@tanstack/query-devtools 5.0.0-alpha.54 → 5.0.0-alpha.56

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 (38) hide show
  1. package/dist/cjs/Devtools-3819273f.js +2634 -0
  2. package/dist/cjs/Devtools-3819273f.js.map +1 -0
  3. package/dist/cjs/index.cjs +102 -0
  4. package/dist/cjs/index.cjs.map +1 -0
  5. package/dist/esm/Devtools-a6a9d5b5.js +2626 -0
  6. package/dist/esm/Devtools-a6a9d5b5.js.map +1 -0
  7. package/dist/esm/index.js +100 -0
  8. package/dist/esm/index.js.map +1 -0
  9. package/{build → dist}/source/Devtools.jsx +1 -0
  10. package/package.json +15 -17
  11. package/src/Devtools.tsx +1 -0
  12. package/build/cjs/Devtools-5f8e85ff.js +0 -6781
  13. package/build/cjs/Devtools-5f8e85ff.js.map +0 -1
  14. package/build/cjs/index-db699afb.js +0 -1395
  15. package/build/cjs/index-db699afb.js.map +0 -1
  16. package/build/cjs/index.js +0 -8
  17. package/build/cjs/index.js.map +0 -1
  18. package/build/esm/Devtools-8dd32079.js +0 -6773
  19. package/build/esm/Devtools-8dd32079.js.map +0 -1
  20. package/build/esm/index-34324cec.js +0 -1365
  21. package/build/esm/index-34324cec.js.map +0 -1
  22. package/build/esm/index.js +0 -2
  23. package/build/esm/index.js.map +0 -1
  24. /package/{build → dist}/source/Context.js +0 -0
  25. /package/{build → dist}/source/Explorer.jsx +0 -0
  26. /package/{build → dist}/source/fonts.js +0 -0
  27. /package/{build → dist}/source/icons/index.jsx +0 -0
  28. /package/{build → dist}/source/index.jsx +0 -0
  29. /package/{build → dist}/source/theme.js +0 -0
  30. /package/{build → dist}/source/utils.jsx +0 -0
  31. /package/{build → dist}/types/Context.d.ts +0 -0
  32. /package/{build → dist}/types/Devtools.d.ts +0 -0
  33. /package/{build → dist}/types/Explorer.d.ts +0 -0
  34. /package/{build → dist}/types/fonts.d.ts +0 -0
  35. /package/{build → dist}/types/icons/index.d.ts +0 -0
  36. /package/{build → dist}/types/index.d.ts +0 -0
  37. /package/{build → dist}/types/theme.d.ts +0 -0
  38. /package/{build → dist}/types/utils.d.ts +0 -0
