@tanstack/router-devtools-core 1.132.47 → 1.132.51

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 (79) hide show
  1. package/dist/BaseTanStackRouterDevtoolsPanel-CaAQWNvS.js +1817 -0
  2. package/dist/BaseTanStackRouterDevtoolsPanel-CaAQWNvS.js.map +1 -0
  3. package/dist/BaseTanStackRouterDevtoolsPanel-CbH9Ihs_.cjs +1833 -0
  4. package/dist/BaseTanStackRouterDevtoolsPanel-CbH9Ihs_.cjs.map +1 -0
  5. package/dist/FloatingTanStackRouterDevtools-0xtXUOcx.cjs +283 -0
  6. package/dist/FloatingTanStackRouterDevtools-0xtXUOcx.cjs.map +1 -0
  7. package/dist/FloatingTanStackRouterDevtools-DdHNTjWg.js +283 -0
  8. package/dist/FloatingTanStackRouterDevtools-DdHNTjWg.js.map +1 -0
  9. package/dist/cjs/index.cjs +6 -0
  10. package/dist/cjs/{packages/router-devtools-core/src/index.cjs.map → index.cjs.map} +1 -1
  11. package/dist/esm/index.js +6 -0
  12. package/dist/esm/{packages/router-devtools-core/src/index.js.map → index.js.map} +1 -1
  13. package/dist/index-BiZF0hsR.js +222 -0
  14. package/dist/index-BiZF0hsR.js.map +1 -0
  15. package/dist/index-CHaaetqh.cjs +221 -0
  16. package/dist/index-CHaaetqh.cjs.map +1 -0
  17. package/package.json +6 -5
  18. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.cjs +0 -792
  19. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.cjs.map +0 -1
  20. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.cjs +0 -675
  21. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.cjs.map +0 -1
  22. package/dist/cjs/packages/router-devtools-core/src/AgeTicker.cjs +0 -48
  23. package/dist/cjs/packages/router-devtools-core/src/AgeTicker.cjs.map +0 -1
  24. package/dist/cjs/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.cjs +0 -604
  25. package/dist/cjs/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.cjs.map +0 -1
  26. package/dist/cjs/packages/router-devtools-core/src/Explorer.cjs +0 -307
  27. package/dist/cjs/packages/router-devtools-core/src/Explorer.cjs.map +0 -1
  28. package/dist/cjs/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.cjs +0 -201
  29. package/dist/cjs/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.cjs.map +0 -1
  30. package/dist/cjs/packages/router-devtools-core/src/NavigateButton.cjs +0 -31
  31. package/dist/cjs/packages/router-devtools-core/src/NavigateButton.cjs.map +0 -1
  32. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.cjs +0 -100
  33. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.cjs.map +0 -1
  34. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.cjs +0 -113
  35. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.cjs.map +0 -1
  36. package/dist/cjs/packages/router-devtools-core/src/context.cjs +0 -20
  37. package/dist/cjs/packages/router-devtools-core/src/context.cjs.map +0 -1
  38. package/dist/cjs/packages/router-devtools-core/src/index.cjs +0 -7
  39. package/dist/cjs/packages/router-devtools-core/src/logo.cjs +0 -92
  40. package/dist/cjs/packages/router-devtools-core/src/logo.cjs.map +0 -1
  41. package/dist/cjs/packages/router-devtools-core/src/tokens.cjs +0 -201
  42. package/dist/cjs/packages/router-devtools-core/src/tokens.cjs.map +0 -1
  43. package/dist/cjs/packages/router-devtools-core/src/useLocalStorage.cjs +0 -42
  44. package/dist/cjs/packages/router-devtools-core/src/useLocalStorage.cjs.map +0 -1
  45. package/dist/cjs/packages/router-devtools-core/src/useStyles.cjs +0 -607
  46. package/dist/cjs/packages/router-devtools-core/src/useStyles.cjs.map +0 -1
  47. package/dist/cjs/packages/router-devtools-core/src/utils.cjs +0 -62
  48. package/dist/cjs/packages/router-devtools-core/src/utils.cjs.map +0 -1
  49. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js +0 -792
  50. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js.map +0 -1
  51. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js +0 -676
  52. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js.map +0 -1
  53. package/dist/esm/packages/router-devtools-core/src/AgeTicker.js +0 -48
  54. package/dist/esm/packages/router-devtools-core/src/AgeTicker.js.map +0 -1
  55. package/dist/esm/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.js +0 -604
  56. package/dist/esm/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.js.map +0 -1
  57. package/dist/esm/packages/router-devtools-core/src/Explorer.js +0 -290
  58. package/dist/esm/packages/router-devtools-core/src/Explorer.js.map +0 -1
  59. package/dist/esm/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.js +0 -201
  60. package/dist/esm/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.js.map +0 -1
  61. package/dist/esm/packages/router-devtools-core/src/NavigateButton.js +0 -31
  62. package/dist/esm/packages/router-devtools-core/src/NavigateButton.js.map +0 -1
  63. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.js +0 -100
  64. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.js.map +0 -1
  65. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.js +0 -113
  66. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.js.map +0 -1
  67. package/dist/esm/packages/router-devtools-core/src/context.js +0 -20
  68. package/dist/esm/packages/router-devtools-core/src/context.js.map +0 -1
  69. package/dist/esm/packages/router-devtools-core/src/index.js +0 -7
  70. package/dist/esm/packages/router-devtools-core/src/logo.js +0 -92
  71. package/dist/esm/packages/router-devtools-core/src/logo.js.map +0 -1
  72. package/dist/esm/packages/router-devtools-core/src/tokens.js +0 -201
  73. package/dist/esm/packages/router-devtools-core/src/tokens.js.map +0 -1
  74. package/dist/esm/packages/router-devtools-core/src/useLocalStorage.js +0 -43
  75. package/dist/esm/packages/router-devtools-core/src/useLocalStorage.js.map +0 -1
  76. package/dist/esm/packages/router-devtools-core/src/useStyles.js +0 -590
  77. package/dist/esm/packages/router-devtools-core/src/useStyles.js.map +0 -1
  78. package/dist/esm/packages/router-devtools-core/src/utils.js +0 -62
  79. package/dist/esm/packages/router-devtools-core/src/utils.js.map +0 -1
