@cartanova/qgrid-cli 2.6.10 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +137 -60
  2. package/bundle/dist/application/qgrid/qgrid.frame.js +5 -2
  3. package/bundle/dist/application/setting/setting.model.js +65 -3
  4. package/bundle/dist/application/setting/setting.types.js +13 -3
  5. package/bundle/dist/i18n/en.js +3 -1
  6. package/bundle/dist/i18n/ko.js +3 -1
  7. package/bundle/dist/utils/process-supervisor.js +22 -0
  8. package/bundle/dist/utils/server-restart.js +61 -0
  9. package/bundle/src/application/qgrid/qgrid-oauth-redirect.test.ts +7 -0
  10. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +113 -0
  11. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +172 -75
  12. package/bundle/src/application/qgrid/qgrid.frame.test.ts +45 -0
  13. package/bundle/src/application/qgrid/qgrid.frame.ts +4 -0
  14. package/bundle/src/application/setting/setting.model.test.ts +104 -0
  15. package/bundle/src/application/setting/setting.model.ts +75 -3
  16. package/bundle/src/application/setting/setting.types.ts +12 -0
  17. package/bundle/src/application/sonamu.generated.http +7 -0
  18. package/bundle/src/i18n/en.ts +3 -0
  19. package/bundle/src/i18n/ko.ts +3 -0
  20. package/bundle/src/server-error-handler.test.ts +15 -0
  21. package/bundle/src/utils/process-supervisor.test.ts +24 -0
  22. package/bundle/src/utils/process-supervisor.ts +17 -0
  23. package/bundle/src/utils/server-restart.test.ts +76 -0
  24. package/bundle/src/utils/server-restart.ts +68 -0
  25. package/bundle/web-dist/client/assets/chat-icon-JYfue7fB.png +0 -0
  26. package/bundle/web-dist/client/assets/index-C24D5PiN.js +106 -0
  27. package/bundle/web-dist/client/assets/index-CcMEpCgt.css +1 -0
  28. package/bundle/web-dist/client/assets/logs-CIlZG6A3.js +1 -0
  29. package/bundle/web-dist/client/assets/monit-DZFBMxKl.js +1 -0
  30. package/bundle/web-dist/client/assets/{routes-CkBXB-V4.js → routes-C3wlSNBL.js} +2 -2
  31. package/bundle/web-dist/client/assets/services.generated-jGypfumC.js +51 -0
  32. package/bundle/web-dist/client/assets/settings-ClRDWO-8.js +1 -0
  33. package/bundle/web-dist/client/assets/show-BP7U8yyJ.js +2 -0
  34. package/bundle/web-dist/client/assets/tokens-DfQeULnJ.js +1 -0
  35. package/bundle/web-dist/client/assets/{use-oauth-login-flow-Bz87RV5v.js → use-oauth-login-flow-CY-ASCfL.js} +1 -1
  36. package/bundle/web-dist/client/index.html +3 -3
  37. package/bundle/web-dist/server/assets/{lazyRouteComponent-Ws7I6fL-.js → lazyRouteComponent-DOc8TV-P.js} +2 -2
  38. package/bundle/web-dist/server/assets/{logs-C1rxLh8H.js → logs-CfF3nmLM.js} +3 -4
  39. package/bundle/web-dist/server/assets/{monit-C8gx9Sar.js → monit-BSaKhh5D.js} +2 -3
  40. package/bundle/web-dist/server/assets/{plus-BISXNqRU.js → plus-DLFUHsfx.js} +1 -1
  41. package/bundle/web-dist/server/assets/{react-dom-D7duWOwf.js → react-dom-BotjLnTK.js} +1 -1
  42. package/bundle/web-dist/server/assets/{routes-ZW_Ih5Em.js → routes-CHMxrTT0.js} +4 -5
  43. package/bundle/web-dist/server/assets/{sd.generated-LO-h1_16.js → services.generated-D3Q3FYot.js} +16697 -15377
  44. package/bundle/web-dist/server/assets/{settings--aoatERH.js → settings-DOQjV28c.js} +271 -55
  45. package/bundle/web-dist/server/assets/show-Cn_C6Qvl.js +2776 -0
  46. package/bundle/web-dist/server/assets/{tokens-DIObtTuZ.js → tokens-c0EN3iCx.js} +4 -5
  47. package/bundle/web-dist/server/assets/{use-oauth-login-flow-V3k8PSqQ.js → use-oauth-login-flow-B68AbMDE.js} +1 -2
  48. package/bundle/web-dist/server/entry-server.generated.js +23856 -40
  49. package/dist/cli.js +93 -38
  50. package/package.json +1 -1
  51. package/skills/qgrid/references/cli-env-and-server-boot.md +34 -3
  52. package/bundle/web-dist/client/assets/index-BRRNJRgu.js +0 -78
  53. package/bundle/web-dist/client/assets/index-rdbxJinT.css +0 -1
  54. package/bundle/web-dist/client/assets/logs-BI5K8oe4.js +0 -1
  55. package/bundle/web-dist/client/assets/monit-4Y-Razet.js +0 -1
  56. package/bundle/web-dist/client/assets/sd.generated-Bwa7rses.js +0 -51
  57. package/bundle/web-dist/client/assets/services.generated-BzwTuZRP.js +0 -1
  58. package/bundle/web-dist/client/assets/settings-B62_r1i4.js +0 -1
  59. package/bundle/web-dist/client/assets/show-CGRchJj7.js +0 -30
  60. package/bundle/web-dist/client/assets/tokens-Bx5mQnoJ.js +0 -1
  61. package/bundle/web-dist/server/assets/services.generated-CZIChgHV.js +0 -1305
  62. package/bundle/web-dist/server/assets/show-BY27w9oi.js +0 -25968
  63. /package/bundle/web-dist/client/assets/{plus-p4vtg6LN.js → plus-DqBd6gHk.js} +0 -0
  64. /package/bundle/web-dist/server/assets/{cost-DzjfVtUr.js → cost-CSH_t17I.js} +0 -0