@@ -0,0 +1,2634 @@
1
+ 'use strict';
2
+
3
+ var web = require('solid-js/web');
4
+ var solidJs = require('solid-js');
5
+ var matchSorterUtils = require('@tanstack/match-sorter-utils');
6
+ var css = require('@emotion/css');
7
+ var superjson = require('superjson');
8
+ var keyed = require('@solid-primitives/keyed');
9
+ var solidTransitionGroup = require('solid-transition-group');
10
+ var storage = require('@solid-primitives/storage');
11
+ var resizeObserver = require('@solid-primitives/resize-observer');
12
+
13
+ const ShadowVariants = {
14
+ xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
15
+ sm: '0 1px 3px 0 color, 0 1px 2px -1px color',
16
+ md: '0 4px 6px -1px color, 0 2px 4px -2px color',
17
+ lg: '0 10px 15px -3px color, 0 4px 6px -4px color',
18
+ xl: '0 20px 25px -5px color, 0 8px 10px -6px color',
19
+ '2xl': '0 25px 50px -12px color',
20
+ inner: 'inset 0 2px 4px 0 color',
21
+ none: 'none'
22
+ };
23
+ const getShadow = (variant, color = '') => {
24
+ return ShadowVariants[variant].replace(/color/g, color);
25
+ };
26
+ const Shadow = {
27
+ xs: (color = 'rgb(0 0 0 / 0.1)') => getShadow('xs', color),
28
+ sm: (color = 'rgb(0 0 0 / 0.1)') => getShadow('sm', color),
29
+ md: (color = 'rgb(0 0 0 / 0.1)') => getShadow('md', color),
30
+ lg: (color = 'rgb(0 0 0 / 0.1)') => getShadow('lg', color),
31
+ xl: (color = 'rgb(0 0 0 / 0.1)') => getShadow('xl', color),
32
+ '2xl': (color = 'rgb(0 0 0 / 0.25)') => getShadow('2xl', color),
33
+ inner: (color = 'rgb(0 0 0 / 0.05)') => getShadow('inner', color),
34
+ none: () => getShadow('none')
35
+ };
36
+ const tokens = {
37
+ colors: {
38
+ inherit: 'inherit',
39
+ current: 'currentColor',
40
+ transparent: 'transparent',
41
+ black: '#000000',
42
+ white: '#ffffff',
43
+ neutral: {
44
+ 50: '#f9fafb',
45
+ 100: '#f2f4f7',
46
+ 200: '#eaecf0',
47
+ 300: '#d0d5dd',
48
+ 400: '#98a2b3',
49
+ 500: '#667085',
50
+ 600: '#475467',
51
+ 700: '#344054',
52
+ 800: '#1d2939',
53
+ 900: '#101828'
54
+ },
55
+ darkGray: {
56
+ 50: '#525c7a',
57
+ 100: '#49536e',
58
+ 200: '#414962',
59
+ 300: '#394056',
60
+ 400: '#313749',
61
+ 500: '#292e3d',
62
+ 600: '#212530',
63
+ 700: '#191c24',
64
+ 800: '#111318',
65
+ 900: '#0b0d10'
66
+ },
67
+ gray: {
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
+ blue: {
80
+ 25: '#F5FAFF',
81
+ 50: '#EFF8FF',
82
+ 100: '#D1E9FF',
83
+ 200: '#B2DDFF',
84
+ 300: '#84CAFF',
85
+ 400: '#53B1FD',
86
+ 500: '#2E90FA',
87
+ 600: '#1570EF',
88
+ 700: '#175CD3',
89
+ 800: '#1849A9',
90
+ 900: '#194185'
91
+ },
92
+ green: {
93
+ 25: '#F6FEF9',
94
+ 50: '#ECFDF3',
95
+ 100: '#D1FADF',
96
+ 200: '#A6F4C5',
97
+ 300: '#6CE9A6',
98
+ 400: '#32D583',
99
+ 500: '#12B76A',
100
+ 600: '#039855',
101
+ 700: '#027A48',
102
+ 800: '#05603A',
103
+ 900: '#054F31'
104
+ },
105
+ red: {
106
+ 25: '#FFFBFA',
107
+ 50: '#FEF3F2',
108
+ 100: '#FEE4E2',
109
+ 200: '#FECDCA',
110
+ 300: '#FDA29B',
111
+ 400: '#F97066',
112
+ 500: '#F04438',
113
+ 600: '#D92D20',
114
+ 700: '#B42318',
115
+ 800: '#912018',
116
+ 900: '#7A271A'
117
+ },
118
+ yellow: {
119
+ 25: '#FFFCF5',
120
+ 50: '#FFFAEB',
121
+ 100: '#FEF0C7',
122
+ 200: '#FEDF89',
123
+ 300: '#FEC84B',
124
+ 400: '#FDB022',
125
+ 500: '#F79009',
126
+ 600: '#DC6803',
127
+ 700: '#B54708',
128
+ 800: '#93370D',
129
+ 900: '#7A2E0E'
130
+ },
131
+ purple: {
132
+ 25: '#FAFAFF',
133
+ 50: '#F4F3FF',
134
+ 100: '#EBE9FE',
135
+ 200: '#D9D6FE',
136
+ 300: '#BDB4FE',
137
+ 400: '#9B8AFB',
138
+ 500: '#7A5AF8',
139
+ 600: '#6938EF',
140
+ 700: '#5925DC',
141
+ 800: '#4A1FB8',
142
+ 900: '#3E1C96'
143
+ },
144
+ teal: {
145
+ 25: '#F6FEFC',
146
+ 50: '#F0FDF9',
147
+ 100: '#CCFBEF',
148
+ 200: '#99F6E0',
149
+ 300: '#5FE9D0',
150
+ 400: '#2ED3B7',
151
+ 500: '#15B79E',
152
+ 600: '#0E9384',
153
+ 700: '#107569',
154
+ 800: '#125D56',
155
+ 900: '#134E48'
156
+ },
157
+ pink: {
158
+ 25: '#fdf2f8',
159
+ 50: '#fce7f3',
160
+ 100: '#fbcfe8',
161
+ 200: '#f9a8d4',
162
+ 300: '#f472b6',
163
+ 400: '#ec4899',
164
+ 500: '#db2777',
165
+ 600: '#be185d',
166
+ 700: '#9d174d',
167
+ 800: '#831843',
168
+ 900: '#500724'
169
+ },
170
+ cyan: {
171
+ 25: '#ecfeff',
172
+ 50: '#cffafe',
173
+ 100: '#a5f3fc',
174
+ 200: '#67e8f9',
175
+ 300: '#22d3ee',
176
+ 400: '#06b6d4',
177
+ 500: '#0891b2',
178
+ 600: '#0e7490',
179
+ 700: '#155e75',
180
+ 800: '#164e63',
181
+ 900: '#083344'
182
+ }
183
+ },
184
+ alpha: {
185
+ 100: 'ff',
186
+ 90: 'e5',
187
+ 80: 'cc',
188
+ 70: 'b3',
189
+ 60: '99',
190
+ 50: '80',
191
+ 40: '66',
192
+ 30: '4d',
193
+ 20: '33',
194
+ 10: '1a',
195
+ 0: '00'
196
+ },
197
+ font: {
198
+ size: {
199
+ '2xs': '0.625rem',
200
+ xs: '0.75rem',
201
+ sm: '0.875rem',
202
+ md: '1rem',
203
+ lg: '1.125rem',
204
+ xl: '1.25rem',
205
+ '2xl': '1.5rem',
206
+ '3xl': '1.875rem',
207
+ '4xl': '2.25rem',
208
+ '5xl': '3rem',
209
+ '6xl': '3.75rem',
210
+ '7xl': '4.5rem',
211
+ '8xl': '6rem',
212
+ '9xl': '8rem'
213
+ },
214
+ lineHeight: {
215
+ xs: '1rem',
216
+ sm: '1.25rem',
217
+ md: '1.5rem',
218
+ lg: '1.75rem',
219
+ xl: '1.75rem',
220
+ '2xl': '2rem',
221
+ '3xl': '2.25rem',
222
+ '4xl': '2.5rem',
223
+ '5xl': '1',
224
+ '6xl': '1',
225
+ '7xl': '1',
226
+ '8xl': '1',
227
+ '9xl': '1'
228
+ },
229
+ weight: {
230
+ thin: '100',
231
+ extralight: '200',
232
+ light: '300',
233
+ normal: '400',
234
+ medium: '500',
235
+ semibold: '600',
236
+ bold: '700',
237
+ extrabold: '800',
238
+ black: '900'
239
+ }
240
+ },
241
+ breakpoints: {
242
+ xs: '320px',
243
+ sm: '640px',
244
+ md: '768px',
245
+ lg: '1024px',
246
+ xl: '1280px',
247
+ '2xl': '1536px'
248
+ },
249
+ border: {
250
+ radius: {
251
+ none: '0px',
252
+ xs: '0.125rem',
253
+ sm: '0.25rem',
254
+ md: '0.375rem',
255
+ lg: '0.5rem',
256
+ xl: '0.75rem',
257
+ '2xl': '1rem',
258
+ '3xl': '1.5rem',
259
+ full: '9999px'
260
+ }
261
+ },
262
+ size: {
263
+ 0: '0px',
264
+ 0.25: '0.0625rem',
265
+ 0.5: '0.125rem',
266
+ 1: '0.25rem',
267
+ 1.5: '0.375rem',
268
+ 2: '0.5rem',
269
+ 2.5: '0.625rem',
270
+ 3: '0.75rem',
271
+ 3.5: '0.875rem',
272
+ 4: '1rem',
273
+ 4.5: '1.125rem',
274
+ 5: '1.25rem',
275
+ 6: '1.5rem',
276
+ 7: '1.75rem',
277
+ 8: '2rem',
278
+ 9: '2.25rem',
279
+ 10: '2.5rem',
280
+ 11: '2.75rem',
281
+ 12: '3rem',
282
+ 14: '3.5rem',
283
+ 16: '4rem',
284
+ 20: '5rem',
285
+ 24: '6rem',
286
+ 28: '7rem',
287
+ 32: '8rem',
288
+ 36: '9rem',
289
+ 40: '10rem',
290
+ 44: '11rem',
291
+ 48: '12rem',
292
+ 52: '13rem',
293
+ 56: '14rem',
294
+ 60: '15rem',
295
+ 64: '16rem',
296
+ 72: '18rem',
297
+ 80: '20rem',
298
+ 96: '24rem'
299
+ },
300
+ shadow: Shadow,
301
+ zIndices: {
302
+ hide: -1,
303
+ auto: 'auto',
304
+ base: 0,
305
+ docked: 10,
306
+ dropdown: 1000,
307
+ sticky: 1100,
308
+ banner: 1200,
309
+ overlay: 1300,
310
+ modal: 1400,
311
+ popover: 1500,
312
+ skipLink: 1600,
313
+ toast: 1700,
314
+ tooltip: 1800
315
+ }
316
+ };
317
+
318
+ function getQueryStatusLabel(query) {
319
+ return query.state.fetchStatus === 'fetching' ? 'fetching' : !query.getObserversCount() ? 'inactive' : query.state.fetchStatus === 'paused' ? 'paused' : query.isStale() ? 'stale' : 'fresh';
320
+ }
321
+ function getSidedProp(prop, side) {
322
+ return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`;
323
+ }
324
+ function getQueryStatusColor({
325
+ queryState,
326
+ observerCount,
327
+ isStale
328
+ }) {
329
+ return queryState.fetchStatus === 'fetching' ? 'blue' : !observerCount ? 'gray' : queryState.fetchStatus === 'paused' ? 'purple' : isStale ? 'yellow' : 'green';
330
+ }
331
+ function getQueryStatusColorByLabel(label) {
332
+ return label === 'fresh' ? 'green' : label === 'stale' ? 'yellow' : label === 'paused' ? 'purple' : label === 'inactive' ? 'gray' : 'blue';
333
+ }
334
+
335
+ /**
336
+ * Displays a string regardless the type of the data
337
+ * @param {unknown} value Value to be stringified
338
+ * @param {boolean} beautify Formats json to multiline
339
+ */
340
+ const displayValue = (value, beautify = false) => {
341
+ const {
342
+ json
343
+ } = superjson.serialize(value);
344
+ return JSON.stringify(json, null, beautify ? 2 : undefined);
345
+ };
346
+
347
+ // Sorting functions
348
+
349
+ const getStatusRank = q => q.state.fetchStatus !== 'idle' ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
350
+ const queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash);
351
+ const dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1;
352
+ const statusAndDateSort = (a, b) => {
353
+ if (getStatusRank(a) === getStatusRank(b)) {
354
+ return dateSort(a, b);
355
+ }
356
+ return getStatusRank(a) > getStatusRank(b) ? 1 : -1;
357
+ };
358
+ const sortFns = {
359
+ status: statusAndDateSort,
360
+ 'query hash': queryHashSort,
361
+ 'last updated': dateSort
362
+ };
363
+ const convertRemToPixels = rem => {
364
+ return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
365
+ };
366
+
367
+ const _tmpl$$2 = /*#__PURE__*/web.template(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z" stroke="#98A2B3" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 4),
368
+ _tmpl$2$2 = /*#__PURE__*/web.template(`<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L5 5L9 1" stroke="#98A2B3" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 4),
369
+ _tmpl$3$2 = /*#__PURE__*/web.template(`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667" stroke="#98A2B3" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 4),
370
+ _tmpl$4$2 = /*#__PURE__*/web.template(`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333" stroke="#98A2B3" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 4),
371
+ _tmpl$5$2 = /*#__PURE__*/web.template(`<svg stroke="#98A2B3" fill="#98A2B3" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z"></path></svg>`, 6),
372
+ _tmpl$6$2 = /*#__PURE__*/web.template(`<svg stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z"></path></svg>`, 6),
373
+ _tmpl$7$2 = /*#__PURE__*/web.template(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z" stroke="#98A2B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z" stroke="#98A2B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 6),
374
+ _tmpl$8$1 = /*#__PURE__*/web.template(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path class="copier" d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="#98A2B3"></path></svg>`, 4),
375
+ _tmpl$9$1 = /*#__PURE__*/web.template(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z" stroke="#12B76A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 4),
376
+ _tmpl$10$1 = /*#__PURE__*/web.template(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z" stroke="#F04438" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>`, 4),
377
+ _tmpl$11$1 = /*#__PURE__*/web.template(`<svg version="1.0" viewBox="0 0 633 633"><linearGradient id="a" x1="-666.45" x2="-666.45" y1="163.28" y2="163.99" gradientTransform="matrix(633 0 0 633 422177 -103358)" gradientUnits="userSpaceOnUse"><stop stop-color="#6BDAFF" offset="0"></stop><stop stop-color="#F9FFB5" offset=".32"></stop><stop stop-color="#FFA770" offset=".71"></stop><stop stop-color="#FF7373" offset="1"></stop></linearGradient><circle cx="316.5" cy="316.5" r="316.5" fill="url(#a)"></circle><defs><filter id="am" x="-137.5" y="412" width="454" height="396.9" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="b" x="-137.5" y="412" width="454" height="396.9" maskUnits="userSpaceOnUse"><g filter="url(#am)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#b)"><ellipse cx="89.5" cy="610.5" rx="214.5" ry="186" fill="#015064" stroke="#00CFE2" stroke-width="25"></ellipse></g><defs><filter id="ah" x="316.5" y="412" width="454" height="396.9" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="k" x="316.5" y="412" width="454" height="396.9" maskUnits="userSpaceOnUse"><g filter="url(#ah)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#k)"><ellipse cx="543.5" cy="610.5" rx="214.5" ry="186" fill="#015064" stroke="#00CFE2" stroke-width="25"></ellipse></g><defs><filter id="ae" x="-137.5" y="450" width="454" height="396.9" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="j" x="-137.5" y="450" width="454" height="396.9" maskUnits="userSpaceOnUse"><g filter="url(#ae)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#j)"><ellipse cx="89.5" cy="648.5" rx="214.5" ry="186" fill="#015064" stroke="#00A8B8" stroke-width="25"></ellipse></g><defs><filter id="ai" x="316.5" y="450" width="454" height="396.9" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="i" x="316.5" y="450" width="454" height="396.9" maskUnits="userSpaceOnUse"><g filter="url(#ai)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#i)"><ellipse cx="543.5" cy="648.5" rx="214.5" ry="186" fill="#015064" stroke="#00A8B8" stroke-width="25"></ellipse></g><defs><filter id="aj" x="-137.5" y="486" width="454" height="396.9" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="h" x="-137.5" y="486" width="454" height="396.9" maskUnits="userSpaceOnUse"><g filter="url(#aj)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#h)"><ellipse cx="89.5" cy="684.5" rx="214.5" ry="186" fill="#015064" stroke="#007782" stroke-width="25"></ellipse></g><defs><filter id="ag" x="316.5" y="486" width="454" height="396.9" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="g" x="316.5" y="486" width="454" height="396.9" maskUnits="userSpaceOnUse"><g filter="url(#ag)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#g)"><ellipse cx="543.5" cy="684.5" rx="214.5" ry="186" fill="#015064" stroke="#007782" stroke-width="25"></ellipse></g><defs><filter id="af" x="272.2" y="308" width="176.9" height="129.3" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="f" x="272.2" y="308" width="176.9" height="129.3" maskUnits="userSpaceOnUse"><g filter="url(#af)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#f)"><line x1="436" x2="431" y1="403.2" y2="431.8" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="11"></line><line x1="291" x2="280" y1="341.5" y2="403.5" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="11"></line><line x1="332.9" x2="328.6" y1="384.1" y2="411.2" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="11"></line><linearGradient id="m" x1="-670.75" x2="-671.59" y1="164.4" y2="164.49" gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)" gradientUnits="userSpaceOnUse"><stop stop-color="#EE2700" offset="0"></stop><stop stop-color="#FF008E" offset="1"></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z" clip-rule="evenodd" fill="url(#m)" fill-rule="evenodd"></path><line x1="428.2" x2="429.1" y1="384.5" y2="378" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="7"></line><line x1="395.2" x2="396.1" y1="379.5" y2="373" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="7"></line><line x1="362.2" x2="363.1" y1="373.5" y2="367.4" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="7"></line><line x1="324.2" x2="328.4" y1="351.3" y2="347.4" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="7"></line><line x1="303.2" x2="307.4" y1="331.3" y2="327.4" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="7"></line></g><defs><filter id="ak" x="73.2" y="113.8" width="280.6" height="317.4" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="e" x="73.2" y="113.8" width="280.6" height="317.4" maskUnits="userSpaceOnUse"><g filter="url(#ak)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#e)"><linearGradient id="n" x1="-672.16" x2="-672.16" y1="165.03" y2="166.03" gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)" gradientUnits="userSpaceOnUse"><stop stop-color="#A17500" offset="0"></stop><stop stop-color="#5D2100" offset="1"></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6" clip-rule="evenodd" fill="url(#n)" fill-rule="evenodd"></path><g stroke="#2F8A00"><linearGradient id="r" x1="-660.23" x2="-660.23" y1="166.72" y2="167.72" gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)" gradientUnits="userSpaceOnUse"><stop stop-color="#2F8A00" offset="0"></stop><stop stop-color="#90FF57" offset="1"></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z" clip-rule="evenodd" fill="url(#r)" fill-rule="evenodd" stroke-width="13"></path><linearGradient id="s" x1="-661.36" x2="-661.36" y1="164.18" y2="165.18" gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)" gradientUnits="userSpaceOnUse"><stop stop-color="#2F8A00" offset="0"></stop><stop stop-color="#90FF57" offset="1"></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z" clip-rule="evenodd" fill="url(#s)" fill-rule="evenodd" stroke-width="13"></path><linearGradient id="q" x1="-656.79" x2="-656.79" y1="165.15" y2="166.15" gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#2F8A00" offset="0"></stop><stop stop-color="#90FF57" offset="1"></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z" clip-rule="evenodd" fill="url(#q)" fill-rule="evenodd" stroke-width="13"></path><linearGradient id="p" x1="-663.07" x2="-663.07" y1="165.44" y2="166.44" gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)" gradientUnits="userSpaceOnUse"><stop stop-color="#2F8A00" offset="0"></stop><stop stop-color="#90FF57" offset="1"></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z" clip-rule="evenodd" fill="url(#p)" fill-rule="evenodd" stroke-width="13"></path><linearGradient id="o" x1="-662.57" x2="-662.57" y1="164.44" y2="165.44" gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)" gradientUnits="userSpaceOnUse"><stop stop-color="#2F8A00" offset="0"></stop><stop stop-color="#90FF57" offset="1"></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z" clip-rule="evenodd" fill="url(#o)" fill-rule="evenodd" stroke-width="13"></path><linearGradient id="l" x1="-656.43" x2="-656.43" y1="163.86" y2="164.86" gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)" gradientUnits="userSpaceOnUse"><stop stop-color="#2F8A00" offset="0"></stop><stop stop-color="#90FF57" offset="1"></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z" clip-rule="evenodd" fill="url(#l)" fill-rule="evenodd" stroke-width="13"></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1" fill="none" stroke-linecap="round" stroke-width="8"></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8" fill="none" stroke-linecap="round" stroke-width="8"></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9" fill="none" stroke-linecap="round" stroke-width="8"></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32" fill="none" stroke-linecap="round" stroke-width="8"></path></g></g><defs><filter id="al" x="50.5" y="399" width="532" height="633" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="d" x="50.5" y="399" width="532" height="633" maskUnits="userSpaceOnUse"><g filter="url(#al)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#d)"><linearGradient id="u" x1="-666.06" x2="-666.23" y1="163.36" y2="163.75" gradientTransform="matrix(532 0 0 633 354760 -102959)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFF400" offset="0"></stop><stop stop-color="#3C8700" offset="1"></stop></linearGradient><ellipse cx="316.5" cy="715.5" rx="266" ry="316.5" fill="url(#u)"></ellipse></g><defs><filter id="ad" x="391" y="-24" width="288" height="283" filterUnits="userSpaceOnUse"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask id="c" x="391" y="-24" width="288" height="283" maskUnits="userSpaceOnUse"><g filter="url(#ad)"><circle cx="316.5" cy="316.5" r="316.5" fill="#fff"></circle></g></mask><g mask="url(#c)"><linearGradient id="t" x1="-664.56" x2="-664.56" y1="163.79" y2="164.79" gradientTransform="matrix(227 0 0 227 151421 -37204)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFDF00" offset="0"></stop><stop stop-color="#FF9D00" offset="1"></stop></linearGradient><circle cx="565.5" cy="89.5" r="113.5" fill="url(#t)"></circle><linearGradient id="v" x1="-644.5" x2="-645.77" y1="342" y2="342" gradientTransform="matrix(30 0 0 1 19770 -253)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="427" x2="397" y1="89" y2="89" fill="none" stroke="url(#v)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="aa" x1="-641.56" x2="-642.83" y1="196.02" y2="196.07" gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="430.5" x2="404" y1="55.5" y2="50" fill="none" stroke="url(#aa)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="w" x1="-643.73" x2="-645" y1="185.83" y2="185.9" gradientTransform="matrix(29 0 0 8 19107 -1361)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="431" x2="402" y1="122" y2="130" fill="none" stroke="url(#w)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="ac" x1="-638.94" x2="-640.22" y1="177.09" y2="177.39" gradientTransform="matrix(24 0 0 13 15783 -2145)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="442" x2="418" y1="153" y2="166" fill="none" stroke="url(#ac)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="ab" x1="-633.42" x2="-634.7" y1="172.41" y2="173.31" gradientTransform="matrix(20 0 0 19 13137 -3096)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="464" x2="444" y1="180" y2="199" fill="none" stroke="url(#ab)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="y" x1="-619.05" x2="-619.52" y1="170.82" y2="171.82" gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="491.4" x2="477.5" y1="203" y2="225.9" fill="none" stroke="url(#y)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="x" x1="-578.5" x2="-578.63" y1="170.31" y2="171.31" gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="524.5" x2="517" y1="219.5" y2="244" fill="none" stroke="url(#x)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line><linearGradient id="z" x1="666.5" x2="666.5" y1="170.31" y2="171.31" gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFA400" offset="0"></stop><stop stop-color="#FF5E00" offset="1"></stop></linearGradient><line x1="564.5" x2="565" y1="228.5" y2="253" fill="none" stroke="url(#z)" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="12"></line></g></svg>`, 336);
378
+ function Search() {
379
+ return _tmpl$$2.cloneNode(true);
380
+ }
381
+ function ChevronDown() {
382
+ return _tmpl$2$2.cloneNode(true);
383
+ }
384
+ function ArrowUp() {
385
+ return _tmpl$3$2.cloneNode(true);
386
+ }
387
+ function ArrowDown() {
388
+ return _tmpl$4$2.cloneNode(true);
389
+ }
390
+ function Wifi() {
391
+ return _tmpl$5$2.cloneNode(true);
392
+ }
393
+ function Offline() {
394
+ return (() => {
395
+ const _el$6 = _tmpl$6$2.cloneNode(true);
396
+ web.effect(_p$ => {
397
+ const _v$ = tokens.colors.yellow[500],
398
+ _v$2 = tokens.colors.yellow[500];
399
+ _v$ !== _p$._v$ && web.setAttribute(_el$6, "stroke", _p$._v$ = _v$);
400
+ _v$2 !== _p$._v$2 && web.setAttribute(_el$6, "fill", _p$._v$2 = _v$2);
401
+ return _p$;
402
+ }, {
403
+ _v$: undefined,
404
+ _v$2: undefined
405
+ });
406
+ return _el$6;
407
+ })();
408
+ }
409
+ function Settings() {
410
+ return _tmpl$7$2.cloneNode(true);
411
+ }
412
+ function Copier() {
413
+ return _tmpl$8$1.cloneNode(true);
414
+ }
415
+ function CopiedCopier() {
416
+ return _tmpl$9$1.cloneNode(true);
417
+ }
418
+ function ErrorCopier() {
419
+ return _tmpl$10$1.cloneNode(true);
420
+ }
421
+ function TanstackLogo() {
422
+ return _tmpl$11$1.cloneNode(true);
423
+ }
424
+
425
+ const _tmpl$$1 = /*#__PURE__*/web.template(`<span><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L10 8L6 4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></span>`, 6),
426
+ _tmpl$2$1 = /*#__PURE__*/web.template(`<button></button>`, 2),
427
+ _tmpl$3$1 = /*#__PURE__*/web.template(`<button> <span></span> <span> </span></button>`, 6),
428
+ _tmpl$4$1 = /*#__PURE__*/web.template(`<div></div>`, 2),
429
+ _tmpl$5$1 = /*#__PURE__*/web.template(`<span>:</span>`, 2),
430
+ _tmpl$6$1 = /*#__PURE__*/web.template(`<span></span>`, 2),
431
+ _tmpl$7$1 = /*#__PURE__*/web.template(`<div><div><button> [<!>...<!>]</button></div></div>`, 8);
432
+
433
+ /**
434
+ * Chunk elements in the array by size
435
+ *
436
+ * when the array cannot be chunked evenly by size, the last chunk will be
437
+ * filled with the remaining elements
438
+ *
439
+ * @example
440
+ * chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']]
441
+ */
442
+ function chunkArray(array, size) {
443
+ if (size < 1) return [];
444
+ let i = 0;
445
+ const result = [];
446
+ while (i < array.length) {
447
+ result.push(array.slice(i, i + size));
448
+ i = i + size;
449
+ }
450
+ return result;
451
+ }
452
+ const Expander = props => {
453
+ const styles = getStyles$1();
454
+ return (() => {
455
+ const _el$ = _tmpl$$1.cloneNode(true);
456
+ web.effect(() => web.className(_el$, css.cx(styles.expander, css.css`
457
+ transform: rotate(${props.expanded ? 90 : 0}deg);
458
+ `)));
459
+ return _el$;
460
+ })();
461
+ };
462
+ const CopyButton = props => {
463
+ const styles = getStyles$1();
464
+ const [copyState, setCopyState] = solidJs.createSignal('NoCopy');
465
+ return (() => {
466
+ const _el$2 = _tmpl$2$1.cloneNode(true);
467
+ web.addEventListener(_el$2, "click", copyState() === 'NoCopy' ? () => {
468
+ navigator.clipboard.writeText(superjson.stringify(props.value)).then(() => {
469
+ setCopyState('SuccessCopy');
470
+ setTimeout(() => {
471
+ setCopyState('NoCopy');
472
+ }, 1500);
473
+ }, err => {
474
+ console.error('Failed to copy: ', err);
475
+ setCopyState('ErrorCopy');
476
+ setTimeout(() => {
477
+ setCopyState('NoCopy');
478
+ }, 1500);
479
+ });
480
+ } : undefined, true);
481
+ web.insert(_el$2, web.createComponent(solidJs.Switch, {
482
+ get children() {
483
+ return [web.createComponent(solidJs.Match, {
484
+ get when() {
485
+ return copyState() === 'NoCopy';
486
+ },
487
+ get children() {
488
+ return web.createComponent(Copier, {});
489
+ }
490
+ }), web.createComponent(solidJs.Match, {
491
+ get when() {
492
+ return copyState() === 'SuccessCopy';
493
+ },
494
+ get children() {
495
+ return web.createComponent(CopiedCopier, {});
496
+ }
497
+ }), web.createComponent(solidJs.Match, {
498
+ get when() {
499
+ return copyState() === 'ErrorCopy';
500
+ },
501
+ get children() {
502
+ return web.createComponent(ErrorCopier, {});
503
+ }
504
+ })];
505
+ }
506
+ }));
507
+ web.effect(_p$ => {
508
+ const _v$ = styles.copyButton,
509
+ _v$2 = `${copyState() === 'NoCopy' ? 'Copy object to clipboard' : copyState() === 'SuccessCopy' ? 'Object copied to clipboard' : 'Error copying object to clipboard'}`;
510
+ _v$ !== _p$._v$ && web.className(_el$2, _p$._v$ = _v$);
511
+ _v$2 !== _p$._v$2 && web.setAttribute(_el$2, "aria-label", _p$._v$2 = _v$2);
512
+ return _p$;
513
+ }, {
514
+ _v$: undefined,
515
+ _v$2: undefined
516
+ });
517
+ return _el$2;
518
+ })();
519
+ };
520
+ function isIterable(x) {
521
+ return Symbol.iterator in x;
522
+ }
523
+ function Explorer(props) {
524
+ const styles = getStyles$1();
525
+ const [expanded, setExpanded] = solidJs.createSignal((props.defaultExpanded || []).includes(props.label));
526
+ const toggleExpanded = () => setExpanded(old => !old);
527
+ const [expandedPages, setExpandedPages] = solidJs.createSignal([]);
528
+ const subEntries = solidJs.createMemo(() => {
529
+ if (Array.isArray(props.value)) {
530
+ return props.value.map((d, i) => ({
531
+ label: i.toString(),
532
+ value: d
533
+ }));
534
+ } else if (props.value !== null && typeof props.value === 'object' && isIterable(props.value) && typeof props.value[Symbol.iterator] === 'function') {
535
+ if (props.value instanceof Map) {
536
+ return Array.from(props.value, ([key, val]) => ({
537
+ label: key,
538
+ value: val
539
+ }));
540
+ }
541
+ return Array.from(props.value, (val, i) => ({
542
+ label: i.toString(),
543
+ value: val
544
+ }));
545
+ } else if (typeof props.value === 'object' && props.value !== null) {
546
+ return Object.entries(props.value).map(([key, val]) => ({
547
+ label: key,
548
+ value: val
549
+ }));
550
+ }
551
+ return [];
552
+ });
553
+ const type = solidJs.createMemo(() => {
554
+ if (Array.isArray(props.value)) {
555
+ return 'array';
556
+ } else if (props.value !== null && typeof props.value === 'object' && isIterable(props.value) && typeof props.value[Symbol.iterator] === 'function') {
557
+ return 'Iterable';
558
+ } else if (typeof props.value === 'object' && props.value !== null) {
559
+ return 'object';
560
+ }
561
+ return typeof props.value;
562
+ });
563
+ const subEntryPages = solidJs.createMemo(() => chunkArray(subEntries(), 100));
564
+ return (() => {
565
+ const _el$3 = _tmpl$4$1.cloneNode(true);
566
+ web.insert(_el$3, web.createComponent(solidJs.Show, {
567
+ get when() {
568
+ return subEntryPages().length;
569
+ },
570
+ get children() {
571
+ return [(() => {
572
+ const _el$4 = _tmpl$3$1.cloneNode(true),
573
+ _el$5 = _el$4.firstChild,
574
+ _el$6 = _el$5.nextSibling,
575
+ _el$7 = _el$6.nextSibling,
576
+ _el$8 = _el$7.nextSibling,
577
+ _el$9 = _el$8.firstChild;
578
+ _el$4.$$click = () => toggleExpanded();
579
+ web.insert(_el$4, web.createComponent(Expander, {
580
+ get expanded() {
581
+ return expanded();
582
+ }
583
+ }), _el$5);
584
+ web.insert(_el$6, () => props.label);
585
+ web.insert(_el$8, () => String(type()).toLowerCase() === 'iterable' ? '(Iterable) ' : '', _el$9);
586
+ web.insert(_el$8, () => subEntries().length, _el$9);
587
+ web.insert(_el$8, () => subEntries().length > 1 ? `items` : `item`, null);
588
+ web.effect(_p$ => {
589
+ const _v$3 = styles.expanderButton,
590
+ _v$4 = styles.info;
591
+ _v$3 !== _p$._v$3 && web.className(_el$4, _p$._v$3 = _v$3);
592
+ _v$4 !== _p$._v$4 && web.className(_el$8, _p$._v$4 = _v$4);
593
+ return _p$;
594
+ }, {
595
+ _v$3: undefined,
596
+ _v$4: undefined
597
+ });
598
+ return _el$4;
599
+ })(), web.createComponent(solidJs.Show, {
600
+ get when() {
601
+ return props.copyable;
602
+ },
603
+ get children() {
604
+ return web.createComponent(CopyButton, {
605
+ get value() {
606
+ return props.value;
607
+ }
608
+ });
609
+ }
610
+ }), web.createComponent(solidJs.Show, {
611
+ get when() {
612
+ return expanded();
613
+ },
614
+ get children() {
615
+ return [web.createComponent(solidJs.Show, {
616
+ get when() {
617
+ return subEntryPages().length === 1;
618
+ },
619
+ get children() {
620
+ const _el$10 = _tmpl$4$1.cloneNode(true);
621
+ web.insert(_el$10, web.createComponent(keyed.Key, {
622
+ get each() {
623
+ return subEntries();
624
+ },
625
+ by: item => item.label,
626
+ children: entry => {
627
+ return web.createComponent(Explorer, {
628
+ get defaultExpanded() {
629
+ return props.defaultExpanded;
630
+ },
631
+ get label() {
632
+ return entry().label;
633
+ },
634
+ get value() {
635
+ return entry().value;
636
+ },
637
+ get copyable() {
638
+ return props.copyable;
639
+ }
640
+ });
641
+ }
642
+ }));
643
+ web.effect(() => web.className(_el$10, styles.subEntry));
644
+ return _el$10;
645
+ }
646
+ }), web.createComponent(solidJs.Show, {
647
+ get when() {
648
+ return subEntryPages().length > 1;
649
+ },
650
+ get children() {
651
+ const _el$11 = _tmpl$4$1.cloneNode(true);
652
+ web.insert(_el$11, web.createComponent(solidJs.Index, {
653
+ get each() {
654
+ return subEntryPages();
655
+ },
656
+ children: (entries, index) => (() => {
657
+ const _el$15 = _tmpl$7$1.cloneNode(true),
658
+ _el$16 = _el$15.firstChild,
659
+ _el$17 = _el$16.firstChild,
660
+ _el$18 = _el$17.firstChild,
661
+ _el$22 = _el$18.nextSibling,
662
+ _el$20 = _el$22.nextSibling,
663
+ _el$23 = _el$20.nextSibling;
664
+ _el$23.nextSibling;
665
+ _el$17.$$click = () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index]);
666
+ web.insert(_el$17, web.createComponent(Expander, {
667
+ get expanded() {
668
+ return expandedPages().includes(index);
669
+ }
670
+ }), _el$18);
671
+ web.insert(_el$17, index * 100, _el$22);
672
+ web.insert(_el$17, index * 100 + 100 - 1, _el$23);
673
+ web.insert(_el$16, web.createComponent(solidJs.Show, {
674
+ get when() {
675
+ return expandedPages().includes(index);
676
+ },
677
+ get children() {
678
+ const _el$24 = _tmpl$4$1.cloneNode(true);
679
+ web.insert(_el$24, web.createComponent(keyed.Key, {
680
+ get each() {
681
+ return entries();
682
+ },
683
+ by: entry => entry.label,
684
+ children: entry => web.createComponent(Explorer, {
685
+ get defaultExpanded() {
686
+ return props.defaultExpanded;
687
+ },
688
+ get label() {
689
+ return entry().label;
690
+ },
691
+ get value() {
692
+ return entry().value;
693
+ },
694
+ get copyable() {
695
+ return props.copyable;
696
+ }
697
+ })
698
+ }));
699
+ web.effect(() => web.className(_el$24, styles.subEntry));
700
+ return _el$24;
701
+ }
702
+ }), null);
703
+ web.effect(_p$ => {
704
+ const _v$5 = styles.entry,
705
+ _v$6 = styles.expanderButton;
706
+ _v$5 !== _p$._v$5 && web.className(_el$16, _p$._v$5 = _v$5);
707
+ _v$6 !== _p$._v$6 && web.className(_el$17, _p$._v$6 = _v$6);
708
+ return _p$;
709
+ }, {
710
+ _v$5: undefined,
711
+ _v$6: undefined
712
+ });
713
+ return _el$15;
714
+ })()
715
+ }));
716
+ web.effect(() => web.className(_el$11, styles.subEntry));
717
+ return _el$11;
718
+ }
719
+ })];
720
+ }
721
+ })];
722
+ }
723
+ }), null);
724
+ web.insert(_el$3, web.createComponent(solidJs.Show, {
725
+ get when() {
726
+ return subEntryPages().length === 0;
727
+ },
728
+ get children() {
729
+ return [(() => {
730
+ const _el$12 = _tmpl$5$1.cloneNode(true),
731
+ _el$13 = _el$12.firstChild;
732
+ web.insert(_el$12, () => props.label, _el$13);
733
+ web.effect(() => web.className(_el$12, styles.label));
734
+ return _el$12;
735
+ })(), ' ', (() => {
736
+ const _el$14 = _tmpl$6$1.cloneNode(true);
737
+ web.insert(_el$14, () => displayValue(props.value));
738
+ web.effect(() => web.className(_el$14, styles.value));
739
+ return _el$14;
740
+ })()];
741
+ }
742
+ }), null);
743
+ web.effect(() => web.className(_el$3, styles.entry));
744
+ return _el$3;
745
+ })();
746
+ }
747
+ const getStyles$1 = () => {
748
+ const {
749
+ colors,
750
+ font,
751
+ size,
752
+ border
753
+ } = tokens;
754
+ return {
755
+ entry: css.css`
756
+ & * {
757
+ font-size: ${font.size.sm};
758
+ font-family: 'Menlo', 'Fira Code', monospace;
759
+ line-height: 1.7;
760
+ }
761
+ position: relative;
762
+ outline: none;
763
+ word-break: break-word;
764
+ `,
765
+ subEntry: css.css`
766
+ margin: 0 0 0 0.5em;
767
+ padding-left: 0.75em;
768
+ border-left: 2px solid ${colors.darkGray[400]};
769
+ `,
770
+ expander: css.css`
771
+ & path {
772
+ stroke: ${colors.gray[400]};
773
+ }
774
+ display: inline-flex;
775
+ align-items: center;
776
+ transition: all 0.1s ease;
777
+ `,
778
+ expanderButton: css.css`
779
+ cursor: pointer;
780
+ color: inherit;
781
+ font: inherit;
782
+ outline: inherit;
783
+ line-height: ${font.size.sm};
784
+ background: transparent;
785
+ border: none;
786
+ padding: 0;
787
+ display: inline-flex;
788
+ align-items: center;
789
+ gap: ${size[1]};
790
+
791
+ &:focus-visible {
792
+ border-radius: ${border.radius.xs};
793
+ outline: 2px solid ${colors.blue[800]};
794
+ }
795
+ `,
796
+ info: css.css`
797
+ color: ${colors.gray[500]};
798
+ font-size: ${font.size.xs};
799
+ line-height: ${font.size.xs};
800
+ margin-left: ${size[1]};
801
+ `,
802
+ label: css.css`
803
+ color: ${colors.gray[300]};
804
+ `,
805
+ value: css.css`
806
+ color: ${colors.purple[400]};
807
+ `,
808
+ copyButton: css.css`
809
+ background-color: transparent;
810
+ border: none;
811
+ display: inline-flex;
812
+ padding: 0px;
813
+ align-items: center;
814
+ justify-content: center;
815
+ cursor: pointer;
816
+ width: ${size[3.5]};
817
+ height: ${size[3.5]};
818
+ position: relative;
819
+ top: 4px;
820
+ left: ${size[2]};
821
+ z-index: 1;
822
+
823
+ &:hover svg .copier {
824
+ stroke: ${colors.gray[500]} !important;
825
+ }
826
+
827
+ &:focus-visible {
828
+ border-radius: ${border.radius.xs};
829
+ outline: 2px solid ${colors.blue[800]};
830
+ outline-offset: 2px;
831
+ }
832
+ `
833
+ };
834
+ };
835
+ web.delegateEvents(["click"]);
836
+
837
+ const QueryDevtoolsContext = solidJs.createContext({
838
+ client: undefined,
839
+ onlineManager: undefined,
840
+ queryFlavor: '',
841
+ version: ''
842
+ });
843
+ function useQueryDevtoolsContext() {
844
+ return solidJs.useContext(QueryDevtoolsContext);
845
+ }
846
+
847
+ const loadFonts = () => {
848
+ const link = document.createElement('link');
849
+ link.href = 'https://fonts.googleapis.com/css2?family=Fira+Code&family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Roboto&display=swap';
850
+ link.rel = 'stylesheet';
851
+ document.head.appendChild(link);
852
+ };
853
+
854
+ const _tmpl$ = /*#__PURE__*/web.template(`<div><div aria-hidden="true"></div><button aria-label="Open Tanstack query devtools"></button></div>`, 6),
855
+ _tmpl$2 = /*#__PURE__*/web.template(`<div></div>`, 2),
856
+ _tmpl$3 = /*#__PURE__*/web.template(`<span>Asc</span>`, 2),
857
+ _tmpl$4 = /*#__PURE__*/web.template(`<span>Desc</span>`, 2),
858
+ _tmpl$5 = /*#__PURE__*/web.template(`<div role="menu" tabindex="-1" aria-labelledby="TSQD-settings-menu-btn" id="TSQD-settings-menu"><div>Position</div><div><button aria-label="Position top"><span>Top</span></button><button aria-label="Position bottom"><span>Bottom</span></button><button aria-label="Position left"><span>Left</span></button><button aria-label="Position right"><span>Right</span></button></div></div>`, 22),
859
+ _tmpl$6 = /*#__PURE__*/web.template(`<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools"></button><div><div><button aria-label="Close Tanstack query devtools"><span>TANSTACK</span><span> v</span></button></div><div><div><div><input aria-label="Filter queries by query key" type="text" placeholder="Filter"></div><div><select></select></div><button></button></div><div><button></button><div><button id="TSQD-settings-menu-btn" aria-haspopup="true" aria-controls="TSQD-settings-menu"></button></div></div></div><div><div></div></div></div></aside>`, 41),
860
+ _tmpl$7 = /*#__PURE__*/web.template(`<option>Sort by </option>`, 2),
861
+ _tmpl$8 = /*#__PURE__*/web.template(`<div class="TSQDQueryDisabled">disabled</div>`, 2),
862
+ _tmpl$9 = /*#__PURE__*/web.template(`<button><div></div><code class="TSQDQueryHash"></code></button>`, 6),
863
+ _tmpl$10 = /*#__PURE__*/web.template(`<div role="tooltip" id="TSQD-status-tooltip"></div>`, 2),
864
+ _tmpl$11 = /*#__PURE__*/web.template(`<span></span>`, 2),
865
+ _tmpl$12 = /*#__PURE__*/web.template(`<button><span></span><span></span></button>`, 6),
866
+ _tmpl$13 = /*#__PURE__*/web.template(`<button><span></span> Error</button>`, 4),
867
+ _tmpl$14 = /*#__PURE__*/web.template(`<div><span></span>Trigger Error<select><option value="" disabled selected></option></select></div>`, 8),
868
+ _tmpl$15 = /*#__PURE__*/web.template(`<div><div>Query Details</div><div><div><pre><code></code></pre><span></span></div><div><span>Observers:</span><span></span></div><div><span>Last Updated:</span><span></span></div></div><div>Actions</div><div><button><span></span>Refetch</button><button><span></span>Invalidate</button><button><span></span>Reset</button><button><span></span> Loading</button></div><div>Data Explorer</div><div></div><div>Query Explorer</div><div></div></div>`, 54),
869
+ _tmpl$16 = /*#__PURE__*/web.template(`<option></option>`, 2);
870
+ const firstBreakpoint = 1024;
871
+ const secondBreakpoint = 796;
872
+ const thirdBreakpoint = 700;
873
+ const BUTTON_POSITION = 'bottom-right';
874
+ const POSITION = 'bottom';
875
+ const INITIAL_IS_OPEN = false;
876
+ const DEFAULT_HEIGHT = 500;
877
+ const DEFAULT_WIDTH = 500;
878
+ const DEFAULT_SORT_FN_NAME = Object.keys(sortFns)[0];
879
+ const DEFAULT_SORT_ORDER = 1;
880
+ const [selectedQueryHash, setSelectedQueryHash] = solidJs.createSignal(null);
881
+ const [panelWidth, setPanelWidth] = solidJs.createSignal(0);
882
+ const DevtoolsComponent = props => {
883
+ return web.createComponent(QueryDevtoolsContext.Provider, {
884
+ value: props,
885
+ get children() {
886
+ return web.createComponent(Devtools, {});
887
+ }
888
+ });
889
+ };
890
+ const Devtools = () => {
891
+ loadFonts();
892
+ const styles = getStyles();
893
+ const [localStore, setLocalStore] = storage.createLocalStorage({
894
+ prefix: 'TanstackQueryDevtools'
895
+ });
896
+ const buttonPosition = solidJs.createMemo(() => {
897
+ return useQueryDevtoolsContext().buttonPosition || BUTTON_POSITION;
898
+ });
899
+ const isOpen = solidJs.createMemo(() => {
900
+ return localStore.open === 'true' ? true : localStore.open === 'false' ? false : useQueryDevtoolsContext().initialIsOpen || INITIAL_IS_OPEN;
901
+ });
902
+ const position = solidJs.createMemo(() => {
903
+ return localStore.position || useQueryDevtoolsContext().position || POSITION;
904
+ });
905
+ return (() => {
906
+ const _el$ = _tmpl$2.cloneNode(true);
907
+ web.insert(_el$, web.createComponent(solidTransitionGroup.TransitionGroup, {
908
+ name: "TSQD-panel",
909
+ get children() {
910
+ return web.createComponent(solidJs.Show, {
911
+ get when() {
912
+ return isOpen();
913
+ },
914
+ get children() {
915
+ return web.createComponent(DevtoolsPanel, {
916
+ localStore: localStore,
917
+ setLocalStore: setLocalStore
918
+ });
919
+ }
920
+ });
921
+ }
922
+ }), null);
923
+ web.insert(_el$, web.createComponent(solidTransitionGroup.TransitionGroup, {
924
+ name: "TSQD-button",
925
+ get children() {
926
+ return web.createComponent(solidJs.Show, {
927
+ get when() {
928
+ return !isOpen();
929
+ },
930
+ get children() {
931
+ const _el$2 = _tmpl$.cloneNode(true),
932
+ _el$3 = _el$2.firstChild,
933
+ _el$4 = _el$3.nextSibling;
934
+ web.insert(_el$3, web.createComponent(TanstackLogo, {}));
935
+ _el$4.$$click = () => setLocalStore('open', 'true');
936
+ web.insert(_el$4, web.createComponent(TanstackLogo, {}));
937
+ web.effect(() => web.className(_el$2, css.cx(styles.devtoolsBtn, styles[`devtoolsBtn-position-${buttonPosition()}`])));
938
+ return _el$2;
939
+ }
940
+ });
941
+ }
942
+ }), null);
943
+ web.effect(() => web.className(_el$, css.css`
944
+ & .TSQD-panel-exit-active,
945
+ & .TSQD-panel-enter-active {
946
+ transition: opacity 0.3s, transform 0.3s;
947
+ }
948
+
949
+ & .TSQD-panel-exit-to,
950
+ & .TSQD-panel-enter {
951
+ ${position() === 'top' ? `transform: translateY(-${Number(localStore.height || DEFAULT_HEIGHT)}px);` : position() === 'left' ? `transform: translateX(-${Number(localStore.width || DEFAULT_WIDTH)}px);` : position() === 'right' ? `transform: translateX(${Number(localStore.width || DEFAULT_WIDTH)}px);` : `transform: translateY(${Number(localStore.height || DEFAULT_HEIGHT)}px);`}
952
+ }
953
+
954
+ & .TSQD-button-exit-active,
955
+ & .TSQD-button-enter-active {
956
+ transition: opacity 0.3s, transform 0.3s;
957
+ }
958
+
959
+ & .TSQD-button-exit-to,
960
+ & .TSQD-button-enter {
961
+ transform: ${buttonPosition() === 'top-left' ? `translateX(-72px);` : buttonPosition() === 'top-right' ? `translateX(72px);` : `translateY(72px);`};
962
+ }
963
+ `));
964
+ return _el$;
965
+ })();
966
+ };
967
+ const DevtoolsPanel = props => {
968
+ const styles = getStyles();
969
+ const [isResizing, setIsResizing] = solidJs.createSignal(false);
970
+ const sort = solidJs.createMemo(() => props.localStore.sort || DEFAULT_SORT_FN_NAME);
971
+ const sortOrder = solidJs.createMemo(() => Number(props.localStore.sortOrder) || DEFAULT_SORT_ORDER);
972
+ const [offline, setOffline] = solidJs.createSignal(false);
973
+ const [settingsOpen, setSettingsOpen] = solidJs.createSignal(false);
974
+ const position = solidJs.createMemo(() => props.localStore.position || useQueryDevtoolsContext().position || POSITION);
975
+ const sortFn = solidJs.createMemo(() => sortFns[sort()]);
976
+ const onlineManager = solidJs.createMemo(() => useQueryDevtoolsContext().onlineManager);
977
+ const cache = solidJs.createMemo(() => {
978
+ return useQueryDevtoolsContext().client.getQueryCache();
979
+ });
980
+ const queryCount = createSubscribeToQueryCacheBatcher(queryCache => {
981
+ return queryCache().getAll().length;
982
+ }, false);
983
+ const queries = solidJs.createMemo(solidJs.on(() => [queryCount(), props.localStore.filter, sort(), sortOrder()], () => {
984
+ const curr = cache().getAll();
985
+ const filtered = props.localStore.filter ? curr.filter(item => matchSorterUtils.rankItem(item.queryHash, props.localStore.filter || '').passed) : [...curr];
986
+ const sorted = sortFn() ? filtered.sort((a, b) => sortFn()(a, b) * sortOrder()) : filtered;
987
+ return sorted;
988
+ }));
989
+ const handleDragStart = event => {
990
+ const panelElement = event.currentTarget.parentElement;
991
+ if (!panelElement) return;
992
+ setIsResizing(true);
993
+ const {
994
+ height,
995
+ width
996
+ } = panelElement.getBoundingClientRect();
997
+ const startX = event.clientX;
998
+ const startY = event.clientY;
999
+ let newSize = 0;
1000
+ const minHeight = convertRemToPixels(3.5);
1001
+ const minWidth = convertRemToPixels(12);
1002
+ const runDrag = moveEvent => {
1003
+ moveEvent.preventDefault();
1004
+ if (position() === 'left' || position() === 'right') {
1005
+ const valToAdd = position() === 'right' ? startX - moveEvent.clientX : moveEvent.clientX - startX;
1006
+ newSize = Math.round(width + valToAdd);
1007
+ if (newSize < minWidth) {
1008
+ newSize = minWidth;
1009
+ }
1010
+ props.setLocalStore('width', String(Math.round(newSize)));
1011
+ const newWidth = panelElement.getBoundingClientRect().width;
1012
+ // If the panel size didn't decrease, this means we have reached the minimum width
1013
+ // of the panel so we restore the original width in local storage
1014
+ // Restoring the width helps in smooth open/close transitions
1015
+ if (Number(props.localStore.width) < newWidth) {
1016
+ props.setLocalStore('width', String(newWidth));
1017
+ }
1018
+ } else {
1019
+ const valToAdd = position() === 'bottom' ? startY - moveEvent.clientY : moveEvent.clientY - startY;
1020
+ newSize = Math.round(height + valToAdd);
1021
+ // If the panel size is less than the minimum height,
1022
+ // we set the size to the minimum height
1023
+ if (newSize < minHeight) {
1024
+ newSize = minHeight;
1025
+ setSelectedQueryHash(null);
1026
+ }
1027
+ props.setLocalStore('height', String(Math.round(newSize)));
1028
+ }
1029
+ };
1030
+ const unsub = () => {
1031
+ if (isResizing()) {
1032
+ setIsResizing(false);
1033
+ }
1034
+ document.removeEventListener('mousemove', runDrag, false);
1035
+ document.removeEventListener('mouseUp', unsub, false);
1036
+ };
1037
+ document.addEventListener('mousemove', runDrag, false);
1038
+ document.addEventListener('mouseup', unsub, false);
1039
+ };
1040
+ setupQueryCacheSubscription();
1041
+ let queriesContainerRef;
1042
+ let panelRef;
1043
+ solidJs.onMount(() => {
1044
+ resizeObserver.createResizeObserver(panelRef, ({
1045
+ width
1046
+ }, el) => {
1047
+ if (el === panelRef) {
1048
+ setPanelWidth(width);
1049
+ }
1050
+ });
1051
+ });
1052
+ const setDevtoolsPosition = pos => {
1053
+ props.setLocalStore('position', pos);
1054
+ setSettingsOpen(false);
1055
+ };
1056
+ solidJs.createEffect(() => {
1057
+ const rootContainer = panelRef.parentElement?.parentElement?.parentElement;
1058
+ if (!rootContainer) return;
1059
+ const styleProp = getSidedProp('padding', props.localStore.position);
1060
+ const isVertical = props.localStore.position === 'left' || props.localStore.position === 'right';
1061
+ const previousPaddings = (({
1062
+ padding,
1063
+ paddingTop,
1064
+ paddingBottom,
1065
+ paddingLeft,
1066
+ paddingRight
1067
+ }) => ({
1068
+ padding,
1069
+ paddingTop,
1070
+ paddingBottom,
1071
+ paddingLeft,
1072
+ paddingRight
1073
+ }))(rootContainer.style);
1074
+ rootContainer.style[styleProp] = `${isVertical ? props.localStore.width : props.localStore.height}px`;
1075
+ solidJs.onCleanup(() => {
1076
+ Object.entries(previousPaddings).forEach(([property, previousValue]) => {
1077
+ rootContainer.style[property] = previousValue;
1078
+ });
1079
+ });
1080
+ });
1081
+ return (() => {
1082
+ const _el$5 = _tmpl$6.cloneNode(true),
1083
+ _el$6 = _el$5.firstChild,
1084
+ _el$7 = _el$6.nextSibling,
1085
+ _el$8 = _el$7.nextSibling,
1086
+ _el$9 = _el$8.firstChild,
1087
+ _el$10 = _el$9.firstChild,
1088
+ _el$11 = _el$10.firstChild,
1089
+ _el$12 = _el$11.nextSibling,
1090
+ _el$13 = _el$12.firstChild,
1091
+ _el$14 = _el$9.nextSibling,
1092
+ _el$15 = _el$14.firstChild,
1093
+ _el$16 = _el$15.firstChild,
1094
+ _el$17 = _el$16.firstChild,
1095
+ _el$18 = _el$16.nextSibling,
1096
+ _el$19 = _el$18.firstChild,
1097
+ _el$20 = _el$18.nextSibling,
1098
+ _el$23 = _el$15.nextSibling,
1099
+ _el$24 = _el$23.firstChild,
1100
+ _el$25 = _el$24.nextSibling,
1101
+ _el$26 = _el$25.firstChild,
1102
+ _el$38 = _el$14.nextSibling,
1103
+ _el$39 = _el$38.firstChild;
1104
+ const _ref$ = panelRef;
1105
+ typeof _ref$ === "function" ? web.use(_ref$, _el$5) : panelRef = _el$5;
1106
+ _el$6.$$mousedown = handleDragStart;
1107
+ _el$7.$$click = () => props.setLocalStore('open', 'false');
1108
+ web.insert(_el$7, web.createComponent(ChevronDown, {}));
1109
+ const _ref$2 = queriesContainerRef;
1110
+ typeof _ref$2 === "function" ? web.use(_ref$2, _el$8) : queriesContainerRef = _el$8;
1111
+ _el$10.$$click = () => props.setLocalStore('open', 'false');
1112
+ web.insert(_el$12, () => useQueryDevtoolsContext().queryFlavor, _el$13);
1113
+ web.insert(_el$12, () => useQueryDevtoolsContext().version, null);
1114
+ web.insert(_el$9, web.createComponent(QueryStatusCount, {}), null);
1115
+ web.insert(_el$16, web.createComponent(Search, {}), _el$17);
1116
+ _el$17.$$input = e => props.setLocalStore('filter', e.currentTarget.value);
1117
+ _el$19.addEventListener("change", e => props.setLocalStore('sort', e.currentTarget.value));
1118
+ web.insert(_el$19, () => Object.keys(sortFns).map(key => (() => {
1119
+ const _el$40 = _tmpl$7.cloneNode(true);
1120
+ _el$40.firstChild;
1121
+ _el$40.value = key;
1122
+ web.insert(_el$40, key, null);
1123
+ return _el$40;
1124
+ })()));
1125
+ web.insert(_el$18, web.createComponent(ChevronDown, {}), null);
1126
+ _el$20.$$click = () => {
1127
+ props.setLocalStore('sortOrder', String(sortOrder() * -1));
1128
+ };
1129
+ web.insert(_el$20, web.createComponent(solidJs.Show, {
1130
+ get when() {
1131
+ return sortOrder() === 1;
1132
+ },
1133
+ get children() {
1134
+ return [_tmpl$3.cloneNode(true), web.createComponent(ArrowUp, {})];
1135
+ }
1136
+ }), null);
1137
+ web.insert(_el$20, web.createComponent(solidJs.Show, {
1138
+ get when() {
1139
+ return sortOrder() === -1;
1140
+ },
1141
+ get children() {
1142
+ return [_tmpl$4.cloneNode(true), web.createComponent(ArrowDown, {})];
1143
+ }
1144
+ }), null);
1145
+ _el$24.$$click = () => {
1146
+ if (offline()) {
1147
+ onlineManager().setOnline(undefined);
1148
+ setOffline(false);
1149
+ window.dispatchEvent(new Event('online'));
1150
+ } else {
1151
+ onlineManager().setOnline(false);
1152
+ setOffline(true);
1153
+ window.dispatchEvent(new Event('offline'));
1154
+ }
1155
+ };
1156
+ web.insert(_el$24, (() => {
1157
+ const _c$ = web.memo(() => !!offline());
1158
+ return () => _c$() ? web.createComponent(Offline, {}) : web.createComponent(Wifi, {});
1159
+ })());
1160
+ _el$25.style.setProperty("position", "relative");
1161
+ _el$26.$$click = () => setSettingsOpen(prev => !prev);
1162
+ web.insert(_el$26, web.createComponent(Settings, {}));
1163
+ web.insert(_el$25, web.createComponent(solidJs.Show, {
1164
+ get when() {
1165
+ return settingsOpen();
1166
+ },
1167
+ get children() {
1168
+ const _el$27 = _tmpl$5.cloneNode(true),
1169
+ _el$28 = _el$27.firstChild,
1170
+ _el$29 = _el$28.nextSibling,
1171
+ _el$30 = _el$29.firstChild,
1172
+ _el$31 = _el$30.firstChild,
1173
+ _el$32 = _el$30.nextSibling,
1174
+ _el$33 = _el$32.firstChild,
1175
+ _el$34 = _el$32.nextSibling,
1176
+ _el$35 = _el$34.firstChild,
1177
+ _el$36 = _el$34.nextSibling,
1178
+ _el$37 = _el$36.firstChild;
1179
+ _el$30.$$click = () => {
1180
+ setDevtoolsPosition('top');
1181
+ };
1182
+ web.insert(_el$30, web.createComponent(ArrowUp, {}), _el$31);
1183
+ _el$32.$$click = () => {
1184
+ setDevtoolsPosition('bottom');
1185
+ };
1186
+ web.insert(_el$32, web.createComponent(ArrowDown, {}), _el$33);
1187
+ _el$34.$$click = () => {
1188
+ setDevtoolsPosition('left');
1189
+ };
1190
+ web.insert(_el$34, web.createComponent(ArrowDown, {}), _el$35);
1191
+ _el$36.$$click = () => {
1192
+ setDevtoolsPosition('right');
1193
+ };
1194
+ web.insert(_el$36, web.createComponent(ArrowDown, {}), _el$37);
1195
+ web.effect(_p$ => {
1196
+ const _v$ = styles.settingsMenu,
1197
+ _v$2 = styles.settingsMenuHeader,
1198
+ _v$3 = styles.settingsMenuSection;
1199
+ _v$ !== _p$._v$ && web.className(_el$27, _p$._v$ = _v$);
1200
+ _v$2 !== _p$._v$2 && web.className(_el$28, _p$._v$2 = _v$2);
1201
+ _v$3 !== _p$._v$3 && web.className(_el$29, _p$._v$3 = _v$3);
1202
+ return _p$;
1203
+ }, {
1204
+ _v$: undefined,
1205
+ _v$2: undefined,
1206
+ _v$3: undefined
1207
+ });
1208
+ return _el$27;
1209
+ }
1210
+ }), null);
1211
+ web.insert(_el$39, web.createComponent(keyed.Key, {
1212
+ by: q => q.queryHash,
1213
+ get each() {
1214
+ return queries();
1215
+ },
1216
+ children: query => web.createComponent(QueryRow, {
1217
+ get query() {
1218
+ return query();
1219
+ }
1220
+ })
1221
+ }));
1222
+ web.insert(_el$5, web.createComponent(solidJs.Show, {
1223
+ get when() {
1224
+ return selectedQueryHash();
1225
+ },
1226
+ get children() {
1227
+ return web.createComponent(QueryDetails, {});
1228
+ }
1229
+ }), null);
1230
+ web.effect(_p$ => {
1231
+ const _v$4 = `${styles.panel} ${styles[`panel-position-${position()}`]} ${css.css`
1232
+ flex-direction: ${panelWidth() < secondBreakpoint ? 'column' : 'row'};
1233
+ background-color: ${panelWidth() < secondBreakpoint ? tokens.colors.gray[600] : tokens.colors.darkGray[900]};
1234
+ ${panelWidth() < thirdBreakpoint && (position() === 'right' || position() === 'left') ? `
1235
+ min-width: min-content;
1236
+ ` : ''}
1237
+ `}`,
1238
+ _v$5 = position() === 'bottom' || position() === 'top' ? `${props.localStore.height || DEFAULT_HEIGHT}px` : 'auto',
1239
+ _v$6 = position() === 'right' || position() === 'left' ? `${props.localStore.width || DEFAULT_WIDTH}px` : 'auto',
1240
+ _v$7 = css.cx(styles.dragHandle, styles[`dragHandle-position-${position()}`]),
1241
+ _v$8 = css.cx(styles.closeBtn, styles[`closeBtn-position-${position()}`]),
1242
+ _v$9 = `${styles.queriesContainer} ${css.css`
1243
+ ${panelWidth() < secondBreakpoint && selectedQueryHash() ? `
1244
+ height: 50%;
1245
+ max-height: 50%;
1246
+ ` : ''}
1247
+ `}`,
1248
+ _v$10 = css.cx(styles.row),
1249
+ _v$11 = styles.logo,
1250
+ _v$12 = styles.tanstackLogo,
1251
+ _v$13 = styles.queryFlavorLogo,
1252
+ _v$14 = css.cx(styles.row, css.css`
1253
+ gap: ${tokens.size[2.5]};
1254
+ `),
1255
+ _v$15 = styles.filtersContainer,
1256
+ _v$16 = styles.filterInput,
1257
+ _v$17 = styles.filterSelect,
1258
+ _v$18 = `Sort order ${sortOrder() === -1 ? 'descending' : 'ascending'}`,
1259
+ _v$19 = sortOrder() === -1,
1260
+ _v$20 = styles.actionsContainer,
1261
+ _v$21 = styles.actionsBtn,
1262
+ _v$22 = `${offline() ? 'Unset offline mocking behavior' : 'Mock offline behavior'}`,
1263
+ _v$23 = offline(),
1264
+ _v$24 = styles.actionsBtn,
1265
+ _v$25 = `${settingsOpen() ? 'Close' : 'Open'} settings menu`,
1266
+ _v$26 = styles.overflowQueryContainer;
1267
+ _v$4 !== _p$._v$4 && web.className(_el$5, _p$._v$4 = _v$4);
1268
+ _v$5 !== _p$._v$5 && _el$5.style.setProperty("height", _p$._v$5 = _v$5);
1269
+ _v$6 !== _p$._v$6 && _el$5.style.setProperty("width", _p$._v$6 = _v$6);
1270
+ _v$7 !== _p$._v$7 && web.className(_el$6, _p$._v$7 = _v$7);
1271
+ _v$8 !== _p$._v$8 && web.className(_el$7, _p$._v$8 = _v$8);
1272
+ _v$9 !== _p$._v$9 && web.className(_el$8, _p$._v$9 = _v$9);
1273
+ _v$10 !== _p$._v$10 && web.className(_el$9, _p$._v$10 = _v$10);
1274
+ _v$11 !== _p$._v$11 && web.className(_el$10, _p$._v$11 = _v$11);
1275
+ _v$12 !== _p$._v$12 && web.className(_el$11, _p$._v$12 = _v$12);
1276
+ _v$13 !== _p$._v$13 && web.className(_el$12, _p$._v$13 = _v$13);
1277
+ _v$14 !== _p$._v$14 && web.className(_el$14, _p$._v$14 = _v$14);
1278
+ _v$15 !== _p$._v$15 && web.className(_el$15, _p$._v$15 = _v$15);
1279
+ _v$16 !== _p$._v$16 && web.className(_el$16, _p$._v$16 = _v$16);
1280
+ _v$17 !== _p$._v$17 && web.className(_el$18, _p$._v$17 = _v$17);
1281
+ _v$18 !== _p$._v$18 && web.setAttribute(_el$20, "aria-label", _p$._v$18 = _v$18);
1282
+ _v$19 !== _p$._v$19 && web.setAttribute(_el$20, "aria-pressed", _p$._v$19 = _v$19);
1283
+ _v$20 !== _p$._v$20 && web.className(_el$23, _p$._v$20 = _v$20);
1284
+ _v$21 !== _p$._v$21 && web.className(_el$24, _p$._v$21 = _v$21);
1285
+ _v$22 !== _p$._v$22 && web.setAttribute(_el$24, "aria-label", _p$._v$22 = _v$22);
1286
+ _v$23 !== _p$._v$23 && web.setAttribute(_el$24, "aria-pressed", _p$._v$23 = _v$23);
1287
+ _v$24 !== _p$._v$24 && web.className(_el$26, _p$._v$24 = _v$24);
1288
+ _v$25 !== _p$._v$25 && web.setAttribute(_el$26, "aria-label", _p$._v$25 = _v$25);
1289
+ _v$26 !== _p$._v$26 && web.className(_el$38, _p$._v$26 = _v$26);
1290
+ return _p$;
1291
+ }, {
1292
+ _v$4: undefined,
1293
+ _v$5: undefined,
1294
+ _v$6: undefined,
1295
+ _v$7: undefined,
1296
+ _v$8: undefined,
1297
+ _v$9: undefined,
1298
+ _v$10: undefined,
1299
+ _v$11: undefined,
1300
+ _v$12: undefined,
1301
+ _v$13: undefined,
1302
+ _v$14: undefined,
1303
+ _v$15: undefined,
1304
+ _v$16: undefined,
1305
+ _v$17: undefined,
1306
+ _v$18: undefined,
1307
+ _v$19: undefined,
1308
+ _v$20: undefined,
1309
+ _v$21: undefined,
1310
+ _v$22: undefined,
1311
+ _v$23: undefined,
1312
+ _v$24: undefined,
1313
+ _v$25: undefined,
1314
+ _v$26: undefined
1315
+ });
1316
+ web.effect(() => _el$17.value = props.localStore.filter || '');
1317
+ web.effect(() => _el$19.value = sort());
1318
+ return _el$5;
1319
+ })();
1320
+ };
1321
+ const QueryRow = props => {
1322
+ const styles = getStyles();
1323
+ const queryState = createSubscribeToQueryCacheBatcher(queryCache => queryCache().find({
1324
+ queryKey: props.query.queryKey
1325
+ })?.state);
1326
+ const isDisabled = createSubscribeToQueryCacheBatcher(queryCache => queryCache().find({
1327
+ queryKey: props.query.queryKey
1328
+ })?.isDisabled() ?? false);
1329
+ const isStale = createSubscribeToQueryCacheBatcher(queryCache => queryCache().find({
1330
+ queryKey: props.query.queryKey
1331
+ })?.isStale() ?? false);
1332
+ const observers = createSubscribeToQueryCacheBatcher(queryCache => queryCache().find({
1333
+ queryKey: props.query.queryKey
1334
+ })?.getObserversCount() ?? 0);
1335
+ const color = solidJs.createMemo(() => getQueryStatusColor({
1336
+ queryState: queryState(),
1337
+ observerCount: observers(),
1338
+ isStale: isStale()
1339
+ }));
1340
+ return web.createComponent(solidJs.Show, {
1341
+ get when() {
1342
+ return queryState();
1343
+ },
1344
+ get children() {
1345
+ const _el$42 = _tmpl$9.cloneNode(true),
1346
+ _el$43 = _el$42.firstChild,
1347
+ _el$44 = _el$43.nextSibling;
1348
+ _el$42.$$click = () => setSelectedQueryHash(props.query.queryHash === selectedQueryHash() ? null : props.query.queryHash);
1349
+ web.insert(_el$43, observers);
1350
+ web.insert(_el$44, () => props.query.queryHash);
1351
+ web.insert(_el$42, web.createComponent(solidJs.Show, {
1352
+ get when() {
1353
+ return isDisabled();
1354
+ },
1355
+ get children() {
1356
+ return _tmpl$8.cloneNode(true);
1357
+ }
1358
+ }), null);
1359
+ web.effect(_p$ => {
1360
+ const _v$27 = css.cx(styles.queryRow, selectedQueryHash() === props.query.queryHash && styles.selectedQueryRow),
1361
+ _v$28 = `Query key ${props.query.queryHash}`,
1362
+ _v$29 = css.cx('TSQDObserverCount', color() === 'gray' ? css.css`
1363
+ background-color: ${tokens.colors[color()][700]};
1364
+ color: ${tokens.colors[color()][300]};
1365
+ ` : css.css`
1366
+ background-color: ${tokens.colors[color()][900]};
1367
+ color: ${tokens.colors[color()][300]} !important;
1368
+ `);
1369
+ _v$27 !== _p$._v$27 && web.className(_el$42, _p$._v$27 = _v$27);
1370
+ _v$28 !== _p$._v$28 && web.setAttribute(_el$42, "aria-label", _p$._v$28 = _v$28);
1371
+ _v$29 !== _p$._v$29 && web.className(_el$43, _p$._v$29 = _v$29);
1372
+ return _p$;
1373
+ }, {
1374
+ _v$27: undefined,
1375
+ _v$28: undefined,
1376
+ _v$29: undefined
1377
+ });
1378
+ return _el$42;
1379
+ }
1380
+ });
1381
+ };
1382
+ const QueryStatusCount = () => {
1383
+ const stale = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().filter(q => getQueryStatusLabel(q) === 'stale').length);
1384
+ const fresh = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().filter(q => getQueryStatusLabel(q) === 'fresh').length);
1385
+ const fetching = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().filter(q => getQueryStatusLabel(q) === 'fetching').length);
1386
+ const paused = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().filter(q => getQueryStatusLabel(q) === 'paused').length);
1387
+ const inactive = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().filter(q => getQueryStatusLabel(q) === 'inactive').length);
1388
+ const styles = getStyles();
1389
+ return (() => {
1390
+ const _el$46 = _tmpl$2.cloneNode(true);
1391
+ web.insert(_el$46, web.createComponent(QueryStatus, {
1392
+ label: "Fresh",
1393
+ color: "green",
1394
+ get count() {
1395
+ return fresh();
1396
+ }
1397
+ }), null);
1398
+ web.insert(_el$46, web.createComponent(QueryStatus, {
1399
+ label: "Fetching",
1400
+ color: "blue",
1401
+ get count() {
1402
+ return fetching();
1403
+ }
1404
+ }), null);
1405
+ web.insert(_el$46, web.createComponent(QueryStatus, {
1406
+ label: "Paused",
1407
+ color: "purple",
1408
+ get count() {
1409
+ return paused();
1410
+ }
1411
+ }), null);
1412
+ web.insert(_el$46, web.createComponent(QueryStatus, {
1413
+ label: "Stale",
1414
+ color: "yellow",
1415
+ get count() {
1416
+ return stale();
1417
+ }
1418
+ }), null);
1419
+ web.insert(_el$46, web.createComponent(QueryStatus, {
1420
+ label: "Inactive",
1421
+ color: "gray",
1422
+ get count() {
1423
+ return inactive();
1424
+ }
1425
+ }), null);
1426
+ web.effect(() => web.className(_el$46, styles.queryStatusContainer));
1427
+ return _el$46;
1428
+ })();
1429
+ };
1430
+ const QueryStatus = props => {
1431
+ const styles = getStyles();
1432
+ let tagRef;
1433
+ const [mouseOver, setMouseOver] = solidJs.createSignal(false);
1434
+ const [focused, setFocused] = solidJs.createSignal(false);
1435
+ const showLabel = solidJs.createMemo(() => {
1436
+ if (selectedQueryHash()) {
1437
+ if (panelWidth() < firstBreakpoint && panelWidth() > secondBreakpoint) {
1438
+ return false;
1439
+ }
1440
+ }
1441
+ if (panelWidth() < thirdBreakpoint) {
1442
+ return false;
1443
+ }
1444
+ return true;
1445
+ });
1446
+ return (() => {
1447
+ const _el$47 = _tmpl$12.cloneNode(true),
1448
+ _el$49 = _el$47.firstChild,
1449
+ _el$51 = _el$49.nextSibling;
1450
+ const _ref$3 = tagRef;
1451
+ typeof _ref$3 === "function" ? web.use(_ref$3, _el$47) : tagRef = _el$47;
1452
+ _el$47.addEventListener("mouseleave", () => {
1453
+ setMouseOver(false);
1454
+ setFocused(false);
1455
+ });
1456
+ _el$47.addEventListener("mouseenter", () => setMouseOver(true));
1457
+ _el$47.addEventListener("blur", () => setFocused(false));
1458
+ _el$47.addEventListener("focus", () => setFocused(true));
1459
+ web.spread(_el$47, web.mergeProps({
1460
+ get disabled() {
1461
+ return showLabel();
1462
+ },
1463
+ get ["class"]() {
1464
+ return css.cx(styles.queryStatusTag, !showLabel() ? css.css`
1465
+ cursor: pointer;
1466
+ &:hover {
1467
+ background: ${tokens.colors.darkGray[400]}${tokens.alpha[80]};
1468
+ }
1469
+ ` : null);
1470
+ }
1471
+ }, () => mouseOver() || focused() ? {
1472
+ 'aria-describedby': 'TSQD-status-tooltip'
1473
+ } : {}), false, true);
1474
+ web.insert(_el$47, web.createComponent(solidJs.Show, {
1475
+ get when() {
1476
+ return web.memo(() => !!!showLabel())() && (mouseOver() || focused());
1477
+ },
1478
+ get children() {
1479
+ const _el$48 = _tmpl$10.cloneNode(true);
1480
+ web.insert(_el$48, () => props.label);
1481
+ web.effect(() => web.className(_el$48, css.cx(styles.statusTooltip)));
1482
+ return _el$48;
1483
+ }
1484
+ }), _el$49);
1485
+ web.insert(_el$47, web.createComponent(solidJs.Show, {
1486
+ get when() {
1487
+ return showLabel();
1488
+ },
1489
+ get children() {
1490
+ const _el$50 = _tmpl$11.cloneNode(true);
1491
+ web.insert(_el$50, () => props.label);
1492
+ return _el$50;
1493
+ }
1494
+ }), _el$51);
1495
+ web.insert(_el$51, () => props.count);
1496
+ web.effect(_p$ => {
1497
+ const _v$30 = css.css`
1498
+ width: ${tokens.size[2]};
1499
+ height: ${tokens.size[2]};
1500
+ border-radius: ${tokens.border.radius.full};
1501
+ background-color: ${tokens.colors[props.color][500]};
1502
+ `,
1503
+ _v$31 = css.cx(styles.queryStatusCount, props.count > 0 && props.color !== 'gray' ? css.css`
1504
+ background-color: ${tokens.colors[props.color][900]};
1505
+ color: ${tokens.colors[props.color][300]} !important;
1506
+ ` : css.css`
1507
+ color: ${tokens.colors['gray'][400]} !important;
1508
+ `);
1509
+ _v$30 !== _p$._v$30 && web.className(_el$49, _p$._v$30 = _v$30);
1510
+ _v$31 !== _p$._v$31 && web.className(_el$51, _p$._v$31 = _v$31);
1511
+ return _p$;
1512
+ }, {
1513
+ _v$30: undefined,
1514
+ _v$31: undefined
1515
+ });
1516
+ return _el$47;
1517
+ })();
1518
+ };
1519
+ const QueryDetails = () => {
1520
+ const styles = getStyles();
1521
+ const queryClient = useQueryDevtoolsContext().client;
1522
+ const [restoringLoading, setRestoringLoading] = solidJs.createSignal(false);
1523
+ const errorTypes = solidJs.createMemo(() => {
1524
+ return useQueryDevtoolsContext().errorTypes || [];
1525
+ });
1526
+ const activeQuery = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().find(query => query.queryHash === selectedQueryHash()), false);
1527
+ const activeQueryFresh = createSubscribeToQueryCacheBatcher(queryCache => {
1528
+ return queryCache().getAll().find(query => query.queryHash === selectedQueryHash());
1529
+ }, false);
1530
+ const activeQueryState = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().find(query => query.queryHash === selectedQueryHash())?.state, false);
1531
+ const activeQueryStateData = createSubscribeToQueryCacheBatcher(queryCache => {
1532
+ return queryCache().getAll().find(query => query.queryHash === selectedQueryHash())?.state.data;
1533
+ }, false);
1534
+ const statusLabel = createSubscribeToQueryCacheBatcher(queryCache => {
1535
+ const query = queryCache().getAll().find(q => q.queryHash === selectedQueryHash());
1536
+ if (!query) return 'inactive';
1537
+ return getQueryStatusLabel(query);
1538
+ });
1539
+ const queryStatus = createSubscribeToQueryCacheBatcher(queryCache => {
1540
+ const query = queryCache().getAll().find(q => q.queryHash === selectedQueryHash());
1541
+ if (!query) return 'pending';
1542
+ return query.state.status;
1543
+ });
1544
+ const observerCount = createSubscribeToQueryCacheBatcher(queryCache => queryCache().getAll().find(query => query.queryHash === selectedQueryHash())?.getObserversCount() ?? 0);
1545
+ const color = solidJs.createMemo(() => getQueryStatusColorByLabel(statusLabel()));
1546
+ const handleRefetch = () => {
1547
+ const promise = activeQuery()?.fetch();
1548
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1549
+ promise?.catch(() => {});
1550
+ };
1551
+ const triggerError = errorType => {
1552
+ const error = errorType?.initializer(activeQuery()) ?? new Error('Unknown error from devtools');
1553
+ const __previousQueryOptions = activeQuery().options;
1554
+ activeQuery().setState({
1555
+ status: 'error',
1556
+ error,
1557
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
1558
+ fetchMeta: {
1559
+ ...activeQuery().state.fetchMeta,
1560
+ __previousQueryOptions
1561
+ }
1562
+ });
1563
+ };
1564
+ const restoreQueryAfterLoadingOrError = () => {
1565
+ activeQuery()?.fetch((activeQuery()?.state.fetchMeta).__previousQueryOptions, {
1566
+ // Make sure this fetch will cancel the previous one
1567
+ cancelRefetch: true
1568
+ });
1569
+ };
1570
+ solidJs.createEffect(() => {
1571
+ if (statusLabel() !== 'fetching') {
1572
+ setRestoringLoading(false);
1573
+ }
1574
+ });
1575
+ return web.createComponent(solidJs.Show, {
1576
+ get when() {
1577
+ return web.memo(() => !!activeQuery())() && activeQueryState();
1578
+ },
1579
+ get children() {
1580
+ const _el$52 = _tmpl$15.cloneNode(true),
1581
+ _el$53 = _el$52.firstChild,
1582
+ _el$54 = _el$53.nextSibling,
1583
+ _el$55 = _el$54.firstChild,
1584
+ _el$56 = _el$55.firstChild,
1585
+ _el$57 = _el$56.firstChild,
1586
+ _el$58 = _el$56.nextSibling,
1587
+ _el$59 = _el$55.nextSibling,
1588
+ _el$60 = _el$59.firstChild,
1589
+ _el$61 = _el$60.nextSibling,
1590
+ _el$62 = _el$59.nextSibling,
1591
+ _el$63 = _el$62.firstChild,
1592
+ _el$64 = _el$63.nextSibling,
1593
+ _el$65 = _el$54.nextSibling,
1594
+ _el$66 = _el$65.nextSibling,
1595
+ _el$67 = _el$66.firstChild,
1596
+ _el$68 = _el$67.firstChild,
1597
+ _el$69 = _el$67.nextSibling,
1598
+ _el$70 = _el$69.firstChild,
1599
+ _el$71 = _el$69.nextSibling,
1600
+ _el$72 = _el$71.firstChild,
1601
+ _el$73 = _el$71.nextSibling,
1602
+ _el$74 = _el$73.firstChild,
1603
+ _el$75 = _el$74.nextSibling,
1604
+ _el$84 = _el$66.nextSibling,
1605
+ _el$85 = _el$84.nextSibling,
1606
+ _el$86 = _el$85.nextSibling,
1607
+ _el$87 = _el$86.nextSibling;
1608
+ web.insert(_el$57, () => displayValue(activeQuery().queryKey, true));
1609
+ web.insert(_el$58, statusLabel);
1610
+ web.insert(_el$61, observerCount);
1611
+ web.insert(_el$64, () => new Date(activeQueryState().dataUpdatedAt).toLocaleTimeString());
1612
+ _el$67.$$click = handleRefetch;
1613
+ _el$69.$$click = () => queryClient.invalidateQueries(activeQuery());
1614
+ _el$71.$$click = () => queryClient.resetQueries(activeQuery());
1615
+ _el$73.$$click = () => {
1616
+ if (activeQuery()?.state.data === undefined) {
1617
+ setRestoringLoading(true);
1618
+ restoreQueryAfterLoadingOrError();
1619
+ } else {
1620
+ const activeQueryVal = activeQuery();
1621
+ if (!activeQueryVal) return;
1622
+ const __previousQueryOptions = activeQueryVal.options;
1623
+ // Trigger a fetch in order to trigger suspense as well.
1624
+ activeQueryVal.fetch({
1625
+ ...__previousQueryOptions,
1626
+ queryFn: () => {
1627
+ return new Promise(() => {
1628
+ // Never resolve
1629
+ });
1630
+ },
1631
+ gcTime: -1
1632
+ });
1633
+ activeQueryVal.setState({
1634
+ data: undefined,
1635
+ status: 'pending',
1636
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
1637
+ fetchMeta: {
1638
+ ...activeQueryVal.state.fetchMeta,
1639
+ __previousQueryOptions
1640
+ }
1641
+ });
1642
+ }
1643
+ };
1644
+ web.insert(_el$73, () => statusLabel() === 'fetching' ? 'Restore' : 'Trigger', _el$75);
1645
+ web.insert(_el$66, web.createComponent(solidJs.Show, {
1646
+ get when() {
1647
+ return errorTypes().length === 0 || queryStatus() === 'error';
1648
+ },
1649
+ get children() {
1650
+ const _el$76 = _tmpl$13.cloneNode(true),
1651
+ _el$77 = _el$76.firstChild,
1652
+ _el$78 = _el$77.nextSibling;
1653
+ _el$76.$$click = () => {
1654
+ if (!activeQuery().state.error) {
1655
+ triggerError();
1656
+ } else {
1657
+ queryClient.resetQueries(activeQuery());
1658
+ }
1659
+ };
1660
+ web.insert(_el$76, () => queryStatus() === 'error' ? 'Restore' : 'Trigger', _el$78);
1661
+ web.effect(_p$ => {
1662
+ const _v$32 = css.css`
1663
+ color: ${tokens.colors.red[400]};
1664
+ `,
1665
+ _v$33 = css.css`
1666
+ background-color: ${tokens.colors.red[400]};
1667
+ `;
1668
+ _v$32 !== _p$._v$32 && web.className(_el$76, _p$._v$32 = _v$32);
1669
+ _v$33 !== _p$._v$33 && web.className(_el$77, _p$._v$33 = _v$33);
1670
+ return _p$;
1671
+ }, {
1672
+ _v$32: undefined,
1673
+ _v$33: undefined
1674
+ });
1675
+ return _el$76;
1676
+ }
1677
+ }), null);
1678
+ web.insert(_el$66, web.createComponent(solidJs.Show, {
1679
+ get when() {
1680
+ return !(errorTypes().length === 0 || queryStatus() === 'error');
1681
+ },
1682
+ get children() {
1683
+ const _el$79 = _tmpl$14.cloneNode(true),
1684
+ _el$80 = _el$79.firstChild,
1685
+ _el$81 = _el$80.nextSibling,
1686
+ _el$82 = _el$81.nextSibling;
1687
+ _el$82.firstChild;
1688
+ _el$82.addEventListener("change", e => {
1689
+ const errorType = errorTypes().find(t => t.name === e.currentTarget.value);
1690
+ triggerError(errorType);
1691
+ });
1692
+ web.insert(_el$82, web.createComponent(solidJs.For, {
1693
+ get each() {
1694
+ return errorTypes();
1695
+ },
1696
+ children: errorType => (() => {
1697
+ const _el$88 = _tmpl$16.cloneNode(true);
1698
+ web.insert(_el$88, () => errorType.name);
1699
+ web.effect(() => _el$88.value = errorType.name);
1700
+ return _el$88;
1701
+ })()
1702
+ }), null);
1703
+ web.insert(_el$79, web.createComponent(ChevronDown, {}), null);
1704
+ web.effect(_p$ => {
1705
+ const _v$34 = styles.actionsSelect,
1706
+ _v$35 = css.css`
1707
+ background-color: ${tokens.colors.red[400]};
1708
+ `,
1709
+ _v$36 = queryStatus() === 'pending';
1710
+ _v$34 !== _p$._v$34 && web.className(_el$79, _p$._v$34 = _v$34);
1711
+ _v$35 !== _p$._v$35 && web.className(_el$80, _p$._v$35 = _v$35);
1712
+ _v$36 !== _p$._v$36 && (_el$82.disabled = _p$._v$36 = _v$36);
1713
+ return _p$;
1714
+ }, {
1715
+ _v$34: undefined,
1716
+ _v$35: undefined,
1717
+ _v$36: undefined
1718
+ });
1719
+ return _el$79;
1720
+ }
1721
+ }), null);
1722
+ _el$85.style.setProperty("padding", "0.5rem");
1723
+ web.insert(_el$85, web.createComponent(Explorer, {
1724
+ label: "Data",
1725
+ defaultExpanded: ['Data'],
1726
+ get value() {
1727
+ return activeQueryStateData();
1728
+ },
1729
+ copyable: true
1730
+ }));
1731
+ _el$87.style.setProperty("padding", "0.5rem");
1732
+ web.insert(_el$87, web.createComponent(Explorer, {
1733
+ label: "Query",
1734
+ defaultExpanded: ['Query', 'queryKey'],
1735
+ get value() {
1736
+ return activeQueryFresh();
1737
+ }
1738
+ }));
1739
+ web.effect(_p$ => {
1740
+ const _v$37 = styles.detailsContainer,
1741
+ _v$38 = styles.detailsHeader,
1742
+ _v$39 = styles.detailsBody,
1743
+ _v$40 = css.cx(styles.queryDetailsStatus, color() === 'gray' ? css.css`
1744
+ background-color: ${tokens.colors[color()][700]};
1745
+ color: ${tokens.colors[color()][300]};
1746
+ border-color: ${tokens.colors[color()][600]};
1747
+ ` : css.css`
1748
+ background-color: ${tokens.colors[color()][900]};
1749
+ color: ${tokens.colors[color()][300]};
1750
+ border-color: ${tokens.colors[color()][600]};
1751
+ `),
1752
+ _v$41 = styles.detailsHeader,
1753
+ _v$42 = styles.actionsBody,
1754
+ _v$43 = css.css`
1755
+ color: ${tokens.colors.blue[400]};
1756
+ `,
1757
+ _v$44 = statusLabel() === 'fetching',
1758
+ _v$45 = css.css`
1759
+ background-color: ${tokens.colors.blue[400]};
1760
+ `,
1761
+ _v$46 = css.css`
1762
+ color: ${tokens.colors.yellow[400]};
1763
+ `,
1764
+ _v$47 = css.css`
1765
+ background-color: ${tokens.colors.yellow[400]};
1766
+ `,
1767
+ _v$48 = css.css`
1768
+ color: ${tokens.colors.gray[300]};
1769
+ `,
1770
+ _v$49 = css.css`
1771
+ background-color: ${tokens.colors.gray[400]};
1772
+ `,
1773
+ _v$50 = css.css`
1774
+ color: ${tokens.colors.cyan[400]};
1775
+ `,
1776
+ _v$51 = restoringLoading(),
1777
+ _v$52 = css.css`
1778
+ background-color: ${tokens.colors.cyan[400]};
1779
+ `,
1780
+ _v$53 = styles.detailsHeader,
1781
+ _v$54 = styles.detailsHeader;
1782
+ _v$37 !== _p$._v$37 && web.className(_el$52, _p$._v$37 = _v$37);
1783
+ _v$38 !== _p$._v$38 && web.className(_el$53, _p$._v$38 = _v$38);
1784
+ _v$39 !== _p$._v$39 && web.className(_el$54, _p$._v$39 = _v$39);
1785
+ _v$40 !== _p$._v$40 && web.className(_el$58, _p$._v$40 = _v$40);
1786
+ _v$41 !== _p$._v$41 && web.className(_el$65, _p$._v$41 = _v$41);
1787
+ _v$42 !== _p$._v$42 && web.className(_el$66, _p$._v$42 = _v$42);
1788
+ _v$43 !== _p$._v$43 && web.className(_el$67, _p$._v$43 = _v$43);
1789
+ _v$44 !== _p$._v$44 && (_el$67.disabled = _p$._v$44 = _v$44);
1790
+ _v$45 !== _p$._v$45 && web.className(_el$68, _p$._v$45 = _v$45);
1791
+ _v$46 !== _p$._v$46 && web.className(_el$69, _p$._v$46 = _v$46);
1792
+ _v$47 !== _p$._v$47 && web.className(_el$70, _p$._v$47 = _v$47);
1793
+ _v$48 !== _p$._v$48 && web.className(_el$71, _p$._v$48 = _v$48);
1794
+ _v$49 !== _p$._v$49 && web.className(_el$72, _p$._v$49 = _v$49);
1795
+ _v$50 !== _p$._v$50 && web.className(_el$73, _p$._v$50 = _v$50);
1796
+ _v$51 !== _p$._v$51 && (_el$73.disabled = _p$._v$51 = _v$51);
1797
+ _v$52 !== _p$._v$52 && web.className(_el$74, _p$._v$52 = _v$52);
1798
+ _v$53 !== _p$._v$53 && web.className(_el$84, _p$._v$53 = _v$53);
1799
+ _v$54 !== _p$._v$54 && web.className(_el$86, _p$._v$54 = _v$54);
1800
+ return _p$;
1801
+ }, {
1802
+ _v$37: undefined,
1803
+ _v$38: undefined,
1804
+ _v$39: undefined,
1805
+ _v$40: undefined,
1806
+ _v$41: undefined,
1807
+ _v$42: undefined,
1808
+ _v$43: undefined,
1809
+ _v$44: undefined,
1810
+ _v$45: undefined,
1811
+ _v$46: undefined,
1812
+ _v$47: undefined,
1813
+ _v$48: undefined,
1814
+ _v$49: undefined,
1815
+ _v$50: undefined,
1816
+ _v$51: undefined,
1817
+ _v$52: undefined,
1818
+ _v$53: undefined,
1819
+ _v$54: undefined
1820
+ });
1821
+ return _el$52;
1822
+ }
1823
+ });
1824
+ };
1825
+ const signalsMap = new Map();
1826
+ const setupQueryCacheSubscription = () => {
1827
+ const queryCache = solidJs.createMemo(() => {
1828
+ const client = useQueryDevtoolsContext().client;
1829
+ return client.getQueryCache();
1830
+ });
1831
+ const unsub = queryCache().subscribe(() => {
1832
+ for (const [callback, setter] of signalsMap.entries()) {
1833
+ queueMicrotask(() => {
1834
+ setter(callback(queryCache));
1835
+ });
1836
+ }
1837
+ });
1838
+ solidJs.onCleanup(() => {
1839
+ signalsMap.clear();
1840
+ unsub();
1841
+ });
1842
+ return unsub;
1843
+ };
1844
+ const createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
1845
+ const queryCache = solidJs.createMemo(() => {
1846
+ const client = useQueryDevtoolsContext().client;
1847
+ return client.getQueryCache();
1848
+ });
1849
+ const [value, setValue] = solidJs.createSignal(callback(queryCache), !equalityCheck ? {
1850
+ equals: false
1851
+ } : undefined);
1852
+ solidJs.createEffect(() => {
1853
+ setValue(callback(queryCache));
1854
+ });
1855
+
1856
+ // @ts-ignore
1857
+ signalsMap.set(callback, setValue);
1858
+ solidJs.onCleanup(() => {
1859
+ // @ts-ignore
1860
+ signalsMap.delete(callback);
1861
+ });
1862
+ return value;
1863
+ };
1864
+ const getStyles = () => {
1865
+ const {
1866
+ colors,
1867
+ font,
1868
+ size,
1869
+ alpha,
1870
+ shadow,
1871
+ border
1872
+ } = tokens;
1873
+ return {
1874
+ devtoolsBtn: css.css`
1875
+ z-index: 100000;
1876
+ position: fixed;
1877
+ padding: 4px;
1878
+
1879
+ display: flex;
1880
+ align-items: center;
1881
+ justify-content: center;
1882
+ border-radius: 9999px;
1883
+ box-shadow: ${shadow.md()};
1884
+ overflow: hidden;
1885
+
1886
+ & div {
1887
+ position: absolute;
1888
+ top: -8px;
1889
+ left: -8px;
1890
+ right: -8px;
1891
+ bottom: -8px;
1892
+ border-radius: 9999px;
1893
+
1894
+ & svg {
1895
+ position: absolute;
1896
+ width: 100%;
1897
+ height: 100%;
1898
+ }
1899
+ filter: blur(6px) saturate(1.2) contrast(1.1);
1900
+ }
1901
+
1902
+ &:focus-within {
1903
+ outline-offset: 2px;
1904
+ outline: 3px solid ${colors.green[600]};
1905
+ }
1906
+
1907
+ & button {
1908
+ position: relative;
1909
+ z-index: 1;
1910
+ padding: 0;
1911
+ border-radius: 9999px;
1912
+ background-color: transparent;
1913
+ border: none;
1914
+ height: 40px;
1915
+ display: flex;
1916
+ width: 40px;
1917
+ overflow: hidden;
1918
+ cursor: pointer;
1919
+ outline: none;
1920
+ & svg {
1921
+ position: absolute;
1922
+ width: 100%;
1923
+ height: 100%;
1924
+ }
1925
+ }
1926
+ `,
1927
+ panel: css.css`
1928
+ position: fixed;
1929
+ z-index: 9999;
1930
+ display: flex;
1931
+ gap: ${tokens.size[0.5]};
1932
+ & * {
1933
+ font-family: 'Inter', sans-serif;
1934
+ color: ${colors.gray[300]};
1935
+ box-sizing: border-box;
1936
+ text-transform: none;
1937
+ }
1938
+ `,
1939
+ 'devtoolsBtn-position-bottom-right': css.css`
1940
+ bottom: 12px;
1941
+ right: 12px;
1942
+ `,
1943
+ 'devtoolsBtn-position-bottom-left': css.css`
1944
+ bottom: 12px;
1945
+ left: 12px;
1946
+ `,
1947
+ 'devtoolsBtn-position-top-left': css.css`
1948
+ top: 12px;
1949
+ left: 12px;
1950
+ `,
1951
+ 'devtoolsBtn-position-top-right': css.css`
1952
+ top: 12px;
1953
+ right: 12px;
1954
+ `,
1955
+ 'panel-position-top': css.css`
1956
+ top: 0;
1957
+ right: 0;
1958
+ left: 0;
1959
+ max-height: 90%;
1960
+ min-height: 3.5rem;
1961
+ border-bottom: ${colors.darkGray[300]} 1px solid;
1962
+ `,
1963
+ 'panel-position-bottom': css.css`
1964
+ bottom: 0;
1965
+ right: 0;
1966
+ left: 0;
1967
+ max-height: 90%;
1968
+ min-height: 3.5rem;
1969
+ border-top: ${colors.darkGray[300]} 1px solid;
1970
+ `,
1971
+ 'panel-position-right': css.css`
1972
+ bottom: 0;
1973
+ right: 0;
1974
+ top: 0;
1975
+ border-left: ${colors.darkGray[300]} 1px solid;
1976
+ max-width: 90%;
1977
+ `,
1978
+ 'panel-position-left': css.css`
1979
+ bottom: 0;
1980
+ left: 0;
1981
+ top: 0;
1982
+ border-right: ${colors.darkGray[300]} 1px solid;
1983
+ max-width: 90%;
1984
+ `,
1985
+ closeBtn: css.css`
1986
+ position: absolute;
1987
+ cursor: pointer;
1988
+ z-index: 5;
1989
+ display: flex;
1990
+ align-items: center;
1991
+ justify-content: center;
1992
+ outline: none;
1993
+ &:hover {
1994
+ background-color: ${colors.darkGray[500]};
1995
+ }
1996
+ &:focus-visible {
1997
+ outline: 2px solid ${colors.blue[600]};
1998
+ }
1999
+ `,
2000
+ 'closeBtn-position-top': css.css`
2001
+ bottom: 0;
2002
+ right: ${size[3]};
2003
+ transform: translate(0, 100%);
2004
+ background-color: ${colors.darkGray[700]};
2005
+ border-right: ${colors.darkGray[300]} 1px solid;
2006
+ border-left: ${colors.darkGray[300]} 1px solid;
2007
+ border-top: none;
2008
+ border-bottom: ${colors.darkGray[300]} 1px solid;
2009
+ border-radius: 0px 0px ${border.radius.sm} ${border.radius.sm};
2010
+ padding: ${size[1.5]} ${size[2.5]} ${size[2]} ${size[2.5]};
2011
+
2012
+ &::after {
2013
+ content: ' ';
2014
+ position: absolute;
2015
+ bottom: 100%;
2016
+ left: -${size[2.5]};
2017
+ height: ${size[1.5]};
2018
+ width: calc(100% + ${size[5]});
2019
+ }
2020
+
2021
+ & svg {
2022
+ transform: rotate(180deg);
2023
+ }
2024
+ `,
2025
+ 'closeBtn-position-bottom': css.css`
2026
+ top: 0;
2027
+ right: ${size[3]};
2028
+ transform: translate(0, -100%);
2029
+ background-color: ${colors.darkGray[700]};
2030
+ border-right: ${colors.darkGray[300]} 1px solid;
2031
+ border-left: ${colors.darkGray[300]} 1px solid;
2032
+ border-top: ${colors.darkGray[300]} 1px solid;
2033
+ border-bottom: none;
2034
+ border-radius: ${border.radius.sm} ${border.radius.sm} 0px 0px;
2035
+ padding: ${size[2]} ${size[2.5]} ${size[1.5]} ${size[2.5]};
2036
+
2037
+ &::after {
2038
+ content: ' ';
2039
+ position: absolute;
2040
+ top: 100%;
2041
+ left: -${size[2.5]};
2042
+ height: ${size[1.5]};
2043
+ width: calc(100% + ${size[5]});
2044
+ }
2045
+ `,
2046
+ 'closeBtn-position-right': css.css`
2047
+ bottom: ${size[3]};
2048
+ left: 0;
2049
+ transform: translate(-100%, 0);
2050
+ background-color: ${colors.darkGray[700]};
2051
+ border-right: none;
2052
+ border-left: ${colors.darkGray[300]} 1px solid;
2053
+ border-top: ${colors.darkGray[300]} 1px solid;
2054
+ border-bottom: ${colors.darkGray[300]} 1px solid;
2055
+ border-radius: ${border.radius.sm} 0px 0px ${border.radius.sm};
2056
+ padding: ${size[2.5]} ${size[1]} ${size[2.5]} ${size[1.5]};
2057
+
2058
+ &::after {
2059
+ content: ' ';
2060
+ position: absolute;
2061
+ left: 100%;
2062
+ height: calc(100% + ${size[5]});
2063
+ width: ${size[1.5]};
2064
+ }
2065
+
2066
+ & svg {
2067
+ transform: rotate(-90deg);
2068
+ }
2069
+ `,
2070
+ 'closeBtn-position-left': css.css`
2071
+ bottom: ${size[3]};
2072
+ right: 0;
2073
+ transform: translate(100%, 0);
2074
+ background-color: ${colors.darkGray[700]};
2075
+ border-left: none;
2076
+ border-right: ${colors.darkGray[300]} 1px solid;
2077
+ border-top: ${colors.darkGray[300]} 1px solid;
2078
+ border-bottom: ${colors.darkGray[300]} 1px solid;
2079
+ border-radius: 0px ${border.radius.sm} ${border.radius.sm} 0px;
2080
+ padding: ${size[2.5]} ${size[1.5]} ${size[2.5]} ${size[1]};
2081
+
2082
+ &::after {
2083
+ content: ' ';
2084
+ position: absolute;
2085
+ right: 100%;
2086
+ height: calc(100% + ${size[5]});
2087
+ width: ${size[1.5]};
2088
+ }
2089
+
2090
+ & svg {
2091
+ transform: rotate(90deg);
2092
+ }
2093
+ `,
2094
+ queriesContainer: css.css`
2095
+ flex: 1 1 700px;
2096
+ background-color: ${colors.darkGray[700]};
2097
+ display: flex;
2098
+ flex-direction: column;
2099
+ `,
2100
+ dragHandle: css.css`
2101
+ position: absolute;
2102
+ transition: background-color 0.125s ease;
2103
+ &:hover {
2104
+ background-color: ${colors.gray[400]}${alpha[90]};
2105
+ }
2106
+ z-index: 4;
2107
+ `,
2108
+ 'dragHandle-position-top': css.css`
2109
+ bottom: 0;
2110
+ width: 100%;
2111
+ height: ${tokens.size[1]};
2112
+ cursor: ns-resize;
2113
+ `,
2114
+ 'dragHandle-position-bottom': css.css`
2115
+ top: 0;
2116
+ width: 100%;
2117
+ height: ${tokens.size[1]};
2118
+ cursor: ns-resize;
2119
+ `,
2120
+ 'dragHandle-position-right': css.css`
2121
+ left: 0;
2122
+ width: ${tokens.size[1]};
2123
+ height: 100%;
2124
+ cursor: ew-resize;
2125
+ `,
2126
+ 'dragHandle-position-left': css.css`
2127
+ right: 0;
2128
+ width: ${tokens.size[1]};
2129
+ height: 100%;
2130
+ cursor: ew-resize;
2131
+ `,
2132
+ row: css.css`
2133
+ display: flex;
2134
+ justify-content: space-between;
2135
+ padding: ${tokens.size[2.5]} ${tokens.size[3]};
2136
+ gap: ${tokens.size[4]};
2137
+ border-bottom: ${colors.darkGray[500]} 1px solid;
2138
+ align-items: center;
2139
+ & > button {
2140
+ padding: 0;
2141
+ background: transparent;
2142
+ border: none;
2143
+ display: flex;
2144
+ flex-direction: column;
2145
+ }
2146
+ `,
2147
+ logo: css.css`
2148
+ cursor: pointer;
2149
+ &:hover {
2150
+ opacity: 0.7;
2151
+ }
2152
+ &:focus-visible {
2153
+ outline-offset: 4px;
2154
+ border-radius: ${border.radius.xs};
2155
+ outline: 2px solid ${colors.blue[800]};
2156
+ }
2157
+ `,
2158
+ tanstackLogo: css.css`
2159
+ font-size: ${font.size.lg};
2160
+ font-weight: ${font.weight.extrabold};
2161
+ line-height: ${font.lineHeight.sm};
2162
+ white-space: nowrap;
2163
+ `,
2164
+ queryFlavorLogo: css.css`
2165
+ font-weight: ${font.weight.semibold};
2166
+ font-size: ${font.size.sm};
2167
+ background: linear-gradient(to right, #dd524b, #e9a03b);
2168
+ background-clip: text;
2169
+ line-height: ${font.lineHeight.xs};
2170
+ -webkit-text-fill-color: transparent;
2171
+ white-space: nowrap;
2172
+ `,
2173
+ queryStatusContainer: css.css`
2174
+ display: flex;
2175
+ gap: ${tokens.size[2]};
2176
+ height: min-content;
2177
+ `,
2178
+ queryStatusTag: css.css`
2179
+ display: flex;
2180
+ gap: ${tokens.size[1.5]};
2181
+ background: ${colors.darkGray[500]};
2182
+ border-radius: ${tokens.border.radius.md};
2183
+ font-size: ${font.size.sm};
2184
+ padding: ${tokens.size[1]};
2185
+ padding-left: ${tokens.size[2.5]};
2186
+ align-items: center;
2187
+ line-height: ${font.lineHeight.md};
2188
+ font-weight: ${font.weight.medium};
2189
+ border: none;
2190
+ user-select: none;
2191
+ position: relative;
2192
+ &:focus-visible {
2193
+ outline-offset: 2px;
2194
+ outline: 2px solid ${colors.blue[800]};
2195
+ }
2196
+ & span:nth-child(2) {
2197
+ color: ${colors.gray[300]}${alpha[80]};
2198
+ }
2199
+ `,
2200
+ statusTooltip: css.css`
2201
+ position: absolute;
2202
+ z-index: 1;
2203
+ background-color: ${colors.darkGray[500]};
2204
+ top: 100%;
2205
+ left: 50%;
2206
+ transform: translate(-50%, calc(${tokens.size[2]}));
2207
+ padding: ${tokens.size[0.5]} ${tokens.size[3]};
2208
+ border-radius: ${tokens.border.radius.md};
2209
+ font-size: ${font.size.sm};
2210
+ border: 2px solid ${colors.gray[600]};
2211
+ color: ${tokens.colors['gray'][300]};
2212
+
2213
+ &::before {
2214
+ top: 0px;
2215
+ content: ' ';
2216
+ display: block;
2217
+ left: 50%;
2218
+ transform: translate(-50%, -100%);
2219
+ position: absolute;
2220
+ border-color: transparent transparent ${colors.gray[600]} transparent;
2221
+ border-style: solid;
2222
+ border-width: 7px;
2223
+ /* transform: rotate(180deg); */
2224
+ }
2225
+
2226
+ &::after {
2227
+ top: 0px;
2228
+ content: ' ';
2229
+ display: block;
2230
+ left: 50%;
2231
+ transform: translate(-50%, calc(-100% + 2.5px));
2232
+ position: absolute;
2233
+ border-color: transparent transparent ${colors.darkGray[500]}
2234
+ transparent;
2235
+ border-style: solid;
2236
+ border-width: 7px;
2237
+ }
2238
+ `,
2239
+ selectedQueryRow: css.css`
2240
+ background-color: ${colors.darkGray[500]};
2241
+ `,
2242
+ queryStatusCount: css.css`
2243
+ padding: 0 8px;
2244
+ display: flex;
2245
+ align-items: center;
2246
+ justify-content: center;
2247
+ color: ${colors.gray[400]};
2248
+ background-color: ${colors.darkGray[300]};
2249
+ border-radius: 3px;
2250
+ font-variant-numeric: tabular-nums;
2251
+ `,
2252
+ filtersContainer: css.css`
2253
+ display: flex;
2254
+ gap: ${tokens.size[2.5]};
2255
+ & > button {
2256
+ cursor: pointer;
2257
+ padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
2258
+ padding-right: ${tokens.size[1.5]};
2259
+ border-radius: ${tokens.border.radius.md};
2260
+ background-color: ${colors.darkGray[400]};
2261
+ font-size: ${font.size.sm};
2262
+ display: flex;
2263
+ align-items: center;
2264
+ line-height: ${font.lineHeight.sm};
2265
+ gap: ${tokens.size[1.5]};
2266
+ max-width: 160px;
2267
+ border: 1px solid ${colors.darkGray[200]};
2268
+ &:focus-visible {
2269
+ outline-offset: 2px;
2270
+ border-radius: ${border.radius.xs};
2271
+ outline: 2px solid ${colors.blue[800]};
2272
+ }
2273
+ }
2274
+ `,
2275
+ filterInput: css.css`
2276
+ padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
2277
+ border-radius: ${tokens.border.radius.md};
2278
+ background-color: ${colors.darkGray[400]};
2279
+ display: flex;
2280
+ box-sizing: content-box;
2281
+ align-items: center;
2282
+ gap: ${tokens.size[1.5]};
2283
+ max-width: 160px;
2284
+ min-width: 100px;
2285
+ border: 1px solid ${colors.darkGray[200]};
2286
+ height: min-content;
2287
+ & > svg {
2288
+ width: ${tokens.size[3.5]};
2289
+ height: ${tokens.size[3.5]};
2290
+ }
2291
+ & input {
2292
+ font-size: ${font.size.sm};
2293
+ width: 100%;
2294
+ background-color: ${colors.darkGray[400]};
2295
+ border: none;
2296
+ padding: 0;
2297
+ line-height: ${font.lineHeight.sm};
2298
+ color: ${colors.gray[300]};
2299
+ &::placeholder {
2300
+ color: ${colors.gray[300]};
2301
+ }
2302
+ &:focus {
2303
+ outline: none;
2304
+ }
2305
+ }
2306
+
2307
+ &:focus-within {
2308
+ outline-offset: 2px;
2309
+ border-radius: ${border.radius.xs};
2310
+ outline: 2px solid ${colors.blue[800]};
2311
+ }
2312
+ `,
2313
+ filterSelect: css.css`
2314
+ padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
2315
+ border-radius: ${tokens.border.radius.md};
2316
+ background-color: ${colors.darkGray[400]};
2317
+ display: flex;
2318
+ align-items: center;
2319
+ gap: ${tokens.size[1.5]};
2320
+ box-sizing: content-box;
2321
+ max-width: 160px;
2322
+ border: 1px solid ${colors.darkGray[200]};
2323
+ height: min-content;
2324
+ & > svg {
2325
+ width: ${tokens.size[3]};
2326
+ height: ${tokens.size[3]};
2327
+ }
2328
+ & > select {
2329
+ appearance: none;
2330
+ min-width: 100px;
2331
+ line-height: ${font.lineHeight.sm};
2332
+ font-size: ${font.size.sm};
2333
+ background-color: ${colors.darkGray[400]};
2334
+ border: none;
2335
+ &:focus {
2336
+ outline: none;
2337
+ }
2338
+ }
2339
+ &:focus-within {
2340
+ outline-offset: 2px;
2341
+ border-radius: ${border.radius.xs};
2342
+ outline: 2px solid ${colors.blue[800]};
2343
+ }
2344
+ `,
2345
+ actionsContainer: css.css`
2346
+ display: flex;
2347
+ gap: ${tokens.size[2.5]};
2348
+ `,
2349
+ actionsBtn: css.css`
2350
+ border-radius: ${tokens.border.radius.md};
2351
+ background-color: ${colors.darkGray[400]};
2352
+ width: 2.125rem; // 34px
2353
+ height: 2.125rem; // 34px
2354
+ justify-content: center;
2355
+ display: flex;
2356
+ align-items: center;
2357
+ gap: ${tokens.size[1.5]};
2358
+ max-width: 160px;
2359
+ border: 1px solid ${colors.darkGray[200]};
2360
+ cursor: pointer;
2361
+ &:hover {
2362
+ background-color: ${colors.darkGray[500]};
2363
+ }
2364
+ & svg {
2365
+ width: ${tokens.size[4]};
2366
+ height: ${tokens.size[4]};
2367
+ }
2368
+ &:focus-visible {
2369
+ outline-offset: 2px;
2370
+ border-radius: ${border.radius.xs};
2371
+ outline: 2px solid ${colors.blue[800]};
2372
+ }
2373
+ `,
2374
+ overflowQueryContainer: css.css`
2375
+ flex: 1;
2376
+ overflow-y: auto;
2377
+ & > div {
2378
+ display: flex;
2379
+ flex-direction: column;
2380
+ }
2381
+ `,
2382
+ queryRow: css.css`
2383
+ display: flex;
2384
+ align-items: center;
2385
+ padding: 0;
2386
+ background-color: inherit;
2387
+ border: none;
2388
+ cursor: pointer;
2389
+ &:focus-visible {
2390
+ outline-offset: -2px;
2391
+ border-radius: ${border.radius.xs};
2392
+ outline: 2px solid ${colors.blue[800]};
2393
+ }
2394
+ &:hover .TSQDQueryHash {
2395
+ background-color: ${colors.darkGray[600]};
2396
+ }
2397
+
2398
+ & .TSQDObserverCount {
2399
+ padding: 0 ${tokens.size[1]};
2400
+ user-select: none;
2401
+ min-width: ${tokens.size[8]};
2402
+ align-self: stretch !important;
2403
+ display: flex;
2404
+ align-items: center;
2405
+ justify-content: center;
2406
+ font-size: ${font.size.sm};
2407
+ font-weight: ${font.weight.medium};
2408
+ border-bottom: 1px solid ${colors.darkGray[700]};
2409
+ }
2410
+ & .TSQDQueryHash {
2411
+ user-select: text;
2412
+ font-size: ${font.size.sm};
2413
+ display: flex;
2414
+ align-items: center;
2415
+ min-height: ${tokens.size[8]};
2416
+ flex: 1;
2417
+ padding: ${tokens.size[1]} ${tokens.size[2]};
2418
+ font-family: 'Menlo', 'Fira Code', monospace !important;
2419
+ border-bottom: 1px solid ${colors.darkGray[400]};
2420
+ text-align: left;
2421
+ text-overflow: clip;
2422
+ word-break: break-word;
2423
+ }
2424
+
2425
+ & .TSQDQueryDisabled {
2426
+ align-self: stretch;
2427
+ align-self: stretch !important;
2428
+ display: flex;
2429
+ align-items: center;
2430
+ padding: 0 ${tokens.size[3]};
2431
+ color: ${colors.gray[300]};
2432
+ background-color: ${colors.darkGray[600]};
2433
+ border-bottom: 1px solid ${colors.darkGray[400]};
2434
+ font-size: ${font.size.sm};
2435
+ }
2436
+ `,
2437
+ detailsContainer: css.css`
2438
+ flex: 1 1 700px;
2439
+ background-color: ${colors.darkGray[700]};
2440
+ display: flex;
2441
+ flex-direction: column;
2442
+ overflow-y: auto;
2443
+ display: flex;
2444
+ `,
2445
+ detailsHeader: css.css`
2446
+ position: sticky;
2447
+ top: 0;
2448
+ z-index: 2;
2449
+ background-color: ${colors.darkGray[600]};
2450
+ padding: ${tokens.size[2]} ${tokens.size[2]};
2451
+ font-weight: ${font.weight.medium};
2452
+ font-size: ${font.size.sm};
2453
+ `,
2454
+ detailsBody: css.css`
2455
+ margin: ${tokens.size[2]} 0px ${tokens.size[3]} 0px;
2456
+ & > div {
2457
+ display: flex;
2458
+ align-items: stretch;
2459
+ padding: 0 ${tokens.size[2]};
2460
+ line-height: ${font.lineHeight.sm};
2461
+ justify-content: space-between;
2462
+ & > span {
2463
+ font-size: ${font.size.sm};
2464
+ }
2465
+ & > span:nth-child(2) {
2466
+ font-variant-numeric: tabular-nums;
2467
+ }
2468
+ }
2469
+
2470
+ & > div:first-child {
2471
+ margin-bottom: ${tokens.size[2]};
2472
+ }
2473
+
2474
+ & code {
2475
+ font-family: 'Menlo', 'Fira Code', monospace !important;
2476
+ margin: 0;
2477
+ font-size: ${font.size.sm};
2478
+ line-height: ${font.lineHeight.sm};
2479
+ }
2480
+ `,
2481
+ queryDetailsStatus: css.css`
2482
+ border: 1px solid ${colors.darkGray[200]};
2483
+ border-radius: ${tokens.border.radius.md};
2484
+ font-weight: ${font.weight.medium};
2485
+ padding: ${tokens.size[1]} ${tokens.size[2.5]};
2486
+ `,
2487
+ actionsBody: css.css`
2488
+ flex-wrap: wrap;
2489
+ margin: ${tokens.size[3]} 0px ${tokens.size[3]} 0px;
2490
+ display: flex;
2491
+ gap: ${tokens.size[2]};
2492
+ padding: 0px ${tokens.size[2]};
2493
+ & > button {
2494
+ font-size: ${font.size.sm};
2495
+ padding: ${tokens.size[2]} ${tokens.size[2]};
2496
+ display: flex;
2497
+ border-radius: ${tokens.border.radius.md};
2498
+ border: 1px solid ${colors.darkGray[400]};
2499
+ background-color: ${colors.darkGray[600]};
2500
+ align-items: center;
2501
+ gap: ${tokens.size[2]};
2502
+ font-weight: ${font.weight.medium};
2503
+ line-height: ${font.lineHeight.sm};
2504
+ cursor: pointer;
2505
+ &:focus-visible {
2506
+ outline-offset: 2px;
2507
+ border-radius: ${border.radius.xs};
2508
+ outline: 2px solid ${colors.blue[800]};
2509
+ }
2510
+ &:hover {
2511
+ background-color: ${colors.darkGray[500]};
2512
+ }
2513
+
2514
+ &:disabled {
2515
+ opacity: 0.6;
2516
+ cursor: not-allowed;
2517
+ }
2518
+
2519
+ & > span {
2520
+ width: ${size[2]};
2521
+ height: ${size[2]};
2522
+ border-radius: ${tokens.border.radius.full};
2523
+ }
2524
+ }
2525
+ `,
2526
+ actionsSelect: css.css`
2527
+ font-size: ${font.size.sm};
2528
+ padding: ${tokens.size[2]} ${tokens.size[2]};
2529
+ display: flex;
2530
+ border-radius: ${tokens.border.radius.md};
2531
+ overflow: hidden;
2532
+ border: 1px solid ${colors.darkGray[400]};
2533
+ background-color: ${colors.darkGray[600]};
2534
+ align-items: center;
2535
+ gap: ${tokens.size[2]};
2536
+ font-weight: ${font.weight.medium};
2537
+ line-height: ${font.lineHeight.sm};
2538
+ color: ${tokens.colors.red[400]};
2539
+ cursor: pointer;
2540
+ position: relative;
2541
+ &:hover {
2542
+ background-color: ${colors.darkGray[500]};
2543
+ }
2544
+ & > span {
2545
+ width: ${size[2]};
2546
+ height: ${size[2]};
2547
+ border-radius: ${tokens.border.radius.full};
2548
+ }
2549
+ &:focus-within {
2550
+ outline-offset: 2px;
2551
+ border-radius: ${border.radius.xs};
2552
+ outline: 2px solid ${colors.blue[800]};
2553
+ }
2554
+ & select {
2555
+ position: absolute;
2556
+ top: 0;
2557
+ left: 0;
2558
+ width: 100%;
2559
+ height: 100%;
2560
+ appearance: none;
2561
+ background-color: transparent;
2562
+ border: none;
2563
+ color: transparent;
2564
+ outline: none;
2565
+ }
2566
+
2567
+ & svg path {
2568
+ stroke: ${tokens.colors.red[400]} !important;
2569
+ }
2570
+ `,
2571
+ settingsMenu: css.css`
2572
+ position: absolute;
2573
+ top: calc(100% + ${tokens.size[2]});
2574
+ border-radius: ${tokens.border.radius.lg};
2575
+ border: 1px solid ${colors.gray[600]};
2576
+ right: 0;
2577
+ min-width: ${tokens.size[44]};
2578
+ background-color: ${colors.darkGray[400]};
2579
+ font-size: ${font.size.sm};
2580
+ color: ${colors.gray[500]};
2581
+ z-index: 7;
2582
+ `,
2583
+ settingsMenuHeader: css.css`
2584
+ padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
2585
+ color: ${colors.gray[300]};
2586
+ font-weight: ${font.weight.medium};
2587
+ `,
2588
+ settingsMenuSection: css.css`
2589
+ border-top: 1px solid ${colors.gray[600]};
2590
+ display: flex;
2591
+ flex-direction: column;
2592
+ padding: ${tokens.size[1]} ${tokens.size[1]};
2593
+
2594
+ & > button {
2595
+ cursor: pointer;
2596
+ background-color: transparent;
2597
+ border: none;
2598
+ padding: ${tokens.size[2]} ${tokens.size[1.5]};
2599
+ font-size: ${font.size.sm};
2600
+ display: flex;
2601
+ align-items: center;
2602
+ justify-content: flex-start;
2603
+ gap: ${tokens.size[2]};
2604
+ border-radius: ${tokens.border.radius.md};
2605
+ &:hover {
2606
+ background-color: ${colors.darkGray[500]};
2607
+ }
2608
+
2609
+ &:focus-visible {
2610
+ outline-offset: 2px;
2611
+ outline: 2px solid ${colors.blue[800]};
2612
+ }
2613
+ }
2614
+
2615
+ & button:nth-child(4) svg {
2616
+ transform: rotate(-90deg);
2617
+ }
2618
+
2619
+ & button:nth-child(3) svg {
2620
+ transform: rotate(90deg);
2621
+ }
2622
+ `
2623
+ };
2624
+ };
2625
+ web.delegateEvents(["click", "mousedown", "input"]);
2626
+
2627
+ exports.Devtools = Devtools;
2628
+ exports.DevtoolsComponent = DevtoolsComponent;
2629
+ exports.DevtoolsPanel = DevtoolsPanel;
2630
+ exports.QueryRow = QueryRow;
2631
+ exports.QueryStatus = QueryStatus;
2632
+ exports.QueryStatusCount = QueryStatusCount;
2633
+ exports.default = DevtoolsComponent;
2634
+ //# sourceMappingURL=Devtools-3819273f.js.map