@@ -0,0 +1,1817 @@
1
+ import { template, insert, memo, createComponent, effect, className, setAttribute, mergeProps, delegateEvents, spread, addEventListener } from "solid-js/web";
2
+ import { clsx } from "clsx";
3
+ import invariant from "tiny-invariant";
4
+ import { rootRouteId, trimPath, interpolatePath } from "@tanstack/router-core";
5
+ import { createSignal, createEffect, createRenderEffect, useContext, createMemo, Show, onCleanup } from "solid-js";
6
+ import { S as ShadowDomTargetContext, u as useDevtoolsOnClose } from "./index-BiZF0hsR.js";
7
+ import * as goober from "goober";
8
+ const isServer = typeof window === "undefined";
9
+ function getStatusColor(match) {
10
+ const colorMap = {
11
+ pending: "yellow",
12
+ success: "green",
13
+ error: "red",
14
+ notFound: "purple",
15
+ redirected: "gray"
16
+ };
17
+ return match.isFetching && match.status === "success" ? match.isFetching === "beforeLoad" ? "purple" : "blue" : colorMap[match.status];
18
+ }
19
+ function getRouteStatusColor(matches, route) {
20
+ const found = matches.find((d) => d.routeId === route.id);
21
+ if (!found) return "gray";
22
+ return getStatusColor(found);
23
+ }
24
+ function useIsMounted() {
25
+ const [isMounted, setIsMounted] = createSignal(false);
26
+ const effect2 = isServer ? createEffect : createRenderEffect;
27
+ effect2(() => {
28
+ setIsMounted(true);
29
+ });
30
+ return isMounted;
31
+ }
32
+ const displayValue = (value) => {
33
+ const name = Object.getOwnPropertyNames(Object(value));
34
+ const newValue = typeof value === "bigint" ? `${value.toString()}n` : value;
35
+ try {
36
+ return JSON.stringify(newValue, name);
37
+ } catch (e) {
38
+ return `unable to stringify`;
39
+ }
40
+ };
41
+ function multiSortBy(arr, accessors = [(d) => d]) {
42
+ return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
43
+ for (const accessor of accessors) {
44
+ const ao = accessor(a);
45
+ const bo = accessor(b);
46
+ if (typeof ao === "undefined") {
47
+ if (typeof bo === "undefined") {
48
+ continue;
49
+ }
50
+ return 1;
51
+ }
52
+ if (ao === bo) {
53
+ continue;
54
+ }
55
+ return ao > bo ? 1 : -1;
56
+ }
57
+ return ai - bi;
58
+ }).map(([d]) => d);
59
+ }
60
+ const tokens = {
61
+ colors: {
62
+ inherit: "inherit",
63
+ current: "currentColor",
64
+ transparent: "transparent",
65
+ black: "#000000",
66
+ white: "#ffffff",
67
+ neutral: {
68
+ 50: "#f9fafb",
69
+ 100: "#f2f4f7",
70
+ 200: "#eaecf0",
71
+ 300: "#d0d5dd",
72
+ 400: "#98a2b3",
73
+ 500: "#667085",
74
+ 600: "#475467",
75
+ 700: "#344054",
76
+ 800: "#1d2939",
77
+ 900: "#101828"
78
+ },
79
+ darkGray: {
80
+ 50: "#525c7a",
81
+ 100: "#49536e",
82
+ 200: "#414962",
83
+ 300: "#394056",
84
+ 400: "#313749",
85
+ 500: "#292e3d",
86
+ 600: "#212530",
87
+ 700: "#191c24",
88
+ 800: "#111318",
89
+ 900: "#0b0d10"
90
+ },
91
+ gray: {
92
+ 50: "#f9fafb",
93
+ 100: "#f2f4f7",
94
+ 200: "#eaecf0",
95
+ 300: "#d0d5dd",
96
+ 400: "#98a2b3",
97
+ 500: "#667085",
98
+ 600: "#475467",
99
+ 700: "#344054",
100
+ 800: "#1d2939",
101
+ 900: "#101828"
102
+ },
103
+ blue: {
104
+ 25: "#F5FAFF",
105
+ 50: "#EFF8FF",
106
+ 100: "#D1E9FF",
107
+ 200: "#B2DDFF",
108
+ 300: "#84CAFF",
109
+ 400: "#53B1FD",
110
+ 500: "#2E90FA",
111
+ 600: "#1570EF",
112
+ 700: "#175CD3",
113
+ 800: "#1849A9",
114
+ 900: "#194185"
115
+ },
116
+ green: {
117
+ 25: "#F6FEF9",
118
+ 50: "#ECFDF3",
119
+ 100: "#D1FADF",
120
+ 200: "#A6F4C5",
121
+ 300: "#6CE9A6",
122
+ 400: "#32D583",
123
+ 500: "#12B76A",
124
+ 600: "#039855",
125
+ 700: "#027A48",
126
+ 800: "#05603A",
127
+ 900: "#054F31"
128
+ },
129
+ red: {
130
+ 50: "#fef2f2",
131
+ 100: "#fee2e2",
132
+ 200: "#fecaca",
133
+ 300: "#fca5a5",
134
+ 400: "#f87171",
135
+ 500: "#ef4444",
136
+ 600: "#dc2626",
137
+ 700: "#b91c1c",
138
+ 800: "#991b1b",
139
+ 900: "#7f1d1d",
140
+ 950: "#450a0a"
141
+ },
142
+ yellow: {
143
+ 25: "#FFFCF5",
144
+ 50: "#FFFAEB",
145
+ 100: "#FEF0C7",
146
+ 200: "#FEDF89",
147
+ 300: "#FEC84B",
148
+ 400: "#FDB022",
149
+ 500: "#F79009",
150
+ 600: "#DC6803",
151
+ 700: "#B54708",
152
+ 800: "#93370D",
153
+ 900: "#7A2E0E"
154
+ },
155
+ purple: {
156
+ 25: "#FAFAFF",
157
+ 50: "#F4F3FF",
158
+ 100: "#EBE9FE",
159
+ 200: "#D9D6FE",
160
+ 300: "#BDB4FE",
161
+ 400: "#9B8AFB",
162
+ 500: "#7A5AF8",
163
+ 600: "#6938EF",
164
+ 700: "#5925DC",
165
+ 800: "#4A1FB8",
166
+ 900: "#3E1C96"
167
+ },
168
+ teal: {
169
+ 25: "#F6FEFC",
170
+ 50: "#F0FDF9",
171
+ 100: "#CCFBEF",
172
+ 200: "#99F6E0",
173
+ 300: "#5FE9D0",
174
+ 400: "#2ED3B7",
175
+ 500: "#15B79E",
176
+ 600: "#0E9384",
177
+ 700: "#107569",
178
+ 800: "#125D56",
179
+ 900: "#134E48"
180
+ },
181
+ pink: {
182
+ 25: "#fdf2f8",
183
+ 50: "#fce7f3",
184
+ 100: "#fbcfe8",
185
+ 200: "#f9a8d4",
186
+ 300: "#f472b6",
187
+ 400: "#ec4899",
188
+ 500: "#db2777",
189
+ 600: "#be185d",
190
+ 700: "#9d174d",
191
+ 800: "#831843",
192
+ 900: "#500724"
193
+ },
194
+ cyan: {
195
+ 25: "#ecfeff",
196
+ 50: "#cffafe",
197
+ 100: "#a5f3fc",
198
+ 200: "#67e8f9",
199
+ 300: "#22d3ee",
200
+ 400: "#06b6d4",
201
+ 500: "#0891b2",
202
+ 600: "#0e7490",
203
+ 700: "#155e75",
204
+ 800: "#164e63",
205
+ 900: "#083344"
206
+ }
207
+ },
208
+ alpha: {
209
+ 90: "e5",
210
+ 70: "b3",
211
+ 20: "33"
212
+ },
213
+ font: {
214
+ size: {
215
+ "2xs": "calc(var(--tsrd-font-size) * 0.625)",
216
+ xs: "calc(var(--tsrd-font-size) * 0.75)",
217
+ sm: "calc(var(--tsrd-font-size) * 0.875)",
218
+ md: "var(--tsrd-font-size)"
219
+ },
220
+ lineHeight: {
221
+ xs: "calc(var(--tsrd-font-size) * 1)",
222
+ sm: "calc(var(--tsrd-font-size) * 1.25)"
223
+ },
224
+ weight: {
225
+ normal: "400",
226
+ medium: "500",
227
+ semibold: "600",
228
+ bold: "700"
229
+ },
230
+ fontFamily: {
231
+ sans: "ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",
232
+ mono: `ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace`
233
+ }
234
+ },
235
+ border: {
236
+ radius: {
237
+ xs: "calc(var(--tsrd-font-size) * 0.125)",
238
+ sm: "calc(var(--tsrd-font-size) * 0.25)",
239
+ md: "calc(var(--tsrd-font-size) * 0.375)",
240
+ full: "9999px"
241
+ }
242
+ },
243
+ size: {
244
+ 0: "0px",
245
+ 0.5: "calc(var(--tsrd-font-size) * 0.125)",
246
+ 1: "calc(var(--tsrd-font-size) * 0.25)",
247
+ 1.5: "calc(var(--tsrd-font-size) * 0.375)",
248
+ 2: "calc(var(--tsrd-font-size) * 0.5)",
249
+ 2.5: "calc(var(--tsrd-font-size) * 0.625)",
250
+ 3: "calc(var(--tsrd-font-size) * 0.75)",
251
+ 3.5: "calc(var(--tsrd-font-size) * 0.875)",
252
+ 4: "calc(var(--tsrd-font-size) * 1)",
253
+ 5: "calc(var(--tsrd-font-size) * 1.25)",
254
+ 8: "calc(var(--tsrd-font-size) * 2)"
255
+ }
256
+ };
257
+ const stylesFactory$1 = (shadowDOMTarget) => {
258
+ const {
259
+ colors,
260
+ font,
261
+ size,
262
+ alpha,
263
+ border
264
+ } = tokens;
265
+ const {
266
+ fontFamily,
267
+ lineHeight,
268
+ size: fontSize
269
+ } = font;
270
+ const css = shadowDOMTarget ? goober.css.bind({
271
+ target: shadowDOMTarget
272
+ }) : goober.css;
273
+ return {
274
+ devtoolsPanelContainer: css`
275
+ direction: ltr;
276
+ position: fixed;
277
+ bottom: 0;
278
+ right: 0;
279
+ z-index: 99999;
280
+ width: 100%;
281
+ max-height: 90%;
282
+ border-top: 1px solid ${colors.gray[700]};
283
+ transform-origin: top;
284
+ `,
285
+ devtoolsPanelContainerVisibility: (isOpen) => {
286
+ return css`
287
+ visibility: ${isOpen ? "visible" : "hidden"};
288
+ `;
289
+ },
290
+ devtoolsPanelContainerResizing: (isResizing) => {
291
+ if (isResizing()) {
292
+ return css`
293
+ transition: none;
294
+ `;
295
+ }
296
+ return css`
297
+ transition: all 0.4s ease;
298
+ `;
299
+ },
300
+ devtoolsPanelContainerAnimation: (isOpen, height) => {
301
+ if (isOpen) {
302
+ return css`
303
+ pointer-events: auto;
304
+ transform: translateY(0);
305
+ `;
306
+ }
307
+ return css`
308
+ pointer-events: none;
309
+ transform: translateY(${height}px);
310
+ `;
311
+ },
312
+ logo: css`
313
+ cursor: pointer;
314
+ display: flex;
315
+ flex-direction: column;
316
+ background-color: transparent;
317
+ border: none;
318
+ font-family: ${fontFamily.sans};
319
+ gap: ${tokens.size[0.5]};
320
+ padding: 0px;
321
+ &:hover {
322
+ opacity: 0.7;
323
+ }
324
+ &:focus-visible {
325
+ outline-offset: 4px;
326
+ border-radius: ${border.radius.xs};
327
+ outline: 2px solid ${colors.blue[800]};
328
+ }
329
+ `,
330
+ tanstackLogo: css`
331
+ font-size: ${font.size.md};
332
+ font-weight: ${font.weight.bold};
333
+ line-height: ${font.lineHeight.xs};
334
+ white-space: nowrap;
335
+ color: ${colors.gray[300]};
336
+ `,
337
+ routerLogo: css`
338
+ font-weight: ${font.weight.semibold};
339
+ font-size: ${font.size.xs};
340
+ background: linear-gradient(to right, #84cc16, #10b981);
341
+ background-clip: text;
342
+ -webkit-background-clip: text;
343
+ line-height: 1;
344
+ -webkit-text-fill-color: transparent;
345
+ white-space: nowrap;
346
+ `,
347
+ devtoolsPanel: css`
348
+ display: flex;
349
+ font-size: ${fontSize.sm};
350
+ font-family: ${fontFamily.sans};
351
+ background-color: ${colors.darkGray[700]};
352
+ color: ${colors.gray[300]};
353
+
354
+ @media (max-width: 700px) {
355
+ flex-direction: column;
356
+ }
357
+ @media (max-width: 600px) {
358
+ font-size: ${fontSize.xs};
359
+ }
360
+ `,
361
+ dragHandle: css`
362
+ position: absolute;
363
+ left: 0;
364
+ top: 0;
365
+ width: 100%;
366
+ height: 4px;
367
+ cursor: row-resize;
368
+ z-index: 100000;
369
+ &:hover {
370
+ background-color: ${colors.purple[400]}${alpha[90]};
371
+ }
372
+ `,
373
+ firstContainer: css`
374
+ flex: 1 1 500px;
375
+ min-height: 40%;
376
+ max-height: 100%;
377
+ overflow: auto;
378
+ border-right: 1px solid ${colors.gray[700]};
379
+ display: flex;
380
+ flex-direction: column;
381
+ `,
382
+ routerExplorerContainer: css`
383
+ overflow-y: auto;
384
+ flex: 1;
385
+ `,
386
+ routerExplorer: css`
387
+ padding: ${tokens.size[2]};
388
+ `,
389
+ row: css`
390
+ display: flex;
391
+ align-items: center;
392
+ padding: ${tokens.size[2]} ${tokens.size[2.5]};
393
+ gap: ${tokens.size[2.5]};
394
+ border-bottom: ${colors.darkGray[500]} 1px solid;
395
+ align-items: center;
396
+ `,
397
+ detailsHeader: css`
398
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
399
+ position: sticky;
400
+ top: 0;
401
+ z-index: 2;
402
+ background-color: ${colors.darkGray[600]};
403
+ padding: 0px ${tokens.size[2]};
404
+ font-weight: ${font.weight.medium};
405
+ font-size: ${font.size.xs};
406
+ min-height: ${tokens.size[8]};
407
+ line-height: ${font.lineHeight.xs};
408
+ text-align: left;
409
+ display: flex;
410
+ align-items: center;
411
+ `,
412
+ maskedBadge: css`
413
+ background: ${colors.yellow[900]}${alpha[70]};
414
+ color: ${colors.yellow[300]};
415
+ display: inline-block;
416
+ padding: ${tokens.size[0]} ${tokens.size[2.5]};
417
+ border-radius: ${border.radius.full};
418
+ font-size: ${font.size.xs};
419
+ font-weight: ${font.weight.normal};
420
+ border: 1px solid ${colors.yellow[300]};
421
+ `,
422
+ maskedLocation: css`
423
+ color: ${colors.yellow[300]};
424
+ `,
425
+ detailsContent: css`
426
+ padding: ${tokens.size[1.5]} ${tokens.size[2]};
427
+ display: flex;
428
+ align-items: center;
429
+ justify-content: space-between;
430
+ font-size: ${font.size.xs};
431
+ `,
432
+ routeMatchesToggle: css`
433
+ display: flex;
434
+ align-items: center;
435
+ border: 1px solid ${colors.gray[500]};
436
+ border-radius: ${border.radius.sm};
437
+ overflow: hidden;
438
+ `,
439
+ routeMatchesToggleBtn: (active, showBorder) => {
440
+ const base = css`
441
+ appearance: none;
442
+ border: none;
443
+ font-size: 12px;
444
+ padding: 4px 8px;
445
+ background: transparent;
446
+ cursor: pointer;
447
+ font-family: ${fontFamily.sans};
448
+ font-weight: ${font.weight.medium};
449
+ `;
450
+ const classes = [base];
451
+ if (active) {
452
+ const activeStyles = css`
453
+ background: ${colors.darkGray[400]};
454
+ color: ${colors.gray[300]};
455
+ `;
456
+ classes.push(activeStyles);
457
+ } else {
458
+ const inactiveStyles = css`
459
+ color: ${colors.gray[500]};
460
+ background: ${colors.darkGray[800]}${alpha[20]};
461
+ `;
462
+ classes.push(inactiveStyles);
463
+ }
464
+ if (showBorder) {
465
+ classes.push(css`
466
+ border-right: 1px solid ${tokens.colors.gray[500]};
467
+ `);
468
+ }
469
+ return classes;
470
+ },
471
+ detailsHeaderInfo: css`
472
+ flex: 1;
473
+ justify-content: flex-end;
474
+ display: flex;
475
+ align-items: center;
476
+ font-weight: ${font.weight.normal};
477
+ color: ${colors.gray[400]};
478
+ `,
479
+ matchRow: (active) => {
480
+ const base = css`
481
+ display: flex;
482
+ border-bottom: 1px solid ${colors.darkGray[400]};
483
+ cursor: pointer;
484
+ align-items: center;
485
+ padding: ${size[1]} ${size[2]};
486
+ gap: ${size[2]};
487
+ font-size: ${fontSize.xs};
488
+ color: ${colors.gray[300]};
489
+ `;
490
+ const classes = [base];
491
+ if (active) {
492
+ const activeStyles = css`
493
+ background: ${colors.darkGray[500]};
494
+ `;
495
+ classes.push(activeStyles);
496
+ }
497
+ return classes;
498
+ },
499
+ matchIndicator: (color) => {
500
+ const base = css`
501
+ flex: 0 0 auto;
502
+ width: ${size[3]};
503
+ height: ${size[3]};
504
+ background: ${colors[color][900]};
505
+ border: 1px solid ${colors[color][500]};
506
+ border-radius: ${border.radius.full};
507
+ transition: all 0.25s ease-out;
508
+ box-sizing: border-box;
509
+ `;
510
+ const classes = [base];
511
+ if (color === "gray") {
512
+ const grayStyles = css`
513
+ background: ${colors.gray[700]};
514
+ border-color: ${colors.gray[400]};
515
+ `;
516
+ classes.push(grayStyles);
517
+ }
518
+ return classes;
519
+ },
520
+ matchID: css`
521
+ flex: 1;
522
+ line-height: ${lineHeight["xs"]};
523
+ `,
524
+ ageTicker: (showWarning) => {
525
+ const base = css`
526
+ display: flex;
527
+ gap: ${size[1]};
528
+ font-size: ${fontSize.xs};
529
+ color: ${colors.gray[400]};
530
+ font-variant-numeric: tabular-nums;
531
+ line-height: ${lineHeight["xs"]};
532
+ `;
533
+ const classes = [base];
534
+ if (showWarning) {
535
+ const warningStyles = css`
536
+ color: ${colors.yellow[400]};
537
+ `;
538
+ classes.push(warningStyles);
539
+ }
540
+ return classes;
541
+ },
542
+ secondContainer: css`
543
+ flex: 1 1 500px;
544
+ min-height: 40%;
545
+ max-height: 100%;
546
+ overflow: auto;
547
+ border-right: 1px solid ${colors.gray[700]};
548
+ display: flex;
549
+ flex-direction: column;
550
+ `,
551
+ thirdContainer: css`
552
+ flex: 1 1 500px;
553
+ overflow: auto;
554
+ display: flex;
555
+ flex-direction: column;
556
+ height: 100%;
557
+ border-right: 1px solid ${colors.gray[700]};
558
+
559
+ @media (max-width: 700px) {
560
+ border-top: 2px solid ${colors.gray[700]};
561
+ }
562
+ `,
563
+ fourthContainer: css`
564
+ flex: 1 1 500px;
565
+ min-height: 40%;
566
+ max-height: 100%;
567
+ overflow: auto;
568
+ display: flex;
569
+ flex-direction: column;
570
+ `,
571
+ routesContainer: css`
572
+ overflow-x: auto;
573
+ overflow-y: visible;
574
+ `,
575
+ routesRowContainer: (active, isMatch) => {
576
+ const base = css`
577
+ display: flex;
578
+ border-bottom: 1px solid ${colors.darkGray[400]};
579
+ align-items: center;
580
+ padding: ${size[1]} ${size[2]};
581
+ gap: ${size[2]};
582
+ font-size: ${fontSize.xs};
583
+ color: ${colors.gray[300]};
584
+ cursor: ${isMatch ? "pointer" : "default"};
585
+ line-height: ${lineHeight["xs"]};
586
+ `;
587
+ const classes = [base];
588
+ if (active) {
589
+ const activeStyles = css`
590
+ background: ${colors.darkGray[500]};
591
+ `;
592
+ classes.push(activeStyles);
593
+ }
594
+ return classes;
595
+ },
596
+ routesRow: (isMatch) => {
597
+ const base = css`
598
+ flex: 1 0 auto;
599
+ display: flex;
600
+ justify-content: space-between;
601
+ align-items: center;
602
+ font-size: ${fontSize.xs};
603
+ line-height: ${lineHeight["xs"]};
604
+ `;
605
+ const classes = [base];
606
+ if (!isMatch) {
607
+ const matchStyles = css`
608
+ color: ${colors.gray[400]};
609
+ `;
610
+ classes.push(matchStyles);
611
+ }
612
+ return classes;
613
+ },
614
+ routesRowInner: css`
615
+ display: 'flex';
616
+ align-items: 'center';
617
+ flex-grow: 1;
618
+ min-width: 0;
619
+ `,
620
+ routeParamInfo: css`
621
+ color: ${colors.gray[400]};
622
+ font-size: ${fontSize.xs};
623
+ line-height: ${lineHeight["xs"]};
624
+ `,
625
+ nestedRouteRow: (isRoot) => {
626
+ const base = css`
627
+ margin-left: ${isRoot ? 0 : size[3.5]};
628
+ border-left: ${isRoot ? "" : `solid 1px ${colors.gray[700]}`};
629
+ `;
630
+ return base;
631
+ },
632
+ code: css`
633
+ font-size: ${fontSize.xs};
634
+ line-height: ${lineHeight["xs"]};
635
+ white-space: nowrap;
636
+ overflow: hidden;
637
+ text-overflow: ellipsis;
638
+ `,
639
+ matchesContainer: css`
640
+ flex: 1 1 auto;
641
+ overflow-y: auto;
642
+ `,
643
+ cachedMatchesContainer: css`
644
+ flex: 1 1 auto;
645
+ overflow-y: auto;
646
+ max-height: 50%;
647
+ `,
648
+ maskedBadgeContainer: css`
649
+ flex: 1;
650
+ justify-content: flex-end;
651
+ display: flex;
652
+ `,
653
+ matchDetails: css`
654
+ display: flex;
655
+ flex-direction: column;
656
+ padding: ${tokens.size[2]};
657
+ font-size: ${tokens.font.size.xs};
658
+ color: ${tokens.colors.gray[300]};
659
+ line-height: ${tokens.font.lineHeight.sm};
660
+ `,
661
+ matchStatus: (status, isFetching) => {
662
+ const colorMap = {
663
+ pending: "yellow",
664
+ success: "green",
665
+ error: "red",
666
+ notFound: "purple",
667
+ redirected: "gray"
668
+ };
669
+ const color = isFetching && status === "success" ? isFetching === "beforeLoad" ? "purple" : "blue" : colorMap[status];
670
+ return css`
671
+ display: flex;
672
+ justify-content: center;
673
+ align-items: center;
674
+ height: 40px;
675
+ border-radius: ${tokens.border.radius.sm};
676
+ font-weight: ${tokens.font.weight.normal};
677
+ background-color: ${tokens.colors[color][900]}${tokens.alpha[90]};
678
+ color: ${tokens.colors[color][300]};
679
+ border: 1px solid ${tokens.colors[color][600]};
680
+ margin-bottom: ${tokens.size[2]};
681
+ transition: all 0.25s ease-out;
682
+ `;
683
+ },
684
+ matchDetailsInfo: css`
685
+ display: flex;
686
+ justify-content: flex-end;
687
+ flex: 1;
688
+ `,
689
+ matchDetailsInfoLabel: css`
690
+ display: flex;
691
+ `,
692
+ mainCloseBtn: css`
693
+ background: ${colors.darkGray[700]};
694
+ padding: ${size[1]} ${size[2]} ${size[1]} ${size[1.5]};
695
+ border-radius: ${border.radius.md};
696
+ position: fixed;
697
+ z-index: 99999;
698
+ display: inline-flex;
699
+ width: fit-content;
700
+ cursor: pointer;
701
+ appearance: none;
702
+ border: 0;
703
+ gap: 8px;
704
+ align-items: center;
705
+ border: 1px solid ${colors.gray[500]};
706
+ font-size: ${font.size.xs};
707
+ cursor: pointer;
708
+ transition: all 0.25s ease-out;
709
+
710
+ &:hover {
711
+ background: ${colors.darkGray[500]};
712
+ }
713
+ `,
714
+ mainCloseBtnPosition: (position) => {
715
+ const base = css`
716
+ ${position === "top-left" ? `top: ${size[2]}; left: ${size[2]};` : ""}
717
+ ${position === "top-right" ? `top: ${size[2]}; right: ${size[2]};` : ""}
718
+ ${position === "bottom-left" ? `bottom: ${size[2]}; left: ${size[2]};` : ""}
719
+ ${position === "bottom-right" ? `bottom: ${size[2]}; right: ${size[2]};` : ""}
720
+ `;
721
+ return base;
722
+ },
723
+ mainCloseBtnAnimation: (isOpen) => {
724
+ if (!isOpen) {
725
+ return css`
726
+ opacity: 1;
727
+ pointer-events: auto;
728
+ visibility: visible;
729
+ `;
730
+ }
731
+ return css`
732
+ opacity: 0;
733
+ pointer-events: none;
734
+ visibility: hidden;
735
+ `;
736
+ },
737
+ routerLogoCloseButton: css`
738
+ font-weight: ${font.weight.semibold};
739
+ font-size: ${font.size.xs};
740
+ background: linear-gradient(to right, #98f30c, #00f4a3);
741
+ background-clip: text;
742
+ -webkit-background-clip: text;
743
+ line-height: 1;
744
+ -webkit-text-fill-color: transparent;
745
+ white-space: nowrap;
746
+ `,
747
+ mainCloseBtnDivider: css`
748
+ width: 1px;
749
+ background: ${tokens.colors.gray[600]};
750
+ height: 100%;
751
+ border-radius: 999999px;
752
+ color: transparent;
753
+ `,
754
+ mainCloseBtnIconContainer: css`
755
+ position: relative;
756
+ width: ${size[5]};
757
+ height: ${size[5]};
758
+ background: pink;
759
+ border-radius: 999999px;
760
+ overflow: hidden;
761
+ `,
762
+ mainCloseBtnIconOuter: css`
763
+ width: ${size[5]};
764
+ height: ${size[5]};
765
+ position: absolute;
766
+ top: 50%;
767
+ left: 50%;
768
+ transform: translate(-50%, -50%);
769
+ filter: blur(3px) saturate(1.8) contrast(2);
770
+ `,
771
+ mainCloseBtnIconInner: css`
772
+ width: ${size[4]};
773
+ height: ${size[4]};
774
+ position: absolute;
775
+ top: 50%;
776
+ left: 50%;
777
+ transform: translate(-50%, -50%);
778
+ `,
779
+ panelCloseBtn: css`
780
+ position: absolute;
781
+ cursor: pointer;
782
+ z-index: 100001;
783
+ display: flex;
784
+ align-items: center;
785
+ justify-content: center;
786
+ outline: none;
787
+ background-color: ${colors.darkGray[700]};
788
+ &:hover {
789
+ background-color: ${colors.darkGray[500]};
790
+ }
791
+
792
+ top: 0;
793
+ right: ${size[2]};
794
+ transform: translate(0, -100%);
795
+ border-right: ${colors.darkGray[300]} 1px solid;
796
+ border-left: ${colors.darkGray[300]} 1px solid;
797
+ border-top: ${colors.darkGray[300]} 1px solid;
798
+ border-bottom: none;
799
+ border-radius: ${border.radius.sm} ${border.radius.sm} 0px 0px;
800
+ padding: ${size[1]} ${size[1.5]} ${size[0.5]} ${size[1.5]};
801
+
802
+ &::after {
803
+ content: ' ';
804
+ position: absolute;
805
+ top: 100%;
806
+ left: -${size[2.5]};
807
+ height: ${size[1.5]};
808
+ width: calc(100% + ${size[5]});
809
+ }
810
+ `,
811
+ panelCloseBtnIcon: css`
812
+ color: ${colors.gray[400]};
813
+ width: ${size[2]};
814
+ height: ${size[2]};
815
+ `,
816
+ navigateButton: css`
817
+ background: none;
818
+ border: none;
819
+ padding: 0 0 0 4px;
820
+ margin: 0;
821
+ color: ${colors.gray[400]};
822
+ font-size: ${fontSize.md};
823
+ cursor: pointer;
824
+ line-height: 1;
825
+ vertical-align: middle;
826
+ margin-right: 0.5ch;
827
+ flex-shrink: 0;
828
+ &:hover {
829
+ color: ${colors.blue[300]};
830
+ }
831
+ `
832
+ };
833
+ };
834
+ function useStyles$1() {
835
+ const shadowDomTarget = useContext(ShadowDomTargetContext);
836
+ const [_styles] = createSignal(stylesFactory$1(shadowDomTarget));
837
+ return _styles;
838
+ }
839
+ const getItem = (key) => {
840
+ try {
841
+ const itemValue = localStorage.getItem(key);
842
+ if (typeof itemValue === "string") {
843
+ return JSON.parse(itemValue);
844
+ }
845
+ return void 0;
846
+ } catch {
847
+ return void 0;
848
+ }
849
+ };
850
+ function useLocalStorage(key, defaultValue) {
851
+ const [value, setValue] = createSignal();
852
+ createEffect(() => {
853
+ const initialValue = getItem(key);
854
+ if (typeof initialValue === "undefined" || initialValue === null) {
855
+ setValue(
856
+ typeof defaultValue === "function" ? defaultValue() : defaultValue
857
+ );
858
+ } else {
859
+ setValue(initialValue);
860
+ }
861
+ });
862
+ const setter = (updater) => {
863
+ setValue((old) => {
864
+ let newVal = updater;
865
+ if (typeof updater == "function") {
866
+ newVal = updater(old);
867
+ }
868
+ try {
869
+ localStorage.setItem(key, JSON.stringify(newVal));
870
+ } catch {
871
+ }
872
+ return newVal;
873
+ });
874
+ };
875
+ return [value, setter];
876
+ }
877
+ var _tmpl$$3 = /* @__PURE__ */ template(`<span><svg xmlns=http://www.w3.org/2000/svg width=12 height=12 fill=none viewBox="0 0 24 24"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 18l6-6-6-6">`), _tmpl$2$1 = /* @__PURE__ */ template(`<div>`), _tmpl$3$1 = /* @__PURE__ */ template(`<button><span> `), _tmpl$4$1 = /* @__PURE__ */ template(`<div><div><button> [<!> ... <!>]`), _tmpl$5$1 = /* @__PURE__ */ template(`<button><span></span> 🔄 `), _tmpl$6$1 = /* @__PURE__ */ template(`<span>:`), _tmpl$7$1 = /* @__PURE__ */ template(`<span>`);
878
+ const Expander = ({
879
+ expanded,
880
+ style = {}
881
+ }) => {
882
+ const styles = useStyles();
883
+ return (() => {
884
+ var _el$ = _tmpl$$3(), _el$2 = _el$.firstChild;
885
+ effect((_p$) => {
886
+ var _v$ = styles().expander, _v$2 = clsx(styles().expanderIcon(expanded));
887
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
888
+ _v$2 !== _p$.t && setAttribute(_el$2, "class", _p$.t = _v$2);
889
+ return _p$;
890
+ }, {
891
+ e: void 0,
892
+ t: void 0
893
+ });
894
+ return _el$;
895
+ })();
896
+ };
897
+ function chunkArray(array, size) {
898
+ if (size < 1) return [];
899
+ let i = 0;
900
+ const result = [];
901
+ while (i < array.length) {
902
+ result.push(array.slice(i, i + size));
903
+ i = i + size;
904
+ }
905
+ return result;
906
+ }
907
+ function isIterable(x) {
908
+ return Symbol.iterator in x;
909
+ }
910
+ function Explorer({
911
+ value,
912
+ defaultExpanded,
913
+ pageSize = 100,
914
+ filterSubEntries,
915
+ ...rest
916
+ }) {
917
+ const [expanded, setExpanded] = createSignal(Boolean(defaultExpanded));
918
+ const toggleExpanded = () => setExpanded((old) => !old);
919
+ const type = createMemo(() => typeof value());
920
+ const subEntries = createMemo(() => {
921
+ let entries = [];
922
+ const makeProperty = (sub) => {
923
+ const subDefaultExpanded = defaultExpanded === true ? {
924
+ [sub.label]: true
925
+ } : defaultExpanded?.[sub.label];
926
+ return {
927
+ ...sub,
928
+ value: () => sub.value,
929
+ defaultExpanded: subDefaultExpanded
930
+ };
931
+ };
932
+ if (Array.isArray(value())) {
933
+ entries = value().map((d, i) => makeProperty({
934
+ label: i.toString(),
935
+ value: d
936
+ }));
937
+ } else if (value() !== null && typeof value() === "object" && isIterable(value()) && typeof value()[Symbol.iterator] === "function") {
938
+ entries = Array.from(value(), (val, i) => makeProperty({
939
+ label: i.toString(),
940
+ value: val
941
+ }));
942
+ } else if (typeof value() === "object" && value() !== null) {
943
+ entries = Object.entries(value()).map(([key, val]) => makeProperty({
944
+ label: key,
945
+ value: val
946
+ }));
947
+ }
948
+ return filterSubEntries ? filterSubEntries(entries) : entries;
949
+ });
950
+ const subEntryPages = createMemo(() => chunkArray(subEntries(), pageSize));
951
+ const [expandedPages, setExpandedPages] = createSignal([]);
952
+ const [valueSnapshot, setValueSnapshot] = createSignal(void 0);
953
+ const styles = useStyles();
954
+ const refreshValueSnapshot = () => {
955
+ setValueSnapshot(value()());
956
+ };
957
+ const handleEntry = (entry) => createComponent(Explorer, mergeProps({
958
+ value,
959
+ filterSubEntries
960
+ }, rest, entry));
961
+ return (() => {
962
+ var _el$3 = _tmpl$2$1();
963
+ insert(_el$3, (() => {
964
+ var _c$ = memo(() => !!subEntryPages().length);
965
+ return () => _c$() ? [(() => {
966
+ var _el$4 = _tmpl$3$1(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild;
967
+ _el$4.$$click = () => toggleExpanded();
968
+ insert(_el$4, createComponent(Expander, {
969
+ get expanded() {
970
+ return expanded() ?? false;
971
+ }
972
+ }), _el$5);
973
+ insert(_el$4, () => rest.label, _el$5);
974
+ insert(_el$5, () => String(type).toLowerCase() === "iterable" ? "(Iterable) " : "", _el$6);
975
+ insert(_el$5, () => subEntries().length, _el$6);
976
+ insert(_el$5, () => subEntries().length > 1 ? `items` : `item`, null);
977
+ effect((_p$) => {
978
+ var _v$3 = styles().expandButton, _v$4 = styles().info;
979
+ _v$3 !== _p$.e && className(_el$4, _p$.e = _v$3);
980
+ _v$4 !== _p$.t && className(_el$5, _p$.t = _v$4);
981
+ return _p$;
982
+ }, {
983
+ e: void 0,
984
+ t: void 0
985
+ });
986
+ return _el$4;
987
+ })(), memo(() => memo(() => !!(expanded() ?? false))() ? memo(() => subEntryPages().length === 1)() ? (() => {
988
+ var _el$7 = _tmpl$2$1();
989
+ insert(_el$7, () => subEntries().map((entry, index) => handleEntry(entry)));
990
+ effect(() => className(_el$7, styles().subEntries));
991
+ return _el$7;
992
+ })() : (() => {
993
+ var _el$8 = _tmpl$2$1();
994
+ insert(_el$8, () => subEntryPages().map((entries, index) => {
995
+ return (() => {
996
+ var _el$9 = _tmpl$4$1(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$15 = _el$10.nextSibling, _el$12 = _el$15.nextSibling, _el$16 = _el$12.nextSibling;
997
+ _el$16.nextSibling;
998
+ _el$1.$$click = () => setExpandedPages((old) => old.includes(index) ? old.filter((d) => d !== index) : [...old, index]);
999
+ insert(_el$1, createComponent(Expander, {
1000
+ get expanded() {
1001
+ return expandedPages().includes(index);
1002
+ }
1003
+ }), _el$10);
1004
+ insert(_el$1, index * pageSize, _el$15);
1005
+ insert(_el$1, index * pageSize + pageSize - 1, _el$16);
1006
+ insert(_el$0, (() => {
1007
+ var _c$3 = memo(() => !!expandedPages().includes(index));
1008
+ return () => _c$3() ? (() => {
1009
+ var _el$17 = _tmpl$2$1();
1010
+ insert(_el$17, () => entries.map((entry) => handleEntry(entry)));
1011
+ effect(() => className(_el$17, styles().subEntries));
1012
+ return _el$17;
1013
+ })() : null;
1014
+ })(), null);
1015
+ effect((_p$) => {
1016
+ var _v$5 = styles().entry, _v$6 = clsx(styles().labelButton, "labelButton");
1017
+ _v$5 !== _p$.e && className(_el$0, _p$.e = _v$5);
1018
+ _v$6 !== _p$.t && className(_el$1, _p$.t = _v$6);
1019
+ return _p$;
1020
+ }, {
1021
+ e: void 0,
1022
+ t: void 0
1023
+ });
1024
+ return _el$9;
1025
+ })();
1026
+ }));
1027
+ effect(() => className(_el$8, styles().subEntries));
1028
+ return _el$8;
1029
+ })() : null)] : (() => {
1030
+ var _c$2 = memo(() => type() === "function");
1031
+ return () => _c$2() ? createComponent(Explorer, {
1032
+ get label() {
1033
+ return (() => {
1034
+ var _el$18 = _tmpl$5$1(), _el$19 = _el$18.firstChild;
1035
+ _el$18.$$click = refreshValueSnapshot;
1036
+ insert(_el$19, () => rest.label);
1037
+ effect(() => className(_el$18, styles().refreshValueBtn));
1038
+ return _el$18;
1039
+ })();
1040
+ },
1041
+ value: valueSnapshot,
1042
+ defaultExpanded: {}
1043
+ }) : [(() => {
1044
+ var _el$20 = _tmpl$6$1(), _el$21 = _el$20.firstChild;
1045
+ insert(_el$20, () => rest.label, _el$21);
1046
+ return _el$20;
1047
+ })(), " ", (() => {
1048
+ var _el$22 = _tmpl$7$1();
1049
+ insert(_el$22, () => displayValue(value()));
1050
+ effect(() => className(_el$22, styles().value));
1051
+ return _el$22;
1052
+ })()];
1053
+ })();
1054
+ })());
1055
+ effect(() => className(_el$3, styles().entry));
1056
+ return _el$3;
1057
+ })();
1058
+ }
1059
+ const stylesFactory = (shadowDOMTarget) => {
1060
+ const {
1061
+ colors,
1062
+ font,
1063
+ size
1064
+ } = tokens;
1065
+ const {
1066
+ fontFamily,
1067
+ lineHeight,
1068
+ size: fontSize
1069
+ } = font;
1070
+ const css = shadowDOMTarget ? goober.css.bind({
1071
+ target: shadowDOMTarget
1072
+ }) : goober.css;
1073
+ return {
1074
+ entry: css`
1075
+ font-family: ${fontFamily.mono};
1076
+ font-size: ${fontSize.xs};
1077
+ line-height: ${lineHeight.sm};
1078
+ outline: none;
1079
+ word-break: break-word;
1080
+ `,
1081
+ labelButton: css`
1082
+ cursor: pointer;
1083
+ color: inherit;
1084
+ font: inherit;
1085
+ outline: inherit;
1086
+ background: transparent;
1087
+ border: none;
1088
+ padding: 0;
1089
+ `,
1090
+ expander: css`
1091
+ display: inline-flex;
1092
+ align-items: center;
1093
+ justify-content: center;
1094
+ width: ${size[3]};
1095
+ height: ${size[3]};
1096
+ padding-left: 3px;
1097
+ box-sizing: content-box;
1098
+ `,
1099
+ expanderIcon: (expanded) => {
1100
+ if (expanded) {
1101
+ return css`
1102
+ transform: rotate(90deg);
1103
+ transition: transform 0.1s ease;
1104
+ `;
1105
+ }
1106
+ return css`
1107
+ transform: rotate(0deg);
1108
+ transition: transform 0.1s ease;
1109
+ `;
1110
+ },
1111
+ expandButton: css`
1112
+ display: flex;
1113
+ gap: ${size[1]};
1114
+ align-items: center;
1115
+ cursor: pointer;
1116
+ color: inherit;
1117
+ font: inherit;
1118
+ outline: inherit;
1119
+ background: transparent;
1120
+ border: none;
1121
+ padding: 0;
1122
+ `,
1123
+ value: css`
1124
+ color: ${colors.purple[400]};
1125
+ `,
1126
+ subEntries: css`
1127
+ margin-left: ${size[2]};
1128
+ padding-left: ${size[2]};
1129
+ border-left: 2px solid ${colors.darkGray[400]};
1130
+ `,
1131
+ info: css`
1132
+ color: ${colors.gray[500]};
1133
+ font-size: ${fontSize["2xs"]};
1134
+ padding-left: ${size[1]};
1135
+ `,
1136
+ refreshValueBtn: css`
1137
+ appearance: none;
1138
+ border: 0;
1139
+ cursor: pointer;
1140
+ background: transparent;
1141
+ color: inherit;
1142
+ padding: 0;
1143
+ font-family: ${fontFamily.mono};
1144
+ font-size: ${fontSize.xs};
1145
+ `
1146
+ };
1147
+ };
1148
+ function useStyles() {
1149
+ const shadowDomTarget = useContext(ShadowDomTargetContext);
1150
+ const [_styles] = createSignal(stylesFactory(shadowDomTarget));
1151
+ return _styles;
1152
+ }
1153
+ delegateEvents(["click"]);
1154
+ var _tmpl$$2 = /* @__PURE__ */ template(`<div><div></div><div>/</div><div></div><div>/</div><div>`);
1155
+ function formatTime(ms) {
1156
+ const units = ["s", "min", "h", "d"];
1157
+ const values = [ms / 1e3, ms / 6e4, ms / 36e5, ms / 864e5];
1158
+ let chosenUnitIndex = 0;
1159
+ for (let i = 1; i < values.length; i++) {
1160
+ if (values[i] < 1) break;
1161
+ chosenUnitIndex = i;
1162
+ }
1163
+ const formatter = new Intl.NumberFormat(navigator.language, {
1164
+ compactDisplay: "short",
1165
+ notation: "compact",
1166
+ maximumFractionDigits: 0
1167
+ });
1168
+ return formatter.format(values[chosenUnitIndex]) + units[chosenUnitIndex];
1169
+ }
1170
+ function AgeTicker({
1171
+ match,
1172
+ router
1173
+ }) {
1174
+ const styles = useStyles$1();
1175
+ if (!match) {
1176
+ return null;
1177
+ }
1178
+ const route = router().looseRoutesById[match.routeId];
1179
+ if (!route.options.loader) {
1180
+ return null;
1181
+ }
1182
+ const age = Date.now() - match.updatedAt;
1183
+ const staleTime = route.options.staleTime ?? router().options.defaultStaleTime ?? 0;
1184
+ const gcTime = route.options.gcTime ?? router().options.defaultGcTime ?? 30 * 60 * 1e3;
1185
+ return (() => {
1186
+ var _el$ = _tmpl$$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling;
1187
+ insert(_el$2, () => formatTime(age));
1188
+ insert(_el$4, () => formatTime(staleTime));
1189
+ insert(_el$6, () => formatTime(gcTime));
1190
+ effect(() => className(_el$, clsx(styles().ageTicker(age > staleTime))));
1191
+ return _el$;
1192
+ })();
1193
+ }
1194
+ var _tmpl$$1 = /* @__PURE__ */ template(`<button type=button>➔`);
1195
+ function NavigateButton({
1196
+ to,
1197
+ params,
1198
+ search,
1199
+ router
1200
+ }) {
1201
+ const styles = useStyles$1();
1202
+ return (() => {
1203
+ var _el$ = _tmpl$$1();
1204
+ _el$.$$click = (e) => {
1205
+ e.stopPropagation();
1206
+ router().navigate({
1207
+ to,
1208
+ params,
1209
+ search
1210
+ });
1211
+ };
1212
+ setAttribute(_el$, "title", `Navigate to ${to}`);
1213
+ effect(() => className(_el$, styles().navigateButton));
1214
+ return _el$;
1215
+ })();
1216
+ }
1217
+ delegateEvents(["click"]);
1218
+ var _tmpl$ = /* @__PURE__ */ template(`<button><div>TANSTACK</div><div>TanStack Router v1`), _tmpl$2 = /* @__PURE__ */ template(`<div><div>`), _tmpl$3 = /* @__PURE__ */ template(`<code> `), _tmpl$4 = /* @__PURE__ */ template(`<code>`), _tmpl$5 = /* @__PURE__ */ template(`<div><div role=button><div>`), _tmpl$6 = /* @__PURE__ */ template(`<div>`), _tmpl$7 = /* @__PURE__ */ template(`<div><button><svg xmlns=http://www.w3.org/2000/svg width=10 height=6 fill=none viewBox="0 0 10 6"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=1.667 d="M1 1l4 4 4-4"></path></svg></button><div><div></div><div><div></div></div></div><div><div><div><span>Pathname</span></div><div><code></code></div><div><div><button type=button>Routes</button><button type=button>Matches</button></div><div><div>age / staleTime / gcTime</div></div></div><div>`), _tmpl$8 = /* @__PURE__ */ template(`<div><span>masked`), _tmpl$9 = /* @__PURE__ */ template(`<div role=button><div>`), _tmpl$0 = /* @__PURE__ */ template(`<div><div><div>Cached Matches</div><div>age / staleTime / gcTime</div></div><div>`), _tmpl$1 = /* @__PURE__ */ template(`<div><div>Match Details</div><div><div><div><div></div></div><div><div>ID:</div><div><code></code></div></div><div><div>State:</div><div></div></div><div><div>Last Updated:</div><div></div></div></div></div><div>Explorer</div><div>`), _tmpl$10 = /* @__PURE__ */ template(`<div>Loader Data`), _tmpl$11 = /* @__PURE__ */ template(`<div><div><span>Search Params</span></div><div>`), _tmpl$12 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem;>`), _tmpl$13 = /* @__PURE__ */ template(`<button type=button style=cursor:pointer; aria-label="Copy value to clipboard">`);
1219
+ function Logo(props) {
1220
+ const {
1221
+ className: className$1,
1222
+ ...rest
1223
+ } = props;
1224
+ const styles = useStyles$1();
1225
+ return (() => {
1226
+ var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
1227
+ spread(_el$, mergeProps(rest, {
1228
+ get ["class"]() {
1229
+ return clsx(styles().logo, className$1 ? className$1() : "");
1230
+ }
1231
+ }), false, true);
1232
+ effect((_p$) => {
1233
+ var _v$ = styles().tanstackLogo, _v$2 = styles().routerLogo;
1234
+ _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
1235
+ _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
1236
+ return _p$;
1237
+ }, {
1238
+ e: void 0,
1239
+ t: void 0
1240
+ });
1241
+ return _el$;
1242
+ })();
1243
+ }
1244
+ function NavigateLink(props) {
1245
+ return (() => {
1246
+ var _el$4 = _tmpl$2(), _el$5 = _el$4.firstChild;
1247
+ _el$4.style.setProperty("display", "flex");
1248
+ _el$4.style.setProperty("align-items", "center");
1249
+ _el$4.style.setProperty("width", "100%");
1250
+ insert(_el$4, () => props.left, _el$5);
1251
+ _el$5.style.setProperty("flex-grow", "1");
1252
+ _el$5.style.setProperty("min-width", "0");
1253
+ insert(_el$5, () => props.children);
1254
+ insert(_el$4, () => props.right, null);
1255
+ effect(() => className(_el$4, props.class));
1256
+ return _el$4;
1257
+ })();
1258
+ }
1259
+ function RouteComp({
1260
+ routerState,
1261
+ router,
1262
+ route,
1263
+ isRoot,
1264
+ activeId,
1265
+ setActiveId
1266
+ }) {
1267
+ const styles = useStyles$1();
1268
+ const matches = createMemo(() => routerState().pendingMatches || routerState().matches);
1269
+ const match = createMemo(() => routerState().matches.find((d) => d.routeId === route.id));
1270
+ const param = createMemo(() => {
1271
+ try {
1272
+ if (match()?.params) {
1273
+ const p = match()?.params;
1274
+ const r = route.path || trimPath(route.id);
1275
+ if (r.startsWith("$")) {
1276
+ const trimmed = r.slice(1);
1277
+ if (p[trimmed]) {
1278
+ return `(${p[trimmed]})`;
1279
+ }
1280
+ }
1281
+ }
1282
+ return "";
1283
+ } catch (error) {
1284
+ return "";
1285
+ }
1286
+ });
1287
+ const navigationTarget = createMemo(() => {
1288
+ if (isRoot) return void 0;
1289
+ if (!route.path) return void 0;
1290
+ const allParams = Object.assign({}, ...matches().map((m) => m.params));
1291
+ const interpolated = interpolatePath({
1292
+ path: route.fullPath,
1293
+ params: allParams,
1294
+ leaveWildcards: false,
1295
+ leaveParams: false,
1296
+ decodeCharMap: router().pathParamsDecodeCharMap
1297
+ });
1298
+ return !interpolated.isMissingParams ? interpolated.interpolatedPath : void 0;
1299
+ });
1300
+ return (() => {
1301
+ var _el$6 = _tmpl$5(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild;
1302
+ _el$7.$$click = () => {
1303
+ if (match()) {
1304
+ setActiveId(activeId() === route.id ? "" : route.id);
1305
+ }
1306
+ };
1307
+ insert(_el$7, createComponent(NavigateLink, {
1308
+ get ["class"]() {
1309
+ return clsx(styles().routesRow(!!match()));
1310
+ },
1311
+ get left() {
1312
+ return createComponent(Show, {
1313
+ get when() {
1314
+ return navigationTarget();
1315
+ },
1316
+ children: (navigate) => createComponent(NavigateButton, {
1317
+ get to() {
1318
+ return navigate();
1319
+ },
1320
+ router
1321
+ })
1322
+ });
1323
+ },
1324
+ get right() {
1325
+ return createComponent(AgeTicker, {
1326
+ get match() {
1327
+ return match();
1328
+ },
1329
+ router
1330
+ });
1331
+ },
1332
+ get children() {
1333
+ return [(() => {
1334
+ var _el$9 = _tmpl$3(), _el$0 = _el$9.firstChild;
1335
+ insert(_el$9, () => isRoot ? rootRouteId : route.path || trimPath(route.id), _el$0);
1336
+ effect(() => className(_el$9, styles().code));
1337
+ return _el$9;
1338
+ })(), (() => {
1339
+ var _el$1 = _tmpl$4();
1340
+ insert(_el$1, param);
1341
+ effect(() => className(_el$1, styles().routeParamInfo));
1342
+ return _el$1;
1343
+ })()];
1344
+ }
1345
+ }), null);
1346
+ insert(_el$6, (() => {
1347
+ var _c$ = memo(() => !!route.children?.length);
1348
+ return () => _c$() ? (() => {
1349
+ var _el$10 = _tmpl$6();
1350
+ insert(_el$10, () => [...route.children].sort((a, b) => {
1351
+ return a.rank - b.rank;
1352
+ }).map((r) => createComponent(RouteComp, {
1353
+ routerState,
1354
+ router,
1355
+ route: r,
1356
+ activeId,
1357
+ setActiveId
1358
+ })));
1359
+ effect(() => className(_el$10, styles().nestedRouteRow(!!isRoot)));
1360
+ return _el$10;
1361
+ })() : null;
1362
+ })(), null);
1363
+ effect((_p$) => {
1364
+ var _v$3 = `Open match details for ${route.id}`, _v$4 = clsx(styles().routesRowContainer(route.id === activeId(), !!match())), _v$5 = clsx(styles().matchIndicator(getRouteStatusColor(matches(), route)));
1365
+ _v$3 !== _p$.e && setAttribute(_el$7, "aria-label", _p$.e = _v$3);
1366
+ _v$4 !== _p$.t && className(_el$7, _p$.t = _v$4);
1367
+ _v$5 !== _p$.a && className(_el$8, _p$.a = _v$5);
1368
+ return _p$;
1369
+ }, {
1370
+ e: void 0,
1371
+ t: void 0,
1372
+ a: void 0
1373
+ });
1374
+ return _el$6;
1375
+ })();
1376
+ }
1377
+ const BaseTanStackRouterDevtoolsPanel = function BaseTanStackRouterDevtoolsPanel2({
1378
+ ...props
1379
+ }) {
1380
+ const {
1381
+ isOpen = true,
1382
+ setIsOpen,
1383
+ handleDragStart,
1384
+ router,
1385
+ routerState,
1386
+ shadowDOMTarget,
1387
+ ...panelProps
1388
+ } = props;
1389
+ const {
1390
+ onCloseClick
1391
+ } = useDevtoolsOnClose();
1392
+ const styles = useStyles$1();
1393
+ const {
1394
+ className: className$1,
1395
+ style,
1396
+ ...otherPanelProps
1397
+ } = panelProps;
1398
+ invariant(router, "No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.");
1399
+ const [showMatches, setShowMatches] = useLocalStorage("tanstackRouterDevtoolsShowMatches", true);
1400
+ const [activeId, setActiveId] = useLocalStorage("tanstackRouterDevtoolsActiveRouteId", "");
1401
+ const activeMatch = createMemo(() => {
1402
+ const matches = [...routerState().pendingMatches ?? [], ...routerState().matches, ...routerState().cachedMatches];
1403
+ return matches.find((d) => d.routeId === activeId() || d.id === activeId());
1404
+ });
1405
+ const hasSearch = createMemo(() => Object.keys(routerState().location.search).length);
1406
+ const explorerState = createMemo(() => {
1407
+ return {
1408
+ ...router(),
1409
+ state: routerState()
1410
+ };
1411
+ });
1412
+ const routerExplorerValue = createMemo(() => Object.fromEntries(multiSortBy(Object.keys(explorerState()), ["state", "routesById", "routesByPath", "flatRoutes", "options", "manifest"].map((d) => (dd) => dd !== d)).map((key) => [key, explorerState()[key]]).filter((d) => typeof d[1] !== "function" && !["__store", "basepath", "injectedHtml", "subscribers", "latestLoadPromise", "navigateTimeout", "resetNextScroll", "tempLocationKey", "latestLocation", "routeTree", "history"].includes(d[0]))));
1413
+ const activeMatchLoaderData = createMemo(() => activeMatch()?.loaderData);
1414
+ const activeMatchValue = createMemo(() => activeMatch());
1415
+ const locationSearchValue = createMemo(() => routerState().location.search);
1416
+ return (() => {
1417
+ var _el$11 = _tmpl$7(), _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$12.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$14.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild;
1418
+ _el$20.firstChild;
1419
+ var _el$22 = _el$20.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$25.nextSibling, _el$29 = _el$24.nextSibling;
1420
+ spread(_el$11, mergeProps({
1421
+ get ["class"]() {
1422
+ return clsx(styles().devtoolsPanel, "TanStackRouterDevtoolsPanel", className$1 ? className$1() : "");
1423
+ },
1424
+ get style() {
1425
+ return style ? style() : "";
1426
+ }
1427
+ }, otherPanelProps), false, true);
1428
+ insert(_el$11, handleDragStart ? (() => {
1429
+ var _el$30 = _tmpl$6();
1430
+ addEventListener(_el$30, "mousedown", handleDragStart, true);
1431
+ effect(() => className(_el$30, styles().dragHandle));
1432
+ return _el$30;
1433
+ })() : null, _el$12);
1434
+ _el$12.$$click = (e) => {
1435
+ if (setIsOpen) {
1436
+ setIsOpen(false);
1437
+ }
1438
+ onCloseClick(e);
1439
+ };
1440
+ insert(_el$15, createComponent(Logo, {
1441
+ "aria-hidden": true,
1442
+ onClick: (e) => {
1443
+ if (setIsOpen) {
1444
+ setIsOpen(false);
1445
+ }
1446
+ onCloseClick(e);
1447
+ }
1448
+ }));
1449
+ insert(_el$17, createComponent(Explorer, {
1450
+ label: "Router",
1451
+ value: routerExplorerValue,
1452
+ defaultExpanded: {
1453
+ state: {},
1454
+ context: {},
1455
+ options: {}
1456
+ },
1457
+ filterSubEntries: (subEntries) => {
1458
+ return subEntries.filter((d) => typeof d.value() !== "function");
1459
+ }
1460
+ }));
1461
+ insert(_el$20, (() => {
1462
+ var _c$2 = memo(() => !!routerState().location.maskedLocation);
1463
+ return () => _c$2() ? (() => {
1464
+ var _el$31 = _tmpl$8(), _el$32 = _el$31.firstChild;
1465
+ effect((_p$) => {
1466
+ var _v$22 = styles().maskedBadgeContainer, _v$23 = styles().maskedBadge;
1467
+ _v$22 !== _p$.e && className(_el$31, _p$.e = _v$22);
1468
+ _v$23 !== _p$.t && className(_el$32, _p$.t = _v$23);
1469
+ return _p$;
1470
+ }, {
1471
+ e: void 0,
1472
+ t: void 0
1473
+ });
1474
+ return _el$31;
1475
+ })() : null;
1476
+ })(), null);
1477
+ insert(_el$23, () => routerState().location.pathname);
1478
+ insert(_el$22, (() => {
1479
+ var _c$3 = memo(() => !!routerState().location.maskedLocation);
1480
+ return () => _c$3() ? (() => {
1481
+ var _el$33 = _tmpl$4();
1482
+ insert(_el$33, () => routerState().location.maskedLocation?.pathname);
1483
+ effect(() => className(_el$33, styles().maskedLocation));
1484
+ return _el$33;
1485
+ })() : null;
1486
+ })(), null);
1487
+ _el$26.$$click = () => {
1488
+ setShowMatches(false);
1489
+ };
1490
+ _el$27.$$click = () => {
1491
+ setShowMatches(true);
1492
+ };
1493
+ insert(_el$29, (() => {
1494
+ var _c$4 = memo(() => !!!showMatches());
1495
+ return () => _c$4() ? createComponent(RouteComp, {
1496
+ routerState,
1497
+ router,
1498
+ get route() {
1499
+ return router().routeTree;
1500
+ },
1501
+ isRoot: true,
1502
+ activeId,
1503
+ setActiveId
1504
+ }) : (() => {
1505
+ var _el$34 = _tmpl$6();
1506
+ insert(_el$34, () => (routerState().pendingMatches?.length ? routerState().pendingMatches : routerState().matches)?.map((match, _i) => {
1507
+ return (() => {
1508
+ var _el$35 = _tmpl$9(), _el$36 = _el$35.firstChild;
1509
+ _el$35.$$click = () => setActiveId(activeId() === match.id ? "" : match.id);
1510
+ insert(_el$35, createComponent(NavigateLink, {
1511
+ get left() {
1512
+ return createComponent(NavigateButton, {
1513
+ get to() {
1514
+ return match.pathname;
1515
+ },
1516
+ get params() {
1517
+ return match.params;
1518
+ },
1519
+ get search() {
1520
+ return match.search;
1521
+ },
1522
+ router
1523
+ });
1524
+ },
1525
+ get right() {
1526
+ return createComponent(AgeTicker, {
1527
+ match,
1528
+ router
1529
+ });
1530
+ },
1531
+ get children() {
1532
+ var _el$37 = _tmpl$4();
1533
+ insert(_el$37, () => `${match.routeId === rootRouteId ? rootRouteId : match.pathname}`);
1534
+ effect(() => className(_el$37, styles().matchID));
1535
+ return _el$37;
1536
+ }
1537
+ }), null);
1538
+ effect((_p$) => {
1539
+ var _v$24 = `Open match details for ${match.id}`, _v$25 = clsx(styles().matchRow(match === activeMatch())), _v$26 = clsx(styles().matchIndicator(getStatusColor(match)));
1540
+ _v$24 !== _p$.e && setAttribute(_el$35, "aria-label", _p$.e = _v$24);
1541
+ _v$25 !== _p$.t && className(_el$35, _p$.t = _v$25);
1542
+ _v$26 !== _p$.a && className(_el$36, _p$.a = _v$26);
1543
+ return _p$;
1544
+ }, {
1545
+ e: void 0,
1546
+ t: void 0,
1547
+ a: void 0
1548
+ });
1549
+ return _el$35;
1550
+ })();
1551
+ }));
1552
+ return _el$34;
1553
+ })();
1554
+ })());
1555
+ insert(_el$18, (() => {
1556
+ var _c$5 = memo(() => !!routerState().cachedMatches.length);
1557
+ return () => _c$5() ? (() => {
1558
+ var _el$38 = _tmpl$0(), _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling, _el$42 = _el$39.nextSibling;
1559
+ insert(_el$42, () => routerState().cachedMatches.map((match) => {
1560
+ return (() => {
1561
+ var _el$43 = _tmpl$9(), _el$44 = _el$43.firstChild;
1562
+ _el$43.$$click = () => setActiveId(activeId() === match.id ? "" : match.id);
1563
+ insert(_el$43, createComponent(NavigateLink, {
1564
+ get left() {
1565
+ return createComponent(NavigateButton, {
1566
+ get to() {
1567
+ return match.pathname;
1568
+ },
1569
+ get params() {
1570
+ return match.params;
1571
+ },
1572
+ get search() {
1573
+ return match.search;
1574
+ },
1575
+ router
1576
+ });
1577
+ },
1578
+ get right() {
1579
+ return createComponent(AgeTicker, {
1580
+ match,
1581
+ router
1582
+ });
1583
+ },
1584
+ get children() {
1585
+ var _el$45 = _tmpl$4();
1586
+ insert(_el$45, () => `${match.id}`);
1587
+ effect(() => className(_el$45, styles().matchID));
1588
+ return _el$45;
1589
+ }
1590
+ }), null);
1591
+ effect((_p$) => {
1592
+ var _v$30 = `Open match details for ${match.id}`, _v$31 = clsx(styles().matchRow(match === activeMatch())), _v$32 = clsx(styles().matchIndicator(getStatusColor(match)));
1593
+ _v$30 !== _p$.e && setAttribute(_el$43, "aria-label", _p$.e = _v$30);
1594
+ _v$31 !== _p$.t && className(_el$43, _p$.t = _v$31);
1595
+ _v$32 !== _p$.a && className(_el$44, _p$.a = _v$32);
1596
+ return _p$;
1597
+ }, {
1598
+ e: void 0,
1599
+ t: void 0,
1600
+ a: void 0
1601
+ });
1602
+ return _el$43;
1603
+ })();
1604
+ }));
1605
+ effect((_p$) => {
1606
+ var _v$27 = styles().cachedMatchesContainer, _v$28 = styles().detailsHeader, _v$29 = styles().detailsHeaderInfo;
1607
+ _v$27 !== _p$.e && className(_el$38, _p$.e = _v$27);
1608
+ _v$28 !== _p$.t && className(_el$39, _p$.t = _v$28);
1609
+ _v$29 !== _p$.a && className(_el$41, _p$.a = _v$29);
1610
+ return _p$;
1611
+ }, {
1612
+ e: void 0,
1613
+ t: void 0,
1614
+ a: void 0
1615
+ });
1616
+ return _el$38;
1617
+ })() : null;
1618
+ })(), null);
1619
+ insert(_el$11, (() => {
1620
+ var _c$6 = memo(() => !!(activeMatch() && activeMatch()?.status));
1621
+ return () => _c$6() ? (() => {
1622
+ var _el$46 = _tmpl$1(), _el$47 = _el$46.firstChild, _el$48 = _el$47.nextSibling, _el$49 = _el$48.firstChild, _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$50.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$56 = _el$52.nextSibling, _el$57 = _el$56.firstChild, _el$58 = _el$57.nextSibling, _el$59 = _el$56.nextSibling, _el$60 = _el$59.firstChild, _el$61 = _el$60.nextSibling, _el$62 = _el$48.nextSibling, _el$63 = _el$62.nextSibling;
1623
+ insert(_el$51, (() => {
1624
+ var _c$8 = memo(() => !!(activeMatch()?.status === "success" && activeMatch()?.isFetching));
1625
+ return () => _c$8() ? "fetching" : activeMatch()?.status;
1626
+ })());
1627
+ insert(_el$55, () => activeMatch()?.id);
1628
+ insert(_el$58, (() => {
1629
+ var _c$9 = memo(() => !!routerState().pendingMatches?.find((d) => d.id === activeMatch()?.id));
1630
+ return () => _c$9() ? "Pending" : routerState().matches.find((d) => d.id === activeMatch()?.id) ? "Active" : "Cached";
1631
+ })());
1632
+ insert(_el$61, (() => {
1633
+ var _c$0 = memo(() => !!activeMatch()?.updatedAt);
1634
+ return () => _c$0() ? new Date(activeMatch()?.updatedAt).toLocaleTimeString() : "N/A";
1635
+ })());
1636
+ insert(_el$46, (() => {
1637
+ var _c$1 = memo(() => !!activeMatchLoaderData());
1638
+ return () => _c$1() ? [(() => {
1639
+ var _el$64 = _tmpl$10();
1640
+ effect(() => className(_el$64, styles().detailsHeader));
1641
+ return _el$64;
1642
+ })(), (() => {
1643
+ var _el$65 = _tmpl$6();
1644
+ insert(_el$65, createComponent(Explorer, {
1645
+ label: "loaderData",
1646
+ value: activeMatchLoaderData,
1647
+ defaultExpanded: {}
1648
+ }));
1649
+ effect(() => className(_el$65, styles().detailsContent));
1650
+ return _el$65;
1651
+ })()] : null;
1652
+ })(), _el$62);
1653
+ insert(_el$63, createComponent(Explorer, {
1654
+ label: "Match",
1655
+ value: activeMatchValue,
1656
+ defaultExpanded: {}
1657
+ }));
1658
+ effect((_p$) => {
1659
+ var _v$33 = styles().thirdContainer, _v$34 = styles().detailsHeader, _v$35 = styles().matchDetails, _v$36 = styles().matchStatus(activeMatch()?.status, activeMatch()?.isFetching), _v$37 = styles().matchDetailsInfoLabel, _v$38 = styles().matchDetailsInfo, _v$39 = styles().matchDetailsInfoLabel, _v$40 = styles().matchDetailsInfo, _v$41 = styles().matchDetailsInfoLabel, _v$42 = styles().matchDetailsInfo, _v$43 = styles().detailsHeader, _v$44 = styles().detailsContent;
1660
+ _v$33 !== _p$.e && className(_el$46, _p$.e = _v$33);
1661
+ _v$34 !== _p$.t && className(_el$47, _p$.t = _v$34);
1662
+ _v$35 !== _p$.a && className(_el$49, _p$.a = _v$35);
1663
+ _v$36 !== _p$.o && className(_el$50, _p$.o = _v$36);
1664
+ _v$37 !== _p$.i && className(_el$52, _p$.i = _v$37);
1665
+ _v$38 !== _p$.n && className(_el$54, _p$.n = _v$38);
1666
+ _v$39 !== _p$.s && className(_el$56, _p$.s = _v$39);
1667
+ _v$40 !== _p$.h && className(_el$58, _p$.h = _v$40);
1668
+ _v$41 !== _p$.r && className(_el$59, _p$.r = _v$41);
1669
+ _v$42 !== _p$.d && className(_el$61, _p$.d = _v$42);
1670
+ _v$43 !== _p$.l && className(_el$62, _p$.l = _v$43);
1671
+ _v$44 !== _p$.u && className(_el$63, _p$.u = _v$44);
1672
+ return _p$;
1673
+ }, {
1674
+ e: void 0,
1675
+ t: void 0,
1676
+ a: void 0,
1677
+ o: void 0,
1678
+ i: void 0,
1679
+ n: void 0,
1680
+ s: void 0,
1681
+ h: void 0,
1682
+ r: void 0,
1683
+ d: void 0,
1684
+ l: void 0,
1685
+ u: void 0
1686
+ });
1687
+ return _el$46;
1688
+ })() : null;
1689
+ })(), null);
1690
+ insert(_el$11, (() => {
1691
+ var _c$7 = memo(() => !!hasSearch());
1692
+ return () => _c$7() ? (() => {
1693
+ var _el$66 = _tmpl$11(), _el$67 = _el$66.firstChild;
1694
+ _el$67.firstChild;
1695
+ var _el$69 = _el$67.nextSibling;
1696
+ insert(_el$67, typeof navigator !== "undefined" ? (() => {
1697
+ var _el$70 = _tmpl$12();
1698
+ insert(_el$70, createComponent(CopyButton, {
1699
+ getValue: () => {
1700
+ const search = routerState().location.search;
1701
+ return JSON.stringify(search);
1702
+ }
1703
+ }));
1704
+ return _el$70;
1705
+ })() : null, null);
1706
+ insert(_el$69, createComponent(Explorer, {
1707
+ value: locationSearchValue,
1708
+ get defaultExpanded() {
1709
+ return Object.keys(routerState().location.search).reduce((obj, next) => {
1710
+ obj[next] = {};
1711
+ return obj;
1712
+ }, {});
1713
+ }
1714
+ }));
1715
+ effect((_p$) => {
1716
+ var _v$45 = styles().fourthContainer, _v$46 = styles().detailsHeader, _v$47 = styles().detailsContent;
1717
+ _v$45 !== _p$.e && className(_el$66, _p$.e = _v$45);
1718
+ _v$46 !== _p$.t && className(_el$67, _p$.t = _v$46);
1719
+ _v$47 !== _p$.a && className(_el$69, _p$.a = _v$47);
1720
+ return _p$;
1721
+ }, {
1722
+ e: void 0,
1723
+ t: void 0,
1724
+ a: void 0
1725
+ });
1726
+ return _el$66;
1727
+ })() : null;
1728
+ })(), null);
1729
+ effect((_p$) => {
1730
+ var _v$6 = styles().panelCloseBtn, _v$7 = styles().panelCloseBtnIcon, _v$8 = styles().firstContainer, _v$9 = styles().row, _v$0 = styles().routerExplorerContainer, _v$1 = styles().routerExplorer, _v$10 = styles().secondContainer, _v$11 = styles().matchesContainer, _v$12 = styles().detailsHeader, _v$13 = styles().detailsContent, _v$14 = styles().detailsHeader, _v$15 = styles().routeMatchesToggle, _v$16 = !showMatches(), _v$17 = clsx(styles().routeMatchesToggleBtn(!showMatches(), true)), _v$18 = showMatches(), _v$19 = clsx(styles().routeMatchesToggleBtn(!!showMatches(), false)), _v$20 = styles().detailsHeaderInfo, _v$21 = clsx(styles().routesContainer);
1731
+ _v$6 !== _p$.e && className(_el$12, _p$.e = _v$6);
1732
+ _v$7 !== _p$.t && setAttribute(_el$13, "class", _p$.t = _v$7);
1733
+ _v$8 !== _p$.a && className(_el$14, _p$.a = _v$8);
1734
+ _v$9 !== _p$.o && className(_el$15, _p$.o = _v$9);
1735
+ _v$0 !== _p$.i && className(_el$16, _p$.i = _v$0);
1736
+ _v$1 !== _p$.n && className(_el$17, _p$.n = _v$1);
1737
+ _v$10 !== _p$.s && className(_el$18, _p$.s = _v$10);
1738
+ _v$11 !== _p$.h && className(_el$19, _p$.h = _v$11);
1739
+ _v$12 !== _p$.r && className(_el$20, _p$.r = _v$12);
1740
+ _v$13 !== _p$.d && className(_el$22, _p$.d = _v$13);
1741
+ _v$14 !== _p$.l && className(_el$24, _p$.l = _v$14);
1742
+ _v$15 !== _p$.u && className(_el$25, _p$.u = _v$15);
1743
+ _v$16 !== _p$.c && (_el$26.disabled = _p$.c = _v$16);
1744
+ _v$17 !== _p$.w && className(_el$26, _p$.w = _v$17);
1745
+ _v$18 !== _p$.m && (_el$27.disabled = _p$.m = _v$18);
1746
+ _v$19 !== _p$.f && className(_el$27, _p$.f = _v$19);
1747
+ _v$20 !== _p$.y && className(_el$28, _p$.y = _v$20);
1748
+ _v$21 !== _p$.g && className(_el$29, _p$.g = _v$21);
1749
+ return _p$;
1750
+ }, {
1751
+ e: void 0,
1752
+ t: void 0,
1753
+ a: void 0,
1754
+ o: void 0,
1755
+ i: void 0,
1756
+ n: void 0,
1757
+ s: void 0,
1758
+ h: void 0,
1759
+ r: void 0,
1760
+ d: void 0,
1761
+ l: void 0,
1762
+ u: void 0,
1763
+ c: void 0,
1764
+ w: void 0,
1765
+ m: void 0,
1766
+ f: void 0,
1767
+ y: void 0,
1768
+ g: void 0
1769
+ });
1770
+ return _el$11;
1771
+ })();
1772
+ };
1773
+ function CopyButton({
1774
+ getValue
1775
+ }) {
1776
+ const [copied, setCopied] = createSignal(false);
1777
+ let timeoutId = null;
1778
+ const handleCopy = async () => {
1779
+ if (typeof navigator === "undefined" || !navigator.clipboard?.writeText) {
1780
+ console.warn("TanStack Router Devtools: Clipboard API unavailable");
1781
+ return;
1782
+ }
1783
+ try {
1784
+ const value = getValue();
1785
+ await navigator.clipboard.writeText(value);
1786
+ setCopied(true);
1787
+ if (timeoutId) clearTimeout(timeoutId);
1788
+ timeoutId = setTimeout(() => setCopied(false), 2500);
1789
+ } catch (e) {
1790
+ console.error("TanStack Router Devtools: Failed to copy", e);
1791
+ }
1792
+ };
1793
+ onCleanup(() => {
1794
+ if (timeoutId) clearTimeout(timeoutId);
1795
+ });
1796
+ return (() => {
1797
+ var _el$71 = _tmpl$13();
1798
+ _el$71.$$click = handleCopy;
1799
+ insert(_el$71, () => copied() ? "✅" : "📋");
1800
+ effect(() => setAttribute(_el$71, "title", copied() ? "Copied!" : "Copy"));
1801
+ return _el$71;
1802
+ })();
1803
+ }
1804
+ delegateEvents(["click", "mousedown"]);
1805
+ const BaseTanStackRouterDevtoolsPanel$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1806
+ __proto__: null,
1807
+ BaseTanStackRouterDevtoolsPanel,
1808
+ default: BaseTanStackRouterDevtoolsPanel
1809
+ }, Symbol.toStringTag, { value: "Module" }));
1810
+ export {
1811
+ BaseTanStackRouterDevtoolsPanel as B,
1812
+ useIsMounted as a,
1813
+ useStyles$1 as b,
1814
+ BaseTanStackRouterDevtoolsPanel$1 as c,
1815
+ useLocalStorage as u
1816
+ };
1817
+ //# sourceMappingURL=BaseTanStackRouterDevtoolsPanel-CaAQWNvS.js.map