@@ -0,0 +1,2776 @@
1
+ import { R as __commonJSMin, V as __toESM, b as require_jsx_runtime, i as RequestLogStepService, r as RequestLogService, x as require_react } from "./services.generated-D3Q3FYot.js";
2
+ import { a as Link } from "./lazyRouteComponent-DOc8TV-P.js";
3
+ import { c as remarkGfm, l as Markdown, o as lucideX, t as Route } from "../entry-server.generated.js";
4
+ import { n as formatMicroUsd, t as cacheHitRate } from "./cost-CSH_t17I.js";
5
+ //#region ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/extends.js
6
+ var require_extends = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
+ function _extends() {
8
+ return module.exports = _extends = Object.assign ? Object.assign.bind() : function(n) {
9
+ for (var e = 1; e < arguments.length; e++) {
10
+ var t = arguments[e];
11
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
12
+ }
13
+ return n;
14
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
15
+ }
16
+ module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
17
+ }));
18
+ //#endregion
19
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/store/ShowTools.js
20
+ var import_objectWithoutPropertiesLoose = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
21
+ function _objectWithoutPropertiesLoose(r, e) {
22
+ if (null == r) return {};
23
+ var t = {};
24
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
25
+ if (-1 !== e.indexOf(n)) continue;
26
+ t[n] = r[n];
27
+ }
28
+ return t;
29
+ }
30
+ module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
31
+ })))());
32
+ var import_extends = /* @__PURE__ */ __toESM(require_extends());
33
+ var import_react = /* @__PURE__ */ __toESM(require_react());
34
+ var import_jsx_runtime = require_jsx_runtime();
35
+ var initialState$5 = {};
36
+ var Context$5 = /* @__PURE__ */ (0, import_react.createContext)(initialState$5);
37
+ var reducer$5 = (state, action) => (0, import_extends.default)({}, state, action);
38
+ var useShowToolsStore = () => {
39
+ return (0, import_react.useContext)(Context$5);
40
+ };
41
+ var DispatchShowTools = /* @__PURE__ */ (0, import_react.createContext)(() => {});
42
+ DispatchShowTools.displayName = "JVR.DispatchShowTools";
43
+ function useShowTools() {
44
+ return (0, import_react.useReducer)(reducer$5, initialState$5);
45
+ }
46
+ function useShowToolsDispatch() {
47
+ return (0, import_react.useContext)(DispatchShowTools);
48
+ }
49
+ var ShowTools = (_ref) => {
50
+ var { initial, dispatch, children } = _ref;
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context$5.Provider, {
52
+ value: initial,
53
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchShowTools.Provider, {
54
+ value: dispatch,
55
+ children
56
+ })
57
+ });
58
+ };
59
+ ShowTools.displayName = "JVR.ShowTools";
60
+ //#endregion
61
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/store/Expands.js
62
+ var initialState$4 = {};
63
+ var Context$4 = /* @__PURE__ */ (0, import_react.createContext)(initialState$4);
64
+ var reducer$4 = (state, action) => (0, import_extends.default)({}, state, action);
65
+ var useExpandsStore = () => {
66
+ return (0, import_react.useContext)(Context$4);
67
+ };
68
+ var DispatchExpands = /* @__PURE__ */ (0, import_react.createContext)(() => {});
69
+ DispatchExpands.displayName = "JVR.DispatchExpands";
70
+ function useExpands() {
71
+ return (0, import_react.useReducer)(reducer$4, initialState$4);
72
+ }
73
+ function useExpandsDispatch() {
74
+ return (0, import_react.useContext)(DispatchExpands);
75
+ }
76
+ var Expands = (_ref) => {
77
+ var { initial, dispatch, children } = _ref;
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context$4.Provider, {
79
+ value: initial,
80
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchExpands.Provider, {
81
+ value: dispatch,
82
+ children
83
+ })
84
+ });
85
+ };
86
+ Expands.displayName = "JVR.Expands";
87
+ //#endregion
88
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/store/Types.js
89
+ var initialState$3 = {
90
+ Str: {
91
+ as: "span",
92
+ "data-type": "string",
93
+ style: { color: "var(--w-rjv-type-string-color, #cb4b16)" },
94
+ className: "w-rjv-type",
95
+ children: "string"
96
+ },
97
+ Url: {
98
+ as: "a",
99
+ style: { color: "var(--w-rjv-type-url-color, #0969da)" },
100
+ "data-type": "url",
101
+ className: "w-rjv-type",
102
+ children: "url"
103
+ },
104
+ Undefined: {
105
+ style: { color: "var(--w-rjv-type-undefined-color, #586e75)" },
106
+ as: "span",
107
+ "data-type": "undefined",
108
+ className: "w-rjv-type",
109
+ children: "undefined"
110
+ },
111
+ Null: {
112
+ style: { color: "var(--w-rjv-type-null-color, #d33682)" },
113
+ as: "span",
114
+ "data-type": "null",
115
+ className: "w-rjv-type",
116
+ children: "null"
117
+ },
118
+ Map: {
119
+ style: {
120
+ color: "var(--w-rjv-type-map-color, #268bd2)",
121
+ marginRight: 3
122
+ },
123
+ as: "span",
124
+ "data-type": "map",
125
+ className: "w-rjv-type",
126
+ children: "Map"
127
+ },
128
+ Nan: {
129
+ style: { color: "var(--w-rjv-type-nan-color, #859900)" },
130
+ as: "span",
131
+ "data-type": "nan",
132
+ className: "w-rjv-type",
133
+ children: "NaN"
134
+ },
135
+ Bigint: {
136
+ style: { color: "var(--w-rjv-type-bigint-color, #268bd2)" },
137
+ as: "span",
138
+ "data-type": "bigint",
139
+ className: "w-rjv-type",
140
+ children: "bigint"
141
+ },
142
+ Int: {
143
+ style: { color: "var(--w-rjv-type-int-color, #268bd2)" },
144
+ as: "span",
145
+ "data-type": "int",
146
+ className: "w-rjv-type",
147
+ children: "int"
148
+ },
149
+ Set: {
150
+ style: {
151
+ color: "var(--w-rjv-type-set-color, #268bd2)",
152
+ marginRight: 3
153
+ },
154
+ as: "span",
155
+ "data-type": "set",
156
+ className: "w-rjv-type",
157
+ children: "Set"
158
+ },
159
+ Float: {
160
+ style: { color: "var(--w-rjv-type-float-color, #859900)" },
161
+ as: "span",
162
+ "data-type": "float",
163
+ className: "w-rjv-type",
164
+ children: "float"
165
+ },
166
+ True: {
167
+ style: { color: "var(--w-rjv-type-boolean-color, #2aa198)" },
168
+ as: "span",
169
+ "data-type": "bool",
170
+ className: "w-rjv-type",
171
+ children: "bool"
172
+ },
173
+ False: {
174
+ style: { color: "var(--w-rjv-type-boolean-color, #2aa198)" },
175
+ as: "span",
176
+ "data-type": "bool",
177
+ className: "w-rjv-type",
178
+ children: "bool"
179
+ },
180
+ Date: {
181
+ style: { color: "var(--w-rjv-type-date-color, #268bd2)" },
182
+ as: "span",
183
+ "data-type": "date",
184
+ className: "w-rjv-type",
185
+ children: "date"
186
+ }
187
+ };
188
+ var Context$3 = /* @__PURE__ */ (0, import_react.createContext)(initialState$3);
189
+ var reducer$3 = (state, action) => (0, import_extends.default)({}, state, action);
190
+ var useTypesStore = () => {
191
+ return (0, import_react.useContext)(Context$3);
192
+ };
193
+ var DispatchTypes = /* @__PURE__ */ (0, import_react.createContext)(() => {});
194
+ DispatchTypes.displayName = "JVR.DispatchTypes";
195
+ function useTypes() {
196
+ return (0, import_react.useReducer)(reducer$3, initialState$3);
197
+ }
198
+ function useTypesDispatch() {
199
+ return (0, import_react.useContext)(DispatchTypes);
200
+ }
201
+ function Types(_ref) {
202
+ var { initial, dispatch, children } = _ref;
203
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context$3.Provider, {
204
+ value: initial,
205
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchTypes.Provider, {
206
+ value: dispatch,
207
+ children
208
+ })
209
+ });
210
+ }
211
+ Types.displayName = "JVR.Types";
212
+ //#endregion
213
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/arrow/TriangleArrow.js
214
+ var _excluded$10 = ["style"];
215
+ function TriangleArrow(props) {
216
+ var { style } = props, reset = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$10);
217
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", (0, import_extends.default)({
218
+ viewBox: "0 0 24 24",
219
+ fill: "var(--w-rjv-arrow-color, currentColor)",
220
+ style: (0, import_extends.default)({
221
+ cursor: "pointer",
222
+ height: "1em",
223
+ width: "1em",
224
+ userSelect: "none",
225
+ display: "inline-flex"
226
+ }, style)
227
+ }, reset, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }) }));
228
+ }
229
+ TriangleArrow.displayName = "JVR.TriangleArrow";
230
+ //#endregion
231
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/store/Symbols.js
232
+ var initialState$2 = {
233
+ Arrow: {
234
+ as: "span",
235
+ className: "w-rjv-arrow",
236
+ style: {
237
+ transform: "rotate(0deg)",
238
+ transition: "all 0.3s"
239
+ },
240
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleArrow, {})
241
+ },
242
+ Colon: {
243
+ as: "span",
244
+ style: {
245
+ color: "var(--w-rjv-colon-color, var(--w-rjv-color))",
246
+ marginLeft: 0,
247
+ marginRight: 2
248
+ },
249
+ className: "w-rjv-colon",
250
+ children: ":"
251
+ },
252
+ Quote: {
253
+ as: "span",
254
+ style: { color: "var(--w-rjv-quotes-color, #236a7c)" },
255
+ className: "w-rjv-quotes",
256
+ children: "\""
257
+ },
258
+ ValueQuote: {
259
+ as: "span",
260
+ style: { color: "var(--w-rjv-quotes-string-color, #cb4b16)" },
261
+ className: "w-rjv-quotes",
262
+ children: "\""
263
+ },
264
+ BracketsLeft: {
265
+ as: "span",
266
+ style: { color: "var(--w-rjv-brackets-color, #236a7c)" },
267
+ className: "w-rjv-brackets-start",
268
+ children: "["
269
+ },
270
+ BracketsRight: {
271
+ as: "span",
272
+ style: { color: "var(--w-rjv-brackets-color, #236a7c)" },
273
+ className: "w-rjv-brackets-end",
274
+ children: "]"
275
+ },
276
+ BraceLeft: {
277
+ as: "span",
278
+ style: { color: "var(--w-rjv-curlybraces-color, #236a7c)" },
279
+ className: "w-rjv-curlybraces-start",
280
+ children: "{"
281
+ },
282
+ BraceRight: {
283
+ as: "span",
284
+ style: { color: "var(--w-rjv-curlybraces-color, #236a7c)" },
285
+ className: "w-rjv-curlybraces-end",
286
+ children: "}"
287
+ }
288
+ };
289
+ var Context$2 = /* @__PURE__ */ (0, import_react.createContext)(initialState$2);
290
+ var reducer$2 = (state, action) => (0, import_extends.default)({}, state, action);
291
+ var useSymbolsStore = () => {
292
+ return (0, import_react.useContext)(Context$2);
293
+ };
294
+ var DispatchSymbols = /* @__PURE__ */ (0, import_react.createContext)(() => {});
295
+ DispatchSymbols.displayName = "JVR.DispatchSymbols";
296
+ function useSymbols() {
297
+ return (0, import_react.useReducer)(reducer$2, initialState$2);
298
+ }
299
+ function useSymbolsDispatch() {
300
+ return (0, import_react.useContext)(DispatchSymbols);
301
+ }
302
+ var Symbols = (_ref) => {
303
+ var { initial, dispatch, children } = _ref;
304
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context$2.Provider, {
305
+ value: initial,
306
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchSymbols.Provider, {
307
+ value: dispatch,
308
+ children
309
+ })
310
+ });
311
+ };
312
+ Symbols.displayName = "JVR.Symbols";
313
+ //#endregion
314
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/store/Section.js
315
+ var initialState$1 = {
316
+ Copied: {
317
+ className: "w-rjv-copied",
318
+ style: {
319
+ height: "1em",
320
+ width: "1em",
321
+ cursor: "pointer",
322
+ verticalAlign: "middle",
323
+ marginLeft: 5
324
+ }
325
+ },
326
+ CountInfo: {
327
+ as: "span",
328
+ className: "w-rjv-object-size",
329
+ style: {
330
+ color: "var(--w-rjv-info-color, #0000004d)",
331
+ paddingLeft: 8,
332
+ fontStyle: "italic"
333
+ }
334
+ },
335
+ CountInfoExtra: {
336
+ as: "span",
337
+ className: "w-rjv-object-extra",
338
+ style: { paddingLeft: 8 }
339
+ },
340
+ Ellipsis: {
341
+ as: "span",
342
+ style: {
343
+ cursor: "pointer",
344
+ color: "var(--w-rjv-ellipsis-color, #cb4b16)",
345
+ userSelect: "none"
346
+ },
347
+ className: "w-rjv-ellipsis",
348
+ children: "..."
349
+ },
350
+ Row: {
351
+ as: "div",
352
+ className: "w-rjv-line"
353
+ },
354
+ KeyName: {
355
+ as: "span",
356
+ className: "w-rjv-object-key"
357
+ }
358
+ };
359
+ var Context$1 = /* @__PURE__ */ (0, import_react.createContext)(initialState$1);
360
+ var reducer$1 = (state, action) => (0, import_extends.default)({}, state, action);
361
+ var useSectionStore = () => {
362
+ return (0, import_react.useContext)(Context$1);
363
+ };
364
+ var DispatchSection = /* @__PURE__ */ (0, import_react.createContext)(() => {});
365
+ DispatchSection.displayName = "JVR.DispatchSection";
366
+ function useSection() {
367
+ return (0, import_react.useReducer)(reducer$1, initialState$1);
368
+ }
369
+ function useSectionDispatch() {
370
+ return (0, import_react.useContext)(DispatchSection);
371
+ }
372
+ var Section$1 = (_ref) => {
373
+ var { initial, dispatch, children } = _ref;
374
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context$1.Provider, {
375
+ value: initial,
376
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchSection.Provider, {
377
+ value: dispatch,
378
+ children
379
+ })
380
+ });
381
+ };
382
+ Section$1.displayName = "JVR.Section";
383
+ //#endregion
384
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/store.js
385
+ var initialState = {
386
+ objectSortKeys: false,
387
+ indentWidth: 15
388
+ };
389
+ var Context = /* @__PURE__ */ (0, import_react.createContext)(initialState);
390
+ Context.displayName = "JVR.Context";
391
+ var DispatchContext = /* @__PURE__ */ (0, import_react.createContext)(() => {});
392
+ DispatchContext.displayName = "JVR.DispatchContext";
393
+ function reducer(state, action) {
394
+ return (0, import_extends.default)({}, state, action);
395
+ }
396
+ var useStore = () => {
397
+ return (0, import_react.useContext)(Context);
398
+ };
399
+ var Provider = (_ref) => {
400
+ var { children, initialState: init, initialTypes } = _ref;
401
+ var [state, dispatch] = (0, import_react.useReducer)(reducer, Object.assign({}, initialState, init));
402
+ var [showTools, showToolsDispatch] = useShowTools();
403
+ var [expands, expandsDispatch] = useExpands();
404
+ var [types, typesDispatch] = useTypes();
405
+ var [symbols, symbolsDispatch] = useSymbols();
406
+ var [section, sectionDispatch] = useSection();
407
+ (0, import_react.useEffect)(() => dispatch((0, import_extends.default)({}, init)), [init]);
408
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, {
409
+ value: state,
410
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchContext.Provider, {
411
+ value: dispatch,
412
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShowTools, {
413
+ initial: showTools,
414
+ dispatch: showToolsDispatch,
415
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Expands, {
416
+ initial: expands,
417
+ dispatch: expandsDispatch,
418
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Types, {
419
+ initial: (0, import_extends.default)({}, types, initialTypes),
420
+ dispatch: typesDispatch,
421
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Symbols, {
422
+ initial: symbols,
423
+ dispatch: symbolsDispatch,
424
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section$1, {
425
+ initial: section,
426
+ dispatch: sectionDispatch,
427
+ children
428
+ })
429
+ })
430
+ })
431
+ })
432
+ })
433
+ })
434
+ });
435
+ };
436
+ Provider.displayName = "JVR.Provider";
437
+ //#endregion
438
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/index.js
439
+ var import_objectDestructuringEmpty = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
440
+ function _objectDestructuringEmpty(t) {
441
+ if (null == t) throw new TypeError("Cannot destructure " + t);
442
+ }
443
+ module.exports = _objectDestructuringEmpty, module.exports.__esModule = true, module.exports["default"] = module.exports;
444
+ })))());
445
+ var _excluded$9 = [
446
+ "isNumber",
447
+ "value",
448
+ "parentValue",
449
+ "keyName",
450
+ "keys"
451
+ ], _excluded2$5 = ["as", "render"], _excluded3$1 = ["as", "render"], _excluded4$1 = ["as", "render"], _excluded5$1 = [
452
+ "as",
453
+ "style",
454
+ "render"
455
+ ], _excluded6$1 = ["as", "render"], _excluded7$1 = ["as", "render"], _excluded8$1 = ["as", "render"], _excluded9$1 = ["as", "render"];
456
+ var Quote$1 = (props) => {
457
+ var { Quote: Comp = {} } = useSymbolsStore();
458
+ var { isNumber, value, parentValue, keyName, keys } = props, other = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$9);
459
+ if (isNumber) return null;
460
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded2$5);
461
+ var Elm = as || "span";
462
+ var elmProps = (0, import_extends.default)({}, other, reset);
463
+ if (typeof elmProps.children === "string") elmProps.children = elmProps.children.trim() || void 0;
464
+ var child = render && typeof render === "function" && render(elmProps, {
465
+ value,
466
+ parentValue,
467
+ keyName,
468
+ keys: keys || (keyName ? [keyName] : [])
469
+ });
470
+ if (child) return child;
471
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, elmProps));
472
+ };
473
+ Quote$1.displayName = "JVR.Quote";
474
+ var ValueQuote$1 = (props) => {
475
+ var { ValueQuote: Comp = {} } = useSymbolsStore();
476
+ var other = (0, import_extends.default)({}, ((0, import_objectDestructuringEmpty.default)(props), props));
477
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded3$1);
478
+ var Elm = as || "span";
479
+ var elmProps = (0, import_extends.default)({}, other, reset);
480
+ var child = render && typeof render === "function" && render(elmProps, {});
481
+ if (child) return child;
482
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, elmProps));
483
+ };
484
+ ValueQuote$1.displayName = "JVR.ValueQuote";
485
+ var Colon$1 = (props) => {
486
+ var { value, parentValue, keyName, keys } = props;
487
+ var { Colon: Comp = {} } = useSymbolsStore();
488
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded4$1);
489
+ var Elm = as || "span";
490
+ var child = render && typeof render === "function" && render(reset, {
491
+ value,
492
+ parentValue,
493
+ keyName,
494
+ keys: keys || (keyName ? [keyName] : [])
495
+ });
496
+ if (child) return child;
497
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, reset));
498
+ };
499
+ Colon$1.displayName = "JVR.Colon";
500
+ var Arrow$1 = (props) => {
501
+ var { Arrow: Comp = {} } = useSymbolsStore();
502
+ var expands = useExpandsStore();
503
+ var { expandKey, style: resetStyle, value, parentValue, keyName, keys } = props;
504
+ var isExpanded = !!expands[expandKey];
505
+ var { as, style, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded5$1);
506
+ var Elm = as || "span";
507
+ var isRender = render && typeof render === "function";
508
+ var elmProps = (0, import_extends.default)({}, reset, {
509
+ "data-expanded": isExpanded,
510
+ style: (0, import_extends.default)({}, style, resetStyle)
511
+ });
512
+ var child = isRender && render(elmProps, {
513
+ value,
514
+ parentValue,
515
+ keyName,
516
+ keys: keys || (keyName ? [keyName] : [])
517
+ });
518
+ if (child) return child;
519
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, reset, { style: (0, import_extends.default)({}, style, resetStyle) }));
520
+ };
521
+ Arrow$1.displayName = "JVR.Arrow";
522
+ var BracketsOpen = (props) => {
523
+ var { isBrackets, value, parentValue, keyName, keys } = props;
524
+ var { BracketsLeft = {}, BraceLeft = {} } = useSymbolsStore();
525
+ var result = {
526
+ value,
527
+ parentValue,
528
+ keyName,
529
+ keys: keys || (keyName ? [keyName] : [])
530
+ };
531
+ if (isBrackets) {
532
+ var { as, render: _render } = BracketsLeft, reset = (0, import_objectWithoutPropertiesLoose.default)(BracketsLeft, _excluded6$1);
533
+ var BracketsLeftComp = as || "span";
534
+ var _child = _render && typeof _render === "function" && _render(reset, result);
535
+ if (_child) return _child;
536
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BracketsLeftComp, (0, import_extends.default)({}, reset));
537
+ }
538
+ var { as: elm, render } = BraceLeft, resetProps = (0, import_objectWithoutPropertiesLoose.default)(BraceLeft, _excluded7$1);
539
+ var BraceLeftComp = elm || "span";
540
+ var child = render && typeof render === "function" && render(resetProps, result);
541
+ if (child) return child;
542
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BraceLeftComp, (0, import_extends.default)({}, resetProps));
543
+ };
544
+ BracketsOpen.displayName = "JVR.BracketsOpen";
545
+ var BracketsClose = (props) => {
546
+ var { isBrackets, isVisiable, value, parentValue, keyName, keys } = props;
547
+ var result = {
548
+ value,
549
+ parentValue,
550
+ keyName,
551
+ keys: keys || (keyName ? [keyName] : [])
552
+ };
553
+ if (!isVisiable) return null;
554
+ var { BracketsRight = {}, BraceRight = {} } = useSymbolsStore();
555
+ if (isBrackets) {
556
+ var { as, render: _render2 } = BracketsRight, _reset = (0, import_objectWithoutPropertiesLoose.default)(BracketsRight, _excluded8$1);
557
+ var BracketsRightComp = as || "span";
558
+ var _child2 = _render2 && typeof _render2 === "function" && _render2(_reset, result);
559
+ if (_child2) return _child2;
560
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BracketsRightComp, (0, import_extends.default)({}, _reset));
561
+ }
562
+ var { as: elm, render } = BraceRight, reset = (0, import_objectWithoutPropertiesLoose.default)(BraceRight, _excluded9$1);
563
+ var BraceRightComp = elm || "span";
564
+ var child = render && typeof render === "function" && render(reset, result);
565
+ if (child) return child;
566
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BraceRightComp, (0, import_extends.default)({}, reset));
567
+ };
568
+ BracketsClose.displayName = "JVR.BracketsClose";
569
+ //#endregion
570
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/comps/NestedClose.js
571
+ var NestedClose = (props) => {
572
+ var _expands$expandKey;
573
+ var { keyName, value, expandKey, parentValue, level, keys = [] } = props;
574
+ var expands = useExpandsStore();
575
+ var { collapsed, shouldExpandNodeInitially } = useStore();
576
+ var defaultExpanded = typeof collapsed === "boolean" ? collapsed : typeof collapsed === "number" ? level > collapsed : false;
577
+ var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
578
+ var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
579
+ value,
580
+ keys,
581
+ level,
582
+ keyName,
583
+ parentValue
584
+ });
585
+ if (shouldExpandNodeInitially && collapsed === false) {
586
+ if (expands[expandKey] === void 0 && !shouldExpand) return null;
587
+ } else if (expands[expandKey] === void 0 && shouldExpand) return null;
588
+ var len = Object.keys(value).length;
589
+ if (isExpanded || len === 0) return null;
590
+ var style = { paddingLeft: 4 };
591
+ var compProps = {
592
+ keyName,
593
+ value,
594
+ keys,
595
+ parentValue
596
+ };
597
+ var isArray = Array.isArray(value);
598
+ var isMySet = value instanceof Set;
599
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
600
+ style,
601
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BracketsClose, (0, import_extends.default)({ isBrackets: isArray || isMySet }, compProps, { isVisiable: true }))
602
+ });
603
+ };
604
+ NestedClose.displayName = "JVR.NestedClose";
605
+ //#endregion
606
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/index.js
607
+ var _excluded$8 = ["as", "render"], _excluded2$4 = ["as", "render"], _excluded3 = ["as", "render"], _excluded4 = ["as", "render"], _excluded5 = ["as", "render"], _excluded6 = ["as", "render"], _excluded7 = ["as", "render"], _excluded8 = ["as", "render"], _excluded9 = ["as", "render"], _excluded0 = ["as", "render"], _excluded1 = ["as", "render"], _excluded10 = ["as", "render"], _excluded11 = ["as", "render"];
608
+ var bigIntToString = (bi) => {
609
+ if (bi === void 0) return "0n";
610
+ else if (typeof bi === "string") try {
611
+ bi = BigInt(bi);
612
+ } catch (e) {
613
+ return "0n";
614
+ }
615
+ return bi ? bi.toString() + "n" : "0n";
616
+ };
617
+ var SetComp = (_ref) => {
618
+ var { value, keyName } = _ref;
619
+ var { Set: Comp = {}, displayDataTypes } = useTypesStore();
620
+ if (!(value instanceof Set) || !displayDataTypes) return null;
621
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded$8);
622
+ var type = render && typeof render === "function" && render(reset, {
623
+ type: "type",
624
+ value,
625
+ keyName
626
+ });
627
+ if (type) return type;
628
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(as || "span", (0, import_extends.default)({}, reset));
629
+ };
630
+ SetComp.displayName = "JVR.SetComp";
631
+ var MapComp = (_ref2) => {
632
+ var { value, keyName } = _ref2;
633
+ var { Map: Comp = {}, displayDataTypes } = useTypesStore();
634
+ if (!(value instanceof Map) || !displayDataTypes) return null;
635
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded2$4);
636
+ var type = render && typeof render === "function" && render(reset, {
637
+ type: "type",
638
+ value,
639
+ keyName
640
+ });
641
+ if (type) return type;
642
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(as || "span", (0, import_extends.default)({}, reset));
643
+ };
644
+ MapComp.displayName = "JVR.MapComp";
645
+ var defalutStyle = {
646
+ opacity: .75,
647
+ paddingRight: 4
648
+ };
649
+ var TypeString = (_ref3) => {
650
+ var { children = "", keyName, keys } = _ref3;
651
+ var { Str = {}, displayDataTypes } = useTypesStore();
652
+ var { shortenTextAfterLength: length = 30, stringEllipsis = "..." } = useStore();
653
+ var { as, render } = Str, reset = (0, import_objectWithoutPropertiesLoose.default)(Str, _excluded3);
654
+ var childrenStr = children;
655
+ var [shorten, setShorten] = (0, import_react.useState)(length && childrenStr.length > length);
656
+ (0, import_react.useEffect)(() => setShorten(length && childrenStr.length > length), [length]);
657
+ var Comp = as || "span";
658
+ var style = (0, import_extends.default)({}, defalutStyle, Str.style || {});
659
+ if (length > 0) {
660
+ reset.style = (0, import_extends.default)({}, reset.style, { cursor: childrenStr.length <= length ? "initial" : "pointer" });
661
+ if (childrenStr.length > length) reset.onClick = () => {
662
+ setShorten(!shorten);
663
+ };
664
+ }
665
+ var text = shorten ? "" + childrenStr.slice(0, length) + stringEllipsis : childrenStr;
666
+ var isRender = render && typeof render === "function";
667
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
668
+ type: "type",
669
+ value: children,
670
+ keyName,
671
+ keys
672
+ });
673
+ var cls = shorten ? "w-rjv-value w-rjv-value-short" : "w-rjv-value";
674
+ var child = isRender && render((0, import_extends.default)({}, reset, {
675
+ children: text,
676
+ className: cls
677
+ }), {
678
+ type: "value",
679
+ value: children,
680
+ keyName,
681
+ keys
682
+ });
683
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
684
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueQuote$1, {}),
685
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
686
+ className: cls,
687
+ children: text
688
+ })),
689
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueQuote$1, {})
690
+ ] })] });
691
+ };
692
+ TypeString.displayName = "JVR.TypeString";
693
+ var TypeTrue = (_ref4) => {
694
+ var { children, keyName, keys } = _ref4;
695
+ var { True = {}, displayDataTypes } = useTypesStore();
696
+ var { as, render } = True, reset = (0, import_objectWithoutPropertiesLoose.default)(True, _excluded4);
697
+ var Comp = as || "span";
698
+ var style = (0, import_extends.default)({}, defalutStyle, True.style || {});
699
+ var isRender = render && typeof render === "function";
700
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
701
+ type: "type",
702
+ value: children,
703
+ keyName,
704
+ keys
705
+ });
706
+ var child = isRender && render((0, import_extends.default)({}, reset, {
707
+ children,
708
+ className: "w-rjv-value"
709
+ }), {
710
+ type: "value",
711
+ value: children,
712
+ keyName,
713
+ keys
714
+ });
715
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
716
+ className: "w-rjv-value",
717
+ children: children == null ? void 0 : children.toString()
718
+ }))] });
719
+ };
720
+ TypeTrue.displayName = "JVR.TypeTrue";
721
+ var TypeFalse = (_ref5) => {
722
+ var { children, keyName, keys } = _ref5;
723
+ var { False = {}, displayDataTypes } = useTypesStore();
724
+ var { as, render } = False, reset = (0, import_objectWithoutPropertiesLoose.default)(False, _excluded5);
725
+ var Comp = as || "span";
726
+ var style = (0, import_extends.default)({}, defalutStyle, False.style || {});
727
+ var isRender = render && typeof render === "function";
728
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
729
+ type: "type",
730
+ value: children,
731
+ keyName,
732
+ keys
733
+ });
734
+ var child = isRender && render((0, import_extends.default)({}, reset, {
735
+ children,
736
+ className: "w-rjv-value"
737
+ }), {
738
+ type: "value",
739
+ value: children,
740
+ keyName,
741
+ keys
742
+ });
743
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
744
+ className: "w-rjv-value",
745
+ children: children == null ? void 0 : children.toString()
746
+ }))] });
747
+ };
748
+ TypeFalse.displayName = "JVR.TypeFalse";
749
+ var TypeFloat = (_ref6) => {
750
+ var { children, keyName, keys } = _ref6;
751
+ var { Float = {}, displayDataTypes } = useTypesStore();
752
+ var { as, render } = Float, reset = (0, import_objectWithoutPropertiesLoose.default)(Float, _excluded6);
753
+ var Comp = as || "span";
754
+ var style = (0, import_extends.default)({}, defalutStyle, Float.style || {});
755
+ var isRender = render && typeof render === "function";
756
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
757
+ type: "type",
758
+ value: children,
759
+ keyName,
760
+ keys
761
+ });
762
+ var child = isRender && render((0, import_extends.default)({}, reset, {
763
+ children,
764
+ className: "w-rjv-value"
765
+ }), {
766
+ type: "value",
767
+ value: children,
768
+ keyName,
769
+ keys
770
+ });
771
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
772
+ className: "w-rjv-value",
773
+ children: children == null ? void 0 : children.toString()
774
+ }))] });
775
+ };
776
+ TypeFloat.displayName = "JVR.TypeFloat";
777
+ var TypeInt = (_ref7) => {
778
+ var { children, keyName, keys } = _ref7;
779
+ var { Int = {}, displayDataTypes } = useTypesStore();
780
+ var { as, render } = Int, reset = (0, import_objectWithoutPropertiesLoose.default)(Int, _excluded7);
781
+ var Comp = as || "span";
782
+ var style = (0, import_extends.default)({}, defalutStyle, Int.style || {});
783
+ var isRender = render && typeof render === "function";
784
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
785
+ type: "type",
786
+ value: children,
787
+ keyName,
788
+ keys
789
+ });
790
+ var child = isRender && render((0, import_extends.default)({}, reset, {
791
+ children,
792
+ className: "w-rjv-value"
793
+ }), {
794
+ type: "value",
795
+ value: children,
796
+ keyName,
797
+ keys
798
+ });
799
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
800
+ className: "w-rjv-value",
801
+ children: children == null ? void 0 : children.toString()
802
+ }))] });
803
+ };
804
+ TypeInt.displayName = "JVR.TypeInt";
805
+ var TypeBigint = (_ref8) => {
806
+ var { children, keyName, keys } = _ref8;
807
+ var { Bigint: CompBigint = {}, displayDataTypes } = useTypesStore();
808
+ var { as, render } = CompBigint, reset = (0, import_objectWithoutPropertiesLoose.default)(CompBigint, _excluded8);
809
+ var Comp = as || "span";
810
+ var style = (0, import_extends.default)({}, defalutStyle, CompBigint.style || {});
811
+ var isRender = render && typeof render === "function";
812
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
813
+ type: "type",
814
+ value: children,
815
+ keyName,
816
+ keys
817
+ });
818
+ var child = isRender && render((0, import_extends.default)({}, reset, {
819
+ children,
820
+ className: "w-rjv-value"
821
+ }), {
822
+ type: "value",
823
+ value: children,
824
+ keyName,
825
+ keys
826
+ });
827
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
828
+ className: "w-rjv-value",
829
+ children: bigIntToString(children == null ? void 0 : children.toString())
830
+ }))] });
831
+ };
832
+ TypeBigint.displayName = "JVR.TypeFloat";
833
+ var TypeUrl = (_ref9) => {
834
+ var { children, keyName, keys } = _ref9;
835
+ var { Url = {}, displayDataTypes } = useTypesStore();
836
+ var { as, render } = Url, reset = (0, import_objectWithoutPropertiesLoose.default)(Url, _excluded9);
837
+ var Comp = as || "span";
838
+ var style = (0, import_extends.default)({}, defalutStyle, Url.style);
839
+ var isRender = render && typeof render === "function";
840
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
841
+ type: "type",
842
+ value: children,
843
+ keyName,
844
+ keys
845
+ });
846
+ var child = isRender && render((0, import_extends.default)({}, reset, {
847
+ children: children == null ? void 0 : children.href,
848
+ className: "w-rjv-value"
849
+ }), {
850
+ type: "value",
851
+ value: children,
852
+ keyName,
853
+ keys
854
+ });
855
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", (0, import_extends.default)({
856
+ href: children == null ? void 0 : children.href,
857
+ target: "_blank"
858
+ }, reset, {
859
+ className: "w-rjv-value",
860
+ children: [
861
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueQuote$1, {}),
862
+ children == null ? void 0 : children.href,
863
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueQuote$1, {})
864
+ ]
865
+ }))] });
866
+ };
867
+ TypeUrl.displayName = "JVR.TypeUrl";
868
+ var TypeDate = (_ref0) => {
869
+ var { children, keyName, keys } = _ref0;
870
+ var { Date: CompData = {}, displayDataTypes } = useTypesStore();
871
+ var { as, render } = CompData, reset = (0, import_objectWithoutPropertiesLoose.default)(CompData, _excluded0);
872
+ var Comp = as || "span";
873
+ var style = (0, import_extends.default)({}, defalutStyle, CompData.style || {});
874
+ var isRender = render && typeof render === "function";
875
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
876
+ type: "type",
877
+ value: children,
878
+ keyName,
879
+ keys
880
+ });
881
+ var childStr = children instanceof Date ? children.toLocaleString() : children;
882
+ var child = isRender && render((0, import_extends.default)({}, reset, {
883
+ children: childStr,
884
+ className: "w-rjv-value"
885
+ }), {
886
+ type: "value",
887
+ value: children,
888
+ keyName,
889
+ keys
890
+ });
891
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, {
892
+ className: "w-rjv-value",
893
+ children: childStr
894
+ }))] });
895
+ };
896
+ TypeDate.displayName = "JVR.TypeDate";
897
+ var TypeUndefined = (_ref1) => {
898
+ var { children, keyName, keys } = _ref1;
899
+ var { Undefined = {}, displayDataTypes } = useTypesStore();
900
+ var { as, render } = Undefined, reset = (0, import_objectWithoutPropertiesLoose.default)(Undefined, _excluded1);
901
+ var Comp = as || "span";
902
+ var style = (0, import_extends.default)({}, defalutStyle, Undefined.style || {});
903
+ var isRender = render && typeof render === "function";
904
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
905
+ type: "type",
906
+ value: children,
907
+ keyName,
908
+ keys
909
+ });
910
+ var child = isRender && render((0, import_extends.default)({}, reset, {
911
+ children,
912
+ className: "w-rjv-value"
913
+ }), {
914
+ type: "value",
915
+ value: children,
916
+ keyName,
917
+ keys
918
+ });
919
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child] });
920
+ };
921
+ TypeUndefined.displayName = "JVR.TypeUndefined";
922
+ var TypeNull = (_ref10) => {
923
+ var { children, keyName, keys } = _ref10;
924
+ var { Null = {}, displayDataTypes } = useTypesStore();
925
+ var { as, render } = Null, reset = (0, import_objectWithoutPropertiesLoose.default)(Null, _excluded10);
926
+ var Comp = as || "span";
927
+ var style = (0, import_extends.default)({}, defalutStyle, Null.style || {});
928
+ var isRender = render && typeof render === "function";
929
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
930
+ type: "type",
931
+ value: children,
932
+ keyName,
933
+ keys
934
+ });
935
+ var child = isRender && render((0, import_extends.default)({}, reset, {
936
+ children,
937
+ className: "w-rjv-value"
938
+ }), {
939
+ type: "value",
940
+ value: children,
941
+ keyName,
942
+ keys
943
+ });
944
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child] });
945
+ };
946
+ TypeNull.displayName = "JVR.TypeNull";
947
+ var TypeNan = (_ref11) => {
948
+ var { children, keyName, keys } = _ref11;
949
+ var { Nan = {}, displayDataTypes } = useTypesStore();
950
+ var { as, render } = Nan, reset = (0, import_objectWithoutPropertiesLoose.default)(Nan, _excluded11);
951
+ var Comp = as || "span";
952
+ var style = (0, import_extends.default)({}, defalutStyle, Nan.style || {});
953
+ var isRender = render && typeof render === "function";
954
+ var type = isRender && render((0, import_extends.default)({}, reset, { style }), {
955
+ type: "type",
956
+ value: children,
957
+ keyName,
958
+ keys
959
+ });
960
+ var child = isRender && render((0, import_extends.default)({}, reset, {
961
+ children: children == null ? void 0 : children.toString(),
962
+ className: "w-rjv-value"
963
+ }), {
964
+ type: "value",
965
+ value: children,
966
+ keyName,
967
+ keys
968
+ });
969
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [displayDataTypes && (type || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, (0, import_extends.default)({}, reset, { style }))), child] });
970
+ };
971
+ TypeNan.displayName = "JVR.TypeNan";
972
+ //#endregion
973
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/comps/Value.js
974
+ var isFloat = (n) => Number(n) === n && n % 1 !== 0 || isNaN(n);
975
+ var Value = (props) => {
976
+ var { value, keyName, keys } = props;
977
+ var reset = {
978
+ keyName,
979
+ keys
980
+ };
981
+ if (value instanceof URL) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeUrl, (0, import_extends.default)({}, reset, { children: value }));
982
+ if (typeof value === "string") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeString, (0, import_extends.default)({}, reset, { children: value }));
983
+ if (value === true) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeTrue, (0, import_extends.default)({}, reset, { children: value }));
984
+ if (value === false) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeFalse, (0, import_extends.default)({}, reset, { children: value }));
985
+ if (value === null) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeNull, (0, import_extends.default)({}, reset, { children: value }));
986
+ if (value === void 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeUndefined, (0, import_extends.default)({}, reset, { children: value }));
987
+ if (value instanceof Date) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeDate, (0, import_extends.default)({}, reset, { children: value }));
988
+ if (typeof value === "number" && isNaN(value)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeNan, (0, import_extends.default)({}, reset, { children: value }));
989
+ else if (typeof value === "number" && isFloat(value)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeFloat, (0, import_extends.default)({}, reset, { children: value }));
990
+ else if (typeof value === "bigint") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeBigint, (0, import_extends.default)({}, reset, { children: value }));
991
+ else if (typeof value === "number") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypeInt, (0, import_extends.default)({}, reset, { children: value }));
992
+ return null;
993
+ };
994
+ Value.displayName = "JVR.Value";
995
+ //#endregion
996
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/utils/useRender.js
997
+ function useSymbolsRender(currentProps, props, key) {
998
+ var dispatch = useSymbolsDispatch();
999
+ var reset = (0, import_extends.default)({}, currentProps, props, {
1000
+ className: [currentProps.className, props.className].filter(Boolean).join(" "),
1001
+ style: (0, import_extends.default)({}, currentProps.style, props.style),
1002
+ children: props.children || currentProps.children
1003
+ });
1004
+ (0, import_react.useEffect)(() => dispatch({ [key]: reset }), [props]);
1005
+ }
1006
+ function useTypesRender(currentProps, props, key) {
1007
+ var dispatch = useTypesDispatch();
1008
+ var reset = (0, import_extends.default)({}, currentProps, props, {
1009
+ className: [currentProps.className, props.className].filter(Boolean).join(" "),
1010
+ style: (0, import_extends.default)({}, currentProps.style, props.style),
1011
+ children: props.children || currentProps.children
1012
+ });
1013
+ (0, import_react.useEffect)(() => dispatch({ [key]: reset }), [props]);
1014
+ }
1015
+ function useSectionRender(currentProps, props, key) {
1016
+ var dispatch = useSectionDispatch();
1017
+ var reset = (0, import_extends.default)({}, currentProps, props, {
1018
+ className: [currentProps.className, props.className].filter(Boolean).join(" "),
1019
+ style: (0, import_extends.default)({}, currentProps.style, props.style),
1020
+ children: props.children || currentProps.children
1021
+ });
1022
+ (0, import_react.useEffect)(() => dispatch({ [key]: reset }), [props]);
1023
+ }
1024
+ //#endregion
1025
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/section/KeyName.js
1026
+ var _excluded$7 = ["as", "render"];
1027
+ var KeyName = (props) => {
1028
+ var { KeyName: Comp = {} } = useSectionStore();
1029
+ useSectionRender(Comp, props, "KeyName");
1030
+ return null;
1031
+ };
1032
+ KeyName.displayName = "JVR.KeyName";
1033
+ var KeyNameComp = (props) => {
1034
+ var { children, value, parentValue, keyName, keys } = props;
1035
+ var style = { color: typeof children === "number" ? "var(--w-rjv-key-number, #268bd2)" : "var(--w-rjv-key-string, #002b36)" };
1036
+ var { KeyName: Comp = {} } = useSectionStore();
1037
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded$7);
1038
+ reset.style = (0, import_extends.default)({}, reset.style, style);
1039
+ var Elm = as || "span";
1040
+ var child = render && typeof render === "function" && render((0, import_extends.default)({}, reset, { children }), {
1041
+ value,
1042
+ parentValue,
1043
+ keyName,
1044
+ keys: keys || (keyName ? [keyName] : [])
1045
+ });
1046
+ if (child) return child;
1047
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, reset, { children }));
1048
+ };
1049
+ KeyNameComp.displayName = "JVR.KeyNameComp";
1050
+ //#endregion
1051
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/section/Row.js
1052
+ var _excluded$6 = [
1053
+ "children",
1054
+ "value",
1055
+ "parentValue",
1056
+ "keyName",
1057
+ "keys"
1058
+ ], _excluded2$3 = [
1059
+ "as",
1060
+ "render",
1061
+ "children"
1062
+ ];
1063
+ var Row = (props) => {
1064
+ var { Row: Comp = {} } = useSectionStore();
1065
+ useSectionRender(Comp, props, "Row");
1066
+ return null;
1067
+ };
1068
+ Row.displayName = "JVR.Row";
1069
+ var RowComp = (props) => {
1070
+ var { children, value, parentValue, keyName, keys } = props, other = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$6);
1071
+ var { Row: Comp = {} } = useSectionStore();
1072
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded2$3);
1073
+ var Elm = as || "div";
1074
+ var child = render && typeof render === "function" && render((0, import_extends.default)({}, other, reset, { children }), {
1075
+ value,
1076
+ keyName,
1077
+ parentValue,
1078
+ keys
1079
+ });
1080
+ if (child) return child;
1081
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, other, reset, { children }));
1082
+ };
1083
+ RowComp.displayName = "JVR.RowComp";
1084
+ //#endregion
1085
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/utils/useHighlight.js
1086
+ function usePrevious(value) {
1087
+ var ref = (0, import_react.useRef)();
1088
+ (0, import_react.useEffect)(() => {
1089
+ ref.current = value;
1090
+ });
1091
+ return ref.current;
1092
+ }
1093
+ function useHighlight(_ref) {
1094
+ var { value, highlightUpdates, highlightContainer } = _ref;
1095
+ var prevValue = usePrevious(value);
1096
+ var isHighlight = (0, import_react.useMemo)(() => {
1097
+ if (!highlightUpdates || prevValue === void 0) return false;
1098
+ if (typeof value !== typeof prevValue) return true;
1099
+ if (typeof value === "number") {
1100
+ if (isNaN(value) && isNaN(prevValue)) return false;
1101
+ return value !== prevValue;
1102
+ }
1103
+ if (Array.isArray(value) !== Array.isArray(prevValue)) return true;
1104
+ if (typeof value === "object" || typeof value === "function") return false;
1105
+ if (value !== prevValue) return true;
1106
+ }, [highlightUpdates, value]);
1107
+ (0, import_react.useEffect)(() => {
1108
+ if (highlightContainer && highlightContainer.current && isHighlight && "animate" in highlightContainer.current) highlightContainer.current.animate([{ backgroundColor: "var(--w-rjv-update-color, #ebcb8b)" }, { backgroundColor: "" }], {
1109
+ duration: 1e3,
1110
+ easing: "ease-in"
1111
+ });
1112
+ }, [
1113
+ isHighlight,
1114
+ value,
1115
+ highlightContainer
1116
+ ]);
1117
+ }
1118
+ //#endregion
1119
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/comps/Copied.js
1120
+ var _excluded$5 = [
1121
+ "keyName",
1122
+ "value",
1123
+ "parentValue",
1124
+ "expandKey",
1125
+ "keys",
1126
+ "beforeCopy"
1127
+ ], _excluded2$2 = ["as", "render"];
1128
+ var Copied$1 = (props) => {
1129
+ var { keyName, value, parentValue, expandKey, keys, beforeCopy } = props, other = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$5);
1130
+ var { onCopied, enableClipboard, beforeCopy: globalBeforeCopy } = useStore();
1131
+ var isShowTools = useShowToolsStore()[expandKey];
1132
+ var [copied, setCopied] = (0, import_react.useState)(false);
1133
+ var { Copied: Comp = {} } = useSectionStore();
1134
+ var sectionBeforeCopy = Comp == null ? void 0 : Comp.beforeCopy;
1135
+ if (enableClipboard === false || !isShowTools) return null;
1136
+ var click = (event) => {
1137
+ event.stopPropagation();
1138
+ var copyText = "";
1139
+ if (typeof value === "number" && value === Infinity) copyText = "Infinity";
1140
+ else if (typeof value === "number" && isNaN(value)) copyText = "NaN";
1141
+ else if (typeof value === "bigint") copyText = bigIntToString(value);
1142
+ else if (value instanceof Date) copyText = value.toLocaleString();
1143
+ else copyText = JSON.stringify(value, (_, v) => typeof v === "bigint" ? bigIntToString(v) : v, 2);
1144
+ var finalBeforeCopy = beforeCopy || sectionBeforeCopy || globalBeforeCopy;
1145
+ if (finalBeforeCopy && typeof finalBeforeCopy === "function") copyText = finalBeforeCopy(copyText, keyName, value, parentValue, expandKey, keys);
1146
+ onCopied && onCopied(copyText, value);
1147
+ setCopied(true);
1148
+ (navigator.clipboard || { writeText(text) {
1149
+ return new Promise((reslove, reject) => {
1150
+ var textarea = document.createElement("textarea");
1151
+ textarea.style.position = "absolute";
1152
+ textarea.style.opacity = "0";
1153
+ textarea.style.left = "-99999999px";
1154
+ textarea.value = text;
1155
+ document.body.appendChild(textarea);
1156
+ textarea.select();
1157
+ if (!document.execCommand("copy")) reject();
1158
+ else reslove();
1159
+ textarea.remove();
1160
+ });
1161
+ } }).writeText(copyText).then(() => {
1162
+ var timer = setTimeout(() => {
1163
+ setCopied(false);
1164
+ clearTimeout(timer);
1165
+ }, 3e3);
1166
+ }).catch((error) => {});
1167
+ };
1168
+ var svgProps = {
1169
+ style: { display: "inline-flex" },
1170
+ fill: copied ? "var(--w-rjv-copied-success-color, #28a745)" : "var(--w-rjv-copied-color, currentColor)",
1171
+ onClick: click
1172
+ };
1173
+ var { render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded2$2);
1174
+ var elmProps = (0, import_extends.default)({}, reset, other, svgProps, { style: (0, import_extends.default)({}, reset.style, other.style, svgProps.style) });
1175
+ var child = render && typeof render === "function" && render((0, import_extends.default)({}, elmProps, { "data-copied": copied }), {
1176
+ value,
1177
+ keyName,
1178
+ keys,
1179
+ parentValue
1180
+ });
1181
+ if (child) return child;
1182
+ if (copied) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", (0, import_extends.default)({ viewBox: "0 0 32 36" }, elmProps, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z" }) }));
1183
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", (0, import_extends.default)({ viewBox: "0 0 32 36" }, elmProps, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z" }) }));
1184
+ };
1185
+ Copied$1.displayName = "JVR.Copied";
1186
+ //#endregion
1187
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/comps/useIdCompat.js
1188
+ function useIdCompat() {
1189
+ var idRef = (0, import_react.useRef)(null);
1190
+ if (idRef.current === null) idRef.current = "custom-id-" + Math.random().toString(36).substr(2, 9);
1191
+ return idRef.current;
1192
+ }
1193
+ //#endregion
1194
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/comps/KeyValues.js
1195
+ var KeyValues = (props) => {
1196
+ var _expands$expandKey;
1197
+ var { keyName, value, expandKey = "", level, keys = [], parentValue } = props;
1198
+ var expands = useExpandsStore();
1199
+ var { objectSortKeys, indentWidth, collapsed, shouldExpandNodeInitially } = useStore();
1200
+ var defaultExpanded = typeof collapsed === "boolean" ? collapsed : typeof collapsed === "number" ? level > collapsed : false;
1201
+ var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
1202
+ var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
1203
+ value,
1204
+ keys,
1205
+ level,
1206
+ keyName,
1207
+ parentValue
1208
+ });
1209
+ if (shouldExpandNodeInitially && collapsed === false) {
1210
+ if (expands[expandKey] === void 0 && !shouldExpand) return null;
1211
+ } else if (expands[expandKey] === void 0 && shouldExpand) return null;
1212
+ if (isExpanded) return null;
1213
+ var entries = Array.isArray(value) ? Object.entries(value).map((m) => [Number(m[0]), m[1]]) : Object.entries(value);
1214
+ if (objectSortKeys) entries = objectSortKeys === true ? entries.sort((_ref, _ref2) => {
1215
+ var [a] = _ref;
1216
+ var [b] = _ref2;
1217
+ return typeof a === "string" && typeof b === "string" ? a.localeCompare(b) : 0;
1218
+ }) : entries.sort((_ref3, _ref4) => {
1219
+ var [a, valA] = _ref3;
1220
+ var [b, valB] = _ref4;
1221
+ return typeof a === "string" && typeof b === "string" ? objectSortKeys(a, b, valA, valB) : 0;
1222
+ });
1223
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1224
+ className: "w-rjv-wrap",
1225
+ style: {
1226
+ borderLeft: "var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",
1227
+ paddingLeft: indentWidth,
1228
+ marginLeft: 6
1229
+ },
1230
+ children: entries.map((_ref5, idx) => {
1231
+ var [key, val] = _ref5;
1232
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyValuesItem, {
1233
+ parentValue: value,
1234
+ keyName: key,
1235
+ keys: [...keys, key],
1236
+ value: val,
1237
+ level
1238
+ }, idx);
1239
+ })
1240
+ });
1241
+ };
1242
+ KeyValues.displayName = "JVR.KeyValues";
1243
+ var KayName = (props) => {
1244
+ var { keyName, parentValue, keys, value } = props;
1245
+ var { highlightUpdates } = useStore();
1246
+ var isNumber = typeof keyName === "number";
1247
+ var highlightContainer = (0, import_react.useRef)(null);
1248
+ useHighlight({
1249
+ value,
1250
+ highlightUpdates,
1251
+ highlightContainer
1252
+ });
1253
+ var compProps = {
1254
+ keyName,
1255
+ value,
1256
+ keys,
1257
+ parentValue
1258
+ };
1259
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
1260
+ ref: highlightContainer,
1261
+ children: [
1262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Quote$1, (0, import_extends.default)({
1263
+ isNumber,
1264
+ "data-placement": "left"
1265
+ }, compProps)),
1266
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyNameComp, (0, import_extends.default)({}, compProps, { children: keyName })),
1267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Quote$1, (0, import_extends.default)({
1268
+ isNumber,
1269
+ "data-placement": "right"
1270
+ }, compProps))
1271
+ ]
1272
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Colon$1, (0, import_extends.default)({}, compProps))] });
1273
+ };
1274
+ KayName.displayName = "JVR.KayName";
1275
+ var KeyValuesItem = (props) => {
1276
+ var { keyName, value, parentValue, level = 0, keys = [] } = props;
1277
+ var dispatch = useShowToolsDispatch();
1278
+ var subkeyid = useIdCompat();
1279
+ var isMyArray = Array.isArray(value);
1280
+ var isMySet = value instanceof Set;
1281
+ var isMyMap = value instanceof Map;
1282
+ var isDate = value instanceof Date;
1283
+ var isUrl = value instanceof URL;
1284
+ if (value && typeof value === "object" && !isMyArray && !isMySet && !isMyMap && !isDate && !isUrl || isMyArray || isMySet || isMyMap) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, {
1285
+ keyName,
1286
+ value: isMySet ? Array.from(value) : isMyMap ? Object.fromEntries(value) : value,
1287
+ parentValue,
1288
+ initialValue: value,
1289
+ keys,
1290
+ level: level + 1
1291
+ });
1292
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RowComp, (0, import_extends.default)({
1293
+ className: "w-rjv-line",
1294
+ value,
1295
+ keyName,
1296
+ keys,
1297
+ parentValue
1298
+ }, {
1299
+ onMouseEnter: () => dispatch({ [subkeyid]: true }),
1300
+ onMouseLeave: () => dispatch({ [subkeyid]: false })
1301
+ }, { children: [
1302
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KayName, {
1303
+ keyName,
1304
+ value,
1305
+ keys,
1306
+ parentValue
1307
+ }),
1308
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Value, {
1309
+ keyName,
1310
+ value,
1311
+ keys
1312
+ }),
1313
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copied$1, {
1314
+ keyName,
1315
+ value,
1316
+ keys,
1317
+ parentValue,
1318
+ expandKey: subkeyid
1319
+ })
1320
+ ] }));
1321
+ };
1322
+ KeyValuesItem.displayName = "JVR.KeyValuesItem";
1323
+ //#endregion
1324
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/section/CountInfoExtra.js
1325
+ var _excluded$4 = ["value", "keyName"], _excluded2$1 = ["as", "render"];
1326
+ var CountInfoExtra = (props) => {
1327
+ var { CountInfoExtra: Comp = {} } = useSectionStore();
1328
+ useSectionRender(Comp, props, "CountInfoExtra");
1329
+ return null;
1330
+ };
1331
+ CountInfoExtra.displayName = "JVR.CountInfoExtra";
1332
+ var CountInfoExtraComps = (props) => {
1333
+ var { value = {}, keyName } = props, other = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$4);
1334
+ var { CountInfoExtra: Comp = {} } = useSectionStore();
1335
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded2$1);
1336
+ if (!render && !reset.children) return null;
1337
+ var Elm = as || "span";
1338
+ var isRender = render && typeof render === "function";
1339
+ var elmProps = (0, import_extends.default)({}, reset, other);
1340
+ var child = isRender && render(elmProps, {
1341
+ value,
1342
+ keyName
1343
+ });
1344
+ if (child) return child;
1345
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, elmProps));
1346
+ };
1347
+ CountInfoExtraComps.displayName = "JVR.CountInfoExtraComps";
1348
+ //#endregion
1349
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/section/CountInfo.js
1350
+ var _excluded$3 = ["value", "keyName"], _excluded2 = ["as", "render"];
1351
+ var CountInfo = (props) => {
1352
+ var { CountInfo: Comp = {} } = useSectionStore();
1353
+ useSectionRender(Comp, props, "CountInfo");
1354
+ return null;
1355
+ };
1356
+ CountInfo.displayName = "JVR.CountInfo";
1357
+ var CountInfoComp = (props) => {
1358
+ var { value = {}, keyName } = props, other = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$3);
1359
+ var { displayObjectSize } = useStore();
1360
+ var { CountInfo: Comp = {} } = useSectionStore();
1361
+ if (!displayObjectSize) return null;
1362
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded2);
1363
+ var Elm = as || "span";
1364
+ reset.style = (0, import_extends.default)({}, reset.style, props.style);
1365
+ var len = Object.keys(value).length;
1366
+ if (!reset.children) reset.children = len + " item" + (len === 1 ? "" : "s");
1367
+ var elmProps = (0, import_extends.default)({}, reset, other);
1368
+ var child = render && typeof render === "function" && render((0, import_extends.default)({}, elmProps, { "data-length": len }), {
1369
+ value,
1370
+ keyName
1371
+ });
1372
+ if (child) return child;
1373
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, elmProps));
1374
+ };
1375
+ CountInfoComp.displayName = "JVR.CountInfoComp";
1376
+ //#endregion
1377
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/section/Ellipsis.js
1378
+ var _excluded$2 = ["as", "render"];
1379
+ var Ellipsis = (props) => {
1380
+ var { Ellipsis: Comp = {} } = useSectionStore();
1381
+ useSectionRender(Comp, props, "Ellipsis");
1382
+ return null;
1383
+ };
1384
+ Ellipsis.displayName = "JVR.Ellipsis";
1385
+ var EllipsisComp = (_ref) => {
1386
+ var { isExpanded, value, keyName } = _ref;
1387
+ var { Ellipsis: Comp = {} } = useSectionStore();
1388
+ var { as, render } = Comp, reset = (0, import_objectWithoutPropertiesLoose.default)(Comp, _excluded$2);
1389
+ var Elm = as || "span";
1390
+ var child = render && typeof render === "function" && render((0, import_extends.default)({}, reset, { "data-expanded": isExpanded }), {
1391
+ value,
1392
+ keyName
1393
+ });
1394
+ if (child) return child;
1395
+ if (!isExpanded || typeof value === "object" && Object.keys(value).length == 0) return null;
1396
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Elm, (0, import_extends.default)({}, reset));
1397
+ };
1398
+ EllipsisComp.displayName = "JVR.EllipsisComp";
1399
+ //#endregion
1400
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/comps/NestedOpen.js
1401
+ var NestedOpen = (props) => {
1402
+ var _expands$expandKey;
1403
+ var { keyName, expandKey, keys = [], initialValue, value, parentValue, level } = props;
1404
+ var expands = useExpandsStore();
1405
+ var dispatchExpands = useExpandsDispatch();
1406
+ var { onExpand, collapsed, shouldExpandNodeInitially } = useStore();
1407
+ var defaultExpanded = typeof collapsed === "boolean" ? collapsed : typeof collapsed === "number" ? level > collapsed : false;
1408
+ var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
1409
+ var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
1410
+ value,
1411
+ keys,
1412
+ level,
1413
+ keyName,
1414
+ parentValue
1415
+ });
1416
+ if (expands[expandKey] === void 0 && shouldExpandNodeInitially) isExpanded = !shouldExpand;
1417
+ var click = () => {
1418
+ var opt = {
1419
+ expand: !isExpanded,
1420
+ value,
1421
+ keyid: expandKey,
1422
+ keyName
1423
+ };
1424
+ onExpand && onExpand(opt);
1425
+ dispatchExpands({ [expandKey]: opt.expand });
1426
+ };
1427
+ var style = {
1428
+ display: "inline-flex",
1429
+ alignItems: "center"
1430
+ };
1431
+ var arrowStyle = {
1432
+ transform: "rotate(" + (!isExpanded ? "0" : "-90") + "deg)",
1433
+ transition: "all 0.3s"
1434
+ };
1435
+ var len = Object.keys(value).length;
1436
+ var isObject = typeof value === "object";
1437
+ var isArray = Array.isArray(value);
1438
+ var isMySet = value instanceof Set;
1439
+ var showArrow = len !== 0 && (isArray || isMySet || isObject);
1440
+ var reset = { style };
1441
+ if (showArrow) reset.onClick = click;
1442
+ var compProps = {
1443
+ keyName,
1444
+ value,
1445
+ keys,
1446
+ parentValue
1447
+ };
1448
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", (0, import_extends.default)({}, reset, { children: [
1449
+ showArrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow$1, (0, import_extends.default)({
1450
+ style: arrowStyle,
1451
+ expandKey
1452
+ }, compProps)),
1453
+ (keyName || typeof keyName === "number") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KayName, (0, import_extends.default)({}, compProps)),
1454
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SetComp, {
1455
+ value: initialValue,
1456
+ keyName
1457
+ }),
1458
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MapComp, {
1459
+ value: initialValue,
1460
+ keyName
1461
+ }),
1462
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BracketsOpen, (0, import_extends.default)({ isBrackets: isArray || isMySet }, compProps)),
1463
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EllipsisComp, {
1464
+ keyName,
1465
+ value,
1466
+ isExpanded
1467
+ }),
1468
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BracketsClose, (0, import_extends.default)({
1469
+ isVisiable: isExpanded || !showArrow,
1470
+ isBrackets: isArray || isMySet
1471
+ }, compProps)),
1472
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CountInfoComp, {
1473
+ value,
1474
+ keyName
1475
+ }),
1476
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CountInfoExtraComps, {
1477
+ value,
1478
+ keyName
1479
+ }),
1480
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copied$1, {
1481
+ keyName,
1482
+ value,
1483
+ expandKey,
1484
+ parentValue,
1485
+ keys
1486
+ })
1487
+ ] }));
1488
+ };
1489
+ NestedOpen.displayName = "JVR.NestedOpen";
1490
+ //#endregion
1491
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/Container.js
1492
+ var _excluded$1 = [
1493
+ "className",
1494
+ "children",
1495
+ "parentValue",
1496
+ "keyid",
1497
+ "level",
1498
+ "value",
1499
+ "initialValue",
1500
+ "keys",
1501
+ "keyName"
1502
+ ];
1503
+ var Container = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
1504
+ var { className = "", parentValue, level = 1, value, initialValue, keys, keyName } = props, elmProps = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded$1);
1505
+ var dispatch = useShowToolsDispatch();
1506
+ var subkeyid = useIdCompat();
1507
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", (0, import_extends.default)({
1508
+ className: [className, "w-rjv-inner"].filter(Boolean).join(" "),
1509
+ ref
1510
+ }, elmProps, {
1511
+ onMouseEnter: () => dispatch({ [subkeyid]: true }),
1512
+ onMouseLeave: () => dispatch({ [subkeyid]: false })
1513
+ }, { children: [
1514
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NestedOpen, {
1515
+ expandKey: subkeyid,
1516
+ value,
1517
+ level,
1518
+ keys,
1519
+ parentValue,
1520
+ keyName,
1521
+ initialValue
1522
+ }),
1523
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyValues, {
1524
+ expandKey: subkeyid,
1525
+ value,
1526
+ level,
1527
+ keys,
1528
+ parentValue,
1529
+ keyName
1530
+ }),
1531
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NestedClose, {
1532
+ expandKey: subkeyid,
1533
+ value,
1534
+ level,
1535
+ keys,
1536
+ parentValue,
1537
+ keyName
1538
+ })
1539
+ ] }));
1540
+ });
1541
+ Container.displayName = "JVR.Container";
1542
+ //#endregion
1543
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/BraceLeft.js
1544
+ var BraceLeft = (props) => {
1545
+ var { BraceLeft: Comp = {} } = useSymbolsStore();
1546
+ useSymbolsRender(Comp, props, "BraceLeft");
1547
+ return null;
1548
+ };
1549
+ BraceLeft.displayName = "JVR.BraceLeft";
1550
+ //#endregion
1551
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/BraceRight.js
1552
+ var BraceRight = (props) => {
1553
+ var { BraceRight: Comp = {} } = useSymbolsStore();
1554
+ useSymbolsRender(Comp, props, "BraceRight");
1555
+ return null;
1556
+ };
1557
+ BraceRight.displayName = "JVR.BraceRight";
1558
+ //#endregion
1559
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/BracketsLeft.js
1560
+ var BracketsLeft = (props) => {
1561
+ var { BracketsLeft: Comp = {} } = useSymbolsStore();
1562
+ useSymbolsRender(Comp, props, "BracketsLeft");
1563
+ return null;
1564
+ };
1565
+ BracketsLeft.displayName = "JVR.BracketsLeft";
1566
+ //#endregion
1567
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/BracketsRight.js
1568
+ var BracketsRight = (props) => {
1569
+ var { BracketsRight: Comp = {} } = useSymbolsStore();
1570
+ useSymbolsRender(Comp, props, "BracketsRight");
1571
+ return null;
1572
+ };
1573
+ BracketsRight.displayName = "JVR.BracketsRight";
1574
+ //#endregion
1575
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/Arrow.js
1576
+ var Arrow = (props) => {
1577
+ var { Arrow: Comp = {} } = useSymbolsStore();
1578
+ useSymbolsRender(Comp, props, "Arrow");
1579
+ return null;
1580
+ };
1581
+ Arrow.displayName = "JVR.Arrow";
1582
+ //#endregion
1583
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/Colon.js
1584
+ var Colon = (props) => {
1585
+ var { Colon: Comp = {} } = useSymbolsStore();
1586
+ useSymbolsRender(Comp, props, "Colon");
1587
+ return null;
1588
+ };
1589
+ Colon.displayName = "JVR.Colon";
1590
+ //#endregion
1591
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/Quote.js
1592
+ var Quote = (props) => {
1593
+ var { Quote: Comp = {} } = useSymbolsStore();
1594
+ useSymbolsRender(Comp, props, "Quote");
1595
+ return null;
1596
+ };
1597
+ Quote.displayName = "JVR.Quote";
1598
+ //#endregion
1599
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/symbol/ValueQuote.js
1600
+ var ValueQuote = (props) => {
1601
+ var { ValueQuote: Comp = {} } = useSymbolsStore();
1602
+ useSymbolsRender(Comp, props, "ValueQuote");
1603
+ return null;
1604
+ };
1605
+ ValueQuote.displayName = "JVR.ValueQuote";
1606
+ //#endregion
1607
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Bigint.js
1608
+ var Bigint = (props) => {
1609
+ var { Bigint: Comp = {} } = useTypesStore();
1610
+ useTypesRender(Comp, props, "Bigint");
1611
+ return null;
1612
+ };
1613
+ Bigint.displayName = "JVR.Bigint";
1614
+ //#endregion
1615
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Date.js
1616
+ var Date$1 = (props) => {
1617
+ var { Date: Comp = {} } = useTypesStore();
1618
+ useTypesRender(Comp, props, "Date");
1619
+ return null;
1620
+ };
1621
+ Date$1.displayName = "JVR.Date";
1622
+ //#endregion
1623
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/False.js
1624
+ var False = (props) => {
1625
+ var { False: Comp = {} } = useTypesStore();
1626
+ useTypesRender(Comp, props, "False");
1627
+ return null;
1628
+ };
1629
+ False.displayName = "JVR.False";
1630
+ //#endregion
1631
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Float.js
1632
+ var Float = (props) => {
1633
+ var { Float: Comp = {} } = useTypesStore();
1634
+ useTypesRender(Comp, props, "Float");
1635
+ return null;
1636
+ };
1637
+ Float.displayName = "JVR.Float";
1638
+ //#endregion
1639
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Int.js
1640
+ var Int = (props) => {
1641
+ var { Int: Comp = {} } = useTypesStore();
1642
+ useTypesRender(Comp, props, "Int");
1643
+ return null;
1644
+ };
1645
+ Int.displayName = "JVR.Int";
1646
+ //#endregion
1647
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Map.js
1648
+ var Map$1 = (props) => {
1649
+ var { Map: Comp = {} } = useTypesStore();
1650
+ useTypesRender(Comp, props, "Map");
1651
+ return null;
1652
+ };
1653
+ Map$1.displayName = "JVR.Map";
1654
+ //#endregion
1655
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Nan.js
1656
+ var Nan = (props) => {
1657
+ var { Nan: Comp = {} } = useTypesStore();
1658
+ useTypesRender(Comp, props, "Nan");
1659
+ return null;
1660
+ };
1661
+ Nan.displayName = "JVR.Nan";
1662
+ //#endregion
1663
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Null.js
1664
+ var Null = (props) => {
1665
+ var { Null: Comp = {} } = useTypesStore();
1666
+ useTypesRender(Comp, props, "Null");
1667
+ return null;
1668
+ };
1669
+ Null.displayName = "JVR.Null";
1670
+ //#endregion
1671
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Set.js
1672
+ var Set$1 = (props) => {
1673
+ var { Set: Comp = {} } = useTypesStore();
1674
+ useTypesRender(Comp, props, "Set");
1675
+ return null;
1676
+ };
1677
+ Set$1.displayName = "JVR.Set";
1678
+ //#endregion
1679
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/String.js
1680
+ var StringText = (props) => {
1681
+ var { Str: Comp = {} } = useTypesStore();
1682
+ useTypesRender(Comp, props, "Str");
1683
+ return null;
1684
+ };
1685
+ StringText.displayName = "JVR.StringText";
1686
+ //#endregion
1687
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/True.js
1688
+ var True = (props) => {
1689
+ var { True: Comp = {} } = useTypesStore();
1690
+ useTypesRender(Comp, props, "True");
1691
+ return null;
1692
+ };
1693
+ True.displayName = "JVR.True";
1694
+ //#endregion
1695
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Undefined.js
1696
+ var Undefined = (props) => {
1697
+ var { Undefined: Comp = {} } = useTypesStore();
1698
+ useTypesRender(Comp, props, "Undefined");
1699
+ return null;
1700
+ };
1701
+ Undefined.displayName = "JVR.Undefined";
1702
+ //#endregion
1703
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/types/Url.js
1704
+ var Url = (props) => {
1705
+ var { Url: Comp = {} } = useTypesStore();
1706
+ useTypesRender(Comp, props, "Url");
1707
+ return null;
1708
+ };
1709
+ Url.displayName = "JVR.Url";
1710
+ //#endregion
1711
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/section/Copied.js
1712
+ var Copied = (props) => {
1713
+ var { Copied: Comp = {} } = useSectionStore();
1714
+ useSectionRender(Comp, props, "Copied");
1715
+ return null;
1716
+ };
1717
+ Copied.displayName = "JVR.Copied";
1718
+ //#endregion
1719
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/index.js
1720
+ var _excluded = [
1721
+ "className",
1722
+ "style",
1723
+ "value",
1724
+ "children",
1725
+ "collapsed",
1726
+ "shouldExpandNodeInitially",
1727
+ "indentWidth",
1728
+ "displayObjectSize",
1729
+ "shortenTextAfterLength",
1730
+ "stringEllipsis",
1731
+ "highlightUpdates",
1732
+ "enableClipboard",
1733
+ "displayDataTypes",
1734
+ "objectSortKeys",
1735
+ "onExpand",
1736
+ "onCopied",
1737
+ "beforeCopy"
1738
+ ];
1739
+ var JsonView = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
1740
+ var { className = "", style, value, children, collapsed = false, shouldExpandNodeInitially, indentWidth = 15, displayObjectSize = true, shortenTextAfterLength = 30, stringEllipsis, highlightUpdates = true, enableClipboard = true, displayDataTypes = true, objectSortKeys = false, onExpand, onCopied, beforeCopy } = props, elmProps = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded);
1741
+ var defaultStyle = (0, import_extends.default)({
1742
+ lineHeight: 1.4,
1743
+ fontFamily: "var(--w-rjv-font-family, Menlo, monospace)",
1744
+ color: "var(--w-rjv-color, #002b36)",
1745
+ backgroundColor: "var(--w-rjv-background-color, #00000000)",
1746
+ fontSize: 13
1747
+ }, style);
1748
+ var cls = [
1749
+ "w-json-view-container",
1750
+ "w-rjv",
1751
+ className
1752
+ ].filter(Boolean).join(" ");
1753
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Provider, {
1754
+ initialState: {
1755
+ value,
1756
+ objectSortKeys,
1757
+ indentWidth,
1758
+ shouldExpandNodeInitially: collapsed === false ? shouldExpandNodeInitially : void 0,
1759
+ displayObjectSize,
1760
+ collapsed,
1761
+ enableClipboard,
1762
+ shortenTextAfterLength,
1763
+ stringEllipsis,
1764
+ highlightUpdates,
1765
+ onCopied,
1766
+ onExpand,
1767
+ beforeCopy
1768
+ },
1769
+ initialTypes: { displayDataTypes },
1770
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, (0, import_extends.default)({ value }, elmProps, {
1771
+ ref,
1772
+ className: cls,
1773
+ style: defaultStyle
1774
+ })), children]
1775
+ });
1776
+ });
1777
+ JsonView.Bigint = Bigint;
1778
+ JsonView.Date = Date$1;
1779
+ JsonView.False = False;
1780
+ JsonView.Float = Float;
1781
+ JsonView.Int = Int;
1782
+ JsonView.Map = Map$1;
1783
+ JsonView.Nan = Nan;
1784
+ JsonView.Null = Null;
1785
+ JsonView.Set = Set$1;
1786
+ JsonView.String = StringText;
1787
+ JsonView.True = True;
1788
+ JsonView.Undefined = Undefined;
1789
+ JsonView.Url = Url;
1790
+ JsonView.ValueQuote = ValueQuote;
1791
+ JsonView.Arrow = Arrow;
1792
+ JsonView.Colon = Colon;
1793
+ JsonView.Quote = Quote;
1794
+ JsonView.Ellipsis = Ellipsis;
1795
+ JsonView.BraceLeft = BraceLeft;
1796
+ JsonView.BraceRight = BraceRight;
1797
+ JsonView.BracketsLeft = BracketsLeft;
1798
+ JsonView.BracketsRight = BracketsRight;
1799
+ JsonView.Copied = Copied;
1800
+ JsonView.CountInfo = CountInfo;
1801
+ JsonView.CountInfoExtra = CountInfoExtra;
1802
+ JsonView.KeyName = KeyName;
1803
+ JsonView.Row = Row;
1804
+ JsonView.displayName = "JVR.JsonView";
1805
+ //#endregion
1806
+ //#region ../../node_modules/.pnpm/@uiw+react-json-view@2.0.0-alpha.41_@babel+runtime@7.29.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@uiw/react-json-view/esm/theme/light.js
1807
+ var lightTheme = {
1808
+ "--w-rjv-font-family": "monospace",
1809
+ "--w-rjv-color": "#002b36",
1810
+ "--w-rjv-key-string": "#002b36",
1811
+ "--w-rjv-background-color": "#ffffff",
1812
+ "--w-rjv-line-color": "#ebebeb",
1813
+ "--w-rjv-arrow-color": "var(--w-rjv-color)",
1814
+ "--w-rjv-edit-color": "var(--w-rjv-color)",
1815
+ "--w-rjv-info-color": "#0000004d",
1816
+ "--w-rjv-update-color": "#ebcb8b",
1817
+ "--w-rjv-copied-color": "#002b36",
1818
+ "--w-rjv-copied-success-color": "#28a745",
1819
+ "--w-rjv-curlybraces-color": "#236a7c",
1820
+ "--w-rjv-colon-color": "#002b36",
1821
+ "--w-rjv-brackets-color": "#236a7c",
1822
+ "--w-rjv-quotes-color": "var(--w-rjv-key-string)",
1823
+ "--w-rjv-quotes-string-color": "var(--w-rjv-type-string-color)",
1824
+ "--w-rjv-type-string-color": "#cb4b16",
1825
+ "--w-rjv-type-int-color": "#268bd2",
1826
+ "--w-rjv-type-float-color": "#859900",
1827
+ "--w-rjv-type-bigint-color": "#268bd2",
1828
+ "--w-rjv-type-boolean-color": "#2aa198",
1829
+ "--w-rjv-type-date-color": "#586e75",
1830
+ "--w-rjv-type-url-color": "#0969da",
1831
+ "--w-rjv-type-null-color": "#d33682",
1832
+ "--w-rjv-type-nan-color": "#859900",
1833
+ "--w-rjv-type-undefined-color": "#586e75"
1834
+ };
1835
+ //#endregion
1836
+ //#region ~icons/lucide/arrow-left.jsx
1837
+ var lucideArrowLeft = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1838
+ viewBox: "0 0 24 24",
1839
+ width: "1.2em",
1840
+ height: "1.2em",
1841
+ ...props,
1842
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1843
+ fill: "none",
1844
+ stroke: "currentColor",
1845
+ strokeLinecap: "round",
1846
+ strokeLinejoin: "round",
1847
+ strokeWidth: 2,
1848
+ d: "m12 19l-7-7l7-7m7 7H5"
1849
+ })
1850
+ });
1851
+ //#endregion
1852
+ //#region ~icons/lucide/check.jsx
1853
+ var lucideCheck = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1854
+ viewBox: "0 0 24 24",
1855
+ width: "1.2em",
1856
+ height: "1.2em",
1857
+ ...props,
1858
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1859
+ fill: "none",
1860
+ stroke: "currentColor",
1861
+ strokeLinecap: "round",
1862
+ strokeLinejoin: "round",
1863
+ strokeWidth: 2,
1864
+ d: "M20 6L9 17l-5-5"
1865
+ })
1866
+ });
1867
+ //#endregion
1868
+ //#region ~icons/lucide/chevron-down.jsx
1869
+ var lucideChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1870
+ viewBox: "0 0 24 24",
1871
+ width: "1.2em",
1872
+ height: "1.2em",
1873
+ ...props,
1874
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1875
+ fill: "none",
1876
+ stroke: "currentColor",
1877
+ strokeLinecap: "round",
1878
+ strokeLinejoin: "round",
1879
+ strokeWidth: 2,
1880
+ d: "m6 9l6 6l6-6"
1881
+ })
1882
+ });
1883
+ //#endregion
1884
+ //#region ~icons/lucide/copy.jsx
1885
+ var lucideCopy = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1886
+ viewBox: "0 0 24 24",
1887
+ width: "1.2em",
1888
+ height: "1.2em",
1889
+ ...props,
1890
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
1891
+ fill: "none",
1892
+ stroke: "currentColor",
1893
+ strokeLinecap: "round",
1894
+ strokeLinejoin: "round",
1895
+ strokeWidth: 2,
1896
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
1897
+ width: 14,
1898
+ height: 14,
1899
+ x: 8,
1900
+ y: 8,
1901
+ rx: 2,
1902
+ ry: 2
1903
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
1904
+ })
1905
+ });
1906
+ //#endregion
1907
+ //#region src/routes/requests/show.tsx?tsr-split=component
1908
+ function RequestShowPage() {
1909
+ const { id } = Route.useSearch();
1910
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RequestDetail, { id });
1911
+ }
1912
+ function formatNum(n) {
1913
+ return n.toLocaleString();
1914
+ }
1915
+ var TOKENS_PER_SEC_PROVIDERS = /* @__PURE__ */ new Set();
1916
+ function tryParseJson(text) {
1917
+ try {
1918
+ return {
1919
+ ok: true,
1920
+ value: JSON.parse(text)
1921
+ };
1922
+ } catch {
1923
+ return { ok: false };
1924
+ }
1925
+ }
1926
+ function safeParseJson(text) {
1927
+ if (!text) return {};
1928
+ try {
1929
+ return JSON.parse(text);
1930
+ } catch {
1931
+ return text;
1932
+ }
1933
+ }
1934
+ function CopyButton({ text }) {
1935
+ const [copied, setCopied] = (0, import_react.useState)(false);
1936
+ (0, import_react.useEffect)(() => {
1937
+ if (!copied) return void 0;
1938
+ const id = setTimeout(() => setCopied(false), 1500);
1939
+ return () => clearTimeout(id);
1940
+ }, [copied]);
1941
+ const handleCopy = () => {
1942
+ navigator.clipboard.writeText(text);
1943
+ setCopied(true);
1944
+ };
1945
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
1946
+ type: "button",
1947
+ className: "absolute top-2 right-2 p-1 rounded text-sand-400 hover:text-sand-600 transition-colors",
1948
+ onClick: handleCopy,
1949
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideCheck, { className: "size-3.5 text-sage-500" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideCopy, { className: "size-3.5" })
1950
+ });
1951
+ }
1952
+ var DATA_IMAGE_TAG_RE = /<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;
1953
+ function parseImageSegments(text) {
1954
+ const segments = [];
1955
+ let cursor = 0;
1956
+ for (const match of text.matchAll(DATA_IMAGE_TAG_RE)) {
1957
+ const index = match.index ?? 0;
1958
+ if (index > cursor) segments.push({
1959
+ type: "text",
1960
+ text: text.slice(cursor, index)
1961
+ });
1962
+ segments.push({
1963
+ type: "image",
1964
+ src: match[1],
1965
+ alt: match[2] ?? "generated image"
1966
+ });
1967
+ cursor = index + match[0].length;
1968
+ }
1969
+ if (cursor < text.length) segments.push({
1970
+ type: "text",
1971
+ text: text.slice(cursor)
1972
+ });
1973
+ return segments.filter((segment) => segment.type === "image" || segment.text.trim().length > 0);
1974
+ }
1975
+ function ImageAwareContent({ text, markdown }) {
1976
+ const [viewerSrc, setViewerSrc] = (0, import_react.useState)(null);
1977
+ const segments = parseImageSegments(text);
1978
+ if (!segments.some((segment) => segment.type === "image")) return markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1979
+ className: "prose prose-sm prose-qgrid max-w-none",
1980
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
1981
+ remarkPlugins: [remarkGfm],
1982
+ children: text
1983
+ })
1984
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
1985
+ className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
1986
+ children: text
1987
+ });
1988
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
1989
+ className: "space-y-3",
1990
+ children: [segments.map((segment, index) => segment.type === "text" ? markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1991
+ className: "prose prose-sm prose-qgrid max-w-none",
1992
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
1993
+ remarkPlugins: [remarkGfm],
1994
+ children: segment.text
1995
+ })
1996
+ }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
1997
+ className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
1998
+ children: segment.text
1999
+ }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2000
+ type: "button",
2001
+ className: "block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors",
2002
+ onClick: () => setViewerSrc(segment.src),
2003
+ title: "Open image",
2004
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
2005
+ src: segment.src,
2006
+ alt: segment.alt,
2007
+ className: "max-h-[520px] max-w-full object-contain",
2008
+ loading: "lazy"
2009
+ })
2010
+ }, `image-${index}`)), viewerSrc && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2011
+ className: "fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center",
2012
+ onClick: () => setViewerSrc(null),
2013
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2014
+ type: "button",
2015
+ className: "absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white",
2016
+ onClick: () => setViewerSrc(null),
2017
+ title: "Close image",
2018
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideX, { className: "size-5" })
2019
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
2020
+ src: viewerSrc,
2021
+ alt: "generated preview",
2022
+ className: "max-h-full max-w-full object-contain rounded-md bg-white",
2023
+ onClick: (e) => e.stopPropagation()
2024
+ })]
2025
+ })]
2026
+ });
2027
+ }
2028
+ function FormattedContent({ text, markdown }) {
2029
+ const parsed = tryParseJson(text);
2030
+ const [mode, setMode] = (0, import_react.useState)("pretty");
2031
+ const canRenderJsonView = parsed.ok && parsed.value !== null && (Array.isArray(parsed.value) || typeof parsed.value === "object");
2032
+ if (!parsed.ok || !canRenderJsonView) {
2033
+ if (markdown) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageAwareContent, {
2034
+ text,
2035
+ markdown: true
2036
+ });
2037
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageAwareContent, { text: parsed.ok ? JSON.stringify(parsed.value, null, 2) : text });
2038
+ }
2039
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2040
+ className: "flex gap-1 mb-2",
2041
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2042
+ type: "button",
2043
+ className: `px-2 py-0.5 text-[10px] rounded-md transition-colors ${mode === "plain" ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600"}`,
2044
+ onClick: () => setMode("plain"),
2045
+ children: "Plain"
2046
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2047
+ type: "button",
2048
+ className: `px-2 py-0.5 text-[10px] rounded-md transition-colors ${mode === "pretty" ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600"}`,
2049
+ onClick: () => setMode("pretty"),
2050
+ children: "Pretty"
2051
+ })]
2052
+ }), mode === "pretty" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(JsonView, {
2053
+ value: parsed.value,
2054
+ style: lightTheme,
2055
+ displayDataTypes: false,
2056
+ enableClipboard: true,
2057
+ collapsed: false
2058
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2059
+ className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
2060
+ children: JSON.stringify(parsed.value, null, 2)
2061
+ })] });
2062
+ }
2063
+ function Section({ title, defaultOpen = true, children }) {
2064
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2065
+ open: defaultOpen,
2066
+ className: "group panel overflow-hidden",
2067
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2068
+ className: "panel-header flex items-center gap-1.5 cursor-pointer select-none list-none px-4 py-2.5",
2069
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3.5 text-sand-400 transition-transform group-open:rotate-0 -rotate-90" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2070
+ className: "text-[11px] uppercase tracking-wider text-sand-500 font-medium",
2071
+ children: title
2072
+ })]
2073
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2074
+ className: "p-4",
2075
+ children
2076
+ })]
2077
+ });
2078
+ }
2079
+ function Metric({ label, value }) {
2080
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2081
+ className: "min-w-0",
2082
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
2083
+ className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate",
2084
+ children: label
2085
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
2086
+ className: "text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate",
2087
+ children: value
2088
+ })]
2089
+ });
2090
+ }
2091
+ var STATUS_STYLE = {
2092
+ running: "bg-blue-100 text-blue-600",
2093
+ succeeded: "bg-sage-100 text-sage-600",
2094
+ error: "bg-red-100 text-red-600",
2095
+ aborted: "bg-caution-400/15 text-caution-500"
2096
+ };
2097
+ function ErrorPanel({ message }) {
2098
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2099
+ className: "panel overflow-hidden border border-red-200 bg-red-50/60",
2100
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2101
+ className: "px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5",
2102
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2103
+ className: "text-[11px] uppercase tracking-wider text-red-600 font-medium",
2104
+ children: "Error"
2105
+ })
2106
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2107
+ className: "p-4",
2108
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2109
+ className: "text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto",
2110
+ children: message
2111
+ })
2112
+ })]
2113
+ });
2114
+ }
2115
+ function HeaderBar({ data }) {
2116
+ const isRunning = data.status === "running";
2117
+ const hasFallback = !isRunning && data.requested_model_name !== null && data.model_name !== null && data.requested_model_name !== data.model_name;
2118
+ const hasRequestedOnly = !isRunning && data.requested_model_name !== null && data.model_name === null;
2119
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2120
+ className: "panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5",
2121
+ children: [
2122
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2123
+ className: "text-[15px] font-semibold text-sand-900 break-all",
2124
+ children: isRunning ? "실행 중" : hasFallback ? `${data.requested_model_name} → ${data.model_name}` : data.model_name ?? data.requested_model_name ?? "Unknown model"
2125
+ }),
2126
+ hasRequestedOnly && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2127
+ className: "text-[10px] text-sand-400",
2128
+ children: "요청"
2129
+ }),
2130
+ !isRunning && (data.fallback_count ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2131
+ className: "text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase",
2132
+ children: ["fallback ×", data.fallback_count]
2133
+ }),
2134
+ !isRunning && data.status !== "succeeded" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2135
+ className: `text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${STATUS_STYLE[data.status] ?? "bg-sand-100 text-sand-500"}`,
2136
+ children: data.status
2137
+ }),
2138
+ data.effort && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2139
+ className: "text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono",
2140
+ children: ["effort=", data.effort]
2141
+ }),
2142
+ data.project_name && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2143
+ className: "text-[12px] text-sand-400",
2144
+ children: ["· project=", data.project_name]
2145
+ }),
2146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2147
+ className: "ml-auto text-[11px] text-sand-400",
2148
+ children: data.token_name
2149
+ })
2150
+ ]
2151
+ });
2152
+ }
2153
+ function MetricsPanel({ data, toolCallCount }) {
2154
+ const tokensPerSecEnabled = isTokensPerSecEnabled(data);
2155
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2156
+ className: "panel overflow-hidden px-5 py-3 space-y-3",
2157
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2158
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3",
2159
+ children: [
2160
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2161
+ label: "Duration",
2162
+ value: `${(data.duration_ms / 1e3).toFixed(1)}s`
2163
+ }),
2164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2165
+ label: "TTFT",
2166
+ value: formatRunTtftMs(data.ttft_ms)
2167
+ }),
2168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2169
+ label: "Tokens/sec",
2170
+ value: formatTokensPerSec(data.output_tokens, data.duration_ms, data.ttft_ms, tokensPerSecEnabled)
2171
+ }),
2172
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2173
+ label: "Driver Cost",
2174
+ value: data.cost_usd !== null ? formatMicroUsd(data.cost_usd) : "—"
2175
+ }),
2176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2177
+ label: "Cost Source",
2178
+ value: data.cost_source ?? "legacy"
2179
+ }),
2180
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2181
+ label: "Image Cost",
2182
+ value: data.image_cost_usd !== null ? formatMicroUsd(data.image_cost_usd) : "—"
2183
+ }),
2184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2185
+ label: "Tool Calls",
2186
+ value: `${toolCallCount}회`
2187
+ })
2188
+ ]
2189
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2190
+ className: "border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3",
2191
+ children: [
2192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2193
+ label: "Input",
2194
+ value: formatNum(data.input_tokens)
2195
+ }),
2196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2197
+ label: "Output",
2198
+ value: formatNum(data.output_tokens)
2199
+ }),
2200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2201
+ label: "Cache Read",
2202
+ value: formatNum(data.cache_read_tokens)
2203
+ }),
2204
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2205
+ label: "Cache Write",
2206
+ value: formatNum(data.cache_creation_tokens)
2207
+ }),
2208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2209
+ label: "Cache Write (5m)",
2210
+ value: data.cache_creation_5m_tokens === null ? "—" : formatNum(data.cache_creation_5m_tokens)
2211
+ }),
2212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2213
+ label: "Cache Write (1h)",
2214
+ value: data.cache_creation_1h_tokens === null ? "—" : formatNum(data.cache_creation_1h_tokens)
2215
+ }),
2216
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2217
+ label: "Cache Hit",
2218
+ value: cacheHitRate(data)
2219
+ })
2220
+ ]
2221
+ })]
2222
+ });
2223
+ }
2224
+ function formatDurationMs(ms) {
2225
+ if (ms === null || ms === void 0) return "—";
2226
+ return ms >= 1e3 ? `${(ms / 1e3).toFixed(1)}s` : `${ms}ms`;
2227
+ }
2228
+ function formatRunTtftMs(ms) {
2229
+ if (ms === null || ms === void 0 || ms <= 0) return "—";
2230
+ return formatDurationMs(ms);
2231
+ }
2232
+ function detectTokenRateProvider(source) {
2233
+ const modelName = source.model_name?.trim().toLowerCase();
2234
+ if (modelName) {
2235
+ const canonical = modelName.includes("/") ? modelName.split("/").pop() : modelName;
2236
+ if (canonical.startsWith("claude-")) return "anthropic";
2237
+ if (/^(gpt-|codex-|o\d)/.test(canonical)) return "openai";
2238
+ }
2239
+ const tokenName = source.token_name?.trim().toLowerCase();
2240
+ if (tokenName?.startsWith("anthropic/")) return "anthropic";
2241
+ if (tokenName?.startsWith("openai/")) return "openai";
2242
+ return null;
2243
+ }
2244
+ function isTokensPerSecEnabled(source) {
2245
+ const provider = detectTokenRateProvider(source);
2246
+ return provider !== null && TOKENS_PER_SEC_PROVIDERS.has(provider);
2247
+ }
2248
+ function formatTokensPerSec(outputTokens, durationMs, ttftMs, enabled) {
2249
+ if (!enabled || outputTokens === null || outputTokens === void 0 || durationMs === null || durationMs === void 0 || ttftMs === null || ttftMs === void 0 || ttftMs <= 0) return "—";
2250
+ const generationMs = durationMs - ttftMs;
2251
+ if (outputTokens <= 0 || generationMs <= 0) return "—";
2252
+ return `${Math.round(outputTokens / (generationMs / 1e3)).toLocaleString()} tok/s`;
2253
+ }
2254
+ function CompactMetric({ label, value }) {
2255
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2256
+ className: "min-w-0",
2257
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2258
+ className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate",
2259
+ children: label
2260
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2261
+ className: "mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate",
2262
+ children: value
2263
+ })]
2264
+ });
2265
+ }
2266
+ function readToolInputImages(args) {
2267
+ if (!args || typeof args !== "object" || Array.isArray(args)) return [];
2268
+ const inputImages = args.inputImages;
2269
+ return Array.isArray(inputImages) ? inputImages : void 0;
2270
+ }
2271
+ function getToolInputImages(args) {
2272
+ return (readToolInputImages(args) ?? []).filter((item) => {
2273
+ if (!item || typeof item !== "object" || Array.isArray(item)) return false;
2274
+ const image = item;
2275
+ return typeof image.url === "string" && image.url.length > 0 || typeof image.data === "string" && image.data.length > 0;
2276
+ });
2277
+ }
2278
+ function hideToolInputImages(args) {
2279
+ if (!args || typeof args !== "object" || Array.isArray(args)) return args;
2280
+ const record = args;
2281
+ const inputImages = readToolInputImages(record);
2282
+ if (!inputImages) return args;
2283
+ return {
2284
+ ...record,
2285
+ inputImages: inputImages.map((item) => {
2286
+ if (!item || typeof item !== "object" || Array.isArray(item)) return item;
2287
+ const image = item;
2288
+ const maskedUrl = typeof image.url === "string" && image.url.toLowerCase().startsWith("data:") ? `[data-url ${image.url.length} chars]` : image.url;
2289
+ return {
2290
+ mediaType: image.mediaType,
2291
+ byteSize: image.byteSize,
2292
+ ...maskedUrl ? { url: maskedUrl } : {},
2293
+ ...image.data ? { data: `[base64 ${image.data.length} chars]` } : {}
2294
+ };
2295
+ })
2296
+ };
2297
+ }
2298
+ function ToolInputImages({ images }) {
2299
+ const renderableImages = images.map((image, index) => {
2300
+ const urlSrc = image.url && !image.url.startsWith("[") ? image.url : void 0;
2301
+ const dataSrc = image.data ? `data:${image.mediaType ?? "image/png"};base64,${image.data}` : "";
2302
+ const src = urlSrc ?? dataSrc;
2303
+ return src ? {
2304
+ image,
2305
+ index,
2306
+ src
2307
+ } : null;
2308
+ }).filter((item) => item !== null);
2309
+ if (renderableImages.length === 0) return null;
2310
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2311
+ className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2",
2312
+ children: "Input Images"
2313
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2314
+ className: "mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2",
2315
+ children: renderableImages.map(({ image, index, src }) => {
2316
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2317
+ className: "rounded-md border border-sand-200 bg-white overflow-hidden",
2318
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
2319
+ src,
2320
+ alt: `reference ${index + 1}`,
2321
+ className: "max-h-64 w-full object-contain bg-white",
2322
+ loading: "lazy"
2323
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2324
+ className: "px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100",
2325
+ children: [
2326
+ image.mediaType ?? "image",
2327
+ " ·",
2328
+ " ",
2329
+ image.byteSize !== void 0 ? `${image.byteSize.toLocaleString()} bytes` : "url"
2330
+ ]
2331
+ })]
2332
+ }, `${image.mediaType ?? "image"}-${index}`);
2333
+ })
2334
+ })] });
2335
+ }
2336
+ function RequestInputImages({ stepId }) {
2337
+ const { data: detail } = RequestLogStepService.useRequestLogStep("I", stepId ?? 0, { enabled: stepId !== null });
2338
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolInputImages, { images: getToolInputImages(detail ? safeParseJson(detail.tool_args) : null) });
2339
+ }
2340
+ function ToolCallItem({ entry }) {
2341
+ const hasError = !!entry.error;
2342
+ const [opened, setOpened] = (0, import_react.useState)(false);
2343
+ const { data: detail } = RequestLogStepService.useRequestLogStep("A", entry.id, { enabled: opened });
2344
+ const displayArgs = hideToolInputImages(detail ? safeParseJson(detail.tool_args) : null);
2345
+ const result = detail ? safeParseJson(detail.tool_result) : null;
2346
+ const error = detail?.error ?? entry.error;
2347
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2348
+ className: "group/tool",
2349
+ onToggle: (e) => setOpened(e.currentTarget.open),
2350
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2351
+ className: "flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md",
2352
+ children: [
2353
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0" }),
2354
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2355
+ className: "text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0",
2356
+ children: ["call ", entry.callIndex + 1]
2357
+ }),
2358
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2359
+ className: "text-[13px] font-medium text-sand-800 font-mono truncate",
2360
+ children: entry.toolName
2361
+ }),
2362
+ hasError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2363
+ className: "text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0",
2364
+ children: "error"
2365
+ }),
2366
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2367
+ className: "ml-auto text-[11px] text-sand-400 tabular-nums shrink-0",
2368
+ children: formatDurationMs(entry.durationMs)
2369
+ })
2370
+ ]
2371
+ }), opened && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2372
+ className: "mt-1 mx-1 mb-3 space-y-2",
2373
+ children: [
2374
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2375
+ className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2",
2376
+ children: "Request"
2377
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2378
+ className: "mt-1 rounded-md bg-sand-50 p-3 overflow-auto",
2379
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, { text: detail ? JSON.stringify(displayArgs) : "Loading..." })
2380
+ })] }),
2381
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2382
+ className: "text-[10px] uppercase tracking-wider text-red-500 font-medium px-2",
2383
+ children: "Error"
2384
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2385
+ className: "mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto",
2386
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, { text: error })
2387
+ })] }),
2388
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2389
+ className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2",
2390
+ children: "Response"
2391
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2392
+ className: "mt-1 rounded-md bg-sand-50 p-3 overflow-auto",
2393
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2394
+ text: detail ? typeof result === "string" ? result : JSON.stringify(result) : "Loading...",
2395
+ markdown: true
2396
+ })
2397
+ })] })
2398
+ ]
2399
+ })]
2400
+ });
2401
+ }
2402
+ function ReasoningBlock({ stepId }) {
2403
+ const [opened, setOpened] = (0, import_react.useState)(false);
2404
+ const { data: detail } = RequestLogStepService.useRequestLogStep("A", stepId, { enabled: opened });
2405
+ const reasoningText = detail?.reasoning_text ?? null;
2406
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2407
+ className: "group/reason mt-3",
2408
+ onToggle: (e) => setOpened(e.currentTarget.open),
2409
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2410
+ className: "flex items-center gap-2 cursor-pointer select-none list-none",
2411
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2412
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
2413
+ children: "Reasoning"
2414
+ })]
2415
+ }), opened && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2416
+ className: "mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto",
2417
+ children: reasoningText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2418
+ text: reasoningText,
2419
+ markdown: true
2420
+ }) : !detail ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2421
+ className: "text-sm text-sand-400",
2422
+ children: "Loading..."
2423
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2424
+ className: "text-sm text-sand-400",
2425
+ children: "No reasoning text captured."
2426
+ })
2427
+ })]
2428
+ });
2429
+ }
2430
+ function StepTreeItem({ entry, tokensPerSecEnabled }) {
2431
+ const generate = entry.generate;
2432
+ const hasReasoning = generate !== null && generate.reasoningTokens !== null && generate.reasoningTokens !== void 0 && generate.reasoningTokens > 0;
2433
+ const errorCount = entry.toolCalls.filter((toolCall) => toolCall.error).length;
2434
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2435
+ open: true,
2436
+ className: "group/step border-l border-sand-200 pl-3",
2437
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2438
+ className: "flex items-center gap-2 py-2 cursor-pointer select-none list-none",
2439
+ children: [
2440
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0" }),
2441
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2442
+ className: "text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0",
2443
+ children: ["step ", entry.stepIndex + 1]
2444
+ }),
2445
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2446
+ className: "text-[13px] font-semibold text-sand-900",
2447
+ children: "LLM call"
2448
+ }),
2449
+ generate?.finishReason && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2450
+ className: "text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0",
2451
+ children: generate.finishReason
2452
+ }),
2453
+ generate && (generate.fallbackCount ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2454
+ className: "text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0",
2455
+ children: [
2456
+ generate.requestedModelName,
2457
+ " → ",
2458
+ generate.modelName
2459
+ ]
2460
+ }),
2461
+ hasReasoning && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2462
+ className: "text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0",
2463
+ children: "reasoning"
2464
+ }),
2465
+ errorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2466
+ className: "text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0",
2467
+ children: [errorCount, " error"]
2468
+ }),
2469
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2470
+ className: "ml-auto text-[11px] text-sand-400 tabular-nums shrink-0",
2471
+ children: [entry.toolCalls.length, " tools"]
2472
+ })
2473
+ ]
2474
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2475
+ className: "ml-4 mb-4 space-y-3",
2476
+ children: [generate && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2477
+ className: "rounded-md border border-sand-100 bg-sand-50/70 p-3",
2478
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2479
+ className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3",
2480
+ children: [
2481
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2482
+ label: "Duration",
2483
+ value: formatDurationMs(generate.durationMs)
2484
+ }),
2485
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2486
+ label: "TTFT",
2487
+ value: formatRunTtftMs(generate.ttftMs)
2488
+ }),
2489
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2490
+ label: "Tokens/sec",
2491
+ value: formatTokensPerSec(generate.outputTokens, generate.durationMs, generate.ttftMs, tokensPerSecEnabled)
2492
+ }),
2493
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2494
+ label: "Input",
2495
+ value: formatNum(generate.inputTokens ?? 0)
2496
+ }),
2497
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2498
+ label: "Output",
2499
+ value: formatNum(generate.outputTokens ?? 0)
2500
+ }),
2501
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2502
+ label: "Cache Read",
2503
+ value: formatNum(generate.cacheReadTokens ?? 0)
2504
+ }),
2505
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2506
+ label: "Cache Write",
2507
+ value: formatNum(generate.cacheCreationTokens ?? 0)
2508
+ }),
2509
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2510
+ label: "Cache 5m / 1h",
2511
+ value: `${generate.cacheCreation5mTokens === null ? "—" : formatNum(generate.cacheCreation5mTokens)} / ${generate.cacheCreation1hTokens === null ? "—" : formatNum(generate.cacheCreation1hTokens)}`
2512
+ }),
2513
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2514
+ label: "Cost",
2515
+ value: generate.costUsd === null ? "—" : formatMicroUsd(generate.costUsd)
2516
+ }),
2517
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2518
+ label: "Cost Source",
2519
+ value: generate.costSource ?? "legacy"
2520
+ }),
2521
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
2522
+ label: "Reasoning",
2523
+ value: generate.reasoningTokens !== null && generate.reasoningTokens !== void 0 ? formatNum(generate.reasoningTokens) : "—"
2524
+ })
2525
+ ]
2526
+ }), hasReasoning && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReasoningBlock, { stepId: generate.id })]
2527
+ }), entry.toolCalls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2528
+ className: "space-y-0.5",
2529
+ children: entry.toolCalls.map((toolCall) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolCallItem, { entry: toolCall }, `${toolCall.stepIndex}-${toolCall.callIndex}-${toolCall.toolCallId}`))
2530
+ })]
2531
+ })]
2532
+ });
2533
+ }
2534
+ function StepTreeSection({ steps, tokensPerSecEnabled }) {
2535
+ const toolCallCount = steps.reduce((sum, step) => sum + step.toolCalls.length, 0);
2536
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
2537
+ title: `Steps (${steps.length} steps · ${toolCallCount} tool calls)`,
2538
+ defaultOpen: true,
2539
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2540
+ className: "space-y-1",
2541
+ children: steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StepTreeItem, {
2542
+ entry: step,
2543
+ tokensPerSecEnabled
2544
+ }, step.stepIndex))
2545
+ })
2546
+ });
2547
+ }
2548
+ function buildStepTree(steps) {
2549
+ const grouped = /* @__PURE__ */ new Map();
2550
+ function ensureStep(stepIndex) {
2551
+ const existing = grouped.get(stepIndex);
2552
+ if (existing) return existing;
2553
+ const next = {
2554
+ stepIndex,
2555
+ generate: null,
2556
+ toolCalls: []
2557
+ };
2558
+ grouped.set(stepIndex, next);
2559
+ return next;
2560
+ }
2561
+ for (const step of steps) {
2562
+ const group = ensureStep(step.step_index);
2563
+ if (step.type === "generate") {
2564
+ group.generate = {
2565
+ id: step.id,
2566
+ stepIndex: step.step_index,
2567
+ modelName: step.model_name,
2568
+ requestedModelName: step.requested_model_name,
2569
+ fallbackCount: step.fallback_count,
2570
+ inputTokens: step.input_tokens,
2571
+ outputTokens: step.output_tokens,
2572
+ cacheReadTokens: step.cache_read_tokens,
2573
+ cacheCreationTokens: step.cache_creation_tokens,
2574
+ cacheCreation5mTokens: step.cache_creation_5m_tokens,
2575
+ cacheCreation1hTokens: step.cache_creation_1h_tokens,
2576
+ costUsd: step.cost_usd,
2577
+ costSource: step.cost_source,
2578
+ durationMs: step.duration_ms,
2579
+ ttftMs: step.ttft_ms,
2580
+ finishReason: step.finish_reason,
2581
+ reasoningTokens: step.reasoning_tokens
2582
+ };
2583
+ continue;
2584
+ }
2585
+ if (step.type === "tool_call") group.toolCalls.push({
2586
+ id: step.id,
2587
+ stepIndex: step.step_index,
2588
+ callIndex: step.tool_call_index ?? group.toolCalls.length,
2589
+ toolCallId: step.tool_call_id ?? "",
2590
+ toolName: step.tool_name ?? "",
2591
+ durationMs: step.tool_duration_ms ?? 0,
2592
+ error: step.error
2593
+ });
2594
+ }
2595
+ return [...grouped.values()].map((step) => ({
2596
+ ...step,
2597
+ toolCalls: step.toolCalls.toSorted((a, b) => a.callIndex - b.callIndex)
2598
+ })).toSorted((a, b) => a.stepIndex - b.stepIndex);
2599
+ }
2600
+ function historyItemBg(item) {
2601
+ if (item.type === "function_call" || item.type === "function_call_output") return "bg-caution-400/10";
2602
+ if (item.role === "assistant") return "bg-sage-50";
2603
+ return "bg-sand-50";
2604
+ }
2605
+ function historyItemLabel(item) {
2606
+ if (item.type === "function_call") return `fn: ${item.name ?? "unknown"}`;
2607
+ if (item.type === "function_call_output") return `fn result`;
2608
+ return item.role ?? item.type;
2609
+ }
2610
+ function extractText(content) {
2611
+ if (typeof content === "string") return content;
2612
+ if (Array.isArray(content)) return content.map((c) => {
2613
+ if (typeof c === "object" && c !== null && "text" in c) return c.text;
2614
+ return JSON.stringify(c);
2615
+ }).join("\n");
2616
+ return JSON.stringify(content);
2617
+ }
2618
+ function MonoPre({ className, children }) {
2619
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2620
+ className: `text-[12px] text-sand-700 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-40 overflow-auto ${className ?? ""}`,
2621
+ children
2622
+ });
2623
+ }
2624
+ function HistorySection({ history }) {
2625
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
2626
+ title: "History",
2627
+ defaultOpen: false,
2628
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2629
+ className: "space-y-1.5",
2630
+ children: history.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2631
+ className: `rounded-md px-3 py-2 ${historyItemBg(item)}`,
2632
+ children: [
2633
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2634
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1",
2635
+ children: historyItemLabel(item)
2636
+ }),
2637
+ item.content !== null && item.content !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, { children: extractText(item.content) }),
2638
+ item.arguments && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, { children: item.arguments }),
2639
+ item.output && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, { children: item.output })
2640
+ ]
2641
+ }, `hist-${i}`))
2642
+ })
2643
+ });
2644
+ }
2645
+ function ToolsSection({ tools }) {
2646
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
2647
+ title: `Tools (${tools.length})`,
2648
+ defaultOpen: false,
2649
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2650
+ className: "space-y-1.5",
2651
+ children: tools.map((tool, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2652
+ className: "rounded-md px-3 py-2 bg-caution-400/10",
2653
+ children: [
2654
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2655
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1",
2656
+ children: ["fn: ", tool.name]
2657
+ }),
2658
+ tool.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2659
+ className: "text-[12px] text-sand-700 leading-relaxed",
2660
+ children: tool.description
2661
+ }),
2662
+ tool.inputSchema !== void 0 && tool.inputSchema !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, {
2663
+ className: "mt-1",
2664
+ children: JSON.stringify(tool.inputSchema, null, 2)
2665
+ })
2666
+ ]
2667
+ }, `tool-${i}`))
2668
+ })
2669
+ });
2670
+ }
2671
+ function RequestDetail({ id }) {
2672
+ const { data, isLoading } = RequestLogService.useRequestLog("A", id);
2673
+ const { data: stepsData } = RequestLogStepService.useRequestLogSteps("T", {
2674
+ request_log_id: id,
2675
+ num: 0,
2676
+ page: 1,
2677
+ orderBy: "id-asc"
2678
+ });
2679
+ const stepTree = buildStepTree(stepsData?.rows ?? []);
2680
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2681
+ className: "max-w-6xl mx-auto space-y-4",
2682
+ children: [
2683
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-32 bg-sand-200 rounded animate-pulse" }),
2684
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-40 panel animate-pulse" }),
2685
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-32 panel animate-pulse" })
2686
+ ]
2687
+ });
2688
+ if (!data) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2689
+ className: "max-w-6xl mx-auto",
2690
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
2691
+ to: "/logs",
2692
+ className: "flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4",
2693
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideArrowLeft, { className: "size-3.5" }), "Back to Logs"]
2694
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2695
+ className: "text-sand-400 text-sm",
2696
+ children: "Request not found."
2697
+ })]
2698
+ });
2699
+ const toolCalls = stepTree.flatMap((step) => step.toolCalls);
2700
+ const firstImageGenerationStepId = toolCalls.find((toolCall) => toolCall.toolName === "image_generation")?.id ?? null;
2701
+ const hasSteps = stepTree.length > 0;
2702
+ const tokensPerSecEnabled = isTokensPerSecEnabled(data);
2703
+ const history = data.history ?? null;
2704
+ const hasHistory = history !== null && history.length > 0;
2705
+ const tools = data.tools ?? null;
2706
+ const hasTools = tools !== null && tools.length > 0;
2707
+ const promptSections = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2708
+ className: "space-y-4",
2709
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
2710
+ title: "System",
2711
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2712
+ className: "relative",
2713
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.system_prompt ?? "null" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2714
+ text: data.system_prompt ?? "null",
2715
+ markdown: true
2716
+ })]
2717
+ })
2718
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
2719
+ title: "User",
2720
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2721
+ className: "space-y-3",
2722
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2723
+ className: "relative",
2724
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.user_prompt ?? "null" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2725
+ text: data.user_prompt ?? "null",
2726
+ markdown: true
2727
+ })]
2728
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RequestInputImages, { stepId: firstImageGenerationStepId })]
2729
+ })
2730
+ })]
2731
+ });
2732
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2733
+ className: `mx-auto space-y-4 ${hasSteps ? "max-w-[120rem]" : "max-w-6xl"}`,
2734
+ children: [
2735
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
2736
+ to: "/logs",
2737
+ className: "inline-flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 transition-colors",
2738
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideArrowLeft, { className: "size-3.5" }), "Back to Logs"]
2739
+ }),
2740
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeaderBar, { data }),
2741
+ data.error_message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorPanel, { message: data.error_message }),
2742
+ hasHistory && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HistorySection, { history }),
2743
+ hasTools && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolsSection, { tools }),
2744
+ hasSteps ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2745
+ className: "flex flex-col lg:flex-row gap-4 items-stretch lg:items-start",
2746
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2747
+ className: "order-1 lg:order-2 flex-1 min-w-0 space-y-4",
2748
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StepTreeSection, {
2749
+ steps: stepTree,
2750
+ tokensPerSecEnabled
2751
+ })
2752
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2753
+ className: "order-2 lg:order-1 flex-1 min-w-0",
2754
+ children: promptSections
2755
+ })]
2756
+ }) : promptSections,
2757
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
2758
+ title: "Response",
2759
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2760
+ className: "relative",
2761
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.response }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2762
+ text: data.response,
2763
+ markdown: true
2764
+ })]
2765
+ })
2766
+ }),
2767
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MetricsPanel, {
2768
+ data,
2769
+ toolCallCount: toolCalls.length
2770
+ }),
2771
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pb-8" })
2772
+ ]
2773
+ });
2774
+ }
2775
+ //#endregion
2776
+ export { RequestShowPage as component };