@localstack/appinspector-ui 1.0.71 → 1.0.73
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.cjs +2786 -627
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2786 -613
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
|
|
8
|
+
get: (a3, b3) => (typeof require !== "undefined" ? require : a3)[b3]
|
|
9
|
+
}) : x2)(function(x2) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
12
|
+
});
|
|
5
13
|
var __esm = (fn, res) => function __init() {
|
|
6
14
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
7
15
|
};
|
|
16
|
+
var __commonJS = (cb2, mod) => function __require2() {
|
|
17
|
+
return mod || (0, cb2[__getOwnPropNames(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
};
|
|
8
19
|
var __export = (target, all) => {
|
|
9
20
|
for (var name in all)
|
|
10
21
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,6 +28,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
28
|
}
|
|
18
29
|
return to;
|
|
19
30
|
};
|
|
31
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
32
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
33
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
34
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
35
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
36
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
37
|
+
mod
|
|
38
|
+
));
|
|
20
39
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
40
|
|
|
22
41
|
// node_modules/framer-motion/node_modules/@emotion/memoize/dist/memoize.browser.esm.js
|
|
@@ -56,6 +75,297 @@ var init_is_prop_valid_browser_esm = __esm({
|
|
|
56
75
|
}
|
|
57
76
|
});
|
|
58
77
|
|
|
78
|
+
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
79
|
+
var require_use_sync_external_store_shim_development = __commonJS({
|
|
80
|
+
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
|
|
81
|
+
"use strict";
|
|
82
|
+
(function() {
|
|
83
|
+
function is(x2, y) {
|
|
84
|
+
return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
|
|
85
|
+
}
|
|
86
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
87
|
+
didWarnOld18Alpha || void 0 === React124.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
88
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
89
|
+
));
|
|
90
|
+
var value = getSnapshot();
|
|
91
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
92
|
+
var cachedValue = getSnapshot();
|
|
93
|
+
objectIs(value, cachedValue) || (console.error(
|
|
94
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
95
|
+
), didWarnUncachedGetSnapshot = true);
|
|
96
|
+
}
|
|
97
|
+
cachedValue = useState16({
|
|
98
|
+
inst: { value, getSnapshot }
|
|
99
|
+
});
|
|
100
|
+
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
101
|
+
useLayoutEffect2(
|
|
102
|
+
function() {
|
|
103
|
+
inst.value = value;
|
|
104
|
+
inst.getSnapshot = getSnapshot;
|
|
105
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
106
|
+
},
|
|
107
|
+
[subscribe, value, getSnapshot]
|
|
108
|
+
);
|
|
109
|
+
useEffect20(
|
|
110
|
+
function() {
|
|
111
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
112
|
+
return subscribe(function() {
|
|
113
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
[subscribe]
|
|
117
|
+
);
|
|
118
|
+
useDebugValue2(value);
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
function checkIfSnapshotChanged(inst) {
|
|
122
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
123
|
+
inst = inst.value;
|
|
124
|
+
try {
|
|
125
|
+
var nextValue = latestGetSnapshot();
|
|
126
|
+
return !objectIs(inst, nextValue);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
132
|
+
return getSnapshot();
|
|
133
|
+
}
|
|
134
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
135
|
+
var React124 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState16 = React124.useState, useEffect20 = React124.useEffect, useLayoutEffect2 = React124.useLayoutEffect, useDebugValue2 = React124.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
136
|
+
exports.useSyncExternalStore = void 0 !== React124.useSyncExternalStore ? React124.useSyncExternalStore : shim;
|
|
137
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
138
|
+
})();
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// node_modules/use-sync-external-store/shim/index.js
|
|
143
|
+
var require_shim = __commonJS({
|
|
144
|
+
"node_modules/use-sync-external-store/shim/index.js"(exports, module) {
|
|
145
|
+
"use strict";
|
|
146
|
+
if (false) {
|
|
147
|
+
module.exports = null;
|
|
148
|
+
} else {
|
|
149
|
+
module.exports = require_use_sync_external_store_shim_development();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
|
|
155
|
+
var require_with_selector_development = __commonJS({
|
|
156
|
+
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
|
|
157
|
+
"use strict";
|
|
158
|
+
(function() {
|
|
159
|
+
function is(x2, y) {
|
|
160
|
+
return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
|
|
161
|
+
}
|
|
162
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
163
|
+
var React124 = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef15 = React124.useRef, useEffect20 = React124.useEffect, useMemo13 = React124.useMemo, useDebugValue2 = React124.useDebugValue;
|
|
164
|
+
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual) {
|
|
165
|
+
var instRef = useRef15(null);
|
|
166
|
+
if (null === instRef.current) {
|
|
167
|
+
var inst = { hasValue: false, value: null };
|
|
168
|
+
instRef.current = inst;
|
|
169
|
+
} else inst = instRef.current;
|
|
170
|
+
instRef = useMemo13(
|
|
171
|
+
function() {
|
|
172
|
+
function memoizedSelector(nextSnapshot) {
|
|
173
|
+
if (!hasMemo) {
|
|
174
|
+
hasMemo = true;
|
|
175
|
+
memoizedSnapshot = nextSnapshot;
|
|
176
|
+
nextSnapshot = selector2(nextSnapshot);
|
|
177
|
+
if (void 0 !== isEqual && inst.hasValue) {
|
|
178
|
+
var currentSelection = inst.value;
|
|
179
|
+
if (isEqual(currentSelection, nextSnapshot))
|
|
180
|
+
return memoizedSelection = currentSelection;
|
|
181
|
+
}
|
|
182
|
+
return memoizedSelection = nextSnapshot;
|
|
183
|
+
}
|
|
184
|
+
currentSelection = memoizedSelection;
|
|
185
|
+
if (objectIs(memoizedSnapshot, nextSnapshot))
|
|
186
|
+
return currentSelection;
|
|
187
|
+
var nextSelection = selector2(nextSnapshot);
|
|
188
|
+
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
189
|
+
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
190
|
+
memoizedSnapshot = nextSnapshot;
|
|
191
|
+
return memoizedSelection = nextSelection;
|
|
192
|
+
}
|
|
193
|
+
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
194
|
+
return [
|
|
195
|
+
function() {
|
|
196
|
+
return memoizedSelector(getSnapshot());
|
|
197
|
+
},
|
|
198
|
+
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
199
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
200
|
+
}
|
|
201
|
+
];
|
|
202
|
+
},
|
|
203
|
+
[getSnapshot, getServerSnapshot, selector2, isEqual]
|
|
204
|
+
);
|
|
205
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
206
|
+
useEffect20(
|
|
207
|
+
function() {
|
|
208
|
+
inst.hasValue = true;
|
|
209
|
+
inst.value = value;
|
|
210
|
+
},
|
|
211
|
+
[value]
|
|
212
|
+
);
|
|
213
|
+
useDebugValue2(value);
|
|
214
|
+
return value;
|
|
215
|
+
};
|
|
216
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
217
|
+
})();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
// node_modules/use-sync-external-store/shim/with-selector.js
|
|
222
|
+
var require_with_selector = __commonJS({
|
|
223
|
+
"node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
|
|
224
|
+
"use strict";
|
|
225
|
+
if (false) {
|
|
226
|
+
module.exports = null;
|
|
227
|
+
} else {
|
|
228
|
+
module.exports = require_with_selector_development();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// node_modules/toggle-selection/index.js
|
|
234
|
+
var require_toggle_selection = __commonJS({
|
|
235
|
+
"node_modules/toggle-selection/index.js"(exports, module) {
|
|
236
|
+
"use strict";
|
|
237
|
+
module.exports = function() {
|
|
238
|
+
var selection = document.getSelection();
|
|
239
|
+
if (!selection.rangeCount) {
|
|
240
|
+
return function() {
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
var active = document.activeElement;
|
|
244
|
+
var ranges = [];
|
|
245
|
+
for (var i2 = 0; i2 < selection.rangeCount; i2++) {
|
|
246
|
+
ranges.push(selection.getRangeAt(i2));
|
|
247
|
+
}
|
|
248
|
+
switch (active.tagName.toUpperCase()) {
|
|
249
|
+
// .toUpperCase handles XHTML
|
|
250
|
+
case "INPUT":
|
|
251
|
+
case "TEXTAREA":
|
|
252
|
+
active.blur();
|
|
253
|
+
break;
|
|
254
|
+
default:
|
|
255
|
+
active = null;
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
selection.removeAllRanges();
|
|
259
|
+
return function() {
|
|
260
|
+
selection.type === "Caret" && selection.removeAllRanges();
|
|
261
|
+
if (!selection.rangeCount) {
|
|
262
|
+
ranges.forEach(function(range) {
|
|
263
|
+
selection.addRange(range);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
active && active.focus();
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// node_modules/copy-to-clipboard/index.js
|
|
273
|
+
var require_copy_to_clipboard = __commonJS({
|
|
274
|
+
"node_modules/copy-to-clipboard/index.js"(exports, module) {
|
|
275
|
+
"use strict";
|
|
276
|
+
var deselectCurrent = require_toggle_selection();
|
|
277
|
+
var clipboardToIE11Formatting = {
|
|
278
|
+
"text/plain": "Text",
|
|
279
|
+
"text/html": "Url",
|
|
280
|
+
"default": "Text"
|
|
281
|
+
};
|
|
282
|
+
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
283
|
+
function format2(message) {
|
|
284
|
+
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "\u2318" : "Ctrl") + "+C";
|
|
285
|
+
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
286
|
+
}
|
|
287
|
+
function copy(text2, options) {
|
|
288
|
+
var debug2, message, reselectPrevious, range, selection, mark, success = false;
|
|
289
|
+
if (!options) {
|
|
290
|
+
options = {};
|
|
291
|
+
}
|
|
292
|
+
debug2 = options.debug || false;
|
|
293
|
+
try {
|
|
294
|
+
reselectPrevious = deselectCurrent();
|
|
295
|
+
range = document.createRange();
|
|
296
|
+
selection = document.getSelection();
|
|
297
|
+
mark = document.createElement("span");
|
|
298
|
+
mark.textContent = text2;
|
|
299
|
+
mark.ariaHidden = "true";
|
|
300
|
+
mark.style.all = "unset";
|
|
301
|
+
mark.style.position = "fixed";
|
|
302
|
+
mark.style.top = 0;
|
|
303
|
+
mark.style.clip = "rect(0, 0, 0, 0)";
|
|
304
|
+
mark.style.whiteSpace = "pre";
|
|
305
|
+
mark.style.webkitUserSelect = "text";
|
|
306
|
+
mark.style.MozUserSelect = "text";
|
|
307
|
+
mark.style.msUserSelect = "text";
|
|
308
|
+
mark.style.userSelect = "text";
|
|
309
|
+
mark.addEventListener("copy", function(e2) {
|
|
310
|
+
e2.stopPropagation();
|
|
311
|
+
if (options.format) {
|
|
312
|
+
e2.preventDefault();
|
|
313
|
+
if (typeof e2.clipboardData === "undefined") {
|
|
314
|
+
debug2 && console.warn("unable to use e.clipboardData");
|
|
315
|
+
debug2 && console.warn("trying IE specific stuff");
|
|
316
|
+
window.clipboardData.clearData();
|
|
317
|
+
var format3 = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
|
|
318
|
+
window.clipboardData.setData(format3, text2);
|
|
319
|
+
} else {
|
|
320
|
+
e2.clipboardData.clearData();
|
|
321
|
+
e2.clipboardData.setData(options.format, text2);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (options.onCopy) {
|
|
325
|
+
e2.preventDefault();
|
|
326
|
+
options.onCopy(e2.clipboardData);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
document.body.appendChild(mark);
|
|
330
|
+
range.selectNodeContents(mark);
|
|
331
|
+
selection.addRange(range);
|
|
332
|
+
var successful = document.execCommand("copy");
|
|
333
|
+
if (!successful) {
|
|
334
|
+
throw new Error("copy command was unsuccessful");
|
|
335
|
+
}
|
|
336
|
+
success = true;
|
|
337
|
+
} catch (err) {
|
|
338
|
+
debug2 && console.error("unable to copy using execCommand: ", err);
|
|
339
|
+
debug2 && console.warn("trying IE specific stuff");
|
|
340
|
+
try {
|
|
341
|
+
window.clipboardData.setData(options.format || "text", text2);
|
|
342
|
+
options.onCopy && options.onCopy(window.clipboardData);
|
|
343
|
+
success = true;
|
|
344
|
+
} catch (err2) {
|
|
345
|
+
debug2 && console.error("unable to copy using clipboardData: ", err2);
|
|
346
|
+
debug2 && console.error("falling back to prompt");
|
|
347
|
+
message = format2("message" in options ? options.message : defaultMessage);
|
|
348
|
+
window.prompt(message, text2);
|
|
349
|
+
}
|
|
350
|
+
} finally {
|
|
351
|
+
if (selection) {
|
|
352
|
+
if (typeof selection.removeRange == "function") {
|
|
353
|
+
selection.removeRange(range);
|
|
354
|
+
} else {
|
|
355
|
+
selection.removeAllRanges();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (mark) {
|
|
359
|
+
document.body.removeChild(mark);
|
|
360
|
+
}
|
|
361
|
+
reselectPrevious();
|
|
362
|
+
}
|
|
363
|
+
return success;
|
|
364
|
+
}
|
|
365
|
+
module.exports = copy;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
59
369
|
// node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js
|
|
60
370
|
var fromUtf8;
|
|
61
371
|
var init_fromUtf8_browser = __esm({
|
|
@@ -366,8 +676,8 @@ var init_event_streams = __esm({
|
|
|
366
676
|
});
|
|
367
677
|
|
|
368
678
|
// src/pages/spans-list-page.tsx
|
|
369
|
-
import { Box as
|
|
370
|
-
import { useCallback as
|
|
679
|
+
import { Box as Box18 } from "@mui/material";
|
|
680
|
+
import { useCallback as useCallback10, useState as useState15 } from "react";
|
|
371
681
|
|
|
372
682
|
// src/components/spans-list/spans-list.tsx
|
|
373
683
|
import { Alert, Box as Box4, Button as Button2 } from "@mui/material";
|
|
@@ -3228,14 +3538,14 @@ function __values(o2) {
|
|
|
3228
3538
|
function __read(o2, n2) {
|
|
3229
3539
|
var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
|
|
3230
3540
|
if (!m2) return o2;
|
|
3231
|
-
var i2 = m2.call(o2),
|
|
3541
|
+
var i2 = m2.call(o2), r3, ar = [], e2;
|
|
3232
3542
|
try {
|
|
3233
|
-
while ((n2 === void 0 || n2-- > 0) && !(
|
|
3543
|
+
while ((n2 === void 0 || n2-- > 0) && !(r3 = i2.next()).done) ar.push(r3.value);
|
|
3234
3544
|
} catch (error) {
|
|
3235
3545
|
e2 = { error };
|
|
3236
3546
|
} finally {
|
|
3237
3547
|
try {
|
|
3238
|
-
if (
|
|
3548
|
+
if (r3 && !r3.done && (m2 = i2["return"])) m2.call(i2);
|
|
3239
3549
|
} finally {
|
|
3240
3550
|
if (e2) throw e2.error;
|
|
3241
3551
|
}
|
|
@@ -3951,27 +4261,27 @@ var rgba = {
|
|
|
3951
4261
|
|
|
3952
4262
|
// node_modules/style-value-types/dist/es/color/hex.mjs
|
|
3953
4263
|
function parseHex(v2) {
|
|
3954
|
-
let
|
|
4264
|
+
let r3 = "";
|
|
3955
4265
|
let g2 = "";
|
|
3956
4266
|
let b3 = "";
|
|
3957
4267
|
let a3 = "";
|
|
3958
4268
|
if (v2.length > 5) {
|
|
3959
|
-
|
|
4269
|
+
r3 = v2.substr(1, 2);
|
|
3960
4270
|
g2 = v2.substr(3, 2);
|
|
3961
4271
|
b3 = v2.substr(5, 2);
|
|
3962
4272
|
a3 = v2.substr(7, 2);
|
|
3963
4273
|
} else {
|
|
3964
|
-
|
|
4274
|
+
r3 = v2.substr(1, 1);
|
|
3965
4275
|
g2 = v2.substr(2, 1);
|
|
3966
4276
|
b3 = v2.substr(3, 1);
|
|
3967
4277
|
a3 = v2.substr(4, 1);
|
|
3968
|
-
|
|
4278
|
+
r3 += r3;
|
|
3969
4279
|
g2 += g2;
|
|
3970
4280
|
b3 += b3;
|
|
3971
4281
|
a3 += a3;
|
|
3972
4282
|
}
|
|
3973
4283
|
return {
|
|
3974
|
-
red: parseInt(
|
|
4284
|
+
red: parseInt(r3, 16),
|
|
3975
4285
|
green: parseInt(g2, 16),
|
|
3976
4286
|
blue: parseInt(b3, 16),
|
|
3977
4287
|
alpha: a3 ? parseInt(a3, 16) / 255 : 1
|
|
@@ -13843,132 +14153,2012 @@ var useSpans = () => {
|
|
|
13843
14153
|
|
|
13844
14154
|
// src/pages/trace-graph-page.tsx
|
|
13845
14155
|
import { ArrowBack } from "@mui/icons-material";
|
|
13846
|
-
import { Box as
|
|
14156
|
+
import { Box as Box17, Button as Button5, Drawer, Paper as Paper3 } from "@mui/material";
|
|
13847
14157
|
import { styled } from "@mui/material/styles";
|
|
13848
14158
|
import { ReactFlowProvider } from "@xyflow/react";
|
|
13849
|
-
import { useCallback as
|
|
14159
|
+
import { useCallback as useCallback9, useEffect as useEffect19, useRef as useRef14, useState as useState14 } from "react";
|
|
13850
14160
|
|
|
13851
14161
|
// src/components/event-details/event-details.tsx
|
|
13852
|
-
import {
|
|
13853
|
-
import {
|
|
13854
|
-
|
|
13855
|
-
//
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
14162
|
+
import { Close as Close2 } from "@mui/icons-material";
|
|
14163
|
+
import { Box as Box13, Chip as Chip3, Divider as Divider2, FormControlLabel as FormControlLabel2, IconButton as IconButton3, Stack as Stack2, Switch, Typography as Typography9, useTheme as useTheme3 } from "@mui/material";
|
|
14164
|
+
|
|
14165
|
+
// node_modules/@textea/json-viewer/dist/index.mjs
|
|
14166
|
+
import { jsx as jsx129, jsxs as jsxs123, Fragment as Fragment5 } from "react/jsx-runtime";
|
|
14167
|
+
import { Box as Box6, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper as Paper2 } from "@mui/material";
|
|
14168
|
+
import { createContext as createContext9, useContext as useContext16, useState as useState8, useRef as useRef11, useCallback as useCallback8, useMemo as useMemo7, useEffect as useEffect15, memo as memo9 } from "react";
|
|
14169
|
+
|
|
14170
|
+
// node_modules/zustand/esm/vanilla.mjs
|
|
14171
|
+
var createStoreImpl = (createState2) => {
|
|
14172
|
+
let state;
|
|
14173
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
14174
|
+
const setState = (partial, replace) => {
|
|
14175
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
14176
|
+
if (!Object.is(nextState, state)) {
|
|
14177
|
+
const previousState = state;
|
|
14178
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
14179
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
14180
|
+
}
|
|
14181
|
+
};
|
|
14182
|
+
const getState = () => state;
|
|
14183
|
+
const getInitialState = () => initialState;
|
|
14184
|
+
const subscribe = (listener) => {
|
|
14185
|
+
listeners.add(listener);
|
|
14186
|
+
return () => listeners.delete(listener);
|
|
14187
|
+
};
|
|
14188
|
+
const destroy = () => {
|
|
14189
|
+
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
|
14190
|
+
console.warn(
|
|
14191
|
+
"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
|
|
14192
|
+
);
|
|
14193
|
+
}
|
|
14194
|
+
listeners.clear();
|
|
14195
|
+
};
|
|
14196
|
+
const api = { setState, getState, getInitialState, subscribe, destroy };
|
|
14197
|
+
const initialState = state = createState2(setState, getState, api);
|
|
14198
|
+
return api;
|
|
14199
|
+
};
|
|
14200
|
+
var createStore = (createState2) => createState2 ? createStoreImpl(createState2) : createStoreImpl;
|
|
14201
|
+
|
|
14202
|
+
// node_modules/zustand/esm/index.mjs
|
|
14203
|
+
var import_with_selector = __toESM(require_with_selector(), 1);
|
|
14204
|
+
import ReactExports from "react";
|
|
14205
|
+
var { useDebugValue } = ReactExports;
|
|
14206
|
+
var { useSyncExternalStoreWithSelector } = import_with_selector.default;
|
|
14207
|
+
var didWarnAboutEqualityFn = false;
|
|
14208
|
+
var identity = (arg) => arg;
|
|
14209
|
+
function useStore(api, selector2 = identity, equalityFn) {
|
|
14210
|
+
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) {
|
|
14211
|
+
console.warn(
|
|
14212
|
+
"[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"
|
|
14213
|
+
);
|
|
14214
|
+
didWarnAboutEqualityFn = true;
|
|
14215
|
+
}
|
|
14216
|
+
const slice = useSyncExternalStoreWithSelector(
|
|
14217
|
+
api.subscribe,
|
|
14218
|
+
api.getState,
|
|
14219
|
+
api.getServerState || api.getInitialState,
|
|
14220
|
+
selector2,
|
|
14221
|
+
equalityFn
|
|
14222
|
+
);
|
|
14223
|
+
useDebugValue(slice);
|
|
14224
|
+
return slice;
|
|
14225
|
+
}
|
|
14226
|
+
var createImpl = (createState2) => {
|
|
14227
|
+
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && typeof createState2 !== "function") {
|
|
14228
|
+
console.warn(
|
|
14229
|
+
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."
|
|
14230
|
+
);
|
|
13859
14231
|
}
|
|
13860
|
-
|
|
13861
|
-
|
|
14232
|
+
const api = typeof createState2 === "function" ? createStore(createState2) : createState2;
|
|
14233
|
+
const useBoundStore = (selector2, equalityFn) => useStore(api, selector2, equalityFn);
|
|
14234
|
+
Object.assign(useBoundStore, api);
|
|
14235
|
+
return useBoundStore;
|
|
14236
|
+
};
|
|
14237
|
+
var create = (createState2) => createState2 ? createImpl(createState2) : createImpl;
|
|
14238
|
+
|
|
14239
|
+
// node_modules/@textea/json-viewer/dist/index.mjs
|
|
14240
|
+
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
14241
|
+
function r(e2) {
|
|
14242
|
+
var t2, f2, n2 = "";
|
|
14243
|
+
if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
|
|
14244
|
+
else if ("object" == typeof e2) if (Array.isArray(e2)) {
|
|
14245
|
+
var o2 = e2.length;
|
|
14246
|
+
for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
|
|
14247
|
+
} else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2);
|
|
14248
|
+
return n2;
|
|
14249
|
+
}
|
|
14250
|
+
function clsx() {
|
|
14251
|
+
for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2);
|
|
14252
|
+
return n2;
|
|
14253
|
+
}
|
|
14254
|
+
var lightColorspace = {
|
|
14255
|
+
scheme: "Light Theme",
|
|
14256
|
+
author: "mac gainor (https://github.com/mac-s-g)",
|
|
14257
|
+
base00: "rgba(0, 0, 0, 0)",
|
|
14258
|
+
base01: "rgb(245, 245, 245)",
|
|
14259
|
+
base02: "rgb(235, 235, 235)",
|
|
14260
|
+
base03: "#93a1a1",
|
|
14261
|
+
base04: "rgba(0, 0, 0, 0.3)",
|
|
14262
|
+
base05: "#586e75",
|
|
14263
|
+
base06: "#073642",
|
|
14264
|
+
base07: "#002b36",
|
|
14265
|
+
base08: "#d33682",
|
|
14266
|
+
base09: "#cb4b16",
|
|
14267
|
+
base0A: "#ffd500",
|
|
14268
|
+
base0B: "#859900",
|
|
14269
|
+
base0C: "#6c71c4",
|
|
14270
|
+
base0D: "#586e75",
|
|
14271
|
+
base0E: "#2aa198",
|
|
14272
|
+
base0F: "#268bd2"
|
|
14273
|
+
};
|
|
14274
|
+
var darkColorspace = {
|
|
14275
|
+
scheme: "Dark Theme",
|
|
14276
|
+
author: "Chris Kempson (http://chriskempson.com)",
|
|
14277
|
+
base00: "#181818",
|
|
14278
|
+
base01: "#282828",
|
|
14279
|
+
base02: "#383838",
|
|
14280
|
+
base03: "#585858",
|
|
14281
|
+
base04: "#b8b8b8",
|
|
14282
|
+
base05: "#d8d8d8",
|
|
14283
|
+
base06: "#e8e8e8",
|
|
14284
|
+
base07: "#f8f8f8",
|
|
14285
|
+
base08: "#ab4642",
|
|
14286
|
+
base09: "#dc9656",
|
|
14287
|
+
base0A: "#f7ca88",
|
|
14288
|
+
base0B: "#a1b56c",
|
|
14289
|
+
base0C: "#86c1b9",
|
|
14290
|
+
base0D: "#7cafc2",
|
|
14291
|
+
base0E: "#ba8baf",
|
|
14292
|
+
base0F: "#a16946"
|
|
14293
|
+
};
|
|
14294
|
+
var DefaultKeyRenderer = () => null;
|
|
14295
|
+
DefaultKeyRenderer.when = () => false;
|
|
14296
|
+
var createJsonViewerStore = (props) => {
|
|
14297
|
+
return create()((set, get) => {
|
|
14298
|
+
var _props_rootName, _props_indentWidth, _props_keyRenderer, _props_enableAdd, _props_enableDelete, _props_enableClipboard, _props_editable, _props_onChange, _props_onCopy, _props_onSelect, _props_onAdd, _props_onDelete, _props_defaultInspectDepth, _props_defaultInspectControl, _props_maxDisplayLength, _props_groupArraysAfterLength, _props_collapseStringsAfterLength, _props_objectSortKeys, _props_quotesOnKeys, _props_displayDataTypes, _props_displaySize, _props_displayComma, _props_highlightUpdates;
|
|
14299
|
+
return {
|
|
14300
|
+
// provided by user
|
|
14301
|
+
rootName: (_props_rootName = props.rootName) !== null && _props_rootName !== void 0 ? _props_rootName : "root",
|
|
14302
|
+
indentWidth: (_props_indentWidth = props.indentWidth) !== null && _props_indentWidth !== void 0 ? _props_indentWidth : 3,
|
|
14303
|
+
keyRenderer: (_props_keyRenderer = props.keyRenderer) !== null && _props_keyRenderer !== void 0 ? _props_keyRenderer : DefaultKeyRenderer,
|
|
14304
|
+
enableAdd: (_props_enableAdd = props.enableAdd) !== null && _props_enableAdd !== void 0 ? _props_enableAdd : false,
|
|
14305
|
+
enableDelete: (_props_enableDelete = props.enableDelete) !== null && _props_enableDelete !== void 0 ? _props_enableDelete : false,
|
|
14306
|
+
enableClipboard: (_props_enableClipboard = props.enableClipboard) !== null && _props_enableClipboard !== void 0 ? _props_enableClipboard : true,
|
|
14307
|
+
editable: (_props_editable = props.editable) !== null && _props_editable !== void 0 ? _props_editable : false,
|
|
14308
|
+
onChange: (_props_onChange = props.onChange) !== null && _props_onChange !== void 0 ? _props_onChange : () => {
|
|
14309
|
+
},
|
|
14310
|
+
onCopy: (_props_onCopy = props.onCopy) !== null && _props_onCopy !== void 0 ? _props_onCopy : void 0,
|
|
14311
|
+
onSelect: (_props_onSelect = props.onSelect) !== null && _props_onSelect !== void 0 ? _props_onSelect : void 0,
|
|
14312
|
+
onAdd: (_props_onAdd = props.onAdd) !== null && _props_onAdd !== void 0 ? _props_onAdd : void 0,
|
|
14313
|
+
onDelete: (_props_onDelete = props.onDelete) !== null && _props_onDelete !== void 0 ? _props_onDelete : void 0,
|
|
14314
|
+
defaultInspectDepth: (_props_defaultInspectDepth = props.defaultInspectDepth) !== null && _props_defaultInspectDepth !== void 0 ? _props_defaultInspectDepth : 5,
|
|
14315
|
+
defaultInspectControl: (_props_defaultInspectControl = props.defaultInspectControl) !== null && _props_defaultInspectControl !== void 0 ? _props_defaultInspectControl : void 0,
|
|
14316
|
+
maxDisplayLength: (_props_maxDisplayLength = props.maxDisplayLength) !== null && _props_maxDisplayLength !== void 0 ? _props_maxDisplayLength : 30,
|
|
14317
|
+
groupArraysAfterLength: (_props_groupArraysAfterLength = props.groupArraysAfterLength) !== null && _props_groupArraysAfterLength !== void 0 ? _props_groupArraysAfterLength : 100,
|
|
14318
|
+
collapseStringsAfterLength: props.collapseStringsAfterLength === false ? Number.MAX_VALUE : (_props_collapseStringsAfterLength = props.collapseStringsAfterLength) !== null && _props_collapseStringsAfterLength !== void 0 ? _props_collapseStringsAfterLength : 50,
|
|
14319
|
+
objectSortKeys: (_props_objectSortKeys = props.objectSortKeys) !== null && _props_objectSortKeys !== void 0 ? _props_objectSortKeys : false,
|
|
14320
|
+
quotesOnKeys: (_props_quotesOnKeys = props.quotesOnKeys) !== null && _props_quotesOnKeys !== void 0 ? _props_quotesOnKeys : true,
|
|
14321
|
+
displayDataTypes: (_props_displayDataTypes = props.displayDataTypes) !== null && _props_displayDataTypes !== void 0 ? _props_displayDataTypes : true,
|
|
14322
|
+
displaySize: (_props_displaySize = props.displaySize) !== null && _props_displaySize !== void 0 ? _props_displaySize : true,
|
|
14323
|
+
displayComma: (_props_displayComma = props.displayComma) !== null && _props_displayComma !== void 0 ? _props_displayComma : false,
|
|
14324
|
+
highlightUpdates: (_props_highlightUpdates = props.highlightUpdates) !== null && _props_highlightUpdates !== void 0 ? _props_highlightUpdates : false,
|
|
14325
|
+
// internal state
|
|
14326
|
+
inspectCache: {},
|
|
14327
|
+
hoverPath: null,
|
|
14328
|
+
colorspace: lightColorspace,
|
|
14329
|
+
value: props.value,
|
|
14330
|
+
prevValue: void 0,
|
|
14331
|
+
getInspectCache: (path, nestedIndex) => {
|
|
14332
|
+
const target = nestedIndex !== void 0 ? path.join(".") + "[".concat(nestedIndex, "]nt") : path.join(".");
|
|
14333
|
+
return get().inspectCache[target];
|
|
14334
|
+
},
|
|
14335
|
+
setInspectCache: (path, action, nestedIndex) => {
|
|
14336
|
+
const target = nestedIndex !== void 0 ? path.join(".") + "[".concat(nestedIndex, "]nt") : path.join(".");
|
|
14337
|
+
set((state) => ({
|
|
14338
|
+
inspectCache: {
|
|
14339
|
+
...state.inspectCache,
|
|
14340
|
+
[target]: typeof action === "function" ? action(state.inspectCache[target]) : action
|
|
14341
|
+
}
|
|
14342
|
+
}));
|
|
14343
|
+
},
|
|
14344
|
+
setHover: (path, nestedIndex) => {
|
|
14345
|
+
set({
|
|
14346
|
+
hoverPath: path ? {
|
|
14347
|
+
path,
|
|
14348
|
+
nestedIndex
|
|
14349
|
+
} : null
|
|
14350
|
+
});
|
|
14351
|
+
}
|
|
14352
|
+
};
|
|
14353
|
+
});
|
|
14354
|
+
};
|
|
14355
|
+
var JsonViewerStoreContext = createContext9(void 0);
|
|
14356
|
+
JsonViewerStoreContext.Provider;
|
|
14357
|
+
var useJsonViewerStore = (selector2, equalityFn) => {
|
|
14358
|
+
const store = useContext16(JsonViewerStoreContext);
|
|
14359
|
+
return useStore(store, selector2, equalityFn);
|
|
14360
|
+
};
|
|
14361
|
+
var useTextColor = () => {
|
|
14362
|
+
return useJsonViewerStore((store) => store.colorspace.base07);
|
|
14363
|
+
};
|
|
14364
|
+
var objectCtorString = Object.prototype.constructor.toString();
|
|
14365
|
+
function isPlainObject(value) {
|
|
14366
|
+
if (!value || typeof value !== "object") return false;
|
|
14367
|
+
const proto = Object.getPrototypeOf(value);
|
|
14368
|
+
if (proto === null) return true;
|
|
14369
|
+
const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
14370
|
+
if (Ctor === Object) return true;
|
|
14371
|
+
return typeof Ctor === "function" && Function.toString.call(Ctor) === objectCtorString;
|
|
14372
|
+
}
|
|
14373
|
+
var isCycleReference = (root, path, value) => {
|
|
14374
|
+
if (root === null || value === null) {
|
|
14375
|
+
return false;
|
|
13862
14376
|
}
|
|
13863
|
-
if (
|
|
13864
|
-
return
|
|
14377
|
+
if (typeof root !== "object") {
|
|
14378
|
+
return false;
|
|
13865
14379
|
}
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
14380
|
+
if (typeof value !== "object") {
|
|
14381
|
+
return false;
|
|
14382
|
+
}
|
|
14383
|
+
if (Object.is(root, value) && path.length !== 0) {
|
|
14384
|
+
return "";
|
|
14385
|
+
}
|
|
14386
|
+
const currentPath = [];
|
|
14387
|
+
const arr = [
|
|
14388
|
+
...path
|
|
14389
|
+
];
|
|
14390
|
+
let currentRoot = root;
|
|
14391
|
+
while (currentRoot !== value || arr.length !== 0) {
|
|
14392
|
+
if (typeof currentRoot !== "object" || currentRoot === null) {
|
|
14393
|
+
return false;
|
|
13878
14394
|
}
|
|
13879
|
-
|
|
13880
|
-
return
|
|
14395
|
+
if (Object.is(currentRoot, value)) {
|
|
14396
|
+
return currentPath.reduce((path2, value2, currentIndex) => {
|
|
14397
|
+
if (typeof value2 === "number") {
|
|
14398
|
+
return path2 + "[".concat(value2, "]");
|
|
14399
|
+
}
|
|
14400
|
+
return path2 + "".concat(currentIndex === 0 ? "" : ".").concat(value2);
|
|
14401
|
+
}, "");
|
|
13881
14402
|
}
|
|
14403
|
+
const target = arr.shift();
|
|
14404
|
+
currentPath.push(target);
|
|
14405
|
+
currentRoot = currentRoot[target];
|
|
14406
|
+
}
|
|
14407
|
+
return false;
|
|
14408
|
+
};
|
|
14409
|
+
function getValueSize(value) {
|
|
14410
|
+
if (value === null || void 0) {
|
|
14411
|
+
return 0;
|
|
14412
|
+
} else if (Array.isArray(value)) {
|
|
14413
|
+
return value.length;
|
|
14414
|
+
} else if (value instanceof Map || value instanceof Set) {
|
|
14415
|
+
return value.size;
|
|
14416
|
+
} else if (value instanceof Date) {
|
|
14417
|
+
return 1;
|
|
14418
|
+
} else if (typeof value === "object") {
|
|
14419
|
+
return Object.keys(value).length;
|
|
14420
|
+
} else if (typeof value === "string") {
|
|
14421
|
+
return value.length;
|
|
13882
14422
|
}
|
|
14423
|
+
return 1;
|
|
13883
14424
|
}
|
|
13884
|
-
function
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
|
|
13889
|
-
|
|
13890
|
-
case "explicitly_denied": {
|
|
13891
|
-
return "error.main";
|
|
13892
|
-
}
|
|
13893
|
-
case "implicitly_denied": {
|
|
13894
|
-
return "warning.main";
|
|
13895
|
-
}
|
|
14425
|
+
function segmentArray(arr, size) {
|
|
14426
|
+
const result = [];
|
|
14427
|
+
let index2 = 0;
|
|
14428
|
+
while (index2 < arr.length) {
|
|
14429
|
+
result.push(arr.slice(index2, index2 + size));
|
|
14430
|
+
index2 += size;
|
|
13896
14431
|
}
|
|
14432
|
+
return result;
|
|
13897
14433
|
}
|
|
13898
|
-
function
|
|
13899
|
-
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
14434
|
+
function safeStringify(obj, space) {
|
|
14435
|
+
const seenValues = [];
|
|
14436
|
+
function replacer(key, value) {
|
|
14437
|
+
if (typeof value === "bigint") return value.toString();
|
|
14438
|
+
if (value instanceof Map) {
|
|
14439
|
+
if ("toJSON" in value && typeof value.toJSON === "function") return value.toJSON();
|
|
14440
|
+
if (value.size === 0) return {};
|
|
14441
|
+
if (seenValues.includes(value)) return "[Circular]";
|
|
14442
|
+
seenValues.push(value);
|
|
14443
|
+
const entries = Array.from(value.entries());
|
|
14444
|
+
if (entries.every((param) => {
|
|
14445
|
+
let [key2] = param;
|
|
14446
|
+
return typeof key2 === "string" || typeof key2 === "number";
|
|
14447
|
+
})) {
|
|
14448
|
+
return Object.fromEntries(entries);
|
|
13908
14449
|
}
|
|
14450
|
+
return {};
|
|
13909
14451
|
}
|
|
13910
|
-
if (
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
14452
|
+
if (value instanceof Set) {
|
|
14453
|
+
if ("toJSON" in value && typeof value.toJSON === "function") return value.toJSON();
|
|
14454
|
+
if (seenValues.includes(value)) return "[Circular]";
|
|
14455
|
+
seenValues.push(value);
|
|
14456
|
+
return Array.from(value.values());
|
|
14457
|
+
}
|
|
14458
|
+
if (typeof value === "object" && value !== null && Object.keys(value).length) {
|
|
14459
|
+
const stackSize = seenValues.length;
|
|
14460
|
+
if (stackSize) {
|
|
14461
|
+
for (let n2 = stackSize - 1; n2 >= 0 && seenValues[n2][key] !== value; --n2) {
|
|
14462
|
+
seenValues.pop();
|
|
14463
|
+
}
|
|
14464
|
+
if (seenValues.includes(value)) return "[Circular]";
|
|
13914
14465
|
}
|
|
14466
|
+
seenValues.push(value);
|
|
13915
14467
|
}
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
14468
|
+
return value;
|
|
14469
|
+
}
|
|
14470
|
+
return JSON.stringify(obj, replacer, space);
|
|
14471
|
+
}
|
|
14472
|
+
async function copyString(value) {
|
|
14473
|
+
if ("clipboard" in navigator) {
|
|
14474
|
+
try {
|
|
14475
|
+
await navigator.clipboard.writeText(value);
|
|
14476
|
+
} catch {
|
|
13921
14477
|
}
|
|
13922
|
-
return {
|
|
13923
|
-
details: {
|
|
13924
|
-
actions,
|
|
13925
|
-
explicitAllows: payload.explicit_allow_count,
|
|
13926
|
-
explicitDenies: payload.explicit_deny_count,
|
|
13927
|
-
implicitDenies: payload.implicit_deny_count,
|
|
13928
|
-
resources
|
|
13929
|
-
},
|
|
13930
|
-
operation: payload.operation,
|
|
13931
|
-
permission,
|
|
13932
|
-
principal: payload.principal_arn,
|
|
13933
|
-
service: payload.service
|
|
13934
|
-
};
|
|
13935
|
-
} catch (error) {
|
|
13936
|
-
console.error("Error parsing IAM event payload:", error);
|
|
13937
|
-
return void 0;
|
|
13938
14478
|
}
|
|
14479
|
+
(0, import_copy_to_clipboard.default)(value);
|
|
13939
14480
|
}
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
|
|
14481
|
+
function useClipboard() {
|
|
14482
|
+
let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
14483
|
+
const [copied, setCopied] = useState8(false);
|
|
14484
|
+
const copyTimeout = useRef11(null);
|
|
14485
|
+
const handleCopyResult = useCallback8((value) => {
|
|
14486
|
+
const current = copyTimeout.current;
|
|
14487
|
+
if (current) {
|
|
14488
|
+
window.clearTimeout(current);
|
|
14489
|
+
}
|
|
14490
|
+
copyTimeout.current = window.setTimeout(() => setCopied(false), timeout);
|
|
14491
|
+
setCopied(value);
|
|
14492
|
+
}, [
|
|
14493
|
+
timeout
|
|
14494
|
+
]);
|
|
14495
|
+
const onCopy = useJsonViewerStore((store) => store.onCopy);
|
|
14496
|
+
const copy = useCallback8(async (path, value) => {
|
|
14497
|
+
if (typeof onCopy === "function") {
|
|
14498
|
+
try {
|
|
14499
|
+
await onCopy(path, value, copyString);
|
|
14500
|
+
handleCopyResult(true);
|
|
14501
|
+
} catch (error) {
|
|
14502
|
+
console.error("error when copy ".concat(path.length === 0 ? "src" : "src[".concat(path.join(".")), "]"), error);
|
|
13960
14503
|
}
|
|
13961
|
-
|
|
13962
|
-
|
|
14504
|
+
} else {
|
|
14505
|
+
try {
|
|
14506
|
+
const valueToCopy = safeStringify(typeof value === "function" ? value.toString() : value, " ");
|
|
14507
|
+
await copyString(valueToCopy);
|
|
14508
|
+
handleCopyResult(true);
|
|
14509
|
+
} catch (error) {
|
|
14510
|
+
console.error("error when copy ".concat(path.length === 0 ? "src" : "src[".concat(path.join(".")), "]"), error);
|
|
13963
14511
|
}
|
|
13964
|
-
return {
|
|
13965
|
-
details: detailsParts.join("\n"),
|
|
13966
|
-
headline: headline2,
|
|
13967
|
-
message: messageParts.join("\n")
|
|
13968
|
-
};
|
|
13969
14512
|
}
|
|
14513
|
+
}, [
|
|
14514
|
+
handleCopyResult,
|
|
14515
|
+
onCopy
|
|
14516
|
+
]);
|
|
14517
|
+
const reset = useCallback8(() => {
|
|
14518
|
+
setCopied(false);
|
|
14519
|
+
if (copyTimeout.current) {
|
|
14520
|
+
clearTimeout(copyTimeout.current);
|
|
14521
|
+
}
|
|
14522
|
+
}, []);
|
|
14523
|
+
return {
|
|
14524
|
+
copy,
|
|
14525
|
+
reset,
|
|
14526
|
+
copied
|
|
14527
|
+
};
|
|
14528
|
+
}
|
|
14529
|
+
function useIsCycleReference(path, value) {
|
|
14530
|
+
const rootValue = useJsonViewerStore((store) => store.value);
|
|
14531
|
+
return useMemo7(() => isCycleReference(rootValue, path, value), [
|
|
14532
|
+
path,
|
|
14533
|
+
value,
|
|
14534
|
+
rootValue
|
|
14535
|
+
]);
|
|
14536
|
+
}
|
|
14537
|
+
function useInspect(path, value, nestedIndex) {
|
|
14538
|
+
const depth = path.length;
|
|
14539
|
+
const isTrap = useIsCycleReference(path, value);
|
|
14540
|
+
const getInspectCache = useJsonViewerStore((store) => store.getInspectCache);
|
|
14541
|
+
const setInspectCache = useJsonViewerStore((store) => store.setInspectCache);
|
|
14542
|
+
const defaultInspectDepth = useJsonViewerStore((store) => store.defaultInspectDepth);
|
|
14543
|
+
const defaultInspectControl = useJsonViewerStore((store) => store.defaultInspectControl);
|
|
14544
|
+
useEffect15(() => {
|
|
14545
|
+
const inspect2 = getInspectCache(path, nestedIndex);
|
|
14546
|
+
if (inspect2 !== void 0) {
|
|
14547
|
+
return;
|
|
14548
|
+
}
|
|
14549
|
+
if (nestedIndex !== void 0) {
|
|
14550
|
+
setInspectCache(path, false, nestedIndex);
|
|
14551
|
+
return;
|
|
14552
|
+
}
|
|
14553
|
+
const shouldInspect = isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
|
|
14554
|
+
setInspectCache(path, shouldInspect);
|
|
14555
|
+
}, [
|
|
14556
|
+
defaultInspectDepth,
|
|
14557
|
+
defaultInspectControl,
|
|
14558
|
+
depth,
|
|
14559
|
+
getInspectCache,
|
|
14560
|
+
isTrap,
|
|
14561
|
+
nestedIndex,
|
|
14562
|
+
path,
|
|
14563
|
+
value,
|
|
14564
|
+
setInspectCache
|
|
14565
|
+
]);
|
|
14566
|
+
const [inspect, set] = useState8(() => {
|
|
14567
|
+
const shouldInspect = getInspectCache(path, nestedIndex);
|
|
14568
|
+
if (shouldInspect !== void 0) {
|
|
14569
|
+
return shouldInspect;
|
|
14570
|
+
}
|
|
14571
|
+
if (nestedIndex !== void 0) {
|
|
14572
|
+
return false;
|
|
14573
|
+
}
|
|
14574
|
+
return isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
|
|
14575
|
+
});
|
|
14576
|
+
const setInspect = useCallback8((apply) => {
|
|
14577
|
+
set((oldState) => {
|
|
14578
|
+
const newState = typeof apply === "boolean" ? apply : apply(oldState);
|
|
14579
|
+
setInspectCache(path, newState, nestedIndex);
|
|
14580
|
+
return newState;
|
|
14581
|
+
});
|
|
14582
|
+
}, [
|
|
14583
|
+
nestedIndex,
|
|
14584
|
+
path,
|
|
14585
|
+
setInspectCache
|
|
14586
|
+
]);
|
|
14587
|
+
return [
|
|
14588
|
+
inspect,
|
|
14589
|
+
setInspect
|
|
14590
|
+
];
|
|
14591
|
+
}
|
|
14592
|
+
var DataBox = (props) => /* @__PURE__ */ jsx129(Box6, {
|
|
14593
|
+
component: "div",
|
|
14594
|
+
...props,
|
|
14595
|
+
sx: {
|
|
14596
|
+
display: "inline-block",
|
|
14597
|
+
...props.sx
|
|
13970
14598
|
}
|
|
13971
|
-
|
|
14599
|
+
});
|
|
14600
|
+
var DataTypeLabel = (param) => {
|
|
14601
|
+
let { dataType, enable = true } = param;
|
|
14602
|
+
if (!enable) return null;
|
|
14603
|
+
return /* @__PURE__ */ jsx129(DataBox, {
|
|
14604
|
+
className: "data-type-label",
|
|
14605
|
+
sx: {
|
|
14606
|
+
mx: 0.5,
|
|
14607
|
+
fontSize: "0.7rem",
|
|
14608
|
+
opacity: 0.8,
|
|
14609
|
+
userSelect: "none"
|
|
14610
|
+
},
|
|
14611
|
+
children: dataType
|
|
14612
|
+
});
|
|
14613
|
+
};
|
|
14614
|
+
function defineEasyType(param) {
|
|
14615
|
+
let { is, serialize, deserialize, type, colorKey, displayTypeLabel = true, Renderer } = param;
|
|
14616
|
+
const Render = /* @__PURE__ */ memo9(Renderer);
|
|
14617
|
+
const EasyType = (props) => {
|
|
14618
|
+
const storeDisplayDataTypes = useJsonViewerStore((store) => store.displayDataTypes);
|
|
14619
|
+
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
14620
|
+
const onSelect = useJsonViewerStore((store) => store.onSelect);
|
|
14621
|
+
return /* @__PURE__ */ jsxs123(DataBox, {
|
|
14622
|
+
onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(props.path, props.value),
|
|
14623
|
+
sx: {
|
|
14624
|
+
color: color2
|
|
14625
|
+
},
|
|
14626
|
+
children: [
|
|
14627
|
+
displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ jsx129(DataTypeLabel, {
|
|
14628
|
+
dataType: type
|
|
14629
|
+
}),
|
|
14630
|
+
/* @__PURE__ */ jsx129(DataBox, {
|
|
14631
|
+
className: "".concat(type, "-value"),
|
|
14632
|
+
children: /* @__PURE__ */ jsx129(Render, {
|
|
14633
|
+
path: props.path,
|
|
14634
|
+
inspect: props.inspect,
|
|
14635
|
+
setInspect: props.setInspect,
|
|
14636
|
+
value: props.value,
|
|
14637
|
+
prevValue: props.prevValue
|
|
14638
|
+
})
|
|
14639
|
+
})
|
|
14640
|
+
]
|
|
14641
|
+
});
|
|
14642
|
+
};
|
|
14643
|
+
EasyType.displayName = "easy-".concat(type, "-type");
|
|
14644
|
+
if (!serialize || !deserialize) {
|
|
14645
|
+
return {
|
|
14646
|
+
is,
|
|
14647
|
+
Component: EasyType
|
|
14648
|
+
};
|
|
14649
|
+
}
|
|
14650
|
+
const EasyTypeEditor = (param2) => {
|
|
14651
|
+
let { value, setValue, abortEditing, commitEditing } = param2;
|
|
14652
|
+
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
14653
|
+
const handleKeyDown = useCallback8((event) => {
|
|
14654
|
+
if (event.key === "Enter") {
|
|
14655
|
+
event.preventDefault();
|
|
14656
|
+
commitEditing(value);
|
|
14657
|
+
}
|
|
14658
|
+
if (event.key === "Escape") {
|
|
14659
|
+
event.preventDefault();
|
|
14660
|
+
abortEditing();
|
|
14661
|
+
}
|
|
14662
|
+
}, [
|
|
14663
|
+
abortEditing,
|
|
14664
|
+
commitEditing,
|
|
14665
|
+
value
|
|
14666
|
+
]);
|
|
14667
|
+
const handleChange = useCallback8((event) => {
|
|
14668
|
+
setValue(event.target.value);
|
|
14669
|
+
}, [
|
|
14670
|
+
setValue
|
|
14671
|
+
]);
|
|
14672
|
+
return /* @__PURE__ */ jsx129(InputBase, {
|
|
14673
|
+
autoFocus: true,
|
|
14674
|
+
value,
|
|
14675
|
+
onChange: handleChange,
|
|
14676
|
+
onKeyDown: handleKeyDown,
|
|
14677
|
+
size: "small",
|
|
14678
|
+
multiline: true,
|
|
14679
|
+
sx: {
|
|
14680
|
+
color: color2,
|
|
14681
|
+
padding: 0.5,
|
|
14682
|
+
borderStyle: "solid",
|
|
14683
|
+
borderColor: "black",
|
|
14684
|
+
borderWidth: 1,
|
|
14685
|
+
fontSize: "0.8rem",
|
|
14686
|
+
fontFamily: "monospace",
|
|
14687
|
+
display: "inline-flex"
|
|
14688
|
+
}
|
|
14689
|
+
});
|
|
14690
|
+
};
|
|
14691
|
+
EasyTypeEditor.displayName = "easy-".concat(type, "-type-editor");
|
|
14692
|
+
return {
|
|
14693
|
+
is,
|
|
14694
|
+
serialize,
|
|
14695
|
+
deserialize,
|
|
14696
|
+
Component: EasyType,
|
|
14697
|
+
Editor: EasyTypeEditor
|
|
14698
|
+
};
|
|
14699
|
+
}
|
|
14700
|
+
var booleanType = defineEasyType({
|
|
14701
|
+
is: (value) => typeof value === "boolean",
|
|
14702
|
+
type: "bool",
|
|
14703
|
+
colorKey: "base0E",
|
|
14704
|
+
serialize: (value) => value.toString(),
|
|
14705
|
+
deserialize: (value) => {
|
|
14706
|
+
if (value === "true") return true;
|
|
14707
|
+
if (value === "false") return false;
|
|
14708
|
+
throw new Error("Invalid boolean value");
|
|
14709
|
+
},
|
|
14710
|
+
Renderer: (param) => {
|
|
14711
|
+
let { value } = param;
|
|
14712
|
+
return /* @__PURE__ */ jsx129(Fragment5, {
|
|
14713
|
+
children: value ? "true" : "false"
|
|
14714
|
+
});
|
|
14715
|
+
}
|
|
14716
|
+
});
|
|
14717
|
+
var displayOptions = {
|
|
14718
|
+
weekday: "short",
|
|
14719
|
+
year: "numeric",
|
|
14720
|
+
month: "short",
|
|
14721
|
+
day: "numeric",
|
|
14722
|
+
hour: "2-digit",
|
|
14723
|
+
minute: "2-digit"
|
|
14724
|
+
};
|
|
14725
|
+
var dateType = defineEasyType({
|
|
14726
|
+
is: (value) => value instanceof Date,
|
|
14727
|
+
type: "date",
|
|
14728
|
+
colorKey: "base0D",
|
|
14729
|
+
Renderer: (param) => {
|
|
14730
|
+
let { value } = param;
|
|
14731
|
+
return /* @__PURE__ */ jsx129(Fragment5, {
|
|
14732
|
+
children: value.toLocaleTimeString("en-us", displayOptions)
|
|
14733
|
+
});
|
|
14734
|
+
}
|
|
14735
|
+
});
|
|
14736
|
+
var functionBody = (func) => {
|
|
14737
|
+
const funcString = func.toString();
|
|
14738
|
+
let isUsualFunction = true;
|
|
14739
|
+
const parenthesisPos = funcString.indexOf(")");
|
|
14740
|
+
const arrowPos = funcString.indexOf("=>");
|
|
14741
|
+
if (arrowPos !== -1 && arrowPos > parenthesisPos) {
|
|
14742
|
+
isUsualFunction = false;
|
|
14743
|
+
}
|
|
14744
|
+
if (isUsualFunction) {
|
|
14745
|
+
return funcString.substring(funcString.indexOf("{", parenthesisPos) + 1, funcString.lastIndexOf("}"));
|
|
14746
|
+
}
|
|
14747
|
+
return funcString.substring(funcString.indexOf("=>") + 2);
|
|
14748
|
+
};
|
|
14749
|
+
var functionName = (func) => {
|
|
14750
|
+
const funcString = func.toString();
|
|
14751
|
+
const isUsualFunction = funcString.indexOf("function") !== -1;
|
|
14752
|
+
if (isUsualFunction) {
|
|
14753
|
+
return funcString.substring(8, funcString.indexOf("{")).trim();
|
|
14754
|
+
}
|
|
14755
|
+
return funcString.substring(0, funcString.indexOf("=>") + 2).trim();
|
|
14756
|
+
};
|
|
14757
|
+
var lb = "{";
|
|
14758
|
+
var rb = "}";
|
|
14759
|
+
var PreFunctionType = (props) => {
|
|
14760
|
+
return /* @__PURE__ */ jsxs123(NoSsr, {
|
|
14761
|
+
children: [
|
|
14762
|
+
/* @__PURE__ */ jsx129(DataTypeLabel, {
|
|
14763
|
+
dataType: "function"
|
|
14764
|
+
}),
|
|
14765
|
+
/* @__PURE__ */ jsxs123(Box6, {
|
|
14766
|
+
component: "span",
|
|
14767
|
+
className: "data-function-start",
|
|
14768
|
+
sx: {
|
|
14769
|
+
letterSpacing: 0.5
|
|
14770
|
+
},
|
|
14771
|
+
children: [
|
|
14772
|
+
functionName(props.value),
|
|
14773
|
+
" ",
|
|
14774
|
+
lb
|
|
14775
|
+
]
|
|
14776
|
+
})
|
|
14777
|
+
]
|
|
14778
|
+
});
|
|
14779
|
+
};
|
|
14780
|
+
var PostFunctionType = () => {
|
|
14781
|
+
return /* @__PURE__ */ jsx129(NoSsr, {
|
|
14782
|
+
children: /* @__PURE__ */ jsx129(Box6, {
|
|
14783
|
+
component: "span",
|
|
14784
|
+
className: "data-function-end",
|
|
14785
|
+
children: rb
|
|
14786
|
+
})
|
|
14787
|
+
});
|
|
14788
|
+
};
|
|
14789
|
+
var FunctionType = (props) => {
|
|
14790
|
+
const functionColor = useJsonViewerStore((store) => store.colorspace.base05);
|
|
14791
|
+
return /* @__PURE__ */ jsx129(NoSsr, {
|
|
14792
|
+
children: /* @__PURE__ */ jsx129(Box6, {
|
|
14793
|
+
className: "data-function",
|
|
14794
|
+
sx: {
|
|
14795
|
+
display: props.inspect ? "block" : "inline-block",
|
|
14796
|
+
pl: props.inspect ? 2 : 0,
|
|
14797
|
+
color: functionColor
|
|
14798
|
+
},
|
|
14799
|
+
children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ jsx129(Box6, {
|
|
14800
|
+
component: "span",
|
|
14801
|
+
className: "data-function-body",
|
|
14802
|
+
onClick: () => props.setInspect(true),
|
|
14803
|
+
sx: {
|
|
14804
|
+
"&:hover": {
|
|
14805
|
+
cursor: "pointer"
|
|
14806
|
+
},
|
|
14807
|
+
padding: 0.5
|
|
14808
|
+
},
|
|
14809
|
+
children: "\u2026"
|
|
14810
|
+
})
|
|
14811
|
+
})
|
|
14812
|
+
});
|
|
14813
|
+
};
|
|
14814
|
+
var functionType = {
|
|
14815
|
+
is: (value) => typeof value === "function",
|
|
14816
|
+
Component: FunctionType,
|
|
14817
|
+
PreComponent: PreFunctionType,
|
|
14818
|
+
PostComponent: PostFunctionType
|
|
14819
|
+
};
|
|
14820
|
+
var nullType = defineEasyType({
|
|
14821
|
+
is: (value) => value === null,
|
|
14822
|
+
type: "null",
|
|
14823
|
+
colorKey: "base08",
|
|
14824
|
+
displayTypeLabel: false,
|
|
14825
|
+
Renderer: () => {
|
|
14826
|
+
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
14827
|
+
return /* @__PURE__ */ jsx129(Box6, {
|
|
14828
|
+
sx: {
|
|
14829
|
+
fontSize: "0.8rem",
|
|
14830
|
+
backgroundColor,
|
|
14831
|
+
fontWeight: "bold",
|
|
14832
|
+
borderRadius: "3px",
|
|
14833
|
+
padding: "0.5px 2px"
|
|
14834
|
+
},
|
|
14835
|
+
children: "NULL"
|
|
14836
|
+
});
|
|
14837
|
+
}
|
|
14838
|
+
});
|
|
14839
|
+
var isInt = (n2) => n2 % 1 === 0;
|
|
14840
|
+
var nanType = defineEasyType({
|
|
14841
|
+
is: (value) => typeof value === "number" && isNaN(value),
|
|
14842
|
+
type: "NaN",
|
|
14843
|
+
colorKey: "base08",
|
|
14844
|
+
displayTypeLabel: false,
|
|
14845
|
+
serialize: () => "NaN",
|
|
14846
|
+
// allow deserialize the value back to number
|
|
14847
|
+
deserialize: (value) => parseFloat(value),
|
|
14848
|
+
Renderer: () => {
|
|
14849
|
+
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
14850
|
+
return /* @__PURE__ */ jsx129(Box6, {
|
|
14851
|
+
sx: {
|
|
14852
|
+
backgroundColor,
|
|
14853
|
+
fontSize: "0.8rem",
|
|
14854
|
+
fontWeight: "bold",
|
|
14855
|
+
borderRadius: "3px",
|
|
14856
|
+
padding: "0.5px 2px"
|
|
14857
|
+
},
|
|
14858
|
+
children: "NaN"
|
|
14859
|
+
});
|
|
14860
|
+
}
|
|
14861
|
+
});
|
|
14862
|
+
var floatType = defineEasyType({
|
|
14863
|
+
is: (value) => typeof value === "number" && !isInt(value) && !isNaN(value),
|
|
14864
|
+
type: "float",
|
|
14865
|
+
colorKey: "base0B",
|
|
14866
|
+
serialize: (value) => value.toString(),
|
|
14867
|
+
deserialize: (value) => parseFloat(value),
|
|
14868
|
+
Renderer: (param) => {
|
|
14869
|
+
let { value } = param;
|
|
14870
|
+
return /* @__PURE__ */ jsx129(Fragment5, {
|
|
14871
|
+
children: value
|
|
14872
|
+
});
|
|
14873
|
+
}
|
|
14874
|
+
});
|
|
14875
|
+
var intType = defineEasyType({
|
|
14876
|
+
is: (value) => typeof value === "number" && isInt(value),
|
|
14877
|
+
type: "int",
|
|
14878
|
+
colorKey: "base0F",
|
|
14879
|
+
serialize: (value) => value.toString(),
|
|
14880
|
+
// allow deserialize the value to float
|
|
14881
|
+
deserialize: (value) => parseFloat(value),
|
|
14882
|
+
Renderer: (param) => {
|
|
14883
|
+
let { value } = param;
|
|
14884
|
+
return /* @__PURE__ */ jsx129(Fragment5, {
|
|
14885
|
+
children: value
|
|
14886
|
+
});
|
|
14887
|
+
}
|
|
14888
|
+
});
|
|
14889
|
+
var bigIntType = defineEasyType({
|
|
14890
|
+
is: (value) => typeof value === "bigint",
|
|
14891
|
+
type: "bigint",
|
|
14892
|
+
colorKey: "base0F",
|
|
14893
|
+
serialize: (value) => value.toString(),
|
|
14894
|
+
deserialize: (value) => BigInt(value.replace(/\D/g, "")),
|
|
14895
|
+
Renderer: (param) => {
|
|
14896
|
+
let { value } = param;
|
|
14897
|
+
return /* @__PURE__ */ jsx129(Fragment5, {
|
|
14898
|
+
children: "".concat(value, "n")
|
|
14899
|
+
});
|
|
14900
|
+
}
|
|
14901
|
+
});
|
|
14902
|
+
var BaseIcon = (param) => {
|
|
14903
|
+
let { d: d2, ...props } = param;
|
|
14904
|
+
return /* @__PURE__ */ jsx129(SvgIcon, {
|
|
14905
|
+
...props,
|
|
14906
|
+
children: /* @__PURE__ */ jsx129("path", {
|
|
14907
|
+
d: d2
|
|
14908
|
+
})
|
|
14909
|
+
});
|
|
14910
|
+
};
|
|
14911
|
+
var AddBox = "M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zm-8-2h2v-4h4v-2h-4V7h-2v4H7v2h4z";
|
|
14912
|
+
var Check = "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z";
|
|
14913
|
+
var ChevronRight = "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z";
|
|
14914
|
+
var CircularArrows = "M 12 2 C 10.615 1.998 9.214625 2.2867656 7.890625 2.8847656 L 8.9003906 4.6328125 C 9.9043906 4.2098125 10.957 3.998 12 4 C 15.080783 4 17.738521 5.7633175 19.074219 8.3222656 L 17.125 9 L 21.25 11 L 22.875 7 L 20.998047 7.6523438 C 19.377701 4.3110398 15.95585 2 12 2 z M 6.5097656 4.4882812 L 2.2324219 5.0820312 L 3.734375 6.3808594 C 1.6515335 9.4550558 1.3615962 13.574578 3.3398438 17 C 4.0308437 18.201 4.9801562 19.268234 6.1601562 20.115234 L 7.1699219 18.367188 C 6.3019219 17.710187 5.5922656 16.904 5.0722656 16 C 3.5320014 13.332354 3.729203 10.148679 5.2773438 7.7128906 L 6.8398438 9.0625 L 6.5097656 4.4882812 z M 19.929688 13 C 19.794687 14.08 19.450734 15.098 18.927734 16 C 17.386985 18.668487 14.531361 20.090637 11.646484 19.966797 L 12.035156 17.9375 L 8.2402344 20.511719 L 10.892578 23.917969 L 11.265625 21.966797 C 14.968963 22.233766 18.681899 20.426323 20.660156 17 C 21.355156 15.801 21.805219 14.445 21.949219 13 L 19.929688 13 z";
|
|
14915
|
+
var Close = "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";
|
|
14916
|
+
var ContentCopy = "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z";
|
|
14917
|
+
var Edit = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z";
|
|
14918
|
+
var ExpandMore = "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z";
|
|
14919
|
+
var Delete = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z";
|
|
14920
|
+
var AddBoxIcon = (props) => {
|
|
14921
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14922
|
+
d: AddBox,
|
|
14923
|
+
...props
|
|
14924
|
+
});
|
|
14925
|
+
};
|
|
14926
|
+
var CheckIcon = (props) => {
|
|
14927
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14928
|
+
d: Check,
|
|
14929
|
+
...props
|
|
14930
|
+
});
|
|
14931
|
+
};
|
|
14932
|
+
var ChevronRightIcon = (props) => {
|
|
14933
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14934
|
+
d: ChevronRight,
|
|
14935
|
+
...props
|
|
14936
|
+
});
|
|
14937
|
+
};
|
|
14938
|
+
var CircularArrowsIcon = (props) => {
|
|
14939
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14940
|
+
d: CircularArrows,
|
|
14941
|
+
...props
|
|
14942
|
+
});
|
|
14943
|
+
};
|
|
14944
|
+
var CloseIcon = (props) => {
|
|
14945
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14946
|
+
d: Close,
|
|
14947
|
+
...props
|
|
14948
|
+
});
|
|
14949
|
+
};
|
|
14950
|
+
var ContentCopyIcon = (props) => {
|
|
14951
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14952
|
+
d: ContentCopy,
|
|
14953
|
+
...props
|
|
14954
|
+
});
|
|
14955
|
+
};
|
|
14956
|
+
var EditIcon = (props) => {
|
|
14957
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14958
|
+
d: Edit,
|
|
14959
|
+
...props
|
|
14960
|
+
});
|
|
14961
|
+
};
|
|
14962
|
+
var ExpandMoreIcon = (props) => {
|
|
14963
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14964
|
+
d: ExpandMore,
|
|
14965
|
+
...props
|
|
14966
|
+
});
|
|
14967
|
+
};
|
|
14968
|
+
var DeleteIcon = (props) => {
|
|
14969
|
+
return /* @__PURE__ */ jsx129(BaseIcon, {
|
|
14970
|
+
d: Delete,
|
|
14971
|
+
...props
|
|
14972
|
+
});
|
|
14973
|
+
};
|
|
14974
|
+
var objectLb = "{";
|
|
14975
|
+
var arrayLb = "[";
|
|
14976
|
+
var objectRb = "}";
|
|
14977
|
+
var arrayRb = "]";
|
|
14978
|
+
function inspectMetadata(value) {
|
|
14979
|
+
const length = getValueSize(value);
|
|
14980
|
+
let name = "";
|
|
14981
|
+
if (value instanceof Map || value instanceof Set) {
|
|
14982
|
+
name = value[Symbol.toStringTag];
|
|
14983
|
+
}
|
|
14984
|
+
if (Object.prototype.hasOwnProperty.call(value, Symbol.toStringTag)) {
|
|
14985
|
+
name = value[Symbol.toStringTag];
|
|
14986
|
+
}
|
|
14987
|
+
return "".concat(length, " Items").concat(name ? " (".concat(name, ")") : "");
|
|
14988
|
+
}
|
|
14989
|
+
var PreObjectType = (props) => {
|
|
14990
|
+
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
14991
|
+
const textColor = useTextColor();
|
|
14992
|
+
const isArrayLike = useMemo7(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
14993
|
+
props.value
|
|
14994
|
+
]);
|
|
14995
|
+
const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
|
|
14996
|
+
props.value
|
|
14997
|
+
]);
|
|
14998
|
+
const sizeOfValue = useMemo7(() => inspectMetadata(props.value), [
|
|
14999
|
+
props.value
|
|
15000
|
+
]);
|
|
15001
|
+
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
15002
|
+
const shouldDisplaySize = useMemo7(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
15003
|
+
displaySize,
|
|
15004
|
+
props.path,
|
|
15005
|
+
props.value
|
|
15006
|
+
]);
|
|
15007
|
+
const isTrap = useIsCycleReference(props.path, props.value);
|
|
15008
|
+
return /* @__PURE__ */ jsxs123(Box6, {
|
|
15009
|
+
component: "span",
|
|
15010
|
+
className: "data-object-start",
|
|
15011
|
+
sx: {
|
|
15012
|
+
letterSpacing: 0.5
|
|
15013
|
+
},
|
|
15014
|
+
children: [
|
|
15015
|
+
isArrayLike ? arrayLb : objectLb,
|
|
15016
|
+
shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ jsx129(Box6, {
|
|
15017
|
+
component: "span",
|
|
15018
|
+
sx: {
|
|
15019
|
+
pl: 0.5,
|
|
15020
|
+
fontStyle: "italic",
|
|
15021
|
+
color: metadataColor,
|
|
15022
|
+
userSelect: "none"
|
|
15023
|
+
},
|
|
15024
|
+
children: sizeOfValue
|
|
15025
|
+
}),
|
|
15026
|
+
isTrap && !props.inspect && /* @__PURE__ */ jsxs123(Fragment5, {
|
|
15027
|
+
children: [
|
|
15028
|
+
/* @__PURE__ */ jsx129(CircularArrowsIcon, {
|
|
15029
|
+
sx: {
|
|
15030
|
+
fontSize: 12,
|
|
15031
|
+
color: textColor,
|
|
15032
|
+
mx: 0.5
|
|
15033
|
+
}
|
|
15034
|
+
}),
|
|
15035
|
+
/* @__PURE__ */ jsx129(DataBox, {
|
|
15036
|
+
sx: {
|
|
15037
|
+
cursor: "pointer",
|
|
15038
|
+
userSelect: "none"
|
|
15039
|
+
},
|
|
15040
|
+
children: isTrap
|
|
15041
|
+
})
|
|
15042
|
+
]
|
|
15043
|
+
})
|
|
15044
|
+
]
|
|
15045
|
+
});
|
|
15046
|
+
};
|
|
15047
|
+
var PostObjectType = (props) => {
|
|
15048
|
+
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
15049
|
+
const textColor = useTextColor();
|
|
15050
|
+
const isArrayLike = useMemo7(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
15051
|
+
props.value
|
|
15052
|
+
]);
|
|
15053
|
+
const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
|
|
15054
|
+
props.value
|
|
15055
|
+
]);
|
|
15056
|
+
const sizeOfValue = useMemo7(() => inspectMetadata(props.value), [
|
|
15057
|
+
props.value
|
|
15058
|
+
]);
|
|
15059
|
+
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
15060
|
+
const shouldDisplaySize = useMemo7(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
15061
|
+
displaySize,
|
|
15062
|
+
props.path,
|
|
15063
|
+
props.value
|
|
15064
|
+
]);
|
|
15065
|
+
return /* @__PURE__ */ jsxs123(Box6, {
|
|
15066
|
+
component: "span",
|
|
15067
|
+
className: "data-object-end",
|
|
15068
|
+
sx: {
|
|
15069
|
+
lineHeight: 1.5,
|
|
15070
|
+
color: textColor,
|
|
15071
|
+
letterSpacing: 0.5,
|
|
15072
|
+
opacity: 0.8
|
|
15073
|
+
},
|
|
15074
|
+
children: [
|
|
15075
|
+
isArrayLike ? arrayRb : objectRb,
|
|
15076
|
+
shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ jsx129(Box6, {
|
|
15077
|
+
component: "span",
|
|
15078
|
+
sx: {
|
|
15079
|
+
pl: 0.5,
|
|
15080
|
+
fontStyle: "italic",
|
|
15081
|
+
color: metadataColor,
|
|
15082
|
+
userSelect: "none"
|
|
15083
|
+
},
|
|
15084
|
+
children: sizeOfValue
|
|
15085
|
+
}) : null
|
|
15086
|
+
]
|
|
15087
|
+
});
|
|
15088
|
+
};
|
|
15089
|
+
function getIterator(value) {
|
|
15090
|
+
return typeof (value === null || value === void 0 ? void 0 : value[Symbol.iterator]) === "function";
|
|
15091
|
+
}
|
|
15092
|
+
var ObjectType = (props) => {
|
|
15093
|
+
const keyColor = useTextColor();
|
|
15094
|
+
const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
15095
|
+
const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
|
|
15096
|
+
const isTrap = useIsCycleReference(props.path, props.value);
|
|
15097
|
+
const [displayLength, setDisplayLength] = useState8(useJsonViewerStore((store) => store.maxDisplayLength));
|
|
15098
|
+
const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
|
|
15099
|
+
const elements = useMemo7(() => {
|
|
15100
|
+
if (!props.inspect) {
|
|
15101
|
+
return null;
|
|
15102
|
+
}
|
|
15103
|
+
const value = props.value;
|
|
15104
|
+
const iterator = getIterator(value);
|
|
15105
|
+
if (iterator && !Array.isArray(value)) {
|
|
15106
|
+
const elements3 = [];
|
|
15107
|
+
if (value instanceof Map) {
|
|
15108
|
+
const lastIndex2 = value.size - 1;
|
|
15109
|
+
let index2 = 0;
|
|
15110
|
+
value.forEach((value2, k2) => {
|
|
15111
|
+
const key = k2.toString();
|
|
15112
|
+
const path = [
|
|
15113
|
+
...props.path,
|
|
15114
|
+
key
|
|
15115
|
+
];
|
|
15116
|
+
elements3.push(/* @__PURE__ */ jsx129(DataKeyPair, {
|
|
15117
|
+
path,
|
|
15118
|
+
value: value2,
|
|
15119
|
+
prevValue: props.prevValue instanceof Map ? props.prevValue.get(k2) : void 0,
|
|
15120
|
+
editable: false,
|
|
15121
|
+
last: index2 === lastIndex2
|
|
15122
|
+
}, key));
|
|
15123
|
+
index2++;
|
|
15124
|
+
});
|
|
15125
|
+
} else {
|
|
15126
|
+
const iterator2 = value[Symbol.iterator]();
|
|
15127
|
+
let result = iterator2.next();
|
|
15128
|
+
let count2 = 0;
|
|
15129
|
+
while (true) {
|
|
15130
|
+
const nextResult = iterator2.next();
|
|
15131
|
+
var _nextResult_done;
|
|
15132
|
+
elements3.push(/* @__PURE__ */ jsx129(DataKeyPair, {
|
|
15133
|
+
path: [
|
|
15134
|
+
...props.path,
|
|
15135
|
+
"iterator:".concat(count2)
|
|
15136
|
+
],
|
|
15137
|
+
value: result.value,
|
|
15138
|
+
nestedIndex: count2,
|
|
15139
|
+
editable: false,
|
|
15140
|
+
last: (_nextResult_done = nextResult.done) !== null && _nextResult_done !== void 0 ? _nextResult_done : false
|
|
15141
|
+
}, count2));
|
|
15142
|
+
if (nextResult.done) {
|
|
15143
|
+
break;
|
|
15144
|
+
}
|
|
15145
|
+
count2++;
|
|
15146
|
+
result = nextResult;
|
|
15147
|
+
}
|
|
15148
|
+
}
|
|
15149
|
+
return elements3;
|
|
15150
|
+
}
|
|
15151
|
+
if (Array.isArray(value)) {
|
|
15152
|
+
const lastIndex2 = value.length - 1;
|
|
15153
|
+
if (value.length <= groupArraysAfterLength) {
|
|
15154
|
+
const elements4 = value.slice(0, displayLength).map((value2, _index) => {
|
|
15155
|
+
const index2 = props.nestedIndex ? props.nestedIndex * groupArraysAfterLength + _index : _index;
|
|
15156
|
+
const path = [
|
|
15157
|
+
...props.path,
|
|
15158
|
+
index2
|
|
15159
|
+
];
|
|
15160
|
+
return /* @__PURE__ */ jsx129(DataKeyPair, {
|
|
15161
|
+
path,
|
|
15162
|
+
value: value2,
|
|
15163
|
+
prevValue: Array.isArray(props.prevValue) ? props.prevValue[index2] : void 0,
|
|
15164
|
+
last: _index === lastIndex2
|
|
15165
|
+
}, index2);
|
|
15166
|
+
});
|
|
15167
|
+
if (value.length > displayLength) {
|
|
15168
|
+
const rest = value.length - displayLength;
|
|
15169
|
+
elements4.push(/* @__PURE__ */ jsxs123(DataBox, {
|
|
15170
|
+
sx: {
|
|
15171
|
+
cursor: "pointer",
|
|
15172
|
+
lineHeight: 1.5,
|
|
15173
|
+
color: keyColor,
|
|
15174
|
+
letterSpacing: 0.5,
|
|
15175
|
+
opacity: 0.8,
|
|
15176
|
+
userSelect: "none"
|
|
15177
|
+
},
|
|
15178
|
+
onClick: () => setDisplayLength((length) => length * 2),
|
|
15179
|
+
children: [
|
|
15180
|
+
"hidden ",
|
|
15181
|
+
rest,
|
|
15182
|
+
" items\u2026"
|
|
15183
|
+
]
|
|
15184
|
+
}, "last"));
|
|
15185
|
+
}
|
|
15186
|
+
return elements4;
|
|
15187
|
+
}
|
|
15188
|
+
const elements3 = segmentArray(value, groupArraysAfterLength);
|
|
15189
|
+
const prevElements = Array.isArray(props.prevValue) ? segmentArray(props.prevValue, groupArraysAfterLength) : void 0;
|
|
15190
|
+
const elementsLastIndex = elements3.length - 1;
|
|
15191
|
+
return elements3.map((list, index2) => {
|
|
15192
|
+
return /* @__PURE__ */ jsx129(DataKeyPair, {
|
|
15193
|
+
path: props.path,
|
|
15194
|
+
value: list,
|
|
15195
|
+
nestedIndex: index2,
|
|
15196
|
+
prevValue: prevElements === null || prevElements === void 0 ? void 0 : prevElements[index2],
|
|
15197
|
+
last: index2 === elementsLastIndex
|
|
15198
|
+
}, index2);
|
|
15199
|
+
});
|
|
15200
|
+
}
|
|
15201
|
+
let entries = Object.entries(value);
|
|
15202
|
+
if (objectSortKeys) {
|
|
15203
|
+
entries = objectSortKeys === true ? entries.sort((param, param1) => {
|
|
15204
|
+
let [a3] = param, [b3] = param1;
|
|
15205
|
+
return a3.localeCompare(b3);
|
|
15206
|
+
}) : entries.sort((param, param1) => {
|
|
15207
|
+
let [a3] = param, [b3] = param1;
|
|
15208
|
+
return objectSortKeys(a3, b3);
|
|
15209
|
+
});
|
|
15210
|
+
}
|
|
15211
|
+
const lastIndex = entries.length - 1;
|
|
15212
|
+
const elements2 = entries.slice(0, displayLength).map((param, index2) => {
|
|
15213
|
+
let [key, value2] = param;
|
|
15214
|
+
var _props_prevValue;
|
|
15215
|
+
const path = [
|
|
15216
|
+
...props.path,
|
|
15217
|
+
key
|
|
15218
|
+
];
|
|
15219
|
+
return /* @__PURE__ */ jsx129(DataKeyPair, {
|
|
15220
|
+
path,
|
|
15221
|
+
value: value2,
|
|
15222
|
+
prevValue: (_props_prevValue = props.prevValue) === null || _props_prevValue === void 0 ? void 0 : _props_prevValue[key],
|
|
15223
|
+
last: index2 === lastIndex
|
|
15224
|
+
}, key);
|
|
15225
|
+
});
|
|
15226
|
+
if (entries.length > displayLength) {
|
|
15227
|
+
const rest = entries.length - displayLength;
|
|
15228
|
+
elements2.push(/* @__PURE__ */ jsxs123(DataBox, {
|
|
15229
|
+
sx: {
|
|
15230
|
+
cursor: "pointer",
|
|
15231
|
+
lineHeight: 1.5,
|
|
15232
|
+
color: keyColor,
|
|
15233
|
+
letterSpacing: 0.5,
|
|
15234
|
+
opacity: 0.8,
|
|
15235
|
+
userSelect: "none"
|
|
15236
|
+
},
|
|
15237
|
+
onClick: () => setDisplayLength((length) => length * 2),
|
|
15238
|
+
children: [
|
|
15239
|
+
"hidden ",
|
|
15240
|
+
rest,
|
|
15241
|
+
" items\u2026"
|
|
15242
|
+
]
|
|
15243
|
+
}, "last"));
|
|
15244
|
+
}
|
|
15245
|
+
return elements2;
|
|
15246
|
+
}, [
|
|
15247
|
+
props.inspect,
|
|
15248
|
+
props.value,
|
|
15249
|
+
props.prevValue,
|
|
15250
|
+
props.path,
|
|
15251
|
+
props.nestedIndex,
|
|
15252
|
+
groupArraysAfterLength,
|
|
15253
|
+
displayLength,
|
|
15254
|
+
keyColor,
|
|
15255
|
+
objectSortKeys
|
|
15256
|
+
]);
|
|
15257
|
+
const marginLeft = props.inspect ? 0.6 : 0;
|
|
15258
|
+
const width = useJsonViewerStore((store) => store.indentWidth);
|
|
15259
|
+
const indentWidth = props.inspect ? width - marginLeft : width;
|
|
15260
|
+
const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
|
|
15261
|
+
props.value
|
|
15262
|
+
]);
|
|
15263
|
+
if (isEmptyValue) {
|
|
15264
|
+
return null;
|
|
15265
|
+
}
|
|
15266
|
+
return /* @__PURE__ */ jsx129(Box6, {
|
|
15267
|
+
className: "data-object",
|
|
15268
|
+
sx: {
|
|
15269
|
+
display: props.inspect ? "block" : "inline-block",
|
|
15270
|
+
pl: props.inspect ? indentWidth - 0.6 : 0,
|
|
15271
|
+
marginLeft,
|
|
15272
|
+
color: keyColor,
|
|
15273
|
+
borderLeft: props.inspect ? "1px solid ".concat(borderColor) : "none"
|
|
15274
|
+
},
|
|
15275
|
+
children: props.inspect ? elements : !isTrap && /* @__PURE__ */ jsx129(Box6, {
|
|
15276
|
+
component: "span",
|
|
15277
|
+
className: "data-object-body",
|
|
15278
|
+
onClick: () => props.setInspect(true),
|
|
15279
|
+
sx: {
|
|
15280
|
+
"&:hover": {
|
|
15281
|
+
cursor: "pointer"
|
|
15282
|
+
},
|
|
15283
|
+
padding: 0.5,
|
|
15284
|
+
userSelect: "none"
|
|
15285
|
+
},
|
|
15286
|
+
children: "\u2026"
|
|
15287
|
+
})
|
|
15288
|
+
});
|
|
15289
|
+
};
|
|
15290
|
+
var objectType = {
|
|
15291
|
+
is: (value) => typeof value === "object",
|
|
15292
|
+
Component: ObjectType,
|
|
15293
|
+
PreComponent: PreObjectType,
|
|
15294
|
+
PostComponent: PostObjectType
|
|
15295
|
+
};
|
|
15296
|
+
var stringType = defineEasyType({
|
|
15297
|
+
is: (value) => typeof value === "string",
|
|
15298
|
+
type: "string",
|
|
15299
|
+
colorKey: "base09",
|
|
15300
|
+
serialize: (value) => value,
|
|
15301
|
+
deserialize: (value) => value,
|
|
15302
|
+
Renderer: (props) => {
|
|
15303
|
+
const [showRest, setShowRest] = useState8(false);
|
|
15304
|
+
const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
|
|
15305
|
+
const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
|
|
15306
|
+
const hasRest = props.value.length > collapseStringsAfterLength;
|
|
15307
|
+
return /* @__PURE__ */ jsxs123(Box6, {
|
|
15308
|
+
component: "span",
|
|
15309
|
+
sx: {
|
|
15310
|
+
overflowWrap: "anywhere",
|
|
15311
|
+
cursor: hasRest ? "pointer" : "inherit"
|
|
15312
|
+
},
|
|
15313
|
+
onClick: () => {
|
|
15314
|
+
var _window_getSelection;
|
|
15315
|
+
if (((_window_getSelection = window.getSelection()) === null || _window_getSelection === void 0 ? void 0 : _window_getSelection.type) === "Range") {
|
|
15316
|
+
return;
|
|
15317
|
+
}
|
|
15318
|
+
if (hasRest) {
|
|
15319
|
+
setShowRest((value2) => !value2);
|
|
15320
|
+
}
|
|
15321
|
+
},
|
|
15322
|
+
children: [
|
|
15323
|
+
'"',
|
|
15324
|
+
value,
|
|
15325
|
+
hasRest && !showRest && /* @__PURE__ */ jsx129(Box6, {
|
|
15326
|
+
component: "span",
|
|
15327
|
+
sx: {
|
|
15328
|
+
padding: 0.5
|
|
15329
|
+
},
|
|
15330
|
+
children: "\u2026"
|
|
15331
|
+
}),
|
|
15332
|
+
'"'
|
|
15333
|
+
]
|
|
15334
|
+
});
|
|
15335
|
+
}
|
|
15336
|
+
});
|
|
15337
|
+
var undefinedType = defineEasyType({
|
|
15338
|
+
is: (value) => value === void 0,
|
|
15339
|
+
type: "undefined",
|
|
15340
|
+
colorKey: "base05",
|
|
15341
|
+
displayTypeLabel: false,
|
|
15342
|
+
Renderer: () => {
|
|
15343
|
+
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
15344
|
+
return /* @__PURE__ */ jsx129(Box6, {
|
|
15345
|
+
sx: {
|
|
15346
|
+
fontSize: "0.7rem",
|
|
15347
|
+
backgroundColor,
|
|
15348
|
+
borderRadius: "3px",
|
|
15349
|
+
padding: "0.5px 2px"
|
|
15350
|
+
},
|
|
15351
|
+
children: "undefined"
|
|
15352
|
+
});
|
|
15353
|
+
}
|
|
15354
|
+
});
|
|
15355
|
+
function memorizeDataType(dataType) {
|
|
15356
|
+
function compare(prevProps, nextProps) {
|
|
15357
|
+
var _prevProps_path, _nextProps_path;
|
|
15358
|
+
return Object.is(prevProps.value, nextProps.value) && prevProps.inspect && nextProps.inspect && ((_prevProps_path = prevProps.path) === null || _prevProps_path === void 0 ? void 0 : _prevProps_path.join(".")) === ((_nextProps_path = nextProps.path) === null || _nextProps_path === void 0 ? void 0 : _nextProps_path.join("."));
|
|
15359
|
+
}
|
|
15360
|
+
dataType.Component = /* @__PURE__ */ memo9(dataType.Component, compare);
|
|
15361
|
+
if (dataType.Editor) {
|
|
15362
|
+
dataType.Editor = /* @__PURE__ */ memo9(dataType.Editor, function compare2(prevProps, nextProps) {
|
|
15363
|
+
return Object.is(prevProps.value, nextProps.value);
|
|
15364
|
+
});
|
|
15365
|
+
}
|
|
15366
|
+
if (dataType.PreComponent) {
|
|
15367
|
+
dataType.PreComponent = /* @__PURE__ */ memo9(dataType.PreComponent, compare);
|
|
15368
|
+
}
|
|
15369
|
+
if (dataType.PostComponent) {
|
|
15370
|
+
dataType.PostComponent = /* @__PURE__ */ memo9(dataType.PostComponent, compare);
|
|
15371
|
+
}
|
|
15372
|
+
return dataType;
|
|
15373
|
+
}
|
|
15374
|
+
var predefinedTypes = [
|
|
15375
|
+
memorizeDataType(booleanType),
|
|
15376
|
+
memorizeDataType(dateType),
|
|
15377
|
+
memorizeDataType(nullType),
|
|
15378
|
+
memorizeDataType(undefinedType),
|
|
15379
|
+
memorizeDataType(stringType),
|
|
15380
|
+
memorizeDataType(functionType),
|
|
15381
|
+
memorizeDataType(nanType),
|
|
15382
|
+
memorizeDataType(intType),
|
|
15383
|
+
memorizeDataType(floatType),
|
|
15384
|
+
memorizeDataType(bigIntType)
|
|
15385
|
+
];
|
|
15386
|
+
var createTypeRegistryStore = () => {
|
|
15387
|
+
return createStore()((set) => ({
|
|
15388
|
+
registry: predefinedTypes,
|
|
15389
|
+
registerTypes: (setState) => {
|
|
15390
|
+
set((state) => ({
|
|
15391
|
+
registry: typeof setState === "function" ? setState(state.registry) : setState
|
|
15392
|
+
}));
|
|
15393
|
+
}
|
|
15394
|
+
}));
|
|
15395
|
+
};
|
|
15396
|
+
var TypeRegistryStoreContext = /* @__PURE__ */ createContext9(void 0);
|
|
15397
|
+
TypeRegistryStoreContext.Provider;
|
|
15398
|
+
var useTypeRegistryStore = (selector2, equalityFn) => {
|
|
15399
|
+
const store = useContext16(TypeRegistryStoreContext);
|
|
15400
|
+
return useStore(store, selector2, equalityFn);
|
|
15401
|
+
};
|
|
15402
|
+
function matchTypeComponents(value, path, registry) {
|
|
15403
|
+
let potential;
|
|
15404
|
+
for (const T of registry) {
|
|
15405
|
+
if (T.is(value, path)) {
|
|
15406
|
+
potential = T;
|
|
15407
|
+
}
|
|
15408
|
+
}
|
|
15409
|
+
if (potential === void 0) {
|
|
15410
|
+
if (typeof value === "object") {
|
|
15411
|
+
return objectType;
|
|
15412
|
+
}
|
|
15413
|
+
throw new Error("No type matched for value: ".concat(value));
|
|
15414
|
+
}
|
|
15415
|
+
return potential;
|
|
15416
|
+
}
|
|
15417
|
+
function useTypeComponents(value, path) {
|
|
15418
|
+
const registry = useTypeRegistryStore((store) => store.registry);
|
|
15419
|
+
return useMemo7(() => matchTypeComponents(value, path, registry), [
|
|
15420
|
+
value,
|
|
15421
|
+
path,
|
|
15422
|
+
registry
|
|
15423
|
+
]);
|
|
15424
|
+
}
|
|
15425
|
+
var IconBox = (props) => /* @__PURE__ */ jsx129(Box6, {
|
|
15426
|
+
component: "span",
|
|
15427
|
+
...props,
|
|
15428
|
+
sx: {
|
|
15429
|
+
cursor: "pointer",
|
|
15430
|
+
paddingLeft: "0.7rem",
|
|
15431
|
+
...props.sx
|
|
15432
|
+
}
|
|
15433
|
+
});
|
|
15434
|
+
var DataKeyPair = (props) => {
|
|
15435
|
+
const { value, prevValue, path, nestedIndex, last } = props;
|
|
15436
|
+
const { Component, PreComponent, PostComponent, Editor, serialize, deserialize } = useTypeComponents(value, path);
|
|
15437
|
+
var _props_editable;
|
|
15438
|
+
const propsEditable = (_props_editable = props.editable) !== null && _props_editable !== void 0 ? _props_editable : void 0;
|
|
15439
|
+
const storeEditable = useJsonViewerStore((store) => store.editable);
|
|
15440
|
+
const editable = useMemo7(() => {
|
|
15441
|
+
if (storeEditable === false) {
|
|
15442
|
+
return false;
|
|
15443
|
+
}
|
|
15444
|
+
if (propsEditable === false) {
|
|
15445
|
+
return false;
|
|
15446
|
+
}
|
|
15447
|
+
if (typeof storeEditable === "function") {
|
|
15448
|
+
return !!storeEditable(path, value);
|
|
15449
|
+
}
|
|
15450
|
+
return storeEditable;
|
|
15451
|
+
}, [
|
|
15452
|
+
path,
|
|
15453
|
+
propsEditable,
|
|
15454
|
+
storeEditable,
|
|
15455
|
+
value
|
|
15456
|
+
]);
|
|
15457
|
+
const [tempValue, setTempValue] = useState8("");
|
|
15458
|
+
const depth = path.length;
|
|
15459
|
+
const key = path[depth - 1];
|
|
15460
|
+
const hoverPath = useJsonViewerStore((store) => store.hoverPath);
|
|
15461
|
+
const isHover = useMemo7(() => {
|
|
15462
|
+
return hoverPath && path.every((value2, index2) => value2 === hoverPath.path[index2] && nestedIndex === hoverPath.nestedIndex);
|
|
15463
|
+
}, [
|
|
15464
|
+
hoverPath,
|
|
15465
|
+
path,
|
|
15466
|
+
nestedIndex
|
|
15467
|
+
]);
|
|
15468
|
+
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
15469
|
+
const root = useJsonViewerStore((store) => store.value);
|
|
15470
|
+
const [inspect, setInspect] = useInspect(path, value, nestedIndex);
|
|
15471
|
+
const [editing, setEditing] = useState8(false);
|
|
15472
|
+
const onChange = useJsonViewerStore((store) => store.onChange);
|
|
15473
|
+
const keyColor = useTextColor();
|
|
15474
|
+
const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
|
|
15475
|
+
const highlightColor = useJsonViewerStore((store) => store.colorspace.base0A);
|
|
15476
|
+
const displayComma = useJsonViewerStore((store) => store.displayComma);
|
|
15477
|
+
const quotesOnKeys = useJsonViewerStore((store) => store.quotesOnKeys);
|
|
15478
|
+
const rootName = useJsonViewerStore((store) => store.rootName);
|
|
15479
|
+
const isRoot = root === value;
|
|
15480
|
+
const isNumberKey = Number.isInteger(Number(key));
|
|
15481
|
+
const storeEnableAdd = useJsonViewerStore((store) => store.enableAdd);
|
|
15482
|
+
const onAdd = useJsonViewerStore((store) => store.onAdd);
|
|
15483
|
+
const enableAdd = useMemo7(() => {
|
|
15484
|
+
if (!onAdd || nestedIndex !== void 0) return false;
|
|
15485
|
+
if (storeEnableAdd === false) {
|
|
15486
|
+
return false;
|
|
15487
|
+
}
|
|
15488
|
+
if (propsEditable === false) {
|
|
15489
|
+
return false;
|
|
15490
|
+
}
|
|
15491
|
+
if (typeof storeEnableAdd === "function") {
|
|
15492
|
+
return !!storeEnableAdd(path, value);
|
|
15493
|
+
}
|
|
15494
|
+
if (Array.isArray(value) || isPlainObject(value)) {
|
|
15495
|
+
return true;
|
|
15496
|
+
}
|
|
15497
|
+
return false;
|
|
15498
|
+
}, [
|
|
15499
|
+
onAdd,
|
|
15500
|
+
nestedIndex,
|
|
15501
|
+
path,
|
|
15502
|
+
storeEnableAdd,
|
|
15503
|
+
propsEditable,
|
|
15504
|
+
value
|
|
15505
|
+
]);
|
|
15506
|
+
const storeEnableDelete = useJsonViewerStore((store) => store.enableDelete);
|
|
15507
|
+
const onDelete = useJsonViewerStore((store) => store.onDelete);
|
|
15508
|
+
const enableDelete = useMemo7(() => {
|
|
15509
|
+
if (!onDelete || nestedIndex !== void 0) return false;
|
|
15510
|
+
if (isRoot) {
|
|
15511
|
+
return false;
|
|
15512
|
+
}
|
|
15513
|
+
if (storeEnableDelete === false) {
|
|
15514
|
+
return false;
|
|
15515
|
+
}
|
|
15516
|
+
if (propsEditable === false) {
|
|
15517
|
+
return false;
|
|
15518
|
+
}
|
|
15519
|
+
if (typeof storeEnableDelete === "function") {
|
|
15520
|
+
return !!storeEnableDelete(path, value);
|
|
15521
|
+
}
|
|
15522
|
+
return storeEnableDelete;
|
|
15523
|
+
}, [
|
|
15524
|
+
onDelete,
|
|
15525
|
+
nestedIndex,
|
|
15526
|
+
isRoot,
|
|
15527
|
+
path,
|
|
15528
|
+
storeEnableDelete,
|
|
15529
|
+
propsEditable,
|
|
15530
|
+
value
|
|
15531
|
+
]);
|
|
15532
|
+
const enableClipboard = useJsonViewerStore((store) => store.enableClipboard);
|
|
15533
|
+
const { copy, copied } = useClipboard();
|
|
15534
|
+
const highlightUpdates = useJsonViewerStore((store) => store.highlightUpdates);
|
|
15535
|
+
const isHighlight = useMemo7(() => {
|
|
15536
|
+
if (!highlightUpdates || prevValue === void 0) return false;
|
|
15537
|
+
if (typeof value !== typeof prevValue) {
|
|
15538
|
+
return true;
|
|
15539
|
+
}
|
|
15540
|
+
if (typeof value === "number") {
|
|
15541
|
+
if (isNaN(value) && isNaN(prevValue)) return false;
|
|
15542
|
+
return value !== prevValue;
|
|
15543
|
+
}
|
|
15544
|
+
if (Array.isArray(value) !== Array.isArray(prevValue)) {
|
|
15545
|
+
return true;
|
|
15546
|
+
}
|
|
15547
|
+
if (typeof value === "object" || typeof value === "function") {
|
|
15548
|
+
return false;
|
|
15549
|
+
}
|
|
15550
|
+
if (value !== prevValue) {
|
|
15551
|
+
return true;
|
|
15552
|
+
}
|
|
15553
|
+
return false;
|
|
15554
|
+
}, [
|
|
15555
|
+
highlightUpdates,
|
|
15556
|
+
prevValue,
|
|
15557
|
+
value
|
|
15558
|
+
]);
|
|
15559
|
+
const highlightContainer = useRef11();
|
|
15560
|
+
useEffect15(() => {
|
|
15561
|
+
if (highlightContainer.current && isHighlight && "animate" in highlightContainer.current) {
|
|
15562
|
+
highlightContainer.current.animate([
|
|
15563
|
+
{
|
|
15564
|
+
backgroundColor: highlightColor
|
|
15565
|
+
},
|
|
15566
|
+
{
|
|
15567
|
+
backgroundColor: ""
|
|
15568
|
+
}
|
|
15569
|
+
], {
|
|
15570
|
+
duration: 1e3,
|
|
15571
|
+
easing: "ease-in"
|
|
15572
|
+
});
|
|
15573
|
+
}
|
|
15574
|
+
}, [
|
|
15575
|
+
highlightColor,
|
|
15576
|
+
isHighlight,
|
|
15577
|
+
prevValue,
|
|
15578
|
+
value
|
|
15579
|
+
]);
|
|
15580
|
+
const startEditing = useCallback8((event) => {
|
|
15581
|
+
event.preventDefault();
|
|
15582
|
+
if (serialize) setTempValue(serialize(value));
|
|
15583
|
+
setEditing(true);
|
|
15584
|
+
}, [
|
|
15585
|
+
serialize,
|
|
15586
|
+
value
|
|
15587
|
+
]);
|
|
15588
|
+
const abortEditing = useCallback8(() => {
|
|
15589
|
+
setEditing(false);
|
|
15590
|
+
setTempValue("");
|
|
15591
|
+
}, [
|
|
15592
|
+
setEditing,
|
|
15593
|
+
setTempValue
|
|
15594
|
+
]);
|
|
15595
|
+
const commitEditing = useCallback8((newValue) => {
|
|
15596
|
+
setEditing(false);
|
|
15597
|
+
if (!deserialize) return;
|
|
15598
|
+
try {
|
|
15599
|
+
onChange(path, value, deserialize(newValue));
|
|
15600
|
+
} catch (e2) {
|
|
15601
|
+
}
|
|
15602
|
+
}, [
|
|
15603
|
+
setEditing,
|
|
15604
|
+
deserialize,
|
|
15605
|
+
onChange,
|
|
15606
|
+
path,
|
|
15607
|
+
value
|
|
15608
|
+
]);
|
|
15609
|
+
const actionIcons = useMemo7(() => {
|
|
15610
|
+
if (editing) {
|
|
15611
|
+
return /* @__PURE__ */ jsxs123(Fragment5, {
|
|
15612
|
+
children: [
|
|
15613
|
+
/* @__PURE__ */ jsx129(IconBox, {
|
|
15614
|
+
children: /* @__PURE__ */ jsx129(CloseIcon, {
|
|
15615
|
+
sx: {
|
|
15616
|
+
fontSize: ".8rem"
|
|
15617
|
+
},
|
|
15618
|
+
onClick: abortEditing
|
|
15619
|
+
})
|
|
15620
|
+
}),
|
|
15621
|
+
/* @__PURE__ */ jsx129(IconBox, {
|
|
15622
|
+
children: /* @__PURE__ */ jsx129(CheckIcon, {
|
|
15623
|
+
sx: {
|
|
15624
|
+
fontSize: ".8rem"
|
|
15625
|
+
},
|
|
15626
|
+
onClick: () => commitEditing(tempValue)
|
|
15627
|
+
})
|
|
15628
|
+
})
|
|
15629
|
+
]
|
|
15630
|
+
});
|
|
15631
|
+
}
|
|
15632
|
+
return /* @__PURE__ */ jsxs123(Fragment5, {
|
|
15633
|
+
children: [
|
|
15634
|
+
enableClipboard && /* @__PURE__ */ jsx129(IconBox, {
|
|
15635
|
+
onClick: (event) => {
|
|
15636
|
+
event.preventDefault();
|
|
15637
|
+
try {
|
|
15638
|
+
copy(path, value, copyString);
|
|
15639
|
+
} catch (e2) {
|
|
15640
|
+
console.error(e2);
|
|
15641
|
+
}
|
|
15642
|
+
},
|
|
15643
|
+
children: copied ? /* @__PURE__ */ jsx129(CheckIcon, {
|
|
15644
|
+
sx: {
|
|
15645
|
+
fontSize: ".8rem"
|
|
15646
|
+
}
|
|
15647
|
+
}) : /* @__PURE__ */ jsx129(ContentCopyIcon, {
|
|
15648
|
+
sx: {
|
|
15649
|
+
fontSize: ".8rem"
|
|
15650
|
+
}
|
|
15651
|
+
})
|
|
15652
|
+
}),
|
|
15653
|
+
Editor && editable && serialize && deserialize && /* @__PURE__ */ jsx129(IconBox, {
|
|
15654
|
+
onClick: startEditing,
|
|
15655
|
+
children: /* @__PURE__ */ jsx129(EditIcon, {
|
|
15656
|
+
sx: {
|
|
15657
|
+
fontSize: ".8rem"
|
|
15658
|
+
}
|
|
15659
|
+
})
|
|
15660
|
+
}),
|
|
15661
|
+
enableAdd && /* @__PURE__ */ jsx129(IconBox, {
|
|
15662
|
+
onClick: (event) => {
|
|
15663
|
+
event.preventDefault();
|
|
15664
|
+
onAdd === null || onAdd === void 0 ? void 0 : onAdd(path);
|
|
15665
|
+
},
|
|
15666
|
+
children: /* @__PURE__ */ jsx129(AddBoxIcon, {
|
|
15667
|
+
sx: {
|
|
15668
|
+
fontSize: ".8rem"
|
|
15669
|
+
}
|
|
15670
|
+
})
|
|
15671
|
+
}),
|
|
15672
|
+
enableDelete && /* @__PURE__ */ jsx129(IconBox, {
|
|
15673
|
+
onClick: (event) => {
|
|
15674
|
+
event.preventDefault();
|
|
15675
|
+
onDelete === null || onDelete === void 0 ? void 0 : onDelete(path, value);
|
|
15676
|
+
},
|
|
15677
|
+
children: /* @__PURE__ */ jsx129(DeleteIcon, {
|
|
15678
|
+
sx: {
|
|
15679
|
+
fontSize: ".9rem"
|
|
15680
|
+
}
|
|
15681
|
+
})
|
|
15682
|
+
})
|
|
15683
|
+
]
|
|
15684
|
+
});
|
|
15685
|
+
}, [
|
|
15686
|
+
Editor,
|
|
15687
|
+
serialize,
|
|
15688
|
+
deserialize,
|
|
15689
|
+
copied,
|
|
15690
|
+
copy,
|
|
15691
|
+
editable,
|
|
15692
|
+
editing,
|
|
15693
|
+
enableClipboard,
|
|
15694
|
+
enableAdd,
|
|
15695
|
+
enableDelete,
|
|
15696
|
+
tempValue,
|
|
15697
|
+
path,
|
|
15698
|
+
value,
|
|
15699
|
+
onAdd,
|
|
15700
|
+
onDelete,
|
|
15701
|
+
startEditing,
|
|
15702
|
+
abortEditing,
|
|
15703
|
+
commitEditing
|
|
15704
|
+
]);
|
|
15705
|
+
const isEmptyValue = useMemo7(() => getValueSize(value) === 0, [
|
|
15706
|
+
value
|
|
15707
|
+
]);
|
|
15708
|
+
const expandable = !isEmptyValue && !!(PreComponent && PostComponent);
|
|
15709
|
+
const KeyRenderer = useJsonViewerStore((store) => store.keyRenderer);
|
|
15710
|
+
const downstreamProps = useMemo7(() => ({
|
|
15711
|
+
path,
|
|
15712
|
+
inspect,
|
|
15713
|
+
setInspect,
|
|
15714
|
+
value,
|
|
15715
|
+
prevValue,
|
|
15716
|
+
nestedIndex
|
|
15717
|
+
}), [
|
|
15718
|
+
inspect,
|
|
15719
|
+
path,
|
|
15720
|
+
setInspect,
|
|
15721
|
+
value,
|
|
15722
|
+
prevValue,
|
|
15723
|
+
nestedIndex
|
|
15724
|
+
]);
|
|
15725
|
+
return /* @__PURE__ */ jsxs123(Box6, {
|
|
15726
|
+
className: "data-key-pair",
|
|
15727
|
+
"data-testid": "data-key-pair" + path.join("."),
|
|
15728
|
+
sx: {
|
|
15729
|
+
userSelect: "text"
|
|
15730
|
+
},
|
|
15731
|
+
onMouseEnter: useCallback8(() => setHover(path, nestedIndex), [
|
|
15732
|
+
setHover,
|
|
15733
|
+
path,
|
|
15734
|
+
nestedIndex
|
|
15735
|
+
]),
|
|
15736
|
+
children: [
|
|
15737
|
+
/* @__PURE__ */ jsxs123(DataBox, {
|
|
15738
|
+
component: "span",
|
|
15739
|
+
className: "data-key",
|
|
15740
|
+
sx: {
|
|
15741
|
+
lineHeight: 1.5,
|
|
15742
|
+
color: keyColor,
|
|
15743
|
+
letterSpacing: 0.5,
|
|
15744
|
+
opacity: 0.8
|
|
15745
|
+
},
|
|
15746
|
+
onClick: useCallback8((event) => {
|
|
15747
|
+
if (event.isDefaultPrevented()) {
|
|
15748
|
+
return;
|
|
15749
|
+
}
|
|
15750
|
+
if (!isEmptyValue) {
|
|
15751
|
+
setInspect((state) => !state);
|
|
15752
|
+
}
|
|
15753
|
+
}, [
|
|
15754
|
+
isEmptyValue,
|
|
15755
|
+
setInspect
|
|
15756
|
+
]),
|
|
15757
|
+
children: [
|
|
15758
|
+
expandable ? inspect ? /* @__PURE__ */ jsx129(ExpandMoreIcon, {
|
|
15759
|
+
className: "data-key-toggle-expanded",
|
|
15760
|
+
sx: {
|
|
15761
|
+
fontSize: ".8rem",
|
|
15762
|
+
"&:hover": {
|
|
15763
|
+
cursor: "pointer"
|
|
15764
|
+
}
|
|
15765
|
+
}
|
|
15766
|
+
}) : /* @__PURE__ */ jsx129(ChevronRightIcon, {
|
|
15767
|
+
className: "data-key-toggle-collapsed",
|
|
15768
|
+
sx: {
|
|
15769
|
+
fontSize: ".8rem",
|
|
15770
|
+
"&:hover": {
|
|
15771
|
+
cursor: "pointer"
|
|
15772
|
+
}
|
|
15773
|
+
}
|
|
15774
|
+
}) : null,
|
|
15775
|
+
/* @__PURE__ */ jsx129(Box6, {
|
|
15776
|
+
ref: highlightContainer,
|
|
15777
|
+
className: "data-key-key",
|
|
15778
|
+
component: "span",
|
|
15779
|
+
children: isRoot && depth === 0 ? rootName !== false ? quotesOnKeys ? /* @__PURE__ */ jsxs123(Fragment5, {
|
|
15780
|
+
children: [
|
|
15781
|
+
'"',
|
|
15782
|
+
rootName,
|
|
15783
|
+
'"'
|
|
15784
|
+
]
|
|
15785
|
+
}) : /* @__PURE__ */ jsx129(Fragment5, {
|
|
15786
|
+
children: rootName
|
|
15787
|
+
}) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ jsx129(KeyRenderer, {
|
|
15788
|
+
...downstreamProps
|
|
15789
|
+
}) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ jsx129(Box6, {
|
|
15790
|
+
component: "span",
|
|
15791
|
+
style: {
|
|
15792
|
+
color: numberKeyColor,
|
|
15793
|
+
userSelect: isNumberKey ? "none" : "auto"
|
|
15794
|
+
},
|
|
15795
|
+
children: key
|
|
15796
|
+
}) : quotesOnKeys ? /* @__PURE__ */ jsxs123(Fragment5, {
|
|
15797
|
+
children: [
|
|
15798
|
+
'"',
|
|
15799
|
+
key,
|
|
15800
|
+
'"'
|
|
15801
|
+
]
|
|
15802
|
+
}) : /* @__PURE__ */ jsx129(Fragment5, {
|
|
15803
|
+
children: key
|
|
15804
|
+
}))
|
|
15805
|
+
}),
|
|
15806
|
+
isRoot ? rootName !== false && /* @__PURE__ */ jsx129(DataBox, {
|
|
15807
|
+
className: "data-key-colon",
|
|
15808
|
+
sx: {
|
|
15809
|
+
mr: 0.5
|
|
15810
|
+
},
|
|
15811
|
+
children: ":"
|
|
15812
|
+
}) : nestedIndex === void 0 && /* @__PURE__ */ jsx129(DataBox, {
|
|
15813
|
+
className: "data-key-colon",
|
|
15814
|
+
sx: {
|
|
15815
|
+
mr: 0.5,
|
|
15816
|
+
".data-key-key:empty + &": {
|
|
15817
|
+
display: "none"
|
|
15818
|
+
},
|
|
15819
|
+
userSelect: isNumberKey ? "none" : "auto"
|
|
15820
|
+
},
|
|
15821
|
+
children: ":"
|
|
15822
|
+
}),
|
|
15823
|
+
PreComponent && /* @__PURE__ */ jsx129(PreComponent, {
|
|
15824
|
+
...downstreamProps
|
|
15825
|
+
}),
|
|
15826
|
+
isHover && expandable && inspect && actionIcons
|
|
15827
|
+
]
|
|
15828
|
+
}),
|
|
15829
|
+
editing && editable ? Editor && /* @__PURE__ */ jsx129(Editor, {
|
|
15830
|
+
path,
|
|
15831
|
+
value: tempValue,
|
|
15832
|
+
setValue: setTempValue,
|
|
15833
|
+
abortEditing,
|
|
15834
|
+
commitEditing
|
|
15835
|
+
}) : Component ? /* @__PURE__ */ jsx129(Component, {
|
|
15836
|
+
...downstreamProps
|
|
15837
|
+
}) : /* @__PURE__ */ jsx129(Box6, {
|
|
15838
|
+
component: "span",
|
|
15839
|
+
className: "data-value-fallback",
|
|
15840
|
+
children: "fallback: ".concat(value)
|
|
15841
|
+
}),
|
|
15842
|
+
PostComponent && /* @__PURE__ */ jsx129(PostComponent, {
|
|
15843
|
+
...downstreamProps
|
|
15844
|
+
}),
|
|
15845
|
+
!last && displayComma && /* @__PURE__ */ jsx129(DataBox, {
|
|
15846
|
+
children: ","
|
|
15847
|
+
}),
|
|
15848
|
+
isHover && expandable && !inspect && actionIcons,
|
|
15849
|
+
isHover && !expandable && actionIcons,
|
|
15850
|
+
!isHover && editing && actionIcons
|
|
15851
|
+
]
|
|
15852
|
+
});
|
|
15853
|
+
};
|
|
15854
|
+
var query = "(prefers-color-scheme: dark)";
|
|
15855
|
+
function useThemeDetector() {
|
|
15856
|
+
const [isDark, setIsDark] = useState8(false);
|
|
15857
|
+
useEffect15(() => {
|
|
15858
|
+
const listener = (e2) => setIsDark(e2.matches);
|
|
15859
|
+
setIsDark(window.matchMedia(query).matches);
|
|
15860
|
+
const queryMedia = window.matchMedia(query);
|
|
15861
|
+
queryMedia.addEventListener("change", listener);
|
|
15862
|
+
return () => queryMedia.removeEventListener("change", listener);
|
|
15863
|
+
}, []);
|
|
15864
|
+
return isDark;
|
|
15865
|
+
}
|
|
15866
|
+
function useSetIfNotUndefinedEffect(key, value) {
|
|
15867
|
+
const { setState } = useContext16(JsonViewerStoreContext);
|
|
15868
|
+
useEffect15(() => {
|
|
15869
|
+
if (value !== void 0) {
|
|
15870
|
+
setState({
|
|
15871
|
+
[key]: value
|
|
15872
|
+
});
|
|
15873
|
+
}
|
|
15874
|
+
}, [
|
|
15875
|
+
key,
|
|
15876
|
+
value,
|
|
15877
|
+
setState
|
|
15878
|
+
]);
|
|
15879
|
+
}
|
|
15880
|
+
var JsonViewerInner = (props) => {
|
|
15881
|
+
const { setState } = useContext16(JsonViewerStoreContext);
|
|
15882
|
+
useEffect15(() => {
|
|
15883
|
+
setState((state) => ({
|
|
15884
|
+
prevValue: state.value,
|
|
15885
|
+
value: props.value
|
|
15886
|
+
}));
|
|
15887
|
+
}, [
|
|
15888
|
+
props.value,
|
|
15889
|
+
setState
|
|
15890
|
+
]);
|
|
15891
|
+
useSetIfNotUndefinedEffect("rootName", props.rootName);
|
|
15892
|
+
useSetIfNotUndefinedEffect("indentWidth", props.indentWidth);
|
|
15893
|
+
useSetIfNotUndefinedEffect("keyRenderer", props.keyRenderer);
|
|
15894
|
+
useSetIfNotUndefinedEffect("enableAdd", props.enableAdd);
|
|
15895
|
+
useSetIfNotUndefinedEffect("enableDelete", props.enableDelete);
|
|
15896
|
+
useSetIfNotUndefinedEffect("enableClipboard", props.enableClipboard);
|
|
15897
|
+
useSetIfNotUndefinedEffect("editable", props.editable);
|
|
15898
|
+
useSetIfNotUndefinedEffect("onChange", props.onChange);
|
|
15899
|
+
useSetIfNotUndefinedEffect("onCopy", props.onCopy);
|
|
15900
|
+
useSetIfNotUndefinedEffect("onSelect", props.onSelect);
|
|
15901
|
+
useSetIfNotUndefinedEffect("onAdd", props.onAdd);
|
|
15902
|
+
useSetIfNotUndefinedEffect("onDelete", props.onDelete);
|
|
15903
|
+
useSetIfNotUndefinedEffect("maxDisplayLength", props.maxDisplayLength);
|
|
15904
|
+
useSetIfNotUndefinedEffect("groupArraysAfterLength", props.groupArraysAfterLength);
|
|
15905
|
+
useSetIfNotUndefinedEffect("quotesOnKeys", props.quotesOnKeys);
|
|
15906
|
+
useSetIfNotUndefinedEffect("displayDataTypes", props.displayDataTypes);
|
|
15907
|
+
useSetIfNotUndefinedEffect("displaySize", props.displaySize);
|
|
15908
|
+
useSetIfNotUndefinedEffect("displayComma", props.displayComma);
|
|
15909
|
+
useSetIfNotUndefinedEffect("highlightUpdates", props.highlightUpdates);
|
|
15910
|
+
useEffect15(() => {
|
|
15911
|
+
if (props.theme === "light") {
|
|
15912
|
+
setState({
|
|
15913
|
+
colorspace: lightColorspace
|
|
15914
|
+
});
|
|
15915
|
+
} else if (props.theme === "dark") {
|
|
15916
|
+
setState({
|
|
15917
|
+
colorspace: darkColorspace
|
|
15918
|
+
});
|
|
15919
|
+
} else if (typeof props.theme === "object") {
|
|
15920
|
+
setState({
|
|
15921
|
+
colorspace: props.theme
|
|
15922
|
+
});
|
|
15923
|
+
}
|
|
15924
|
+
}, [
|
|
15925
|
+
setState,
|
|
15926
|
+
props.theme
|
|
15927
|
+
]);
|
|
15928
|
+
const themeCls = useMemo7(() => {
|
|
15929
|
+
if (typeof props.theme === "object") return "json-viewer-theme-custom";
|
|
15930
|
+
return props.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light";
|
|
15931
|
+
}, [
|
|
15932
|
+
props.theme
|
|
15933
|
+
]);
|
|
15934
|
+
const onceRef = useRef11(true);
|
|
15935
|
+
const registerTypes = useTypeRegistryStore((store) => store.registerTypes);
|
|
15936
|
+
if (onceRef.current) {
|
|
15937
|
+
const allTypes = props.valueTypes ? [
|
|
15938
|
+
...predefinedTypes,
|
|
15939
|
+
...props.valueTypes
|
|
15940
|
+
] : [
|
|
15941
|
+
...predefinedTypes
|
|
15942
|
+
];
|
|
15943
|
+
registerTypes(allTypes);
|
|
15944
|
+
onceRef.current = false;
|
|
15945
|
+
}
|
|
15946
|
+
useEffect15(() => {
|
|
15947
|
+
const allTypes = props.valueTypes ? [
|
|
15948
|
+
...predefinedTypes,
|
|
15949
|
+
...props.valueTypes
|
|
15950
|
+
] : [
|
|
15951
|
+
...predefinedTypes
|
|
15952
|
+
];
|
|
15953
|
+
registerTypes(allTypes);
|
|
15954
|
+
}, [
|
|
15955
|
+
props.valueTypes,
|
|
15956
|
+
registerTypes
|
|
15957
|
+
]);
|
|
15958
|
+
const value = useJsonViewerStore((store) => store.value);
|
|
15959
|
+
const prevValue = useJsonViewerStore((store) => store.prevValue);
|
|
15960
|
+
const emptyPath = useMemo7(() => [], []);
|
|
15961
|
+
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
15962
|
+
const onMouseLeave = useCallback8(() => setHover(null), [
|
|
15963
|
+
setHover
|
|
15964
|
+
]);
|
|
15965
|
+
return /* @__PURE__ */ jsx129(Paper2, {
|
|
15966
|
+
elevation: 0,
|
|
15967
|
+
className: clsx(themeCls, props.className),
|
|
15968
|
+
style: props.style,
|
|
15969
|
+
sx: {
|
|
15970
|
+
fontFamily: "monospace",
|
|
15971
|
+
userSelect: "none",
|
|
15972
|
+
contentVisibility: "auto",
|
|
15973
|
+
...props.sx
|
|
15974
|
+
},
|
|
15975
|
+
onMouseLeave,
|
|
15976
|
+
children: /* @__PURE__ */ jsx129(DataKeyPair, {
|
|
15977
|
+
value,
|
|
15978
|
+
prevValue,
|
|
15979
|
+
path: emptyPath,
|
|
15980
|
+
last: true
|
|
15981
|
+
})
|
|
15982
|
+
});
|
|
15983
|
+
};
|
|
15984
|
+
var JsonViewer = function JsonViewer2(props) {
|
|
15985
|
+
if (true) {
|
|
15986
|
+
if ("displayObjectSize" in props) {
|
|
15987
|
+
console.error("`displayObjectSize` is deprecated. Use `displaySize` instead.\nSee https://viewer.textea.io/migration/migration-v3#raname-displayobjectsize-to-displaysize for more information.");
|
|
15988
|
+
}
|
|
15989
|
+
}
|
|
15990
|
+
const isAutoDarkTheme = useThemeDetector();
|
|
15991
|
+
const themeType = useMemo7(() => {
|
|
15992
|
+
var _props_theme;
|
|
15993
|
+
return props.theme === "auto" ? isAutoDarkTheme ? "dark" : "light" : (_props_theme = props.theme) !== null && _props_theme !== void 0 ? _props_theme : "light";
|
|
15994
|
+
}, [
|
|
15995
|
+
isAutoDarkTheme,
|
|
15996
|
+
props.theme
|
|
15997
|
+
]);
|
|
15998
|
+
const theme = useMemo7(() => {
|
|
15999
|
+
const backgroundColor = typeof themeType === "object" ? themeType.base00 : themeType === "dark" ? darkColorspace.base00 : lightColorspace.base00;
|
|
16000
|
+
const foregroundColor = typeof themeType === "object" ? themeType.base07 : themeType === "dark" ? darkColorspace.base07 : lightColorspace.base07;
|
|
16001
|
+
return createTheme({
|
|
16002
|
+
components: {
|
|
16003
|
+
MuiPaper: {
|
|
16004
|
+
styleOverrides: {
|
|
16005
|
+
root: {
|
|
16006
|
+
backgroundColor,
|
|
16007
|
+
color: foregroundColor
|
|
16008
|
+
}
|
|
16009
|
+
}
|
|
16010
|
+
}
|
|
16011
|
+
},
|
|
16012
|
+
palette: {
|
|
16013
|
+
mode: themeType === "dark" ? "dark" : "light",
|
|
16014
|
+
background: {
|
|
16015
|
+
default: backgroundColor
|
|
16016
|
+
}
|
|
16017
|
+
}
|
|
16018
|
+
});
|
|
16019
|
+
}, [
|
|
16020
|
+
themeType
|
|
16021
|
+
]);
|
|
16022
|
+
const mixedProps = {
|
|
16023
|
+
...props,
|
|
16024
|
+
theme: themeType
|
|
16025
|
+
};
|
|
16026
|
+
const jsonViewerStore = useMemo7(() => createJsonViewerStore(props), []);
|
|
16027
|
+
const typeRegistryStore = useMemo7(() => createTypeRegistryStore(), []);
|
|
16028
|
+
return /* @__PURE__ */ jsx129(ThemeProvider, {
|
|
16029
|
+
theme,
|
|
16030
|
+
children: /* @__PURE__ */ jsx129(TypeRegistryStoreContext.Provider, {
|
|
16031
|
+
value: typeRegistryStore,
|
|
16032
|
+
children: /* @__PURE__ */ jsx129(JsonViewerStoreContext.Provider, {
|
|
16033
|
+
value: jsonViewerStore,
|
|
16034
|
+
children: /* @__PURE__ */ jsx129(JsonViewerInner, {
|
|
16035
|
+
...mixedProps
|
|
16036
|
+
})
|
|
16037
|
+
})
|
|
16038
|
+
})
|
|
16039
|
+
});
|
|
16040
|
+
};
|
|
16041
|
+
|
|
16042
|
+
// src/components/event-details/event-details.tsx
|
|
16043
|
+
import { memo as memo10, useMemo as useMemo11, useState as useState13 } from "react";
|
|
16044
|
+
|
|
16045
|
+
// src/utils/iam-utils.ts
|
|
16046
|
+
function determinePermissionStatus(payload) {
|
|
16047
|
+
if (payload.explicit_deny_count && payload.explicit_deny_count > 0) {
|
|
16048
|
+
return "explicitly_denied";
|
|
16049
|
+
}
|
|
16050
|
+
if (payload.is_allowed && payload.explicit_allow_count && payload.explicit_allow_count > 0) {
|
|
16051
|
+
return "explicitly_allowed";
|
|
16052
|
+
}
|
|
16053
|
+
if (payload.is_allowed) {
|
|
16054
|
+
return "implicitly_allowed";
|
|
16055
|
+
}
|
|
16056
|
+
return "implicitly_denied";
|
|
16057
|
+
}
|
|
16058
|
+
function formatPermissionStatus(status) {
|
|
16059
|
+
switch (status) {
|
|
16060
|
+
case "explicitly_allowed": {
|
|
16061
|
+
return "Explicitly Allowed";
|
|
16062
|
+
}
|
|
16063
|
+
case "explicitly_denied": {
|
|
16064
|
+
return "Explicitly Denied";
|
|
16065
|
+
}
|
|
16066
|
+
case "implicitly_allowed": {
|
|
16067
|
+
return "Implicitly Allowed";
|
|
16068
|
+
}
|
|
16069
|
+
case "implicitly_denied": {
|
|
16070
|
+
return "Implicitly Denied";
|
|
16071
|
+
}
|
|
16072
|
+
}
|
|
16073
|
+
}
|
|
16074
|
+
function getPermissionStatusColor(status) {
|
|
16075
|
+
switch (status) {
|
|
16076
|
+
case "explicitly_allowed":
|
|
16077
|
+
case "implicitly_allowed": {
|
|
16078
|
+
return "success.main";
|
|
16079
|
+
}
|
|
16080
|
+
case "explicitly_denied": {
|
|
16081
|
+
return "error.main";
|
|
16082
|
+
}
|
|
16083
|
+
case "implicitly_denied": {
|
|
16084
|
+
return "warning.main";
|
|
16085
|
+
}
|
|
16086
|
+
}
|
|
16087
|
+
}
|
|
16088
|
+
function parseIAMEvent(payloadString) {
|
|
16089
|
+
try {
|
|
16090
|
+
const payload = JSON.parse(payloadString);
|
|
16091
|
+
const permission = determinePermissionStatus(payload);
|
|
16092
|
+
const actions = [];
|
|
16093
|
+
const resources = [];
|
|
16094
|
+
if (payload.explicit_allows) {
|
|
16095
|
+
for (const allow of payload.explicit_allows) {
|
|
16096
|
+
if (!actions.includes(allow.action)) actions.push(allow.action);
|
|
16097
|
+
if (!resources.includes(allow.resource)) resources.push(allow.resource);
|
|
16098
|
+
}
|
|
16099
|
+
}
|
|
16100
|
+
if (payload.explicit_denies) {
|
|
16101
|
+
for (const deny of payload.explicit_denies) {
|
|
16102
|
+
if (!actions.includes(deny.action)) actions.push(deny.action);
|
|
16103
|
+
if (!resources.includes(deny.resource)) resources.push(deny.resource);
|
|
16104
|
+
}
|
|
16105
|
+
}
|
|
16106
|
+
if (payload.implicit_denies) {
|
|
16107
|
+
for (const deny of payload.implicit_denies) {
|
|
16108
|
+
if (!actions.includes(deny.action)) actions.push(deny.action);
|
|
16109
|
+
if (!resources.includes(deny.resource)) resources.push(deny.resource);
|
|
16110
|
+
}
|
|
16111
|
+
}
|
|
16112
|
+
return {
|
|
16113
|
+
details: {
|
|
16114
|
+
actions,
|
|
16115
|
+
explicitAllows: payload.explicit_allow_count,
|
|
16116
|
+
explicitDenies: payload.explicit_deny_count,
|
|
16117
|
+
implicitDenies: payload.implicit_deny_count,
|
|
16118
|
+
resources
|
|
16119
|
+
},
|
|
16120
|
+
operation: payload.operation,
|
|
16121
|
+
permission,
|
|
16122
|
+
principal: payload.principal_arn,
|
|
16123
|
+
service: payload.service
|
|
16124
|
+
};
|
|
16125
|
+
} catch (error) {
|
|
16126
|
+
console.error("Error parsing IAM event payload:", error);
|
|
16127
|
+
return void 0;
|
|
16128
|
+
}
|
|
16129
|
+
}
|
|
16130
|
+
|
|
16131
|
+
// src/utils/event-utils.ts
|
|
16132
|
+
var iamEventParser = (eventName, attributes) => {
|
|
16133
|
+
if (attributes?.payload && typeof attributes.payload === "string") {
|
|
16134
|
+
const parsedIAM = parseIAMEvent(attributes.payload);
|
|
16135
|
+
if (parsedIAM) {
|
|
16136
|
+
const headline2 = `${parsedIAM.service}:${parsedIAM.operation} - ${formatPermissionStatus(parsedIAM.permission)}`;
|
|
16137
|
+
const messageParts = [`Principal: ${parsedIAM.principal}`];
|
|
16138
|
+
if (parsedIAM.details.actions && parsedIAM.details.actions.length > 0) {
|
|
16139
|
+
messageParts.push(`Actions: ${parsedIAM.details.actions.join(", ")}`);
|
|
16140
|
+
}
|
|
16141
|
+
if (parsedIAM.details.resources && parsedIAM.details.resources.length > 0) {
|
|
16142
|
+
messageParts.push(`Resources: ${parsedIAM.details.resources.join(", ")}`);
|
|
16143
|
+
}
|
|
16144
|
+
const detailsParts = [];
|
|
16145
|
+
if (parsedIAM.details.explicitAllows !== void 0) {
|
|
16146
|
+
detailsParts.push(`Explicit Allows: ${String(parsedIAM.details.explicitAllows)}`);
|
|
16147
|
+
}
|
|
16148
|
+
if (parsedIAM.details.explicitDenies !== void 0) {
|
|
16149
|
+
detailsParts.push(`Explicit Denies: ${String(parsedIAM.details.explicitDenies)}`);
|
|
16150
|
+
}
|
|
16151
|
+
if (parsedIAM.details.implicitDenies !== void 0) {
|
|
16152
|
+
detailsParts.push(`Implicit Denies: ${String(parsedIAM.details.implicitDenies)}`);
|
|
16153
|
+
}
|
|
16154
|
+
return {
|
|
16155
|
+
details: detailsParts.join("\n"),
|
|
16156
|
+
headline: headline2,
|
|
16157
|
+
message: messageParts.join("\n")
|
|
16158
|
+
};
|
|
16159
|
+
}
|
|
16160
|
+
}
|
|
16161
|
+
const headline = eventName || "IAM Event";
|
|
13972
16162
|
const message = typeof attributes?.message === "string" ? attributes.message : "";
|
|
13973
16163
|
const details = typeof attributes?.details === "string" ? attributes.details : "";
|
|
13974
16164
|
return { details, headline, message };
|
|
@@ -14046,45 +16236,10 @@ var getEventGroupsByType = (events) => {
|
|
|
14046
16236
|
return groups;
|
|
14047
16237
|
};
|
|
14048
16238
|
|
|
14049
|
-
// src/components/event-details/event-details-header.tsx
|
|
14050
|
-
import { Close } from "@mui/icons-material";
|
|
14051
|
-
import { Box as Box6, IconButton, Typography as Typography4 } from "@mui/material";
|
|
14052
|
-
import { jsx as jsx129, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
14053
|
-
var EventDetailsHeader = ({ event, onClose }) => {
|
|
14054
|
-
return /* @__PURE__ */ jsxs123(
|
|
14055
|
-
Box6,
|
|
14056
|
-
{
|
|
14057
|
-
sx: {
|
|
14058
|
-
alignItems: "center",
|
|
14059
|
-
borderBottom: "1px solid",
|
|
14060
|
-
borderColor: "divider",
|
|
14061
|
-
display: "flex",
|
|
14062
|
-
justifyContent: "space-between",
|
|
14063
|
-
p: 2
|
|
14064
|
-
},
|
|
14065
|
-
children: [
|
|
14066
|
-
/* @__PURE__ */ jsxs123(Box6, { children: [
|
|
14067
|
-
/* @__PURE__ */ jsx129(Typography4, { sx: { fontWeight: 600 }, variant: "h6", children: "Event Details" }),
|
|
14068
|
-
/* @__PURE__ */ jsxs123(Typography4, { color: "text.secondary", variant: "body2", children: [
|
|
14069
|
-
event.service_name,
|
|
14070
|
-
" ",
|
|
14071
|
-
"-",
|
|
14072
|
-
event.operation_name
|
|
14073
|
-
] })
|
|
14074
|
-
] }),
|
|
14075
|
-
onClose && /* @__PURE__ */ jsx129(IconButton, { onClick: onClose, size: "small", children: /* @__PURE__ */ jsx129(Close, {}) })
|
|
14076
|
-
]
|
|
14077
|
-
}
|
|
14078
|
-
);
|
|
14079
|
-
};
|
|
14080
|
-
|
|
14081
|
-
// src/components/event-details/event-section.tsx
|
|
14082
|
-
import { Box as Box12 } from "@mui/material";
|
|
14083
|
-
|
|
14084
16239
|
// src/components/event-details/event-detail.tsx
|
|
14085
16240
|
import { KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
|
|
14086
|
-
import { Box as Box10, Grid as Grid3, IconButton as
|
|
14087
|
-
import { useEffect as
|
|
16241
|
+
import { Box as Box10, Grid as Grid3, IconButton as IconButton2, Typography as Typography6 } from "@mui/material";
|
|
16242
|
+
import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef12, useState as useState10 } from "react";
|
|
14088
16243
|
|
|
14089
16244
|
// src/components/status-icon.tsx
|
|
14090
16245
|
import { Cancel, CheckCircle, Error as Error2, Info, RemoveCircle } from "@mui/icons-material";
|
|
@@ -14112,11 +16267,11 @@ var StatusIcon = ({ errorLevel }) => {
|
|
|
14112
16267
|
|
|
14113
16268
|
// src/components/event-details/iam-event-detail.tsx
|
|
14114
16269
|
import { CheckCircle as CheckCircle2, Error as ErrorIcon, Warning } from "@mui/icons-material";
|
|
14115
|
-
import { Box as Box8, Chip, Grid as Grid2, Typography as
|
|
16270
|
+
import { Box as Box8, Chip, Grid as Grid2, Typography as Typography4 } from "@mui/material";
|
|
14116
16271
|
import { jsx as jsx131, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
14117
16272
|
var DetailRow = ({ content, label }) => /* @__PURE__ */ jsxs124(Grid2, { container: true, spacing: 0, sx: { mb: 1 }, children: [
|
|
14118
16273
|
/* @__PURE__ */ jsx131(Grid2, { item: true, sx: { pr: 1 }, xs: 3, children: /* @__PURE__ */ jsx131(
|
|
14119
|
-
|
|
16274
|
+
Typography4,
|
|
14120
16275
|
{
|
|
14121
16276
|
sx: {
|
|
14122
16277
|
color: "text.secondary",
|
|
@@ -14127,7 +16282,7 @@ var DetailRow = ({ content, label }) => /* @__PURE__ */ jsxs124(Grid2, { contain
|
|
|
14127
16282
|
}
|
|
14128
16283
|
) }),
|
|
14129
16284
|
/* @__PURE__ */ jsx131(Grid2, { item: true, xs: 9, children: typeof content === "string" ? /* @__PURE__ */ jsx131(
|
|
14130
|
-
|
|
16285
|
+
Typography4,
|
|
14131
16286
|
{
|
|
14132
16287
|
sx: {
|
|
14133
16288
|
color: "text.primary",
|
|
@@ -14155,11 +16310,11 @@ var PermissionIcon = ({ status }) => {
|
|
|
14155
16310
|
var IAMEventDetail = ({ event }) => {
|
|
14156
16311
|
const payloadString = event.attributes?.payload;
|
|
14157
16312
|
if (!payloadString) {
|
|
14158
|
-
return /* @__PURE__ */ jsx131(Box8, { sx: { p: 2 }, children: /* @__PURE__ */ jsx131(
|
|
16313
|
+
return /* @__PURE__ */ jsx131(Box8, { sx: { p: 2 }, children: /* @__PURE__ */ jsx131(Typography4, { sx: { fontWeight: 600 }, variant: "body2", children: "No IAM policy evaluation data available" }) });
|
|
14159
16314
|
}
|
|
14160
16315
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
14161
16316
|
if (!parsedIAM) {
|
|
14162
|
-
return /* @__PURE__ */ jsx131(Box8, { sx: { p: 2 }, children: /* @__PURE__ */ jsx131(
|
|
16317
|
+
return /* @__PURE__ */ jsx131(Box8, { sx: { p: 2 }, children: /* @__PURE__ */ jsx131(Typography4, { sx: { fontWeight: 600 }, variant: "body2", children: "Failed to parse IAM event data" }) });
|
|
14163
16318
|
}
|
|
14164
16319
|
return /* @__PURE__ */ jsxs124(Box8, { sx: { p: 2 }, children: [
|
|
14165
16320
|
/* @__PURE__ */ jsx131(Box8, { sx: { mb: 2 }, children: /* @__PURE__ */ jsx131(
|
|
@@ -14181,7 +16336,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
14181
16336
|
DetailRow,
|
|
14182
16337
|
{
|
|
14183
16338
|
content: /* @__PURE__ */ jsx131(Box8, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsx131(
|
|
14184
|
-
|
|
16339
|
+
Typography4,
|
|
14185
16340
|
{
|
|
14186
16341
|
sx: {
|
|
14187
16342
|
color: "text.primary"
|
|
@@ -14198,7 +16353,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
14198
16353
|
DetailRow,
|
|
14199
16354
|
{
|
|
14200
16355
|
content: /* @__PURE__ */ jsx131(Box8, { children: parsedIAM.details.resources.map((resource) => /* @__PURE__ */ jsx131(
|
|
14201
|
-
|
|
16356
|
+
Typography4,
|
|
14202
16357
|
{
|
|
14203
16358
|
sx: {
|
|
14204
16359
|
color: "text.primary",
|
|
@@ -14213,19 +16368,19 @@ var IAMEventDetail = ({ event }) => {
|
|
|
14213
16368
|
}
|
|
14214
16369
|
),
|
|
14215
16370
|
/* @__PURE__ */ jsxs124(Box8, { sx: { mt: 2 }, children: [
|
|
14216
|
-
/* @__PURE__ */ jsx131(
|
|
16371
|
+
/* @__PURE__ */ jsx131(Typography4, { sx: { fontWeight: 600, mb: 1 }, variant: "caption", children: "Policy Evaluation" }),
|
|
14217
16372
|
/* @__PURE__ */ jsxs124(Grid2, { container: true, spacing: 2, children: [
|
|
14218
16373
|
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ jsx131(Grid2, { item: true, xs: 4, children: /* @__PURE__ */ jsxs124(Box8, { sx: { textAlign: "center" }, children: [
|
|
14219
|
-
/* @__PURE__ */ jsx131(
|
|
14220
|
-
/* @__PURE__ */ jsx131(
|
|
16374
|
+
/* @__PURE__ */ jsx131(Typography4, { color: "success.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitAllows }),
|
|
16375
|
+
/* @__PURE__ */ jsx131(Typography4, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Allows" })
|
|
14221
16376
|
] }) }),
|
|
14222
16377
|
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ jsx131(Grid2, { item: true, xs: 4, children: /* @__PURE__ */ jsxs124(Box8, { sx: { textAlign: "center" }, children: [
|
|
14223
|
-
/* @__PURE__ */ jsx131(
|
|
14224
|
-
/* @__PURE__ */ jsx131(
|
|
16378
|
+
/* @__PURE__ */ jsx131(Typography4, { color: "error.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitDenies }),
|
|
16379
|
+
/* @__PURE__ */ jsx131(Typography4, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Denies" })
|
|
14225
16380
|
] }) }),
|
|
14226
16381
|
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ jsx131(Grid2, { item: true, xs: 4, children: /* @__PURE__ */ jsxs124(Box8, { sx: { textAlign: "center" }, children: [
|
|
14227
|
-
/* @__PURE__ */ jsx131(
|
|
14228
|
-
/* @__PURE__ */ jsx131(
|
|
16382
|
+
/* @__PURE__ */ jsx131(Typography4, { color: "warning.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.implicitDenies }),
|
|
16383
|
+
/* @__PURE__ */ jsx131(Typography4, { sx: { fontWeight: 600 }, variant: "caption", children: "Implicit Denies" })
|
|
14229
16384
|
] }) })
|
|
14230
16385
|
] })
|
|
14231
16386
|
] })
|
|
@@ -14234,8 +16389,8 @@ var IAMEventDetail = ({ event }) => {
|
|
|
14234
16389
|
|
|
14235
16390
|
// src/components/event-details/iam-permission-detail.tsx
|
|
14236
16391
|
import { KeyboardArrowDown, KeyboardArrowRight } from "@mui/icons-material";
|
|
14237
|
-
import { Box as Box9, Chip as Chip2, IconButton
|
|
14238
|
-
import { useMemo as
|
|
16392
|
+
import { Box as Box9, Chip as Chip2, IconButton, Typography as Typography5 } from "@mui/material";
|
|
16393
|
+
import { useMemo as useMemo8, useState as useState9 } from "react";
|
|
14239
16394
|
import { jsx as jsx132, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
14240
16395
|
var getChipColors = (status) => {
|
|
14241
16396
|
const isAllowed = status === "explicitly_allowed" || status === "implicitly_allowed";
|
|
@@ -14245,8 +16400,8 @@ var getChipColors = (status) => {
|
|
|
14245
16400
|
};
|
|
14246
16401
|
};
|
|
14247
16402
|
var IAMPermissionItem = ({ event }) => {
|
|
14248
|
-
const [isOpen, setIsOpen] =
|
|
14249
|
-
const parsedData =
|
|
16403
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
16404
|
+
const parsedData = useMemo8(() => {
|
|
14250
16405
|
const payloadString = event.attributes?.payload;
|
|
14251
16406
|
if (!payloadString) {
|
|
14252
16407
|
return;
|
|
@@ -14266,7 +16421,7 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
14266
16421
|
const { chipColors, parsedIAM } = parsedData;
|
|
14267
16422
|
return /* @__PURE__ */ jsxs125(Box9, { sx: { mb: 1 }, children: [
|
|
14268
16423
|
/* @__PURE__ */ jsxs125(Box9, { sx: { alignItems: "center", display: "flex" }, children: [
|
|
14269
|
-
/* @__PURE__ */ jsx132(
|
|
16424
|
+
/* @__PURE__ */ jsx132(IconButton, { onClick: () => {
|
|
14270
16425
|
setIsOpen(!isOpen);
|
|
14271
16426
|
}, size: "small", sx: { mr: 1, p: 0 }, children: isOpen ? /* @__PURE__ */ jsx132(KeyboardArrowDown, {}) : /* @__PURE__ */ jsx132(KeyboardArrowRight, {}) }),
|
|
14272
16427
|
/* @__PURE__ */ jsx132(
|
|
@@ -14282,18 +16437,18 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
14282
16437
|
)
|
|
14283
16438
|
] }),
|
|
14284
16439
|
isOpen && /* @__PURE__ */ jsx132(Box9, { sx: { ml: 4, mt: 1 }, children: /* @__PURE__ */ jsxs125(Box9, { children: [
|
|
14285
|
-
/* @__PURE__ */ jsx132(
|
|
14286
|
-
/* @__PURE__ */ jsx132(
|
|
16440
|
+
/* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
16441
|
+
/* @__PURE__ */ jsx132(Typography5, { variant: "body2", children: parsedIAM.principal })
|
|
14287
16442
|
] }) })
|
|
14288
16443
|
] });
|
|
14289
16444
|
};
|
|
14290
16445
|
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ jsx132(Box9, { sx: { mt: 2 }, children: events.map((event) => /* @__PURE__ */ jsx132(IAMPermissionItem, { event }, `${event.span_id}-${event.event_id}`)) });
|
|
14291
16446
|
|
|
14292
16447
|
// src/components/event-details/event-detail.tsx
|
|
14293
|
-
import { Fragment as
|
|
16448
|
+
import { Fragment as Fragment6, jsx as jsx133, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
14294
16449
|
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs126(Grid3, { container: true, spacing: 0, sx: { mb: 1 }, children: [
|
|
14295
16450
|
/* @__PURE__ */ jsx133(Grid3, { item: true, sx: { pr: 1 }, xs: 3, children: /* @__PURE__ */ jsx133(
|
|
14296
|
-
|
|
16451
|
+
Typography6,
|
|
14297
16452
|
{
|
|
14298
16453
|
sx: {
|
|
14299
16454
|
color: "text.primary",
|
|
@@ -14304,7 +16459,7 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs126(Grid3, { contai
|
|
|
14304
16459
|
}
|
|
14305
16460
|
) }),
|
|
14306
16461
|
/* @__PURE__ */ jsx133(Grid3, { item: true, xs: 9, children: typeof content === "string" ? /* @__PURE__ */ jsx133(
|
|
14307
|
-
|
|
16462
|
+
Typography6,
|
|
14308
16463
|
{
|
|
14309
16464
|
sx: {
|
|
14310
16465
|
color: "text.primary",
|
|
@@ -14316,15 +16471,15 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs126(Grid3, { contai
|
|
|
14316
16471
|
) : content })
|
|
14317
16472
|
] });
|
|
14318
16473
|
var EventMessage = ({ event }) => {
|
|
14319
|
-
const [isOpen, setIsOpen] =
|
|
14320
|
-
const [isOverflowing, setIsOverflowing] =
|
|
14321
|
-
const textReference =
|
|
14322
|
-
const parsedMessage =
|
|
14323
|
-
const isIAMPolicyEvent =
|
|
16474
|
+
const [isOpen, setIsOpen] = useState10(false);
|
|
16475
|
+
const [isOverflowing, setIsOverflowing] = useState10(false);
|
|
16476
|
+
const textReference = useRef12(null);
|
|
16477
|
+
const parsedMessage = useMemo9(() => parseEventMessage(event), [event]);
|
|
16478
|
+
const isIAMPolicyEvent = useMemo9(
|
|
14324
16479
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
14325
16480
|
[event]
|
|
14326
16481
|
);
|
|
14327
|
-
|
|
16482
|
+
useEffect16(() => {
|
|
14328
16483
|
const checkOverflow = () => {
|
|
14329
16484
|
const element = textReference.current;
|
|
14330
16485
|
if (element) {
|
|
@@ -14337,18 +16492,18 @@ var EventMessage = ({ event }) => {
|
|
|
14337
16492
|
window.removeEventListener("resize", checkOverflow);
|
|
14338
16493
|
};
|
|
14339
16494
|
}, [parsedMessage.headline]);
|
|
14340
|
-
const hasAdditionalContent =
|
|
16495
|
+
const hasAdditionalContent = useMemo9(
|
|
14341
16496
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
14342
16497
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
14343
16498
|
);
|
|
14344
|
-
const shouldShowToggle =
|
|
16499
|
+
const shouldShowToggle = useMemo9(
|
|
14345
16500
|
() => isOverflowing || hasAdditionalContent,
|
|
14346
16501
|
[isOverflowing, hasAdditionalContent]
|
|
14347
16502
|
);
|
|
14348
16503
|
return /* @__PURE__ */ jsxs126(Box10, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
14349
16504
|
/* @__PURE__ */ jsxs126(Box10, { sx: { alignItems: "flex-start", display: "flex" }, children: [
|
|
14350
16505
|
Boolean(shouldShowToggle) && /* @__PURE__ */ jsx133(
|
|
14351
|
-
|
|
16506
|
+
IconButton2,
|
|
14352
16507
|
{
|
|
14353
16508
|
onClick: () => {
|
|
14354
16509
|
setIsOpen(!isOpen);
|
|
@@ -14359,7 +16514,7 @@ var EventMessage = ({ event }) => {
|
|
|
14359
16514
|
}
|
|
14360
16515
|
),
|
|
14361
16516
|
/* @__PURE__ */ jsx133(
|
|
14362
|
-
|
|
16517
|
+
Typography6,
|
|
14363
16518
|
{
|
|
14364
16519
|
ref: textReference,
|
|
14365
16520
|
sx: {
|
|
@@ -14376,7 +16531,7 @@ var EventMessage = ({ event }) => {
|
|
|
14376
16531
|
}
|
|
14377
16532
|
)
|
|
14378
16533
|
] }),
|
|
14379
|
-
isOpen && /* @__PURE__ */ jsx133(Box10, { sx: { ml: 4, mt: 1 }, children: isIAMPolicyEvent ? /* @__PURE__ */ jsx133(IAMEventDetail, { event }) : /* @__PURE__ */ jsxs126(
|
|
16534
|
+
isOpen && /* @__PURE__ */ jsx133(Box10, { sx: { ml: 4, mt: 1 }, children: isIAMPolicyEvent ? /* @__PURE__ */ jsx133(IAMEventDetail, { event }) : /* @__PURE__ */ jsxs126(Fragment6, { children: [
|
|
14380
16535
|
Boolean(parsedMessage.message) && /* @__PURE__ */ jsx133(DetailRow2, { content: parsedMessage.message, label: "Message:" }),
|
|
14381
16536
|
Boolean(parsedMessage.details) && /* @__PURE__ */ jsx133(DetailRow2, { content: parsedMessage.details, label: "Details:" })
|
|
14382
16537
|
] }) })
|
|
@@ -14417,7 +16572,7 @@ var EventDetail = ({
|
|
|
14417
16572
|
mb: 1
|
|
14418
16573
|
},
|
|
14419
16574
|
children: /* @__PURE__ */ jsx133(
|
|
14420
|
-
|
|
16575
|
+
Typography6,
|
|
14421
16576
|
{
|
|
14422
16577
|
sx: {
|
|
14423
16578
|
alignItems: "left",
|
|
@@ -14448,7 +16603,7 @@ var EventDetail = ({
|
|
|
14448
16603
|
children: [
|
|
14449
16604
|
/* @__PURE__ */ jsx133(StatusIcon, { errorLevel: eventLevel }),
|
|
14450
16605
|
/* @__PURE__ */ jsx133(
|
|
14451
|
-
|
|
16606
|
+
Typography6,
|
|
14452
16607
|
{
|
|
14453
16608
|
sx: {
|
|
14454
16609
|
alignItems: "left",
|
|
@@ -14480,85 +16635,6 @@ var EventDetail = ({
|
|
|
14480
16635
|
] });
|
|
14481
16636
|
};
|
|
14482
16637
|
|
|
14483
|
-
// src/components/event-details/toggle-section.tsx
|
|
14484
|
-
import { KeyboardArrowDown as KeyboardArrowDown3, KeyboardArrowRight as KeyboardArrowRight3 } from "@mui/icons-material";
|
|
14485
|
-
import { Box as Box11, Typography as Typography8 } from "@mui/material";
|
|
14486
|
-
import { useState as useState10 } from "react";
|
|
14487
|
-
import { jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
14488
|
-
var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
14489
|
-
const [isOpen, setIsOpen] = useState10(initialOpen);
|
|
14490
|
-
return /* @__PURE__ */ jsxs127(Box11, { sx: { mt: 4 }, children: [
|
|
14491
|
-
/* @__PURE__ */ jsx134(
|
|
14492
|
-
Box11,
|
|
14493
|
-
{
|
|
14494
|
-
onClick: () => {
|
|
14495
|
-
setIsOpen(!isOpen);
|
|
14496
|
-
},
|
|
14497
|
-
sx: {
|
|
14498
|
-
cursor: "pointer",
|
|
14499
|
-
mb: 1
|
|
14500
|
-
},
|
|
14501
|
-
children: /* @__PURE__ */ jsxs127(
|
|
14502
|
-
Box11,
|
|
14503
|
-
{
|
|
14504
|
-
role: "button",
|
|
14505
|
-
sx: {
|
|
14506
|
-
alignItems: "center",
|
|
14507
|
-
display: "flex",
|
|
14508
|
-
gap: 1
|
|
14509
|
-
},
|
|
14510
|
-
children: [
|
|
14511
|
-
/* @__PURE__ */ jsx134(Typography8, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
14512
|
-
isOpen ? /* @__PURE__ */ jsx134(KeyboardArrowDown3, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ jsx134(KeyboardArrowRight3, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
14513
|
-
]
|
|
14514
|
-
}
|
|
14515
|
-
)
|
|
14516
|
-
}
|
|
14517
|
-
),
|
|
14518
|
-
isOpen && /* @__PURE__ */ jsx134(Box11, { children })
|
|
14519
|
-
] });
|
|
14520
|
-
};
|
|
14521
|
-
|
|
14522
|
-
// src/components/event-details/event-section.tsx
|
|
14523
|
-
import { jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
14524
|
-
var EventSection = ({
|
|
14525
|
-
eventGroups,
|
|
14526
|
-
headline
|
|
14527
|
-
}) => /* @__PURE__ */ jsx135(ToggleSection, { headline, children: /* @__PURE__ */ jsxs128(Box12, { children: [
|
|
14528
|
-
eventGroups.errors && /* @__PURE__ */ jsx135(
|
|
14529
|
-
EventDetail,
|
|
14530
|
-
{
|
|
14531
|
-
displayText: "Error",
|
|
14532
|
-
events: eventGroups.errors,
|
|
14533
|
-
type: "error"
|
|
14534
|
-
}
|
|
14535
|
-
),
|
|
14536
|
-
eventGroups.warnings && /* @__PURE__ */ jsx135(
|
|
14537
|
-
EventDetail,
|
|
14538
|
-
{
|
|
14539
|
-
displayText: "Warning",
|
|
14540
|
-
events: eventGroups.warnings,
|
|
14541
|
-
type: "warning"
|
|
14542
|
-
}
|
|
14543
|
-
),
|
|
14544
|
-
eventGroups.permissions && /* @__PURE__ */ jsx135(
|
|
14545
|
-
EventDetail,
|
|
14546
|
-
{
|
|
14547
|
-
displayText: "IAM Permission",
|
|
14548
|
-
events: eventGroups.permissions,
|
|
14549
|
-
type: "permission"
|
|
14550
|
-
}
|
|
14551
|
-
),
|
|
14552
|
-
eventGroups.info && /* @__PURE__ */ jsx135(
|
|
14553
|
-
EventDetail,
|
|
14554
|
-
{
|
|
14555
|
-
displayText: "Info",
|
|
14556
|
-
events: eventGroups.info,
|
|
14557
|
-
type: "info"
|
|
14558
|
-
}
|
|
14559
|
-
)
|
|
14560
|
-
] }) });
|
|
14561
|
-
|
|
14562
16638
|
// node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
|
|
14563
16639
|
var getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
|
|
14564
16640
|
return {
|
|
@@ -14649,9 +16725,9 @@ var HttpRequest = class _HttpRequest {
|
|
|
14649
16725
|
return _HttpRequest.clone(this);
|
|
14650
16726
|
}
|
|
14651
16727
|
};
|
|
14652
|
-
function cloneQuery(
|
|
14653
|
-
return Object.keys(
|
|
14654
|
-
const param =
|
|
16728
|
+
function cloneQuery(query2) {
|
|
16729
|
+
return Object.keys(query2).reduce((carry, paramName) => {
|
|
16730
|
+
const param = query2[paramName];
|
|
14655
16731
|
return {
|
|
14656
16732
|
...carry,
|
|
14657
16733
|
[paramName]: Array.isArray(param) ? [...param] : param
|
|
@@ -14882,10 +16958,10 @@ var httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
|
14882
16958
|
if (!scheme) {
|
|
14883
16959
|
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
14884
16960
|
}
|
|
14885
|
-
const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
|
|
16961
|
+
const { httpAuthOption: { signingProperties = {} }, identity: identity2, signer } = scheme;
|
|
14886
16962
|
const output = await next({
|
|
14887
16963
|
...args,
|
|
14888
|
-
request: await signer.sign(args.request,
|
|
16964
|
+
request: await signer.sign(args.request, identity2, signingProperties)
|
|
14889
16965
|
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
14890
16966
|
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
14891
16967
|
return output;
|
|
@@ -15023,10 +17099,10 @@ var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
|
|
|
15023
17099
|
var hexEncode = (c3) => `%${c3.charCodeAt(0).toString(16).toUpperCase()}`;
|
|
15024
17100
|
|
|
15025
17101
|
// node_modules/@smithy/querystring-builder/dist-es/index.js
|
|
15026
|
-
function buildQueryString(
|
|
17102
|
+
function buildQueryString(query2) {
|
|
15027
17103
|
const parts = [];
|
|
15028
|
-
for (let key of Object.keys(
|
|
15029
|
-
const value =
|
|
17104
|
+
for (let key of Object.keys(query2).sort()) {
|
|
17105
|
+
const value = query2[key];
|
|
15030
17106
|
key = escapeUri(key);
|
|
15031
17107
|
if (Array.isArray(value)) {
|
|
15032
17108
|
for (let i2 = 0, iLen = value.length; i2 < iLen; i2++) {
|
|
@@ -15393,7 +17469,7 @@ var findHeader = (pattern, headers) => {
|
|
|
15393
17469
|
|
|
15394
17470
|
// node_modules/@smithy/querystring-parser/dist-es/index.js
|
|
15395
17471
|
function parseQueryString(querystring) {
|
|
15396
|
-
const
|
|
17472
|
+
const query2 = {};
|
|
15397
17473
|
querystring = querystring.replace(/^\?/, "");
|
|
15398
17474
|
if (querystring) {
|
|
15399
17475
|
for (const pair of querystring.split("&")) {
|
|
@@ -15402,16 +17478,16 @@ function parseQueryString(querystring) {
|
|
|
15402
17478
|
if (value) {
|
|
15403
17479
|
value = decodeURIComponent(value);
|
|
15404
17480
|
}
|
|
15405
|
-
if (!(key in
|
|
15406
|
-
|
|
15407
|
-
} else if (Array.isArray(
|
|
15408
|
-
|
|
17481
|
+
if (!(key in query2)) {
|
|
17482
|
+
query2[key] = value;
|
|
17483
|
+
} else if (Array.isArray(query2[key])) {
|
|
17484
|
+
query2[key].push(value);
|
|
15409
17485
|
} else {
|
|
15410
|
-
|
|
17486
|
+
query2[key] = [query2[key], value];
|
|
15411
17487
|
}
|
|
15412
17488
|
}
|
|
15413
17489
|
}
|
|
15414
|
-
return
|
|
17490
|
+
return query2;
|
|
15415
17491
|
}
|
|
15416
17492
|
|
|
15417
17493
|
// node_modules/@smithy/url-parser/dist-es/index.js
|
|
@@ -15420,16 +17496,16 @@ var parseUrl = (url) => {
|
|
|
15420
17496
|
return parseUrl(new URL(url));
|
|
15421
17497
|
}
|
|
15422
17498
|
const { hostname, pathname, port, protocol, search } = url;
|
|
15423
|
-
let
|
|
17499
|
+
let query2;
|
|
15424
17500
|
if (search) {
|
|
15425
|
-
|
|
17501
|
+
query2 = parseQueryString(search);
|
|
15426
17502
|
}
|
|
15427
17503
|
return {
|
|
15428
17504
|
hostname,
|
|
15429
17505
|
port: port ? parseInt(port) : void 0,
|
|
15430
17506
|
protocol,
|
|
15431
17507
|
path: pathname,
|
|
15432
|
-
query
|
|
17508
|
+
query: query2
|
|
15433
17509
|
};
|
|
15434
17510
|
};
|
|
15435
17511
|
|
|
@@ -15832,8 +17908,8 @@ var TypeRegistry = class _TypeRegistry {
|
|
|
15832
17908
|
}
|
|
15833
17909
|
register(shapeId, schema) {
|
|
15834
17910
|
const qualifiedName = this.normalizeShapeId(shapeId);
|
|
15835
|
-
for (const
|
|
15836
|
-
|
|
17911
|
+
for (const r3 of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) {
|
|
17912
|
+
r3.schemas.set(qualifiedName, schema);
|
|
15837
17913
|
}
|
|
15838
17914
|
}
|
|
15839
17915
|
getSchema(shapeId) {
|
|
@@ -15846,9 +17922,9 @@ var TypeRegistry = class _TypeRegistry {
|
|
|
15846
17922
|
registerError(es, ctor) {
|
|
15847
17923
|
const $error = es;
|
|
15848
17924
|
const ns = $error[1];
|
|
15849
|
-
for (const
|
|
15850
|
-
|
|
15851
|
-
|
|
17925
|
+
for (const r3 of [this, _TypeRegistry.for(ns)]) {
|
|
17926
|
+
r3.schemas.set(ns + "#" + $error[2], $error);
|
|
17927
|
+
r3.exceptions.set($error, ctor);
|
|
15852
17928
|
}
|
|
15853
17929
|
}
|
|
15854
17930
|
getErrorCtor(es) {
|
|
@@ -16366,7 +18442,7 @@ var HttpProtocol = class extends SerdeContext {
|
|
|
16366
18442
|
var RpcProtocol = class extends HttpProtocol {
|
|
16367
18443
|
async serializeRequest(operationSchema, input, context) {
|
|
16368
18444
|
const serializer = this.serializer;
|
|
16369
|
-
const
|
|
18445
|
+
const query2 = {};
|
|
16370
18446
|
const headers = {};
|
|
16371
18447
|
const endpoint = await context.endpoint();
|
|
16372
18448
|
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
@@ -16378,7 +18454,7 @@ var RpcProtocol = class extends HttpProtocol {
|
|
|
16378
18454
|
port: void 0,
|
|
16379
18455
|
path: "/",
|
|
16380
18456
|
fragment: void 0,
|
|
16381
|
-
query,
|
|
18457
|
+
query: query2,
|
|
16382
18458
|
headers,
|
|
16383
18459
|
body: void 0
|
|
16384
18460
|
});
|
|
@@ -16412,7 +18488,7 @@ var RpcProtocol = class extends HttpProtocol {
|
|
|
16412
18488
|
}
|
|
16413
18489
|
}
|
|
16414
18490
|
request.headers = Object.assign(request.headers, headers);
|
|
16415
|
-
request.query =
|
|
18491
|
+
request.query = query2;
|
|
16416
18492
|
request.body = payload;
|
|
16417
18493
|
request.method = "POST";
|
|
16418
18494
|
return request;
|
|
@@ -16492,12 +18568,12 @@ var DefaultIdentityProviderConfig = class {
|
|
|
16492
18568
|
};
|
|
16493
18569
|
|
|
16494
18570
|
// node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js
|
|
16495
|
-
var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(
|
|
16496
|
-
return doesIdentityRequireRefresh(
|
|
18571
|
+
var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity2) {
|
|
18572
|
+
return doesIdentityRequireRefresh(identity2) && identity2.expiration.getTime() - Date.now() < expirationMs;
|
|
16497
18573
|
};
|
|
16498
18574
|
var EXPIRATION_MS = 3e5;
|
|
16499
18575
|
var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
|
|
16500
|
-
var doesIdentityRequireRefresh = (
|
|
18576
|
+
var doesIdentityRequireRefresh = (identity2) => identity2.expiration !== void 0;
|
|
16501
18577
|
var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
16502
18578
|
if (provider === void 0) {
|
|
16503
18579
|
return void 0;
|
|
@@ -16730,9 +18806,9 @@ var parseURL = (value) => {
|
|
|
16730
18806
|
return value;
|
|
16731
18807
|
}
|
|
16732
18808
|
if (typeof value === "object" && "hostname" in value) {
|
|
16733
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
|
|
18809
|
+
const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query: query2 = {} } = value;
|
|
16734
18810
|
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
|
|
16735
|
-
url.search = Object.entries(
|
|
18811
|
+
url.search = Object.entries(query2).map(([k2, v2]) => `${k2}=${v2}`).join("&");
|
|
16736
18812
|
return url;
|
|
16737
18813
|
}
|
|
16738
18814
|
return new URL(value);
|
|
@@ -17469,7 +19545,7 @@ var validateSigningProperties = async (signingProperties) => {
|
|
|
17469
19545
|
};
|
|
17470
19546
|
};
|
|
17471
19547
|
var AwsSdkSigV4Signer = class {
|
|
17472
|
-
async sign(httpRequest,
|
|
19548
|
+
async sign(httpRequest, identity2, signingProperties) {
|
|
17473
19549
|
if (!HttpRequest.isInstance(httpRequest)) {
|
|
17474
19550
|
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
17475
19551
|
}
|
|
@@ -17811,18 +19887,18 @@ var hasHeader = (soughtHeader, headers) => {
|
|
|
17811
19887
|
|
|
17812
19888
|
// node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js
|
|
17813
19889
|
var moveHeadersToQuery = (request, options = {}) => {
|
|
17814
|
-
const { headers, query = {} } = HttpRequest.clone(request);
|
|
19890
|
+
const { headers, query: query2 = {} } = HttpRequest.clone(request);
|
|
17815
19891
|
for (const name of Object.keys(headers)) {
|
|
17816
19892
|
const lname = name.toLowerCase();
|
|
17817
19893
|
if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) {
|
|
17818
|
-
|
|
19894
|
+
query2[name] = headers[name];
|
|
17819
19895
|
delete headers[name];
|
|
17820
19896
|
}
|
|
17821
19897
|
}
|
|
17822
19898
|
return {
|
|
17823
19899
|
...request,
|
|
17824
19900
|
headers,
|
|
17825
|
-
query
|
|
19901
|
+
query: query2
|
|
17826
19902
|
};
|
|
17827
19903
|
};
|
|
17828
19904
|
|
|
@@ -17841,16 +19917,16 @@ var prepareRequest = (request) => {
|
|
|
17841
19917
|
init_dist_es();
|
|
17842
19918
|
|
|
17843
19919
|
// node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js
|
|
17844
|
-
var getCanonicalQuery = ({ query = {} }) => {
|
|
19920
|
+
var getCanonicalQuery = ({ query: query2 = {} }) => {
|
|
17845
19921
|
const keys = [];
|
|
17846
19922
|
const serialized = {};
|
|
17847
|
-
for (const key of Object.keys(
|
|
19923
|
+
for (const key of Object.keys(query2)) {
|
|
17848
19924
|
if (key.toLowerCase() === SIGNATURE_HEADER) {
|
|
17849
19925
|
continue;
|
|
17850
19926
|
}
|
|
17851
19927
|
const encodedKey = escapeUri(key);
|
|
17852
19928
|
keys.push(encodedKey);
|
|
17853
|
-
const value =
|
|
19929
|
+
const value = query2[key];
|
|
17854
19930
|
if (typeof value === "string") {
|
|
17855
19931
|
serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
|
|
17856
19932
|
} else if (Array.isArray(value)) {
|
|
@@ -19871,9 +21947,9 @@ async function checkFeatures(context, config, args) {
|
|
|
19871
21947
|
break;
|
|
19872
21948
|
}
|
|
19873
21949
|
}
|
|
19874
|
-
const
|
|
19875
|
-
if (
|
|
19876
|
-
const credentials =
|
|
21950
|
+
const identity2 = context.__smithy_context?.selectedHttpAuthScheme?.identity;
|
|
21951
|
+
if (identity2?.$source) {
|
|
21952
|
+
const credentials = identity2;
|
|
19877
21953
|
if (credentials.accountId) {
|
|
19878
21954
|
setFeature2(context, "RESOLVED_ACCOUNT_ID", "T");
|
|
19879
21955
|
}
|
|
@@ -21078,11 +23154,11 @@ var Sha2563 = (
|
|
|
21078
23154
|
|
|
21079
23155
|
// node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js
|
|
21080
23156
|
var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => async (config) => {
|
|
21081
|
-
const
|
|
21082
|
-
const uaString =
|
|
21083
|
-
const osName =
|
|
23157
|
+
const navigator2 = typeof window !== "undefined" ? window.navigator : void 0;
|
|
23158
|
+
const uaString = navigator2?.userAgent ?? "";
|
|
23159
|
+
const osName = navigator2?.userAgentData?.platform ?? fallback.os(uaString) ?? "other";
|
|
21084
23160
|
const osVersion = void 0;
|
|
21085
|
-
const brands =
|
|
23161
|
+
const brands = navigator2?.userAgentData?.brands ?? [];
|
|
21086
23162
|
const brand = brands[brands.length - 1];
|
|
21087
23163
|
const browserName = brand?.brand ?? fallback.browser(uaString) ?? "unknown";
|
|
21088
23164
|
const browserVersion = brand?.version ?? "unknown";
|
|
@@ -22042,15 +24118,15 @@ var resolveDefaultsModeConfig = ({ defaultsMode } = {}) => memoize2(async () =>
|
|
|
22042
24118
|
}
|
|
22043
24119
|
});
|
|
22044
24120
|
var useMobileConfiguration = () => {
|
|
22045
|
-
const
|
|
22046
|
-
if (
|
|
22047
|
-
const { effectiveType, rtt, downlink } =
|
|
24121
|
+
const navigator2 = window?.navigator;
|
|
24122
|
+
if (navigator2?.connection) {
|
|
24123
|
+
const { effectiveType, rtt, downlink } = navigator2?.connection;
|
|
22048
24124
|
const slow = typeof effectiveType === "string" && effectiveType !== "4g" || Number(rtt) > 100 || Number(downlink) < 10;
|
|
22049
24125
|
if (slow) {
|
|
22050
24126
|
return true;
|
|
22051
24127
|
}
|
|
22052
24128
|
}
|
|
22053
|
-
return
|
|
24129
|
+
return navigator2?.userAgentData?.mobile || typeof navigator2?.maxTouchPoints === "number" && navigator2?.maxTouchPoints > 1;
|
|
22054
24130
|
};
|
|
22055
24131
|
|
|
22056
24132
|
// node_modules/@aws-sdk/client-cloudwatch-logs/dist-es/runtimeConfig.shared.js
|
|
@@ -22078,10 +24154,10 @@ var n = {};
|
|
|
22078
24154
|
var o = { [x]: "Region" };
|
|
22079
24155
|
var p = { [v]: "getAttr", [w]: [{ [x]: g }, "supportsFIPS"] };
|
|
22080
24156
|
var q = { [v]: c2, [w]: [true, { [v]: "getAttr", [w]: [{ [x]: g }, "supportsDualStack"] }] };
|
|
22081
|
-
var
|
|
24157
|
+
var r2 = [l];
|
|
22082
24158
|
var s = [m];
|
|
22083
24159
|
var t = [o];
|
|
22084
|
-
var _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b2, [w]: [k] }], rules: [{ conditions:
|
|
24160
|
+
var _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b2, [w]: [k] }], rules: [{ conditions: r2, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b2, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c2, [w]: [a2, p] }, q], rules: [{ endpoint: { url: "https://logs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r2, rules: [{ conditions: [{ [v]: c2, [w]: [p, a2] }], rules: [{ conditions: [{ [v]: h, [w]: [o, "us-gov-east-1"] }], endpoint: { url: "https://logs.us-gov-east-1.amazonaws.com", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, "us-gov-west-1"] }], endpoint: { url: "https://logs.us-gov-west-1.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://logs-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://logs.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://logs.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
|
|
22085
24161
|
var ruleSet = _data;
|
|
22086
24162
|
|
|
22087
24163
|
// node_modules/@aws-sdk/client-cloudwatch-logs/dist-es/endpoint/endpointResolver.js
|
|
@@ -24246,17 +26322,17 @@ var QueryStatus = {
|
|
|
24246
26322
|
};
|
|
24247
26323
|
|
|
24248
26324
|
// src/components/event-details/lambda-invoke-logs-section.tsx
|
|
24249
|
-
import { Box as
|
|
24250
|
-
import { useEffect as
|
|
24251
|
-
import { jsx as
|
|
26325
|
+
import { Box as Box11, CircularProgress as CircularProgress2, Stack, Typography as Typography7 } from "@mui/material";
|
|
26326
|
+
import { useEffect as useEffect17, useMemo as useMemo10, useRef as useRef13, useState as useState11 } from "react";
|
|
26327
|
+
import { jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
24252
26328
|
var POLL_INTERVAL_MS = 1e3;
|
|
24253
26329
|
async function pollQueryResults(client, queryId) {
|
|
24254
26330
|
return client.send(new GetQueryResultsCommand({ queryId }));
|
|
24255
26331
|
}
|
|
24256
|
-
async function startLambdaLogsQuery(client,
|
|
26332
|
+
async function startLambdaLogsQuery(client, functionName2, requestId, startTimeSec, endTimeSec) {
|
|
24257
26333
|
const response = await client.send(new StartQueryCommand({
|
|
24258
26334
|
endTime: endTimeSec,
|
|
24259
|
-
logGroupName: `/aws/lambda/${
|
|
26335
|
+
logGroupName: `/aws/lambda/${functionName2}`,
|
|
24260
26336
|
queryString: `fields @timestamp, @message | filter @requestId = "${requestId}" | sort @timestamp asc`,
|
|
24261
26337
|
startTime: startTimeSec
|
|
24262
26338
|
}));
|
|
@@ -24265,7 +26341,7 @@ async function startLambdaLogsQuery(client, functionName, requestId, startTimeSe
|
|
|
24265
26341
|
}
|
|
24266
26342
|
function useCloudWatchLogsClient(region) {
|
|
24267
26343
|
const { localstackEndpoint } = useAppInspector();
|
|
24268
|
-
const client =
|
|
26344
|
+
const client = useMemo10(() => new CloudWatchLogsClient({
|
|
24269
26345
|
credentials: {
|
|
24270
26346
|
accessKeyId: "test",
|
|
24271
26347
|
secretAccessKey: "test"
|
|
@@ -24275,19 +26351,19 @@ function useCloudWatchLogsClient(region) {
|
|
|
24275
26351
|
}), [region, localstackEndpoint]);
|
|
24276
26352
|
return client;
|
|
24277
26353
|
}
|
|
24278
|
-
function useLambdaInvokeLogs(
|
|
26354
|
+
function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano) {
|
|
24279
26355
|
const [loading, setLoading] = useState11(true);
|
|
24280
26356
|
const [logs, setLogs] = useState11([]);
|
|
24281
26357
|
const [error, setError] = useState11();
|
|
24282
|
-
const pollTimerRef =
|
|
26358
|
+
const pollTimerRef = useRef13(null);
|
|
24283
26359
|
const cloudWatchLogs = useCloudWatchLogsClient(region);
|
|
24284
|
-
|
|
26360
|
+
useEffect17(() => {
|
|
24285
26361
|
let cancelled = false;
|
|
24286
26362
|
const startTimeSec = Math.floor(Number(BigInt(startTimeNano) / BigInt(1e9)));
|
|
24287
26363
|
const endTimeSec = Math.ceil(Number(BigInt(endTimeNano) / BigInt(1e9)));
|
|
24288
26364
|
async function run() {
|
|
24289
26365
|
try {
|
|
24290
|
-
const queryId = await startLambdaLogsQuery(cloudWatchLogs,
|
|
26366
|
+
const queryId = await startLambdaLogsQuery(cloudWatchLogs, functionName2, requestId, startTimeSec - 60, endTimeSec + 60);
|
|
24291
26367
|
const poll = async () => {
|
|
24292
26368
|
if (cancelled) return;
|
|
24293
26369
|
try {
|
|
@@ -24332,42 +26408,85 @@ function useLambdaInvokeLogs(functionName, requestId, region, startTimeNano, end
|
|
|
24332
26408
|
cancelled = true;
|
|
24333
26409
|
if (pollTimerRef.current !== null) clearTimeout(pollTimerRef.current);
|
|
24334
26410
|
};
|
|
24335
|
-
}, [
|
|
26411
|
+
}, [functionName2, requestId, region, startTimeNano, endTimeNano]);
|
|
24336
26412
|
return { error, loading, logs };
|
|
24337
26413
|
}
|
|
24338
|
-
var LambdaInvokeLogsSection = ({ endTimeNano, functionName, region, requestId, startTimeNano }) => {
|
|
24339
|
-
const { error, loading, logs } = useLambdaInvokeLogs(
|
|
26414
|
+
var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, region, requestId, startTimeNano }) => {
|
|
26415
|
+
const { error, loading, logs } = useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano);
|
|
24340
26416
|
if (loading) {
|
|
24341
|
-
return /* @__PURE__ */
|
|
24342
|
-
/* @__PURE__ */
|
|
24343
|
-
/* @__PURE__ */
|
|
26417
|
+
return /* @__PURE__ */ jsxs127(Stack, { alignItems: "center", direction: "row", spacing: 1, children: [
|
|
26418
|
+
/* @__PURE__ */ jsx134(CircularProgress2, { size: 14 }),
|
|
26419
|
+
/* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "body2", children: "Loading logs\u2026" })
|
|
24344
26420
|
] });
|
|
24345
26421
|
}
|
|
24346
26422
|
if (error !== void 0) {
|
|
24347
|
-
return /* @__PURE__ */
|
|
26423
|
+
return /* @__PURE__ */ jsx134(Typography7, { color: "error", variant: "body2", children: error.message });
|
|
24348
26424
|
}
|
|
24349
26425
|
if (logs.length === 0) {
|
|
24350
|
-
return /* @__PURE__ */
|
|
26426
|
+
return /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "body2", children: "No logs found for this invocation." });
|
|
24351
26427
|
}
|
|
24352
|
-
return /* @__PURE__ */
|
|
26428
|
+
return /* @__PURE__ */ jsx134(Box11, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ jsx134("pre", { style: { margin: 0, overflow: "auto" }, children: logs.map((log) => /* @__PURE__ */ jsx134(Typography7, { variant: "body2", children: `[${log.timestamp}] ${log.message}` }, log.ptr)) }) });
|
|
24353
26429
|
};
|
|
24354
26430
|
|
|
24355
|
-
// src/components/event-details/
|
|
24356
|
-
import {
|
|
24357
|
-
|
|
24358
|
-
|
|
24359
|
-
|
|
24360
|
-
|
|
24361
|
-
|
|
24362
|
-
|
|
24363
|
-
|
|
24364
|
-
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
|
|
24369
|
-
|
|
26431
|
+
// src/components/event-details/toggle-section.tsx
|
|
26432
|
+
import { KeyboardArrowDown as KeyboardArrowDown3, KeyboardArrowRight as KeyboardArrowRight3 } from "@mui/icons-material";
|
|
26433
|
+
import { Box as Box12, Typography as Typography8 } from "@mui/material";
|
|
26434
|
+
import { useState as useState12 } from "react";
|
|
26435
|
+
import { jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
26436
|
+
var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
26437
|
+
const [isOpen, setIsOpen] = useState12(initialOpen);
|
|
26438
|
+
return /* @__PURE__ */ jsxs128(Box12, { sx: { mt: 4 }, children: [
|
|
26439
|
+
/* @__PURE__ */ jsxs128(
|
|
26440
|
+
Box12,
|
|
26441
|
+
{
|
|
26442
|
+
onClick: () => {
|
|
26443
|
+
setIsOpen(!isOpen);
|
|
26444
|
+
},
|
|
26445
|
+
sx: {
|
|
26446
|
+
alignItems: "center",
|
|
26447
|
+
cursor: "pointer",
|
|
26448
|
+
display: "flex",
|
|
26449
|
+
justifyContent: "space-between",
|
|
26450
|
+
mb: 1
|
|
26451
|
+
},
|
|
26452
|
+
children: [
|
|
26453
|
+
/* @__PURE__ */ jsxs128(
|
|
26454
|
+
Box12,
|
|
26455
|
+
{
|
|
26456
|
+
role: "button",
|
|
26457
|
+
sx: {
|
|
26458
|
+
alignItems: "center",
|
|
26459
|
+
display: "flex",
|
|
26460
|
+
gap: 1
|
|
26461
|
+
},
|
|
26462
|
+
children: [
|
|
26463
|
+
/* @__PURE__ */ jsx135(Typography8, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
26464
|
+
isOpen ? /* @__PURE__ */ jsx135(KeyboardArrowDown3, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ jsx135(KeyboardArrowRight3, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
26465
|
+
]
|
|
26466
|
+
}
|
|
26467
|
+
),
|
|
26468
|
+
action !== false && /* @__PURE__ */ jsx135(Box12, { onClick: (event) => {
|
|
26469
|
+
event.stopPropagation();
|
|
26470
|
+
}, children: action })
|
|
26471
|
+
]
|
|
26472
|
+
}
|
|
26473
|
+
),
|
|
26474
|
+
isOpen && /* @__PURE__ */ jsx135(Box12, { children })
|
|
26475
|
+
] });
|
|
24370
26476
|
};
|
|
26477
|
+
|
|
26478
|
+
// src/components/event-details/event-details.tsx
|
|
26479
|
+
import { Fragment as Fragment7, jsx as jsx136, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
26480
|
+
function tryParseJson(value) {
|
|
26481
|
+
if (typeof value !== "string") {
|
|
26482
|
+
return value;
|
|
26483
|
+
}
|
|
26484
|
+
try {
|
|
26485
|
+
return JSON.parse(value);
|
|
26486
|
+
} catch {
|
|
26487
|
+
return value;
|
|
26488
|
+
}
|
|
26489
|
+
}
|
|
24371
26490
|
var checkIsLambdaInvoke = (span) => {
|
|
24372
26491
|
if (span.service_name !== "lambda") {
|
|
24373
26492
|
return false;
|
|
@@ -24375,97 +26494,157 @@ var checkIsLambdaInvoke = (span) => {
|
|
|
24375
26494
|
const operationName = span.operation_name.toLowerCase();
|
|
24376
26495
|
return operationName === "invoke" || operationName === "invokewithresponsestream" || operationName === "invokeasync";
|
|
24377
26496
|
};
|
|
26497
|
+
var checkIsSqsSendMessage = (span) => {
|
|
26498
|
+
if (span.service_name !== "sqs") {
|
|
26499
|
+
return false;
|
|
26500
|
+
}
|
|
26501
|
+
return span.operation_name.startsWith("SendMessage");
|
|
26502
|
+
};
|
|
24378
26503
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
24379
|
-
const
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
const
|
|
24384
|
-
const resourceArn = typeof selectedEvent?.attributes?.["localstack.aws.resource_arn"] === "string" ? selectedEvent.attributes["localstack.aws.resource_arn"] : void 0;
|
|
26504
|
+
const eventGroups = useMemo11(
|
|
26505
|
+
() => getEventGroupsByType(selectedEvent?.events ?? []),
|
|
26506
|
+
[selectedEvent?.events]
|
|
26507
|
+
);
|
|
26508
|
+
const [parseNestedJson, setParseNestedJson] = useState13(true);
|
|
24385
26509
|
if (!selectedEvent) {
|
|
24386
|
-
return /* @__PURE__ */
|
|
26510
|
+
return /* @__PURE__ */ jsx136(Box13, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx136(Typography9, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
24387
26511
|
}
|
|
24388
26512
|
const isLambdaInvoke = checkIsLambdaInvoke(selectedEvent);
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
26513
|
+
const isSqsSendMessage = checkIsSqsSendMessage(selectedEvent);
|
|
26514
|
+
const requestId = typeof selectedEvent.attributes?.["localstack.request_id"] === "string" ? selectedEvent.attributes["localstack.request_id"] : void 0;
|
|
26515
|
+
const resourceArn = typeof selectedEvent.attributes?.["localstack.aws.resource_arn"] === "string" ? selectedEvent.attributes["localstack.aws.resource_arn"] : void 0;
|
|
26516
|
+
const requestPayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.request"]);
|
|
26517
|
+
if (parseNestedJson) {
|
|
26518
|
+
if (isLambdaInvoke && requestPayload && typeof requestPayload === "object" && "Payload" in requestPayload) {
|
|
26519
|
+
requestPayload.Payload = tryParseJson(requestPayload.Payload);
|
|
26520
|
+
} else if (isSqsSendMessage && requestPayload && typeof requestPayload === "object" && "MessageBody" in requestPayload) {
|
|
26521
|
+
requestPayload.MessageBody = tryParseJson(requestPayload.MessageBody);
|
|
26522
|
+
}
|
|
26523
|
+
}
|
|
26524
|
+
const responsePayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.response"]);
|
|
26525
|
+
if (parseNestedJson && isLambdaInvoke && responsePayload && typeof responsePayload === "object" && "Payload" in responsePayload) {
|
|
26526
|
+
responsePayload.Payload = tryParseJson(responsePayload.Payload);
|
|
26527
|
+
}
|
|
26528
|
+
const exceptionPayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.exception"]);
|
|
26529
|
+
const hasPayloads = requestPayload !== void 0 || responsePayload !== void 0 || exceptionPayload !== void 0;
|
|
26530
|
+
const duration = selectedEvent.end_time_unix_nano ? ((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString() : void 0;
|
|
26531
|
+
return /* @__PURE__ */ jsxs129(Box13, { "data-testid": "event-details", sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
26532
|
+
/* @__PURE__ */ jsxs129(
|
|
26533
|
+
Box13,
|
|
26534
|
+
{
|
|
26535
|
+
sx: {
|
|
26536
|
+
alignItems: "center",
|
|
26537
|
+
borderBottom: "1px solid",
|
|
26538
|
+
borderColor: "divider",
|
|
26539
|
+
display: "flex",
|
|
26540
|
+
justifyContent: "space-between",
|
|
26541
|
+
px: 2,
|
|
26542
|
+
py: 1
|
|
26543
|
+
},
|
|
26544
|
+
children: [
|
|
26545
|
+
/* @__PURE__ */ jsx136(Box13, { children: /* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
|
|
26546
|
+
onClose && /* @__PURE__ */ jsx136(IconButton3, { onClick: onClose, size: "small", children: /* @__PURE__ */ jsx136(Close2, {}) })
|
|
26547
|
+
]
|
|
26548
|
+
}
|
|
26549
|
+
),
|
|
26550
|
+
/* @__PURE__ */ jsx136(Box13, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 2, children: [
|
|
26551
|
+
/* @__PURE__ */ jsx136(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 1, children: [
|
|
26552
|
+
/* @__PURE__ */ jsxs129(Box13, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
26553
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26554
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
26555
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.service_name })
|
|
26556
|
+
] }),
|
|
26557
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26558
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
|
|
26559
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.operation_name })
|
|
26560
|
+
] })
|
|
24415
26561
|
] }),
|
|
24416
|
-
/* @__PURE__ */
|
|
24417
|
-
/* @__PURE__ */
|
|
24418
|
-
/* @__PURE__ */
|
|
26562
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26563
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
26564
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.resource_name })
|
|
24419
26565
|
] }),
|
|
24420
|
-
Boolean(
|
|
24421
|
-
/* @__PURE__ */
|
|
24422
|
-
/* @__PURE__ */
|
|
26566
|
+
Boolean(resourceArn) && /* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26567
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource ARN" }),
|
|
26568
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: resourceArn })
|
|
24423
26569
|
] }),
|
|
24424
|
-
|
|
24425
|
-
/* @__PURE__ */
|
|
24426
|
-
|
|
24427
|
-
|
|
24428
|
-
|
|
24429
|
-
|
|
24430
|
-
|
|
24431
|
-
|
|
24432
|
-
|
|
24433
|
-
/* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
26570
|
+
/* @__PURE__ */ jsxs129(Box13, { sx: { display: "grid", gap: 1, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
26571
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26572
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Account" }),
|
|
26573
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.account_id })
|
|
26574
|
+
] }),
|
|
26575
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26576
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
26577
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.region })
|
|
26578
|
+
] })
|
|
24434
26579
|
] }),
|
|
24435
|
-
|
|
24436
|
-
/* @__PURE__ */
|
|
24437
|
-
|
|
24438
|
-
(
|
|
24439
|
-
|
|
24440
|
-
|
|
26580
|
+
/* @__PURE__ */ jsxs129(Box13, { sx: { display: "grid", gap: 1, gridTemplateColumns: duration === void 0 ? "1fr" : "1.3fr 1fr" }, children: [
|
|
26581
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26582
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
26583
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
26584
|
+
] }),
|
|
26585
|
+
duration !== void 0 && /* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26586
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
26587
|
+
/* @__PURE__ */ jsxs129(Typography9, { variant: "body2", children: [
|
|
26588
|
+
duration,
|
|
26589
|
+
"ms"
|
|
26590
|
+
] })
|
|
24441
26591
|
] })
|
|
26592
|
+
] }),
|
|
26593
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26594
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Status" }),
|
|
26595
|
+
/* @__PURE__ */ jsx136(Stack2, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 1, sx: { mb: eventGroups.errors || eventGroups.warnings ? 1 : 0 }, children: /* @__PURE__ */ jsx136(
|
|
26596
|
+
Chip3,
|
|
26597
|
+
{
|
|
26598
|
+
color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
|
|
26599
|
+
label: selectedEvent.status_code === 2 ? "Error" : selectedEvent.status_code === 1 ? "OK" : "Unset",
|
|
26600
|
+
size: "small"
|
|
26601
|
+
}
|
|
26602
|
+
) })
|
|
24442
26603
|
] })
|
|
24443
26604
|
] }) }),
|
|
24444
|
-
/* @__PURE__ */
|
|
24445
|
-
/* @__PURE__ */
|
|
24446
|
-
/* @__PURE__ */
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24454
|
-
|
|
24455
|
-
] }) }),
|
|
24456
|
-
selectedEvent.events.length > 0 && /* @__PURE__ */ jsxs130(Fragment6, { children: [
|
|
24457
|
-
/* @__PURE__ */ jsx137(Divider2, {}),
|
|
24458
|
-
/* @__PURE__ */ jsx137(
|
|
24459
|
-
EventSection,
|
|
26605
|
+
/* @__PURE__ */ jsx136(Divider2, {}),
|
|
26606
|
+
/* @__PURE__ */ jsxs129(ToggleSection, { headline: "Permissions", children: [
|
|
26607
|
+
!eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ jsx136(Typography9, { color: "text.secondary", variant: "body2", children: "There is no permission information available. Are IAM Policy Streams enabled?" }),
|
|
26608
|
+
eventGroups.permissions && /* @__PURE__ */ jsx136(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, type: "permission" }),
|
|
26609
|
+
eventGroups.errors && /* @__PURE__ */ jsx136(EventDetail, { displayText: "Error", events: eventGroups.errors, type: "error" }),
|
|
26610
|
+
eventGroups.warnings && /* @__PURE__ */ jsx136(EventDetail, { displayText: "Warning", events: eventGroups.warnings, type: "warning" })
|
|
26611
|
+
] }),
|
|
26612
|
+
hasPayloads && /* @__PURE__ */ jsxs129(Fragment7, { children: [
|
|
26613
|
+
/* @__PURE__ */ jsx136(Divider2, {}),
|
|
26614
|
+
/* @__PURE__ */ jsx136(
|
|
26615
|
+
ToggleSection,
|
|
24460
26616
|
{
|
|
24461
|
-
|
|
24462
|
-
|
|
26617
|
+
action: /* @__PURE__ */ jsx136(
|
|
26618
|
+
FormControlLabel2,
|
|
26619
|
+
{
|
|
26620
|
+
control: /* @__PURE__ */ jsx136(Switch, { checked: !parseNestedJson, onChange: (event) => {
|
|
26621
|
+
setParseNestedJson(!event.target.checked);
|
|
26622
|
+
}, size: "small" }),
|
|
26623
|
+
label: /* @__PURE__ */ jsx136(Typography9, { variant: "caption", children: "View raw data" }),
|
|
26624
|
+
sx: { mr: 0 }
|
|
26625
|
+
}
|
|
26626
|
+
),
|
|
26627
|
+
headline: "Payloads",
|
|
26628
|
+
children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 2, children: [
|
|
26629
|
+
requestPayload !== void 0 && /* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26630
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Request" }),
|
|
26631
|
+
/* @__PURE__ */ jsx136(PayloadViewer, { value: requestPayload })
|
|
26632
|
+
] }),
|
|
26633
|
+
responsePayload !== void 0 && /* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26634
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Response" }),
|
|
26635
|
+
/* @__PURE__ */ jsx136(PayloadViewer, { value: responsePayload })
|
|
26636
|
+
] }),
|
|
26637
|
+
exceptionPayload !== void 0 && /* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26638
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Exception" }),
|
|
26639
|
+
/* @__PURE__ */ jsx136(PayloadViewer, { value: exceptionPayload })
|
|
26640
|
+
] })
|
|
26641
|
+
] })
|
|
24463
26642
|
}
|
|
24464
26643
|
)
|
|
24465
26644
|
] }),
|
|
24466
|
-
isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */
|
|
24467
|
-
/* @__PURE__ */
|
|
24468
|
-
/* @__PURE__ */
|
|
26645
|
+
isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */ jsxs129(Fragment7, { children: [
|
|
26646
|
+
/* @__PURE__ */ jsx136(Divider2, {}),
|
|
26647
|
+
/* @__PURE__ */ jsx136(ToggleSection, { headline: "Lambda Logs", children: /* @__PURE__ */ jsx136(
|
|
24469
26648
|
LambdaInvokeLogsSection,
|
|
24470
26649
|
{
|
|
24471
26650
|
endTimeNano: selectedEvent.end_time_unix_nano ?? selectedEvent.start_time_unix_nano,
|
|
@@ -24476,58 +26655,72 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
24476
26655
|
}
|
|
24477
26656
|
) })
|
|
24478
26657
|
] }),
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
/* @__PURE__ */
|
|
24482
|
-
/* @__PURE__ */
|
|
24483
|
-
|
|
24484
|
-
] },
|
|
24485
|
-
|
|
26658
|
+
/* @__PURE__ */ jsx136(Divider2, {}),
|
|
26659
|
+
/* @__PURE__ */ jsx136(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 1, children: [
|
|
26660
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26661
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
26662
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.span_id })
|
|
26663
|
+
] }),
|
|
26664
|
+
/* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26665
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
26666
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: selectedEvent.trace_id })
|
|
26667
|
+
] }),
|
|
26668
|
+
requestId !== void 0 && /* @__PURE__ */ jsxs129(Box13, { children: [
|
|
26669
|
+
/* @__PURE__ */ jsx136(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Request ID" }),
|
|
26670
|
+
/* @__PURE__ */ jsx136(Typography9, { variant: "body2", children: requestId })
|
|
26671
|
+
] }),
|
|
26672
|
+
eventGroups.info && /* @__PURE__ */ jsx136(EventDetail, { displayText: "Info", events: eventGroups.info, type: "info" })
|
|
26673
|
+
] }) })
|
|
24486
26674
|
] }) })
|
|
24487
26675
|
] });
|
|
24488
26676
|
};
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
|
|
26677
|
+
var PayloadViewer = memo10(({ value }) => {
|
|
26678
|
+
const theme = useTheme3();
|
|
26679
|
+
return /* @__PURE__ */ jsx136(Box13, { sx: { backgroundColor: "background.default", borderRadius: 1, fontSize: 12, overflow: "auto", p: 1 }, children: /* @__PURE__ */ jsx136(
|
|
26680
|
+
JsonViewer,
|
|
26681
|
+
{
|
|
26682
|
+
displayDataTypes: false,
|
|
26683
|
+
displaySize: false,
|
|
26684
|
+
enableClipboard: false,
|
|
26685
|
+
rootName: false,
|
|
26686
|
+
theme: theme.palette.mode,
|
|
26687
|
+
value
|
|
26688
|
+
}
|
|
26689
|
+
) });
|
|
26690
|
+
});
|
|
24498
26691
|
|
|
24499
26692
|
// src/components/trace-graph/trace-graph.tsx
|
|
24500
26693
|
import "@xyflow/react/dist/base.css";
|
|
24501
|
-
import { Alert as Alert3, Button as Button4, useTheme as
|
|
24502
|
-
import { Background, ReactFlow, useNodesState } from "@xyflow/react";
|
|
24503
|
-
import { useEffect as
|
|
26694
|
+
import { Alert as Alert3, Button as Button4, useTheme as useTheme4 } from "@mui/material";
|
|
26695
|
+
import { Background, MarkerType, Position as Position2, ReactFlow, useEdgesState, useNodesState } from "@xyflow/react";
|
|
26696
|
+
import { useEffect as useEffect18 } from "react";
|
|
24504
26697
|
|
|
24505
26698
|
// src/components/trace-graph/service-node.tsx
|
|
24506
|
-
import { Box as
|
|
26699
|
+
import { Box as Box15, Stack as Stack3, Typography as Typography10 } from "@mui/material";
|
|
24507
26700
|
import "@xyflow/react/dist/style.css";
|
|
24508
26701
|
import { Handle, Position } from "@xyflow/react";
|
|
24509
|
-
import { memo as
|
|
26702
|
+
import { memo as memo11 } from "react";
|
|
24510
26703
|
|
|
24511
26704
|
// src/components/trace-graph/problem-indicator.tsx
|
|
24512
26705
|
import { Error as ErrorIcon2, Info as Info2, Warning as Warning2 } from "@mui/icons-material";
|
|
24513
|
-
import { Box as
|
|
24514
|
-
import { useMemo as
|
|
24515
|
-
import { jsx as
|
|
26706
|
+
import { Box as Box14, Tooltip as Tooltip3 } from "@mui/material";
|
|
26707
|
+
import { useMemo as useMemo12 } from "react";
|
|
26708
|
+
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
24516
26709
|
var ProblemIndicator = ({ error }) => {
|
|
24517
|
-
const icon =
|
|
26710
|
+
const icon = useMemo12(() => {
|
|
24518
26711
|
switch (error.level) {
|
|
24519
26712
|
case "error": {
|
|
24520
|
-
return /* @__PURE__ */
|
|
26713
|
+
return /* @__PURE__ */ jsx137(ErrorIcon2, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
24521
26714
|
}
|
|
24522
26715
|
case "warning": {
|
|
24523
|
-
return /* @__PURE__ */
|
|
26716
|
+
return /* @__PURE__ */ jsx137(Warning2, { sx: { color: "#ff9800", fontSize: "14px" } });
|
|
24524
26717
|
}
|
|
24525
26718
|
default: {
|
|
24526
|
-
return /* @__PURE__ */
|
|
26719
|
+
return /* @__PURE__ */ jsx137(Info2, { sx: { color: "#2196f3", fontSize: "14px" } });
|
|
24527
26720
|
}
|
|
24528
26721
|
}
|
|
24529
26722
|
}, [error.level]);
|
|
24530
|
-
const color2 =
|
|
26723
|
+
const color2 = useMemo12(() => {
|
|
24531
26724
|
switch (error.level) {
|
|
24532
26725
|
case "error": {
|
|
24533
26726
|
return "#d32f2f";
|
|
@@ -24540,8 +26733,8 @@ var ProblemIndicator = ({ error }) => {
|
|
|
24540
26733
|
}
|
|
24541
26734
|
}
|
|
24542
26735
|
}, [error.level]);
|
|
24543
|
-
return /* @__PURE__ */
|
|
24544
|
-
|
|
26736
|
+
return /* @__PURE__ */ jsx137(Tooltip3, { arrow: true, title: error.message ?? "Issue detected", children: /* @__PURE__ */ jsx137(
|
|
26737
|
+
Box14,
|
|
24545
26738
|
{
|
|
24546
26739
|
sx: {
|
|
24547
26740
|
alignItems: "center",
|
|
@@ -24560,17 +26753,17 @@ var ProblemIndicator = ({ error }) => {
|
|
|
24560
26753
|
};
|
|
24561
26754
|
|
|
24562
26755
|
// src/components/trace-graph/service-node.tsx
|
|
24563
|
-
import { jsx as
|
|
26756
|
+
import { jsx as jsx138, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
24564
26757
|
var handleStyle = {
|
|
24565
26758
|
backgroundColor: "white",
|
|
24566
26759
|
borderColor: "lightgray",
|
|
24567
26760
|
opacity: 0
|
|
24568
26761
|
};
|
|
24569
|
-
var ServiceNode =
|
|
26762
|
+
var ServiceNode = memo11(({ data, selected }) => {
|
|
24570
26763
|
const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
|
|
24571
|
-
return /* @__PURE__ */
|
|
24572
|
-
/* @__PURE__ */
|
|
24573
|
-
|
|
26764
|
+
return /* @__PURE__ */ jsxs130(Box15, { sx: { maxWidth: 200 }, children: [
|
|
26765
|
+
/* @__PURE__ */ jsxs130(
|
|
26766
|
+
Box15,
|
|
24574
26767
|
{
|
|
24575
26768
|
role: "button",
|
|
24576
26769
|
sx: {
|
|
@@ -24590,9 +26783,9 @@ var ServiceNode = memo9(({ data, selected }) => {
|
|
|
24590
26783
|
},
|
|
24591
26784
|
tabIndex: 0,
|
|
24592
26785
|
children: [
|
|
24593
|
-
/* @__PURE__ */
|
|
24594
|
-
/* @__PURE__ */
|
|
24595
|
-
/* @__PURE__ */
|
|
26786
|
+
/* @__PURE__ */ jsx138(Handle, { position: Position.Left, style: handleStyle, type: "target" }),
|
|
26787
|
+
/* @__PURE__ */ jsx138(Handle, { position: Position.Right, style: handleStyle, type: "source" }),
|
|
26788
|
+
/* @__PURE__ */ jsx138(
|
|
24596
26789
|
ServiceCell,
|
|
24597
26790
|
{
|
|
24598
26791
|
height: "32px",
|
|
@@ -24605,7 +26798,7 @@ var ServiceNode = memo9(({ data, selected }) => {
|
|
|
24605
26798
|
]
|
|
24606
26799
|
}
|
|
24607
26800
|
),
|
|
24608
|
-
/* @__PURE__ */
|
|
26801
|
+
/* @__PURE__ */ jsxs130(
|
|
24609
26802
|
Stack3,
|
|
24610
26803
|
{
|
|
24611
26804
|
alignItems: "center",
|
|
@@ -24616,7 +26809,7 @@ var ServiceNode = memo9(({ data, selected }) => {
|
|
|
24616
26809
|
mt: 0.5
|
|
24617
26810
|
},
|
|
24618
26811
|
children: [
|
|
24619
|
-
hasErrors && /* @__PURE__ */
|
|
26812
|
+
hasErrors && /* @__PURE__ */ jsx138(
|
|
24620
26813
|
Stack3,
|
|
24621
26814
|
{
|
|
24622
26815
|
direction: "row",
|
|
@@ -24625,11 +26818,11 @@ var ServiceNode = memo9(({ data, selected }) => {
|
|
|
24625
26818
|
flexWrap: "wrap",
|
|
24626
26819
|
gap: "2px"
|
|
24627
26820
|
},
|
|
24628
|
-
children: data.event.errors?.map((error) => /* @__PURE__ */
|
|
26821
|
+
children: data.event.errors?.map((error) => /* @__PURE__ */ jsx138(ProblemIndicator, { error }, error.span_id))
|
|
24629
26822
|
}
|
|
24630
26823
|
),
|
|
24631
|
-
/* @__PURE__ */
|
|
24632
|
-
|
|
26824
|
+
/* @__PURE__ */ jsx138(
|
|
26825
|
+
Typography10,
|
|
24633
26826
|
{
|
|
24634
26827
|
sx: {
|
|
24635
26828
|
fontSize: "0.9rem",
|
|
@@ -24651,56 +26844,6 @@ var ServiceNode = memo9(({ data, selected }) => {
|
|
|
24651
26844
|
|
|
24652
26845
|
// src/components/trace-graph/utils.ts
|
|
24653
26846
|
import dagre from "@dagrejs/dagre";
|
|
24654
|
-
import { MarkerType, Position as Position2 } from "@xyflow/react";
|
|
24655
|
-
var generateNodesAndEdges = (event, parentId) => {
|
|
24656
|
-
const nodes = [];
|
|
24657
|
-
const edges = [];
|
|
24658
|
-
nodes.push({
|
|
24659
|
-
data: {
|
|
24660
|
-
data: { [event.span_id]: event },
|
|
24661
|
-
event,
|
|
24662
|
-
height: 28,
|
|
24663
|
-
id: event.span_id,
|
|
24664
|
-
position: { x: 0, y: 0 },
|
|
24665
|
-
width: 28
|
|
24666
|
-
},
|
|
24667
|
-
id: event.span_id,
|
|
24668
|
-
position: { x: 0, y: 0 },
|
|
24669
|
-
// Will be set by layout
|
|
24670
|
-
sourcePosition: Position2.Right,
|
|
24671
|
-
targetPosition: Position2.Left,
|
|
24672
|
-
type: "service"
|
|
24673
|
-
});
|
|
24674
|
-
if (parentId) {
|
|
24675
|
-
edges.push({
|
|
24676
|
-
animated: false,
|
|
24677
|
-
id: `e-${parentId}-${event.span_id}`,
|
|
24678
|
-
markerEnd: {
|
|
24679
|
-
color: "lightgray",
|
|
24680
|
-
height: 16,
|
|
24681
|
-
type: MarkerType.Arrow,
|
|
24682
|
-
width: 16
|
|
24683
|
-
},
|
|
24684
|
-
source: parentId,
|
|
24685
|
-
style: {
|
|
24686
|
-
stroke: "lightgray",
|
|
24687
|
-
strokeWidth: 1
|
|
24688
|
-
},
|
|
24689
|
-
target: event.span_id
|
|
24690
|
-
});
|
|
24691
|
-
}
|
|
24692
|
-
if (event.children && event.children.length > 0) {
|
|
24693
|
-
for (const child of event.children) {
|
|
24694
|
-
const { edges: childEdges, nodes: childNodes } = generateNodesAndEdges(
|
|
24695
|
-
child,
|
|
24696
|
-
event.span_id
|
|
24697
|
-
);
|
|
24698
|
-
nodes.push(...childNodes);
|
|
24699
|
-
edges.push(...childEdges);
|
|
24700
|
-
}
|
|
24701
|
-
}
|
|
24702
|
-
return { edges, nodes };
|
|
24703
|
-
};
|
|
24704
26847
|
var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
24705
26848
|
const dagreGraph = new dagre.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
|
|
24706
26849
|
const direction = "LR";
|
|
@@ -24730,9 +26873,9 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
24730
26873
|
|
|
24731
26874
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
24732
26875
|
import { Add, FitScreen, Remove } from "@mui/icons-material";
|
|
24733
|
-
import { Box as
|
|
24734
|
-
import { useReactFlow, useStore } from "@xyflow/react";
|
|
24735
|
-
import { memo as
|
|
26876
|
+
import { Box as Box16, IconButton as IconButton4 } from "@mui/material";
|
|
26877
|
+
import { useReactFlow, useStore as useStore2 } from "@xyflow/react";
|
|
26878
|
+
import { memo as memo12 } from "react";
|
|
24736
26879
|
|
|
24737
26880
|
// node_modules/zustand/esm/shallow.mjs
|
|
24738
26881
|
function shallow$1(objA, objB) {
|
|
@@ -24773,14 +26916,14 @@ function shallow$1(objA, objB) {
|
|
|
24773
26916
|
}
|
|
24774
26917
|
|
|
24775
26918
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
24776
|
-
import { jsx as
|
|
26919
|
+
import { jsx as jsx139, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
24777
26920
|
var selector = (s2) => ({
|
|
24778
26921
|
isInteractive: s2.nodesDraggable || s2.nodesConnectable || s2.elementsSelectable,
|
|
24779
26922
|
maxZoomReached: s2.transform[2] >= s2.maxZoom,
|
|
24780
26923
|
minZoomReached: s2.transform[2] <= s2.minZoom
|
|
24781
26924
|
});
|
|
24782
|
-
var Controls =
|
|
24783
|
-
const { maxZoomReached, minZoomReached } =
|
|
26925
|
+
var Controls = memo12(() => {
|
|
26926
|
+
const { maxZoomReached, minZoomReached } = useStore2(selector, shallow$1);
|
|
24784
26927
|
const { fitView, zoomIn, zoomOut } = useReactFlow();
|
|
24785
26928
|
const onZoomInHandler = () => {
|
|
24786
26929
|
void zoomIn();
|
|
@@ -24791,8 +26934,8 @@ var Controls = memo10(() => {
|
|
|
24791
26934
|
const onFitViewHandler = () => {
|
|
24792
26935
|
void fitView();
|
|
24793
26936
|
};
|
|
24794
|
-
return /* @__PURE__ */
|
|
24795
|
-
|
|
26937
|
+
return /* @__PURE__ */ jsxs131(
|
|
26938
|
+
Box16,
|
|
24796
26939
|
{
|
|
24797
26940
|
sx: {
|
|
24798
26941
|
bottom: 0,
|
|
@@ -24805,33 +26948,33 @@ var Controls = memo10(() => {
|
|
|
24805
26948
|
zIndex: 5
|
|
24806
26949
|
},
|
|
24807
26950
|
children: [
|
|
24808
|
-
/* @__PURE__ */
|
|
26951
|
+
/* @__PURE__ */ jsx139(
|
|
24809
26952
|
IconButton4,
|
|
24810
26953
|
{
|
|
24811
26954
|
className: "react-flow__controls-zoomin",
|
|
24812
26955
|
disabled: maxZoomReached,
|
|
24813
26956
|
onClick: onZoomInHandler,
|
|
24814
26957
|
size: "small",
|
|
24815
|
-
children: /* @__PURE__ */
|
|
26958
|
+
children: /* @__PURE__ */ jsx139(Add, {})
|
|
24816
26959
|
}
|
|
24817
26960
|
),
|
|
24818
|
-
/* @__PURE__ */
|
|
26961
|
+
/* @__PURE__ */ jsx139(
|
|
24819
26962
|
IconButton4,
|
|
24820
26963
|
{
|
|
24821
26964
|
className: "react-flow__controls-zoomout",
|
|
24822
26965
|
disabled: minZoomReached,
|
|
24823
26966
|
onClick: onZoomOutHandler,
|
|
24824
26967
|
size: "small",
|
|
24825
|
-
children: /* @__PURE__ */
|
|
26968
|
+
children: /* @__PURE__ */ jsx139(Remove, {})
|
|
24826
26969
|
}
|
|
24827
26970
|
),
|
|
24828
|
-
/* @__PURE__ */
|
|
26971
|
+
/* @__PURE__ */ jsx139(
|
|
24829
26972
|
IconButton4,
|
|
24830
26973
|
{
|
|
24831
26974
|
className: "react-flow__controls-fitview",
|
|
24832
26975
|
onClick: onFitViewHandler,
|
|
24833
26976
|
size: "small",
|
|
24834
|
-
children: /* @__PURE__ */
|
|
26977
|
+
children: /* @__PURE__ */ jsx139(FitScreen, {})
|
|
24835
26978
|
}
|
|
24836
26979
|
)
|
|
24837
26980
|
]
|
|
@@ -24840,7 +26983,7 @@ var Controls = memo10(() => {
|
|
|
24840
26983
|
});
|
|
24841
26984
|
|
|
24842
26985
|
// src/components/trace-graph/trace-graph.tsx
|
|
24843
|
-
import { Fragment as
|
|
26986
|
+
import { Fragment as Fragment8, jsx as jsx140, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
24844
26987
|
var nodeTypes = {
|
|
24845
26988
|
service: ServiceNode
|
|
24846
26989
|
};
|
|
@@ -24851,40 +26994,48 @@ var TraceGraph = ({
|
|
|
24851
26994
|
spans
|
|
24852
26995
|
}) => {
|
|
24853
26996
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
24854
|
-
const [edges, setEdges] =
|
|
24855
|
-
|
|
24856
|
-
const
|
|
24857
|
-
const
|
|
24858
|
-
for (const span of spans.data ?? []) {
|
|
24859
|
-
spansMap.set(span.span_id, { ...span, children: [] });
|
|
24860
|
-
}
|
|
26997
|
+
const [edges, setEdges] = useEdgesState([]);
|
|
26998
|
+
useEffect18(() => {
|
|
26999
|
+
const allNodes = [];
|
|
27000
|
+
const allEdges = [];
|
|
24861
27001
|
for (const span of spans.data ?? []) {
|
|
24862
|
-
|
|
24863
|
-
|
|
24864
|
-
|
|
24865
|
-
|
|
24866
|
-
|
|
24867
|
-
|
|
24868
|
-
|
|
24869
|
-
|
|
24870
|
-
|
|
24871
|
-
|
|
27002
|
+
allNodes.push({
|
|
27003
|
+
data: {
|
|
27004
|
+
data: { [span.span_id]: span },
|
|
27005
|
+
event: span,
|
|
27006
|
+
height: 28,
|
|
27007
|
+
id: span.span_id,
|
|
27008
|
+
position: { x: 0, y: 0 },
|
|
27009
|
+
width: 28
|
|
27010
|
+
},
|
|
27011
|
+
id: span.span_id,
|
|
27012
|
+
position: { x: 0, y: 0 },
|
|
27013
|
+
sourcePosition: Position2.Right,
|
|
27014
|
+
targetPosition: Position2.Left,
|
|
27015
|
+
type: "service"
|
|
27016
|
+
});
|
|
27017
|
+
if (span.parent_span_id !== null) {
|
|
27018
|
+
allEdges.push({
|
|
27019
|
+
animated: false,
|
|
27020
|
+
id: `e-${span.parent_span_id}-${span.span_id}`,
|
|
27021
|
+
markerEnd: { color: "lightgray", height: 16, type: MarkerType.Arrow, width: 16 },
|
|
27022
|
+
source: span.parent_span_id,
|
|
27023
|
+
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
27024
|
+
target: span.span_id
|
|
27025
|
+
});
|
|
24872
27026
|
}
|
|
24873
27027
|
for (const linkedSpanId of span.linked_span_ids ?? []) {
|
|
24874
|
-
|
|
24875
|
-
|
|
24876
|
-
|
|
24877
|
-
|
|
24878
|
-
|
|
27028
|
+
allEdges.push({
|
|
27029
|
+
id: `e-link-${linkedSpanId}-${span.span_id}`,
|
|
27030
|
+
markerEnd: { color: "lightgray", height: 16, type: MarkerType.Arrow, width: 16 },
|
|
27031
|
+
source: linkedSpanId,
|
|
27032
|
+
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
27033
|
+
// animated: true,
|
|
27034
|
+
// style: { stroke: 'lightgray', strokeDasharray: '4 2', strokeWidth: 1 },
|
|
27035
|
+
target: span.span_id
|
|
27036
|
+
});
|
|
24879
27037
|
}
|
|
24880
27038
|
}
|
|
24881
|
-
let allNodes = [];
|
|
24882
|
-
let allEdges = [];
|
|
24883
|
-
for (const rootSpan of rootSpans) {
|
|
24884
|
-
const { edges: newEdges, nodes: newNodes } = generateNodesAndEdges(rootSpan);
|
|
24885
|
-
allNodes = [...allNodes, ...newNodes];
|
|
24886
|
-
allEdges = [...allEdges, ...newEdges];
|
|
24887
|
-
}
|
|
24888
27039
|
const { edges: layoutedEdges, nodes: layoutedNodes } = getLayoutedNodesAndEdges(allNodes, allEdges);
|
|
24889
27040
|
for (const node of layoutedNodes) {
|
|
24890
27041
|
if (node.id === initialFocusEventId) {
|
|
@@ -24893,13 +27044,13 @@ var TraceGraph = ({
|
|
|
24893
27044
|
}
|
|
24894
27045
|
setNodes(layoutedNodes);
|
|
24895
27046
|
setEdges(layoutedEdges);
|
|
24896
|
-
}, [spans.data, initialFocusEventId, setNodes]);
|
|
24897
|
-
const theme =
|
|
24898
|
-
return /* @__PURE__ */
|
|
24899
|
-
spans.error && /* @__PURE__ */
|
|
27047
|
+
}, [spans.data, initialFocusEventId, setNodes, setEdges]);
|
|
27048
|
+
const theme = useTheme4();
|
|
27049
|
+
return /* @__PURE__ */ jsxs132(Fragment8, { children: [
|
|
27050
|
+
spans.error && /* @__PURE__ */ jsxs132(
|
|
24900
27051
|
Alert3,
|
|
24901
27052
|
{
|
|
24902
|
-
action: /* @__PURE__ */
|
|
27053
|
+
action: /* @__PURE__ */ jsx140(Button4, { onClick: () => {
|
|
24903
27054
|
onRefresh();
|
|
24904
27055
|
}, children: "Retry" }),
|
|
24905
27056
|
severity: "error",
|
|
@@ -24910,7 +27061,7 @@ var TraceGraph = ({
|
|
|
24910
27061
|
]
|
|
24911
27062
|
}
|
|
24912
27063
|
),
|
|
24913
|
-
/* @__PURE__ */
|
|
27064
|
+
/* @__PURE__ */ jsxs132(
|
|
24914
27065
|
ReactFlow,
|
|
24915
27066
|
{
|
|
24916
27067
|
"data-testid": "trace-graph",
|
|
@@ -24928,8 +27079,8 @@ var TraceGraph = ({
|
|
|
24928
27079
|
onNodesChange,
|
|
24929
27080
|
selectNodesOnDrag: false,
|
|
24930
27081
|
children: [
|
|
24931
|
-
/* @__PURE__ */
|
|
24932
|
-
/* @__PURE__ */
|
|
27082
|
+
/* @__PURE__ */ jsx140(Controls, {}),
|
|
27083
|
+
/* @__PURE__ */ jsx140(
|
|
24933
27084
|
Background,
|
|
24934
27085
|
{
|
|
24935
27086
|
bgColor: theme.palette.background.paper,
|
|
@@ -24943,7 +27094,7 @@ var TraceGraph = ({
|
|
|
24943
27094
|
};
|
|
24944
27095
|
|
|
24945
27096
|
// src/pages/trace-graph-page.tsx
|
|
24946
|
-
import { Fragment as
|
|
27097
|
+
import { Fragment as Fragment9, jsx as jsx141, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
24947
27098
|
var HEADER_HEIGHT = 56;
|
|
24948
27099
|
var DRAWER_WIDTH = "35%";
|
|
24949
27100
|
var Main = styled("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
@@ -24991,8 +27142,8 @@ var TraceGraphView = ({
|
|
|
24991
27142
|
traceId
|
|
24992
27143
|
}) => {
|
|
24993
27144
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
24994
|
-
return /* @__PURE__ */
|
|
24995
|
-
|
|
27145
|
+
return /* @__PURE__ */ jsxs133(
|
|
27146
|
+
Box17,
|
|
24996
27147
|
{
|
|
24997
27148
|
"data-testid": "trace-graph-page",
|
|
24998
27149
|
sx: {
|
|
@@ -25004,14 +27155,14 @@ var TraceGraphView = ({
|
|
|
25004
27155
|
overflow: "hidden"
|
|
25005
27156
|
},
|
|
25006
27157
|
children: [
|
|
25007
|
-
/* @__PURE__ */
|
|
25008
|
-
/* @__PURE__ */
|
|
27158
|
+
/* @__PURE__ */ jsxs133(Box17, { sx: { display: "flex", width: "100%" }, children: [
|
|
27159
|
+
/* @__PURE__ */ jsx141(Button5, { onClick: () => {
|
|
25009
27160
|
navigateToSpansList();
|
|
25010
|
-
}, startIcon: /* @__PURE__ */
|
|
25011
|
-
/* @__PURE__ */
|
|
27161
|
+
}, startIcon: /* @__PURE__ */ jsx141(ArrowBack, {}), children: "Go back" }),
|
|
27162
|
+
/* @__PURE__ */ jsx141(Box17, { sx: { flexGrow: 1 } })
|
|
25012
27163
|
] }),
|
|
25013
|
-
/* @__PURE__ */
|
|
25014
|
-
|
|
27164
|
+
/* @__PURE__ */ jsx141(
|
|
27165
|
+
Paper3,
|
|
25015
27166
|
{
|
|
25016
27167
|
sx: {
|
|
25017
27168
|
display: "flex",
|
|
@@ -25020,22 +27171,22 @@ var TraceGraphView = ({
|
|
|
25020
27171
|
position: "relative",
|
|
25021
27172
|
width: "100%"
|
|
25022
27173
|
},
|
|
25023
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */
|
|
27174
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ jsx141(
|
|
25024
27175
|
StatusMessage,
|
|
25025
27176
|
{
|
|
25026
27177
|
error: statusError,
|
|
25027
27178
|
onRetry: handleRetry,
|
|
25028
27179
|
status
|
|
25029
27180
|
}
|
|
25030
|
-
) : /* @__PURE__ */
|
|
25031
|
-
/* @__PURE__ */
|
|
25032
|
-
|
|
27181
|
+
) : /* @__PURE__ */ jsxs133(Fragment9, { children: [
|
|
27182
|
+
/* @__PURE__ */ jsx141(Main, { open, children: /* @__PURE__ */ jsx141(
|
|
27183
|
+
Box17,
|
|
25033
27184
|
{
|
|
25034
27185
|
sx: {
|
|
25035
27186
|
height: "100%",
|
|
25036
27187
|
overflow: "auto"
|
|
25037
27188
|
},
|
|
25038
|
-
children: traceId !== void 0 && /* @__PURE__ */
|
|
27189
|
+
children: traceId !== void 0 && /* @__PURE__ */ jsx141(ReactFlowProvider, { children: /* @__PURE__ */ jsx141(
|
|
25039
27190
|
TraceGraph,
|
|
25040
27191
|
{
|
|
25041
27192
|
initialFocusEventId: spanId,
|
|
@@ -25052,7 +27203,7 @@ var TraceGraphView = ({
|
|
|
25052
27203
|
) })
|
|
25053
27204
|
}
|
|
25054
27205
|
) }),
|
|
25055
|
-
/* @__PURE__ */
|
|
27206
|
+
/* @__PURE__ */ jsx141(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx141(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
25056
27207
|
] })
|
|
25057
27208
|
}
|
|
25058
27209
|
)
|
|
@@ -25069,7 +27220,7 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
|
|
|
25069
27220
|
const traceResponses = await Promise.all(
|
|
25070
27221
|
newTraceIds.map((id2) => api.getSpans({ trace_id: id2 }))
|
|
25071
27222
|
);
|
|
25072
|
-
const currentBatchSpans = traceResponses.flatMap((
|
|
27223
|
+
const currentBatchSpans = traceResponses.flatMap((r3) => r3.spans);
|
|
25073
27224
|
const currentSpanIds = currentBatchSpans.map((s2) => s2.span_id);
|
|
25074
27225
|
for (const span of currentBatchSpans) {
|
|
25075
27226
|
allSpans.set(span.span_id, span);
|
|
@@ -25096,10 +27247,10 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
|
|
|
25096
27247
|
}
|
|
25097
27248
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
25098
27249
|
const api = useAppInspectorApi();
|
|
25099
|
-
const [spans, setSpans] =
|
|
25100
|
-
const [loading, setLoading] =
|
|
25101
|
-
const [fetchError, setFetchError] =
|
|
25102
|
-
const fetchSpans =
|
|
27250
|
+
const [spans, setSpans] = useState14();
|
|
27251
|
+
const [loading, setLoading] = useState14(false);
|
|
27252
|
+
const [fetchError, setFetchError] = useState14();
|
|
27253
|
+
const fetchSpans = useCallback9(async () => {
|
|
25103
27254
|
setLoading(true);
|
|
25104
27255
|
try {
|
|
25105
27256
|
const spans2 = await fetchConnectedTraces(api, [traceId]);
|
|
@@ -25112,31 +27263,31 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
25112
27263
|
setLoading(false);
|
|
25113
27264
|
}
|
|
25114
27265
|
}, [api, traceId]);
|
|
25115
|
-
|
|
27266
|
+
useEffect19(() => {
|
|
25116
27267
|
void fetchSpans();
|
|
25117
27268
|
}, [fetchSpans]);
|
|
25118
|
-
const [open, setOpen] =
|
|
25119
|
-
const [selectedEvent, setSelectedEvent] =
|
|
25120
|
-
const spansReference =
|
|
25121
|
-
|
|
27269
|
+
const [open, setOpen] = useState14(true);
|
|
27270
|
+
const [selectedEvent, setSelectedEvent] = useState14(() => spans?.find((span) => span.span_id === spanId));
|
|
27271
|
+
const spansReference = useRef14();
|
|
27272
|
+
useEffect19(() => {
|
|
25122
27273
|
if (!spansReference.current && spans) {
|
|
25123
27274
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
25124
27275
|
spansReference.current = spans;
|
|
25125
27276
|
}
|
|
25126
27277
|
}, [spans, setSelectedEvent, spanId]);
|
|
25127
27278
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
25128
|
-
const handleEventSelect =
|
|
27279
|
+
const handleEventSelect = useCallback9((spanId2) => {
|
|
25129
27280
|
const span = spans?.find((s2) => s2.span_id === spanId2);
|
|
25130
27281
|
setSelectedEvent(span);
|
|
25131
27282
|
setOpen(true);
|
|
25132
27283
|
}, [spans]);
|
|
25133
|
-
const handleRetry =
|
|
27284
|
+
const handleRetry = useCallback9(() => {
|
|
25134
27285
|
void checkStatus();
|
|
25135
27286
|
}, [checkStatus]);
|
|
25136
|
-
const navigateToSpansList =
|
|
27287
|
+
const navigateToSpansList = useCallback9(() => {
|
|
25137
27288
|
onClose?.();
|
|
25138
27289
|
}, [onClose]);
|
|
25139
|
-
return /* @__PURE__ */
|
|
27290
|
+
return /* @__PURE__ */ jsx141(
|
|
25140
27291
|
TraceGraphView,
|
|
25141
27292
|
{
|
|
25142
27293
|
fetchError,
|
|
@@ -25160,7 +27311,7 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
25160
27311
|
};
|
|
25161
27312
|
|
|
25162
27313
|
// src/pages/spans-list-page.tsx
|
|
25163
|
-
import { Fragment as
|
|
27314
|
+
import { Fragment as Fragment10, jsx as jsx142, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
25164
27315
|
var SpansListPage = () => {
|
|
25165
27316
|
const {
|
|
25166
27317
|
checkStatus,
|
|
@@ -25179,23 +27330,23 @@ var SpansListPage = () => {
|
|
|
25179
27330
|
streamPaused,
|
|
25180
27331
|
toggleStream
|
|
25181
27332
|
} = useSpans();
|
|
25182
|
-
const clearSpansSync =
|
|
27333
|
+
const clearSpansSync = useCallback10(() => {
|
|
25183
27334
|
void clearSpans();
|
|
25184
27335
|
}, [clearSpans]);
|
|
25185
27336
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
25186
|
-
const [selectedTraceId, setSelectedTraceId] =
|
|
25187
|
-
const [selectedSpanId, setSelectedSpanId] =
|
|
25188
|
-
const navigateToSpan =
|
|
27337
|
+
const [selectedTraceId, setSelectedTraceId] = useState15();
|
|
27338
|
+
const [selectedSpanId, setSelectedSpanId] = useState15();
|
|
27339
|
+
const navigateToSpan = useCallback10((span) => {
|
|
25189
27340
|
setSelectedTraceId(span.trace_id);
|
|
25190
27341
|
setSelectedSpanId(span.span_id);
|
|
25191
27342
|
}, []);
|
|
25192
|
-
const handleRetry =
|
|
27343
|
+
const handleRetry = useCallback10(() => {
|
|
25193
27344
|
void checkStatus();
|
|
25194
27345
|
}, [checkStatus]);
|
|
25195
27346
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
25196
|
-
return /* @__PURE__ */
|
|
25197
|
-
/* @__PURE__ */
|
|
25198
|
-
|
|
27347
|
+
return /* @__PURE__ */ jsxs134(Fragment10, { children: [
|
|
27348
|
+
/* @__PURE__ */ jsx142(
|
|
27349
|
+
Box18,
|
|
25199
27350
|
{
|
|
25200
27351
|
"data-testid": "spans-list-page",
|
|
25201
27352
|
sx: {
|
|
@@ -25209,14 +27360,14 @@ var SpansListPage = () => {
|
|
|
25209
27360
|
visibility: selectedTraceId === void 0 ? "visible" : "hidden",
|
|
25210
27361
|
width: "100%"
|
|
25211
27362
|
},
|
|
25212
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */
|
|
27363
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ jsx142(
|
|
25213
27364
|
StatusMessage,
|
|
25214
27365
|
{
|
|
25215
27366
|
error: statusError,
|
|
25216
27367
|
onRetry: handleRetry,
|
|
25217
27368
|
status
|
|
25218
27369
|
}
|
|
25219
|
-
) : /* @__PURE__ */
|
|
27370
|
+
) : /* @__PURE__ */ jsx142(
|
|
25220
27371
|
SpansList,
|
|
25221
27372
|
{
|
|
25222
27373
|
clearingSpans,
|
|
@@ -25238,7 +27389,7 @@ var SpansListPage = () => {
|
|
|
25238
27389
|
)
|
|
25239
27390
|
}
|
|
25240
27391
|
),
|
|
25241
|
-
selectedTraceId !== void 0 && /* @__PURE__ */
|
|
27392
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ jsx142(TraceGraphPage, { onClose: () => {
|
|
25242
27393
|
setSelectedTraceId(void 0);
|
|
25243
27394
|
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
25244
27395
|
] });
|
|
@@ -25259,6 +27410,28 @@ export {
|
|
|
25259
27410
|
};
|
|
25260
27411
|
/*! Bundled license information:
|
|
25261
27412
|
|
|
27413
|
+
use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
|
|
27414
|
+
(**
|
|
27415
|
+
* @license React
|
|
27416
|
+
* use-sync-external-store-shim.development.js
|
|
27417
|
+
*
|
|
27418
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
27419
|
+
*
|
|
27420
|
+
* This source code is licensed under the MIT license found in the
|
|
27421
|
+
* LICENSE file in the root directory of this source tree.
|
|
27422
|
+
*)
|
|
27423
|
+
|
|
27424
|
+
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
|
|
27425
|
+
(**
|
|
27426
|
+
* @license React
|
|
27427
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
27428
|
+
*
|
|
27429
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
27430
|
+
*
|
|
27431
|
+
* This source code is licensed under the MIT license found in the
|
|
27432
|
+
* LICENSE file in the root directory of this source tree.
|
|
27433
|
+
*)
|
|
27434
|
+
|
|
25262
27435
|
@tanstack/table-core/build/lib/index.mjs:
|
|
25263
27436
|
(**
|
|
25264
27437
|
* table-core
|