@sanity/ui 3.0.0-static.2 → 3.0.0-static.20

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 (770) hide show
  1. package/README.md +6 -6
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/_visual-editing.cjs +3152 -0
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/buildCommand.cjs +71 -0
  6. package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
  7. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
  8. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  9. package/dist/_chunks-es/_visual-editing.js +3163 -0
  10. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  11. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
  12. package/dist/_chunks-es/refractor.js.map +1 -0
  13. package/dist/_visual-editing.cjs +30 -0
  14. package/dist/_visual-editing.cjs.map +1 -0
  15. package/dist/_visual-editing.d.cts +959 -0
  16. package/dist/_visual-editing.d.ts +545 -392
  17. package/dist/_visual-editing.js +29 -30
  18. package/dist/_visual-editing.js.map +1 -1
  19. package/dist/{cli.js → cli.cjs} +4 -4
  20. package/dist/cli.cjs.map +1 -0
  21. package/dist/css.cjs +4353 -0
  22. package/dist/css.cjs.map +1 -0
  23. package/dist/css.d.cts +10251 -0
  24. package/dist/css.d.ts +9714 -1598
  25. package/dist/css.js +3460 -3818
  26. package/dist/css.js.map +1 -1
  27. package/dist/index.cjs +1594 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/{index.d.mts → index.d.cts} +1435 -918
  30. package/dist/index.d.ts +1435 -918
  31. package/dist/index.js +622 -572
  32. package/dist/index.js.map +1 -1
  33. package/dist/{theme.mjs → theme.cjs} +2821 -2570
  34. package/dist/theme.cjs.map +1 -0
  35. package/dist/{theme.d.mts → theme.d.cts} +330 -310
  36. package/dist/theme.d.ts +330 -310
  37. package/dist/theme.js +2822 -2569
  38. package/dist/theme.js.map +1 -1
  39. package/dist/ui-system.css +24528 -0
  40. package/dist/ui-system.min.css +1 -0
  41. package/dist/ui-theme.css +1184 -0
  42. package/dist/ui-theme.min.css +1 -0
  43. package/dist/ui.css +25715 -0
  44. package/dist/ui.min.css +1 -0
  45. package/exports/_visual-editing.ts +0 -1
  46. package/package.json +78 -78
  47. package/src/cli/buildCommand.ts +77 -25
  48. package/src/cli/index.ts +2 -14
  49. package/src/core/StyleTags.tsx +8 -14
  50. package/src/core/_compat/helpers.ts +72 -0
  51. package/src/core/_compat/index.ts +1 -6
  52. package/src/core/_compat/styles/_responsive.ts +1 -1
  53. package/src/core/_compat/theme/theme.test.tsx +4 -5
  54. package/src/core/_compat/theme/themeColorProvider.tsx +4 -8
  55. package/src/core/_compat/theme/themeContext.ts +5 -5
  56. package/src/core/_compat/theme/themeProvider.tsx +19 -11
  57. package/src/core/_compat/theme/types.ts +2 -4
  58. package/src/core/_compat/theme/useRootTheme.ts +2 -4
  59. package/src/core/_compat/theme/useTheme.ts +3 -7
  60. package/src/core/_compat/types.ts +0 -73
  61. package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
  62. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
  63. package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
  64. package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
  65. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
  66. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
  67. package/src/core/components/autocomplete/autocomplete.tsx +92 -126
  68. package/src/core/components/autocomplete/autocompleteOption.tsx +3 -1
  69. package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
  70. package/src/core/components/autocomplete/constants.ts +1 -1
  71. package/src/core/components/autocomplete/types.ts +4 -9
  72. package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
  73. package/src/core/components/breadcrumbs/breadcrumbs.tsx +34 -28
  74. package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
  75. package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
  76. package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
  77. package/src/core/components/dialog/__workshop__/position.tsx +4 -4
  78. package/src/core/components/dialog/__workshop__/props.tsx +7 -7
  79. package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
  80. package/src/core/components/dialog/dialog.tsx +104 -300
  81. package/src/core/components/dialog/dialogCard.tsx +198 -0
  82. package/src/core/components/dialog/dialogContext.ts +1 -1
  83. package/src/core/components/dialog/dialogProvider.tsx +3 -3
  84. package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
  85. package/src/core/components/dialog/useDialog.ts +1 -1
  86. package/src/core/components/hotkeys/hotkeys.tsx +42 -26
  87. package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
  88. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
  89. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
  90. package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
  91. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
  92. package/src/core/components/menu/__workshop__/groups.tsx +2 -2
  93. package/src/core/components/menu/__workshop__/menuButton.tsx +4 -4
  94. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
  95. package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
  96. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
  97. package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
  98. package/src/core/components/menu/__workshop__/tones.tsx +3 -3
  99. package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
  100. package/src/core/components/menu/menu.test.tsx +6 -7
  101. package/src/core/components/menu/menu.tsx +28 -34
  102. package/src/core/components/menu/menuButton.tsx +19 -23
  103. package/src/core/components/menu/menuContext.ts +1 -1
  104. package/src/core/components/menu/menuDivider.tsx +26 -14
  105. package/src/core/components/menu/menuGroup.tsx +39 -31
  106. package/src/core/components/menu/menuItem.tsx +59 -45
  107. package/src/core/components/menu/useMenu.ts +1 -1
  108. package/src/core/components/menu/useMenuController.ts +4 -4
  109. package/src/core/components/skeleton/__workshop__/delay.tsx +3 -3
  110. package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
  111. package/src/core/components/skeleton/codeSkeleton.tsx +53 -0
  112. package/src/core/components/skeleton/headingSkeleton.tsx +52 -0
  113. package/src/core/components/skeleton/index.ts +3 -0
  114. package/src/core/components/skeleton/labelSkeleton.tsx +51 -0
  115. package/src/core/components/skeleton/skeleton.tsx +40 -17
  116. package/src/core/components/skeleton/textSkeleton.tsx +32 -111
  117. package/src/core/components/tab/__workshop__/example.tsx +2 -2
  118. package/src/core/components/tab/tab.tsx +29 -25
  119. package/src/core/components/tab/tabList.tsx +51 -28
  120. package/src/core/components/tab/tabPanel.tsx +30 -21
  121. package/src/core/components/toast/__workshop__/hook.tsx +1 -1
  122. package/src/core/components/toast/__workshop__/toast.tsx +5 -5
  123. package/src/core/components/toast/toast.test.tsx +5 -5
  124. package/src/core/components/toast/toast.tsx +25 -22
  125. package/src/core/components/toast/toastContext.ts +1 -1
  126. package/src/core/components/toast/toastLayer.tsx +29 -11
  127. package/src/core/components/toast/toastProvider.tsx +3 -7
  128. package/src/core/components/toast/types.ts +3 -7
  129. package/src/core/components/toast/useToast.ts +2 -4
  130. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  131. package/src/core/components/tree/__workshop__/basic.tsx +1 -1
  132. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  133. package/src/core/components/tree/helpers.ts +1 -1
  134. package/src/core/components/tree/tree.tsx +198 -191
  135. package/src/core/components/tree/treeContext.ts +1 -1
  136. package/src/core/components/tree/treeGroup.tsx +26 -6
  137. package/src/core/components/tree/treeItem.tsx +45 -33
  138. package/src/core/components/tree/types.ts +2 -2
  139. package/src/core/components/tree/useTree.ts +1 -1
  140. package/src/core/constants.ts +6 -0
  141. package/src/core/hooks/useClickOutside.test.tsx +15 -16
  142. package/src/core/hooks/useClickOutside.ts +2 -6
  143. package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
  144. package/src/core/hooks/useClickOutsideEvent.ts +3 -9
  145. package/src/core/hooks/useDelayed.test.ts +6 -7
  146. package/src/core/hooks/useDelayedState.ts +1 -1
  147. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
  148. package/src/core/hooks/useElementSize.ts +1 -1
  149. package/src/core/hooks/useForwardedRef.ts +1 -1
  150. package/src/core/hooks/useMatchMedia.ts +13 -31
  151. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
  152. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -18
  153. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +12 -12
  154. package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
  155. package/src/core/hooks/usePrefersDark.test.tsx +1 -0
  156. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
  157. package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
  158. package/src/core/middleware/origin.ts +1 -1
  159. package/src/core/primitives/_selectable/selectable.tsx +34 -21
  160. package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
  161. package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
  162. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
  163. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
  164. package/src/core/primitives/avatar/avatar.tsx +33 -36
  165. package/src/core/primitives/avatar/avatarCounter.tsx +35 -27
  166. package/src/core/primitives/avatar/avatarStack.tsx +35 -28
  167. package/src/core/primitives/avatar/types.ts +3 -3
  168. package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
  169. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
  170. package/src/core/primitives/badge/badge.test.tsx +2 -3
  171. package/src/core/primitives/badge/badge.tsx +34 -33
  172. package/src/core/primitives/badge/types.ts +2 -1
  173. package/src/core/primitives/box/__workshop__/props.tsx +2 -2
  174. package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
  175. package/src/core/primitives/box/box.tsx +76 -31
  176. package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
  177. package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
  178. package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
  179. package/src/core/primitives/button/__workshop__/props.tsx +19 -22
  180. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  181. package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
  182. package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
  183. package/src/core/primitives/button/button.test.tsx +3 -18
  184. package/src/core/primitives/button/button.tsx +75 -73
  185. package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
  186. package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
  187. package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
  188. package/src/core/primitives/card/__workshop__/index.ts +1 -1
  189. package/src/core/primitives/card/__workshop__/interactive.tsx +3 -4
  190. package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
  191. package/src/core/primitives/card/__workshop__/props.tsx +14 -17
  192. package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
  193. package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
  194. package/src/core/primitives/card/card.tsx +53 -43
  195. package/src/core/primitives/card/cardContext.ts +10 -0
  196. package/src/core/primitives/card/cardProvider.tsx +27 -0
  197. package/src/core/primitives/card/index.ts +2 -0
  198. package/src/core/primitives/card/types.ts +19 -3
  199. package/src/core/primitives/card/useCard.ts +8 -0
  200. package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
  201. package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
  202. package/src/core/primitives/checkbox/checkbox.tsx +30 -21
  203. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
  204. package/src/core/primitives/code/__workshop__/props.tsx +4 -7
  205. package/src/core/primitives/code/code.tsx +28 -26
  206. package/src/core/primitives/container/__workshop__/example.tsx +2 -2
  207. package/src/core/primitives/container/container.tsx +29 -18
  208. package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
  209. package/src/core/primitives/flex/flex.tsx +21 -19
  210. package/src/core/primitives/grid/grid.tsx +21 -16
  211. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
  212. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
  213. package/src/core/primitives/heading/heading.tsx +46 -23
  214. package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
  215. package/src/core/primitives/inline/inline.tsx +27 -24
  216. package/src/core/primitives/inline/types.ts +1 -0
  217. package/src/core/primitives/kbd/kbd.tsx +29 -27
  218. package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
  219. package/src/core/primitives/label/label.tsx +45 -30
  220. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
  221. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
  222. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
  223. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
  224. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
  225. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
  226. package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
  227. package/src/core/primitives/popover/constants.ts +1 -1
  228. package/src/core/primitives/popover/floating-ui/size.ts +2 -2
  229. package/src/core/primitives/popover/helpers.ts +1 -1
  230. package/src/core/primitives/popover/popover.tsx +296 -334
  231. package/src/core/primitives/popover/popoverLayer.tsx +149 -0
  232. package/src/core/primitives/popover/types.ts +3 -2
  233. package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
  234. package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
  235. package/src/core/primitives/radio/radio.tsx +33 -17
  236. package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
  237. package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
  238. package/src/core/primitives/select/select.tsx +29 -27
  239. package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
  240. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -5
  241. package/src/core/primitives/spinner/spinner.tsx +26 -14
  242. package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
  243. package/src/core/primitives/stack/stack.tsx +33 -19
  244. package/src/core/primitives/switch/switch.tsx +33 -16
  245. package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
  246. package/src/core/primitives/text/__workshop__/example.tsx +9 -20
  247. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
  248. package/src/core/primitives/text/text.tsx +48 -30
  249. package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
  250. package/src/core/primitives/textArea/textArea.tsx +48 -21
  251. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
  252. package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
  253. package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
  254. package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
  255. package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
  256. package/src/core/primitives/textInput/textInput.tsx +52 -71
  257. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
  258. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
  259. package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
  260. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
  261. package/src/core/primitives/tooltip/constants.ts +1 -1
  262. package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
  263. package/src/core/primitives/tooltip/tooltip.tsx +112 -87
  264. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
  265. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -3
  266. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
  267. package/src/core/primitives/tooltip/tooltipLayer.tsx +107 -0
  268. package/src/core/primitives/types.ts +16 -27
  269. package/src/core/types/avatar.ts +3 -6
  270. package/src/core/types/badge.ts +2 -4
  271. package/src/core/types/button.ts +2 -4
  272. package/src/core/types/card.ts +2 -4
  273. package/src/core/types/dialog.ts +1 -3
  274. package/src/core/types/props.ts +20 -10
  275. package/src/core/types/selectable.ts +1 -1
  276. package/src/core/utils/arrow/arrow.tsx +37 -28
  277. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
  278. package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
  279. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +4 -8
  280. package/src/core/utils/boundaryElement/types.ts +1 -3
  281. package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
  282. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
  283. package/src/core/utils/elementQuery/elementQuery.tsx +43 -19
  284. package/src/core/utils/errorBoundary.tsx +6 -4
  285. package/src/core/utils/index.ts +0 -1
  286. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
  287. package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
  288. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
  289. package/src/core/utils/layer/getLayerContext.test.ts +3 -1
  290. package/src/core/utils/layer/getLayerContext.ts +1 -1
  291. package/src/core/utils/layer/layer.test.tsx +5 -5
  292. package/src/core/utils/layer/layer.tsx +24 -94
  293. package/src/core/utils/layer/layerCard.tsx +92 -0
  294. package/src/core/utils/layer/layerContext.ts +1 -1
  295. package/src/core/utils/layer/layerProvider.tsx +13 -9
  296. package/src/core/utils/layer/useLayer.ts +2 -4
  297. package/src/core/utils/portal/__workshop__/named.tsx +3 -3
  298. package/src/core/utils/portal/portal.test.tsx +5 -5
  299. package/src/core/utils/portal/{portal.ts → portal.tsx} +17 -9
  300. package/src/core/utils/portal/portalContext.ts +1 -1
  301. package/src/core/utils/portal/portalProvider.tsx +4 -8
  302. package/src/core/utils/portal/types.ts +1 -3
  303. package/src/core/utils/portal/usePortal.ts +2 -4
  304. package/src/core/utils/srOnly/srOnly.tsx +27 -22
  305. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
  306. package/src/core/utils/virtualList/virtualList.tsx +72 -54
  307. package/src/css/_assign.ts +3 -0
  308. package/src/css/_compileStyle.ts +156 -0
  309. package/src/css/_compileSystem.ts +7 -0
  310. package/src/css/_compileTheme.ts +13 -0
  311. package/src/css/_composeClassNames.ts +12 -0
  312. package/src/css/_fromEntries.ts +3 -0
  313. package/src/css/_getClassNames.ts +9 -0
  314. package/src/css/_hash.ts +9 -0
  315. package/src/css/_mergeStyles.ts +24 -0
  316. package/src/css/_resp.ts +2 -2
  317. package/src/css/_responsiveRule.ts +38 -0
  318. package/src/css/_scopeClassName.ts +9 -0
  319. package/src/css/_scopeClassNames.ts +12 -0
  320. package/src/css/_system.style.ts +166 -0
  321. package/src/css/aspects/border/border.style.ts +13 -0
  322. package/src/css/aspects/border/border.ts +14 -0
  323. package/src/css/{styles → aspects}/border/types.ts +1 -1
  324. package/src/css/aspects/boxSizing/boxSizing.style.ts +10 -0
  325. package/src/css/aspects/boxSizing/boxSizing.ts +8 -0
  326. package/src/css/aspects/boxSizing/index.ts +2 -0
  327. package/src/css/aspects/boxSizing/types.ts +9 -0
  328. package/src/css/aspects/display/display.style.ts +34 -0
  329. package/src/css/aspects/display/display.ts +8 -0
  330. package/src/css/{styles → aspects}/display/types.ts +3 -4
  331. package/src/css/aspects/flex/flex.ts +13 -0
  332. package/src/css/aspects/flex/flexAlign.style.ts +12 -0
  333. package/src/css/aspects/flex/flexDirection.style.ts +11 -0
  334. package/src/css/aspects/flex/flexJustify.style.ts +13 -0
  335. package/src/css/aspects/flex/flexWrap.style.ts +10 -0
  336. package/src/css/{styles → aspects}/flex/types.ts +5 -13
  337. package/src/css/aspects/flexItem/flex.style.ts +22 -0
  338. package/src/css/aspects/flexItem/flexItem.ts +8 -0
  339. package/src/css/aspects/flexItem/types.ts +25 -0
  340. package/src/css/aspects/font/font.style.ts +83 -0
  341. package/src/css/aspects/font/font.ts +7 -0
  342. package/src/css/aspects/font/types.ts +6 -0
  343. package/src/css/aspects/gap/gap.style.ts +21 -0
  344. package/src/css/aspects/gap/gap.ts +8 -0
  345. package/src/css/{styles → aspects}/gap/types.ts +2 -2
  346. package/src/css/{styles → aspects}/grid/grid.ts +6 -5
  347. package/src/css/aspects/grid/gridAutoColumns.style.ts +11 -0
  348. package/src/css/aspects/grid/gridAutoFlow.style.ts +11 -0
  349. package/src/css/aspects/grid/gridAutoRows.style.ts +11 -0
  350. package/src/css/aspects/grid/gridColumns.style.ts +18 -0
  351. package/src/css/aspects/grid/gridRows.style.ts +18 -0
  352. package/src/css/{styles → aspects}/grid/types.ts +8 -12
  353. package/src/css/aspects/gridItem/gridColumn.style.ts +20 -0
  354. package/src/css/aspects/gridItem/gridColumnEnd.style.ts +20 -0
  355. package/src/css/aspects/gridItem/gridColumnStart.style.ts +20 -0
  356. package/src/css/{styles → aspects}/gridItem/gridItem.ts +4 -4
  357. package/src/css/aspects/gridItem/gridRow.style.ts +20 -0
  358. package/src/css/aspects/gridItem/gridRowEnd.style.ts +20 -0
  359. package/src/css/aspects/gridItem/gridRowStart.style.ts +20 -0
  360. package/src/css/{styles → aspects}/gridItem/types.ts +8 -19
  361. package/src/css/aspects/height/height.style.ts +9 -0
  362. package/src/css/aspects/height/height.ts +16 -0
  363. package/src/css/aspects/height/index.ts +1 -0
  364. package/src/css/{styles → aspects}/index.ts +5 -0
  365. package/src/css/aspects/inset/inset.style.ts +12 -0
  366. package/src/css/{styles → aspects}/inset/inset.ts +4 -3
  367. package/src/css/{styles → aspects}/inset/types.ts +1 -1
  368. package/src/css/aspects/margin/margin.style.ts +56 -0
  369. package/src/css/{styles → aspects}/margin/margin.ts +4 -3
  370. package/src/css/aspects/margin/types.ts +17 -0
  371. package/src/css/aspects/maxWidth/maxWidth.style.ts +16 -0
  372. package/src/css/aspects/maxWidth/maxWidth.ts +8 -0
  373. package/src/css/aspects/maxWidth/types.ts +8 -0
  374. package/src/css/aspects/minHeight/index.ts +2 -0
  375. package/src/css/aspects/minHeight/minHeight.style.ts +9 -0
  376. package/src/css/aspects/minHeight/minHeight.ts +8 -0
  377. package/src/css/aspects/minHeight/types.ts +9 -0
  378. package/src/css/aspects/minWidth/index.ts +2 -0
  379. package/src/css/aspects/minWidth/minWidth.style.ts +13 -0
  380. package/src/css/aspects/minWidth/minWidth.ts +8 -0
  381. package/src/css/aspects/minWidth/types.ts +9 -0
  382. package/src/css/aspects/outline/outline.style.ts +9 -0
  383. package/src/css/aspects/overflow/overflow.style.ts +11 -0
  384. package/src/css/{styles → aspects}/overflow/overflow.ts +4 -3
  385. package/src/css/{styles → aspects}/overflow/types.ts +1 -1
  386. package/src/css/aspects/padding/padding.style.ts +43 -0
  387. package/src/css/{styles → aspects}/padding/padding.ts +4 -3
  388. package/src/css/{styles → aspects}/padding/types.ts +2 -2
  389. package/src/css/aspects/pointerEvents/pointerEvents.style.ts +13 -0
  390. package/src/css/aspects/pointerEvents/pointerEvents.ts +7 -0
  391. package/src/css/aspects/position/position.style.ts +12 -0
  392. package/src/css/aspects/position/position.ts +8 -0
  393. package/src/css/{styles → aspects}/position/types.ts +1 -1
  394. package/src/css/aspects/radius/radius.style.ts +16 -0
  395. package/src/css/aspects/radius/radius.ts +8 -0
  396. package/src/css/aspects/radius/types.ts +8 -0
  397. package/src/css/aspects/shadow/shadow.style.ts +24 -0
  398. package/src/css/aspects/shadow/shadow.ts +8 -0
  399. package/src/css/aspects/shadow/types.ts +8 -0
  400. package/src/css/aspects/textAlign/index.ts +2 -0
  401. package/src/css/aspects/textAlign/textAlign.style.ts +26 -0
  402. package/src/css/aspects/textAlign/textAlign.ts +8 -0
  403. package/src/css/aspects/textAlign/types.ts +7 -0
  404. package/src/css/aspects/textOverflow/textOverflow.style.ts +21 -0
  405. package/src/css/aspects/textOverflow/textOverflow.ts +7 -0
  406. package/src/css/{styles → aspects}/textOverflow/types.ts +1 -0
  407. package/src/css/aspects/width/types.ts +11 -0
  408. package/src/css/aspects/width/width.style.ts +11 -0
  409. package/src/css/aspects/width/width.ts +8 -0
  410. package/src/css/components/breadcrumbs/breadcrumbs.style.ts +9 -0
  411. package/src/css/components/breadcrumbs/breadcrumbs.ts +3 -2
  412. package/src/css/components/dialog/dialog.style.ts +77 -0
  413. package/src/css/components/dialog/dialog.ts +17 -8
  414. package/src/css/components/menu/menu.style.ts +17 -0
  415. package/src/css/components/menu/menu.ts +5 -3
  416. package/src/css/components/skeleton/skeleton.style.ts +104 -0
  417. package/src/css/components/skeleton/skeleton.ts +13 -8
  418. package/src/css/components/skeleton/types.ts +8 -6
  419. package/src/css/components/toast/toast.style.ts +20 -0
  420. package/src/css/components/toast/toast.ts +11 -6
  421. package/src/css/components/tree/tree.style.ts +39 -0
  422. package/src/css/components/tree/tree.ts +3 -2
  423. package/src/css/constants.ts +10 -0
  424. package/src/css/index.ts +8 -8
  425. package/src/css/prefix/constants.ts +6 -0
  426. package/src/css/prefix/types.ts +1 -0
  427. package/src/css/primitives/_arrow/{rules.ts → _arrow.style.ts} +23 -25
  428. package/src/css/primitives/_arrow/_arrow.ts +13 -6
  429. package/src/css/primitives/_input/_input.style.ts +235 -0
  430. package/src/css/primitives/_input/input.ts +18 -13
  431. package/src/css/primitives/_input/types.ts +3 -3
  432. package/src/css/primitives/_selectable/{rules.ts → _selectable.style.ts} +36 -36
  433. package/src/css/primitives/_selectable/selectable.ts +5 -5
  434. package/src/css/primitives/_selectable/types.ts +2 -2
  435. package/src/css/primitives/avatar/{rules.ts → avatar.style.ts} +62 -67
  436. package/src/css/primitives/avatar/avatar.ts +14 -8
  437. package/src/css/primitives/avatar/types.ts +4 -3
  438. package/src/css/primitives/badge/badge.style.ts +21 -0
  439. package/src/css/primitives/badge/badge.ts +8 -4
  440. package/src/css/primitives/badge/types.ts +2 -2
  441. package/src/css/primitives/box/box.style.ts +22 -0
  442. package/src/css/primitives/box/box.ts +16 -10
  443. package/src/css/primitives/box/types.ts +12 -15
  444. package/src/css/primitives/button/button.style.ts +275 -0
  445. package/src/css/primitives/button/button.ts +9 -30
  446. package/src/css/primitives/button/index.ts +1 -0
  447. package/src/css/primitives/button/types.ts +13 -0
  448. package/src/css/primitives/card/card.style.ts +295 -0
  449. package/src/css/primitives/card/card.ts +7 -11
  450. package/src/css/primitives/card/types.ts +4 -5
  451. package/src/css/primitives/checkbox/checkbox.style.ts +178 -0
  452. package/src/css/primitives/checkbox/checkbox.ts +5 -3
  453. package/src/css/primitives/code/code.style.ts +61 -0
  454. package/src/css/primitives/code/code.ts +8 -4
  455. package/src/css/primitives/code/types.ts +2 -2
  456. package/src/css/primitives/container/container.style.ts +10 -0
  457. package/src/css/primitives/container/container.ts +6 -4
  458. package/src/css/primitives/container/types.ts +3 -2
  459. package/src/css/primitives/heading/heading.style.ts +56 -0
  460. package/src/css/primitives/heading/heading.ts +13 -10
  461. package/src/css/primitives/heading/types.ts +4 -2
  462. package/src/css/primitives/kbd/kbd.style.ts +19 -0
  463. package/src/css/primitives/kbd/kbd.ts +6 -4
  464. package/src/css/primitives/kbd/types.ts +1 -1
  465. package/src/css/primitives/label/label.style.ts +52 -0
  466. package/src/css/primitives/label/label.ts +7 -9
  467. package/src/css/primitives/label/types.ts +11 -4
  468. package/src/css/primitives/popover/popover.style.ts +9 -0
  469. package/src/css/primitives/popover/popover.ts +8 -2
  470. package/src/css/primitives/radio/radio.style.ts +84 -0
  471. package/src/css/primitives/radio/radio.ts +3 -2
  472. package/src/css/primitives/select/{rules.ts → select.style.ts} +8 -6
  473. package/src/css/primitives/select/select.ts +7 -4
  474. package/src/css/primitives/select/types.ts +1 -1
  475. package/src/css/primitives/spinner/spinner.style.ts +22 -0
  476. package/src/css/primitives/spinner/spinner.ts +5 -3
  477. package/src/css/primitives/stack/index.ts +1 -0
  478. package/src/css/primitives/stack/stack.style.ts +13 -0
  479. package/src/css/primitives/stack/stack.ts +6 -0
  480. package/src/css/primitives/switch/switch.style.ts +102 -0
  481. package/src/css/primitives/switch/switch.ts +11 -6
  482. package/src/css/primitives/text/text.style.ts +65 -0
  483. package/src/css/primitives/text/text.ts +7 -9
  484. package/src/css/primitives/text/types.ts +7 -2
  485. package/src/css/primitives/textArea/textArea.style.ts +11 -0
  486. package/src/css/primitives/textArea/textArea.ts +5 -3
  487. package/src/css/primitives/textArea/types.ts +1 -1
  488. package/src/css/primitives/textInput/textInput.style.ts +46 -0
  489. package/src/css/primitives/textInput/textInput.ts +20 -4
  490. package/src/css/primitives/textInput/types.ts +2 -8
  491. package/src/css/primitives/token/token.style.ts +50 -0
  492. package/src/css/primitives/tooltip/tooltip.style.ts +9 -0
  493. package/src/css/primitives/tooltip/tooltip.ts +3 -6
  494. package/src/css/renderColor.ts +31 -0
  495. package/src/css/responsiveRules.ts +12 -19
  496. package/src/css/theme/index.ts +14 -0
  497. package/src/css/theme/lib/contract/buildVarContract.ts +76 -0
  498. package/src/css/theme/lib/contract/index.ts +2 -0
  499. package/src/css/theme/lib/contract/types.ts +15 -0
  500. package/src/css/theme/resolveTheme.ts +863 -0
  501. package/src/css/types.ts +29 -755
  502. package/src/css/util.ts +5 -0
  503. package/src/css/utils/srOnly/srOnly.style.ts +14 -0
  504. package/src/css/utils/srOnly/srOnly.ts +4 -2
  505. package/src/theme/getScopedTheme.ts +4 -4
  506. package/src/theme/index.ts +0 -5
  507. package/src/theme/types.ts +6 -10
  508. package/src/theme/v0/color/_generic.ts +1 -1
  509. package/src/theme/v0/color/button.ts +1 -1
  510. package/src/theme/v0/color/card.ts +1 -1
  511. package/src/theme/v0/color/color.ts +11 -11
  512. package/src/theme/v0/color/input.ts +1 -1
  513. package/src/theme/v0/color/muted.ts +1 -1
  514. package/src/theme/v0/color/selectable.ts +1 -1
  515. package/src/theme/v0/color/solid.ts +1 -1
  516. package/src/theme/v0/color/spot.ts +1 -1
  517. package/src/theme/v0/focusRing.ts +1 -3
  518. package/src/theme/v0/font.ts +6 -19
  519. package/src/theme/v0/layer.ts +1 -3
  520. package/src/theme/v0/shadow.ts +2 -6
  521. package/src/theme/v0/styles.ts +1 -1
  522. package/src/theme/v0/theme.ts +7 -7
  523. package/src/theme/v2/avatar.ts +2 -4
  524. package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
  525. package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
  526. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
  527. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
  528. package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
  529. package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
  530. package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
  531. package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
  532. package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
  533. package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
  534. package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
  535. package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
  536. package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
  537. package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
  538. package/src/theme/v2/build/buildTheme.ts +12 -0
  539. package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
  540. package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
  541. package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
  542. package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
  543. package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
  544. package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
  545. package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
  546. package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
  547. package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
  548. package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
  549. package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
  550. package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
  551. package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
  552. package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
  553. package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
  554. package/src/theme/v2/color/_helpers.ts +2 -2
  555. package/src/theme/v2/color/_system.ts +2 -4
  556. package/src/theme/v2/color/avatar.ts +3 -7
  557. package/src/theme/v2/color/badge.ts +3 -7
  558. package/src/theme/v2/color/button.ts +5 -11
  559. package/src/theme/v2/color/color.ts +10 -16
  560. package/src/theme/v2/color/input.ts +8 -10
  561. package/src/theme/v2/color/kbd.ts +1 -3
  562. package/src/theme/v2/color/selectable.ts +4 -8
  563. package/src/theme/v2/color/state.ts +5 -7
  564. package/src/theme/v2/color/syntax.ts +1 -3
  565. package/src/theme/{config → v2/config}/helpers.ts +6 -13
  566. package/src/theme/{config → v2/config}/system.ts +11 -12
  567. package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
  568. package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
  569. package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
  570. package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
  571. package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
  572. package/src/theme/{config → v2/config}/types.ts +8 -6
  573. package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
  574. package/src/theme/{defaults → v2/defaults}/colorTokens.ts +3 -3
  575. package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
  576. package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
  577. package/src/theme/v2/index.ts +2 -0
  578. package/src/theme/v2/input.ts +2 -4
  579. package/src/theme/v2/theme.ts +10 -14
  580. package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
  581. package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
  582. package/src/theme/v3/buildTheme_v3.ts +14 -10
  583. package/src/theme/v3/color/_constants.ts +15 -0
  584. package/src/theme/v3/color/avatar.ts +14 -0
  585. package/src/theme/v3/color/card.ts +58 -95
  586. package/src/theme/v3/color/color.ts +75 -71
  587. package/src/theme/v3/color/element.ts +8 -8
  588. package/src/theme/v3/color/index.ts +2 -2
  589. package/src/theme/v3/color/token.ts +19 -4
  590. package/src/theme/v3/color/tokens.ts +2 -2
  591. package/src/theme/v3/defaultFonts.ts +250 -0
  592. package/src/theme/v3/defaultTokens.ts +199 -0
  593. package/src/theme/v3/index.ts +4 -1
  594. package/src/theme/{palette → v3/palette}/constants.ts +3 -3
  595. package/src/theme/v3/palette/index.ts +2 -0
  596. package/src/theme/v3/palette/types.ts +7 -0
  597. package/src/theme/v3/resolveTokens.ts +70 -65
  598. package/src/theme/v3/tokens.ts +2 -2
  599. package/src/theme/v3/types.ts +95 -11
  600. package/src/theme/versioning/getTheme_v2.ts +3 -3
  601. package/src/theme/versioning/is_v0.ts +2 -2
  602. package/src/theme/versioning/is_v2.ts +2 -2
  603. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  604. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
  605. package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
  606. package/src/theme/versioning/v0_v2.ts +3 -3
  607. package/src/theme/versioning/v2_v0.ts +4 -4
  608. package/src/theme/versioning/v3_v2.ts +39 -38
  609. package/dist/_chunks-cjs/_visual-editing.js +0 -3059
  610. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  611. package/dist/_chunks-cjs/buildCommand.js +0 -32
  612. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  613. package/dist/_chunks-cjs/refractor.js.map +0 -1
  614. package/dist/_chunks-cjs/v3_v2.js +0 -251
  615. package/dist/_chunks-cjs/v3_v2.js.map +0 -1
  616. package/dist/_chunks-es/_visual-editing.mjs +0 -3066
  617. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  618. package/dist/_chunks-es/refractor.mjs.map +0 -1
  619. package/dist/_chunks-es/v3_v2.mjs +0 -252
  620. package/dist/_chunks-es/v3_v2.mjs.map +0 -1
  621. package/dist/_visual-editing.d.mts +0 -806
  622. package/dist/_visual-editing.mjs +0 -31
  623. package/dist/_visual-editing.mjs.map +0 -1
  624. package/dist/cli.js.map +0 -1
  625. package/dist/css.d.mts +0 -2135
  626. package/dist/css.mjs +0 -4713
  627. package/dist/css.mjs.map +0 -1
  628. package/dist/index.mjs +0 -1542
  629. package/dist/index.mjs.map +0 -1
  630. package/dist/sanity-palette.css +0 -9
  631. package/dist/sanity-theme.css +0 -1
  632. package/dist/system.css +0 -3577
  633. package/dist/theme.mjs.map +0 -1
  634. package/src/core/primitives/popover/popoverCard.tsx +0 -148
  635. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
  636. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  637. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  638. package/src/css/compile/compilePalette.ts +0 -60
  639. package/src/css/compile/compileRule.ts +0 -90
  640. package/src/css/compile/compileRules.test.ts +0 -35
  641. package/src/css/compile/compileRules.ts +0 -40
  642. package/src/css/compile/compileSystem.ts +0 -7
  643. package/src/css/compile/compileTheme.ts +0 -15
  644. package/src/css/compile/compileTheme_v3.ts +0 -410
  645. package/src/css/compile/types.ts +0 -6
  646. package/src/css/components/breadcrumbs/rules.ts +0 -25
  647. package/src/css/components/dialog/rules.ts +0 -76
  648. package/src/css/components/menu/rules.ts +0 -15
  649. package/src/css/components/skeleton/rules.ts +0 -112
  650. package/src/css/components/toast/rules.ts +0 -17
  651. package/src/css/components/tree/rules.ts +0 -168
  652. package/src/css/composeClassNames.ts +0 -13
  653. package/src/css/primitives/_input/rules.ts +0 -163
  654. package/src/css/primitives/_selectable/__style.ts +0 -117
  655. package/src/css/primitives/_selectable/_contants.ts +0 -11
  656. package/src/css/primitives/badge/rules.ts +0 -22
  657. package/src/css/primitives/box/rules.ts +0 -28
  658. package/src/css/primitives/button/_constants.ts +0 -17
  659. package/src/css/primitives/button/rules.ts +0 -293
  660. package/src/css/primitives/card/_constants.ts +0 -13
  661. package/src/css/primitives/card/rules.ts +0 -471
  662. package/src/css/primitives/checkbox/__styles.ts +0 -129
  663. package/src/css/primitives/checkbox/rules.ts +0 -152
  664. package/src/css/primitives/code/rules.ts +0 -96
  665. package/src/css/primitives/container/rules.ts +0 -8
  666. package/src/css/primitives/heading/rules.ts +0 -155
  667. package/src/css/primitives/kbd/rules.ts +0 -20
  668. package/src/css/primitives/label/rules.ts +0 -137
  669. package/src/css/primitives/popover/rules.ts +0 -5
  670. package/src/css/primitives/radio/rules.ts +0 -121
  671. package/src/css/primitives/spinner/rules.ts +0 -20
  672. package/src/css/primitives/switch/rules.ts +0 -340
  673. package/src/css/primitives/text/rules.ts +0 -164
  674. package/src/css/primitives/textArea/rules.ts +0 -7
  675. package/src/css/primitives/textInput/rules.ts +0 -224
  676. package/src/css/primitives/token/rules.ts +0 -45
  677. package/src/css/primitives/tooltip/rules.ts +0 -19
  678. package/src/css/rules.ts +0 -113
  679. package/src/css/styles/border/border.ts +0 -22
  680. package/src/css/styles/border/rules.ts +0 -24
  681. package/src/css/styles/display/display.ts +0 -7
  682. package/src/css/styles/display/rules.ts +0 -62
  683. package/src/css/styles/flex/flex.ts +0 -20
  684. package/src/css/styles/flex/rules.ts +0 -28
  685. package/src/css/styles/flexItem/flexItem.ts +0 -8
  686. package/src/css/styles/flexItem/rules.ts +0 -12
  687. package/src/css/styles/flexItem/types.ts +0 -11
  688. package/src/css/styles/font/font.ts +0 -17
  689. package/src/css/styles/font/rules.ts +0 -148
  690. package/src/css/styles/font/types.ts +0 -12
  691. package/src/css/styles/gap/gap.ts +0 -8
  692. package/src/css/styles/gap/rules.ts +0 -34
  693. package/src/css/styles/grid/rules.ts +0 -146
  694. package/src/css/styles/gridItem/rules.ts +0 -96
  695. package/src/css/styles/height/rules.ts +0 -7
  696. package/src/css/styles/inset/rules.ts +0 -16
  697. package/src/css/styles/margin/rules.ts +0 -64
  698. package/src/css/styles/margin/types.ts +0 -11
  699. package/src/css/styles/maxWidth/maxWidth.ts +0 -6
  700. package/src/css/styles/maxWidth/rules.ts +0 -13
  701. package/src/css/styles/maxWidth/types.ts +0 -7
  702. package/src/css/styles/outline/rules.ts +0 -7
  703. package/src/css/styles/overflow/rules.ts +0 -9
  704. package/src/css/styles/padding/rules.ts +0 -62
  705. package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
  706. package/src/css/styles/pointerEvents/rules.ts +0 -11
  707. package/src/css/styles/position/position.ts +0 -7
  708. package/src/css/styles/position/rules.ts +0 -24
  709. package/src/css/styles/radius/radius.ts +0 -8
  710. package/src/css/styles/radius/rules.ts +0 -13
  711. package/src/css/styles/radius/types.ts +0 -8
  712. package/src/css/styles/shadow/rules.ts +0 -53
  713. package/src/css/styles/shadow/shadow.ts +0 -7
  714. package/src/css/styles/shadow/types.ts +0 -8
  715. package/src/css/styles/textOverflow/rules.ts +0 -17
  716. package/src/css/styles/textOverflow/textOverflow.ts +0 -6
  717. package/src/css/styles/width/rules.ts +0 -7
  718. package/src/css/styles/width/types.ts +0 -9
  719. package/src/css/styles/width/width.ts +0 -6
  720. package/src/css/utils/srOnly/rules.ts +0 -11
  721. package/src/css/varNames.ts +0 -473
  722. package/src/css/vars.ts +0 -443
  723. package/src/theme/_types.ts +0 -41
  724. package/src/theme/build/buildTheme.ts +0 -12
  725. package/src/theme/build/theme.test.ts +0 -27
  726. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  727. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  728. package/src/theme/palette/types.ts +0 -16
  729. package/src/theme/v3/buildTheme_v3.test.ts +0 -40
  730. package/src/theme/v3/color/buildColor_v3.ts +0 -193
  731. package/src/theme/v3/color/parseColor.test.ts +0 -79
  732. package/src/theme/v3/color/renderColor.test.ts +0 -19
  733. package/src/theme/v3/color/renderColor.ts +0 -33
  734. package/src/theme/v3/defaults.ts +0 -205
  735. /package/dist/{cli.d.ts → cli.d.cts} +0 -0
  736. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
  737. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
  738. /package/src/css/{styles → aspects}/border/index.ts +0 -0
  739. /package/src/css/{styles → aspects}/display/index.ts +0 -0
  740. /package/src/css/{styles → aspects}/flex/index.ts +0 -0
  741. /package/src/css/{styles → aspects}/flexItem/index.ts +0 -0
  742. /package/src/css/{styles → aspects}/font/index.ts +0 -0
  743. /package/src/css/{styles → aspects}/gap/index.ts +0 -0
  744. /package/src/css/{styles → aspects}/grid/index.ts +0 -0
  745. /package/src/css/{styles → aspects}/gridItem/index.ts +0 -0
  746. /package/src/css/{styles → aspects}/inset/index.ts +0 -0
  747. /package/src/css/{styles → aspects}/margin/index.ts +0 -0
  748. /package/src/css/{styles → aspects}/maxWidth/index.ts +0 -0
  749. /package/src/css/{styles → aspects}/overflow/index.ts +0 -0
  750. /package/src/css/{styles → aspects}/padding/index.ts +0 -0
  751. /package/src/css/{styles → aspects}/pointerEvents/index.ts +0 -0
  752. /package/src/css/{styles → aspects}/pointerEvents/types.ts +0 -0
  753. /package/src/css/{styles → aspects}/position/index.ts +0 -0
  754. /package/src/css/{styles → aspects}/radius/index.ts +0 -0
  755. /package/src/css/{styles → aspects}/shadow/index.ts +0 -0
  756. /package/src/css/{styles → aspects}/textOverflow/index.ts +0 -0
  757. /package/src/css/{styles → aspects}/width/index.ts +0 -0
  758. /package/src/{theme/palette → css/prefix}/index.ts +0 -0
  759. /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
  760. /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
  761. /package/src/theme/{build → v2/build}/index.ts +0 -0
  762. /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
  763. /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
  764. /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
  765. /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
  766. /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
  767. /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
  768. /package/src/theme/{build → v2/build}/merge.ts +0 -0
  769. /package/src/theme/{config → v2/config}/index.ts +0 -0
  770. /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
