@tanstack/router-devtools-core 1.166.7 → 1.166.9

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