@jfrader/ui 0.4.0 → 0.5.1

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 (307) hide show
  1. package/README.md +2 -0
  2. package/dist/accordion-DLul6vIl.js +205 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/announcement-bar-Dlbq5-9D.js +382 -0
  7. package/dist/announcement-bar.js +2 -0
  8. package/dist/avatar-CaGJHy1N.js +145 -0
  9. package/dist/avatar-group-M1opAQEG.js +138 -0
  10. package/dist/avatar-group.js +2 -0
  11. package/dist/avatar.js +1 -1
  12. package/dist/badge-CjM5Agqk.js +119 -0
  13. package/dist/badge.js +1 -1
  14. package/dist/bottom-sheet-DjZOPq4k.js +674 -0
  15. package/dist/bottom-sheet.js +2 -0
  16. package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
  17. package/dist/breadcrumbs.js +1 -1
  18. package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
  19. package/dist/button.js +1 -1
  20. package/dist/calendar-BzJdv_SZ.js +449 -0
  21. package/dist/calendar.js +1 -1
  22. package/dist/card-Ca4KQKYQ.js +154 -0
  23. package/dist/card.js +1 -1
  24. package/dist/carousel-B7OrvD6J.js +474 -0
  25. package/dist/carousel.js +2 -0
  26. package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
  27. package/dist/checkbox.js +1 -1
  28. package/dist/chip-group-DjQ0_6Y9.js +290 -0
  29. package/dist/chip-group.js +2 -0
  30. package/dist/code-block/shiki.js +147 -0
  31. package/dist/code-block-B5we2lZa.js +293 -0
  32. package/dist/code-block.js +2 -0
  33. package/dist/collection-registry-k6JcD3Jr.js +44 -0
  34. package/dist/combobox-DFFqOBCi.js +339 -0
  35. package/dist/combobox.js +1 -1
  36. package/dist/command-palette-BmQu2w4H.js +391 -0
  37. package/dist/command-palette.js +1 -1
  38. package/dist/comment-thread-ASaXDcGo.js +1410 -0
  39. package/dist/comment-thread.js +2 -0
  40. package/dist/context-menu-__1c2Dk9.js +370 -0
  41. package/dist/context-menu.js +2 -0
  42. package/dist/copy-button-DCSLcYS-.js +252 -0
  43. package/dist/copy-button.js +2 -0
  44. package/dist/countdown-Dp_TD1VP.js +293 -0
  45. package/dist/countdown.js +2 -0
  46. package/dist/date-picker-BiPN7yeK.js +255 -0
  47. package/dist/date-picker.js +1 -1
  48. package/dist/date-range-picker-DQpUeKqV.js +570 -0
  49. package/dist/date-range-picker.js +2 -0
  50. package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
  51. package/dist/dialog.js +1 -1
  52. package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
  53. package/dist/divider.js +1 -1
  54. package/dist/drawer-DsASTiP-.js +553 -0
  55. package/dist/drawer.js +2 -0
  56. package/dist/elastic-slider-BG6K019r.js +395 -0
  57. package/dist/elastic-slider.js +2 -0
  58. package/dist/empty-state-CDgrjPPf.js +142 -0
  59. package/dist/empty-state.js +2 -0
  60. package/dist/expandable-card-rUATve0o.js +347 -0
  61. package/dist/expandable-card.js +2 -0
  62. package/dist/expanding-search-BxOwtdwt.js +238 -0
  63. package/dist/expanding-search.js +2 -0
  64. package/dist/field-anatomy-COVdNpf5.js +84 -0
  65. package/dist/file-dropzone-BuXm3Tea.js +457 -0
  66. package/dist/file-dropzone.js +2 -0
  67. package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
  68. package/dist/filter-toolbar.js +2 -0
  69. package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
  70. package/dist/hold-to-confirm.js +2 -0
  71. package/dist/hover-card-CoMJKg1g.js +347 -0
  72. package/dist/hover-card.js +2 -0
  73. package/dist/image-compare-BxY8Ykzt.js +415 -0
  74. package/dist/image-compare.js +2 -0
  75. package/dist/index.js +84 -38
  76. package/dist/inline-edit-C0eeml65.js +535 -0
  77. package/dist/inline-edit.js +2 -0
  78. package/dist/input-control-DmMuAuPS.js +34 -0
  79. package/dist/json-viewer-DgWqyU75.js +802 -0
  80. package/dist/json-viewer.js +2 -0
  81. package/dist/listbox-style-WX-RASp1.js +59 -0
  82. package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
  83. package/dist/mention-input-sq61si9L.js +600 -0
  84. package/dist/mention-input.js +2 -0
  85. package/dist/menu-DDKgmK2F.js +295 -0
  86. package/dist/menu.js +1 -1
  87. package/dist/metric-card--lVTz5Wn.js +118 -0
  88. package/dist/metric-card.js +2 -0
  89. package/dist/multi-select-DG1BCFX7.js +598 -0
  90. package/dist/multi-select.js +2 -0
  91. package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
  92. package/dist/navigation.js +1 -1
  93. package/dist/overlay-layer-qEbpEtb8.js +78 -0
  94. package/dist/overlay-portal-C4JZFq2M.js +15 -0
  95. package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
  96. package/dist/pagination.js +1 -1
  97. package/dist/password-field-03pWRkuY.js +250 -0
  98. package/dist/password-field.js +2 -0
  99. package/dist/pill-BaS-uIbn.js +58 -0
  100. package/dist/pill.js +1 -1
  101. package/dist/popover-CErIw2q3.js +125 -0
  102. package/dist/popover.js +1 -1
  103. package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
  104. package/dist/progress.js +1 -1
  105. package/dist/radio-cards-Cu9cBssN.js +456 -0
  106. package/dist/radio-cards.js +2 -0
  107. package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
  108. package/dist/radio-group.js +1 -1
  109. package/dist/resizable-panels-DUpQEpwG.js +520 -0
  110. package/dist/resizable-panels.js +2 -0
  111. package/dist/scroll-area-CcZyiSOQ.js +371 -0
  112. package/dist/scroll-area.js +2 -0
  113. package/dist/search-field-DMvho0KQ.js +274 -0
  114. package/dist/search-field.js +2 -0
  115. package/dist/segmented-control-8ZUGnsZm.js +327 -0
  116. package/dist/segmented-control.js +2 -0
  117. package/dist/select-D5rhJ8gi.js +293 -0
  118. package/dist/select.js +1 -1
  119. package/dist/signature-pad-_bTeguN9.js +645 -0
  120. package/dist/signature-pad.js +2 -0
  121. package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
  122. package/dist/skeleton.js +1 -1
  123. package/dist/slider-DVG6-Awh.js +308 -0
  124. package/dist/slider.js +2 -0
  125. package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
  126. package/dist/sortable-data-table.js +2 -0
  127. package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
  128. package/dist/spinner.js +1 -1
  129. package/dist/split-button-BCw4zZom.js +262 -0
  130. package/dist/split-button.js +2 -0
  131. package/dist/stepper-CruHbXxX.js +480 -0
  132. package/dist/stepper.js +2 -0
  133. package/dist/swipe-actions-CBuJREU1.js +420 -0
  134. package/dist/swipe-actions.js +2 -0
  135. package/dist/switch-C1WrKrf-.js +145 -0
  136. package/dist/switch.js +1 -1
  137. package/dist/tabs-XluwRjgg.js +210 -0
  138. package/dist/tabs.js +1 -1
  139. package/dist/tag-input-DSRCyrX2.js +418 -0
  140. package/dist/tag-input.js +2 -0
  141. package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
  142. package/dist/text-field.js +1 -1
  143. package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
  144. package/dist/textarea.js +1 -1
  145. package/dist/theme-root.js +1 -1
  146. package/dist/theme-switch-C505TtU8.js +166 -0
  147. package/dist/theme-switch.js +2 -0
  148. package/dist/time-picker-CPlhW0tr.js +311 -0
  149. package/dist/time-picker.js +2 -0
  150. package/dist/timeline-B0uAAVfT.js +624 -0
  151. package/dist/timeline.js +2 -0
  152. package/dist/toast-B7wo3sX1.js +371 -0
  153. package/dist/toast-stack-B40VpS4M.js +197 -0
  154. package/dist/toast-stack.js +2 -0
  155. package/dist/toast.js +1 -1
  156. package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
  157. package/dist/toggle-group.js +1 -1
  158. package/dist/tooltip-BvgVTCTN.js +120 -0
  159. package/dist/tooltip.js +1 -1
  160. package/dist/tree-view-j8qLqkb_.js +364 -0
  161. package/dist/tree-view.js +2 -0
  162. package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
  163. package/dist/types/components/announcement-bar/index.d.ts +2 -0
  164. package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
  165. package/dist/types/components/avatar-group/index.d.ts +2 -0
  166. package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
  167. package/dist/types/components/bottom-sheet/index.d.ts +2 -0
  168. package/dist/types/components/calendar/calendar.d.ts +25 -1
  169. package/dist/types/components/calendar/index.d.ts +1 -1
  170. package/dist/types/components/carousel/carousel.d.ts +73 -0
  171. package/dist/types/components/carousel/index.d.ts +2 -0
  172. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  173. package/dist/types/components/chip-group/chip-group.d.ts +54 -0
  174. package/dist/types/components/chip-group/index.d.ts +1 -0
  175. package/dist/types/components/code-block/code-block.d.ts +58 -0
  176. package/dist/types/components/code-block/index.d.ts +1 -0
  177. package/dist/types/components/code-block/shiki.d.ts +3 -0
  178. package/dist/types/components/combobox/combobox.d.ts +1 -1
  179. package/dist/types/components/command-palette/command-palette.d.ts +2 -2
  180. package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
  181. package/dist/types/components/comment-thread/index.d.ts +1 -0
  182. package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
  183. package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
  184. package/dist/types/components/context-menu/context-menu.d.ts +55 -0
  185. package/dist/types/components/context-menu/index.d.ts +2 -0
  186. package/dist/types/components/copy-button/copy-button.d.ts +49 -0
  187. package/dist/types/components/copy-button/index.d.ts +2 -0
  188. package/dist/types/components/countdown/countdown.d.ts +37 -0
  189. package/dist/types/components/countdown/index.d.ts +1 -0
  190. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  191. package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
  192. package/dist/types/components/date-range-picker/index.d.ts +2 -0
  193. package/dist/types/components/drawer/drawer.d.ts +59 -0
  194. package/dist/types/components/drawer/index.d.ts +2 -0
  195. package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
  196. package/dist/types/components/elastic-slider/index.d.ts +1 -0
  197. package/dist/types/components/empty-state/empty-state.d.ts +36 -0
  198. package/dist/types/components/empty-state/index.d.ts +2 -0
  199. package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
  200. package/dist/types/components/expandable-card/index.d.ts +2 -0
  201. package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
  202. package/dist/types/components/expanding-search/index.d.ts +1 -0
  203. package/dist/types/components/field/field-anatomy.d.ts +4 -2
  204. package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
  205. package/dist/types/components/file-dropzone/index.d.ts +2 -0
  206. package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
  207. package/dist/types/components/filter-toolbar/index.d.ts +1 -0
  208. package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
  209. package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
  210. package/dist/types/components/hover-card/hover-card.d.ts +97 -0
  211. package/dist/types/components/hover-card/index.d.ts +2 -0
  212. package/dist/types/components/image-compare/image-compare.d.ts +54 -0
  213. package/dist/types/components/image-compare/index.d.ts +1 -0
  214. package/dist/types/components/inline-edit/index.d.ts +2 -0
  215. package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
  216. package/dist/types/components/json-viewer/index.d.ts +2 -0
  217. package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
  218. package/dist/types/components/mention-input/index.d.ts +2 -0
  219. package/dist/types/components/mention-input/mention-input.d.ts +87 -0
  220. package/dist/types/components/menu/menu.d.ts +68 -7
  221. package/dist/types/components/metric-card/index.d.ts +1 -0
  222. package/dist/types/components/metric-card/metric-card.d.ts +37 -0
  223. package/dist/types/components/multi-select/index.d.ts +2 -0
  224. package/dist/types/components/multi-select/multi-select.d.ts +73 -0
  225. package/dist/types/components/pagination/pagination.d.ts +1 -1
  226. package/dist/types/components/password-field/index.d.ts +2 -0
  227. package/dist/types/components/password-field/password-field.d.ts +34 -0
  228. package/dist/types/components/popover/popover.d.ts +1 -1
  229. package/dist/types/components/radio-cards/index.d.ts +1 -0
  230. package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
  231. package/dist/types/components/radio-group/radio-group.d.ts +1 -1
  232. package/dist/types/components/resizable-panels/index.d.ts +2 -0
  233. package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
  234. package/dist/types/components/scroll-area/index.d.ts +2 -0
  235. package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
  236. package/dist/types/components/search-field/index.d.ts +1 -0
  237. package/dist/types/components/search-field/search-field.d.ts +31 -0
  238. package/dist/types/components/segmented-control/index.d.ts +2 -0
  239. package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
  240. package/dist/types/components/select/select.d.ts +1 -1
  241. package/dist/types/components/signature-pad/index.d.ts +2 -0
  242. package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
  243. package/dist/types/components/slider/index.d.ts +1 -0
  244. package/dist/types/components/slider/slider-style.d.ts +14 -0
  245. package/dist/types/components/slider/slider.d.ts +62 -0
  246. package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
  247. package/dist/types/components/sortable-data-table/index.d.ts +1 -0
  248. package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
  249. package/dist/types/components/split-button/index.d.ts +2 -0
  250. package/dist/types/components/split-button/split-button.d.ts +55 -0
  251. package/dist/types/components/stepper/index.d.ts +2 -0
  252. package/dist/types/components/stepper/stepper.d.ts +85 -0
  253. package/dist/types/components/swipe-actions/index.d.ts +2 -0
  254. package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
  255. package/dist/types/components/tabs/tabs.d.ts +1 -1
  256. package/dist/types/components/tag-input/index.d.ts +2 -0
  257. package/dist/types/components/tag-input/tag-input.d.ts +66 -0
  258. package/dist/types/components/text-field/text-field.d.ts +1 -1
  259. package/dist/types/components/textarea/textarea.d.ts +1 -1
  260. package/dist/types/components/theme-switch/index.d.ts +1 -0
  261. package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
  262. package/dist/types/components/time-picker/index.d.ts +2 -0
  263. package/dist/types/components/time-picker/time-picker.d.ts +48 -0
  264. package/dist/types/components/timeline/index.d.ts +2 -0
  265. package/dist/types/components/timeline/timeline.d.ts +66 -0
  266. package/dist/types/components/toast/toast.d.ts +37 -2
  267. package/dist/types/components/toast-stack/index.d.ts +2 -0
  268. package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
  269. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  270. package/dist/types/components/tree-view/index.d.ts +1 -0
  271. package/dist/types/components/tree-view/tree-view.d.ts +47 -0
  272. package/dist/types/components/usage-meter/index.d.ts +2 -0
  273. package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
  274. package/dist/types/index.d.ts +45 -0
  275. package/dist/types/overlay/overlay-layer.d.ts +53 -0
  276. package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
  277. package/dist/types/styling/media.d.ts +1 -0
  278. package/dist/types/styling/theme.d.ts +12 -0
  279. package/dist/types/utils/use-controlled-state.d.ts +2 -1
  280. package/dist/usage-meter-qyQ3rYVv.js +463 -0
  281. package/dist/usage-meter.js +2 -0
  282. package/dist/use-controlled-state-DpeVQZNR.js +20 -0
  283. package/dist/use-latest-callback-cj1OOQL6.js +11 -0
  284. package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
  285. package/dist/use-slider-interaction-ChL-208h.js +234 -0
  286. package/package.json +195 -3
  287. package/dist/accordion-Bd-j04hW.js +0 -198
  288. package/dist/avatar-BahDVO9t.js +0 -132
  289. package/dist/badge-B_sLygxU.js +0 -108
  290. package/dist/calendar-C9Yad_-w.js +0 -394
  291. package/dist/card-D-aI2QHx.js +0 -158
  292. package/dist/collection-registry-BTYi6zGh.js +0 -98
  293. package/dist/combobox-DiMC2g_u.js +0 -327
  294. package/dist/command-palette-V_2pEay7.js +0 -379
  295. package/dist/date-picker-C29Uo4Tx.js +0 -250
  296. package/dist/field-anatomy-D2ToMeRa.js +0 -109
  297. package/dist/menu-CGPTNRnF.js +0 -216
  298. package/dist/pill-DO2gHzMb.js +0 -56
  299. package/dist/popover-CdRXjQqI.js +0 -113
  300. package/dist/select-BgG7WgSh.js +0 -286
  301. package/dist/switch-Dr-qjmT4.js +0 -142
  302. package/dist/tabs-CK_g1RKa.js +0 -203
  303. package/dist/toast-CjmELMZZ.js +0 -283
  304. package/dist/tooltip-CaL3rKbV.js +0 -108
  305. package/dist/use-controlled-state-CVXDa-qM.js +0 -21
  306. package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
  307. package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