@@ -0,0 +1,3152 @@
1
+ "use strict";
2
+ var jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"), react = require("react"), styledComponents = require("styled-components"), css = require("@sanity/ui/css"), reactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), useEffectEvent = require("use-effect-event"), reactDom = require("react-dom");
3
+ function getGlobalScope() {
4
+ if (typeof globalThis < "u") return globalThis;
5
+ if (typeof window < "u") return window;
6
+ if (typeof self < "u") return self;
7
+ if (typeof global < "u") return global;
8
+ throw new Error("@sanity/ui: could not locate global scope");
9
+ }
10
+ const globalScope = getGlobalScope();
11
+ function createGlobalScopedContext(key2, defaultValue) {
12
+ const symbol = Symbol.for(key2);
13
+ return typeof document > "u" ? react.createContext(defaultValue) : (globalScope[symbol] = globalScope[symbol] || react.createContext(defaultValue), globalScope[symbol]);
14
+ }
15
+ const CardContext = createGlobalScopedContext("@sanity/ui/context/card", null);
16
+ function CardProvider(props) {
17
+ const $ = reactCompilerRuntime.c(7), {
18
+ children,
19
+ tone,
20
+ scheme,
21
+ unstable_CompatProvider
22
+ } = props;
23
+ let t0, t1;
24
+ $[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t1 = {
25
+ tone,
26
+ scheme,
27
+ unstable_CompatProvider
28
+ }, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t1) : t1 = $[3], t0 = t1;
29
+ let t2;
30
+ return $[4] !== children || $[5] !== t0 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t2) : t2 = $[6], t2;
31
+ }
32
+ CardProvider.displayName = "CardProvider";
33
+ const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
34
+ function ThemeProvider(props) {
35
+ const $ = reactCompilerRuntime.c(19), parentTheme = react.useContext(ThemeContext), {
36
+ children
37
+ } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
38
+ let t0;
39
+ bb0: {
40
+ if (!rootTheme) {
41
+ t0 = null;
42
+ break bb0;
43
+ }
44
+ let t12;
45
+ $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
46
+ version: 0,
47
+ theme: rootTheme,
48
+ scheme,
49
+ tone
50
+ }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
51
+ }
52
+ const themeContext = t0;
53
+ let t1;
54
+ bb1: {
55
+ if (!rootTheme) {
56
+ t1 = null;
57
+ break bb1;
58
+ }
59
+ let t22;
60
+ $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = theme.getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
61
+ }
62
+ const theme$1 = t1;
63
+ if (!theme$1) {
64
+ let t22;
65
+ return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
66
+ }
67
+ let t2;
68
+ $[9] !== children || $[10] !== theme$1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }), $[9] = children, $[10] = theme$1, $[11] = t2) : t2 = $[11];
69
+ let t3;
70
+ $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14];
71
+ let t4;
72
+ return $[15] !== scheme || $[16] !== t3 || $[17] !== tone ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { scheme, tone, unstable_CompatProvider: ThemeColorProvider, children: t3 }), $[15] = scheme, $[16] = t3, $[17] = tone, $[18] = t4) : t4 = $[18], t4;
73
+ }
74
+ ThemeProvider.displayName = "ThemeProvider";
75
+ function useRootTheme() {
76
+ const value = react.useContext(ThemeContext);
77
+ if (!value)
78
+ throw new Error("useRootTheme(): missing context value");
79
+ return value;
80
+ }
81
+ function ThemeColorProvider(props) {
82
+ const $ = reactCompilerRuntime.c(5), {
83
+ children,
84
+ scheme,
85
+ tone
86
+ } = props, root = useRootTheme(), t0 = scheme || root.scheme;
87
+ let t1;
88
+ return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
89
+ }
90
+ ThemeColorProvider.displayName = "ThemeColorProvider";
91
+ function useTheme() {
92
+ return styledComponents.useTheme();
93
+ }
94
+ function useTheme_v2() {
95
+ const $ = reactCompilerRuntime.c(2), t0 = styledComponents.useTheme();
96
+ let t1;
97
+ return $[0] !== t0 ? (t1 = theme.getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
98
+ }
99
+ const EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
100
+ card: {
101
+ initial: {
102
+ scale: 0.97,
103
+ willChange: "transform"
104
+ },
105
+ hidden: {
106
+ opacity: 0
107
+ },
108
+ visible: {
109
+ opacity: 1,
110
+ transition: {
111
+ when: "beforeChildren",
112
+ duration: 0.1
113
+ }
114
+ },
115
+ scaleIn: {
116
+ scale: 1
117
+ },
118
+ scaleOut: {
119
+ scale: 0.97
120
+ }
121
+ },
122
+ transition: {
123
+ type: "spring",
124
+ visualDuration: 0.2,
125
+ bounce: 0.25
126
+ }
127
+ }, Z_OFFSETS = {
128
+ dialog: 600,
129
+ popover: 400,
130
+ tooltip: 200
131
+ };
132
+ function _isEnterToClickElement(element) {
133
+ return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
134
+ }
135
+ function isHTMLElement(node) {
136
+ return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
137
+ }
138
+ function isHTMLAnchorElement(element) {
139
+ return isHTMLElement(element) && element.nodeName === "A";
140
+ }
141
+ function isHTMLInputElement(element) {
142
+ return isHTMLElement(element) && element.nodeName === "INPUT";
143
+ }
144
+ function isHTMLButtonElement(element) {
145
+ return isHTMLElement(element) && element.nodeName === "BUTTON";
146
+ }
147
+ function isHTMLSelectElement(element) {
148
+ return isHTMLElement(element) && element.nodeName === "SELECT";
149
+ }
150
+ function isHTMLTextAreaElement(element) {
151
+ return isHTMLElement(element) && element.nodeName === "TEXTAREA";
152
+ }
153
+ function containsOrEqualsElement(element, node) {
154
+ return element.contains(node) || element === node;
155
+ }
156
+ function _getArrayProp(val, defaultVal) {
157
+ return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
158
+ }
159
+ function _isScrollable(el) {
160
+ if (!(el instanceof Element)) return !1;
161
+ const style = window.getComputedStyle(el);
162
+ return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
163
+ }
164
+ function useArrayProp(val, defaultVal) {
165
+ const $ = reactCompilerRuntime.c(3);
166
+ let t0;
167
+ $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
168
+ const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
169
+ return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
170
+ }
171
+ function useClickOutsideEvent(listener, t0, boundaryElement) {
172
+ const $ = reactCompilerRuntime.c(9), elementsArg = t0 === void 0 ? _temp$7 : t0;
173
+ let t1;
174
+ $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
175
+ if (!listener)
176
+ return;
177
+ const target = evt.target;
178
+ if (!(target instanceof Node))
179
+ return;
180
+ const resolvedBoundaryElement = boundaryElement?.();
181
+ if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
182
+ return;
183
+ const elements = elementsArg().flat();
184
+ for (const el of elements)
185
+ if (el && (target === el || el.contains(target)))
186
+ return;
187
+ listener(evt);
188
+ }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
189
+ const onEvent = useEffectEvent.useEffectEvent(t1), hasListener = !!listener;
190
+ let t2;
191
+ $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
192
+ if (!hasListener)
193
+ return;
194
+ const handleEvent = (evt_0) => onEvent(evt_0);
195
+ return document.addEventListener("mousedown", handleEvent), () => {
196
+ document.removeEventListener("mousedown", handleEvent);
197
+ };
198
+ }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
199
+ let t3;
200
+ $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], react.useEffect(t2, t3), react.useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
201
+ }
202
+ function _temp$7() {
203
+ return EMPTY_ARRAY;
204
+ }
205
+ function useCustomValidity(ref, customValidity) {
206
+ const $ = reactCompilerRuntime.c(6);
207
+ let t0;
208
+ $[0] !== customValidity || $[1] !== ref.current ? (t0 = () => {
209
+ ref.current?.setCustomValidity(customValidity || "");
210
+ }, $[0] = customValidity, $[1] = ref.current, $[2] = t0) : t0 = $[2];
211
+ let t1;
212
+ $[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], react.useEffect(t0, t1);
213
+ }
214
+ const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : resizeObserver.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
215
+ function _createElementRectValueListener() {
216
+ return {
217
+ subscribe(element, subscriber) {
218
+ const resizeObserver2 = new _ResizeObserver(([entry]) => {
219
+ subscriber({
220
+ _contentRect: entry.contentRect,
221
+ border: {
222
+ width: entry.borderBoxSize[0].inlineSize,
223
+ height: entry.borderBoxSize[0].blockSize
224
+ },
225
+ content: {
226
+ width: entry.contentRect.width,
227
+ height: entry.contentRect.height
228
+ }
229
+ });
230
+ });
231
+ return resizeObserver2.observe(element), () => {
232
+ resizeObserver2.unobserve(element), resizeObserver2.disconnect();
233
+ };
234
+ }
235
+ };
236
+ }
237
+ function _createElementSizeObserver() {
238
+ const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
239
+ return {
240
+ subscribe(element, subscriber) {
241
+ const subscribers = subscribersCache.get(element) || [];
242
+ let dispose = disposeCache.get(element);
243
+ return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
244
+ for (const sub of subscribers)
245
+ sub(elementRect);
246
+ })), subscribers.push(subscriber), () => {
247
+ const idx = subscribers.indexOf(subscriber);
248
+ idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
249
+ };
250
+ }
251
+ };
252
+ }
253
+ function useElementSize(element) {
254
+ const $ = reactCompilerRuntime.c(3), [size2, setSize] = react.useState(null);
255
+ let t0, t1;
256
+ return $[0] !== element ? (t0 = () => {
257
+ if (element)
258
+ return _elementSizeObserver.subscribe(element, setSize);
259
+ }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), react.useEffect(t0, t1), size2;
260
+ }
261
+ function useGlobalKeyDown(onKeyDown) {
262
+ const $ = reactCompilerRuntime.c(5);
263
+ let t0;
264
+ $[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
265
+ const handleKeyDown = useEffectEvent.useEffectEvent(t0);
266
+ let t1;
267
+ $[2] !== handleKeyDown ? (t1 = () => {
268
+ const handler = (event_0) => handleKeyDown(event_0);
269
+ return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
270
+ }, $[2] = handleKeyDown, $[3] = t1) : t1 = $[3];
271
+ let t2;
272
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[4] = t2) : t2 = $[4], react.useEffect(t1, t2);
273
+ }
274
+ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
275
+ const $ = reactCompilerRuntime.c(4);
276
+ react.useDebugValue(mediaQueryString);
277
+ let t0;
278
+ $[0] !== mediaQueryString ? (t0 = (onStoreChange) => {
279
+ const media2 = window.matchMedia(mediaQueryString);
280
+ return media2.addEventListener("change", onStoreChange), () => media2.removeEventListener("change", onStoreChange);
281
+ }, $[0] = mediaQueryString, $[1] = t0) : t0 = $[1];
282
+ let t1;
283
+ return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], react.useSyncExternalStore(t0, t1, getServerSnapshot2);
284
+ }
285
+ const media = Object.values(css.BREAKPOINTS);
286
+ function _getMediaQuery(media2, index) {
287
+ return index === 0 ? `screen and (max-width: ${media2[index + 1] - 1}px)` : index === media2.length - 1 ? `screen and (min-width: ${media2[index]}px)` : `screen and (min-width: ${media2[index]}px) and (max-width: ${media2[index + 1] - 1}px)`;
288
+ }
289
+ function _createMediaStore() {
290
+ const mediaLen = media.length;
291
+ let sizes;
292
+ const getSizes = () => {
293
+ if (!sizes) {
294
+ sizes = [];
295
+ for (let index = mediaLen; index > -1; index -= 1) {
296
+ const mediaQuery = _getMediaQuery(media, index);
297
+ sizes.push({
298
+ index,
299
+ mq: window.matchMedia(mediaQuery)
300
+ });
301
+ }
302
+ }
303
+ return sizes;
304
+ };
305
+ return {
306
+ getSnapshot: () => {
307
+ for (const {
308
+ index,
309
+ mq
310
+ } of getSizes())
311
+ if (mq.matches) return index;
312
+ return 0;
313
+ },
314
+ subscribe: (onStoreChange) => {
315
+ const disposeFns = [];
316
+ for (const {
317
+ mq
318
+ } of getSizes()) {
319
+ const handleChange = () => {
320
+ mq.matches && onStoreChange();
321
+ };
322
+ mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
323
+ }
324
+ return () => {
325
+ for (const disposeFn of disposeFns)
326
+ disposeFn();
327
+ };
328
+ }
329
+ };
330
+ }
331
+ function getServerSnapshot() {
332
+ return 0;
333
+ }
334
+ function useMediaIndex() {
335
+ const $ = reactCompilerRuntime.c(1);
336
+ let t0, t1;
337
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = _createMediaStore(), $[0] = t1) : t1 = $[0], t0 = t1;
338
+ const store = t0;
339
+ return react.useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
340
+ }
341
+ function usePrefersDark(t0) {
342
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$6 : t0);
343
+ }
344
+ function _temp$6() {
345
+ return !1;
346
+ }
347
+ function usePrefersReducedMotion(t0) {
348
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$5 : t0);
349
+ }
350
+ function _temp$5() {
351
+ return !1;
352
+ }
353
+ const DEFAULT_BOX_ELEMENT = "div";
354
+ function Box(props) {
355
+ const $ = reactCompilerRuntime.c(130), t0 = props;
356
+ let align, autoCols, autoFlow, autoRows, borderBottom, borderLeft, borderRight, borderTop, children, className, column, columnEnd, columnStart, columns, direction, flex, gap, gapX, gapY, height, inset, insetBottom, insetLeft, insetRight, insetTop, justify, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, muted, outline, overflow, overflowX, overflowY, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pointerEvents, position, radius, rest, row, rowEnd, rowStart, rows, t1, t2, t3, t4, t5, t6, t7, t8, textAlign, width, wrap;
357
+ $[0] !== t0 ? ({
358
+ align,
359
+ as: t1,
360
+ autoCols,
361
+ autoFlow,
362
+ autoRows,
363
+ border: t2,
364
+ borderTop,
365
+ borderRight,
366
+ borderBottom,
367
+ borderLeft,
368
+ className,
369
+ children,
370
+ column,
371
+ columnStart,
372
+ columnEnd,
373
+ columns,
374
+ direction,
375
+ display: t3,
376
+ flex,
377
+ gap,
378
+ gapX,
379
+ gapY,
380
+ height,
381
+ inset,
382
+ insetBottom,
383
+ insetLeft,
384
+ insetRight,
385
+ insetTop,
386
+ justify,
387
+ margin: t4,
388
+ marginX,
389
+ marginY,
390
+ marginTop,
391
+ marginRight,
392
+ marginBottom,
393
+ marginLeft,
394
+ maxWidth,
395
+ minHeight: t5,
396
+ minWidth: t6,
397
+ muted,
398
+ outline,
399
+ overflow,
400
+ overflowX,
401
+ overflowY,
402
+ padding: t7,
403
+ paddingX,
404
+ paddingY,
405
+ paddingTop,
406
+ paddingRight,
407
+ paddingBottom,
408
+ paddingLeft,
409
+ pointerEvents,
410
+ position,
411
+ radius,
412
+ row,
413
+ rows,
414
+ rowStart,
415
+ rowEnd,
416
+ sizing: t8,
417
+ textAlign,
418
+ width,
419
+ wrap,
420
+ ...rest
421
+ } = t0, $[0] = t0, $[1] = align, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = borderBottom, $[6] = borderLeft, $[7] = borderRight, $[8] = borderTop, $[9] = children, $[10] = className, $[11] = column, $[12] = columnEnd, $[13] = columnStart, $[14] = columns, $[15] = direction, $[16] = flex, $[17] = gap, $[18] = gapX, $[19] = gapY, $[20] = height, $[21] = inset, $[22] = insetBottom, $[23] = insetLeft, $[24] = insetRight, $[25] = insetTop, $[26] = justify, $[27] = marginBottom, $[28] = marginLeft, $[29] = marginRight, $[30] = marginTop, $[31] = marginX, $[32] = marginY, $[33] = maxWidth, $[34] = muted, $[35] = outline, $[36] = overflow, $[37] = overflowX, $[38] = overflowY, $[39] = paddingBottom, $[40] = paddingLeft, $[41] = paddingRight, $[42] = paddingTop, $[43] = paddingX, $[44] = paddingY, $[45] = pointerEvents, $[46] = position, $[47] = radius, $[48] = rest, $[49] = row, $[50] = rowEnd, $[51] = rowStart, $[52] = rows, $[53] = t1, $[54] = t2, $[55] = t3, $[56] = t4, $[57] = t5, $[58] = t6, $[59] = t7, $[60] = t8, $[61] = textAlign, $[62] = width, $[63] = wrap) : (align = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], borderBottom = $[5], borderLeft = $[6], borderRight = $[7], borderTop = $[8], children = $[9], className = $[10], column = $[11], columnEnd = $[12], columnStart = $[13], columns = $[14], direction = $[15], flex = $[16], gap = $[17], gapX = $[18], gapY = $[19], height = $[20], inset = $[21], insetBottom = $[22], insetLeft = $[23], insetRight = $[24], insetTop = $[25], justify = $[26], marginBottom = $[27], marginLeft = $[28], marginRight = $[29], marginTop = $[30], marginX = $[31], marginY = $[32], maxWidth = $[33], muted = $[34], outline = $[35], overflow = $[36], overflowX = $[37], overflowY = $[38], paddingBottom = $[39], paddingLeft = $[40], paddingRight = $[41], paddingTop = $[42], paddingX = $[43], paddingY = $[44], pointerEvents = $[45], position = $[46], radius = $[47], rest = $[48], row = $[49], rowEnd = $[50], rowStart = $[51], rows = $[52], t1 = $[53], t2 = $[54], t3 = $[55], t4 = $[56], t5 = $[57], t6 = $[58], t7 = $[59], t8 = $[60], textAlign = $[61], width = $[62], wrap = $[63]);
422
+ const Element2 = t1 === void 0 ? DEFAULT_BOX_ELEMENT : t1, border = t2 === void 0 ? !1 : t2, display = t3 === void 0 ? "block" : t3, margin = t4 === void 0 ? 0 : t4, minHeight = t5 === void 0 ? 0 : t5, minWidth = t6 === void 0 ? 0 : t6, padding = t7 === void 0 ? 0 : t7, sizing = t8 === void 0 ? "border" : t8;
423
+ let t9;
424
+ $[64] !== align || $[65] !== autoCols || $[66] !== autoFlow || $[67] !== autoRows || $[68] !== border || $[69] !== borderBottom || $[70] !== borderLeft || $[71] !== borderRight || $[72] !== borderTop || $[73] !== className || $[74] !== column || $[75] !== columnEnd || $[76] !== columnStart || $[77] !== columns || $[78] !== direction || $[79] !== display || $[80] !== flex || $[81] !== gap || $[82] !== gapX || $[83] !== gapY || $[84] !== height || $[85] !== inset || $[86] !== insetBottom || $[87] !== insetLeft || $[88] !== insetRight || $[89] !== insetTop || $[90] !== justify || $[91] !== margin || $[92] !== marginBottom || $[93] !== marginLeft || $[94] !== marginRight || $[95] !== marginTop || $[96] !== marginX || $[97] !== marginY || $[98] !== maxWidth || $[99] !== minHeight || $[100] !== minWidth || $[101] !== muted || $[102] !== outline || $[103] !== overflow || $[104] !== overflowX || $[105] !== overflowY || $[106] !== padding || $[107] !== paddingBottom || $[108] !== paddingLeft || $[109] !== paddingRight || $[110] !== paddingTop || $[111] !== paddingX || $[112] !== paddingY || $[113] !== pointerEvents || $[114] !== position || $[115] !== radius || $[116] !== row || $[117] !== rowEnd || $[118] !== rowStart || $[119] !== rows || $[120] !== sizing || $[121] !== textAlign || $[122] !== width || $[123] !== wrap ? (t9 = css._composeClassNames(className, css.box({
425
+ align,
426
+ autoCols,
427
+ autoFlow,
428
+ autoRows,
429
+ border,
430
+ borderTop,
431
+ borderRight,
432
+ borderBottom,
433
+ borderLeft,
434
+ column,
435
+ columnStart,
436
+ columnEnd,
437
+ columns,
438
+ direction,
439
+ display,
440
+ flex,
441
+ gap,
442
+ gapX,
443
+ gapY,
444
+ height,
445
+ inset,
446
+ insetBottom,
447
+ insetLeft,
448
+ insetRight,
449
+ insetTop,
450
+ justify,
451
+ margin,
452
+ marginX,
453
+ marginY,
454
+ marginTop,
455
+ marginRight,
456
+ marginBottom,
457
+ marginLeft,
458
+ maxWidth,
459
+ minHeight,
460
+ minWidth,
461
+ muted,
462
+ outline,
463
+ overflow,
464
+ overflowX,
465
+ overflowY,
466
+ padding,
467
+ paddingX,
468
+ paddingY,
469
+ paddingTop,
470
+ paddingRight,
471
+ paddingBottom,
472
+ paddingLeft,
473
+ pointerEvents,
474
+ position,
475
+ radius,
476
+ row,
477
+ rows,
478
+ rowStart,
479
+ rowEnd,
480
+ sizing,
481
+ textAlign,
482
+ width,
483
+ wrap
484
+ })), $[64] = align, $[65] = autoCols, $[66] = autoFlow, $[67] = autoRows, $[68] = border, $[69] = borderBottom, $[70] = borderLeft, $[71] = borderRight, $[72] = borderTop, $[73] = className, $[74] = column, $[75] = columnEnd, $[76] = columnStart, $[77] = columns, $[78] = direction, $[79] = display, $[80] = flex, $[81] = gap, $[82] = gapX, $[83] = gapY, $[84] = height, $[85] = inset, $[86] = insetBottom, $[87] = insetLeft, $[88] = insetRight, $[89] = insetTop, $[90] = justify, $[91] = margin, $[92] = marginBottom, $[93] = marginLeft, $[94] = marginRight, $[95] = marginTop, $[96] = marginX, $[97] = marginY, $[98] = maxWidth, $[99] = minHeight, $[100] = minWidth, $[101] = muted, $[102] = outline, $[103] = overflow, $[104] = overflowX, $[105] = overflowY, $[106] = padding, $[107] = paddingBottom, $[108] = paddingLeft, $[109] = paddingRight, $[110] = paddingTop, $[111] = paddingX, $[112] = paddingY, $[113] = pointerEvents, $[114] = position, $[115] = radius, $[116] = row, $[117] = rowEnd, $[118] = rowStart, $[119] = rows, $[120] = sizing, $[121] = textAlign, $[122] = width, $[123] = wrap, $[124] = t9) : t9 = $[124];
485
+ let t10;
486
+ return $[125] !== Element2 || $[126] !== children || $[127] !== rest || $[128] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Box", ...rest, className: t9, children }), $[125] = Element2, $[126] = children, $[127] = rest, $[128] = t9, $[129] = t10) : t10 = $[129], t10;
487
+ }
488
+ Box.displayName = "Box";
489
+ const DEFAULT_LABEL_ELEMENT = "div";
490
+ function Label(props) {
491
+ const $ = reactCompilerRuntime.c(28);
492
+ let accent, align, children, className, rest, t0, t1, t2, t3, textOverflowProp;
493
+ $[0] !== props ? ({
494
+ accent,
495
+ align,
496
+ as: t0,
497
+ children,
498
+ className,
499
+ muted: t1,
500
+ size: t2,
501
+ textOverflow: textOverflowProp,
502
+ weight: t3,
503
+ ...rest
504
+ } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = children, $[4] = className, $[5] = rest, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = textOverflowProp) : (accent = $[1], align = $[2], children = $[3], className = $[4], rest = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], textOverflowProp = $[10]);
505
+ const Element2 = t0 === void 0 ? DEFAULT_LABEL_ELEMENT : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 1 : t2, weight = t3 === void 0 ? "regular" : t3;
506
+ let t4;
507
+ $[11] !== accent || $[12] !== align || $[13] !== className || $[14] !== muted || $[15] !== size2 || $[16] !== weight ? (t4 = css._composeClassNames(className, css.label({
508
+ accent,
509
+ align,
510
+ muted,
511
+ size: size2,
512
+ weight
513
+ })), $[11] = accent, $[12] = align, $[13] = className, $[14] = muted, $[15] = size2, $[16] = weight, $[17] = t4) : t4 = $[17];
514
+ let t5;
515
+ $[18] !== textOverflowProp ? (t5 = css.textOverflow({
516
+ textOverflow: textOverflowProp
517
+ }), $[18] = textOverflowProp, $[19] = t5) : t5 = $[19];
518
+ let t6;
519
+ $[20] !== children || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[20] = children, $[21] = t5, $[22] = t6) : t6 = $[22];
520
+ let t7;
521
+ return $[23] !== Element2 || $[24] !== rest || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Label", ...rest, className: t4, children: t6 }), $[23] = Element2, $[24] = rest, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t7;
522
+ }
523
+ Label.displayName = "Label";
524
+ const DEFAULT_AVATAR_ELEMENT = "div";
525
+ function Avatar(props) {
526
+ const $ = reactCompilerRuntime.c(51), t0 = props;
527
+ let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, className, initials, onImageLoadError, rest, src, t1, t2, t3, t4, title;
528
+ $[0] !== t0 ? ({
529
+ __unstable_hideInnerStroke,
530
+ as: t1,
531
+ className,
532
+ color: t2,
533
+ src,
534
+ title,
535
+ initials,
536
+ onImageLoadError,
537
+ arrowPosition: arrowPositionProp,
538
+ animateArrowFrom,
539
+ status: t3,
540
+ size: t4,
541
+ ...rest
542
+ } = t0, $[0] = t0, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = className, $[5] = initials, $[6] = onImageLoadError, $[7] = rest, $[8] = src, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = t4, $[13] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], className = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], title = $[13]);
543
+ const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t4 === void 0 ? 1 : t4, size2 = useArrayProp(sizeProp), [arrowPosition, setArrowPosition] = react.useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = react.useState(!1);
544
+ let t5, t6;
545
+ $[14] !== arrowPosition || $[15] !== arrowPositionProp ? (t5 = () => {
546
+ if (arrowPosition === arrowPositionProp)
547
+ return;
548
+ const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
549
+ return () => cancelAnimationFrame(raf);
550
+ }, t6 = [arrowPosition, arrowPositionProp], $[14] = arrowPosition, $[15] = arrowPositionProp, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), react.useEffect(t5, t6);
551
+ let t7, t8;
552
+ $[18] !== src ? (t7 = () => {
553
+ src && setImageError(!1);
554
+ }, t8 = [src], $[18] = src, $[19] = t7, $[20] = t8) : (t7 = $[19], t8 = $[20]), react.useEffect(t7, t8);
555
+ let t9;
556
+ $[21] !== onImageLoadError ? (t9 = () => {
557
+ setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
558
+ }, $[21] = onImageLoadError, $[22] = t9) : t9 = $[22];
559
+ const handleImageError = t9;
560
+ let t10, t11;
561
+ $[23] !== size2 ? (t11 = size2.map(_temp$4), $[23] = size2, $[24] = t11) : t11 = $[24], t10 = t11;
562
+ const initialsSize = t10, t12 = __unstable_hideInnerStroke ? "" : void 0;
563
+ let t13;
564
+ $[25] !== className || $[26] !== color || $[27] !== sizeProp ? (t13 = css._composeClassNames(className, css.avatar({
565
+ color,
566
+ size: sizeProp
567
+ })), $[25] = className, $[26] = color, $[27] = sizeProp, $[28] = t13) : t13 = $[28];
568
+ const t14 = imageError ? "" : void 0;
569
+ let t15;
570
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t15 = css.avatarArrow(), $[29] = t15) : t15 = $[29];
571
+ let t16;
572
+ $[30] !== color ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t15, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[30] = color, $[31] = t16) : t16 = $[31];
573
+ let t17;
574
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t17 = css.avatarInitials(), $[32] = t17) : t17 = $[32];
575
+ let t18;
576
+ $[33] !== initials || $[34] !== initialsSize ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(Box, { align: "center", as: "span", className: t17, display: "flex", justify: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[33] = initials, $[34] = initialsSize, $[35] = t18) : t18 = $[35];
577
+ let t19;
578
+ $[36] !== handleImageError || $[37] !== initials || $[38] !== src ? (t19 = src && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: css.avatarImage(), inset: 0, position: "absolute", children: [
579
+ /* @__PURE__ */ jsxRuntime.jsx("img", { alt: initials, onError: handleImageError, src }),
580
+ /* @__PURE__ */ jsxRuntime.jsx("span", {})
581
+ ] }), $[36] = handleImageError, $[37] = initials, $[38] = src, $[39] = t19) : t19 = $[39];
582
+ let t20;
583
+ return $[40] !== Element2 || $[41] !== arrowPosition || $[42] !== rest || $[43] !== t12 || $[44] !== t13 || $[45] !== t14 || $[46] !== t16 || $[47] !== t18 || $[48] !== t19 || $[49] !== title ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(Element2, { "data-hide-inner-stroke": t12, "data-ui": "Avatar", ...rest, "aria-label": title, className: t13, "data-arrow-position": arrowPosition, "data-image-error": t14, title, children: [
584
+ t16,
585
+ t18,
586
+ t19
587
+ ] }), $[40] = Element2, $[41] = arrowPosition, $[42] = rest, $[43] = t12, $[44] = t13, $[45] = t14, $[46] = t16, $[47] = t18, $[48] = t19, $[49] = title, $[50] = t20) : t20 = $[50], t20;
588
+ }
589
+ function _temp$4(s) {
590
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
591
+ }
592
+ Avatar.displayName = "Avatar";
593
+ const DEFAULT_AVATAR_COUNTER_ELEMENT = "div";
594
+ function AvatarCounter(props) {
595
+ const $ = reactCompilerRuntime.c(19), t0 = props;
596
+ let className, count, rest, t1, t2;
597
+ $[0] !== t0 ? ({
598
+ as: t1,
599
+ className,
600
+ count,
601
+ size: t2,
602
+ ...rest
603
+ } = t0, $[0] = t0, $[1] = className, $[2] = count, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], count = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
604
+ const as = t1 === void 0 ? DEFAULT_AVATAR_COUNTER_ELEMENT : t1, size2 = useArrayProp(t2 === void 0 ? 1 : t2);
605
+ let t3, t4;
606
+ $[6] !== size2 ? (t4 = size2.map(_temp$3), $[6] = size2, $[7] = t4) : t4 = $[7], t3 = t4;
607
+ const labelSize = t3;
608
+ let t5;
609
+ $[8] !== className || $[9] !== size2 ? (t5 = css._composeClassNames(className, css.avatarCounter({
610
+ size: size2
611
+ })), $[8] = className, $[9] = size2, $[10] = t5) : t5 = $[10];
612
+ let t6;
613
+ $[11] !== count || $[12] !== labelSize ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: labelSize, weight: "medium", children: count }), $[11] = count, $[12] = labelSize, $[13] = t6) : t6 = $[13];
614
+ let t7;
615
+ return $[14] !== as || $[15] !== rest || $[16] !== t5 || $[17] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "AvatarCounter", ...rest, align: "center", as, className: t5, display: "flex", justify: "center", paddingX: 2, sizing: "border", children: t6 }), $[14] = as, $[15] = rest, $[16] = t5, $[17] = t6, $[18] = t7) : t7 = $[18], t7;
616
+ }
617
+ function _temp$3(s) {
618
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
619
+ }
620
+ AvatarCounter.displayName = "AvatarCounter";
621
+ const DEFAULT_AVATAR_STACK_ELEMENT = "div";
622
+ function AvatarStack(props) {
623
+ const $ = reactCompilerRuntime.c(20), t0 = props;
624
+ let childrenProp, className, rest, t1, t2, t3;
625
+ $[0] !== t0 ? ({
626
+ as: t1,
627
+ children: childrenProp,
628
+ className,
629
+ maxLength: t2,
630
+ size: t3,
631
+ ...rest
632
+ } = t0, $[0] = t0, $[1] = childrenProp, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3) : (childrenProp = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6]);
633
+ const as = t1 === void 0 ? DEFAULT_AVATAR_STACK_ELEMENT : t1, maxLengthProp = t2 === void 0 ? 4 : t2, sizeProp = t3 === void 0 ? 1 : t3, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = Box, t4 = "AvatarStack", t5 = "center";
634
+ let t6;
635
+ $[7] !== className || $[8] !== size2 ? (t6 = css._composeClassNames(className, css.avatarStack({
636
+ size: size2
637
+ })), $[7] = className, $[8] = size2, $[9] = t6) : t6 = $[9];
638
+ const t7 = "flex", t8 = len === 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }), t9 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) });
639
+ let t10;
640
+ $[10] !== size2 ? (t10 = (child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: react.cloneElement(child, {
641
+ size: size2
642
+ }) }, String(childIndex)), $[10] = size2, $[11] = t10) : t10 = $[11];
643
+ const t11 = visibleChildren.map(t10);
644
+ let t12;
645
+ return $[12] !== T0 || $[13] !== as || $[14] !== rest || $[15] !== t11 || $[16] !== t6 || $[17] !== t8 || $[18] !== t9 ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { "data-ui": t4, ...rest, align: t5, as, className: t6, display: t7, children: [
646
+ t8,
647
+ t9,
648
+ t11
649
+ ] }), $[12] = T0, $[13] = as, $[14] = rest, $[15] = t11, $[16] = t6, $[17] = t8, $[18] = t9, $[19] = t12) : t12 = $[19], t12;
650
+ }
651
+ AvatarStack.displayName = "AvatarStack";
652
+ const DEFAULT_TEXT_ELEMENT = "div";
653
+ function Text(props) {
654
+ const $ = reactCompilerRuntime.c(30), t0 = props;
655
+ let accent, align, children, className, flex, muted, rest, t1, t2, t3, textOverflowProp;
656
+ $[0] !== t0 ? ({
657
+ accent,
658
+ align,
659
+ as: t1,
660
+ children,
661
+ className,
662
+ flex,
663
+ muted,
664
+ size: t2,
665
+ textOverflow: textOverflowProp,
666
+ weight: t3,
667
+ ...rest
668
+ } = t0, $[0] = t0, $[1] = accent, $[2] = align, $[3] = children, $[4] = className, $[5] = flex, $[6] = muted, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = textOverflowProp) : (accent = $[1], align = $[2], children = $[3], className = $[4], flex = $[5], muted = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], textOverflowProp = $[11]);
669
+ const Element2 = t1 === void 0 ? DEFAULT_TEXT_ELEMENT : t1, size2 = t2 === void 0 ? 2 : t2, weight = t3 === void 0 ? "regular" : t3;
670
+ let t4;
671
+ $[12] !== accent || $[13] !== align || $[14] !== className || $[15] !== flex || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t4 = css._composeClassNames(className, css.text({
672
+ accent,
673
+ align,
674
+ flex,
675
+ muted,
676
+ size: size2,
677
+ weight
678
+ })), $[12] = accent, $[13] = align, $[14] = className, $[15] = flex, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t4) : t4 = $[19];
679
+ let t5;
680
+ $[20] !== textOverflowProp ? (t5 = css.textOverflow({
681
+ textOverflow: textOverflowProp
682
+ }), $[20] = textOverflowProp, $[21] = t5) : t5 = $[21];
683
+ let t6;
684
+ $[22] !== children || $[23] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[22] = children, $[23] = t5, $[24] = t6) : t6 = $[24];
685
+ let t7;
686
+ return $[25] !== Element2 || $[26] !== rest || $[27] !== t4 || $[28] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Text", ...rest, className: t4, children: t6 }), $[25] = Element2, $[26] = rest, $[27] = t4, $[28] = t6, $[29] = t7) : t7 = $[29], t7;
687
+ }
688
+ Text.displayName = "Text";
689
+ const DEFAULT_BADGE_ELEMENT = "span";
690
+ function Badge(props) {
691
+ const $ = reactCompilerRuntime.c(22), t0 = props;
692
+ let children, className, rest, t1, t2, t3, t4, t5;
693
+ $[0] !== t0 ? ({
694
+ as: t1,
695
+ children,
696
+ className,
697
+ fontSize: t2,
698
+ padding: t3,
699
+ radius: t4,
700
+ tone: t5,
701
+ ...rest
702
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5) : (children = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8]);
703
+ const as = t1 === void 0 ? DEFAULT_BADGE_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 1 : t3, radius = t4 === void 0 ? 2 : t4, tone = t5 === void 0 ? "default" : t5;
704
+ let t6;
705
+ $[9] !== className || $[10] !== radius || $[11] !== tone ? (t6 = css._composeClassNames(className, css.badge({
706
+ radius,
707
+ tone
708
+ })), $[9] = className, $[10] = radius, $[11] = tone, $[12] = t6) : t6 = $[12];
709
+ let t7;
710
+ $[13] !== children || $[14] !== fontSize ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, children }), $[13] = children, $[14] = fontSize, $[15] = t7) : t7 = $[15];
711
+ let t8;
712
+ return $[16] !== as || $[17] !== padding || $[18] !== rest || $[19] !== t6 || $[20] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Badge", ...rest, as, className: t6, display: "inline-flex", maxWidth: "fill", padding, children: t7 }), $[16] = as, $[17] = padding, $[18] = rest, $[19] = t6, $[20] = t7, $[21] = t8) : t8 = $[21], t8;
713
+ }
714
+ Badge.displayName = "Badge";
715
+ function AnimatedSpinnerIcon(props) {
716
+ const $ = reactCompilerRuntime.c(8);
717
+ let className, rest;
718
+ $[0] !== props ? ({
719
+ className,
720
+ ...rest
721
+ } = props, $[0] = props, $[1] = className, $[2] = rest) : (className = $[1], rest = $[2]);
722
+ let t0;
723
+ $[3] !== className ? (t0 = css._composeClassNames(className, css.animatedSpinnerIcon()), $[3] = className, $[4] = t0) : t0 = $[4];
724
+ let t1;
725
+ return $[5] !== rest || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, { ...rest, "data-sanity-icon": "animated-spinner", className: t0 }), $[5] = rest, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
726
+ }
727
+ AnimatedSpinnerIcon.displayName = "AnimatedSpinnerIcon";
728
+ const DEFAULT_SPINNER_ELEMENT = "div";
729
+ function Spinner(props) {
730
+ const $ = reactCompilerRuntime.c(8), t0 = props;
731
+ let rest, t1;
732
+ $[0] !== t0 ? ({
733
+ as: t1,
734
+ ...rest
735
+ } = t0, $[0] = t0, $[1] = rest, $[2] = t1) : (rest = $[1], t1 = $[2]);
736
+ const as = t1 === void 0 ? DEFAULT_SPINNER_ELEMENT : t1;
737
+ let t2, t3;
738
+ $[3] === Symbol.for("react.memo_cache_sentinel") ? (t2 = css.spinner(), t3 = /* @__PURE__ */ jsxRuntime.jsx(AnimatedSpinnerIcon, {}), $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]);
739
+ let t4;
740
+ return $[5] !== as || $[6] !== rest ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Text, { as, "data-ui": "Spinner", ...rest, className: t2, children: t3 }), $[5] = as, $[6] = rest, $[7] = t4) : t4 = $[7], t4;
741
+ }
742
+ Spinner.displayName = "Spinner";
743
+ const DEFAULT_BUTTON_ELEMENT = "button";
744
+ function Button(props) {
745
+ const {
746
+ align = "center",
747
+ as: Element2 = DEFAULT_BUTTON_ELEMENT,
748
+ children,
749
+ className,
750
+ disabled,
751
+ display = "inline-flex",
752
+ flex,
753
+ fontSize = 1,
754
+ gap = props.space ?? props.padding ?? 3,
755
+ gapX,
756
+ gapY,
757
+ icon: IconComponent,
758
+ iconRight: IconRightComponent,
759
+ justify = "center",
760
+ loading,
761
+ mode = "default",
762
+ padding = 3,
763
+ paddingX,
764
+ paddingY,
765
+ paddingTop,
766
+ paddingBottom,
767
+ paddingLeft,
768
+ paddingRight,
769
+ radius = 2,
770
+ selected,
771
+ space = props.gap ?? props.space ?? props.padding ?? 3,
772
+ // eslint-disable-line @typescript-eslint/no-unused-vars
773
+ text,
774
+ textAlign,
775
+ textOverflow = "ellipsis",
776
+ textWeight = "medium",
777
+ tone = "default",
778
+ type = "button",
779
+ muted = !1,
780
+ width,
781
+ ...rest
782
+ } = props;
783
+ let href;
784
+ return "href" in rest && (href = typeof rest.href == "string" ? rest.href : href, delete rest.href), /* @__PURE__ */ jsxRuntime.jsxs(
785
+ Element2,
786
+ {
787
+ "data-ui": "Button",
788
+ ...rest,
789
+ className: css._composeClassNames(className, css.button({
790
+ display,
791
+ flex,
792
+ radius,
793
+ width
794
+ })),
795
+ "data-disabled": loading || disabled ? "" : void 0,
796
+ "data-mode": mode,
797
+ "data-tone": tone,
798
+ "data-selected": selected ? "" : void 0,
799
+ disabled: !!(loading || disabled),
800
+ href: disabled ? void 0 : href,
801
+ type,
802
+ children: [
803
+ !!loading && /* @__PURE__ */ jsxRuntime.jsx(Box, { align: "center", as: "span", className: css.buttonLoadingBox(), display: "flex", flex: 1, justify: "center", width: "fill", children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: fontSize }) }),
804
+ (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Box, { align, as: "span", display: "flex", flex: 1, gap, gapX, gapY, justify, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children: [
805
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
806
+ react.isValidElement(IconComponent) && IconComponent,
807
+ reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
808
+ ] }),
809
+ text && /* @__PURE__ */ jsxRuntime.jsx(Text, { align: textAlign, as: "span", flex: "none", muted, size: fontSize, textOverflow, weight: textWeight, children: text }),
810
+ IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
811
+ react.isValidElement(IconRightComponent) && IconRightComponent,
812
+ reactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
813
+ ] })
814
+ ] }),
815
+ children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", flex: 1, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children })
816
+ ]
817
+ }
818
+ );
819
+ }
820
+ Button.displayName = "Button";
821
+ function useCard() {
822
+ return react.useContext(CardContext);
823
+ }
824
+ const DEFAULT_CARD_ELEMENT = "div";
825
+ function Card(props) {
826
+ const $ = reactCompilerRuntime.c(40), t0 = props;
827
+ let className, disabled, pressed, rest, schemeProp, selected, shadow, style, t1, t2, t3, t4, t5;
828
+ $[0] !== t0 ? ({
829
+ __unstable_checkered: t1,
830
+ __unstable_focusRing: t2,
831
+ as: t3,
832
+ className,
833
+ disabled,
834
+ pressed,
835
+ radius: t4,
836
+ scheme: schemeProp,
837
+ selected,
838
+ shadow,
839
+ style,
840
+ tone: t5,
841
+ ...rest
842
+ } = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = pressed, $[4] = rest, $[5] = schemeProp, $[6] = selected, $[7] = shadow, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = t4, $[13] = t5) : (className = $[1], disabled = $[2], pressed = $[3], rest = $[4], schemeProp = $[5], selected = $[6], shadow = $[7], style = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], t5 = $[13]);
843
+ const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent = useCard(), tone = toneProp === "inherit" ? parent?.tone : toneProp, scheme = schemeProp === void 0 ? parent?.scheme : schemeProp, t6 = scheme === parent?.scheme ? void 0 : scheme;
844
+ let t7;
845
+ $[14] !== className || $[15] !== shadow || $[16] !== t6 || $[17] !== tone ? (t7 = css._composeClassNames(className, css.card({
846
+ scheme: t6,
847
+ shadow,
848
+ tone
849
+ })), $[14] = className, $[15] = shadow, $[16] = t6, $[17] = tone, $[18] = t7) : t7 = $[18];
850
+ const t8 = checkered ? "" : void 0, t9 = disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
851
+ let t13;
852
+ $[19] !== as || $[20] !== radius || $[21] !== rest || $[22] !== style || $[23] !== t10 || $[24] !== t11 || $[25] !== t12 || $[26] !== t7 || $[27] !== t8 || $[28] !== t9 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[19] = as, $[20] = radius, $[21] = rest, $[22] = style, $[23] = t10, $[24] = t11, $[25] = t12, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = t13) : t13 = $[29];
853
+ let node = t13;
854
+ if (scheme === parent?.scheme && tone === parent?.tone)
855
+ return node;
856
+ const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
857
+ let t17;
858
+ if ($[30] !== node || $[31] !== t14 || $[32] !== t15 || $[33] !== t16 ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { scheme: t14, tone: t15, unstable_CompatProvider: t16, children: node }), $[30] = node, $[31] = t14, $[32] = t15, $[33] = t16, $[34] = t17) : t17 = $[34], node = t17, parent?.unstable_CompatProvider) {
859
+ const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent?.tone ?? "default";
860
+ let t20;
861
+ return $[35] !== CompatProvider || $[36] !== node || $[37] !== t18 || $[38] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[35] = CompatProvider, $[36] = node, $[37] = t18, $[38] = t19, $[39] = t20) : t20 = $[39], t20;
862
+ }
863
+ return node;
864
+ }
865
+ Card.displayName = "Card";
866
+ const DEFAULT_CHECKBOX_ELEMENT = "input";
867
+ function Checkbox(props) {
868
+ const $ = reactCompilerRuntime.c(32), t0 = props;
869
+ let checked, className, customValidity, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
870
+ $[0] !== t0 ? ({
871
+ as: t1,
872
+ checked,
873
+ className,
874
+ disabled,
875
+ indeterminate,
876
+ customValidity,
877
+ readOnly,
878
+ ref: forwardedRef,
879
+ style,
880
+ ...rest
881
+ } = t0, $[0] = t0, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = forwardedRef, $[6] = indeterminate, $[7] = readOnly, $[8] = rest, $[9] = style, $[10] = t1) : (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], forwardedRef = $[5], indeterminate = $[6], readOnly = $[7], rest = $[8], style = $[9], t1 = $[10]);
882
+ const Element2 = t1 === void 0 ? DEFAULT_CHECKBOX_ELEMENT : t1, ref = react.useRef(null);
883
+ let t2;
884
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], react.useImperativeHandle(forwardedRef, t2);
885
+ let t3, t4;
886
+ $[12] !== indeterminate ? (t3 = () => {
887
+ ref.current && (ref.current.indeterminate = indeterminate || !1);
888
+ }, t4 = [indeterminate], $[12] = indeterminate, $[13] = t3, $[14] = t4) : (t3 = $[13], t4 = $[14]), react.useEffect(t3, t4), useCustomValidity(ref, customValidity);
889
+ let t5;
890
+ $[15] !== className ? (t5 = css._composeClassNames(className, css.checkbox()), $[15] = className, $[16] = t5) : t5 = $[16];
891
+ let t6;
892
+ $[17] !== className ? (t6 = css._composeClassNames(className, css.checkboxInput()), $[17] = className, $[18] = t6) : t6 = $[18];
893
+ const t7 = customValidity ? "" : void 0, t8 = disabled || readOnly;
894
+ let t9;
895
+ $[19] !== Element2 || $[20] !== checked || $[21] !== readOnly || $[22] !== rest || $[23] !== t6 || $[24] !== t7 || $[25] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, checked, className: t6, "data-invalid": t7, disabled: t8, type: "checkbox", readOnly, ref }), $[19] = Element2, $[20] = checked, $[21] = readOnly, $[22] = rest, $[23] = t6, $[24] = t7, $[25] = t8, $[26] = t9) : t9 = $[26];
896
+ let t10;
897
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
898
+ /* @__PURE__ */ jsxRuntime.jsx(icons.CheckmarkIcon, {}),
899
+ /* @__PURE__ */ jsxRuntime.jsx(icons.RemoveIcon, {})
900
+ ] }), $[27] = t10) : t10 = $[27];
901
+ let t11;
902
+ return $[28] !== style || $[29] !== t5 || $[30] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t5, "data-ui": "Checkbox", style, children: [
903
+ t9,
904
+ t10
905
+ ] }), $[28] = style, $[29] = t5, $[30] = t9, $[31] = t11) : t11 = $[31], t11;
906
+ }
907
+ Checkbox.displayName = "Checkbox";
908
+ const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
909
+ return require("./refractor.cjs");
910
+ })), DEFAULT_CODE_ELEMENT = "pre";
911
+ function Code(props) {
912
+ const $ = reactCompilerRuntime.c(25), t0 = props;
913
+ let children, className, languageProp, rest, t1, t2, t3;
914
+ $[0] !== t0 ? ({
915
+ as: t1,
916
+ children,
917
+ className,
918
+ language: languageProp,
919
+ size: t2,
920
+ weight: t3,
921
+ ...rest
922
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = rest, $[5] = t1, $[6] = t2, $[7] = t3) : (children = $[1], className = $[2], languageProp = $[3], rest = $[4], t1 = $[5], t2 = $[6], t3 = $[7]);
923
+ const Element2 = t1 === void 0 ? DEFAULT_CODE_ELEMENT : t1, size2 = t2 === void 0 ? 2 : t2, weight = t3 === void 0 ? "regular" : t3, language = typeof languageProp == "string" ? languageProp : void 0;
924
+ let t4;
925
+ $[8] !== className || $[9] !== size2 || $[10] !== weight ? (t4 = css._composeClassNames(className, css.code({
926
+ size: size2,
927
+ weight
928
+ })), $[8] = className, $[9] = size2, $[10] = weight, $[11] = t4) : t4 = $[11];
929
+ let t5;
930
+ $[12] !== children ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[12] = children, $[13] = t5) : t5 = $[13];
931
+ let t6;
932
+ $[14] !== children || $[15] !== language ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: children }), $[14] = children, $[15] = language, $[16] = t6) : t6 = $[16];
933
+ let t7;
934
+ $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: t5, children: t6 }), $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19];
935
+ let t8;
936
+ return $[20] !== Element2 || $[21] !== rest || $[22] !== t4 || $[23] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Code", ...rest, className: t4, children: t7 }), $[20] = Element2, $[21] = rest, $[22] = t4, $[23] = t7, $[24] = t8) : t8 = $[24], t8;
937
+ }
938
+ Code.displayName = "Code";
939
+ const DEFAULT_CONTAINER_ELEMENT = "div";
940
+ function Container(props) {
941
+ const $ = reactCompilerRuntime.c(12), t0 = props;
942
+ let className, rest, t1, t2;
943
+ $[0] !== t0 ? ({
944
+ as: t1,
945
+ className,
946
+ width: t2,
947
+ ...rest
948
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1, $[4] = t2) : (className = $[1], rest = $[2], t1 = $[3], t2 = $[4]);
949
+ const as = t1 === void 0 ? DEFAULT_CONTAINER_ELEMENT : t1, width = t2 === void 0 ? 2 : t2;
950
+ let t3;
951
+ $[5] !== className || $[6] !== width ? (t3 = css._composeClassNames(className, css.container({
952
+ width
953
+ })), $[5] = className, $[6] = width, $[7] = t3) : t3 = $[7];
954
+ let t4;
955
+ return $[8] !== as || $[9] !== rest || $[10] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Container", ...rest, as, className: t3 }), $[8] = as, $[9] = rest, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
956
+ }
957
+ Container.displayName = "Container";
958
+ const DEFAULT_FLEX_ELEMENT = "div";
959
+ function Flex(props) {
960
+ const $ = reactCompilerRuntime.c(8), t0 = props;
961
+ let rest, t1, t2;
962
+ $[0] !== t0 ? ({
963
+ as: t1,
964
+ direction: t2,
965
+ ...rest
966
+ } = t0, $[0] = t0, $[1] = rest, $[2] = t1, $[3] = t2) : (rest = $[1], t1 = $[2], t2 = $[3]);
967
+ const as = t1 === void 0 ? DEFAULT_FLEX_ELEMENT : t1, direction = t2 === void 0 ? "row" : t2;
968
+ let t3;
969
+ return $[4] !== as || $[5] !== direction || $[6] !== rest ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Flex", ...rest, as, direction, display: "flex" }), $[4] = as, $[5] = direction, $[6] = rest, $[7] = t3) : t3 = $[7], t3;
970
+ }
971
+ Flex.displayName = "Flex";
972
+ const DEFAULT_GRID_ELEMENT = "div";
973
+ function Grid(props) {
974
+ const $ = reactCompilerRuntime.c(8), t0 = props;
975
+ let children, rest, t1;
976
+ $[0] !== t0 ? ({
977
+ as: t1,
978
+ children,
979
+ ...rest
980
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
981
+ const as = t1 === void 0 ? DEFAULT_GRID_ELEMENT : t1;
982
+ let t2;
983
+ return $[4] !== as || $[5] !== children || $[6] !== rest ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Grid", ...rest, as, display: "grid", children }), $[4] = as, $[5] = children, $[6] = rest, $[7] = t2) : t2 = $[7], t2;
984
+ }
985
+ Grid.displayName = "Grid";
986
+ const DEFAULT_HEADING_ELEMENT = "div";
987
+ function Heading(props) {
988
+ const $ = reactCompilerRuntime.c(30), t0 = props;
989
+ let align, children, className, flex, rest, t1, t2, t3, t4, t5, textOverflowProp;
990
+ $[0] !== t0 ? ({
991
+ accent: t1,
992
+ align,
993
+ as: t2,
994
+ children,
995
+ className,
996
+ flex,
997
+ muted: t3,
998
+ size: t4,
999
+ textOverflow: textOverflowProp,
1000
+ weight: t5,
1001
+ ...rest
1002
+ } = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = t4, $[10] = t5, $[11] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8], t4 = $[9], t5 = $[10], textOverflowProp = $[11]);
1003
+ const accent = t1 === void 0 ? !1 : t1, Element2 = t2 === void 0 ? DEFAULT_HEADING_ELEMENT : t2, muted = t3 === void 0 ? !1 : t3, size2 = t4 === void 0 ? 2 : t4, weight = t5 === void 0 ? "regular" : t5;
1004
+ let t6;
1005
+ $[12] !== accent || $[13] !== align || $[14] !== className || $[15] !== flex || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t6 = css._composeClassNames(className, css.heading({
1006
+ accent,
1007
+ align,
1008
+ flex,
1009
+ muted,
1010
+ size: size2,
1011
+ weight
1012
+ })), $[12] = accent, $[13] = align, $[14] = className, $[15] = flex, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t6) : t6 = $[19];
1013
+ let t7;
1014
+ $[20] !== textOverflowProp ? (t7 = css.textOverflow({
1015
+ textOverflow: textOverflowProp
1016
+ }), $[20] = textOverflowProp, $[21] = t7) : t7 = $[21];
1017
+ let t8;
1018
+ $[22] !== children || $[23] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t7, children }), $[22] = children, $[23] = t7, $[24] = t8) : t8 = $[24];
1019
+ let t9;
1020
+ return $[25] !== Element2 || $[26] !== rest || $[27] !== t6 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Heading", ...rest, className: t6, children: t8 }), $[25] = Element2, $[26] = rest, $[27] = t6, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
1021
+ }
1022
+ Heading.displayName = "Heading";
1023
+ const DEFAULT_INLINE_ELEMENT = "div";
1024
+ function Inline(props) {
1025
+ const $ = reactCompilerRuntime.c(11), t0 = props;
1026
+ let children, gap, rest, space, t1;
1027
+ $[0] !== t0 ? ({
1028
+ as: t1,
1029
+ children,
1030
+ gap,
1031
+ space,
1032
+ ...rest
1033
+ } = t0, $[0] = t0, $[1] = children, $[2] = gap, $[3] = rest, $[4] = space, $[5] = t1) : (children = $[1], gap = $[2], rest = $[3], space = $[4], t1 = $[5]);
1034
+ const as = t1 === void 0 ? DEFAULT_INLINE_ELEMENT : t1, t2 = gap ?? space;
1035
+ let t3;
1036
+ return $[6] !== as || $[7] !== children || $[8] !== rest || $[9] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Inline", ...rest, align: "center", as, display: "flex", gap: t2, wrap: "wrap", children }), $[6] = as, $[7] = children, $[8] = rest, $[9] = t2, $[10] = t3) : t3 = $[10], t3;
1037
+ }
1038
+ Inline.displayName = "Inline";
1039
+ const DEFAULT_KBD_ELEMENT = "kbd";
1040
+ function KBD(props) {
1041
+ const $ = reactCompilerRuntime.c(22), t0 = props;
1042
+ let children, className, rest, t1, t2, t3, t4, t5;
1043
+ $[0] !== t0 ? ({
1044
+ as: t1,
1045
+ children,
1046
+ className,
1047
+ display: t2,
1048
+ fontSize: t3,
1049
+ padding: t4,
1050
+ radius: t5,
1051
+ ...rest
1052
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5) : (children = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8]);
1053
+ const as = t1 === void 0 ? DEFAULT_KBD_ELEMENT : t1, display = t2 === void 0 ? "inline-block" : t2, fontSize = t3 === void 0 ? 0 : t3, padding = t4 === void 0 ? 1 : t4, radius = t5 === void 0 ? 2 : t5, t6 = as;
1054
+ let t7;
1055
+ $[9] !== className || $[10] !== radius ? (t7 = css._composeClassNames(className, css.kbd({
1056
+ radius
1057
+ })), $[9] = className, $[10] = radius, $[11] = t7) : t7 = $[11];
1058
+ let t8;
1059
+ $[12] !== children || $[13] !== fontSize ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", muted: !0, size: fontSize, weight: "semibold", children }), $[12] = children, $[13] = fontSize, $[14] = t8) : t8 = $[14];
1060
+ let t9;
1061
+ return $[15] !== display || $[16] !== padding || $[17] !== rest || $[18] !== t6 || $[19] !== t7 || $[20] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "KBD", ...rest, as: t6, className: t7, display, muted: !0, padding, children: t8 }), $[15] = display, $[16] = padding, $[17] = rest, $[18] = t6, $[19] = t7, $[20] = t8, $[21] = t9) : t9 = $[21], t9;
1062
+ }
1063
+ KBD.displayName = "KBD";
1064
+ const origin = {
1065
+ name: "@sanity/ui/origin",
1066
+ fn({
1067
+ middlewareData,
1068
+ placement,
1069
+ rects
1070
+ }) {
1071
+ const [side] = placement.split("-"), floatingWidth = rects.floating.width, floatingHeight = rects.floating.height, shiftX = middlewareData.shift?.x || 0, shiftY = middlewareData.shift?.y || 0;
1072
+ if (floatingWidth <= 0 || floatingHeight <= 0)
1073
+ return {};
1074
+ const isVerticalPlacement = ["bottom", "top"].includes(side), {
1075
+ originX,
1076
+ originY
1077
+ } = isVerticalPlacement ? {
1078
+ originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),
1079
+ originY: side === "bottom" ? 0 : 1
1080
+ } : {
1081
+ originX: side === "left" ? 1 : 0,
1082
+ originY: clamp(0.5 - shiftY / floatingHeight, 0, 1)
1083
+ };
1084
+ return {
1085
+ data: {
1086
+ originX,
1087
+ originY
1088
+ }
1089
+ };
1090
+ }
1091
+ };
1092
+ function clamp(num, min, max) {
1093
+ return Math.min(Math.max(num, min), max);
1094
+ }
1095
+ function moveTowardsLength(movingPoint, targetPoint, amount) {
1096
+ const width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
1097
+ return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
1098
+ }
1099
+ function moveTowardsFractional(movingPoint, targetPoint, fraction) {
1100
+ return {
1101
+ x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
1102
+ y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
1103
+ };
1104
+ }
1105
+ function getRoundedCommands(points) {
1106
+ const len = points.length, cmds = [];
1107
+ for (let i = 0; i < len; i += 1) {
1108
+ const point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
1109
+ if (prevPoint && point.radius) {
1110
+ const curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, 0.5), endControl = moveTowardsFractional(point, curveEnd, 0.5);
1111
+ cmds.push({
1112
+ type: "point",
1113
+ ...curveStart
1114
+ }), cmds.push({
1115
+ type: "curve",
1116
+ curveEnd,
1117
+ startControl,
1118
+ endControl
1119
+ });
1120
+ } else
1121
+ cmds.push({
1122
+ type: "point",
1123
+ ...point
1124
+ });
1125
+ }
1126
+ return cmds;
1127
+ }
1128
+ function compileCommands(cmds) {
1129
+ return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
1130
+ }
1131
+ const DEFAULT_ARROW_ELEMENT = "div";
1132
+ function Arrow(props) {
1133
+ const $ = reactCompilerRuntime.c(31), t0 = props;
1134
+ let h, rest, style, t1, t2, w;
1135
+ $[0] !== t0 ? ({
1136
+ as: t1,
1137
+ width: w,
1138
+ height: h,
1139
+ radius: t2,
1140
+ style,
1141
+ ...rest
1142
+ } = t0, $[0] = t0, $[1] = h, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2, $[6] = w) : (h = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5], w = $[6]);
1143
+ const Element2 = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
1144
+ let t3;
1145
+ const points = [{
1146
+ x: 0,
1147
+ y: 0
1148
+ }, {
1149
+ x: radius,
1150
+ y: 0,
1151
+ radius
1152
+ }, {
1153
+ x: center,
1154
+ y: h - 1,
1155
+ radius
1156
+ }, {
1157
+ x: w - radius,
1158
+ y: 0,
1159
+ radius
1160
+ }, {
1161
+ x: w,
1162
+ y: 0
1163
+ }], cmds = getRoundedCommands(points);
1164
+ t3 = compileCommands(cmds);
1165
+ const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
1166
+ let t4;
1167
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = css._arrow(), $[7] = t4) : t4 = $[7];
1168
+ const t5 = `${w}px`;
1169
+ let t6;
1170
+ $[8] !== style || $[9] !== t5 ? (t6 = {
1171
+ ...style,
1172
+ [css.varNames.arrow.size]: t5
1173
+ }, $[8] = style, $[9] = t5, $[10] = t6) : t6 = $[10];
1174
+ const t7 = `0 0 ${w} ${w}`;
1175
+ let t8;
1176
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css._arrowStrokeMask(), $[11] = t8) : t8 = $[11];
1177
+ let t9;
1178
+ $[12] !== w ? (t9 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { className: t8, x: 0, width: w, height: w, fill: "white" }) }), $[12] = w, $[13] = t9) : t9 = $[13];
1179
+ let t10;
1180
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css._arrowStroke(), $[14] = t10) : t10 = $[14];
1181
+ let t11;
1182
+ $[15] !== strokePath ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t10, d: strokePath, mask: "url(#stroke-mask)" }), $[15] = strokePath, $[16] = t11) : t11 = $[16];
1183
+ let t12;
1184
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css._arrowShape(), $[17] = t12) : t12 = $[17];
1185
+ let t13;
1186
+ $[18] !== fillPath ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t12, d: fillPath }), $[18] = fillPath, $[19] = t13) : t13 = $[19];
1187
+ let t14;
1188
+ $[20] !== t11 || $[21] !== t13 || $[22] !== t7 || $[23] !== t9 || $[24] !== w ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t7, children: [
1189
+ t9,
1190
+ t11,
1191
+ t13
1192
+ ] }), $[20] = t11, $[21] = t13, $[22] = t7, $[23] = t9, $[24] = w, $[25] = t14) : t14 = $[25];
1193
+ let t15;
1194
+ return $[26] !== Element2 || $[27] !== rest || $[28] !== t14 || $[29] !== t6 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t4, style: t6, children: t14 }), $[26] = Element2, $[27] = rest, $[28] = t14, $[29] = t6, $[30] = t15) : t15 = $[30], t15;
1195
+ }
1196
+ Arrow.displayName = "Arrow";
1197
+ const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
1198
+ function BoundaryElementProvider(props) {
1199
+ const $ = reactCompilerRuntime.c(5), {
1200
+ children,
1201
+ element
1202
+ } = props;
1203
+ let t0, t1;
1204
+ $[0] !== element ? (t1 = {
1205
+ version: 0,
1206
+ element
1207
+ }, $[0] = element, $[1] = t1) : t1 = $[1], t0 = t1;
1208
+ const value = t0;
1209
+ let t2;
1210
+ return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
1211
+ }
1212
+ BoundaryElementProvider.displayName = "BoundaryElementProvider";
1213
+ function isRecord(value) {
1214
+ return !!(value && typeof value == "object" && !Array.isArray(value));
1215
+ }
1216
+ const DEFAULT_VALUE = {
1217
+ version: 0,
1218
+ element: null
1219
+ };
1220
+ function useBoundaryElement() {
1221
+ const value = react.useContext(BoundaryElementContext);
1222
+ if (value && (!isRecord(value) || value.version !== 0))
1223
+ throw new Error("useBoundaryElement(): the context value is not compatible");
1224
+ return value || DEFAULT_VALUE;
1225
+ }
1226
+ function findMaxBreakpoints(media2, width) {
1227
+ const ret = [];
1228
+ for (let i = 0; i < media2.length; i += 1)
1229
+ media2[i] > width && ret.push(i);
1230
+ return ret;
1231
+ }
1232
+ function findMinBreakpoints(media2, width) {
1233
+ const ret = [];
1234
+ for (let i = 0; i < media2.length; i += 1)
1235
+ media2[i] <= width && ret.push(i);
1236
+ return ret;
1237
+ }
1238
+ const DEFAULT_ELEMENT_QUERY_ELEMENT = "div", DEFAULT_BREAKPOINTS = Object.values(css.BREAKPOINTS);
1239
+ function ElementQuery(props) {
1240
+ const $ = reactCompilerRuntime.c(21), t0 = props;
1241
+ let children, forwardedRef, mediaProp, rest, t1;
1242
+ $[0] !== t0 ? ({
1243
+ as: t1,
1244
+ children,
1245
+ media: mediaProp,
1246
+ ref: forwardedRef,
1247
+ ...rest
1248
+ } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = mediaProp, $[4] = rest, $[5] = t1) : (children = $[1], forwardedRef = $[2], mediaProp = $[3], rest = $[4], t1 = $[5]);
1249
+ const Element2 = t1 === void 0 ? DEFAULT_ELEMENT_QUERY_ELEMENT : t1, breakpoints = mediaProp ?? DEFAULT_BREAKPOINTS, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
1250
+ let t2;
1251
+ t2 = elementSize?.border.width ?? window.innerWidth;
1252
+ const width = t2;
1253
+ let t3, t4;
1254
+ if ($[6] !== breakpoints || $[7] !== width) {
1255
+ const eq = findMaxBreakpoints(breakpoints, width);
1256
+ t4 = eq.length ? eq.join(" ") : void 0, $[6] = breakpoints, $[7] = width, $[8] = t4;
1257
+ } else
1258
+ t4 = $[8];
1259
+ t3 = t4;
1260
+ const max = t3;
1261
+ let t5, t6;
1262
+ if ($[9] !== breakpoints || $[10] !== width) {
1263
+ const eq_0 = findMinBreakpoints(breakpoints, width);
1264
+ t6 = eq_0.length ? eq_0.join(" ") : void 0, $[9] = breakpoints, $[10] = width, $[11] = t6;
1265
+ } else
1266
+ t6 = $[11];
1267
+ t5 = t6;
1268
+ const min = t5;
1269
+ let t7, t8;
1270
+ $[12] !== element ? (t7 = () => element, t8 = [element], $[12] = element, $[13] = t7, $[14] = t8) : (t7 = $[13], t8 = $[14]), react.useImperativeHandle(forwardedRef, t7, t8);
1271
+ let t9;
1272
+ return $[15] !== Element2 || $[16] !== children || $[17] !== max || $[18] !== min || $[19] !== rest ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "ElementQuery", ...rest, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[15] = Element2, $[16] = children, $[17] = max, $[18] = min, $[19] = rest, $[20] = t9) : t9 = $[20], t9;
1273
+ }
1274
+ ElementQuery.displayName = "ElementQuery";
1275
+ function getLayerContext(contextValue) {
1276
+ if (!isRecord(contextValue) || contextValue.version !== 0)
1277
+ throw new Error("the context value is not compatible");
1278
+ if (!contextValue)
1279
+ throw new Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");
1280
+ if (contextValue.version === 0)
1281
+ return contextValue;
1282
+ throw new Error("could not get layer context");
1283
+ }
1284
+ const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
1285
+ function useLayer() {
1286
+ const $ = reactCompilerRuntime.c(2), value = react.useContext(LayerContext);
1287
+ if (!value)
1288
+ throw new Error("useLayer(): missing context value");
1289
+ try {
1290
+ let t1;
1291
+ return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
1292
+ } catch (t0) {
1293
+ const err = t0;
1294
+ throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
1295
+ }
1296
+ }
1297
+ const DEFAULT_LAYER_CARD_ELEMENT = "div";
1298
+ function LayerCard(props) {
1299
+ const $ = reactCompilerRuntime.c(27), t0 = props;
1300
+ let children, forwardedRef, onActivate, onFocus, rest, t1, t2, t3;
1301
+ $[0] !== t0 ? ({
1302
+ as: t1,
1303
+ children,
1304
+ onActivate,
1305
+ onFocus,
1306
+ position: t2,
1307
+ ref: forwardedRef,
1308
+ style: t3,
1309
+ ...rest
1310
+ } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = onActivate, $[4] = onFocus, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3) : (children = $[1], forwardedRef = $[2], onActivate = $[3], onFocus = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8]);
1311
+ const as = t1 === void 0 ? DEFAULT_LAYER_CARD_ELEMENT : t1, position = t2 === void 0 ? "relative" : t2, style = t3 === void 0 ? EMPTY_RECORD : t3, {
1312
+ zIndex,
1313
+ isTopLayer
1314
+ } = useLayer(), lastFocusedRef = react.useRef(null), ref = react.useRef(null), isTopLayerRef = react.useRef(isTopLayer);
1315
+ let t4;
1316
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9], react.useImperativeHandle(forwardedRef, t4);
1317
+ let t5, t6;
1318
+ $[10] !== isTopLayer || $[11] !== onActivate ? (t5 = () => {
1319
+ isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({
1320
+ activeElement: lastFocusedRef.current
1321
+ }), isTopLayerRef.current = isTopLayer;
1322
+ }, t6 = [isTopLayer, onActivate], $[10] = isTopLayer, $[11] = onActivate, $[12] = t5, $[13] = t6) : (t5 = $[12], t6 = $[13]), react.useEffect(t5, t6);
1323
+ let t7;
1324
+ $[14] !== isTopLayer || $[15] !== onFocus ? (t7 = (event) => {
1325
+ onFocus?.(event);
1326
+ const rootElement = ref.current, target = document.activeElement;
1327
+ !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
1328
+ }, $[14] = isTopLayer, $[15] = onFocus, $[16] = t7) : t7 = $[16];
1329
+ const handleFocus = t7, t8 = as;
1330
+ let t9;
1331
+ $[17] !== style || $[18] !== zIndex ? (t9 = {
1332
+ ...style,
1333
+ zIndex
1334
+ }, $[17] = style, $[18] = zIndex, $[19] = t9) : t9 = $[19];
1335
+ let t10;
1336
+ return $[20] !== children || $[21] !== handleFocus || $[22] !== position || $[23] !== rest || $[24] !== t8 || $[25] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Card, { "data-ui": "Layer", ...rest, as: t8, onFocus: handleFocus, position, ref, style: t9, children }), $[20] = children, $[21] = handleFocus, $[22] = position, $[23] = rest, $[24] = t8, $[25] = t9, $[26] = t10) : t10 = $[26], t10;
1337
+ }
1338
+ LayerCard.displayName = "LayerCard";
1339
+ function LayerProvider(props) {
1340
+ const $ = reactCompilerRuntime.c(19), {
1341
+ children,
1342
+ zOffset: t0
1343
+ } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = react.useContext(LayerContext);
1344
+ let t1;
1345
+ $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
1346
+ const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + (zOffset[mediaIndex] ?? 0) : zOffset[mediaIndex] ?? 0;
1347
+ let t2;
1348
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
1349
+ const [, setChildLayers] = react.useState(t2), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0;
1350
+ let t3;
1351
+ $[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (childLevel) => {
1352
+ const parentDispose = parentRegisterChild?.(childLevel);
1353
+ return childLevel !== void 0 ? setChildLayers((state) => {
1354
+ const prevLen = state[childLevel] ?? 0, nextState = {
1355
+ ...state,
1356
+ [childLevel]: prevLen + 1
1357
+ };
1358
+ return setSize(Object.keys(nextState).length), nextState;
1359
+ }) : setSize(_temp$2), () => {
1360
+ childLevel !== void 0 ? setChildLayers((state_0) => {
1361
+ const nextState_0 = {
1362
+ ...state_0
1363
+ };
1364
+ return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
1365
+ }) : setSize(_temp2$2), parentDispose?.();
1366
+ };
1367
+ }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
1368
+ const registerChild = t3;
1369
+ let t4, t5;
1370
+ $[6] !== level || $[7] !== parentRegisterChild ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = level, $[7] = parentRegisterChild, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), react.useEffect(t4, t5);
1371
+ let t6, t7;
1372
+ $[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t7 = {
1373
+ version: 0,
1374
+ isTopLayer,
1375
+ level,
1376
+ registerChild,
1377
+ size: size2,
1378
+ zIndex
1379
+ }, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t7) : t7 = $[15], t6 = t7;
1380
+ const value = t6;
1381
+ let t8;
1382
+ return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
1383
+ }
1384
+ function _temp2$2(v_0) {
1385
+ return v_0 - 1;
1386
+ }
1387
+ function _temp$2(v) {
1388
+ return v + 1;
1389
+ }
1390
+ LayerProvider.displayName = "LayerProvider";
1391
+ const DEFAULT_LAYER_ELEMENT = "div";
1392
+ function Layer(props) {
1393
+ const $ = reactCompilerRuntime.c(12), t0 = props;
1394
+ let children, rest, t1, t2;
1395
+ $[0] !== t0 ? ({
1396
+ as: t1,
1397
+ children,
1398
+ zOffset: t2,
1399
+ ...rest
1400
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1, $[4] = t2) : (children = $[1], rest = $[2], t1 = $[3], t2 = $[4]);
1401
+ const as = t1 === void 0 ? DEFAULT_LAYER_ELEMENT : t1, zOffset = t2 === void 0 ? 1 : t2;
1402
+ let t3;
1403
+ $[5] !== as || $[6] !== children || $[7] !== rest ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(LayerCard, { ...rest, as, children }), $[5] = as, $[6] = children, $[7] = rest, $[8] = t3) : t3 = $[8];
1404
+ let t4;
1405
+ return $[9] !== t3 || $[10] !== zOffset ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: t3 }), $[9] = t3, $[10] = zOffset, $[11] = t4) : t4 = $[11], t4;
1406
+ }
1407
+ Layer.displayName = "Layer";
1408
+ const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
1409
+ globalScope[elementKey] = null;
1410
+ const defaultContextValue = {
1411
+ version: 0,
1412
+ boundaryElement: null,
1413
+ get element() {
1414
+ return typeof document > "u" ? null : (globalScope[elementKey] || (globalScope[elementKey] = document.createElement("div"), globalScope[elementKey].setAttribute("data-portal", ""), document.body.appendChild(globalScope[elementKey])), globalScope[elementKey]);
1415
+ }
1416
+ }, PortalContext = createGlobalScopedContext(key, defaultContextValue);
1417
+ function usePortal() {
1418
+ const value = react.useContext(PortalContext);
1419
+ if (!value)
1420
+ throw new Error("usePortal(): missing context value");
1421
+ if (!isRecord(value) || value.version !== 0)
1422
+ throw new Error("usePortal(): the context value is not compatible");
1423
+ return value;
1424
+ }
1425
+ function Portal(props) {
1426
+ const $ = reactCompilerRuntime.c(6), {
1427
+ children,
1428
+ __unstable_name: name
1429
+ } = props, card = useCard(), portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
1430
+ if (!portalElement)
1431
+ return null;
1432
+ const t0 = card?.scheme || "light";
1433
+ let t1;
1434
+ $[0] !== children || $[1] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: "transparent", scheme: t0, children }), $[0] = children, $[1] = t0, $[2] = t1) : t1 = $[2];
1435
+ let t2;
1436
+ return $[3] !== portalElement || $[4] !== t1 ? (t2 = reactDom.createPortal(t1, portalElement), $[3] = portalElement, $[4] = t1, $[5] = t2) : t2 = $[5], t2;
1437
+ }
1438
+ Portal.displayName = "Portal";
1439
+ function PortalProvider(props) {
1440
+ const $ = reactCompilerRuntime.c(7), {
1441
+ boundaryElement,
1442
+ children,
1443
+ element,
1444
+ __unstable_elements: elementsProp
1445
+ } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$1, _temp2$1);
1446
+ let t0;
1447
+ const t1 = boundaryElement || null, t2 = element || fallbackElement;
1448
+ let t3;
1449
+ $[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
1450
+ version: 0,
1451
+ boundaryElement: t1,
1452
+ element: t2,
1453
+ elements
1454
+ }, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
1455
+ const value = t0;
1456
+ let t4;
1457
+ return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
1458
+ }
1459
+ function _temp2$1() {
1460
+ return null;
1461
+ }
1462
+ function _temp$1() {
1463
+ return document.body;
1464
+ }
1465
+ PortalProvider.displayName = "PortalProvider";
1466
+ const emptySubscribe = () => () => {
1467
+ };
1468
+ function useUnique(value) {
1469
+ const valueRef = react.useRef(value);
1470
+ return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
1471
+ }
1472
+ function _isEqual(objA, objB) {
1473
+ if (!objA || !objB)
1474
+ return objA === objB;
1475
+ const keysA = Object.keys(objA), keysB = Object.keys(objB);
1476
+ return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
1477
+ }
1478
+ const DEFAULT_SR_ONLY_ELEMENT = "span";
1479
+ function SrOnly(props) {
1480
+ const $ = reactCompilerRuntime.c(12), t0 = props;
1481
+ let children, className, rest, t1;
1482
+ $[0] !== t0 ? ({
1483
+ as: t1,
1484
+ children,
1485
+ className,
1486
+ ...rest
1487
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1) : (children = $[1], className = $[2], rest = $[3], t1 = $[4]);
1488
+ const Element2 = t1 === void 0 ? DEFAULT_SR_ONLY_ELEMENT : t1;
1489
+ let t2;
1490
+ $[5] !== className ? (t2 = css._composeClassNames(className, css.srOnly()), $[5] = className, $[6] = t2) : t2 = $[6];
1491
+ let t3;
1492
+ return $[7] !== Element2 || $[8] !== children || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "SrOnly", ...rest, "aria-hidden": !0, className: t2, children }), $[7] = Element2, $[8] = children, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
1493
+ }
1494
+ SrOnly.displayName = "SrOnly";
1495
+ const DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
1496
+ function VirtualList(props) {
1497
+ const $ = reactCompilerRuntime.c(58), t0 = props;
1498
+ let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
1499
+ $[0] !== t0 ? ({
1500
+ as: t1,
1501
+ gap: t2,
1502
+ getItemKey,
1503
+ items: t3,
1504
+ onChange,
1505
+ renderItem,
1506
+ ref: forwardedRef,
1507
+ ...rest
1508
+ } = t0, $[0] = t0, $[1] = forwardedRef, $[2] = getItemKey, $[3] = onChange, $[4] = renderItem, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3) : (forwardedRef = $[1], getItemKey = $[2], onChange = $[3], renderItem = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8]);
1509
+ const as = t1 === void 0 ? DEFAULT_VIRTUAL_LIST_ELEMENT : t1, gap = t2 === void 0 ? 0 : t2;
1510
+ let t4;
1511
+ $[9] !== t3 ? (t4 = t3 === void 0 ? [] : t3, $[9] = t3, $[10] = t4) : t4 = $[10];
1512
+ const items = t4, ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1), [gapValue, setGapValue] = react.useState(0);
1513
+ let t5;
1514
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[11] = t5) : t5 = $[11], react.useImperativeHandle(forwardedRef, t5);
1515
+ let t6, t7;
1516
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => {
1517
+ if (!ref.current)
1518
+ return;
1519
+ const scrollEl = findScrollable(ref.current.parentNode);
1520
+ if (scrollEl) {
1521
+ if (!(scrollEl instanceof HTMLElement))
1522
+ return;
1523
+ const handleScroll = () => {
1524
+ setScrollTop(scrollEl.scrollTop);
1525
+ };
1526
+ scrollEl.addEventListener("scroll", handleScroll, {
1527
+ passive: !0
1528
+ });
1529
+ const ro = new _ResizeObserver((entries) => {
1530
+ setScrollHeight(entries[0].contentRect.height);
1531
+ });
1532
+ return ro.observe(scrollEl), handleScroll(), () => {
1533
+ scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
1534
+ };
1535
+ }
1536
+ const handleScroll_0 = () => {
1537
+ setScrollTop(window.scrollY);
1538
+ }, handleResize = () => {
1539
+ setScrollHeight(window.innerHeight);
1540
+ };
1541
+ return window.addEventListener("scroll", handleScroll_0, {
1542
+ passive: !0
1543
+ }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
1544
+ window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
1545
+ };
1546
+ }, t7 = [], $[12] = t6, $[13] = t7) : (t6 = $[12], t7 = $[13]), react.useEffect(t6, t7);
1547
+ const len = items.length, height = itemHeight ? len * (itemHeight + gapValue) - gapValue : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
1548
+ let t8, t9;
1549
+ $[14] !== fromIndex || $[15] !== gapValue || $[16] !== itemHeight || $[17] !== onChange || $[18] !== scrollHeight || $[19] !== scrollTop || $[20] !== toIndex ? (t8 = () => {
1550
+ onChange?.({
1551
+ fromIndex,
1552
+ gap: gapValue,
1553
+ itemHeight,
1554
+ scrollHeight,
1555
+ scrollTop,
1556
+ toIndex
1557
+ });
1558
+ }, t9 = [fromIndex, gapValue, itemHeight, onChange, scrollHeight, scrollTop, toIndex], $[14] = fromIndex, $[15] = gapValue, $[16] = itemHeight, $[17] = onChange, $[18] = scrollHeight, $[19] = scrollTop, $[20] = toIndex, $[21] = t8, $[22] = t9) : (t8 = $[21], t9 = $[22]), react.useEffect(t8, t9);
1559
+ let t10;
1560
+ bb0: {
1561
+ if (!renderItem || items.length === 0) {
1562
+ t10 = null;
1563
+ break bb0;
1564
+ }
1565
+ if (itemHeight === -1) {
1566
+ let t113;
1567
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t113 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[23] = t113) : t113 = $[23];
1568
+ let t122;
1569
+ $[24] !== items[0] || $[25] !== renderItem ? (t122 = renderItem(items[0]), $[24] = items[0], $[25] = renderItem, $[26] = t122) : t122 = $[26];
1570
+ let t132;
1571
+ $[27] !== t122 ? (t132 = /* @__PURE__ */ jsxRuntime.jsx(Box, { ref: t113, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t122 }, 0), $[27] = t122, $[28] = t132) : t132 = $[28];
1572
+ let t142;
1573
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t142 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[29] = t142) : t142 = $[29];
1574
+ const t15 = css.vars.space[gap];
1575
+ let t16;
1576
+ $[30] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: t142, style: {
1577
+ height: t15
1578
+ } }), $[30] = t15, $[31] = t16) : t16 = $[31];
1579
+ let t17;
1580
+ $[32] !== t132 || $[33] !== t16 ? (t17 = [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1581
+ t132,
1582
+ t16
1583
+ ] })], $[32] = t132, $[33] = t16, $[34] = t17) : t17 = $[34], t10 = t17;
1584
+ break bb0;
1585
+ }
1586
+ let t112;
1587
+ if ($[35] !== fromIndex || $[36] !== gapValue || $[37] !== getItemKey || $[38] !== itemHeight || $[39] !== items || $[40] !== renderItem || $[41] !== toIndex) {
1588
+ let t122;
1589
+ $[43] !== fromIndex || $[44] !== gapValue || $[45] !== getItemKey || $[46] !== itemHeight || $[47] !== renderItem ? (t122 = (item, _itemIndex) => {
1590
+ const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
1591
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
1592
+ top: itemIndex * (itemHeight + gapValue) - gapValue
1593
+ }, children: node }, key2);
1594
+ }, $[43] = fromIndex, $[44] = gapValue, $[45] = getItemKey, $[46] = itemHeight, $[47] = renderItem, $[48] = t122) : t122 = $[48], t112 = items.slice(fromIndex, toIndex).map(t122), $[35] = fromIndex, $[36] = gapValue, $[37] = getItemKey, $[38] = itemHeight, $[39] = items, $[40] = renderItem, $[41] = toIndex, $[42] = t112;
1595
+ } else
1596
+ t112 = $[42];
1597
+ t10 = t112;
1598
+ }
1599
+ const children = t10;
1600
+ let t11, t12;
1601
+ $[49] !== height ? (t12 = {
1602
+ height
1603
+ }, $[49] = height, $[50] = t12) : t12 = $[50], t11 = t12;
1604
+ const wrapperStyle = t11;
1605
+ let t13;
1606
+ $[51] !== children || $[52] !== wrapperStyle ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[51] = children, $[52] = wrapperStyle, $[53] = t13) : t13 = $[53];
1607
+ let t14;
1608
+ return $[54] !== as || $[55] !== rest || $[56] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t13 }), $[54] = as, $[55] = rest, $[56] = t13, $[57] = t14) : t14 = $[57], t14;
1609
+ }
1610
+ VirtualList.displayName = "VirtualList";
1611
+ function findScrollable(parentNode) {
1612
+ let _scrollEl = parentNode;
1613
+ for (; _scrollEl && !_isScrollable(_scrollEl); )
1614
+ _scrollEl = _scrollEl.parentNode;
1615
+ return _scrollEl;
1616
+ }
1617
+ const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER_ARROW_WIDTH = 19, DEFAULT_POPOVER_ARROW_HEIGHT = 8, DEFAULT_POPOVER_ARROW_RADIUS = 2, DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0], DEFAULT_FALLBACK_PLACEMENTS$1 = {
1618
+ top: ["bottom", "left", "right"],
1619
+ "top-start": ["bottom-start", "left-start", "right-start"],
1620
+ "top-end": ["bottom-end", "left-end", "right-end"],
1621
+ bottom: ["top", "left", "right"],
1622
+ "bottom-start": ["top-start", "left-start", "right-start"],
1623
+ "bottom-end": ["top-end", "left-end", "right-end"],
1624
+ left: ["right", "top", "bottom"],
1625
+ "left-start": ["right-start", "top-start", "bottom-start"],
1626
+ "left-end": ["right-end", "top-end", "bottom-end"],
1627
+ right: ["left", "top", "bottom"],
1628
+ "right-start": ["left-start", "top-start", "bottom-start"],
1629
+ "right-end": ["left-end", "top-end", "bottom-end"]
1630
+ };
1631
+ function size(options) {
1632
+ const {
1633
+ apply,
1634
+ margins,
1635
+ padding = 0
1636
+ } = options;
1637
+ return {
1638
+ name: "@sanity/ui/size",
1639
+ async fn(args) {
1640
+ const {
1641
+ elements,
1642
+ placement,
1643
+ platform,
1644
+ rects
1645
+ } = args, {
1646
+ floating,
1647
+ reference
1648
+ } = rects, overflow = await reactDom$1.detectOverflow(args, {
1649
+ altBoundary: !0,
1650
+ boundary: options.boundaryElement || void 0,
1651
+ elementContext: "floating",
1652
+ padding,
1653
+ rootBoundary: "viewport"
1654
+ });
1655
+ let maxWidth = 1 / 0, maxHeight = 1 / 0;
1656
+ const floatingW = floating.width, floatingH = floating.height;
1657
+ placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom)), apply({
1658
+ availableWidth: maxWidth - margins[1] - margins[3],
1659
+ availableHeight: maxHeight - margins[0] - margins[2],
1660
+ elements,
1661
+ referenceWidth: reference.width - margins[1] - margins[3]
1662
+ });
1663
+ const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
1664
+ return floatingW !== targetW || floatingH !== targetH ? {
1665
+ reset: {
1666
+ rects: !0
1667
+ }
1668
+ } : {};
1669
+ }
1670
+ };
1671
+ }
1672
+ function PopoverLayer(props) {
1673
+ const $ = reactCompilerRuntime.c(65);
1674
+ let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, rest, shadow, strategy, style, t0, xProp, yProp;
1675
+ $[0] !== props ? ({
1676
+ __unstable_margins: marginsProp,
1677
+ animate,
1678
+ arrow,
1679
+ arrowRef,
1680
+ arrowX,
1681
+ arrowY,
1682
+ children,
1683
+ maxWidth,
1684
+ padding,
1685
+ placement,
1686
+ originX,
1687
+ originY,
1688
+ overflow,
1689
+ radius,
1690
+ referenceWidth,
1691
+ shadow,
1692
+ strategy,
1693
+ style,
1694
+ tone: t0,
1695
+ x: xProp,
1696
+ y: yProp,
1697
+ ...rest
1698
+ } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = maxWidth, $[9] = originX, $[10] = originY, $[11] = overflow, $[12] = padding, $[13] = placement, $[14] = radius, $[15] = referenceWidth, $[16] = rest, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = t0, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], maxWidth = $[8], originX = $[9], originY = $[10], overflow = $[11], padding = $[12], placement = $[13], radius = $[14], referenceWidth = $[15], rest = $[16], shadow = $[17], strategy = $[18], style = $[19], t0 = $[20], xProp = $[21], yProp = $[22]);
1699
+ const tone = t0 === void 0 ? "inherit" : t0;
1700
+ let t1;
1701
+ t1 = marginsProp || DEFAULT_POPOVER_MARGINS;
1702
+ const margins = t1, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1703
+ let t2;
1704
+ const t3 = animate ? "transform" : void 0;
1705
+ let t4;
1706
+ $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t3 || $[28] !== x || $[29] !== y ? (t4 = {
1707
+ left: x,
1708
+ originX,
1709
+ originY,
1710
+ top: y,
1711
+ width: referenceWidth,
1712
+ willChange: t3,
1713
+ ...style
1714
+ }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] = t3, $[28] = x, $[29] = y, $[30] = t4) : t4 = $[30], t2 = t4;
1715
+ const rootStyle = t2;
1716
+ let t5;
1717
+ const t6 = arrowX !== null ? arrowX : void 0, t7 = arrowY !== null ? arrowY : void 0;
1718
+ let t8;
1719
+ $[31] !== t6 || $[32] !== t7 ? (t8 = {
1720
+ left: t6,
1721
+ top: t7,
1722
+ right: void 0,
1723
+ bottom: void 0
1724
+ }, $[31] = t6, $[32] = t7, $[33] = t8) : t8 = $[33], t5 = t8;
1725
+ const arrowStyle = t5;
1726
+ let t9;
1727
+ $[34] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.popoverCard(), $[34] = t9) : t9 = $[34];
1728
+ let t10;
1729
+ $[35] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[35] = animate, $[36] = t10) : t10 = $[36];
1730
+ let t11;
1731
+ $[37] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[37] = animate, $[38] = t11) : t11 = $[38];
1732
+ let t12;
1733
+ $[39] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[39] = animate, $[40] = t12) : t12 = $[40];
1734
+ let t13;
1735
+ $[41] !== children || $[42] !== padding ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[41] = children, $[42] = padding, $[43] = t13) : t13 = $[43];
1736
+ let t14;
1737
+ $[44] !== maxWidth || $[45] !== overflow || $[46] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t13 }), $[44] = maxWidth, $[45] = overflow, $[46] = t13, $[47] = t14) : t14 = $[47];
1738
+ let t15;
1739
+ $[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t15 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t15) : t15 = $[51];
1740
+ let t16;
1741
+ return $[52] !== placement || $[53] !== radius || $[54] !== rest || $[55] !== rootStyle || $[56] !== shadow || $[57] !== strategy || $[58] !== t10 || $[59] !== t11 || $[60] !== t12 || $[61] !== t14 || $[62] !== t15 || $[63] !== tone ? (t16 = /* @__PURE__ */ jsxRuntime.jsxs(Layer, { className: t9, "data-ui": "Popover", ...rest, as: framerMotion.motion.div, "data-context-tone": tone, "data-placement": placement, direction: "column", display: "flex", position: strategy, radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t10, animate: t11, exit: t12, children: [
1742
+ t14,
1743
+ t15
1744
+ ] }), $[52] = placement, $[53] = radius, $[54] = rest, $[55] = rootStyle, $[56] = shadow, $[57] = strategy, $[58] = t10, $[59] = t11, $[60] = t12, $[61] = t14, $[62] = t15, $[63] = tone, $[64] = t16) : t16 = $[64], t16;
1745
+ }
1746
+ PopoverLayer.displayName = "PopoverCard";
1747
+ const DEFAULT_POPOVER_ELEMENT = "div";
1748
+ function ViewportOverlay() {
1749
+ const $ = reactCompilerRuntime.c(2), {
1750
+ zIndex
1751
+ } = useLayer();
1752
+ let t0;
1753
+ return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
1754
+ position: "fixed",
1755
+ inset: 0,
1756
+ width: "100vw",
1757
+ height: "100vh",
1758
+ zIndex
1759
+ } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
1760
+ }
1761
+ function Popover(props) {
1762
+ const boundaryElementContext = useBoundaryElement(), {
1763
+ __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
1764
+ animate: _animate = !1,
1765
+ arrow: arrowProp = !1,
1766
+ as = DEFAULT_POPOVER_ELEMENT,
1767
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1768
+ boundaryElement = boundaryElementContext.element,
1769
+ children: childProp,
1770
+ constrainSize = !1,
1771
+ content,
1772
+ disabled,
1773
+ fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
1774
+ matchReferenceWidth,
1775
+ floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
1776
+ modal,
1777
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1778
+ onActivate,
1779
+ open,
1780
+ overflow = "hidden",
1781
+ padding,
1782
+ placement: placementProp = "bottom",
1783
+ portal,
1784
+ preventOverflow = !0,
1785
+ radius = 3,
1786
+ ref: forwardedRef,
1787
+ referenceBoundary = props.boundaryElement ?? boundaryElementContext.element,
1788
+ referenceElement,
1789
+ scheme,
1790
+ shadow = 3,
1791
+ tone = "inherit",
1792
+ width: widthProp = "auto",
1793
+ zOffset: zOffsetProp = Z_OFFSETS.popover,
1794
+ updateRef,
1795
+ ...rest
1796
+ } = props, card = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
1797
+ react.useImperativeHandle(forwardedRef, () => ref.current);
1798
+ const referenceWidthRef = react.useRef(void 0), middleware = react.useMemo(() => {
1799
+ const ret = [];
1800
+ return (constrainSize || preventOverflow) && ret.push(reactDom$1.flip({
1801
+ boundary: floatingBoundary || void 0,
1802
+ fallbackPlacements,
1803
+ padding: DEFAULT_POPOVER_PADDING,
1804
+ rootBoundary
1805
+ })), ret.push(reactDom$1.offset({
1806
+ mainAxis: DEFAULT_POPOVER_DISTANCE
1807
+ })), (constrainSize || matchReferenceWidth) && ret.push(size({
1808
+ apply({
1809
+ availableWidth,
1810
+ availableHeight,
1811
+ elements,
1812
+ referenceWidth
1813
+ }) {
1814
+ referenceWidthRef.current = referenceWidth, matchReferenceWidth && (elements.floating.style.width = `${referenceWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${availableWidth}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
1815
+ },
1816
+ boundaryElement: floatingBoundary || void 0,
1817
+ margins,
1818
+ padding: DEFAULT_POPOVER_PADDING
1819
+ })), preventOverflow && ret.push(reactDom$1.shift({
1820
+ boundary: floatingBoundary || void 0,
1821
+ rootBoundary,
1822
+ padding: DEFAULT_POPOVER_PADDING
1823
+ })), arrowProp && ret.push(reactDom$1.arrow({
1824
+ element: arrowRef,
1825
+ padding: DEFAULT_POPOVER_PADDING
1826
+ })), animate && ret.push(origin), ret.push(reactDom$1.hide({
1827
+ boundary: referenceBoundary || void 0,
1828
+ padding: DEFAULT_POPOVER_PADDING,
1829
+ strategy: "referenceHidden"
1830
+ })), ret;
1831
+ }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
1832
+ x,
1833
+ y,
1834
+ middlewareData,
1835
+ placement,
1836
+ refs,
1837
+ strategy,
1838
+ update
1839
+ } = reactDom$1.useFloating({
1840
+ middleware,
1841
+ placement: placementProp,
1842
+ whileElementsMounted: reactDom$1.autoUpdate,
1843
+ elements: referenceElement ? {
1844
+ reference: referenceElement
1845
+ } : void 0
1846
+ }), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setArrow = react.useCallback((arrowEl) => {
1847
+ arrowRef.current = arrowEl;
1848
+ }, []), setFloating = react.useCallback((node) => {
1849
+ ref.current = node, refs.setFloating(node);
1850
+ }, [refs]), setReference = react.useCallback((node_0) => {
1851
+ refs.setReference(node_0);
1852
+ const childRef = getElementRef$1(childProp);
1853
+ typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
1854
+ }, [childProp, refs]), child = react.useMemo(() => referenceElement ? childProp : childProp ? react.cloneElement(childProp, {
1855
+ ref: setReference
1856
+ }) : null, [childProp, referenceElement, setReference]);
1857
+ if (react.useEffect(() => {
1858
+ updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
1859
+ }, [update, updateRef]), disabled)
1860
+ return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1861
+ const popover = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1862
+ modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
1863
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, x, y, zOffset, children: content })
1864
+ ] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: tone === "inherit" ? card?.tone ?? "default" : tone, scheme: scheme ?? "light", children: popover }) }) : popover);
1865
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1866
+ animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
1867
+ child
1868
+ ] });
1869
+ }
1870
+ Popover.displayName = "Popover";
1871
+ function getElementRef$1(element) {
1872
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1873
+ return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
1874
+ }
1875
+ const DEFAULT_RADIO_ELEMENT = "input";
1876
+ function Radio(props) {
1877
+ const $ = reactCompilerRuntime.c(24), t0 = props;
1878
+ let className, customValidity, disabled, forwardedRef, readOnly, rest, style, t1;
1879
+ $[0] !== t0 ? ({
1880
+ as: t1,
1881
+ className,
1882
+ disabled,
1883
+ style,
1884
+ customValidity,
1885
+ readOnly,
1886
+ ref: forwardedRef,
1887
+ ...rest
1888
+ } = t0, $[0] = t0, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = rest, $[7] = style, $[8] = t1) : (className = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], rest = $[6], style = $[7], t1 = $[8]);
1889
+ const Element2 = t1 === void 0 ? DEFAULT_RADIO_ELEMENT : t1, ref = react.useRef(null);
1890
+ let t2;
1891
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[9] = t2) : t2 = $[9], react.useImperativeHandle(forwardedRef, t2), useCustomValidity(ref, customValidity);
1892
+ let t3;
1893
+ $[10] !== className ? (t3 = css._composeClassNames(className, css.radio()), $[10] = className, $[11] = t3) : t3 = $[11];
1894
+ const t4 = customValidity ? "" : void 0, t5 = !disabled && readOnly ? "" : void 0, t6 = disabled || readOnly;
1895
+ let t7;
1896
+ $[12] !== Element2 || $[13] !== readOnly || $[14] !== rest || $[15] !== t4 || $[16] !== t5 || $[17] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, "data-invalid": t4, "data-read-only": t5, disabled: t6, readOnly, ref, type: "radio" }), $[12] = Element2, $[13] = readOnly, $[14] = rest, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = t7) : t7 = $[18];
1897
+ let t8;
1898
+ $[19] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsxRuntime.jsx("span", {}), $[19] = t8) : t8 = $[19];
1899
+ let t9;
1900
+ return $[20] !== style || $[21] !== t3 || $[22] !== t7 ? (t9 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t3, "data-ui": "Radio", style, children: [
1901
+ t7,
1902
+ t8
1903
+ ] }), $[20] = style, $[21] = t3, $[22] = t7, $[23] = t9) : t9 = $[23], t9;
1904
+ }
1905
+ Radio.displayName = "Radio";
1906
+ const DEFAULT_SELECT_ELEMENT = "select";
1907
+ function Select(props) {
1908
+ const $ = reactCompilerRuntime.c(38), t0 = props;
1909
+ let children, customValidity, disabled, forwardedRef, gap, readOnly, rest, t1, t2, t3, t4, t5, t6;
1910
+ $[0] !== t0 ? ({
1911
+ as: t1,
1912
+ border: t2,
1913
+ children,
1914
+ customValidity,
1915
+ disabled,
1916
+ fontSize: t3,
1917
+ gap,
1918
+ padding: t4,
1919
+ radius: t5,
1920
+ readOnly,
1921
+ ref: forwardedRef,
1922
+ space: t6,
1923
+ ...rest
1924
+ } = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = gap, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6) : (children = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], gap = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13]);
1925
+ const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 1 : t5, space = t6 === void 0 ? 2 : t6, ref = react.useRef(null);
1926
+ let t7;
1927
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[14] = t7) : t7 = $[14], react.useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
1928
+ const t8 = gap ?? space;
1929
+ let t9;
1930
+ $[15] !== border || $[16] !== fontSize || $[17] !== padding || $[18] !== radius || $[19] !== t8 ? (t9 = css.select({
1931
+ border,
1932
+ fontSize,
1933
+ padding,
1934
+ radius,
1935
+ gap: t8
1936
+ }), $[15] = border, $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t8, $[20] = t9) : t9 = $[20];
1937
+ let t10;
1938
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css._inputElement(), $[21] = t10) : t10 = $[21];
1939
+ const t11 = disabled || readOnly;
1940
+ let t12;
1941
+ $[22] !== Element2 || $[23] !== children || $[24] !== rest || $[25] !== t11 ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t10, disabled: t11, ref, children }), $[22] = Element2, $[23] = children, $[24] = rest, $[25] = t11, $[26] = t12) : t12 = $[26];
1942
+ let t13;
1943
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.selectPresentation(), $[27] = t13) : t13 = $[27];
1944
+ let t14;
1945
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}), $[28] = t14) : t14 = $[28];
1946
+ let t15;
1947
+ $[29] !== fontSize ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, children: t14 }), $[29] = fontSize, $[30] = t15) : t15 = $[30];
1948
+ let t16;
1949
+ $[31] !== padding || $[32] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t13, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", display: "inline-block", padding, children: t15 }) }), $[31] = padding, $[32] = t15, $[33] = t16) : t16 = $[33];
1950
+ let t17;
1951
+ return $[34] !== t12 || $[35] !== t16 || $[36] !== t9 ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Select", className: t9, "data-icon-right": "", children: [
1952
+ t12,
1953
+ t16
1954
+ ] }), $[34] = t12, $[35] = t16, $[36] = t9, $[37] = t17) : t17 = $[37], t17;
1955
+ }
1956
+ Select.displayName = "Select";
1957
+ const DEFAULT_STACK_ELEMENT = "div";
1958
+ function Stack(props) {
1959
+ const $ = reactCompilerRuntime.c(13), t0 = props;
1960
+ let className, gap, rest, space, t1;
1961
+ $[0] !== t0 ? ({
1962
+ as: t1,
1963
+ className,
1964
+ gap,
1965
+ space,
1966
+ ...rest
1967
+ } = t0, $[0] = t0, $[1] = className, $[2] = gap, $[3] = rest, $[4] = space, $[5] = t1) : (className = $[1], gap = $[2], rest = $[3], space = $[4], t1 = $[5]);
1968
+ const as = t1 === void 0 ? DEFAULT_STACK_ELEMENT : t1;
1969
+ let t2;
1970
+ $[6] !== className ? (t2 = css._composeClassNames(className, css.stack()), $[6] = className, $[7] = t2) : t2 = $[7];
1971
+ const t3 = gap ?? space;
1972
+ let t4;
1973
+ return $[8] !== as || $[9] !== rest || $[10] !== t2 || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Stack", ...rest, as, autoRows: "min", className: t2, display: "grid", gap: t3 }), $[8] = as, $[9] = rest, $[10] = t2, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
1974
+ }
1975
+ Stack.displayName = "Stack";
1976
+ const DEFAULT_SWITCH_ELEMENT = "input";
1977
+ function Switch(props) {
1978
+ const $ = reactCompilerRuntime.c(31), t0 = props;
1979
+ let checked, className, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
1980
+ $[0] !== t0 ? ({
1981
+ as: t1,
1982
+ checked,
1983
+ className,
1984
+ disabled,
1985
+ indeterminate,
1986
+ readOnly,
1987
+ ref: forwardedRef,
1988
+ style,
1989
+ ...rest
1990
+ } = t0, $[0] = t0, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = forwardedRef, $[5] = indeterminate, $[6] = readOnly, $[7] = rest, $[8] = style, $[9] = t1) : (checked = $[1], className = $[2], disabled = $[3], forwardedRef = $[4], indeterminate = $[5], readOnly = $[6], rest = $[7], style = $[8], t1 = $[9]);
1991
+ const Element2 = t1 === void 0 ? DEFAULT_SWITCH_ELEMENT : t1, ref = react.useRef(null);
1992
+ let t2;
1993
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[10] = t2) : t2 = $[10], react.useImperativeHandle(forwardedRef, t2);
1994
+ let t3, t4;
1995
+ $[11] !== indeterminate ? (t3 = () => {
1996
+ ref.current && (ref.current.indeterminate = indeterminate || !1);
1997
+ }, t4 = [indeterminate], $[11] = indeterminate, $[12] = t3, $[13] = t4) : (t3 = $[12], t4 = $[13]), react.useEffect(t3, t4);
1998
+ let t5;
1999
+ $[14] !== className ? (t5 = css._composeClassNames(className, css._switch()), $[14] = className, $[15] = t5) : t5 = $[15];
2000
+ const t6 = checked ? "" : void 0, t7 = indeterminate ? "" : void 0, t8 = indeterminate !== !0 && checked;
2001
+ let t9;
2002
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css._switchElement(), $[16] = t9) : t9 = $[16];
2003
+ const t10 = disabled ? "" : void 0, t11 = !disabled && readOnly ? "" : void 0, t12 = disabled || readOnly;
2004
+ let t13;
2005
+ $[17] !== Element2 || $[18] !== rest || $[19] !== t10 || $[20] !== t11 || $[21] !== t12 || $[22] !== t8 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, checked: t8, className: t9, "data-disabled": t10, "data-read-only": t11, disabled: t12, type: "checkbox", ref }), $[17] = Element2, $[18] = rest, $[19] = t10, $[20] = t11, $[21] = t12, $[22] = t8, $[23] = t13) : t13 = $[23];
2006
+ let t14;
2007
+ $[24] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": !0, className: css._switchPresentation(), children: [
2008
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchTrack() }),
2009
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchThumb() })
2010
+ ] }), $[24] = t14) : t14 = $[24];
2011
+ let t15;
2012
+ return $[25] !== style || $[26] !== t13 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: t5, "data-checked": t6, "data-indeterminate": t7, "data-ui": "Switch", display: "inline-block", position: "relative", style, children: [
2013
+ t13,
2014
+ t14
2015
+ ] }), $[25] = style, $[26] = t13, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t15) : t15 = $[30], t15;
2016
+ }
2017
+ Switch.displayName = "Switch";
2018
+ const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
2019
+ function TextArea(props) {
2020
+ const $ = reactCompilerRuntime.c(34), t0 = props;
2021
+ let __unstable_disableFocusRing, customValidity, forwardedRef, gap, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
2022
+ $[0] !== t0 ? ({
2023
+ __unstable_disableFocusRing,
2024
+ as: t1,
2025
+ border: t2,
2026
+ customValidity,
2027
+ disabled: t3,
2028
+ fontSize: t4,
2029
+ gap,
2030
+ padding: t5,
2031
+ radius: t6,
2032
+ readOnly,
2033
+ ref: forwardedRef,
2034
+ space: t7,
2035
+ ...rest
2036
+ } = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = forwardedRef, $[4] = gap, $[5] = readOnly, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = t7) : (__unstable_disableFocusRing = $[1], customValidity = $[2], forwardedRef = $[3], gap = $[4], readOnly = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], t6 = $[12], t7 = $[13]);
2037
+ const Element2 = t1 === void 0 ? DEFAULT_TEXT_AREA_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 2 : t6, space = t7 === void 0 ? 3 : t7, ref = react.useRef(null);
2038
+ let t8;
2039
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[14] = t8) : t8 = $[14], react.useImperativeHandle(forwardedRef, t8), useCustomValidity(ref, customValidity);
2040
+ const t9 = gap ?? space;
2041
+ let t10;
2042
+ $[15] !== border || $[16] !== fontSize || $[17] !== padding || $[18] !== radius || $[19] !== t9 ? (t10 = css.textArea({
2043
+ border,
2044
+ fontSize,
2045
+ padding,
2046
+ radius,
2047
+ gap: t9
2048
+ }), $[15] = border, $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t9, $[20] = t10) : t10 = $[20];
2049
+ const t11 = customValidity ? "" : void 0, t12 = !disabled && readOnly ? "" : void 0;
2050
+ let t13;
2051
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css._inputElement(), $[21] = t13) : t13 = $[21];
2052
+ const t14 = __unstable_disableFocusRing ? "" : void 0;
2053
+ let t15;
2054
+ $[22] !== Element2 || $[23] !== disabled || $[24] !== readOnly || $[25] !== rest || $[26] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t13, "data-no-focus-ring": t14, disabled, readOnly, ref }), $[22] = Element2, $[23] = disabled, $[24] = readOnly, $[25] = rest, $[26] = t14, $[27] = t15) : t15 = $[27];
2055
+ let t16;
2056
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._inputPresentation() }), $[28] = t16) : t16 = $[28];
2057
+ let t17;
2058
+ return $[29] !== t10 || $[30] !== t11 || $[31] !== t12 || $[32] !== t15 ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t10, "data-invalid": t11, "data-read-only": t12, "data-ui": "TextArea", children: [
2059
+ t15,
2060
+ t16
2061
+ ] }), $[29] = t10, $[30] = t11, $[31] = t12, $[32] = t15, $[33] = t17) : t17 = $[33], t17;
2062
+ }
2063
+ TextArea.displayName = "TextArea";
2064
+ const DEFAULT_TEXT_INPUT_ELEMENT = "input", CLEAR_BUTTON_BOX_STYLE = {
2065
+ backgroundColor: "transparent",
2066
+ top: 0,
2067
+ right: 0,
2068
+ zIndex: 2
2069
+ };
2070
+ function TextInput(props) {
2071
+ const $ = reactCompilerRuntime.c(89), t0 = props;
2072
+ let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef, gap, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
2073
+ if ($[0] !== t0) {
2074
+ const {
2075
+ __unstable_disableFocusRing: t92,
2076
+ as: t102,
2077
+ border: t112,
2078
+ className: t122,
2079
+ clearButton: t132,
2080
+ disabled: t142,
2081
+ fontSize: t152,
2082
+ gap: t162,
2083
+ icon: t172,
2084
+ iconRight: t182,
2085
+ onClear: t192,
2086
+ padding: t202,
2087
+ prefix: t212,
2088
+ radius: t222,
2089
+ readOnly: t232,
2090
+ ref: t242,
2091
+ space: t252,
2092
+ suffix: t262,
2093
+ customValidity: t272,
2094
+ type: t282,
2095
+ weight: _width,
2096
+ width: t292,
2097
+ ...t302
2098
+ } = t0;
2099
+ __unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, t4 = t152, gap = t162, IconComponent = t172, IconRightComponent = t182, onClear = t192, t5 = t202, prefix = t212, t6 = t222, readOnly = t232, forwardedRef = t242, t7 = t252, suffix = t262, customValidity = t272, t8 = t282, width = t292, rest = t302, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = forwardedRef, $[8] = gap, $[9] = onClear, $[10] = prefix, $[11] = readOnly, $[12] = rest, $[13] = suffix, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = t7, $[21] = t8, $[22] = width;
2100
+ } else
2101
+ IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], forwardedRef = $[7], gap = $[8], onClear = $[9], prefix = $[10], readOnly = $[11], rest = $[12], suffix = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20], t8 = $[21], width = $[22];
2102
+ const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 2 : t6, space = t7 === void 0 ? 3 : t7, type = t8 === void 0 ? "text" : t8, ref = react.useRef(null), paddingArray = useArrayProp(padding), withClearButton = !!clearButton;
2103
+ let t9;
2104
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => ref.current, $[23] = t9) : t9 = $[23], react.useImperativeHandle(forwardedRef, t9), useCustomValidity(ref, customValidity);
2105
+ const handleClearMouseDown = _temp;
2106
+ let t10;
2107
+ $[24] !== onClear ? (t10 = (event_0) => {
2108
+ event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
2109
+ }, $[24] = onClear, $[25] = t10) : t10 = $[25];
2110
+ const handleClearClick = t10;
2111
+ let t11, t12;
2112
+ $[26] !== paddingArray ? (t12 = paddingArray.map(_temp2), $[26] = paddingArray, $[27] = t12) : t12 = $[27], t11 = t12;
2113
+ const clearButtonBoxPadding = t11;
2114
+ let t13, t14;
2115
+ $[28] !== paddingArray ? (t14 = paddingArray.map(_temp3), $[28] = paddingArray, $[29] = t14) : t14 = $[29], t13 = t14;
2116
+ const clearButtonPadding = t13;
2117
+ let t15;
2118
+ t15 = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
2119
+ const clearButtonProps = t15, t16 = gap ?? space;
2120
+ let t17;
2121
+ $[30] !== border || $[31] !== className || $[32] !== fontSize || $[33] !== padding || $[34] !== radius || $[35] !== t16 || $[36] !== width ? (t17 = css._composeClassNames(className, css.textInput({
2122
+ border,
2123
+ fontSize,
2124
+ padding,
2125
+ radius,
2126
+ gap: t16,
2127
+ width
2128
+ })), $[30] = border, $[31] = className, $[32] = fontSize, $[33] = padding, $[34] = radius, $[35] = t16, $[36] = width, $[37] = t17) : t17 = $[37];
2129
+ const t18 = IconComponent ? "" : void 0, t19 = IconRightComponent ? "" : void 0, t20 = customValidity ? "" : void 0, t21 = prefix ? "" : void 0, t22 = !disabled && readOnly ? "" : void 0, t23 = suffix ? "" : void 0;
2130
+ let t24;
2131
+ $[38] !== prefix ? (t24 = prefix && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: css.textInputPrefix(), sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix }) }), $[38] = prefix, $[39] = t24) : t24 = $[39];
2132
+ let t25;
2133
+ $[40] === Symbol.for("react.memo_cache_sentinel") ? (t25 = css.textInputElement(), $[40] = t25) : t25 = $[40];
2134
+ let t26;
2135
+ $[41] === Symbol.for("react.memo_cache_sentinel") ? (t26 = css._inputElement(), $[41] = t26) : t26 = $[41];
2136
+ const t27 = __unstable_disableFocusRing ? "" : void 0;
2137
+ let t28;
2138
+ $[42] !== Element2 || $[43] !== disabled || $[44] !== readOnly || $[45] !== rest || $[46] !== t27 || $[47] !== type ? (t28 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t26, "data-no-focus-ring": t27, disabled, readOnly, ref, type }), $[42] = Element2, $[43] = disabled, $[44] = readOnly, $[45] = rest, $[46] = t27, $[47] = type, $[48] = t28) : t28 = $[48];
2139
+ let t29;
2140
+ $[49] === Symbol.for("react.memo_cache_sentinel") ? (t29 = css._inputPresentation(), $[49] = t29) : t29 = $[49];
2141
+ let t30;
2142
+ $[50] !== IconComponent || $[51] !== fontSize || $[52] !== padding ? (t30 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, position: "absolute", style: {
2143
+ top: 0,
2144
+ left: 0
2145
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
2146
+ react.isValidElement(IconComponent) && IconComponent,
2147
+ reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2148
+ ] }) }), $[50] = IconComponent, $[51] = fontSize, $[52] = padding, $[53] = t30) : t30 = $[53];
2149
+ let t31;
2150
+ $[54] !== IconRightComponent || $[55] !== fontSize || $[56] !== padding || $[57] !== withClearButton ? (t31 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, position: "absolute", style: {
2151
+ top: 0,
2152
+ right: 0
2153
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
2154
+ react.isValidElement(IconRightComponent) && IconRightComponent,
2155
+ reactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
2156
+ ] }) }), $[54] = IconRightComponent, $[55] = fontSize, $[56] = padding, $[57] = withClearButton, $[58] = t31) : t31 = $[58];
2157
+ let t32;
2158
+ $[59] !== t30 || $[60] !== t31 ? (t32 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: t29, position: "absolute", children: [
2159
+ t30,
2160
+ t31
2161
+ ] }), $[59] = t30, $[60] = t31, $[61] = t32) : t32 = $[61];
2162
+ let t33;
2163
+ $[62] !== clearButton || $[63] !== clearButtonBoxPadding || $[64] !== clearButtonPadding || $[65] !== clearButtonProps || $[66] !== disabled || $[67] !== fontSize || $[68] !== handleClearClick || $[69] !== radius || $[70] !== readOnly ? (t33 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(Box, { padding: clearButtonBoxPadding, position: "absolute", style: CLEAR_BUTTON_BOX_STYLE, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[62] = clearButton, $[63] = clearButtonBoxPadding, $[64] = clearButtonPadding, $[65] = clearButtonProps, $[66] = disabled, $[67] = fontSize, $[68] = handleClearClick, $[69] = radius, $[70] = readOnly, $[71] = t33) : t33 = $[71];
2164
+ let t34;
2165
+ $[72] !== t28 || $[73] !== t32 || $[74] !== t33 ? (t34 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: t25, flex: 1, position: "relative", children: [
2166
+ t28,
2167
+ t32,
2168
+ t33
2169
+ ] }), $[72] = t28, $[73] = t32, $[74] = t33, $[75] = t34) : t34 = $[75];
2170
+ let t35;
2171
+ $[76] !== suffix ? (t35 = suffix && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: css.textInputSuffix(), sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), $[76] = suffix, $[77] = t35) : t35 = $[77];
2172
+ let t36;
2173
+ return $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t20 || $[82] !== t21 || $[83] !== t22 || $[84] !== t23 || $[85] !== t24 || $[86] !== t34 || $[87] !== t35 ? (t36 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { align: "center", className: t17, "data-icon-left": t18, "data-icon-right": t19, "data-invalid": t20, "data-prefix": t21, "data-read-only": t22, "data-suffix": t23, "data-ui": "TextInput", display: "flex", children: [
2174
+ t24,
2175
+ t34,
2176
+ t35
2177
+ ] }), $[78] = t17, $[79] = t18, $[80] = t19, $[81] = t20, $[82] = t21, $[83] = t22, $[84] = t23, $[85] = t24, $[86] = t34, $[87] = t35, $[88] = t36) : t36 = $[88], t36;
2178
+ }
2179
+ function _temp3(v_0) {
2180
+ return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : typeof v_0 == "number" ? v_0 - 1 : 0;
2181
+ }
2182
+ function _temp2(v) {
2183
+ return v === 0 ? 0 : v === 1 || v === 2 ? 1 : typeof v == "number" ? v - 2 : 0;
2184
+ }
2185
+ function _temp(event) {
2186
+ event.preventDefault(), event.stopPropagation();
2187
+ }
2188
+ TextInput.displayName = "TextInput";
2189
+ function useDelayedState(initialState) {
2190
+ const $ = reactCompilerRuntime.c(3), [state, setState] = react.useState(initialState), delayedAction = react.useRef(void 0);
2191
+ let t0;
2192
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
2193
+ const action = () => {
2194
+ setState(nextState);
2195
+ };
2196
+ if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay)
2197
+ return action();
2198
+ delayedAction.current = setTimeout(action, delay);
2199
+ }, $[0] = t0) : t0 = $[0];
2200
+ const onStateChange = t0;
2201
+ let t1;
2202
+ return $[1] !== state ? (t1 = [state, onStateChange], $[1] = state, $[2] = t1) : t1 = $[2], t1;
2203
+ }
2204
+ function getElementRef(element) {
2205
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
2206
+ return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
2207
+ }
2208
+ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAULT_TOOLTIP_ARROW_RADIUS = 2, DEFAULT_TOOLTIP_DISTANCE = 4, DEFAULT_TOOLTIP_PADDING = 4, DEFAULT_FALLBACK_PLACEMENTS = {
2209
+ top: ["top-end", "top-start", "bottom", "left", "right"],
2210
+ "top-start": ["top", "top-end", "bottom-start", "left-start", "right-start"],
2211
+ "top-end": ["top", "top-start", "bottom-end", "left-end", "right-end"],
2212
+ bottom: ["bottom-end", "bottom-start", "top", "left", "right"],
2213
+ "bottom-start": ["bottom", "bottom-end", "top-start", "left-start", "right-start"],
2214
+ "bottom-end": ["bottom", "bottom-start", "top-end", "left-end", "right-end"],
2215
+ left: ["left-end", "left-start", "right", "top", "bottom"],
2216
+ "left-start": ["left", "left-end", "right-start", "top-start", "bottom-start"],
2217
+ "left-end": ["left", "left-start", "right-end", "top-end", "bottom-end"],
2218
+ right: ["right-end", "right-start", "left", "top", "bottom"],
2219
+ "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
2220
+ "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
2221
+ }, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
2222
+ function TooltipDelayGroupProvider(props) {
2223
+ const $ = reactCompilerRuntime.c(9), {
2224
+ children,
2225
+ delay
2226
+ } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0;
2227
+ let t0;
2228
+ const t1 = isGroupActive ? 1 : openDelay;
2229
+ let t2;
2230
+ $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
2231
+ setIsGroupActive,
2232
+ openTooltipId,
2233
+ setOpenTooltipId,
2234
+ openDelay: t1,
2235
+ closeDelay
2236
+ }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
2237
+ const value = t0;
2238
+ let t3;
2239
+ return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
2240
+ }
2241
+ TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
2242
+ function useTooltipDelayGroup() {
2243
+ return react.useContext(TooltipDelayGroupContext);
2244
+ }
2245
+ function TooltipLayer(props) {
2246
+ const $ = reactCompilerRuntime.c(50);
2247
+ let animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t0;
2248
+ $[0] !== props ? ({
2249
+ animate,
2250
+ arrow,
2251
+ arrowRef,
2252
+ arrowX,
2253
+ arrowY,
2254
+ children,
2255
+ originX,
2256
+ originY,
2257
+ padding,
2258
+ placement,
2259
+ radius,
2260
+ scheme,
2261
+ shadow,
2262
+ style,
2263
+ tone: t0,
2264
+ ...rest
2265
+ } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = rest, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = t0) : (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], rest = $[12], scheme = $[13], shadow = $[14], style = $[15], t0 = $[16]);
2266
+ const tone = t0 === void 0 ? "inherit" : t0;
2267
+ let t1;
2268
+ const t2 = animate ? "transform" : void 0;
2269
+ let t3;
2270
+ $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
2271
+ originX,
2272
+ originY,
2273
+ willChange: t2,
2274
+ ...style
2275
+ }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t2, $[21] = t3) : t3 = $[21], t1 = t3;
2276
+ const rootStyle = t1;
2277
+ let t4;
2278
+ const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
2279
+ let t7;
2280
+ $[22] !== t5 || $[23] !== t6 ? (t7 = {
2281
+ left: t5,
2282
+ top: t6,
2283
+ right: void 0,
2284
+ bottom: void 0
2285
+ }, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t4 = t7;
2286
+ const arrowStyle = t4, t8 = animate ? "" : void 0;
2287
+ let t9;
2288
+ $[25] !== animate ? (t9 = animate ? ["hidden", "initial"] : void 0, $[25] = animate, $[26] = t9) : t9 = $[26];
2289
+ let t10;
2290
+ $[27] !== animate ? (t10 = animate ? ["visible", "scaleIn"] : void 0, $[27] = animate, $[28] = t10) : t10 = $[28];
2291
+ let t11;
2292
+ $[29] !== animate ? (t11 = animate ? ["hidden", "scaleOut"] : void 0, $[29] = animate, $[30] = t11) : t11 = $[30];
2293
+ let t12;
2294
+ $[31] !== arrow || $[32] !== arrowRef || $[33] !== arrowStyle ? (t12 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[31] = arrow, $[32] = arrowRef, $[33] = arrowStyle, $[34] = t12) : t12 = $[34];
2295
+ let t13;
2296
+ return $[35] !== children || $[36] !== padding || $[37] !== placement || $[38] !== radius || $[39] !== rest || $[40] !== rootStyle || $[41] !== scheme || $[42] !== shadow || $[43] !== t10 || $[44] !== t11 || $[45] !== t12 || $[46] !== t8 || $[47] !== t9 || $[48] !== tone ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(Layer, { "data-ui": "Tooltip__layer", ...rest, as: framerMotion.motion.div, "data-animate": t8, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t9, animate: t10, exit: t11, tone, children: [
2297
+ children,
2298
+ t12
2299
+ ] }), $[35] = children, $[36] = padding, $[37] = placement, $[38] = radius, $[39] = rest, $[40] = rootStyle, $[41] = scheme, $[42] = shadow, $[43] = t10, $[44] = t11, $[45] = t12, $[46] = t8, $[47] = t9, $[48] = tone, $[49] = t13) : t13 = $[49], t13;
2300
+ }
2301
+ TooltipLayer.displayName = "TooltipLayer";
2302
+ const DEFAULT_TOOLTIP_ELEMENT = "div";
2303
+ function Tooltip(props) {
2304
+ const boundaryElementContext = useBoundaryElement(), {
2305
+ animate: _animate = !1,
2306
+ arrow: arrowProp = !1,
2307
+ as = DEFAULT_TOOLTIP_ELEMENT,
2308
+ boundaryElement = boundaryElementContext?.element,
2309
+ children: childProp,
2310
+ className,
2311
+ content,
2312
+ delay,
2313
+ disabled,
2314
+ fallbackPlacements: fallbackPlacementsProp = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
2315
+ padding = 2,
2316
+ placement: placementProp = "bottom",
2317
+ portal: portalProp,
2318
+ radius = 3,
2319
+ ref: forwardedRef,
2320
+ scheme,
2321
+ shadow = 2,
2322
+ zOffset = Z_OFFSETS.tooltip,
2323
+ tone = "inherit",
2324
+ ...rest
2325
+ } = props, card = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
2326
+ react.useImperativeHandle(forwardedRef, () => ref.current);
2327
+ const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = react.useMemo(() => {
2328
+ const ret = [];
2329
+ return ret.push(reactDom$1.flip({
2330
+ boundary: boundaryElement || void 0,
2331
+ fallbackPlacements,
2332
+ padding: DEFAULT_TOOLTIP_PADDING,
2333
+ rootBoundary
2334
+ })), ret.push(reactDom$1.offset({
2335
+ mainAxis: DEFAULT_TOOLTIP_DISTANCE
2336
+ })), ret.push(reactDom$1.shift({
2337
+ boundary: boundaryElement || void 0,
2338
+ rootBoundary,
2339
+ padding: DEFAULT_TOOLTIP_PADDING
2340
+ })), arrowProp && ret.push(reactDom$1.arrow({
2341
+ element: arrowRef,
2342
+ padding: DEFAULT_TOOLTIP_PADDING
2343
+ })), animate && ret.push(origin), ret;
2344
+ }, [animate, arrowProp, boundaryElement, fallbackPlacements]), {
2345
+ floatingStyles,
2346
+ placement,
2347
+ middlewareData,
2348
+ refs,
2349
+ update
2350
+ } = reactDom$1.useFloating({
2351
+ middleware,
2352
+ placement: placementProp,
2353
+ whileElementsMounted: reactDom$1.autoUpdate,
2354
+ elements: {
2355
+ reference: referenceElement
2356
+ },
2357
+ transform: !1
2358
+ }), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
2359
+ setIsGroupActive,
2360
+ setOpenTooltipId
2361
+ } = delayGroupContext || {}, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = react.useCallback((open, immediate) => {
2362
+ if (isInsideGroup)
2363
+ if (open) {
2364
+ const groupedOpenDelay = immediate ? 0 : openDelay;
2365
+ setIsGroupActive?.(open, groupedOpenDelay), setOpenTooltipId?.(tooltipId, groupedOpenDelay);
2366
+ } else {
2367
+ const groupDeactivateDelay = closeDelay > 200 ? closeDelay : 200;
2368
+ setIsGroupActive?.(open, groupDeactivateDelay), setOpenTooltipId?.(null, immediate ? 0 : closeDelay);
2369
+ }
2370
+ else
2371
+ setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
2372
+ }, [isInsideGroup, openDelay, setIsGroupActive, setOpenTooltipId, tooltipId, closeDelay, setIsOpen]), handleBlur = react.useCallback((e) => {
2373
+ handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
2374
+ }, [childProp?.props, handleIsOpenChange]), handleClick = react.useCallback((e_0) => {
2375
+ handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
2376
+ }, [childProp?.props, handleIsOpenChange]), handleContextMenu = react.useCallback((e_1) => {
2377
+ handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
2378
+ }, [childProp?.props, handleIsOpenChange]), handleFocus = react.useCallback((e_2) => {
2379
+ handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
2380
+ }, [childProp?.props, handleIsOpenChange]), handleMouseEnter = react.useCallback((e_3) => {
2381
+ handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
2382
+ }, [childProp?.props, handleIsOpenChange]), handleMouseLeave = react.useCallback((e_4) => {
2383
+ handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
2384
+ }, [childProp?.props, handleIsOpenChange]);
2385
+ useCloseOnMouseLeave({
2386
+ handleIsOpenChange,
2387
+ referenceElement,
2388
+ showTooltip,
2389
+ isInsideGroup
2390
+ }), react.useEffect(() => {
2391
+ disabled && showTooltip && handleIsOpenChange(!1);
2392
+ }, [disabled, handleIsOpenChange, showTooltip]), react.useEffect(() => {
2393
+ !content && showTooltip && handleIsOpenChange(!1);
2394
+ }, [content, handleIsOpenChange, showTooltip]), react.useEffect(() => {
2395
+ if (!showTooltip) return;
2396
+ function handleWindowKeyDown(event) {
2397
+ event.key === "Escape" && handleIsOpenChange(!1, !0);
2398
+ }
2399
+ return window.addEventListener("keydown", handleWindowKeyDown), () => {
2400
+ window.removeEventListener("keydown", handleWindowKeyDown);
2401
+ };
2402
+ }, [handleIsOpenChange, showTooltip]), react.useLayoutEffect(() => {
2403
+ const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
2404
+ setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
2405
+ }, [boundaryElement, portalElement]);
2406
+ const setArrow = react.useCallback((arrowEl) => {
2407
+ arrowRef.current = arrowEl, update();
2408
+ }, [update]), setFloating = react.useCallback((node) => {
2409
+ ref.current = node, refs.setFloating(node);
2410
+ }, [refs]), child = react.useMemo(() => childProp ? react.cloneElement(childProp, {
2411
+ onBlur: handleBlur,
2412
+ onFocus: handleFocus,
2413
+ onMouseEnter: handleMouseEnter,
2414
+ onMouseLeave: handleMouseLeave,
2415
+ onClick: handleClick,
2416
+ onContextMenu: handleContextMenu,
2417
+ ref: setReferenceElement
2418
+ }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
2419
+ if (react.useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
2420
+ if (disabled) return child;
2421
+ const node_0 = /* @__PURE__ */ jsxRuntime.jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: css._composeClassNames(className, css.tooltip()), originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: {
2422
+ ...floatingStyles,
2423
+ maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
2424
+ }, tone, zOffset, children: content }), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: tone === "inherit" ? card?.tone ?? "default" : tone, scheme: scheme ?? "light", children: node_0 }) }) : node_0);
2425
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2426
+ animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
2427
+ child
2428
+ ] });
2429
+ }
2430
+ function useCloseOnMouseLeave(t0) {
2431
+ const $ = reactCompilerRuntime.c(10), {
2432
+ handleIsOpenChange,
2433
+ referenceElement,
2434
+ showTooltip,
2435
+ isInsideGroup
2436
+ } = t0;
2437
+ let t1;
2438
+ $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
2439
+ referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
2440
+ }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
2441
+ const onMouseMove = useEffectEvent.useEffectEvent(t1);
2442
+ let t2;
2443
+ $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
2444
+ if (!showTooltip || isInsideGroup)
2445
+ return;
2446
+ const handleMouseMove = (event) => {
2447
+ onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
2448
+ };
2449
+ return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
2450
+ }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
2451
+ let t3;
2452
+ $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], react.useEffect(t2, t3);
2453
+ }
2454
+ Tooltip.displayName = "Tooltip";
2455
+ const DEFAULT_HOTKEYS_ELEMENT = "kbd";
2456
+ function Hotkeys(props) {
2457
+ const $ = reactCompilerRuntime.c(27), t0 = props;
2458
+ let fontSize, gap, gapX, gapY, keys, padding, radius, rest, t1, t2;
2459
+ $[0] !== t0 ? ({
2460
+ as: t1,
2461
+ fontSize,
2462
+ gap,
2463
+ gapX,
2464
+ gapY,
2465
+ keys,
2466
+ padding,
2467
+ radius,
2468
+ space: t2,
2469
+ ...rest
2470
+ } = t0, $[0] = t0, $[1] = fontSize, $[2] = gap, $[3] = gapX, $[4] = gapY, $[5] = keys, $[6] = padding, $[7] = radius, $[8] = rest, $[9] = t1, $[10] = t2) : (fontSize = $[1], gap = $[2], gapX = $[3], gapY = $[4], keys = $[5], padding = $[6], radius = $[7], rest = $[8], t1 = $[9], t2 = $[10]);
2471
+ const as = t1 === void 0 ? DEFAULT_HOTKEYS_ELEMENT : t1, space = t2 === void 0 ? 1 : t2;
2472
+ if (!keys || keys.length === 0)
2473
+ return;
2474
+ const t3 = gap ?? space;
2475
+ let t4;
2476
+ if ($[11] !== fontSize || $[12] !== keys || $[13] !== padding || $[14] !== radius) {
2477
+ let t52;
2478
+ $[16] !== fontSize || $[17] !== padding || $[18] !== radius ? (t52 = (key2, i) => /* @__PURE__ */ jsxRuntime.jsx(KBD, { fontSize, padding, radius, children: key2 }, i), $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t52) : t52 = $[19], t4 = keys.map(t52), $[11] = fontSize, $[12] = keys, $[13] = padding, $[14] = radius, $[15] = t4;
2479
+ } else
2480
+ t4 = $[15];
2481
+ let t5;
2482
+ return $[20] !== as || $[21] !== gapX || $[22] !== gapY || $[23] !== rest || $[24] !== t3 || $[25] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(Box, { as, "data-ui": "Hotkeys", ...rest, display: "flex", gap: t3, gapX, gapY, children: t4 }), $[20] = as, $[21] = gapX, $[22] = gapY, $[23] = rest, $[24] = t3, $[25] = t4, $[26] = t5) : t5 = $[26], t5;
2483
+ }
2484
+ Hotkeys.displayName = "Hotkeys";
2485
+ const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
2486
+ function _isFocusable(element) {
2487
+ return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
2488
+ }
2489
+ function _getFocusableElements(elements) {
2490
+ return elements.filter(_isFocusable);
2491
+ }
2492
+ function _getDOMPath(rootElement, el) {
2493
+ const path = [];
2494
+ let e = el;
2495
+ for (; e !== rootElement; ) {
2496
+ const parentElement = e.parentElement;
2497
+ if (!parentElement) return path;
2498
+ const index = Array.from(parentElement.childNodes).indexOf(e);
2499
+ if (path.unshift(index), parentElement === rootElement)
2500
+ return path;
2501
+ e = parentElement;
2502
+ }
2503
+ return path;
2504
+ }
2505
+ const EMPTY_PATH = [];
2506
+ function _sortElements(rootElement, elements) {
2507
+ if (!rootElement) return;
2508
+ const map = /* @__PURE__ */ new WeakMap();
2509
+ for (const el of elements)
2510
+ map.set(el, _getDOMPath(rootElement, el));
2511
+ const _sort = (a, b) => {
2512
+ const _a = map.get(a) || EMPTY_PATH, _b = map.get(b) || EMPTY_PATH, len = Math.max(_a.length, _b.length);
2513
+ for (let i = 0; i < len; i += 1) {
2514
+ const aIndex = _a[i] || -1, bIndex = _b[i] || -1;
2515
+ if (aIndex !== bIndex)
2516
+ return aIndex - bIndex;
2517
+ }
2518
+ return 0;
2519
+ };
2520
+ elements.sort(_sort);
2521
+ }
2522
+ function useMenuController(props) {
2523
+ const {
2524
+ onKeyDown,
2525
+ originElement,
2526
+ shouldFocus,
2527
+ rootElementRef
2528
+ } = props, elementsRef = react.useRef([]), [activeIndex, _setActiveIndex] = react.useState(-1), activeIndexRef = react.useRef(activeIndex), activeElement = react.useMemo(() => elementsRef.current[activeIndex] || null, [activeIndex]), mounted = !!rootElementRef.current, setActiveIndex = react.useCallback((nextActiveIndex) => {
2529
+ _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex;
2530
+ }, []), mount = react.useCallback((element, selected) => {
2531
+ if (!element) return () => {
2532
+ };
2533
+ if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
2534
+ const selectedIndex = elementsRef.current.indexOf(element);
2535
+ setActiveIndex(selectedIndex);
2536
+ }
2537
+ return () => {
2538
+ const idx = elementsRef.current.indexOf(element);
2539
+ idx > -1 && elementsRef.current.splice(idx, 1);
2540
+ };
2541
+ }, [rootElementRef, setActiveIndex]), handleKeyDown = react.useCallback((event) => {
2542
+ if (event.key === "Tab") {
2543
+ originElement && originElement.focus();
2544
+ return;
2545
+ }
2546
+ if (event.key === "Home") {
2547
+ event.preventDefault(), event.stopPropagation();
2548
+ const el = _getFocusableElements(elementsRef.current)[0];
2549
+ if (!el) return;
2550
+ const currentIndex = elementsRef.current.indexOf(el);
2551
+ setActiveIndex(currentIndex);
2552
+ return;
2553
+ }
2554
+ if (event.key === "End") {
2555
+ event.preventDefault(), event.stopPropagation();
2556
+ const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
2557
+ if (!el_0) return;
2558
+ const currentIndex_0 = elementsRef.current.indexOf(el_0);
2559
+ setActiveIndex(currentIndex_0);
2560
+ return;
2561
+ }
2562
+ if (event.key === "ArrowUp") {
2563
+ event.preventDefault(), event.stopPropagation();
2564
+ const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
2565
+ if (focusableLen === 0) return;
2566
+ const focusedElement = elementsRef.current[activeIndexRef.current];
2567
+ let focusedIndex = focusableElements_1.indexOf(focusedElement);
2568
+ focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
2569
+ const el_1 = focusableElements_1[focusedIndex], currentIndex_1 = elementsRef.current.indexOf(el_1);
2570
+ setActiveIndex(currentIndex_1);
2571
+ return;
2572
+ }
2573
+ if (event.key === "ArrowDown") {
2574
+ event.preventDefault(), event.stopPropagation();
2575
+ const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
2576
+ if (focusableLen_0 === 0) return;
2577
+ const focusedElement_0 = elementsRef.current[activeIndexRef.current];
2578
+ let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
2579
+ focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
2580
+ const el_2 = focusableElements_2[focusedIndex_0], currentIndex_2 = elementsRef.current.indexOf(el_2);
2581
+ setActiveIndex(currentIndex_2);
2582
+ return;
2583
+ }
2584
+ onKeyDown && onKeyDown(event);
2585
+ }, [onKeyDown, originElement, setActiveIndex]), handleItemMouseEnter = react.useCallback((event_0) => {
2586
+ const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
2587
+ setActiveIndex(currentIndex_3);
2588
+ }, [setActiveIndex]), handleItemMouseLeave = react.useCallback(() => {
2589
+ setActiveIndex(-2), rootElementRef.current?.focus();
2590
+ }, [rootElementRef, setActiveIndex]);
2591
+ return react.useEffect(() => {
2592
+ if (!mounted) return;
2593
+ const rafId = requestAnimationFrame(() => {
2594
+ if (activeIndex === -1) {
2595
+ if (shouldFocus === "first") {
2596
+ const el_3 = _getFocusableElements(elementsRef.current)[0];
2597
+ if (el_3) {
2598
+ const currentIndex_4 = elementsRef.current.indexOf(el_3);
2599
+ setActiveIndex(currentIndex_4);
2600
+ }
2601
+ }
2602
+ if (shouldFocus === "last") {
2603
+ const focusableElements_4 = _getFocusableElements(elementsRef.current), el_4 = focusableElements_4[focusableElements_4.length - 1];
2604
+ if (el_4) {
2605
+ const currentIndex_5 = elementsRef.current.indexOf(el_4);
2606
+ setActiveIndex(currentIndex_5);
2607
+ }
2608
+ }
2609
+ return;
2610
+ }
2611
+ (elementsRef.current[activeIndex] || null)?.focus();
2612
+ });
2613
+ return () => cancelAnimationFrame(rafId);
2614
+ }, [activeIndex, mounted, setActiveIndex, shouldFocus]), {
2615
+ activeElement,
2616
+ activeIndex,
2617
+ handleItemMouseEnter,
2618
+ handleItemMouseLeave,
2619
+ handleKeyDown,
2620
+ mount
2621
+ };
2622
+ }
2623
+ const DEFAULT_MENU_ELEMENT = "div";
2624
+ function Menu(props) {
2625
+ const $ = reactCompilerRuntime.c(58), t0 = props;
2626
+ let _shouldFocus, children, className, forwardedRef, gap, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, rest, t1, t2, t3;
2627
+ if ($[0] !== t0) {
2628
+ const {
2629
+ as: t42,
2630
+ children: t52,
2631
+ className: t62,
2632
+ focusFirst,
2633
+ focusLast,
2634
+ gap: t72,
2635
+ onClickOutside: t82,
2636
+ onEscape: t92,
2637
+ onItemClick: t102,
2638
+ onItemSelect: t112,
2639
+ onKeyDown: t122,
2640
+ originElement: t132,
2641
+ padding: t142,
2642
+ ref: t152,
2643
+ registerElement: t162,
2644
+ shouldFocus: t172,
2645
+ space: t18,
2646
+ ...t19
2647
+ } = t0;
2648
+ t1 = t42, children = t52, className = t62, gap = t72, onClickOutside = t82, onEscape = t92, onItemClick = t102, onItemSelect = t112, onKeyDown = t122, originElement = t132, t2 = t142, forwardedRef = t152, registerElement = t162, _shouldFocus = t172, t3 = t18, rest = t19, $[0] = t0, $[1] = _shouldFocus, $[2] = children, $[3] = className, $[4] = forwardedRef, $[5] = gap, $[6] = onClickOutside, $[7] = onEscape, $[8] = onItemClick, $[9] = onItemSelect, $[10] = onKeyDown, $[11] = originElement, $[12] = registerElement, $[13] = rest, $[14] = t1, $[15] = t2, $[16] = t3;
2649
+ } else
2650
+ _shouldFocus = $[1], children = $[2], className = $[3], forwardedRef = $[4], gap = $[5], onClickOutside = $[6], onEscape = $[7], onItemClick = $[8], onItemSelect = $[9], onKeyDown = $[10], originElement = $[11], registerElement = $[12], rest = $[13], t1 = $[14], t2 = $[15], t3 = $[16];
2651
+ const as = t1 === void 0 ? DEFAULT_MENU_ELEMENT : t1, padding = t2 === void 0 ? 1 : t2, space = t3 === void 0 ? 1 : t3, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = react.useRef(null);
2652
+ let t4;
2653
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[17] = t4) : t4 = $[17], react.useImperativeHandle(forwardedRef, t4);
2654
+ const {
2655
+ isTopLayer
2656
+ } = useLayer();
2657
+ let t5;
2658
+ $[18] !== onKeyDown || $[19] !== originElement || $[20] !== shouldFocus ? (t5 = {
2659
+ onKeyDown,
2660
+ originElement,
2661
+ shouldFocus,
2662
+ rootElementRef: ref
2663
+ }, $[18] = onKeyDown, $[19] = originElement, $[20] = shouldFocus, $[21] = t5) : t5 = $[21];
2664
+ const {
2665
+ activeElement,
2666
+ activeIndex,
2667
+ handleItemMouseEnter,
2668
+ handleItemMouseLeave,
2669
+ handleKeyDown,
2670
+ mount
2671
+ } = useMenuController(t5), unregisterElementRef = react.useRef(null);
2672
+ let t6;
2673
+ $[22] !== registerElement ? (t6 = (el) => {
2674
+ unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
2675
+ }, $[22] = registerElement, $[23] = t6) : t6 = $[23];
2676
+ const handleRefChange = t6;
2677
+ let t7, t8;
2678
+ $[24] !== activeIndex || $[25] !== onItemSelect ? (t7 = () => {
2679
+ onItemSelect && onItemSelect(activeIndex);
2680
+ }, t8 = [activeIndex, onItemSelect], $[24] = activeIndex, $[25] = onItemSelect, $[26] = t7, $[27] = t8) : (t7 = $[26], t8 = $[27]), react.useEffect(t7, t8);
2681
+ let t9;
2682
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[28] = t9) : t9 = $[28], useClickOutsideEvent(isTopLayer && onClickOutside, t9);
2683
+ let t10;
2684
+ $[29] !== isTopLayer || $[30] !== onEscape ? (t10 = (event) => {
2685
+ isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
2686
+ }, $[29] = isTopLayer, $[30] = onEscape, $[31] = t10) : t10 = $[31], useGlobalKeyDown(t10);
2687
+ let t11, t12;
2688
+ $[32] !== activeElement || $[33] !== activeIndex || $[34] !== handleItemMouseEnter || $[35] !== handleItemMouseLeave || $[36] !== mount || $[37] !== onClickOutside || $[38] !== onEscape || $[39] !== onItemClick || $[40] !== registerElement ? (t12 = {
2689
+ version: 0,
2690
+ activeElement,
2691
+ activeIndex,
2692
+ mount,
2693
+ onClickOutside,
2694
+ onEscape,
2695
+ onItemClick,
2696
+ onItemMouseEnter: handleItemMouseEnter,
2697
+ onItemMouseLeave: handleItemMouseLeave,
2698
+ registerElement,
2699
+ onMouseEnter: handleItemMouseEnter,
2700
+ onMouseLeave: handleItemMouseLeave
2701
+ }, $[32] = activeElement, $[33] = activeIndex, $[34] = handleItemMouseEnter, $[35] = handleItemMouseLeave, $[36] = mount, $[37] = onClickOutside, $[38] = onEscape, $[39] = onItemClick, $[40] = registerElement, $[41] = t12) : t12 = $[41], t11 = t12;
2702
+ const value = t11;
2703
+ let t13;
2704
+ $[42] !== className ? (t13 = css._composeClassNames(className, css.menu()), $[42] = className, $[43] = t13) : t13 = $[43];
2705
+ const t14 = gap ?? space;
2706
+ let t15;
2707
+ $[44] !== children || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: t14, children }), $[44] = children, $[45] = t14, $[46] = t15) : t15 = $[46];
2708
+ let t16;
2709
+ $[47] !== as || $[48] !== handleKeyDown || $[49] !== handleRefChange || $[50] !== padding || $[51] !== rest || $[52] !== t13 || $[53] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Menu", ...rest, as, className: t13, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t15 }), $[47] = as, $[48] = handleKeyDown, $[49] = handleRefChange, $[50] = padding, $[51] = rest, $[52] = t13, $[53] = t15, $[54] = t16) : t16 = $[54];
2710
+ let t17;
2711
+ return $[55] !== t16 || $[56] !== value ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: t16 }), $[55] = t16, $[56] = value, $[57] = t17) : t17 = $[57], t17;
2712
+ }
2713
+ Menu.displayName = "Menu";
2714
+ const DEFAULT_MENU_DIVIDER_ELEMENT = "hr";
2715
+ function MenuDivider(props) {
2716
+ const $ = reactCompilerRuntime.c(10), t0 = props;
2717
+ let className, rest, t1;
2718
+ $[0] !== t0 ? ({
2719
+ as: t1,
2720
+ className,
2721
+ ...rest
2722
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
2723
+ const Element2 = t1 === void 0 ? DEFAULT_MENU_DIVIDER_ELEMENT : t1;
2724
+ let t2;
2725
+ $[4] !== className ? (t2 = css._composeClassNames(className, css.menuDivider()), $[4] = className, $[5] = t2) : t2 = $[5];
2726
+ let t3;
2727
+ return $[6] !== Element2 || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t2 }), $[6] = Element2, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
2728
+ }
2729
+ MenuDivider.displayName = "MenuDivider";
2730
+ const DEFAULT_SELECTABLE_ELEMENT = "button";
2731
+ function Selectable(props) {
2732
+ const $ = reactCompilerRuntime.c(14), t0 = props;
2733
+ let className, radius, rest, t1, tone;
2734
+ $[0] !== t0 ? ({
2735
+ as: t1,
2736
+ className,
2737
+ radius,
2738
+ tone,
2739
+ ...rest
2740
+ } = t0, $[0] = t0, $[1] = className, $[2] = radius, $[3] = rest, $[4] = t1, $[5] = tone) : (className = $[1], radius = $[2], rest = $[3], t1 = $[4], tone = $[5]);
2741
+ const as = t1 === void 0 ? DEFAULT_SELECTABLE_ELEMENT : t1;
2742
+ let t2;
2743
+ $[6] !== className || $[7] !== radius || $[8] !== tone ? (t2 = css._composeClassNames(className, css._selectable({
2744
+ radius,
2745
+ tone
2746
+ })), $[6] = className, $[7] = radius, $[8] = tone, $[9] = t2) : t2 = $[9];
2747
+ let t3;
2748
+ return $[10] !== as || $[11] !== rest || $[12] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { ...rest, as, className: t2 }), $[10] = as, $[11] = rest, $[12] = t2, $[13] = t3) : t3 = $[13], t3;
2749
+ }
2750
+ Selectable.displayName = "Selectable";
2751
+ function useMenu() {
2752
+ const value = react.useContext(MenuContext);
2753
+ if (!value)
2754
+ throw new Error("useMenu(): missing context value");
2755
+ if (!isRecord(value) || value.version !== 0)
2756
+ throw new Error("useMenu(): the context value is not compatible");
2757
+ return value;
2758
+ }
2759
+ const DEFAULT_MENU_GROUP_ELEMENT = "button";
2760
+ function MenuGroup(props) {
2761
+ const $ = reactCompilerRuntime.c(79), t0 = props;
2762
+ let IconComponent, children, gap, menuProps, onClick, popover, rest, t1, t2, t3, t4, t5, t6, text;
2763
+ $[0] !== t0 ? ({
2764
+ as: t1,
2765
+ children,
2766
+ fontSize: t2,
2767
+ gap,
2768
+ icon: IconComponent,
2769
+ menu: menuProps,
2770
+ onClick,
2771
+ padding: t3,
2772
+ popover,
2773
+ radius: t4,
2774
+ space: t5,
2775
+ text,
2776
+ tone: t6,
2777
+ ...rest
2778
+ } = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] = gap, $[4] = menuProps, $[5] = onClick, $[6] = popover, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6, $[14] = text) : (IconComponent = $[1], children = $[2], gap = $[3], menuProps = $[4], onClick = $[5], popover = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13], text = $[14]);
2779
+ const as = t1 === void 0 ? DEFAULT_MENU_GROUP_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, space = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, menu = useMenu(), {
2780
+ activeElement,
2781
+ mount,
2782
+ onClickOutside,
2783
+ onEscape,
2784
+ onItemClick,
2785
+ onItemMouseEnter: _onItemMouseEnter,
2786
+ registerElement
2787
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1);
2788
+ let t7;
2789
+ $[15] !== onItemMouseEnter ? (t7 = (event) => {
2790
+ setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
2791
+ }, $[15] = onItemMouseEnter, $[16] = t7) : t7 = $[16];
2792
+ const handleMouseEnter = t7;
2793
+ let t8;
2794
+ $[17] !== rootElement ? (t8 = (event_0) => {
2795
+ event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
2796
+ rootElement?.focus();
2797
+ }));
2798
+ }, $[17] = rootElement, $[18] = t8) : t8 = $[18];
2799
+ const handleMenuKeyDown = t8;
2800
+ let t9;
2801
+ $[19] !== onClick ? (t9 = (event_1) => {
2802
+ onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
2803
+ }, $[19] = onClick, $[20] = t9) : t9 = $[20];
2804
+ const handleClick = t9;
2805
+ let t10;
2806
+ $[21] !== onItemClick ? (t10 = () => {
2807
+ setOpen(!1), onItemClick?.();
2808
+ }, $[21] = onItemClick, $[22] = t10) : t10 = $[22];
2809
+ const handleChildItemClick = t10;
2810
+ let t11;
2811
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => setWithinMenu(!0), $[23] = t11) : t11 = $[23];
2812
+ const handleMenuMouseEnter = t11;
2813
+ let t12, t13;
2814
+ $[24] !== mount || $[25] !== rootElement ? (t12 = () => mount(rootElement), t13 = [mount, rootElement], $[24] = mount, $[25] = rootElement, $[26] = t12, $[27] = t13) : (t12 = $[26], t13 = $[27]), react.useEffect(t12, t13);
2815
+ let t14, t15;
2816
+ $[28] !== active ? (t14 = () => {
2817
+ active || setOpen(!1);
2818
+ }, t15 = [active], $[28] = active, $[29] = t14, $[30] = t15) : (t14 = $[29], t15 = $[30]), react.useEffect(t14, t15);
2819
+ let t16, t17;
2820
+ $[31] !== open ? (t16 = () => {
2821
+ open || setWithinMenu(!1);
2822
+ }, t17 = [open], $[31] = open, $[32] = t16, $[33] = t17) : (t16 = $[32], t17 = $[33]), react.useEffect(t16, t17);
2823
+ let t18, t19;
2824
+ $[34] !== shouldFocus ? (t18 = () => {
2825
+ if (!shouldFocus)
2826
+ return;
2827
+ const rafId = requestAnimationFrame(() => setShouldFocus(null));
2828
+ return () => cancelAnimationFrame(rafId);
2829
+ }, t19 = [shouldFocus], $[34] = shouldFocus, $[35] = t18, $[36] = t19) : (t18 = $[35], t19 = $[36]), react.useEffect(t18, t19);
2830
+ let t20;
2831
+ $[37] !== children || $[38] !== handleChildItemClick || $[39] !== handleMenuKeyDown || $[40] !== menuProps || $[41] !== onClickOutside || $[42] !== onEscape || $[43] !== registerElement || $[44] !== shouldFocus ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[37] = children, $[38] = handleChildItemClick, $[39] = handleMenuKeyDown, $[40] = menuProps, $[41] = onClickOutside, $[42] = onEscape, $[43] = registerElement, $[44] = shouldFocus, $[45] = t20) : t20 = $[45];
2832
+ const childMenu = t20;
2833
+ let t21;
2834
+ $[46] === Symbol.for("react.memo_cache_sentinel") ? (t21 = (event_2) => {
2835
+ const target = event_2.currentTarget;
2836
+ if (document.activeElement === target && event_2.key === "ArrowRight") {
2837
+ setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
2838
+ return;
2839
+ }
2840
+ }, $[46] = t21) : t21 = $[46];
2841
+ const handleKeyDown = t21, t22 = as === "button" ? withinMenu : void 0, t23 = as !== "button" ? withinMenu : void 0, t24 = !withinMenu && active ? "" : void 0, t25 = as === "button" ? "button" : void 0, t26 = gap ?? space;
2842
+ let t27;
2843
+ $[47] !== IconComponent || $[48] !== fontSize ? (t27 = IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
2844
+ react.isValidElement(IconComponent) && IconComponent,
2845
+ reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2846
+ ] }), $[47] = IconComponent, $[48] = fontSize, $[49] = t27) : t27 = $[49];
2847
+ let t28;
2848
+ $[50] !== fontSize || $[51] !== text ? (t28 = /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[50] = fontSize, $[51] = text, $[52] = t28) : t28 = $[52];
2849
+ let t29;
2850
+ $[53] === Symbol.for("react.memo_cache_sentinel") ? (t29 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}), $[53] = t29) : t29 = $[53];
2851
+ let t30;
2852
+ $[54] !== fontSize ? (t30 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, children: t29 }), $[54] = fontSize, $[55] = t30) : t30 = $[55];
2853
+ let t31;
2854
+ $[56] !== padding || $[57] !== t26 || $[58] !== t27 || $[59] !== t28 || $[60] !== t30 ? (t31 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: t26, padding, children: [
2855
+ t27,
2856
+ t28,
2857
+ t30
2858
+ ] }), $[56] = padding, $[57] = t26, $[58] = t27, $[59] = t28, $[60] = t30, $[61] = t31) : t31 = $[61];
2859
+ let t32;
2860
+ $[62] !== as || $[63] !== handleClick || $[64] !== handleMouseEnter || $[65] !== radius || $[66] !== rest || $[67] !== t22 || $[68] !== t23 || $[69] !== t24 || $[70] !== t25 || $[71] !== t31 || $[72] !== tone ? (t32 = /* @__PURE__ */ jsxRuntime.jsx(Selectable, { "data-ui": "MenuGroup", ...rest, "aria-pressed": t22, as, "data-pressed": t23, "data-selected": t24, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, radius, ref: setRootElement, tabIndex: -1, tone, type: t25, children: t31 }), $[62] = as, $[63] = handleClick, $[64] = handleMouseEnter, $[65] = radius, $[66] = rest, $[67] = t22, $[68] = t23, $[69] = t24, $[70] = t25, $[71] = t31, $[72] = tone, $[73] = t32) : t32 = $[73];
2861
+ let t33;
2862
+ return $[74] !== childMenu || $[75] !== open || $[76] !== popover || $[77] !== t32 ? (t33 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t32 }), $[74] = childMenu, $[75] = open, $[76] = popover, $[77] = t32, $[78] = t33) : t33 = $[78], t33;
2863
+ }
2864
+ MenuGroup.displayName = "MenuGroup";
2865
+ const DEFAULT_MENU_ITEM_ELEMENT = "button";
2866
+ function MenuItem(props) {
2867
+ const $ = reactCompilerRuntime.c(75), t0 = props;
2868
+ let IconComponent, IconRightComponent, children, disabled, forwardedRef, gap, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, rest, selectedProp, t1, t2, t3, t4, t5, t6, text;
2869
+ $[0] !== t0 ? ({
2870
+ as: t1,
2871
+ children,
2872
+ disabled,
2873
+ fontSize: t2,
2874
+ gap,
2875
+ gapX,
2876
+ gapY,
2877
+ hotkeys,
2878
+ icon: IconComponent,
2879
+ iconRight: IconRightComponent,
2880
+ onClick,
2881
+ padding: t3,
2882
+ paddingX,
2883
+ paddingY,
2884
+ paddingTop,
2885
+ paddingRight,
2886
+ paddingBottom,
2887
+ paddingLeft,
2888
+ pressed,
2889
+ radius: t4,
2890
+ ref: forwardedRef,
2891
+ selected: selectedProp,
2892
+ space: t5,
2893
+ text,
2894
+ tone: t6,
2895
+ ...rest
2896
+ } = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gap, $[7] = gapX, $[8] = gapY, $[9] = hotkeys, $[10] = onClick, $[11] = paddingBottom, $[12] = paddingLeft, $[13] = paddingRight, $[14] = paddingTop, $[15] = paddingX, $[16] = paddingY, $[17] = pressed, $[18] = rest, $[19] = selectedProp, $[20] = t1, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = t6, $[26] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gap = $[6], gapX = $[7], gapY = $[8], hotkeys = $[9], onClick = $[10], paddingBottom = $[11], paddingLeft = $[12], paddingRight = $[13], paddingTop = $[14], paddingX = $[15], paddingY = $[16], pressed = $[17], rest = $[18], selectedProp = $[19], t1 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], t6 = $[25], text = $[26]);
2897
+ const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, space = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, menu = useMenu(), {
2898
+ activeElement,
2899
+ mount,
2900
+ onItemClick,
2901
+ onItemMouseEnter: _onItemMouseEnter,
2902
+ onItemMouseLeave: _onItemMouseLeave
2903
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onMouseLeave, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
2904
+ let t7;
2905
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[27] = t7) : t7 = $[27], react.useImperativeHandle(forwardedRef, t7);
2906
+ let t8, t9;
2907
+ $[28] !== mount || $[29] !== rootElement || $[30] !== selectedProp ? (t8 = () => mount(rootElement, selectedProp), t9 = [mount, rootElement, selectedProp], $[28] = mount, $[29] = rootElement, $[30] = selectedProp, $[31] = t8, $[32] = t9) : (t8 = $[31], t9 = $[32]), react.useEffect(t8, t9);
2908
+ let t10;
2909
+ $[33] !== disabled || $[34] !== onClick || $[35] !== onItemClick ? (t10 = (event) => {
2910
+ disabled || (onClick && onClick(event), onItemClick && onItemClick());
2911
+ }, $[33] = disabled, $[34] = onClick, $[35] = onItemClick, $[36] = t10) : t10 = $[36];
2912
+ const handleClick = t10;
2913
+ let t11, t12;
2914
+ $[37] !== padding || $[38] !== paddingBottom || $[39] !== paddingLeft || $[40] !== paddingRight || $[41] !== paddingTop || $[42] !== paddingX || $[43] !== paddingY ? (t12 = {
2915
+ padding,
2916
+ paddingX,
2917
+ paddingY,
2918
+ paddingTop,
2919
+ paddingRight,
2920
+ paddingBottom,
2921
+ paddingLeft
2922
+ }, $[37] = padding, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = paddingRight, $[41] = paddingTop, $[42] = paddingX, $[43] = paddingY, $[44] = t12) : t12 = $[44], t11 = t12;
2923
+ const paddingProps = t11;
2924
+ let t13;
2925
+ $[45] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
2926
+ ref.current = el, setRootElement(el);
2927
+ }, $[45] = t13) : t13 = $[45];
2928
+ const setRef = t13, t14 = pressed ? "" : void 0, t15 = active ? "" : void 0, t16 = disabled ? "" : void 0, t17 = as === "button" ? "button" : void 0;
2929
+ let t18;
2930
+ $[46] !== IconComponent || $[47] !== IconRightComponent || $[48] !== fontSize || $[49] !== gap || $[50] !== gapX || $[51] !== gapY || $[52] !== hotkeys || $[53] !== paddingProps || $[54] !== space || $[55] !== text ? (t18 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: gap ?? space, gapX, gapY, align: "center", ...paddingProps, children: [
2931
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { muted: !0, size: fontSize, children: [
2932
+ react.isValidElement(IconComponent) && IconComponent,
2933
+ reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2934
+ ] }),
2935
+ text && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, textOverflow: "ellipsis", weight: "medium", children: text }) }),
2936
+ hotkeys && /* @__PURE__ */ jsxRuntime.jsx(Hotkeys, { keys: hotkeys, style: {
2937
+ marginTop: -4,
2938
+ marginBottom: -4
2939
+ } }),
2940
+ IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { muted: !0, size: fontSize, children: [
2941
+ react.isValidElement(IconRightComponent) && IconRightComponent,
2942
+ reactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
2943
+ ] })
2944
+ ] }), $[46] = IconComponent, $[47] = IconRightComponent, $[48] = fontSize, $[49] = gap, $[50] = gapX, $[51] = gapY, $[52] = hotkeys, $[53] = paddingProps, $[54] = space, $[55] = text, $[56] = t18) : t18 = $[56];
2945
+ let t19;
2946
+ $[57] !== children || $[58] !== paddingProps ? (t19 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[57] = children, $[58] = paddingProps, $[59] = t19) : t19 = $[59];
2947
+ let t20;
2948
+ return $[60] !== as || $[61] !== disabled || $[62] !== handleClick || $[63] !== onItemMouseEnter || $[64] !== onItemMouseLeave || $[65] !== radius || $[66] !== rest || $[67] !== t14 || $[68] !== t15 || $[69] !== t16 || $[70] !== t17 || $[71] !== t18 || $[72] !== t19 || $[73] !== tone ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, "data-pressed": t14, "data-selected": t15, "data-disabled": t16, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, tone, type: t17, children: [
2949
+ t18,
2950
+ t19
2951
+ ] }), $[60] = as, $[61] = disabled, $[62] = handleClick, $[63] = onItemMouseEnter, $[64] = onItemMouseLeave, $[65] = radius, $[66] = rest, $[67] = t14, $[68] = t15, $[69] = t16, $[70] = t17, $[71] = t18, $[72] = t19, $[73] = tone, $[74] = t20) : t20 = $[74], t20;
2952
+ }
2953
+ MenuItem.displayName = "MenuItem";
2954
+ const DEFAULT_TAB_ELEMENT = "button";
2955
+ function Tab(props) {
2956
+ const $ = reactCompilerRuntime.c(33), t0 = props;
2957
+ let focused, forwardedRef, icon, id, label, onClick, onFocus, rest, selected, t1, t2, t3;
2958
+ $[0] !== t0 ? ({
2959
+ as: t1,
2960
+ icon,
2961
+ id,
2962
+ focused,
2963
+ fontSize: t2,
2964
+ label,
2965
+ onClick,
2966
+ onFocus,
2967
+ padding: t3,
2968
+ ref: forwardedRef,
2969
+ selected,
2970
+ ...rest
2971
+ } = t0, $[0] = t0, $[1] = focused, $[2] = forwardedRef, $[3] = icon, $[4] = id, $[5] = label, $[6] = onClick, $[7] = onFocus, $[8] = rest, $[9] = selected, $[10] = t1, $[11] = t2, $[12] = t3) : (focused = $[1], forwardedRef = $[2], icon = $[3], id = $[4], label = $[5], onClick = $[6], onFocus = $[7], rest = $[8], selected = $[9], t1 = $[10], t2 = $[11], t3 = $[12]);
2972
+ const as = t1 === void 0 ? DEFAULT_TAB_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 2 : t3, ref = react.useRef(null), focusedRef = react.useRef(!1);
2973
+ let t4;
2974
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[13] = t4) : t4 = $[13], react.useImperativeHandle(forwardedRef, t4);
2975
+ let t5;
2976
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
2977
+ focusedRef.current = !1;
2978
+ }, $[14] = t5) : t5 = $[14];
2979
+ const handleBlur = t5;
2980
+ let t6;
2981
+ $[15] !== onFocus ? (t6 = (event) => {
2982
+ focusedRef.current = !0, onFocus && onFocus(event);
2983
+ }, $[15] = onFocus, $[16] = t6) : t6 = $[16];
2984
+ const handleFocus = t6;
2985
+ let t7, t8;
2986
+ $[17] !== focused ? (t7 = () => {
2987
+ focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
2988
+ }, t8 = [focused], $[17] = focused, $[18] = t7, $[19] = t8) : (t7 = $[18], t8 = $[19]), react.useEffect(t7, t8);
2989
+ const t9 = selected ? "true" : "false", t10 = selected ? 0 : -1;
2990
+ let t11;
2991
+ return $[20] !== as || $[21] !== fontSize || $[22] !== handleFocus || $[23] !== icon || $[24] !== id || $[25] !== label || $[26] !== onClick || $[27] !== padding || $[28] !== rest || $[29] !== selected || $[30] !== t10 || $[31] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Button, { "data-ui": "Tab", ...rest, "aria-selected": t9, as, fontSize, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t10, text: label, type: "button" }), $[20] = as, $[21] = fontSize, $[22] = handleFocus, $[23] = icon, $[24] = id, $[25] = label, $[26] = onClick, $[27] = padding, $[28] = rest, $[29] = selected, $[30] = t10, $[31] = t9, $[32] = t11) : t11 = $[32], t11;
2992
+ }
2993
+ Tab.displayName = "Tab";
2994
+ const DEFAULT_TAB_LIST_ELEMENT = "div";
2995
+ function TabList(props) {
2996
+ const $ = reactCompilerRuntime.c(21), t0 = props;
2997
+ let childrenProp, rest, t1, t2, t3, t4;
2998
+ $[0] !== t0 ? ({
2999
+ as: t1,
3000
+ children: childrenProp,
3001
+ gap: t2,
3002
+ space: t3,
3003
+ wrap: t4,
3004
+ ...rest
3005
+ } = t0, $[0] = t0, $[1] = childrenProp, $[2] = rest, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4) : (childrenProp = $[1], rest = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6]);
3006
+ const as = t1 === void 0 ? DEFAULT_TAB_LIST_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2, space = t3 === void 0 ? 1 : t3, wrap = t4 === void 0 ? "nowrap" : t4, [focusedIndex, setFocusedIndex] = react.useState(-1);
3007
+ let t5;
3008
+ if ($[7] !== childrenProp || $[8] !== focusedIndex) {
3009
+ const children = react.Children.toArray(childrenProp).filter(_isReactElement);
3010
+ let t62;
3011
+ $[10] !== focusedIndex ? (t62 = (child, childIndex) => react.cloneElement(child, {
3012
+ focused: focusedIndex === childIndex,
3013
+ key: childIndex,
3014
+ onFocus: () => setFocusedIndex(childIndex)
3015
+ }), $[10] = focusedIndex, $[11] = t62) : t62 = $[11], t5 = children.map(t62), $[7] = childrenProp, $[8] = focusedIndex, $[9] = t5;
3016
+ } else
3017
+ t5 = $[9];
3018
+ const tabs = t5, numTabs = tabs.length;
3019
+ let t6;
3020
+ $[12] !== numTabs ? (t6 = (event) => {
3021
+ event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
3022
+ }, $[12] = numTabs, $[13] = t6) : t6 = $[13];
3023
+ const handleKeyDown = t6, t7 = gap ?? space;
3024
+ let t8;
3025
+ return $[14] !== as || $[15] !== handleKeyDown || $[16] !== rest || $[17] !== t7 || $[18] !== tabs || $[19] !== wrap ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "TabList", ...rest, as, gap: t7, onKeyDown: handleKeyDown, role: "tablist", wrap, children: tabs }), $[14] = as, $[15] = handleKeyDown, $[16] = rest, $[17] = t7, $[18] = tabs, $[19] = wrap, $[20] = t8) : t8 = $[20], t8;
3026
+ }
3027
+ TabList.displayName = "TabList";
3028
+ function _isReactElement(node) {
3029
+ return !!node;
3030
+ }
3031
+ exports.AnimatedSpinnerIcon = AnimatedSpinnerIcon;
3032
+ exports.Arrow = Arrow;
3033
+ exports.Avatar = Avatar;
3034
+ exports.AvatarCounter = AvatarCounter;
3035
+ exports.AvatarStack = AvatarStack;
3036
+ exports.Badge = Badge;
3037
+ exports.BoundaryElementProvider = BoundaryElementProvider;
3038
+ exports.Box = Box;
3039
+ exports.Button = Button;
3040
+ exports.Card = Card;
3041
+ exports.CardProvider = CardProvider;
3042
+ exports.Checkbox = Checkbox;
3043
+ exports.Code = Code;
3044
+ exports.Container = Container;
3045
+ exports.DEFAULT_ARROW_ELEMENT = DEFAULT_ARROW_ELEMENT;
3046
+ exports.DEFAULT_AVATAR_COUNTER_ELEMENT = DEFAULT_AVATAR_COUNTER_ELEMENT;
3047
+ exports.DEFAULT_AVATAR_ELEMENT = DEFAULT_AVATAR_ELEMENT;
3048
+ exports.DEFAULT_AVATAR_STACK_ELEMENT = DEFAULT_AVATAR_STACK_ELEMENT;
3049
+ exports.DEFAULT_BADGE_ELEMENT = DEFAULT_BADGE_ELEMENT;
3050
+ exports.DEFAULT_BOX_ELEMENT = DEFAULT_BOX_ELEMENT;
3051
+ exports.DEFAULT_BUTTON_ELEMENT = DEFAULT_BUTTON_ELEMENT;
3052
+ exports.DEFAULT_CARD_ELEMENT = DEFAULT_CARD_ELEMENT;
3053
+ exports.DEFAULT_CHECKBOX_ELEMENT = DEFAULT_CHECKBOX_ELEMENT;
3054
+ exports.DEFAULT_CODE_ELEMENT = DEFAULT_CODE_ELEMENT;
3055
+ exports.DEFAULT_CONTAINER_ELEMENT = DEFAULT_CONTAINER_ELEMENT;
3056
+ exports.DEFAULT_ELEMENT_QUERY_ELEMENT = DEFAULT_ELEMENT_QUERY_ELEMENT;
3057
+ exports.DEFAULT_FLEX_ELEMENT = DEFAULT_FLEX_ELEMENT;
3058
+ exports.DEFAULT_GRID_ELEMENT = DEFAULT_GRID_ELEMENT;
3059
+ exports.DEFAULT_HEADING_ELEMENT = DEFAULT_HEADING_ELEMENT;
3060
+ exports.DEFAULT_HOTKEYS_ELEMENT = DEFAULT_HOTKEYS_ELEMENT;
3061
+ exports.DEFAULT_INLINE_ELEMENT = DEFAULT_INLINE_ELEMENT;
3062
+ exports.DEFAULT_KBD_ELEMENT = DEFAULT_KBD_ELEMENT;
3063
+ exports.DEFAULT_LABEL_ELEMENT = DEFAULT_LABEL_ELEMENT;
3064
+ exports.DEFAULT_LAYER_ELEMENT = DEFAULT_LAYER_ELEMENT;
3065
+ exports.DEFAULT_MENU_DIVIDER_ELEMENT = DEFAULT_MENU_DIVIDER_ELEMENT;
3066
+ exports.DEFAULT_MENU_ELEMENT = DEFAULT_MENU_ELEMENT;
3067
+ exports.DEFAULT_MENU_GROUP_ELEMENT = DEFAULT_MENU_GROUP_ELEMENT;
3068
+ exports.DEFAULT_MENU_ITEM_ELEMENT = DEFAULT_MENU_ITEM_ELEMENT;
3069
+ exports.DEFAULT_POPOVER_ELEMENT = DEFAULT_POPOVER_ELEMENT;
3070
+ exports.DEFAULT_RADIO_ELEMENT = DEFAULT_RADIO_ELEMENT;
3071
+ exports.DEFAULT_SELECT_ELEMENT = DEFAULT_SELECT_ELEMENT;
3072
+ exports.DEFAULT_SPINNER_ELEMENT = DEFAULT_SPINNER_ELEMENT;
3073
+ exports.DEFAULT_SR_ONLY_ELEMENT = DEFAULT_SR_ONLY_ELEMENT;
3074
+ exports.DEFAULT_STACK_ELEMENT = DEFAULT_STACK_ELEMENT;
3075
+ exports.DEFAULT_SWITCH_ELEMENT = DEFAULT_SWITCH_ELEMENT;
3076
+ exports.DEFAULT_TAB_ELEMENT = DEFAULT_TAB_ELEMENT;
3077
+ exports.DEFAULT_TAB_LIST_ELEMENT = DEFAULT_TAB_LIST_ELEMENT;
3078
+ exports.DEFAULT_TEXT_AREA_ELEMENT = DEFAULT_TEXT_AREA_ELEMENT;
3079
+ exports.DEFAULT_TEXT_ELEMENT = DEFAULT_TEXT_ELEMENT;
3080
+ exports.DEFAULT_TEXT_INPUT_ELEMENT = DEFAULT_TEXT_INPUT_ELEMENT;
3081
+ exports.DEFAULT_TOOLTIP_ELEMENT = DEFAULT_TOOLTIP_ELEMENT;
3082
+ exports.DEFAULT_VIRTUAL_LIST_ELEMENT = DEFAULT_VIRTUAL_LIST_ELEMENT;
3083
+ exports.EMPTY_ARRAY = EMPTY_ARRAY;
3084
+ exports.EMPTY_RECORD = EMPTY_RECORD;
3085
+ exports.ElementQuery = ElementQuery;
3086
+ exports.Flex = Flex;
3087
+ exports.Grid = Grid;
3088
+ exports.Heading = Heading;
3089
+ exports.Hotkeys = Hotkeys;
3090
+ exports.Inline = Inline;
3091
+ exports.KBD = KBD;
3092
+ exports.Label = Label;
3093
+ exports.Layer = Layer;
3094
+ exports.LayerProvider = LayerProvider;
3095
+ exports.Menu = Menu;
3096
+ exports.MenuDivider = MenuDivider;
3097
+ exports.MenuGroup = MenuGroup;
3098
+ exports.MenuItem = MenuItem;
3099
+ exports.Popover = Popover;
3100
+ exports.Portal = Portal;
3101
+ exports.PortalProvider = PortalProvider;
3102
+ exports.Radio = Radio;
3103
+ exports.Select = Select;
3104
+ exports.Selectable = Selectable;
3105
+ exports.Spinner = Spinner;
3106
+ exports.SrOnly = SrOnly;
3107
+ exports.Stack = Stack;
3108
+ exports.Switch = Switch;
3109
+ exports.Tab = Tab;
3110
+ exports.TabList = TabList;
3111
+ exports.Text = Text;
3112
+ exports.TextArea = TextArea;
3113
+ exports.TextInput = TextInput;
3114
+ exports.ThemeColorProvider = ThemeColorProvider;
3115
+ exports.ThemeProvider = ThemeProvider;
3116
+ exports.Tooltip = Tooltip;
3117
+ exports.TooltipDelayGroupContext = TooltipDelayGroupContext;
3118
+ exports.TooltipDelayGroupProvider = TooltipDelayGroupProvider;
3119
+ exports.VirtualList = VirtualList;
3120
+ exports.Z_OFFSETS = Z_OFFSETS;
3121
+ exports._ResizeObserver = _ResizeObserver;
3122
+ exports._elementSizeObserver = _elementSizeObserver;
3123
+ exports._getArrayProp = _getArrayProp;
3124
+ exports._isEnterToClickElement = _isEnterToClickElement;
3125
+ exports._isScrollable = _isScrollable;
3126
+ exports.containsOrEqualsElement = containsOrEqualsElement;
3127
+ exports.createGlobalScopedContext = createGlobalScopedContext;
3128
+ exports.isHTMLAnchorElement = isHTMLAnchorElement;
3129
+ exports.isHTMLButtonElement = isHTMLButtonElement;
3130
+ exports.isHTMLElement = isHTMLElement;
3131
+ exports.isHTMLInputElement = isHTMLInputElement;
3132
+ exports.isHTMLSelectElement = isHTMLSelectElement;
3133
+ exports.isHTMLTextAreaElement = isHTMLTextAreaElement;
3134
+ exports.isRecord = isRecord;
3135
+ exports.useArrayProp = useArrayProp;
3136
+ exports.useBoundaryElement = useBoundaryElement;
3137
+ exports.useCard = useCard;
3138
+ exports.useClickOutsideEvent = useClickOutsideEvent;
3139
+ exports.useCustomValidity = useCustomValidity;
3140
+ exports.useElementSize = useElementSize;
3141
+ exports.useGlobalKeyDown = useGlobalKeyDown;
3142
+ exports.useLayer = useLayer;
3143
+ exports.useMatchMedia = useMatchMedia;
3144
+ exports.useMediaIndex = useMediaIndex;
3145
+ exports.usePortal = usePortal;
3146
+ exports.usePrefersDark = usePrefersDark;
3147
+ exports.usePrefersReducedMotion = usePrefersReducedMotion;
3148
+ exports.useRootTheme = useRootTheme;
3149
+ exports.useTheme = useTheme;
3150
+ exports.useTheme_v2 = useTheme_v2;
3151
+ exports.useTooltipDelayGroup = useTooltipDelayGroup;
3152
+ //# sourceMappingURL=_visual-editing.cjs.map