@@ -0,0 +1,802 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { t as n } from "./disclosure-caret-C5T3fcl6.js";
4
+ import { t as r } from "./focus-ring-BK5W5_NY.js";
5
+ import { n as i, r as a } from "./media-8yrN85VT.js";
6
+ import { t as o } from "./use-controlled-state-DpeVQZNR.js";
7
+ import { t as s } from "./button-NLY0h6EJ.js";
8
+ import { n as c } from "./surface-DZ4d-2aL.js";
9
+ import { t as l } from "./text-field-hU72iSVS.js";
10
+ import { useId as ee, useLayoutEffect as te, useMemo as u, useRef as d, useState as f } from "react";
11
+ import { vars as p } from "@jfrader/tokens/vars";
12
+ import { Fragment as m, jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
13
+ //#region src/components/json-viewer/json-viewer.tsx
14
+ var ne = 500, re = {
15
+ object: {
16
+ one: "key",
17
+ other: "keys"
18
+ },
19
+ array: {
20
+ one: "item",
21
+ other: "items"
22
+ }
23
+ }, ie = 50, ae = 2e3, oe = (e, t) => Number.isInteger(e) && e > 0 ? e : t, _ = (e) => e.children.length > 0, se = (e, t, n) => n ? `${e}[${t}]` : /^[A-Za-z_$][\w$]*$/.test(t) ? `${e}.${t}` : `${e}[${JSON.stringify(t)}]`, ce = (e) => e.type === "null" ? "null" : String(e.value);
24
+ function le(e, t) {
25
+ let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = [{
26
+ value: e,
27
+ path: t,
28
+ key: t,
29
+ level: 1,
30
+ index: 0
31
+ }];
32
+ try {
33
+ for (; i.length;) {
34
+ let e = i.pop();
35
+ if ("exit" in e) {
36
+ r.delete(e.exit);
37
+ continue;
38
+ }
39
+ let { value: t } = e, a = t === null ? "null" : Array.isArray(t) ? "array" : typeof t;
40
+ if (![
41
+ "null",
42
+ "array",
43
+ "object",
44
+ "string",
45
+ "number",
46
+ "boolean"
47
+ ].includes(a) || a === "number" && !Number.isFinite(t)) return null;
48
+ let o = {
49
+ ...e,
50
+ value: t,
51
+ type: a,
52
+ children: []
53
+ };
54
+ if (n.set(o.path, o), typeof t != "object" || !t) continue;
55
+ if (r.has(t) || Object.getOwnPropertySymbols(t).length) return null;
56
+ let s = Array.isArray(t);
57
+ if (s && Object.getPrototypeOf(t) !== Array.prototype || !s && Object.getPrototypeOf(t) !== Object.prototype && Object.getPrototypeOf(t) !== null) return null;
58
+ let c = Object.getOwnPropertyDescriptors(t), l = Object.keys(c).filter((e) => !s || e !== "length");
59
+ if (s && (l.length !== t.length || l.some((e, t) => e !== String(t))) || l.some((e) => !("value" in c[e]) || !c[e].enumerable)) return null;
60
+ r.add(t), i.push({ exit: t }), o.children = l.map((e) => se(o.path, e, s));
61
+ for (let e = l.length - 1; e >= 0; e--) {
62
+ let t = l[e];
63
+ i.push({
64
+ value: c[t].value,
65
+ path: o.children[e],
66
+ key: t,
67
+ parent: o.path,
68
+ level: o.level + 1,
69
+ index: e
70
+ });
71
+ }
72
+ }
73
+ return n;
74
+ } catch {
75
+ return null;
76
+ }
77
+ }
78
+ var ue = "2px", de = {
79
+ scrollbarWidth: "thin",
80
+ scrollbarColor: `${p.color.borderStrong} transparent`
81
+ }, fe = e({
82
+ ...c,
83
+ minInlineSize: 0,
84
+ borderRadius: p.radius.lg,
85
+ boxShadow: p.shadow.raised,
86
+ fontSize: p.textSize.sm,
87
+ overflow: "hidden"
88
+ }), pe = e({
89
+ display: "flex",
90
+ flexWrap: "wrap",
91
+ alignItems: "center",
92
+ gap: p.space[1],
93
+ padding: p.space[2],
94
+ borderBlockEnd: `1px solid ${p.color.border}`
95
+ }), me = e({
96
+ position: "relative",
97
+ display: "flex",
98
+ alignItems: "center",
99
+ flex: "1 1 12rem",
100
+ minInlineSize: 0
101
+ }), he = e({
102
+ position: "absolute",
103
+ insetInlineStart: p.space[3],
104
+ display: "inline-flex",
105
+ color: p.color.textMuted,
106
+ pointerEvents: "none",
107
+ "& svg": {
108
+ inlineSize: p.space[4],
109
+ blockSize: p.space[4]
110
+ }
111
+ }), ge = e({
112
+ flex: 1,
113
+ minInlineSize: 0
114
+ }), _e = e({ paddingInlineStart: `calc(${p.space[3]} + ${p.space[4]} + ${p.space[2]})` }), ve = e({
115
+ color: p.color.textMuted,
116
+ fontSize: p.textSize.xs,
117
+ fontVariantNumeric: "tabular-nums",
118
+ whiteSpace: "nowrap",
119
+ paddingInline: p.space[1],
120
+ "&:empty": { paddingInline: 0 }
121
+ }), ye = e({
122
+ display: "flex",
123
+ alignItems: "center",
124
+ gap: p.space[1],
125
+ marginInlineStart: "auto"
126
+ }), be = e({
127
+ alignSelf: "center",
128
+ inlineSize: "1px",
129
+ blockSize: p.space[4],
130
+ marginInline: p.space[1],
131
+ background: p.color.border
132
+ }), xe = e({
133
+ inlineSize: p.space[8],
134
+ paddingInline: 0,
135
+ color: p.color.textMuted,
136
+ "&:hover:not(:disabled)": { color: p.color.text },
137
+ "& svg": {
138
+ inlineSize: p.space[4],
139
+ blockSize: p.space[4]
140
+ }
141
+ }), Se = e({
142
+ ...de,
143
+ overflow: "auto",
144
+ maxBlockSize: "var(--json-max-height)",
145
+ padding: p.space[2],
146
+ fontFamily: p.font.mono,
147
+ "--json-indent": p.space[5],
148
+ "--json-caret": p.space[4],
149
+ "@media (max-width: 40rem)": { "--json-indent": p.space[4] }
150
+ }), Ce = e({
151
+ outline: "none",
152
+ "&:focus-visible > [data-ui=\"json-viewer-row\"]": r
153
+ }), we = e({
154
+ display: "flex",
155
+ alignItems: "center",
156
+ gap: p.space[1],
157
+ minBlockSize: "var(--json-row-height)",
158
+ paddingInlineEnd: p.space[3],
159
+ paddingInlineStart: `calc(var(--json-depth) * var(--json-indent) + ${p.space[1]})`,
160
+ borderInlineStart: `${ue} solid transparent`,
161
+ borderRadius: p.radius.sm,
162
+ cursor: "pointer",
163
+ whiteSpace: "pre",
164
+ minInlineSize: "max-content",
165
+ transitionProperty: "background-color",
166
+ transitionDuration: p.motion.duration.fast,
167
+ transitionTimingFunction: p.motion.easeStandard,
168
+ "&:hover": { background: p.color.surfaceHover },
169
+ "[aria-selected=\"true\"] > &": {
170
+ borderInlineStartColor: p.color.accent,
171
+ background: p.color.accentSoft
172
+ },
173
+ [a]: { transitionDuration: "0s" },
174
+ [i]: {
175
+ color: "CanvasText",
176
+ "[aria-selected=\"true\"] > &": { borderInlineStartColor: "Highlight" }
177
+ }
178
+ }), Te = e({
179
+ position: "relative",
180
+ "&::before": {
181
+ content: "\"\"",
182
+ position: "absolute",
183
+ insetBlock: 0,
184
+ insetInlineStart: `calc(var(--json-depth) * var(--json-indent) + ${p.space[1]} + ${ue} + var(--json-caret) / 2)`,
185
+ inlineSize: "1px",
186
+ background: p.color.border,
187
+ pointerEvents: "none"
188
+ },
189
+ [i]: { "&::before": { background: "GrayText" } }
190
+ }), Ee = e({
191
+ display: "inline-flex",
192
+ alignItems: "center",
193
+ justifyContent: "center",
194
+ flexShrink: 0,
195
+ inlineSize: "var(--json-caret)",
196
+ color: p.color.textMuted,
197
+ "&[data-state]::after": n,
198
+ "&[data-state=\"open\"]::after": { transform: "rotate(90deg)" },
199
+ "&[data-state=\"open\"]:dir(rtl)::after": { transform: "rotate(-90deg)" },
200
+ [a]: { "&[data-state]::after": { transitionDuration: "0s" } },
201
+ [i]: { "&[data-state]::after": {
202
+ forcedColorAdjust: "none",
203
+ color: "CanvasText"
204
+ } }
205
+ }), v = { unicodeBidi: "plaintext" }, De = e({
206
+ ...v,
207
+ color: p.color.text
208
+ }), Oe = e({ color: p.color.textMuted }), ke = e({
209
+ ...v,
210
+ "&[data-type=\"string\"]": { color: p.color.accentText },
211
+ "&[data-type=\"number\"]": {
212
+ color: p.color.textMuted,
213
+ fontVariantNumeric: "tabular-nums"
214
+ },
215
+ "&[data-type=\"boolean\"]": { color: p.color.warning },
216
+ "&[data-type=\"null\"]": {
217
+ color: p.color.textMuted,
218
+ fontStyle: "italic"
219
+ },
220
+ [i]: { color: "CanvasText" }
221
+ }), Ae = e({
222
+ ...v,
223
+ display: "inline-flex",
224
+ alignItems: "center",
225
+ paddingInline: p.space[2],
226
+ border: `1px solid ${p.color.border}`,
227
+ borderRadius: p.radius.full,
228
+ color: p.color.textMuted,
229
+ fontFamily: p.font.sans,
230
+ fontSize: p.textSize.xs,
231
+ fontVariantNumeric: "tabular-nums",
232
+ lineHeight: p.lineHeight.base
233
+ }), je = e({
234
+ color: p.color.accentText,
235
+ fontFamily: p.font.sans
236
+ }), Me = e({
237
+ color: p.color.text,
238
+ background: p.color.accentSoft,
239
+ borderRadius: `calc(${p.radius.sm} / 2)`,
240
+ textDecoration: "underline",
241
+ textDecorationColor: p.color.accentText,
242
+ textUnderlineOffset: "0.2em",
243
+ [i]: {
244
+ color: "Highlight",
245
+ background: "Canvas"
246
+ }
247
+ }), Ne = e({
248
+ display: "grid",
249
+ gap: p.space[2],
250
+ padding: p.space[3],
251
+ borderBlockStart: `1px solid ${p.color.border}`,
252
+ background: p.color.surface,
253
+ minInlineSize: 0
254
+ }), Pe = e({
255
+ display: "flex",
256
+ flexWrap: "wrap",
257
+ alignItems: "center",
258
+ gap: p.space[2],
259
+ minInlineSize: 0
260
+ }), Fe = e({
261
+ ...v,
262
+ fontFamily: p.font.mono,
263
+ fontWeight: p.fontWeight.medium,
264
+ overflowWrap: "anywhere",
265
+ minInlineSize: 0
266
+ }), Ie = e({
267
+ ...de,
268
+ margin: 0,
269
+ padding: p.space[3],
270
+ border: `1px solid ${p.color.borderSubtle}`,
271
+ borderRadius: p.radius.md,
272
+ background: p.color.surfaceInset,
273
+ whiteSpace: "pre-wrap",
274
+ overflowWrap: "anywhere",
275
+ fontFamily: p.font.mono,
276
+ fontSize: p.textSize.xs,
277
+ maxBlockSize: "var(--json-max-height)",
278
+ overflow: "auto",
279
+ "&:focus-visible": r
280
+ }), Le = e({
281
+ paddingInline: p.space[3],
282
+ paddingBlock: p.space[2],
283
+ borderBlockStart: `1px solid ${p.color.border}`,
284
+ color: p.color.textMuted,
285
+ fontSize: p.textSize.xs,
286
+ "&:empty": {
287
+ padding: 0,
288
+ borderBlockStart: 0
289
+ }
290
+ }), Re = e({
291
+ padding: p.space[4],
292
+ color: p.color.textMuted
293
+ }), y = (e) => /* @__PURE__ */ h("svg", {
294
+ viewBox: "0 0 24 24",
295
+ fill: "none",
296
+ stroke: "currentColor",
297
+ strokeWidth: 2,
298
+ strokeLinecap: "round",
299
+ strokeLinejoin: "round",
300
+ "aria-hidden": "true",
301
+ focusable: "false",
302
+ children: e
303
+ }), ze = y(/* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("circle", {
304
+ cx: "11",
305
+ cy: "11",
306
+ r: "7"
307
+ }), /* @__PURE__ */ h("path", { d: "m20 20-3.5-3.5" })] })), Be = y(/* @__PURE__ */ h("path", { d: "m18 15-6-6-6 6" })), Ve = y(/* @__PURE__ */ h("path", { d: "m6 9 6 6 6-6" })), He = y(/* @__PURE__ */ h("path", { d: "m7 15 5 5 5-5M7 9l5-5 5 5" })), Ue = y(/* @__PURE__ */ h("path", { d: "m7 20 5-5 5 5M7 4l5 5 5-5" })), We = y(/* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("rect", {
308
+ x: "9",
309
+ y: "9",
310
+ width: "12",
311
+ height: "12",
312
+ rx: "2"
313
+ }), /* @__PURE__ */ h("path", { d: "M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1" })] })), Ge = y(/* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("path", { d: "M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7" }), /* @__PURE__ */ h("path", { d: "M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7" })] }));
314
+ function b({ data: e, rootName: n = "root", expandedValue: r, defaultExpandedValue: i, onExpandedValueChange: a, defaultExpandDepth: c = 1, query: se, defaultQuery: ue = "", onQueryChange: de, value: v, defaultValue: y, onValueChange: b, onNodeActivate: qe, searchable: x = !0, copyable: S = !0, showPath: Je = !0, pageSize: Ye = ie, maxMatches: Xe = ae, maxHeight: C = "26rem", size: Ze = "md", locale: w, labels: Qe, onCopy: $e, onCopyError: et, slotProps: T, ref: tt, className: nt, sx: rt, style: it, onKeyDown: at, onClick: ot, "aria-label": st, "aria-labelledby": E, "aria-describedby": ct, ...lt }) {
315
+ let D = d(null), O = d(null), k = d(/* @__PURE__ */ new Map()), A = d(null), j = d(!1), M = d({
316
+ text: "",
317
+ time: 0
318
+ }), ut = ee(), N = u(() => le(e, n), [e, n]), P = u(() => new Intl.NumberFormat(w), [w]), dt = u(() => new Intl.PluralRules(w), [w]), F = {
319
+ tree: "JSON",
320
+ search: "Search JSON",
321
+ expandAll: "Expand all",
322
+ collapseAll: "Collapse all",
323
+ previousMatch: "Previous match",
324
+ nextMatch: "Next match",
325
+ copyValue: "Copy value",
326
+ copyPath: "Copy path",
327
+ copied: "Copied",
328
+ copyFailed: "Copy failed",
329
+ invalidData: "Invalid JSON data",
330
+ count: (e, t) => `${P.format(e)} ${re[t][dt.select(e) === "one" ? "one" : "other"]}`,
331
+ match: (e, t, n) => `${P.format(e)} / ${P.format(t)}${n ? "+" : ""}`,
332
+ showMore: (e) => `Show more (${P.format(e)} remaining)`,
333
+ ...Qe
334
+ }, ft = oe(Ye, ie), pt = oe(Xe, ae), [mt] = f(() => i ?? [...N?.values() ?? []].filter((e) => _(e) && e.level <= Math.max(0, Math.floor(c))).map((e) => e.path)), [I = [], ht] = o(r, mt, (e) => a?.([...e])), [L = "", gt] = o(se, ue, de), [R = n, _t] = o(v, y ?? n, b), [vt, z] = f(v ?? y ?? n), [yt, bt] = f({
335
+ data: e,
336
+ pages: /* @__PURE__ */ new Map()
337
+ }), [xt, B] = f({
338
+ query: L,
339
+ closed: /* @__PURE__ */ new Set(),
340
+ opened: /* @__PURE__ */ new Set(),
341
+ pages: /* @__PURE__ */ new Map()
342
+ }), [St, Ct] = f(""), wt = Object.is(yt.data, e) ? yt.pages : /* @__PURE__ */ new Map(), V = xt.query === L ? xt : {
343
+ query: L,
344
+ closed: /* @__PURE__ */ new Set(),
345
+ opened: /* @__PURE__ */ new Set(),
346
+ pages: /* @__PURE__ */ new Map()
347
+ }, H = u(() => {
348
+ let e = [], t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r = L.toLowerCase(), i = !1;
349
+ if (L && N) for (let a of N.values()) {
350
+ if (!a.key.toLowerCase().includes(r) && (a.type === "object" || a.type === "array" || !ce(a).toLowerCase().includes(r))) continue;
351
+ if (e.length === pt) {
352
+ i = !0;
353
+ break;
354
+ }
355
+ e.push(a.path);
356
+ let o = a;
357
+ for (; o.parent !== void 0;) t.add(o.parent), n.set(o.parent, Math.max(n.get(o.parent) ?? 0, o.index + 1)), o = N.get(o.parent);
358
+ }
359
+ return {
360
+ matches: e,
361
+ ancestors: t,
362
+ limits: n,
363
+ truncated: i
364
+ };
365
+ }, [
366
+ N,
367
+ L,
368
+ pt
369
+ ]), U = (e) => !V.closed.has(e) && (I.includes(e) || H.ancestors.has(e) || V.opened.has(e)), W = [], G = /* @__PURE__ */ new Map();
370
+ if (N) {
371
+ let e = [{
372
+ path: n,
373
+ level: 1,
374
+ position: 1,
375
+ setSize: 1
376
+ }];
377
+ for (; e.length;) {
378
+ let t = e.pop();
379
+ if (W.push(t), t.more !== void 0) continue;
380
+ let n = N.get(t.path);
381
+ if (!U(t.path) || !_(n)) continue;
382
+ let r = Math.min(n.children.length, Math.max(wt.get(t.path) ?? ft, H.limits.get(t.path) ?? 0, L ? V.pages.get(t.path) ?? 0 : 0)), i = n.children.length - r, a = r + +!!i, o = n.children.slice(0, r).map((e, n) => ({
383
+ path: e,
384
+ parent: t.path,
385
+ level: t.level + 1,
386
+ position: n + 1,
387
+ setSize: a
388
+ }));
389
+ i && o.push({
390
+ path: `${t.path}\u0000more`,
391
+ parent: t.path,
392
+ level: t.level + 1,
393
+ position: a,
394
+ setSize: a,
395
+ more: i
396
+ }), G.set(t.path, o), e.push(...o.toReversed());
397
+ }
398
+ }
399
+ let [K, Tt] = f({
400
+ nodes: N,
401
+ previousNodes: N,
402
+ selected: R,
403
+ path: R
404
+ }), Et = Object.is(K.nodes, N) ? K.previousNodes : K.nodes, Dt = new Set(W.map((e) => e.path)), Ot = (e) => {
405
+ let t = e;
406
+ for (; t !== void 0;) {
407
+ if (Dt.has(t)) return t;
408
+ t = N?.get(t)?.parent ?? Et?.get(t)?.parent;
409
+ }
410
+ return n;
411
+ }, q = Ot(vt), J = N?.get(R) ?? N?.get(Ot(K.selected === R ? K.path : R)), kt = J?.path ?? n;
412
+ (!Object.is(K.nodes, N) || K.selected !== R || K.path !== kt) && Tt({
413
+ nodes: N,
414
+ previousNodes: Et,
415
+ selected: R,
416
+ path: kt
417
+ }), te(() => {
418
+ if (Object.is(yt.data, e) || (bt({
419
+ data: e,
420
+ pages: /* @__PURE__ */ new Map()
421
+ }), B({
422
+ query: L,
423
+ closed: /* @__PURE__ */ new Set(),
424
+ opened: /* @__PURE__ */ new Set(),
425
+ pages: /* @__PURE__ */ new Map()
426
+ })), vt === q) return;
427
+ let t = A.current, n = D.current?.ownerDocument, r = t && n && (n.activeElement === t || !t.isConnected && n.activeElement === n.body);
428
+ z(q), r && (j.current = !0, k.current.get(q)?.focus(), j.current = !1);
429
+ });
430
+ let Y = (e) => {
431
+ let t = k.current.get(e);
432
+ z(e), t?.focus(), t?.querySelector(":scope > [data-ui=\"json-viewer-row\"]")?.scrollIntoView({
433
+ block: "nearest",
434
+ inline: "nearest",
435
+ behavior: "instant"
436
+ });
437
+ }, X = (e) => {
438
+ let t = [...new Set(e)];
439
+ (t.length !== new Set(I).size || t.some((e) => !I.includes(e))) && ht(t);
440
+ }, At = (e) => {
441
+ if (L) {
442
+ let t = new Set(V.closed), n = new Set(V.opened);
443
+ U(e) ? (t.add(e), n.delete(e)) : (t.delete(e), n.add(e)), B({
444
+ ...V,
445
+ closed: t,
446
+ opened: n
447
+ });
448
+ } else X(U(e) ? I.filter((t) => t !== e) : [...I, e]);
449
+ }, jt = (t) => {
450
+ let n = t.parent, r = G.get(n).length - 1, i = Math.min(N.get(n).children.length, r + ft);
451
+ L ? B({
452
+ ...V,
453
+ pages: new Map(V.pages).set(n, i)
454
+ }) : bt({
455
+ data: e,
456
+ pages: new Map(wt).set(n, i)
457
+ });
458
+ let a = N.get(n).children[r];
459
+ _t(a), z(a), A.current = k.current.get(t.path) ?? null, Z.current = a;
460
+ }, Z = d(null);
461
+ te(() => {
462
+ Z.current !== null && (j.current = !0, k.current.get(Z.current)?.focus(), j.current = !1, Z.current = null);
463
+ });
464
+ let Mt = (e) => {
465
+ if (e.more !== void 0) {
466
+ jt(e);
467
+ return;
468
+ }
469
+ let t = N.get(e.path);
470
+ _(t) ? At(e.path) : qe?.({
471
+ path: t.path,
472
+ value: t.value,
473
+ type: t.type
474
+ });
475
+ }, Nt = async (e, t = J?.path) => {
476
+ if (S && t !== void 0 && N?.has(t)) try {
477
+ let n = e === "path" ? t : JSON.stringify(N.get(t).value, null, 2), r = D.current?.ownerDocument.defaultView?.navigator.clipboard;
478
+ if (!r) throw Error("Clipboard API unavailable");
479
+ await r.writeText(n), Ct(F.copied), $e?.({
480
+ kind: e,
481
+ path: t,
482
+ text: n
483
+ });
484
+ } catch (n) {
485
+ Ct(F.copyFailed), et?.({
486
+ kind: e,
487
+ path: t,
488
+ error: n
489
+ });
490
+ }
491
+ }, Pt = (e, t) => {
492
+ if (!H.matches.length) return;
493
+ let n = H.matches.indexOf(R), r = n < 0 ? e > 0 ? 0 : H.matches.length - 1 : (n + e + H.matches.length) % H.matches.length, i = H.matches[r];
494
+ B({
495
+ ...V,
496
+ closed: /* @__PURE__ */ new Set()
497
+ }), _t(i), t && (z(i), Z.current = i);
498
+ }, Ft = (e) => {
499
+ if (at?.(e), e.defaultPrevented) return;
500
+ if (e.target === O.current) {
501
+ e.key === "Enter" && (e.preventDefault(), Pt(e.shiftKey ? -1 : 1, !1)), e.key === "Escape" && (e.preventDefault(), gt("")), e.key === "ArrowDown" && (e.preventDefault(), Y(q));
502
+ return;
503
+ }
504
+ let t = e.target.closest("[role=\"treeitem\"]");
505
+ if (!t || !D.current?.contains(t) || e.target !== t) return;
506
+ let n = W.findIndex((e) => k.current.get(e.path) === t), r = W[n];
507
+ if (!r) return;
508
+ if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "c") {
509
+ S && r.more === void 0 && !t.ownerDocument.getSelection()?.toString() && (e.preventDefault(), Nt(e.shiftKey ? "path" : "value", r.path));
510
+ return;
511
+ }
512
+ if (e.ctrlKey || e.metaKey || e.altKey || e.nativeEvent.isComposing) return;
513
+ let i = N?.get(r.path), a = {
514
+ ArrowDown: () => Y(W[Math.min(n + 1, W.length - 1)].path),
515
+ ArrowUp: () => Y(W[Math.max(n - 1, 0)].path),
516
+ Home: () => Y(W[0].path),
517
+ End: () => Y(W[W.length - 1].path),
518
+ ArrowRight: () => {
519
+ i && _(i) && (U(r.path) ? Y(G.get(r.path)[0].path) : At(r.path));
520
+ },
521
+ ArrowLeft: () => {
522
+ i && _(i) && U(r.path) ? At(r.path) : r.parent && Y(r.parent);
523
+ },
524
+ Enter: () => Mt(r),
525
+ " ": () => Mt(r),
526
+ "/": () => {
527
+ x && O.current?.focus();
528
+ }
529
+ };
530
+ if (a[e.key] && (e.key !== "/" || x)) e.preventDefault(), a[e.key]();
531
+ else if ([...e.key].length === 1) {
532
+ let t = Date.now(), r = t - M.current.time < ne ? M.current.text + e.key : e.key;
533
+ M.current = {
534
+ text: r,
535
+ time: t
536
+ };
537
+ let i = [...r].every((e) => e === r[0]) ? r[0] : r, a = [...W.slice(n + 1), ...W.slice(0, n + 1)].find((e) => N?.get(e.path)?.key.toLocaleLowerCase(w).startsWith(i.toLocaleLowerCase(w)));
538
+ a && (e.preventDefault(), Y(a.path));
539
+ }
540
+ }, It = (e, t = !1) => {
541
+ let n = L ? e.toLowerCase().indexOf(L.toLowerCase()) : -1, r = (e) => t ? JSON.stringify(e).slice(1, -1) : e;
542
+ return n < 0 ? t ? JSON.stringify(e) : e : /* @__PURE__ */ g(m, { children: [
543
+ t && "\"",
544
+ r(e.slice(0, n)),
545
+ /* @__PURE__ */ h("mark", {
546
+ "data-ui": "json-viewer-match",
547
+ css: Me,
548
+ children: r(e.slice(n, n + L.length))
549
+ }),
550
+ r(e.slice(n + L.length)),
551
+ t && "\""
552
+ ] });
553
+ }, Q = /* @__PURE__ */ new Map();
554
+ for (let [e, t] of W.toReversed().entries()) {
555
+ let n = N?.get(t.path), r = G.get(t.path), i = `${ut}-label-${e}`, a = r ? `${ut}-group-${e}` : void 0;
556
+ Q.set(t.path, /* @__PURE__ */ g("div", {
557
+ "data-ui": "json-viewer-node",
558
+ role: "none",
559
+ children: [/* @__PURE__ */ h("div", {
560
+ id: `${ut}-item-${e}`,
561
+ role: "treeitem",
562
+ "data-ui": "json-viewer-item",
563
+ "aria-labelledby": i,
564
+ "aria-owns": a,
565
+ "aria-level": t.level,
566
+ "aria-posinset": t.position,
567
+ "aria-setsize": t.setSize,
568
+ "aria-expanded": n && _(n) ? U(t.path) : void 0,
569
+ "aria-selected": n ? R === t.path : void 0,
570
+ tabIndex: q === t.path ? 0 : -1,
571
+ css: Ce,
572
+ ref: (e) => {
573
+ e ? k.current.set(t.path, e) : k.current.delete(t.path);
574
+ },
575
+ onFocus: (e) => {
576
+ e.target === e.currentTarget && (A.current = e.currentTarget, z(t.path), n && !j.current && _t(t.path));
577
+ },
578
+ onBlur: (e) => {
579
+ (!e.relatedTarget || !D.current?.contains(e.relatedTarget)) && (A.current = null);
580
+ },
581
+ children: /* @__PURE__ */ g("div", {
582
+ "data-ui": "json-viewer-row",
583
+ className: T?.row?.className,
584
+ css: [we, T?.row?.css],
585
+ style: { "--json-depth": t.level - 1 },
586
+ children: [/* @__PURE__ */ h("span", {
587
+ "data-ui": "json-viewer-caret",
588
+ "data-state": n && _(n) ? U(t.path) ? "open" : "closed" : void 0,
589
+ "aria-hidden": "true",
590
+ css: Ee
591
+ }), /* @__PURE__ */ h("span", {
592
+ "data-ui": "json-viewer-label",
593
+ id: i,
594
+ children: t.more === void 0 ? /* @__PURE__ */ g(m, { children: [
595
+ /* @__PURE__ */ h("span", {
596
+ "data-ui": "json-viewer-key",
597
+ css: De,
598
+ children: It(n.key)
599
+ }),
600
+ /* @__PURE__ */ h("span", {
601
+ css: Oe,
602
+ children: ":"
603
+ }),
604
+ " ",
605
+ n.type === "object" || n.type === "array" ? /* @__PURE__ */ h("span", {
606
+ "data-ui": "json-viewer-type",
607
+ className: T?.value?.className,
608
+ css: [Ae, T?.value?.css],
609
+ children: F.count(n.children.length, n.type)
610
+ }) : /* @__PURE__ */ h("span", {
611
+ "data-ui": "json-viewer-value",
612
+ "data-type": n.type,
613
+ className: T?.value?.className,
614
+ css: [ke, T?.value?.css],
615
+ children: n.type === "string" ? It(String(n.value), !0) : It(JSON.stringify(n.value))
616
+ })
617
+ ] }) : /* @__PURE__ */ h("span", {
618
+ css: je,
619
+ children: F.showMore(t.more)
620
+ })
621
+ })]
622
+ })
623
+ }), r && /* @__PURE__ */ h("div", {
624
+ id: a,
625
+ role: "group",
626
+ "data-ui": "json-viewer-group",
627
+ className: T?.group?.className,
628
+ css: [Te, T?.group?.css],
629
+ style: { "--json-depth": t.level - 1 },
630
+ children: r.map((e) => Q.get(e.path))
631
+ })]
632
+ }, t.path));
633
+ }
634
+ let $ = (e, t, n, r = !1) => /* @__PURE__ */ h(s, {
635
+ "data-ui": "json-viewer-action",
636
+ size: "sm",
637
+ variant: "ghost",
638
+ "aria-label": e,
639
+ title: e,
640
+ className: T?.action?.className,
641
+ css: [xe, T?.action?.css],
642
+ disabled: r,
643
+ onClick: n,
644
+ render: (e) => /* @__PURE__ */ h("button", {
645
+ ...e,
646
+ type: "button",
647
+ disabled: r
648
+ }),
649
+ children: t
650
+ }), Lt = /* @__PURE__ */ h("span", {
651
+ "aria-hidden": "true",
652
+ css: be
653
+ });
654
+ return /* @__PURE__ */ h(t, {
655
+ className: nt,
656
+ styles: fe,
657
+ sx: rt,
658
+ children: (e) => /* @__PURE__ */ g("div", {
659
+ ...lt,
660
+ ref: tt,
661
+ "data-ui": "json-viewer",
662
+ className: e,
663
+ style: {
664
+ "--json-max-height": typeof C == "number" ? `${C}px` : C,
665
+ "--json-row-height": Ze === "sm" ? p.space[8] : p.space[10],
666
+ ...it
667
+ },
668
+ onKeyDown: Ft,
669
+ onClick: (e) => {
670
+ if (ot?.(e), e.defaultPrevented) return;
671
+ let t = e.target.closest("[role=\"treeitem\"]");
672
+ if (!t || !D.current?.contains(t)) return;
673
+ let n = W.find((e) => k.current.get(e.path) === t);
674
+ n && (Y(n.path), Mt(n));
675
+ },
676
+ children: [N ? /* @__PURE__ */ g(m, { children: [
677
+ /* @__PURE__ */ g("div", {
678
+ "data-ui": "json-viewer-toolbar",
679
+ className: T?.toolbar?.className,
680
+ css: [pe, T?.toolbar?.css],
681
+ children: [x && /* @__PURE__ */ g("span", {
682
+ css: me,
683
+ children: [/* @__PURE__ */ h("span", {
684
+ css: he,
685
+ "aria-hidden": "true",
686
+ children: ze
687
+ }), /* @__PURE__ */ h(l, {
688
+ "data-ui": "json-viewer-search",
689
+ ref: O,
690
+ "aria-label": F.search,
691
+ placeholder: F.search,
692
+ value: L,
693
+ onValueChange: gt,
694
+ size: "sm",
695
+ className: T?.search?.className,
696
+ sx: [ge, T?.search?.css],
697
+ slotProps: { control: { css: _e } }
698
+ })]
699
+ }), /* @__PURE__ */ g("span", {
700
+ css: ye,
701
+ children: [
702
+ x && /* @__PURE__ */ g(m, { children: [
703
+ /* @__PURE__ */ h("span", {
704
+ "data-ui": "json-viewer-match-status",
705
+ role: "status",
706
+ "aria-live": "polite",
707
+ "aria-atomic": "true",
708
+ css: ve,
709
+ children: L ? F.match(Math.max(0, H.matches.indexOf(R) + 1), H.matches.length, H.truncated) : ""
710
+ }),
711
+ $(F.previousMatch, Be, () => Pt(-1, !0), !H.matches.length),
712
+ $(F.nextMatch, Ve, () => Pt(1, !0), !H.matches.length),
713
+ Lt
714
+ ] }),
715
+ $(F.expandAll, He, () => {
716
+ B({
717
+ ...V,
718
+ closed: /* @__PURE__ */ new Set()
719
+ }), X([...N.values()].filter(_).map((e) => e.path));
720
+ }),
721
+ $(F.collapseAll, Ue, () => {
722
+ B({
723
+ ...V,
724
+ closed: new Set(H.ancestors)
725
+ }), X(_(N.get(n)) ? [n] : []);
726
+ }),
727
+ S && /* @__PURE__ */ g(m, { children: [
728
+ Lt,
729
+ $(F.copyValue, We, () => {
730
+ Nt("value");
731
+ }),
732
+ $(F.copyPath, Ge, () => {
733
+ Nt("path");
734
+ })
735
+ ] })
736
+ ]
737
+ })]
738
+ }),
739
+ /* @__PURE__ */ h("div", {
740
+ ref: D,
741
+ role: "tree",
742
+ "data-ui": "json-viewer-tree",
743
+ "aria-label": st ?? (E ? void 0 : F.tree),
744
+ "aria-labelledby": E,
745
+ "aria-describedby": ct,
746
+ className: T?.tree?.className,
747
+ css: [Se, T?.tree?.css],
748
+ children: Q.get(n)
749
+ }),
750
+ Je && J && /* @__PURE__ */ g("div", {
751
+ "data-ui": "json-viewer-path-bar",
752
+ className: T?.pathBar?.className,
753
+ css: [Ne, T?.pathBar?.css],
754
+ children: [/* @__PURE__ */ g("span", {
755
+ css: Pe,
756
+ children: [/* @__PURE__ */ h("code", {
757
+ "data-ui": "json-viewer-path",
758
+ css: Fe,
759
+ children: J.path
760
+ }), /* @__PURE__ */ h("span", {
761
+ "data-ui": "json-viewer-current-type",
762
+ css: Ae,
763
+ children: J.type
764
+ })]
765
+ }), /* @__PURE__ */ h("pre", {
766
+ "data-ui": "json-viewer-details",
767
+ dir: "ltr",
768
+ tabIndex: 0,
769
+ css: Ie,
770
+ children: Ke(J.value)
771
+ })]
772
+ })
773
+ ] }) : /* @__PURE__ */ h("div", {
774
+ role: "group",
775
+ "data-ui": "json-viewer-invalid",
776
+ "aria-label": st ?? F.tree,
777
+ "aria-labelledby": E,
778
+ "aria-describedby": ct,
779
+ css: Re,
780
+ children: F.invalidData
781
+ }), /* @__PURE__ */ h("div", {
782
+ role: "status",
783
+ "aria-live": "polite",
784
+ "aria-atomic": "true",
785
+ "data-ui": "json-viewer-status",
786
+ className: T?.status?.className,
787
+ css: [Le, T?.status?.css],
788
+ children: St
789
+ })]
790
+ })
791
+ });
792
+ }
793
+ b.displayName = "JsonViewer";
794
+ function Ke(e) {
795
+ try {
796
+ return JSON.stringify(e, null, 2);
797
+ } catch {
798
+ return "…";
799
+ }
800
+ }
801
+ //#endregion
802
+ export { b as t };