react-panel-layout 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/dist/{FloatingPanelFrame-lLg-Lpg7.js → FloatingPanelFrame-3eU9AwPo.js} +11 -11
  2. package/dist/{FloatingPanelFrame-lLg-Lpg7.js.map → FloatingPanelFrame-3eU9AwPo.js.map} +1 -1
  3. package/dist/{FloatingPanelFrame-D9Cp2al1.cjs → FloatingPanelFrame-CEmXDvUA.cjs} +2 -2
  4. package/dist/{FloatingPanelFrame-D9Cp2al1.cjs.map → FloatingPanelFrame-CEmXDvUA.cjs.map} +1 -1
  5. package/dist/FloatingWindow-CUXnEtrb.js +827 -0
  6. package/dist/FloatingWindow-CUXnEtrb.js.map +1 -0
  7. package/dist/FloatingWindow-DMwyK0eK.cjs +2 -0
  8. package/dist/FloatingWindow-DMwyK0eK.cjs.map +1 -0
  9. package/dist/GridLayout-DKTg_N61.cjs +2 -0
  10. package/dist/GridLayout-DKTg_N61.cjs.map +1 -0
  11. package/dist/GridLayout-UWNxXw77.js +926 -0
  12. package/dist/GridLayout-UWNxXw77.js.map +1 -0
  13. package/dist/HorizontalDivider-DdxzfV0l.js +30 -0
  14. package/dist/HorizontalDivider-DdxzfV0l.js.map +1 -0
  15. package/dist/HorizontalDivider-_pgV4Mcv.cjs +2 -0
  16. package/dist/HorizontalDivider-_pgV4Mcv.cjs.map +1 -0
  17. package/dist/PanelSystem-BqUzNtf2.js +1946 -0
  18. package/dist/PanelSystem-BqUzNtf2.js.map +1 -0
  19. package/dist/PanelSystem-D603LKKv.cjs +3 -0
  20. package/dist/PanelSystem-D603LKKv.cjs.map +1 -0
  21. package/dist/ResizeHandle-CBcAS918.cjs +2 -0
  22. package/dist/ResizeHandle-CBcAS918.cjs.map +1 -0
  23. package/dist/ResizeHandle-CXjc1meV.js +119 -0
  24. package/dist/ResizeHandle-CXjc1meV.js.map +1 -0
  25. package/dist/SwipePivotTabBar-DWrCuwEI.js +411 -0
  26. package/dist/SwipePivotTabBar-DWrCuwEI.js.map +1 -0
  27. package/dist/SwipePivotTabBar-fjjXkpj7.cjs +2 -0
  28. package/dist/SwipePivotTabBar-fjjXkpj7.cjs.map +1 -0
  29. package/dist/components/gesture/SwipeSafeZone.d.ts +40 -0
  30. package/dist/components/window/Drawer.d.ts +3 -1
  31. package/dist/components/window/DrawerLayers.d.ts +1 -1
  32. package/dist/components/window/drawerStyles.d.ts +69 -0
  33. package/dist/components/window/drawerSwipeConfig.d.ts +29 -0
  34. package/dist/components/window/useDrawerSwipeTransform.d.ts +23 -0
  35. package/dist/config.cjs +1 -1
  36. package/dist/config.cjs.map +1 -1
  37. package/dist/config.js +11 -9
  38. package/dist/config.js.map +1 -1
  39. package/dist/constants/styles.d.ts +35 -4
  40. package/dist/dialog/index.d.ts +69 -0
  41. package/dist/floating.cjs +1 -1
  42. package/dist/floating.js +1 -1
  43. package/dist/grid/index.d.ts +58 -0
  44. package/dist/grid.cjs +2 -0
  45. package/dist/grid.cjs.map +1 -0
  46. package/dist/grid.js +13 -0
  47. package/dist/grid.js.map +1 -0
  48. package/dist/hooks/gesture/presets.d.ts +33 -0
  49. package/dist/hooks/gesture/testing/createGestureSimulator.d.ts +117 -0
  50. package/dist/hooks/gesture/thresholdValue.d.ts +44 -0
  51. package/dist/hooks/gesture/types.d.ts +297 -0
  52. package/dist/hooks/gesture/useDirectionalLock.d.ts +20 -0
  53. package/dist/hooks/gesture/useEdgeSwipeInput.d.ts +23 -0
  54. package/dist/hooks/gesture/useNativeGestureGuard.d.ts +23 -0
  55. package/dist/hooks/gesture/usePointerTracking.d.ts +22 -0
  56. package/dist/hooks/gesture/useScrollBoundary.d.ts +23 -0
  57. package/dist/hooks/gesture/useSwipeInput.d.ts +5 -0
  58. package/dist/hooks/gesture/utils.d.ts +59 -0
  59. package/dist/hooks/useAnimatedVisibility.d.ts +58 -0
  60. package/dist/hooks/useAnimationFrame.d.ts +86 -0
  61. package/dist/hooks/useOperationContinuity.d.ts +64 -0
  62. package/dist/hooks/useResizeObserver.d.ts +33 -1
  63. package/dist/hooks/useSharedElementTransition.d.ts +112 -0
  64. package/dist/hooks/useSnapAnimation.d.ts +54 -0
  65. package/dist/hooks/useSwipeContentTransform.d.ts +86 -0
  66. package/dist/index.cjs +1 -2
  67. package/dist/index.cjs.map +1 -1
  68. package/dist/index.d.ts +0 -1
  69. package/dist/index.js +25 -2006
  70. package/dist/index.js.map +1 -1
  71. package/dist/modules/dialog/AlertDialog.d.ts +9 -0
  72. package/dist/modules/dialog/DialogContainer.d.ts +37 -0
  73. package/dist/modules/dialog/Modal.d.ts +26 -0
  74. package/dist/modules/dialog/SwipeDialogContainer.d.ts +16 -0
  75. package/dist/modules/dialog/dialogAnimationUtils.d.ts +113 -0
  76. package/dist/modules/dialog/types.d.ts +183 -0
  77. package/dist/modules/dialog/useDialog.d.ts +39 -0
  78. package/dist/modules/dialog/useDialogContainer.d.ts +47 -0
  79. package/dist/modules/dialog/useDialogSwipeInput.d.ts +70 -0
  80. package/dist/modules/dialog/useDialogTransform.d.ts +82 -0
  81. package/dist/modules/drawer/types.d.ts +74 -0
  82. package/dist/modules/drawer/useDrawerSwipeInput.d.ts +24 -0
  83. package/dist/modules/pivot/PivotContent.d.ts +1 -1
  84. package/dist/modules/pivot/SwipePivotContent.d.ts +39 -0
  85. package/dist/modules/pivot/SwipePivotContent.debug.tmp.d.ts +25 -0
  86. package/dist/modules/pivot/SwipePivotContent.test.d.ts +1 -0
  87. package/dist/modules/pivot/SwipePivotTabBar.d.ts +92 -0
  88. package/dist/modules/pivot/index.d.ts +3 -0
  89. package/dist/modules/pivot/scaleInputState.d.ts +37 -0
  90. package/dist/modules/pivot/types.d.ts +67 -2
  91. package/dist/modules/pivot/usePivotSwipeInput.d.ts +68 -0
  92. package/dist/modules/stack/StackContent.d.ts +15 -0
  93. package/dist/modules/stack/SwipeStackContent.d.ts +66 -0
  94. package/dist/modules/stack/SwipeStackOutlet.d.ts +80 -0
  95. package/dist/modules/stack/computeStackContentState.d.ts +99 -0
  96. package/dist/modules/stack/computeSwipeStackTransform.d.ts +76 -0
  97. package/dist/modules/stack/types.d.ts +194 -0
  98. package/dist/modules/stack/useStackAnimationState.d.ts +32 -0
  99. package/dist/modules/stack/useStackNavigation.d.ts +23 -0
  100. package/dist/modules/stack/useStackSwipeInput.d.ts +27 -0
  101. package/dist/panels/index.d.ts +67 -0
  102. package/dist/panels.cjs +2 -0
  103. package/dist/panels.cjs.map +1 -0
  104. package/dist/panels.js +28 -0
  105. package/dist/panels.js.map +1 -0
  106. package/dist/pivot/index.d.ts +3 -0
  107. package/dist/pivot.cjs +1 -1
  108. package/dist/pivot.cjs.map +1 -1
  109. package/dist/pivot.js +20 -2
  110. package/dist/pivot.js.map +1 -1
  111. package/dist/resizer/index.d.ts +57 -0
  112. package/dist/resizer.cjs +2 -0
  113. package/dist/resizer.cjs.map +1 -0
  114. package/dist/resizer.js +8 -0
  115. package/dist/resizer.js.map +1 -0
  116. package/dist/stack/index.d.ts +72 -0
  117. package/dist/stack.cjs +2 -0
  118. package/dist/stack.cjs.map +1 -0
  119. package/dist/stack.js +721 -0
  120. package/dist/stack.js.map +1 -0
  121. package/dist/sticky-header/StickyArea.d.ts +38 -0
  122. package/dist/sticky-header/calculateStickyMetrics.d.ts +28 -0
  123. package/dist/sticky-header/index.d.ts +4 -4
  124. package/dist/sticky-header/types.d.ts +35 -22
  125. package/dist/sticky-header.cjs +1 -1
  126. package/dist/sticky-header.cjs.map +1 -1
  127. package/dist/sticky-header.js +73 -174
  128. package/dist/sticky-header.js.map +1 -1
  129. package/dist/styles-NkjuMOVS.js +57 -0
  130. package/dist/styles-NkjuMOVS.js.map +1 -0
  131. package/dist/styles-qf6ptVLD.cjs +2 -0
  132. package/dist/styles-qf6ptVLD.cjs.map +1 -0
  133. package/dist/types.d.ts +16 -0
  134. package/dist/useContentCache-CO3LYNmz.js +24 -0
  135. package/dist/useContentCache-CO3LYNmz.js.map +1 -0
  136. package/dist/useContentCache-DqXtLrLs.cjs +2 -0
  137. package/dist/useContentCache-DqXtLrLs.cjs.map +1 -0
  138. package/dist/useDocumentPointerEvents-DXxw3qWj.js +54 -0
  139. package/dist/useDocumentPointerEvents-DXxw3qWj.js.map +1 -0
  140. package/dist/useDocumentPointerEvents-DxDSOtip.cjs +2 -0
  141. package/dist/useDocumentPointerEvents-DxDSOtip.cjs.map +1 -0
  142. package/dist/useFloatingState-C4kRaW_R.cjs +2 -0
  143. package/dist/useFloatingState-C4kRaW_R.cjs.map +1 -0
  144. package/dist/useFloatingState-tEfA_wbc.js +74 -0
  145. package/dist/useFloatingState-tEfA_wbc.js.map +1 -0
  146. package/dist/useNativeGestureGuard-C7TSqEkr.cjs +2 -0
  147. package/dist/useNativeGestureGuard-C7TSqEkr.cjs.map +1 -0
  148. package/dist/useNativeGestureGuard-CGYo6O0r.js +347 -0
  149. package/dist/useNativeGestureGuard-CGYo6O0r.js.map +1 -0
  150. package/dist/window/index.d.ts +63 -0
  151. package/dist/window.cjs +2 -0
  152. package/dist/window.cjs.map +1 -0
  153. package/dist/window.js +160 -0
  154. package/dist/window.js.map +1 -0
  155. package/docs/design-tokens.md +405 -0
  156. package/package.json +34 -4
  157. package/src/PanelSystemContext.tsx +88 -0
  158. package/src/components/gesture/SwipeSafeZone.tsx +69 -0
  159. package/src/components/grid/GridLayerList.tsx +172 -0
  160. package/src/components/grid/GridLayerResizeHandles.tsx +145 -0
  161. package/src/components/grid/GridLayout.spec.tsx +743 -0
  162. package/src/components/grid/GridLayout.tsx +130 -0
  163. package/src/components/grid/GridTrackResizeHandle.tsx +87 -0
  164. package/src/components/paneling/FloatingPanelFrame.tsx +203 -0
  165. package/src/components/panels/DropSuggestOverlay.tsx +131 -0
  166. package/src/components/panels/PanelGroupView.tsx +112 -0
  167. package/src/components/pivot/PivotLayer.tsx +27 -0
  168. package/src/components/resizer/HorizontalDivider.tsx +52 -0
  169. package/src/components/resizer/ResizeHandle.tsx +118 -0
  170. package/src/components/tabs/TabBar.tsx +223 -0
  171. package/src/components/tabs/TabBarTab.tsx +133 -0
  172. package/src/components/tabs/TabDragOverlay.tsx +92 -0
  173. package/src/components/window/DialogOverlay.tsx +180 -0
  174. package/src/components/window/Drawer.tsx +369 -0
  175. package/src/components/window/DrawerLayers.tsx +68 -0
  176. package/src/components/window/FloatingWindow.tsx +95 -0
  177. package/src/components/window/PopupLayerPortal.tsx +218 -0
  178. package/src/components/window/drawerStyles.spec.ts +263 -0
  179. package/src/components/window/drawerStyles.ts +228 -0
  180. package/src/components/window/drawerSwipeConfig.spec.ts +131 -0
  181. package/src/components/window/drawerSwipeConfig.ts +112 -0
  182. package/src/components/window/useDrawerSwipeTransform.spec.ts +234 -0
  183. package/src/components/window/useDrawerSwipeTransform.ts +129 -0
  184. package/src/config/PanelContentDeclaration.tsx +427 -0
  185. package/src/config/index.tsx +52 -0
  186. package/src/config/panelJsx.spec.tsx +54 -0
  187. package/src/config/panelJsxConfig.spec.tsx +54 -0
  188. package/src/config/panelJsxDrawer.spec.tsx +33 -0
  189. package/src/config/panelRouter.spec.ts +68 -0
  190. package/src/config/panelRouter.tsx +155 -0
  191. package/src/constants/styles.ts +280 -0
  192. package/src/demo/Layout.module.css +258 -0
  193. package/src/demo/Layout.tsx +176 -0
  194. package/src/demo/components/CodeBlock.module.css +54 -0
  195. package/src/demo/components/CodeBlock.tsx +34 -0
  196. package/src/demo/components/CodePreview.module.css +37 -0
  197. package/src/demo/components/CodePreview.tsx +31 -0
  198. package/src/demo/components/DataPreview.module.css +177 -0
  199. package/src/demo/components/DataPreview.tsx +115 -0
  200. package/src/demo/components/Story.module.css +68 -0
  201. package/src/demo/components/Story.tsx +54 -0
  202. package/src/demo/components/layout/CodePanel.module.css +183 -0
  203. package/src/demo/components/layout/CodePanel.tsx +149 -0
  204. package/src/demo/components/layout/DemoPage.module.css +60 -0
  205. package/src/demo/components/layout/DemoPage.tsx +56 -0
  206. package/src/demo/components/layout/SingleSamplePage.module.css +11 -0
  207. package/src/demo/components/layout/SingleSamplePage.tsx +35 -0
  208. package/src/demo/components/layout/SplitDemoLayout.module.css +107 -0
  209. package/src/demo/components/layout/SplitDemoLayout.tsx +218 -0
  210. package/src/demo/components/layout/index.ts +11 -0
  211. package/src/demo/components/tab-styles/ChromeTabBar.module.css +75 -0
  212. package/src/demo/components/tab-styles/ChromeTabBar.tsx +111 -0
  213. package/src/demo/components/tab-styles/GitHubTabBar.module.css +81 -0
  214. package/src/demo/components/tab-styles/GitHubTabBar.tsx +109 -0
  215. package/src/demo/components/tab-styles/VSCodeTabBar.module.css +78 -0
  216. package/src/demo/components/tab-styles/VSCodeTabBar.tsx +109 -0
  217. package/src/demo/components/tab-styles/index.ts +6 -0
  218. package/src/demo/components/ui/DemoButton.module.css +63 -0
  219. package/src/demo/components/ui/DemoButton.tsx +32 -0
  220. package/src/demo/components/ui/DemoCard.module.css +15 -0
  221. package/src/demo/components/ui/DemoCard.tsx +30 -0
  222. package/src/demo/components/ui/DemoContainer.module.css +17 -0
  223. package/src/demo/components/ui/DemoContainer.tsx +30 -0
  224. package/src/demo/components/ui/DemoPanel.module.css +23 -0
  225. package/src/demo/components/ui/DemoPanel.tsx +33 -0
  226. package/src/demo/components/ui/PanelText.module.css +18 -0
  227. package/src/demo/components/ui/PanelText.tsx +29 -0
  228. package/src/demo/components/ui/PanelTitle.module.css +18 -0
  229. package/src/demo/components/ui/PanelTitle.tsx +31 -0
  230. package/src/demo/contexts/TabbarDemoConfig.tsx +218 -0
  231. package/src/demo/demo.css +172 -0
  232. package/src/demo/hooks/useMedia.ts +41 -0
  233. package/src/demo/hooks/useShikiHighlight.ts +55 -0
  234. package/src/demo/index.tsx +293 -0
  235. package/src/demo/pages/Dialog/alerts/index.tsx +22 -0
  236. package/src/demo/pages/Dialog/card/index.tsx +22 -0
  237. package/src/demo/pages/Dialog/components/AlertDialogDemo.tsx +124 -0
  238. package/src/demo/pages/Dialog/components/CardExpandDemo.module.css +243 -0
  239. package/src/demo/pages/Dialog/components/CardExpandDemo.tsx +204 -0
  240. package/src/demo/pages/Dialog/components/CustomAlertDialogDemo.tsx +219 -0
  241. package/src/demo/pages/Dialog/components/DialogDemos.module.css +77 -0
  242. package/src/demo/pages/Dialog/components/ModalBasics.tsx +45 -0
  243. package/src/demo/pages/Dialog/components/SwipeDialogDemo.module.css +77 -0
  244. package/src/demo/pages/Dialog/components/SwipeDialogDemo.tsx +181 -0
  245. package/src/demo/pages/Dialog/custom-alert/index.tsx +22 -0
  246. package/src/demo/pages/Dialog/modal/index.tsx +17 -0
  247. package/src/demo/pages/Dialog/swipe/index.tsx +22 -0
  248. package/src/demo/pages/Drawer/animations/index.tsx +22 -0
  249. package/src/demo/pages/Drawer/basics/index.tsx +17 -0
  250. package/src/demo/pages/Drawer/components/DrawerAnimations.module.css +125 -0
  251. package/src/demo/pages/Drawer/components/DrawerAnimations.tsx +118 -0
  252. package/src/demo/pages/Drawer/components/DrawerBasics.module.css +55 -0
  253. package/src/demo/pages/Drawer/components/DrawerBasics.tsx +76 -0
  254. package/src/demo/pages/Drawer/components/DrawerMenuLayout.module.css +332 -0
  255. package/src/demo/pages/Drawer/components/DrawerMenuLayout.tsx +199 -0
  256. package/src/demo/pages/Drawer/components/DrawerSwipe.module.css +316 -0
  257. package/src/demo/pages/Drawer/components/DrawerSwipe.tsx +178 -0
  258. package/src/demo/pages/Drawer/menu/index.tsx +17 -0
  259. package/src/demo/pages/Drawer/swipe/index.tsx +17 -0
  260. package/src/demo/pages/FloatingPanelFrame/ResizableFloatingPanelsPreview.module.css +163 -0
  261. package/src/demo/pages/FloatingPanelFrame/ResizableFloatingPanelsPreview.tsx +234 -0
  262. package/src/demo/pages/FloatingPanelFrame/basic/index.tsx +17 -0
  263. package/src/demo/pages/FloatingPanelFrame/complex/index.tsx +26 -0
  264. package/src/demo/pages/FloatingPanelFrame/components/BasicPanel.module.css +16 -0
  265. package/src/demo/pages/FloatingPanelFrame/components/BasicPanel.tsx +24 -0
  266. package/src/demo/pages/FloatingPanelFrame/components/ComplexPanel.module.css +54 -0
  267. package/src/demo/pages/FloatingPanelFrame/components/ComplexPanel.tsx +67 -0
  268. package/src/demo/pages/FloatingPanelFrame/components/PanelWithControls.module.css +21 -0
  269. package/src/demo/pages/FloatingPanelFrame/components/PanelWithControls.tsx +41 -0
  270. package/src/demo/pages/FloatingPanelFrame/components/PanelWithMeta.module.css +5 -0
  271. package/src/demo/pages/FloatingPanelFrame/components/PanelWithMeta.tsx +43 -0
  272. package/src/demo/pages/FloatingPanelFrame/components/ScrollablePanel.module.css +11 -0
  273. package/src/demo/pages/FloatingPanelFrame/components/ScrollablePanel.tsx +42 -0
  274. package/src/demo/pages/FloatingPanelFrame/index.tsx +80 -0
  275. package/src/demo/pages/FloatingPanelFrame/scrollable/index.tsx +30 -0
  276. package/src/demo/pages/FloatingPanelFrame/with-controls/index.tsx +30 -0
  277. package/src/demo/pages/FloatingPanelFrame/with-meta/index.tsx +17 -0
  278. package/src/demo/pages/HorizontalDivider/components/PanelsWithRichContent.module.css +112 -0
  279. package/src/demo/pages/HorizontalDivider/components/PanelsWithRichContent.tsx +56 -0
  280. package/src/demo/pages/HorizontalDivider/components/SimpleResizablePanels.module.css +46 -0
  281. package/src/demo/pages/HorizontalDivider/components/SimpleResizablePanels.tsx +29 -0
  282. package/src/demo/pages/HorizontalDivider/components/ThreePanelLayout.module.css +54 -0
  283. package/src/demo/pages/HorizontalDivider/components/ThreePanelLayout.tsx +30 -0
  284. package/src/demo/pages/HorizontalDivider/index.module.css +14 -0
  285. package/src/demo/pages/HorizontalDivider/index.tsx +64 -0
  286. package/src/demo/pages/HorizontalDivider/panels-with-rich-content/index.tsx +21 -0
  287. package/src/demo/pages/HorizontalDivider/simple-resizable-panels/index.tsx +21 -0
  288. package/src/demo/pages/HorizontalDivider/three-panel-layout/index.tsx +21 -0
  289. package/src/demo/pages/PanelLayout/PanelLayoutDemo.module.css +174 -0
  290. package/src/demo/pages/PanelLayout/PanelLayoutDemo.tsx +248 -0
  291. package/src/demo/pages/PanelLayout/components/DashboardLayout.module.css +115 -0
  292. package/src/demo/pages/PanelLayout/components/DashboardLayout.tsx +124 -0
  293. package/src/demo/pages/PanelLayout/components/DraggableOverlays.module.css +101 -0
  294. package/src/demo/pages/PanelLayout/components/DraggableOverlays.tsx +122 -0
  295. package/src/demo/pages/PanelLayout/components/IDELayout.module.css +104 -0
  296. package/src/demo/pages/PanelLayout/components/IDELayout.tsx +143 -0
  297. package/src/demo/pages/PanelLayout/components/SimpleGrid.module.css +19 -0
  298. package/src/demo/pages/PanelLayout/components/SimpleGrid.tsx +62 -0
  299. package/src/demo/pages/PanelLayout/dashboard/index.tsx +22 -0
  300. package/src/demo/pages/PanelLayout/draggable-overlays/index.tsx +22 -0
  301. package/src/demo/pages/PanelLayout/ide-layout/index.tsx +22 -0
  302. package/src/demo/pages/PanelLayout/index.tsx +94 -0
  303. package/src/demo/pages/PanelLayout/simple-grid/index.tsx +22 -0
  304. package/src/demo/pages/PanelSystem/PanelSystemPreview.module.css +20 -0
  305. package/src/demo/pages/PanelSystem/PanelSystemPreview.tsx +101 -0
  306. package/src/demo/pages/PanelSystem/preview/index.tsx +18 -0
  307. package/src/demo/pages/PanelSystem/tabbar/index.tsx +129 -0
  308. package/src/demo/pages/Pivot/basics/index.tsx +17 -0
  309. package/src/demo/pages/Pivot/components/Pivot.module.css +278 -0
  310. package/src/demo/pages/Pivot/components/PivotBasics.tsx +103 -0
  311. package/src/demo/pages/Pivot/components/PivotSidebar.tsx +168 -0
  312. package/src/demo/pages/Pivot/components/PivotTabs.tsx +129 -0
  313. package/src/demo/pages/Pivot/components/PivotTransitions.tsx +120 -0
  314. package/src/demo/pages/Pivot/components/SwipePivot.module.css +114 -0
  315. package/src/demo/pages/Pivot/components/SwipePivot.tsx +193 -0
  316. package/src/demo/pages/Pivot/components/SwipeTabsPivot.module.css +203 -0
  317. package/src/demo/pages/Pivot/components/SwipeTabsPivot.tsx +320 -0
  318. package/src/demo/pages/Pivot/sidebar/index.tsx +17 -0
  319. package/src/demo/pages/Pivot/swipe/index.tsx +16 -0
  320. package/src/demo/pages/Pivot/swipe-debug/index.tsx +287 -0
  321. package/src/demo/pages/Pivot/swipe-tabs/index.tsx +15 -0
  322. package/src/demo/pages/Pivot/tabs/index.tsx +17 -0
  323. package/src/demo/pages/Pivot/transitions/index.tsx +17 -0
  324. package/src/demo/pages/ResizeHandle/both-directions/index.tsx +17 -0
  325. package/src/demo/pages/ResizeHandle/components/BothDirectionsDemo.module.css +72 -0
  326. package/src/demo/pages/ResizeHandle/components/BothDirectionsDemo.tsx +41 -0
  327. package/src/demo/pages/ResizeHandle/components/HorizontalResizeDemo.module.css +61 -0
  328. package/src/demo/pages/ResizeHandle/components/HorizontalResizeDemo.tsx +33 -0
  329. package/src/demo/pages/ResizeHandle/components/NestedPanelsDemo.module.css +83 -0
  330. package/src/demo/pages/ResizeHandle/components/NestedPanelsDemo.tsx +53 -0
  331. package/src/demo/pages/ResizeHandle/components/VerticalResizeDemo.module.css +68 -0
  332. package/src/demo/pages/ResizeHandle/components/VerticalResizeDemo.tsx +33 -0
  333. package/src/demo/pages/ResizeHandle/horizontal/index.tsx +17 -0
  334. package/src/demo/pages/ResizeHandle/index.module.css +11 -0
  335. package/src/demo/pages/ResizeHandle/index.tsx +71 -0
  336. package/src/demo/pages/ResizeHandle/nested-panels/index.tsx +17 -0
  337. package/src/demo/pages/ResizeHandle/vertical/index.tsx +17 -0
  338. package/src/demo/pages/ResponsiveLayout/adaptive-workspace/index.tsx +22 -0
  339. package/src/demo/pages/ResponsiveLayout/components/ResponsiveWorkspace.module.css +423 -0
  340. package/src/demo/pages/ResponsiveLayout/components/ResponsiveWorkspace.tsx +398 -0
  341. package/src/demo/pages/Stack/basics/index.tsx +22 -0
  342. package/src/demo/pages/Stack/components/Stack.module.css +234 -0
  343. package/src/demo/pages/Stack/components/StackBasics.spec.tsx +152 -0
  344. package/src/demo/pages/Stack/components/StackBasics.tsx +301 -0
  345. package/src/demo/pages/Stack/components/StackTablet.module.css +299 -0
  346. package/src/demo/pages/Stack/components/StackTablet.spec.tsx +120 -0
  347. package/src/demo/pages/Stack/components/StackTablet.tsx +422 -0
  348. package/src/demo/pages/Stack/tablet/index.tsx +22 -0
  349. package/src/demo/pages/StickyHeader/basics/index.tsx +17 -0
  350. package/src/demo/pages/StickyHeader/components/StickyHeader.module.css +219 -0
  351. package/src/demo/pages/StickyHeader/components/StickyHeaderBasics.tsx +103 -0
  352. package/src/demo/routes.tsx +214 -0
  353. package/src/demo/styles/animations.css +68 -0
  354. package/src/demo/styles/stack-themes.css +35 -0
  355. package/src/demo/utils/createPanelView.tsx +58 -0
  356. package/src/dialog/index.ts +85 -0
  357. package/src/floating/index.ts +24 -0
  358. package/src/grid/index.ts +75 -0
  359. package/src/hooks/ContentCacheContext.tsx +87 -0
  360. package/src/hooks/gesture/presets.spec.ts +86 -0
  361. package/src/hooks/gesture/presets.ts +95 -0
  362. package/src/hooks/gesture/testing/createGestureSimulator.spec.ts +241 -0
  363. package/src/hooks/gesture/testing/createGestureSimulator.ts +385 -0
  364. package/src/hooks/gesture/thresholdValue.spec.ts +103 -0
  365. package/src/hooks/gesture/thresholdValue.ts +77 -0
  366. package/src/hooks/gesture/types.ts +367 -0
  367. package/src/hooks/gesture/useDirectionalLock.spec.ts +271 -0
  368. package/src/hooks/gesture/useDirectionalLock.ts +115 -0
  369. package/src/hooks/gesture/useEdgeSwipeInput.spec.ts +462 -0
  370. package/src/hooks/gesture/useEdgeSwipeInput.ts +131 -0
  371. package/src/hooks/gesture/useNativeGestureGuard.spec.ts +473 -0
  372. package/src/hooks/gesture/useNativeGestureGuard.ts +135 -0
  373. package/src/hooks/gesture/usePointerTracking.spec.ts +364 -0
  374. package/src/hooks/gesture/usePointerTracking.ts +134 -0
  375. package/src/hooks/gesture/useScrollBoundary.spec.ts +249 -0
  376. package/src/hooks/gesture/useScrollBoundary.ts +113 -0
  377. package/src/hooks/gesture/useSwipeInput.spec.ts +592 -0
  378. package/src/hooks/gesture/useSwipeInput.ts +310 -0
  379. package/src/hooks/gesture/utils.spec.ts +152 -0
  380. package/src/hooks/gesture/utils.ts +178 -0
  381. package/src/hooks/useAnimatedVisibility.spec.ts +277 -0
  382. package/src/hooks/useAnimatedVisibility.ts +172 -0
  383. package/src/hooks/useAnimationFrame.ts +208 -0
  384. package/src/hooks/useCSSMatrix.spec.ts +214 -0
  385. package/src/hooks/useCSSMatrix.ts +262 -0
  386. package/src/hooks/useClonedElementPreview.ts +28 -0
  387. package/src/hooks/useContainerScroll.ts +78 -0
  388. package/src/hooks/useContentCache.spec.tsx +232 -0
  389. package/src/hooks/useContentCache.tsx +127 -0
  390. package/src/hooks/useDocumentPointerEvents.ts +137 -0
  391. package/src/hooks/useDocumentScroll.ts +41 -0
  392. package/src/hooks/useEffectEvent.ts +40 -0
  393. package/src/hooks/useElementComponentWrapper.tsx +63 -0
  394. package/src/hooks/useIntersectionObserver.tsx +125 -0
  395. package/src/hooks/useIsomorphicLayoutEffect.ts +29 -0
  396. package/src/hooks/useOperationContinuity.spec.ts +387 -0
  397. package/src/hooks/useOperationContinuity.ts +135 -0
  398. package/src/hooks/useResizeObserver.spec.tsx +277 -0
  399. package/src/hooks/useResizeObserver.tsx +150 -0
  400. package/src/hooks/useScrollContainer.ts +73 -0
  401. package/src/hooks/useSharedElementTransition.ts +333 -0
  402. package/src/hooks/useSnapAnimation.ts +128 -0
  403. package/src/hooks/useSwipeContentTransform.spec.ts +133 -0
  404. package/src/hooks/useSwipeContentTransform.ts +373 -0
  405. package/src/hooks/useTransitionState.ts +95 -0
  406. package/src/index.tsx +88 -0
  407. package/src/modules/dialog/AlertDialog.spec.tsx +387 -0
  408. package/src/modules/dialog/AlertDialog.tsx +221 -0
  409. package/src/modules/dialog/DialogContainer.spec.tsx +228 -0
  410. package/src/modules/dialog/DialogContainer.tsx +188 -0
  411. package/src/modules/dialog/Modal.spec.tsx +220 -0
  412. package/src/modules/dialog/Modal.tsx +182 -0
  413. package/src/modules/dialog/SwipeDialogContainer.tsx +208 -0
  414. package/src/modules/dialog/dialogAnimationUtils.spec.ts +253 -0
  415. package/src/modules/dialog/dialogAnimationUtils.ts +297 -0
  416. package/src/modules/dialog/types.ts +186 -0
  417. package/src/modules/dialog/useDialog.spec.tsx +447 -0
  418. package/src/modules/dialog/useDialog.ts +214 -0
  419. package/src/modules/dialog/useDialogContainer.spec.ts +331 -0
  420. package/src/modules/dialog/useDialogContainer.ts +150 -0
  421. package/src/modules/dialog/useDialogSwipeInput.spec.ts +157 -0
  422. package/src/modules/dialog/useDialogSwipeInput.ts +319 -0
  423. package/src/modules/dialog/useDialogTransform.spec.ts +370 -0
  424. package/src/modules/dialog/useDialogTransform.ts +407 -0
  425. package/src/modules/drawer/types.ts +102 -0
  426. package/src/modules/drawer/useDrawerSwipeInput.spec.ts +566 -0
  427. package/src/modules/drawer/useDrawerSwipeInput.ts +399 -0
  428. package/src/modules/grid/GridLayoutContext.tsx +57 -0
  429. package/src/modules/grid/LayerInstanceContext.tsx +56 -0
  430. package/src/modules/grid/resizeHandles.ts +157 -0
  431. package/src/modules/grid/trackUtils.ts +146 -0
  432. package/src/modules/grid/useGridPlacements.ts +143 -0
  433. package/src/modules/grid/useGridTracks.ts +156 -0
  434. package/src/modules/grid/useLayerDragHandle.ts +16 -0
  435. package/src/modules/grid/useLayerInteractions.tsx +850 -0
  436. package/src/modules/keybindings/KeybindingsProvider.tsx +111 -0
  437. package/src/modules/panels/dom/DomRegistry.tsx +94 -0
  438. package/src/modules/panels/index.ts +45 -0
  439. package/src/modules/panels/interactions/InteractionsContext.test.tsx +330 -0
  440. package/src/modules/panels/interactions/InteractionsContext.tsx +394 -0
  441. package/src/modules/panels/interactions/dnd.ts +28 -0
  442. package/src/modules/panels/keybindings/KeybindingsInstaller.tsx +15 -0
  443. package/src/modules/panels/layout/adapter.ts +124 -0
  444. package/src/modules/panels/rendering/ContentRegistry.spec.tsx +311 -0
  445. package/src/modules/panels/rendering/ContentRegistry.tsx +205 -0
  446. package/src/modules/panels/rendering/GroupContainer.tsx +65 -0
  447. package/src/modules/panels/rendering/RenderBridge.tsx +115 -0
  448. package/src/modules/panels/rendering/RenderContext.tsx +31 -0
  449. package/src/modules/panels/state/PanelSplitHandles.tsx +147 -0
  450. package/src/modules/panels/state/PanelSystemContext.splitLimits.spec.tsx +50 -0
  451. package/src/modules/panels/state/PanelSystemContext.tsx +289 -0
  452. package/src/modules/panels/state/StateContext.tsx +12 -0
  453. package/src/modules/panels/state/cleanup.ts +37 -0
  454. package/src/modules/panels/state/commands.ts +53 -0
  455. package/src/modules/panels/state/focus/Context.tsx +25 -0
  456. package/src/modules/panels/state/focus/logic.ts +57 -0
  457. package/src/modules/panels/state/groups/Context.tsx +25 -0
  458. package/src/modules/panels/state/groups/logic.ts +105 -0
  459. package/src/modules/panels/state/splitLimits.spec.ts +46 -0
  460. package/src/modules/panels/state/splitLimits.ts +90 -0
  461. package/src/modules/panels/state/state.spec.ts +49 -0
  462. package/src/modules/panels/state/tree/Context.tsx +24 -0
  463. package/src/modules/panels/state/tree/logic.spec.ts +34 -0
  464. package/src/modules/panels/state/tree/logic.ts +138 -0
  465. package/src/modules/panels/state/types.ts +142 -0
  466. package/src/modules/panels/system/PanelSystem.empty-tabbar.spec.tsx +53 -0
  467. package/src/modules/panels/system/PanelSystem.tab-click-activates.spec.tsx +44 -0
  468. package/src/modules/panels/system/PanelSystem.tab-reorder.spec.tsx +64 -0
  469. package/src/modules/panels/system/PanelSystem.tabs-no-dup.spec.tsx +57 -0
  470. package/src/modules/panels/system/PanelSystem.tsx +206 -0
  471. package/src/modules/pivot/PivotContent.spec.tsx +179 -0
  472. package/src/modules/pivot/PivotContent.tsx +77 -0
  473. package/src/modules/pivot/SwipePivotContent.debug.tmp.tsx +237 -0
  474. package/src/modules/pivot/SwipePivotContent.position.spec.tsx +171 -0
  475. package/src/modules/pivot/SwipePivotContent.spec.tsx +494 -0
  476. package/src/modules/pivot/SwipePivotContent.test.tsx +502 -0
  477. package/src/modules/pivot/SwipePivotContent.tsx +197 -0
  478. package/src/modules/pivot/SwipePivotTabBar.spec.tsx +882 -0
  479. package/src/modules/pivot/SwipePivotTabBar.tsx +583 -0
  480. package/src/modules/pivot/index.ts +8 -0
  481. package/src/modules/pivot/scaleInputState.spec.ts +219 -0
  482. package/src/modules/pivot/scaleInputState.ts +66 -0
  483. package/src/modules/pivot/types.ts +139 -0
  484. package/src/modules/pivot/usePivot.spec.ts +635 -0
  485. package/src/modules/pivot/usePivot.spec.tsx +186 -0
  486. package/src/modules/pivot/usePivot.tsx +345 -0
  487. package/src/modules/pivot/usePivotSwipeInput.spec.ts +708 -0
  488. package/src/modules/pivot/usePivotSwipeInput.ts +136 -0
  489. package/src/modules/resizer/useResizeDrag.ts +94 -0
  490. package/src/modules/stack/StackContent.spec.tsx +264 -0
  491. package/src/modules/stack/StackContent.tsx +111 -0
  492. package/src/modules/stack/SwipeStackContent.spec.tsx +1564 -0
  493. package/src/modules/stack/SwipeStackContent.tsx +366 -0
  494. package/src/modules/stack/SwipeStackOutlet.spec.tsx +250 -0
  495. package/src/modules/stack/SwipeStackOutlet.tsx +221 -0
  496. package/src/modules/stack/computeStackContentState.spec.ts +281 -0
  497. package/src/modules/stack/computeStackContentState.ts +304 -0
  498. package/src/modules/stack/computeSwipeStackTransform.spec.ts +186 -0
  499. package/src/modules/stack/computeSwipeStackTransform.ts +145 -0
  500. package/src/modules/stack/swipeTransitionContinuity.spec.tsx +1133 -0
  501. package/src/modules/stack/types.ts +226 -0
  502. package/src/modules/stack/useStackAnimationState.spec.ts +188 -0
  503. package/src/modules/stack/useStackAnimationState.ts +143 -0
  504. package/src/modules/stack/useStackNavigation.spec.ts +672 -0
  505. package/src/modules/stack/useStackNavigation.tsx +393 -0
  506. package/src/modules/stack/useStackSwipeInput.spec.ts +309 -0
  507. package/src/modules/stack/useStackSwipeInput.ts +139 -0
  508. package/src/modules/window/useDrawerState.ts +81 -0
  509. package/src/modules/window/useFloatingState.spec.ts +252 -0
  510. package/src/modules/window/useFloatingState.ts +141 -0
  511. package/src/panels/index.ts +119 -0
  512. package/src/pivot/index.ts +19 -0
  513. package/src/resizer/index.ts +68 -0
  514. package/src/stack/index.ts +91 -0
  515. package/src/sticky-header/StickyArea.tsx +193 -0
  516. package/src/sticky-header/calculateStickyMetrics.spec.ts +105 -0
  517. package/src/sticky-header/calculateStickyMetrics.ts +50 -0
  518. package/src/sticky-header/index.ts +18 -0
  519. package/src/sticky-header/types.ts +68 -0
  520. package/src/types.ts +341 -0
  521. package/src/utils/CSSMatrix.ts +321 -0
  522. package/src/utils/css.ts +65 -0
  523. package/src/utils/dialogUtils.ts +43 -0
  524. package/src/utils/math.ts +18 -0
  525. package/src/utils/polyfills/createDialogPolyfill.ts +18 -0
  526. package/src/utils/typedActions.ts +103 -0
  527. package/src/vite-env.d.ts +6 -0
  528. package/src/window/index.ts +69 -0
  529. package/dist/GridLayout-BQQ63eA1.cjs +0 -2
  530. package/dist/GridLayout-BQQ63eA1.cjs.map +0 -1
  531. package/dist/GridLayout-CJTKq7Mp.js +0 -1465
  532. package/dist/GridLayout-CJTKq7Mp.js.map +0 -1
  533. package/dist/sticky-header/StickyHeader.d.ts +0 -53
  534. package/dist/styles-CA2_zLZt.js +0 -52
  535. package/dist/styles-CA2_zLZt.js.map +0 -1
  536. package/dist/styles-PsqGOEJP.cjs +0 -2
  537. package/dist/styles-PsqGOEJP.cjs.map +0 -1
  538. package/dist/usePivot-7ctin_P_.cjs +0 -2
  539. package/dist/usePivot-7ctin_P_.cjs.map +0 -1
  540. package/dist/usePivot-CgQxB8rc.js +0 -124
  541. package/dist/usePivot-CgQxB8rc.js.map +0 -1
@@ -0,0 +1,1946 @@
1
+ import { jsx as m, jsxs as N, Fragment as et } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { e as M, t as Dt, G as ot } from "./GridLayout-UWNxXw77.js";
4
+ import { u as J } from "./useDocumentPointerEvents-DXxw3qWj.js";
5
+ import { a as kt, R as st } from "./ResizeHandle-CXjc1meV.js";
6
+ import { J as At, K as Mt, L as Ot, M as _t, N as Bt, O as $t, T as Nt, Q as Ht, U as Lt, V as zt, W as Xt, X as Yt, Y as Ft, Z as jt } from "./styles-NkjuMOVS.js";
7
+ import { u as nt } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
8
+ import { createPortal as Kt } from "react-dom";
9
+ import { u as Wt } from "./useContentCache-CO3LYNmz.js";
10
+ const dt = l.createContext(null), Ut = () => {
11
+ const t = l.useContext(dt);
12
+ if (!t)
13
+ throw new Error("useKeybindings must be used within KeybindingsProvider");
14
+ return t;
15
+ }, Vt = (t) => {
16
+ const e = [];
17
+ t.metaKey && e.push("Mod"), t.ctrlKey && e.push("Ctrl"), t.altKey && e.push("Alt"), t.shiftKey && e.push("Shift");
18
+ const n = t.key.length === 1 ? t.key.toUpperCase() : t.key;
19
+ return e.push(n), e.join("-");
20
+ }, qt = ({ children: t, configure: e }) => {
21
+ const n = l.useRef({}), r = l.useCallback((a, i) => {
22
+ n.current = { ...n.current, [a]: i };
23
+ }, []), o = l.useCallback((a) => {
24
+ const i = { ...n.current };
25
+ delete i[a], n.current = i;
26
+ }, []);
27
+ l.useEffect(() => {
28
+ const a = (i) => {
29
+ const c = Vt(i), u = n.current[c];
30
+ u && u(i);
31
+ };
32
+ return window.addEventListener("keydown", a), () => {
33
+ window.removeEventListener("keydown", a);
34
+ };
35
+ }, []);
36
+ const s = l.useMemo(() => ({ register: r, unregister: o }), [r, o]);
37
+ return l.useEffect(() => {
38
+ e && e(s);
39
+ }, [s, e]), /* @__PURE__ */ m(dt.Provider, { value: s, children: t });
40
+ }, Zt = (t, e) => {
41
+ t.register("Mod-\\", (n) => {
42
+ n.preventDefault(), e.splitFocused("vertical");
43
+ }), t.register("Mod-Shift-\\", (n) => {
44
+ n.preventDefault(), e.splitFocused("horizontal");
45
+ });
46
+ for (const n of [1, 2, 3, 4, 5, 6, 7, 8, 9])
47
+ t.register(`Mod-${String(n)}`, (r) => {
48
+ r.preventDefault(), e.focusGroupIndex(n);
49
+ });
50
+ t.register("Alt-ArrowRight", (n) => {
51
+ n.preventDefault(), e.focusNextGroup();
52
+ }), t.register("Alt-ArrowLeft", (n) => {
53
+ n.preventDefault(), e.focusPrevGroup();
54
+ });
55
+ }, Jt = (t) => t.type === "group", pt = (t, e = { x: 0, y: 0, w: 100, h: 100 }) => {
56
+ const n = /* @__PURE__ */ new Map(), r = (o, s) => {
57
+ if (Jt(o)) {
58
+ n.set(o.groupId, s);
59
+ return;
60
+ }
61
+ if (o.direction === "vertical") {
62
+ const c = s.w * o.ratio, u = s.w - c;
63
+ r(o.a, { x: s.x, y: s.y, w: c, h: s.h }), r(o.b, { x: s.x + c, y: s.y, w: u, h: s.h });
64
+ return;
65
+ }
66
+ const a = s.h * o.ratio, i = s.h - a;
67
+ r(o.a, { x: s.x, y: s.y, w: s.w, h: a }), r(o.b, { x: s.x, y: s.y + a, w: s.w, h: i });
68
+ };
69
+ return r(t, e), n;
70
+ }, Qt = (t, e) => {
71
+ const n = pt(t.tree), r = {
72
+ areas: [["root"]],
73
+ rows: [{ size: "1fr" }],
74
+ columns: [{ size: "1fr" }],
75
+ gap: "0px",
76
+ style: { position: "relative" }
77
+ }, o = Array.from(n.entries()).map(([s, a]) => {
78
+ const i = {
79
+ position: "absolute",
80
+ left: `${a.x}%`,
81
+ top: `${a.y}%`,
82
+ width: `${a.w}%`,
83
+ height: `${a.h}%`,
84
+ overflow: "hidden",
85
+ display: "flex",
86
+ flexDirection: "column"
87
+ };
88
+ return {
89
+ id: s,
90
+ positionMode: "absolute",
91
+ style: i,
92
+ component: e(s)
93
+ };
94
+ });
95
+ return { config: r, layers: o };
96
+ }, te = (t, e, n) => {
97
+ const r = pt(t.tree), o = Array.from(new Set(Array.from(r.values()).flatMap((h) => [h.x, h.x + h.w]))).sort((h, v) => h - v), s = Array.from(new Set(Array.from(r.values()).flatMap((h) => [h.y, h.y + h.h]))).sort((h, v) => h - v), a = o.slice(1).map((h, v) => `${h - o[v]}fr`), i = s.slice(1).map((h, v) => `${h - s[v]}fr`), c = a.map((h) => ({ size: h, resizable: n })), u = i.map((h) => ({ size: h, resizable: n })), d = (h, v, w, T) => {
98
+ for (const [f, I] of r.entries())
99
+ if (h >= I.x && v <= I.x + I.w && w >= I.y && T <= I.y + I.h)
100
+ return f;
101
+ return ".";
102
+ }, b = [];
103
+ for (let h = 0; h < s.length - 1; h += 1) {
104
+ const v = [];
105
+ for (let w = 0; w < o.length - 1; w += 1)
106
+ v.push(d(o[w], o[w + 1], s[h], s[h + 1]));
107
+ b.push(v);
108
+ }
109
+ const g = {
110
+ areas: b,
111
+ rows: u,
112
+ columns: c,
113
+ gap: "0px"
114
+ }, y = Array.from(r.keys()).map((h) => ({
115
+ id: h,
116
+ gridArea: h,
117
+ component: e(h)
118
+ }));
119
+ return { config: g, layers: y };
120
+ }, ft = l.createContext(null), ee = () => {
121
+ const t = l.useContext(ft);
122
+ if (!t)
123
+ throw new Error("usePanelRenderContext must be used within PanelRenderProvider");
124
+ return t;
125
+ }, ne = ({ value: t, children: e }) => /* @__PURE__ */ m(ft.Provider, { value: t, children: e }), bt = l.createContext(null), ht = () => {
126
+ const t = l.useContext(bt);
127
+ if (!t)
128
+ throw new Error("useDomRegistry must be used within DomRegistryProvider");
129
+ return t;
130
+ }, re = ({ children: t }) => {
131
+ const e = l.useRef(/* @__PURE__ */ new Map()), n = l.useCallback((c) => {
132
+ const u = e.current.get(c);
133
+ if (u)
134
+ return u;
135
+ const d = { group: null, tabbar: null, content: null };
136
+ return e.current.set(c, d), d;
137
+ }, []), r = l.useCallback(
138
+ (c, u) => {
139
+ const d = n(c);
140
+ if (d.group = u, u === null) {
141
+ const b = e.current.get(c);
142
+ (b ? b.tabbar === null && b.content === null : !1) && e.current.delete(c);
143
+ }
144
+ },
145
+ [n]
146
+ ), o = l.useCallback(
147
+ (c, u) => {
148
+ const d = n(c);
149
+ if (d.tabbar = u, u === null) {
150
+ const b = e.current.get(c);
151
+ (b ? b.group === null && b.content === null : !1) && e.current.delete(c);
152
+ }
153
+ },
154
+ [n]
155
+ ), s = l.useCallback(
156
+ (c, u) => {
157
+ const d = n(c);
158
+ if (d.content = u, u === null) {
159
+ const b = e.current.get(c);
160
+ (b ? b.group === null && b.tabbar === null : !1) && e.current.delete(c);
161
+ }
162
+ },
163
+ [n]
164
+ ), a = l.useCallback(() => e.current, []), i = l.useMemo(() => ({ setGroupEl: r, setTabbarEl: o, setContentEl: s, getAll: a }), [r, o, s, a]);
165
+ return /* @__PURE__ */ m(bt.Provider, { value: i, children: t });
166
+ }, oe = {
167
+ display: "flex",
168
+ flexDirection: "column",
169
+ width: "100%",
170
+ height: "100%"
171
+ }, se = {
172
+ flex: "1 1 auto",
173
+ minWidth: 0,
174
+ minHeight: 0,
175
+ position: "relative",
176
+ overflow: "hidden"
177
+ };
178
+ function ie(t, e, n, r) {
179
+ return t ? l.cloneElement(t, n, r) : e ? /* @__PURE__ */ m(e, { ...n, children: r }) : /* @__PURE__ */ m("div", { ...n, children: r });
180
+ }
181
+ function ae(t, e, n, r) {
182
+ return t ? l.cloneElement(t, n, r) : e ? /* @__PURE__ */ m(e, { ...n, children: r }) : /* @__PURE__ */ m("div", { ...n, children: r });
183
+ }
184
+ const ce = ({
185
+ group: t,
186
+ tabbar: e,
187
+ content: n,
188
+ onContentPointerDown: r,
189
+ groupRef: o,
190
+ contentRef: s,
191
+ component: a,
192
+ element: i,
193
+ contentComponent: c,
194
+ contentElement: u
195
+ }) => {
196
+ const d = {
197
+ ref: o,
198
+ style: oe,
199
+ "data-group-id": t.id
200
+ }, g = ie(u, c, {
201
+ ref: s,
202
+ style: se,
203
+ "data-dnd-zone": "content",
204
+ onPointerDown: r
205
+ }, n);
206
+ return ae(i, a, d, /* @__PURE__ */ N(et, { children: [
207
+ e,
208
+ g
209
+ ] }));
210
+ }, gt = l.memo(ce, (t, e) => t.group.id !== e.group.id || t.group.activeTabId !== e.group.activeTabId || t.group.tabs.length !== e.group.tabs.length ? !1 : t.group.tabs === e.group.tabs);
211
+ gt.displayName = "PanelGroupView";
212
+ const K = (t, e, n) => {
213
+ const r = t.left, o = t.top, s = t.width, a = t.height, i = e - r, c = n - o, u = s / 3, d = a / 3;
214
+ return i > u && i < s - u && c > d && c < a - d ? "center" : i < c && i < s - i && c < a - c ? "left" : s - i < c && s - i < i && c < a - c ? "right" : c < i && c < a - c && i < s - i ? "top" : "bottom";
215
+ };
216
+ function k(t, e) {
217
+ if (!e) {
218
+ const r = (() => ({ type: t }));
219
+ return Object.defineProperty(r, "type", {
220
+ value: t,
221
+ writable: !1,
222
+ enumerable: !0
223
+ }), r;
224
+ }
225
+ const n = ((...r) => {
226
+ const o = e(...r);
227
+ return typeof o > "u" ? { type: t } : { type: t, payload: o };
228
+ });
229
+ return Object.defineProperty(n, "type", {
230
+ value: t,
231
+ writable: !1,
232
+ enumerable: !0
233
+ }), n;
234
+ }
235
+ const ue = (t, e) => {
236
+ const n = {};
237
+ return Object.keys(t).forEach((r) => {
238
+ const o = t[r];
239
+ n[r] = ((...s) => {
240
+ const a = o(...s);
241
+ return e(a), a;
242
+ });
243
+ }), n;
244
+ }, mt = (t, e) => {
245
+ const n = {};
246
+ return Object.keys(e).forEach((r) => {
247
+ const o = e[r];
248
+ if (!o)
249
+ return;
250
+ const s = t[r];
251
+ if (!s)
252
+ throw new Error(`Missing action creator for key "${String(r)}"`);
253
+ n[s.type] = o;
254
+ }), n;
255
+ }, vt = { phase: { kind: "idle" }, suggest: null, pointer: null, tabbarHover: null, draggingTabElement: null }, D = {
256
+ startContent: k(
257
+ "START_CONTENT",
258
+ (t) => t
259
+ ),
260
+ startTab: k(
261
+ "START_TAB",
262
+ (t) => t
263
+ ),
264
+ setSuggest: k("SET_SUGGEST", (t) => t),
265
+ setPointer: k("SET_POINTER", (t) => t),
266
+ setTabbarHover: k(
267
+ "SET_TABBAR_HOVER",
268
+ (t) => t
269
+ ),
270
+ reset: k("RESET")
271
+ }, le = mt(D, {
272
+ startContent: (t, e) => ({
273
+ phase: {
274
+ kind: "content",
275
+ startX: e.payload.x,
276
+ startY: e.payload.y,
277
+ fromGroupId: e.payload.groupId,
278
+ tabId: e.payload.tabId,
279
+ cache: e.payload.cache
280
+ },
281
+ suggest: null,
282
+ pointer: null,
283
+ tabbarHover: null,
284
+ draggingTabElement: null
285
+ }),
286
+ startTab: (t, e) => ({
287
+ phase: {
288
+ kind: "tab",
289
+ startX: e.payload.x,
290
+ startY: e.payload.y,
291
+ fromGroupId: e.payload.groupId,
292
+ tabId: e.payload.tabId,
293
+ cache: e.payload.cache
294
+ },
295
+ suggest: null,
296
+ pointer: null,
297
+ tabbarHover: null,
298
+ draggingTabElement: e.payload.element
299
+ }),
300
+ setSuggest: (t, e) => ({ ...t, suggest: e.payload }),
301
+ setPointer: (t, e) => ({ ...t, pointer: e.payload }),
302
+ setTabbarHover: (t, e) => ({ ...t, tabbarHover: e.payload }),
303
+ reset: () => vt
304
+ }), de = (t, e) => {
305
+ const n = le[e.type];
306
+ return n ? n(t, e, void 0) : t;
307
+ }, wt = l.createContext(null), V = () => {
308
+ const t = l.useContext(wt);
309
+ if (!t)
310
+ throw new Error("usePanelInteractions must be used within InteractionsProvider");
311
+ return t;
312
+ }, pe = ({
313
+ containerRef: t,
314
+ dragThresholdPx: e,
315
+ onCommitContentDrop: n,
316
+ onCommitTabDrop: r,
317
+ isContentZoneAllowed: o,
318
+ children: s
319
+ }) => {
320
+ const [a, i] = l.useReducer(de, vt), c = ht(), u = l.useCallback(() => {
321
+ const w = Array.from(c.getAll().entries()), T = w.map(([p, G]) => ({ gid: p, el: G.content ?? G.group })).filter((p) => !!p.el).map((p) => ({ ...p, rect: p.el.getBoundingClientRect() })), f = w.map(([p, G]) => ({ gid: p, el: G.tabbar })).filter((p) => !!p.el).map((p) => ({ ...p, rect: p.el.getBoundingClientRect() })), I = w.map(([p, G]) => ({ gid: p, el: G.content ?? G.group })).filter((p) => !!p.el).map((p) => ({ ...p, rect: p.el.getBoundingClientRect() }));
322
+ return { groups: T, tabbars: f, contents: I };
323
+ }, [c]), d = J((w) => {
324
+ if (!t.current)
325
+ return;
326
+ const f = w.clientX, I = w.clientY, p = a.phase;
327
+ if (p.kind === "idle")
328
+ return;
329
+ const G = Math.abs(f - p.startX), C = Math.abs(I - p.startY);
330
+ if (G < e && C < e) {
331
+ a.phase.kind === "content" && i(D.setSuggest(null)), i(D.setPointer(null)), i(D.setTabbarHover(null));
332
+ return;
333
+ }
334
+ if (i(D.setPointer({ x: f, y: I })), p.kind === "content") {
335
+ const S = p.cache.groups.find(({ rect: x }) => f >= x.left && f <= x.right && I >= x.top && I <= x.bottom);
336
+ if (!S) {
337
+ i(D.setSuggest(null));
338
+ return;
339
+ }
340
+ const P = K(S.rect, f, I);
341
+ if (o && !o({ targetGroupId: S.gid, zone: P })) {
342
+ i(D.setSuggest(null));
343
+ return;
344
+ }
345
+ i(D.setSuggest({ rect: S.rect, zone: P }));
346
+ return;
347
+ }
348
+ if (p.kind === "tab") {
349
+ const S = p.cache.tabbars.find(({ rect: E }) => f >= E.left && f <= E.right && I >= E.top && I <= E.bottom);
350
+ if (S) {
351
+ const A = Array.from(S.el.querySelectorAll("[role='tab']")).map((L) => L.getBoundingClientRect()), R = A.map((L) => L.left + L.width / 2), _ = R.findIndex((L) => f < L), B = _ === -1 ? R.length : _, Rt = A.length === 0 ? S.rect.left + 8 : B === 0 ? A[0].left : B === A.length ? A[A.length - 1].right : (A[B - 1].right + A[B].left) / 2;
352
+ i(D.setTabbarHover({ groupId: S.gid, index: B, rect: S.rect, insertX: Rt }));
353
+ } else
354
+ i(D.setTabbarHover(null));
355
+ const P = p.cache.contents.find(({ rect: E }) => f >= E.left && f <= E.right && I >= E.top && I <= E.bottom);
356
+ if (!P) {
357
+ i(D.setSuggest(null));
358
+ return;
359
+ }
360
+ const x = K(P.rect, f, I);
361
+ if (o && !o({ targetGroupId: P.gid, zone: x })) {
362
+ i(D.setSuggest(null));
363
+ return;
364
+ }
365
+ i(D.setSuggest({ rect: P.rect, zone: x }));
366
+ }
367
+ }), b = J((w) => {
368
+ const T = t.current, f = a;
369
+ if (i(D.reset()), !T)
370
+ return;
371
+ const I = w.clientX, p = w.clientY;
372
+ if (f.phase.kind === "idle")
373
+ return;
374
+ const G = Math.abs(I - f.phase.startX), C = Math.abs(p - f.phase.startY);
375
+ if (!(G < e && C < e)) {
376
+ if (f.phase.kind === "content") {
377
+ const S = f.phase.cache.groups.find(({ rect: E }) => I >= E.left && I <= E.right && p >= E.top && p <= E.bottom);
378
+ if (!S)
379
+ return;
380
+ const P = S.gid ?? null;
381
+ if (!P)
382
+ return;
383
+ const x = K(S.rect, I, p);
384
+ if (o && !o({ targetGroupId: P, zone: x }))
385
+ return;
386
+ n({ fromGroupId: f.phase.fromGroupId, tabId: f.phase.tabId, targetGroupId: P, zone: x });
387
+ return;
388
+ }
389
+ if (f.phase.kind === "tab") {
390
+ const S = f.phase.cache.tabbars.find(({ rect: x }) => I >= x.left && I <= x.right && p >= x.top && p <= x.bottom);
391
+ if (S) {
392
+ const x = S.gid;
393
+ if (!x)
394
+ return;
395
+ const A = Array.from(S.el.querySelectorAll("[role='tab']")).map((B) => {
396
+ const Z = B.getBoundingClientRect();
397
+ return Z.left + Z.width / 2;
398
+ }), R = A.findIndex((B) => I < B), _ = R === -1 ? A.length : R;
399
+ r({ fromGroupId: f.phase.fromGroupId, tabId: f.phase.tabId, targetGroupId: x, targetIndex: _ });
400
+ return;
401
+ }
402
+ const P = f.phase.cache.contents.find(({ rect: x }) => I >= x.left && I <= x.right && p >= x.top && p <= x.bottom);
403
+ if (P) {
404
+ const x = P.gid ?? null;
405
+ if (!x)
406
+ return;
407
+ const E = K(P.rect, I, p);
408
+ if (o && !o({ targetGroupId: x, zone: E }))
409
+ return;
410
+ n({ fromGroupId: f.phase.fromGroupId, tabId: f.phase.tabId, targetGroupId: x, zone: E });
411
+ }
412
+ }
413
+ }
414
+ }), g = J(() => {
415
+ i(D.reset());
416
+ });
417
+ l.useEffect(() => {
418
+ if (a.phase.kind !== "idle")
419
+ return window.addEventListener("pointermove", d), window.addEventListener("pointerup", b, { once: !0 }), window.addEventListener("pointercancel", g, { once: !0 }), () => {
420
+ window.removeEventListener("pointermove", d), window.removeEventListener("pointerup", b), window.removeEventListener("pointercancel", g);
421
+ };
422
+ }, [a.phase.kind]);
423
+ const y = l.useCallback((w, T, f) => {
424
+ if (f.button !== 0)
425
+ return;
426
+ f.currentTarget.setPointerCapture(f.pointerId);
427
+ const I = u();
428
+ i(D.startContent({ x: f.clientX, y: f.clientY, groupId: w, tabId: T, cache: I }));
429
+ }, [u]), h = l.useCallback((w, T, f) => {
430
+ if (f.button !== 0)
431
+ return;
432
+ const I = f.currentTarget;
433
+ I && I.setPointerCapture(f.pointerId);
434
+ const p = u();
435
+ i(D.startTab({ x: f.clientX, y: f.clientY, groupId: T, tabId: w, cache: p, element: I }));
436
+ }, [u]), v = l.useMemo(() => ({
437
+ suggest: a.suggest,
438
+ isTabDragging: a.phase.kind === "tab",
439
+ draggingTabId: a.phase.kind === "tab" ? a.phase.tabId : null,
440
+ dragPointer: a.pointer,
441
+ tabbarHover: a.tabbarHover,
442
+ draggingTabElement: a.draggingTabElement,
443
+ onStartContentDrag: y,
444
+ onStartTabDrag: h
445
+ }), [a.suggest, a.pointer, a.tabbarHover, a.phase, a.draggingTabElement, y, h]);
446
+ return /* @__PURE__ */ m(wt.Provider, { value: v, children: s });
447
+ }, it = {
448
+ display: "inline-flex",
449
+ alignItems: "center",
450
+ userSelect: "none"
451
+ }, fe = ({
452
+ groupId: t,
453
+ tab: e,
454
+ active: n,
455
+ dragging: r,
456
+ onClickTab: o,
457
+ onStartDrag: s,
458
+ onCloseTab: a,
459
+ tabComponent: i,
460
+ tabElement: c,
461
+ onDoubleClick: u
462
+ }) => {
463
+ const d = l.useEffectEvent(() => {
464
+ o(e.id);
465
+ }), b = l.useEffectEvent((v) => {
466
+ s && v.button === 0 && s(e.id, t, v);
467
+ }), g = () => {
468
+ const v = !!a;
469
+ return /* @__PURE__ */ m(l.Activity, { mode: v ? "visible" : "hidden", children: /* @__PURE__ */ m(
470
+ "button",
471
+ {
472
+ type: "button",
473
+ "aria-label": `Close tab ${e.title}`,
474
+ onClick: (w) => {
475
+ a && (w.stopPropagation(), a(t, e.id));
476
+ },
477
+ style: { marginLeft: 6 },
478
+ tabIndex: v ? void 0 : -1,
479
+ disabled: !v,
480
+ "aria-hidden": v ? void 0 : !0,
481
+ children: "×"
482
+ }
483
+ ) });
484
+ }, y = {
485
+ role: "tab",
486
+ "aria-selected": n,
487
+ tabIndex: n ? 0 : -1,
488
+ style: it,
489
+ onClick: d,
490
+ onPointerDown: b,
491
+ onDoubleClick: u,
492
+ "data-tab-id": e.id,
493
+ "data-active": n ? "true" : "false",
494
+ "data-dragging": r ? "true" : "false",
495
+ children: /* @__PURE__ */ N(et, { children: [
496
+ /* @__PURE__ */ m("span", { children: e.title }),
497
+ g()
498
+ ] })
499
+ }, h = {
500
+ type: "button",
501
+ role: "tab",
502
+ "aria-selected": n,
503
+ tabIndex: n ? 0 : -1,
504
+ style: it,
505
+ onClick: () => {
506
+ o(e.id);
507
+ },
508
+ onPointerDown: (v) => {
509
+ s && v.button === 0 && s(e.id, t, v);
510
+ },
511
+ onDoubleClick: u,
512
+ children: /* @__PURE__ */ m("span", { children: e.title })
513
+ };
514
+ return c ? c(h) : i ? /* @__PURE__ */ m(i, { ...h }) : /* @__PURE__ */ m("div", { ...y });
515
+ }, be = {
516
+ display: "flex",
517
+ alignItems: "center"
518
+ }, he = {
519
+ flex: "1 1 auto",
520
+ alignSelf: "stretch"
521
+ }, ge = ({
522
+ group: t,
523
+ onClickTab: e,
524
+ onStartDrag: n,
525
+ rootRef: r,
526
+ component: o,
527
+ element: s,
528
+ tabComponent: a,
529
+ tabElement: i,
530
+ onAddTab: c,
531
+ onCloseTab: u,
532
+ doubleClickToAdd: d
533
+ }) => {
534
+ const { isTabDragging: b, draggingTabId: g } = V(), y = l.useRef(null), h = l.useCallback(
535
+ (p) => {
536
+ if (y.current = p, !!r) {
537
+ if (typeof r == "function") {
538
+ r(p);
539
+ return;
540
+ }
541
+ try {
542
+ r.current = p;
543
+ } catch {
544
+ }
545
+ }
546
+ },
547
+ [r]
548
+ ), v = l.useEffectEvent((p) => {
549
+ const G = y.current ?? p.currentTarget;
550
+ if (!G)
551
+ return;
552
+ const C = Array.from(G.querySelectorAll('[role="tab"]'));
553
+ if (C.length === 0)
554
+ return;
555
+ const S = (R) => {
556
+ const _ = Math.max(0, Math.min(R, C.length - 1)), B = C[_];
557
+ B && B.focus();
558
+ }, P = document.activeElement, x = P ? C.indexOf(P) : C.findIndex((R) => R.getAttribute("data-tab-id") === t.activeTabId);
559
+ if (p.key === "ArrowRight") {
560
+ p.preventDefault();
561
+ const R = x >= 0 ? x + 1 : 0;
562
+ S(R >= C.length ? 0 : R);
563
+ return;
564
+ }
565
+ if (p.key === "ArrowLeft") {
566
+ p.preventDefault();
567
+ const R = x >= 0 ? x - 1 : C.length - 1;
568
+ S(R < 0 ? C.length - 1 : R);
569
+ return;
570
+ }
571
+ if (p.key === "Home") {
572
+ p.preventDefault(), S(0);
573
+ return;
574
+ }
575
+ if (p.key === "End") {
576
+ p.preventDefault(), S(C.length - 1);
577
+ return;
578
+ }
579
+ if (p.key === "Enter" || p.key === " ") {
580
+ p.preventDefault();
581
+ const _ = (x >= 0 ? C[x] : null)?.getAttribute("data-tab-id") ?? null;
582
+ _ && e(_);
583
+ return;
584
+ }
585
+ if (p.key === "Delete" || p.key === "Backspace") {
586
+ if (u) {
587
+ p.preventDefault();
588
+ const _ = (x >= 0 ? C[x] : null)?.getAttribute("data-tab-id") ?? null;
589
+ _ && u(t.id, _);
590
+ }
591
+ return;
592
+ }
593
+ const E = (p.ctrlKey ? 1 : 0) + (p.metaKey ? 1 : 0) > 0, A = typeof p.key == "string" ? p.key.toLowerCase() : "";
594
+ if (E && A === "t") {
595
+ c && (p.preventDefault(), c(t.id));
596
+ return;
597
+ }
598
+ });
599
+ l.useEffect(() => {
600
+ const p = y.current;
601
+ if (!p)
602
+ return;
603
+ const G = p.querySelector(`[role="tab"][data-tab-id="${t.activeTabId}"]`);
604
+ if (G === document.activeElement)
605
+ return;
606
+ !p.contains(document.activeElement) && G && G.focus();
607
+ }, [t.activeTabId]);
608
+ const w = {
609
+ style: be,
610
+ role: "tablist",
611
+ "data-tabbar": "true",
612
+ "data-group-id": t.id,
613
+ "data-dragging": b ? "true" : "false",
614
+ onKeyDown: v
615
+ }, T = kt({
616
+ element: s,
617
+ component: o
618
+ }), f = () => c ? /* @__PURE__ */ m(
619
+ "button",
620
+ {
621
+ type: "button",
622
+ "aria-label": "Add tab",
623
+ onClick: () => {
624
+ c(t.id);
625
+ },
626
+ children: "+"
627
+ }
628
+ ) : null, I = l.useCallback(() => {
629
+ d && c && c(t.id);
630
+ }, [d, c, t.id]);
631
+ return /* @__PURE__ */ N(T, { ...w, ref: h, onDoubleClick: I, children: [
632
+ t.tabs.map((p, G) => /* @__PURE__ */ m(
633
+ fe,
634
+ {
635
+ groupId: t.id,
636
+ tab: p,
637
+ active: t.activeTabId === p.id,
638
+ dragging: g === p.id,
639
+ onClickTab: e,
640
+ onStartDrag: n,
641
+ onCloseTab: u,
642
+ tabComponent: a,
643
+ tabElement: i,
644
+ onDoubleClick: (C) => C.stopPropagation()
645
+ },
646
+ `${t.id}:${p.id}:${G}`
647
+ )),
648
+ /* @__PURE__ */ m("span", { style: he }),
649
+ f()
650
+ ] });
651
+ }, me = ({ id: t, TabBarComponent: e, PanelGroupComponent: n }) => {
652
+ const { getGroup: r, getGroupContent: o, onClickTab: s, onAddTab: a, onCloseTab: i, onStartTabDrag: c, doubleClickToAdd: u, registerContentContainer: d } = ee(), { setGroupEl: b, setTabbarEl: g, setContentEl: y } = ht(), h = l.useCallback(
653
+ (G) => {
654
+ b(t, G);
655
+ },
656
+ [t, b]
657
+ ), v = l.useCallback(
658
+ (G) => {
659
+ y(t, G), d(t, G);
660
+ },
661
+ [t, y, d]
662
+ ), w = l.useCallback(
663
+ (G) => {
664
+ g(t, G);
665
+ },
666
+ [t, g]
667
+ ), T = r(t);
668
+ if (!T)
669
+ return null;
670
+ const f = o(t);
671
+ return /* @__PURE__ */ m(
672
+ n ?? ((G) => /* @__PURE__ */ m(gt, { ...G })),
673
+ {
674
+ group: T,
675
+ tabbar: /* @__PURE__ */ m(
676
+ e ?? ge,
677
+ {
678
+ rootRef: w,
679
+ group: T,
680
+ onClickTab: (G) => s(t, G),
681
+ onAddTab: a,
682
+ onCloseTab: i,
683
+ onStartDrag: (G, C, S) => c(G, C, S),
684
+ doubleClickToAdd: u
685
+ }
686
+ ),
687
+ content: f,
688
+ groupRef: h,
689
+ contentRef: v
690
+ }
691
+ );
692
+ }, ve = (t, e) => {
693
+ const n = new Array(16);
694
+ for (let r = 0; r < 4; r++)
695
+ for (let o = 0; o < 4; o++)
696
+ n[r * 4 + o] = t[0 + o] * e[r * 4 + 0] + t[4 + o] * e[r * 4 + 1] + t[8 + o] * e[r * 4 + 2] + t[12 + o] * e[r * 4 + 3];
697
+ return n;
698
+ }, W = (t) => {
699
+ if (t.length !== 16)
700
+ throw new Error("Matrix must have exactly 16 values");
701
+ const e = Object.freeze([...t]), n = (r) => {
702
+ const o = ve(e, r);
703
+ return W(o);
704
+ };
705
+ return Object.freeze({
706
+ translate: (r = 0, o = 0, s = 0) => n([
707
+ 1,
708
+ 0,
709
+ 0,
710
+ 0,
711
+ 0,
712
+ 1,
713
+ 0,
714
+ 0,
715
+ 0,
716
+ 0,
717
+ 1,
718
+ 0,
719
+ r,
720
+ o,
721
+ s,
722
+ 1
723
+ ]),
724
+ translate3d: (r, o, s) => n([
725
+ 1,
726
+ 0,
727
+ 0,
728
+ 0,
729
+ 0,
730
+ 1,
731
+ 0,
732
+ 0,
733
+ 0,
734
+ 0,
735
+ 1,
736
+ 0,
737
+ r,
738
+ o,
739
+ s,
740
+ 1
741
+ ]),
742
+ translateX: (r) => n([
743
+ 1,
744
+ 0,
745
+ 0,
746
+ 0,
747
+ 0,
748
+ 1,
749
+ 0,
750
+ 0,
751
+ 0,
752
+ 0,
753
+ 1,
754
+ 0,
755
+ r,
756
+ 0,
757
+ 0,
758
+ 1
759
+ ]),
760
+ translateY: (r) => n([
761
+ 1,
762
+ 0,
763
+ 0,
764
+ 0,
765
+ 0,
766
+ 1,
767
+ 0,
768
+ 0,
769
+ 0,
770
+ 0,
771
+ 1,
772
+ 0,
773
+ 0,
774
+ r,
775
+ 0,
776
+ 1
777
+ ]),
778
+ translateZ: (r) => n([
779
+ 1,
780
+ 0,
781
+ 0,
782
+ 0,
783
+ 0,
784
+ 1,
785
+ 0,
786
+ 0,
787
+ 0,
788
+ 0,
789
+ 1,
790
+ 0,
791
+ 0,
792
+ 0,
793
+ r,
794
+ 1
795
+ ]),
796
+ scale: (r = 1, o = 1, s = 1) => n([
797
+ r,
798
+ 0,
799
+ 0,
800
+ 0,
801
+ 0,
802
+ o,
803
+ 0,
804
+ 0,
805
+ 0,
806
+ 0,
807
+ s,
808
+ 0,
809
+ 0,
810
+ 0,
811
+ 0,
812
+ 1
813
+ ]),
814
+ scale3d: (r, o, s) => n([
815
+ r,
816
+ 0,
817
+ 0,
818
+ 0,
819
+ 0,
820
+ o,
821
+ 0,
822
+ 0,
823
+ 0,
824
+ 0,
825
+ s,
826
+ 0,
827
+ 0,
828
+ 0,
829
+ 0,
830
+ 1
831
+ ]),
832
+ scaleX: (r) => n([
833
+ r,
834
+ 0,
835
+ 0,
836
+ 0,
837
+ 0,
838
+ 1,
839
+ 0,
840
+ 0,
841
+ 0,
842
+ 0,
843
+ 1,
844
+ 0,
845
+ 0,
846
+ 0,
847
+ 0,
848
+ 1
849
+ ]),
850
+ scaleY: (r) => n([
851
+ 1,
852
+ 0,
853
+ 0,
854
+ 0,
855
+ 0,
856
+ r,
857
+ 0,
858
+ 0,
859
+ 0,
860
+ 0,
861
+ 1,
862
+ 0,
863
+ 0,
864
+ 0,
865
+ 0,
866
+ 1
867
+ ]),
868
+ scaleZ: (r) => n([
869
+ 1,
870
+ 0,
871
+ 0,
872
+ 0,
873
+ 0,
874
+ 1,
875
+ 0,
876
+ 0,
877
+ 0,
878
+ 0,
879
+ r,
880
+ 0,
881
+ 0,
882
+ 0,
883
+ 0,
884
+ 1
885
+ ]),
886
+ rotateX: (r) => {
887
+ const o = Math.cos(r), s = Math.sin(r);
888
+ return n([
889
+ 1,
890
+ 0,
891
+ 0,
892
+ 0,
893
+ 0,
894
+ o,
895
+ s,
896
+ 0,
897
+ 0,
898
+ -s,
899
+ o,
900
+ 0,
901
+ 0,
902
+ 0,
903
+ 0,
904
+ 1
905
+ ]);
906
+ },
907
+ rotateY: (r) => {
908
+ const o = Math.cos(r), s = Math.sin(r);
909
+ return n([
910
+ o,
911
+ 0,
912
+ -s,
913
+ 0,
914
+ 0,
915
+ 1,
916
+ 0,
917
+ 0,
918
+ s,
919
+ 0,
920
+ o,
921
+ 0,
922
+ 0,
923
+ 0,
924
+ 0,
925
+ 1
926
+ ]);
927
+ },
928
+ rotateZ: (r) => {
929
+ const o = Math.cos(r), s = Math.sin(r);
930
+ return n([
931
+ o,
932
+ s,
933
+ 0,
934
+ 0,
935
+ -s,
936
+ o,
937
+ 0,
938
+ 0,
939
+ 0,
940
+ 0,
941
+ 1,
942
+ 0,
943
+ 0,
944
+ 0,
945
+ 0,
946
+ 1
947
+ ]);
948
+ },
949
+ rotate: (r, o, s, a) => {
950
+ const i = Math.sqrt(o * o + s * s + a * a);
951
+ if (i === 0)
952
+ return W(e);
953
+ o /= i, s /= i, a /= i;
954
+ const c = Math.cos(r), u = Math.sin(r), d = 1 - c;
955
+ return n([
956
+ d * o * o + c,
957
+ d * o * s + u * a,
958
+ d * o * a - u * s,
959
+ 0,
960
+ d * o * s - u * a,
961
+ d * s * s + c,
962
+ d * s * a + u * o,
963
+ 0,
964
+ d * o * a + u * s,
965
+ d * s * a - u * o,
966
+ d * a * a + c,
967
+ 0,
968
+ 0,
969
+ 0,
970
+ 0,
971
+ 1
972
+ ]);
973
+ },
974
+ rotate3d: (r, o, s, a) => {
975
+ const i = Math.sqrt(r * r + o * o + s * s);
976
+ if (i === 0)
977
+ return W(e);
978
+ r /= i, o /= i, s /= i;
979
+ const c = Math.cos(a), u = Math.sin(a), d = 1 - c;
980
+ return n([
981
+ d * r * r + c,
982
+ d * r * o + u * s,
983
+ d * r * s - u * o,
984
+ 0,
985
+ d * r * o - u * s,
986
+ d * o * o + c,
987
+ d * o * s + u * r,
988
+ 0,
989
+ d * r * s + u * o,
990
+ d * o * s - u * r,
991
+ d * s * s + c,
992
+ 0,
993
+ 0,
994
+ 0,
995
+ 0,
996
+ 1
997
+ ]);
998
+ },
999
+ skew: (r = 0, o = 0) => {
1000
+ const s = Math.tan(r), a = Math.tan(o);
1001
+ return n([
1002
+ 1,
1003
+ a,
1004
+ 0,
1005
+ 0,
1006
+ s,
1007
+ 1,
1008
+ 0,
1009
+ 0,
1010
+ 0,
1011
+ 0,
1012
+ 1,
1013
+ 0,
1014
+ 0,
1015
+ 0,
1016
+ 0,
1017
+ 1
1018
+ ]);
1019
+ },
1020
+ skewX: (r) => {
1021
+ const o = Math.tan(r);
1022
+ return n([
1023
+ 1,
1024
+ 0,
1025
+ 0,
1026
+ 0,
1027
+ o,
1028
+ 1,
1029
+ 0,
1030
+ 0,
1031
+ 0,
1032
+ 0,
1033
+ 1,
1034
+ 0,
1035
+ 0,
1036
+ 0,
1037
+ 0,
1038
+ 1
1039
+ ]);
1040
+ },
1041
+ skewY: (r) => {
1042
+ const o = Math.tan(r);
1043
+ return n([
1044
+ 1,
1045
+ o,
1046
+ 0,
1047
+ 0,
1048
+ 0,
1049
+ 1,
1050
+ 0,
1051
+ 0,
1052
+ 0,
1053
+ 0,
1054
+ 1,
1055
+ 0,
1056
+ 0,
1057
+ 0,
1058
+ 0,
1059
+ 1
1060
+ ]);
1061
+ },
1062
+ perspective: (r) => {
1063
+ if (r === 0)
1064
+ throw new Error("Perspective distance cannot be zero");
1065
+ return n([
1066
+ 1,
1067
+ 0,
1068
+ 0,
1069
+ 0,
1070
+ 0,
1071
+ 1,
1072
+ 0,
1073
+ 0,
1074
+ 0,
1075
+ 0,
1076
+ 1,
1077
+ -1 / r,
1078
+ 0,
1079
+ 0,
1080
+ 0,
1081
+ 1
1082
+ ]);
1083
+ },
1084
+ toCSS: () => `matrix3d(${e.join(", ")})`,
1085
+ toArray: () => e,
1086
+ toString: () => [
1087
+ `[${e[0]}, ${e[4]}, ${e[8]}, ${e[12]}]`,
1088
+ `[${e[1]}, ${e[5]}, ${e[9]}, ${e[13]}]`,
1089
+ `[${e[2]}, ${e[6]}, ${e[10]}, ${e[14]}]`,
1090
+ `[${e[3]}, ${e[7]}, ${e[11]}, ${e[15]}]`
1091
+ ].join(`
1092
+ `)
1093
+ });
1094
+ }, we = () => W([
1095
+ 1,
1096
+ 0,
1097
+ 0,
1098
+ 0,
1099
+ 0,
1100
+ 1,
1101
+ 0,
1102
+ 0,
1103
+ 0,
1104
+ 0,
1105
+ 1,
1106
+ 0,
1107
+ 0,
1108
+ 0,
1109
+ 0,
1110
+ 1
1111
+ ]), Ie = {
1112
+ position: "fixed",
1113
+ inset: 0,
1114
+ pointerEvents: "none",
1115
+ zIndex: At
1116
+ }, ye = {
1117
+ position: "absolute",
1118
+ border: `${_t} dashed ${Bt}`,
1119
+ background: Ot,
1120
+ borderRadius: Mt,
1121
+ transformOrigin: "top left"
1122
+ }, $ = (t, e) => e <= 0 ? 0 : M(t / e, 0), Te = (t, e, n) => {
1123
+ const { width: r, height: o } = t, s = n / 2, a = r > 0 ? r : 1, i = o > 0 ? o : 1, c = {
1124
+ translateX: n,
1125
+ translateY: n,
1126
+ scaleX: $(M(r - n * 2, 0), a),
1127
+ scaleY: $(M(o - n * 2, 0), i)
1128
+ }, u = {
1129
+ translateX: n,
1130
+ translateY: n,
1131
+ scaleX: $(M(r / 2 - n * 1.5, 0), a),
1132
+ scaleY: $(M(o - n * 2, 0), i)
1133
+ }, d = {
1134
+ translateX: r / 2 + s,
1135
+ translateY: n,
1136
+ scaleX: $(M(r / 2 - n * 1.5, 0), a),
1137
+ scaleY: $(M(o - n * 2, 0), i)
1138
+ }, b = {
1139
+ translateX: n,
1140
+ translateY: n,
1141
+ scaleX: $(M(r - n * 2, 0), a),
1142
+ scaleY: $(M(o / 2 - n * 1.5, 0), i)
1143
+ }, g = {
1144
+ translateX: n,
1145
+ translateY: o / 2 + s,
1146
+ scaleX: $(M(r - n * 2, 0), a),
1147
+ scaleY: $(M(o / 2 - n * 1.5, 0), i)
1148
+ }, y = {
1149
+ center: c,
1150
+ left: u,
1151
+ right: d,
1152
+ top: b,
1153
+ bottom: g
1154
+ }, { translateX: h, translateY: v, scaleX: w, scaleY: T } = y[e];
1155
+ return we().translate(h, v, 0).scale(w, T, 1).toCSS();
1156
+ }, Ge = (t, e) => {
1157
+ const n = $t;
1158
+ return {
1159
+ ...ye,
1160
+ left: t.left,
1161
+ top: t.top,
1162
+ width: t.width,
1163
+ height: t.height,
1164
+ transform: Te(t, e, n)
1165
+ };
1166
+ }, xe = ({ suggest: t }) => {
1167
+ if (!t)
1168
+ return null;
1169
+ const { rect: e, zone: n } = t, r = Ge(e, n);
1170
+ return /* @__PURE__ */ m("div", { style: Ie, children: /* @__PURE__ */ m("div", { style: r }) });
1171
+ }, Se = typeof window < "u" && typeof document < "u", Ce = (t) => {
1172
+ const [e, n] = l.useState(null), [r, o] = l.useState(null);
1173
+ return nt(() => {
1174
+ if (!Se || !t) {
1175
+ n(null), o(null);
1176
+ return;
1177
+ }
1178
+ const s = t.getBoundingClientRect();
1179
+ n({ width: s.width, height: s.height }), o(t.outerHTML);
1180
+ }, [t]), { html: r, size: e };
1181
+ }, Ee = {
1182
+ position: "fixed",
1183
+ inset: 0,
1184
+ pointerEvents: "none",
1185
+ zIndex: Ft
1186
+ }, Pe = {
1187
+ position: "absolute",
1188
+ width: Yt,
1189
+ borderRadius: Xt,
1190
+ background: zt,
1191
+ boxShadow: Lt
1192
+ }, Re = () => {
1193
+ const { isTabDragging: t, draggingTabId: e, dragPointer: n, tabbarHover: r, draggingTabElement: o } = V(), { html: s, size: a } = Ce(o), i = n !== null && e !== null, c = l.useMemo(() => {
1194
+ if (!(!i || !n))
1195
+ return {
1196
+ position: "absolute",
1197
+ left: n.x,
1198
+ top: n.y,
1199
+ transform: `translate(${Nt}, ${Ht})`,
1200
+ pointerEvents: "none"
1201
+ };
1202
+ }, [i, n]), u = l.useMemo(() => {
1203
+ if (!(!c || !o))
1204
+ return a ? { ...c, width: a.width, height: a.height } : c;
1205
+ }, [c, o, a]), d = l.useMemo(() => {
1206
+ if (r)
1207
+ return {
1208
+ ...Pe,
1209
+ left: r.insertX,
1210
+ top: r.rect.top + 4,
1211
+ height: Math.max(0, r.rect.height - 8)
1212
+ };
1213
+ }, [r]);
1214
+ return t ? /* @__PURE__ */ N("div", { style: Ee, children: [
1215
+ /* @__PURE__ */ m(l.Activity, { mode: u ? "visible" : "hidden", children: /* @__PURE__ */ m("div", { style: u, children: /* @__PURE__ */ m(
1216
+ "div",
1217
+ {
1218
+ style: { width: "100%", height: "100%", pointerEvents: "none" },
1219
+ dangerouslySetInnerHTML: { __html: s ?? "" }
1220
+ }
1221
+ ) }) }),
1222
+ /* @__PURE__ */ m(l.Activity, { mode: d ? "visible" : "hidden", children: /* @__PURE__ */ m("div", { style: d }) })
1223
+ ] }) : null;
1224
+ }, O = (t) => t.type === "group", z = (t, e = []) => {
1225
+ if (O(t))
1226
+ return [...e, t.groupId];
1227
+ const n = z(t.a, e);
1228
+ return z(t.b, n);
1229
+ }, q = (t, e) => e.reduce((n, r) => O(n) ? n : n[r], t), j = (t, e, n) => {
1230
+ if (e.length === 0)
1231
+ return n;
1232
+ const [r, ...o] = e;
1233
+ return O(t) ? t : r === "a" ? { ...t, a: j(t.a, o, n) } : { ...t, b: j(t.b, o, n) };
1234
+ }, U = (t, e, n = []) => {
1235
+ if (O(t))
1236
+ return t.groupId === e ? { splitPath: null, side: null } : null;
1237
+ if (O(t.a) && t.a.groupId === e)
1238
+ return { splitPath: n, side: "a" };
1239
+ if (O(t.b) && t.b.groupId === e)
1240
+ return { splitPath: n, side: "b" };
1241
+ const r = U(t.a, e, [...n, "a"]);
1242
+ return r || U(t.b, e, [...n, "b"]);
1243
+ }, It = (t, e, n, r) => {
1244
+ const o = r(), s = U(t, e), a = {
1245
+ type: "split",
1246
+ direction: n,
1247
+ ratio: 0.5,
1248
+ a: { type: "group", groupId: e },
1249
+ b: { type: "group", groupId: o }
1250
+ };
1251
+ if (!s || s.splitPath === null)
1252
+ return { tree: a, newGroupId: o };
1253
+ const i = s.splitPath, c = q(t, i);
1254
+ if (O(c))
1255
+ return { tree: a, newGroupId: o };
1256
+ const u = s.side === "a" ? { ...c, a } : { ...c, b: a };
1257
+ return { tree: j(t, i, u), newGroupId: o };
1258
+ }, De = (t, e) => {
1259
+ const n = U(t, e);
1260
+ if (!n || n.splitPath === null)
1261
+ return { tree: t, survivorGroupId: e };
1262
+ const r = n.splitPath, o = q(t, r);
1263
+ if (O(o))
1264
+ return { tree: t, survivorGroupId: e };
1265
+ const s = n.side === "a" ? o.b : o.a, a = j(t, r, s), i = O(s) ? s.groupId : z(s)[0] ?? null;
1266
+ return { tree: a, survivorGroupId: i };
1267
+ }, ke = (t, e, n) => {
1268
+ const r = q(t, e);
1269
+ if (O(r))
1270
+ return t;
1271
+ const o = { ...r, ratio: M(n, 0.05, 0.95) };
1272
+ return j(t, e, o);
1273
+ }, Q = (t) => {
1274
+ if (Object.keys(t.groups).filter((o) => t.groups[o].tabIds.length === 0).length === 0)
1275
+ return t;
1276
+ const r = (o, s) => {
1277
+ const a = o.groups[s];
1278
+ if (!a || a.tabs.length > 0 || Object.keys(o.groups).length <= 1)
1279
+ return o;
1280
+ const { tree: c, survivorGroupId: u } = De(o.tree, s), { [s]: d, ...b } = o.groups, g = z(c), y = o.focusedGroupId === s ? u ?? g[0] ?? null : o.focusedGroupId;
1281
+ return { ...o, tree: c, groups: b, groupOrder: g, focusedGroupId: y };
1282
+ };
1283
+ return t.groupOrder.reduce((o, s) => r(o, s), t);
1284
+ }, Ae = (t) => ({ id: t, tabIds: [], tabs: [], activeTabId: null }), at = (t, e, n, r) => {
1285
+ const o = { ...t.groups }, s = o[e];
1286
+ if (!s)
1287
+ throw new Error(`Group ${e} does not exist.`);
1288
+ const a = { ...t.panels, [n.id]: n }, i = [...s.tabIds, n.id], c = r ? n.id : s.activeTabId ?? n.id, u = i.map((b) => a[b]), d = { ...s, tabIds: i, tabs: u, activeTabId: c };
1289
+ return o[e] = d, { ...t, panels: a, groups: o };
1290
+ }, Me = (t, e, n) => {
1291
+ const r = { ...t.groups }, o = r[e];
1292
+ if (!o)
1293
+ throw new Error(`Group ${e} does not exist.`);
1294
+ const s = o.tabIds.filter((c) => c !== n), a = s.map((c) => t.panels[c]), i = o.activeTabId === n ? s[0] ?? null : o.activeTabId;
1295
+ return r[e] = { ...o, tabIds: s, tabs: a, activeTabId: i }, { ...t, groups: r };
1296
+ }, ct = (t, e, n, r, o) => {
1297
+ const s = t.groups[e], a = t.groups[n];
1298
+ if (!s || !a)
1299
+ throw new Error("moveTab: source or target group is missing.");
1300
+ const i = { ...t.groups }, c = s.tabIds.filter((b) => b !== r), u = [...a.tabIds.filter((b) => b !== r), r], d = s.activeTabId === r ? c[0] ?? null : s.activeTabId;
1301
+ return i[e] = { ...s, tabIds: c, tabs: c.map((b) => t.panels[b]), activeTabId: d }, i[n] = { ...a, tabIds: u, tabs: u.map((b) => t.panels[b]), activeTabId: o ? r : a.activeTabId ?? r }, { ...t, groups: i };
1302
+ }, yt = (t, e, n) => {
1303
+ const r = t.groups[e];
1304
+ if (!r)
1305
+ throw new Error(`setActiveTab: group ${e} not found.`);
1306
+ if (!r.tabIds.some((s) => s === n))
1307
+ throw new Error(`setActiveTab: tab ${n} not found in group ${e}.`);
1308
+ const o = { ...t.groups, [e]: { ...r, activeTabId: n } };
1309
+ return { ...t, groups: o, focusedGroupId: e };
1310
+ }, wn = (t, e, n, r) => {
1311
+ const o = t.groups[e];
1312
+ if (!o)
1313
+ throw new Error(`reorderTabWithinGroup: group ${e} not found.`);
1314
+ const s = o.tabIds.findIndex((b) => b === n);
1315
+ if (s === -1)
1316
+ throw new Error(`reorderTabWithinGroup: tab ${n} not in group ${e}.`);
1317
+ const a = Math.max(0, Math.min(r, o.tabIds.length - 1));
1318
+ if (s === a)
1319
+ return t;
1320
+ const i = o.tabIds.slice(), [c] = i.splice(s, 1);
1321
+ i.splice(a, 0, c);
1322
+ const u = i.map((b) => t.panels[b]), d = { ...t.groups, [e]: { ...o, tabIds: i, tabs: u } };
1323
+ return { ...t, groups: d };
1324
+ }, ut = (t, e, n, r, o) => {
1325
+ const s = t.groups[e];
1326
+ if (!s)
1327
+ throw new Error(`addTabToGroupAtIndex: group ${e} not found.`);
1328
+ const a = { ...t.panels, [n.id]: n }, i = s.tabIds.slice(), c = Math.max(0, Math.min(r, i.length));
1329
+ i.splice(c, 0, n.id);
1330
+ const u = i.map((g) => a[g]), d = o ? n.id : s.activeTabId ?? n.id, b = { ...t.groups, [e]: { ...s, tabIds: i, tabs: u, activeTabId: d } };
1331
+ return { ...t, panels: a, groups: b };
1332
+ }, H = (t, e) => {
1333
+ if (!t.groups[e])
1334
+ throw new Error(`setFocusedGroup: group ${e} not found.`);
1335
+ return { ...t, focusedGroupId: e };
1336
+ }, Oe = (t, e) => {
1337
+ const n = e - 1, r = t.groupOrder[n];
1338
+ return r ? H(t, r) : t;
1339
+ }, _e = (t) => {
1340
+ const e = t.groupOrder, n = t.focusedGroupId;
1341
+ if (!n) {
1342
+ const s = e[0];
1343
+ return s ? H(t, s) : t;
1344
+ }
1345
+ const r = e.indexOf(n), o = e[(r + 1) % e.length];
1346
+ return H(t, o);
1347
+ }, Be = (t) => {
1348
+ const e = t.groupOrder, n = t.focusedGroupId;
1349
+ if (!n) {
1350
+ const s = e[e.length - 1];
1351
+ return s ? H(t, s) : t;
1352
+ }
1353
+ const r = e.indexOf(n), o = e[(r - 1 + e.length) % e.length];
1354
+ return H(t, o);
1355
+ }, In = (t) => {
1356
+ const e = z(t.tree);
1357
+ return { ...t, groupOrder: e };
1358
+ }, Tt = (t, e, n, r) => {
1359
+ const { tree: o, newGroupId: s } = It(t.tree, e, n, r), a = { ...t.groups, [s]: Ae(s) }, i = z(o);
1360
+ return { ...t, tree: o, groups: a, groupOrder: i, focusedGroupId: s };
1361
+ }, yn = (t) => {
1362
+ const n = { type: "group", groupId: "g_1" }, r = Object.fromEntries(t.map((i) => [i.id, i])), s = { g_1: { id: "g_1", tabIds: t.map((i) => i.id), tabs: t, activeTabId: t[0]?.id ?? null } };
1363
+ return { tree: n, panels: r, groups: s, groupOrder: ["g_1"], focusedGroupId: "g_1" };
1364
+ }, $e = l.createContext(null), Ne = ({ value: t, children: e }) => /* @__PURE__ */ m($e.Provider, { value: t, children: e }), Gt = l.createContext(null), He = () => {
1365
+ const t = l.useContext(Gt);
1366
+ if (!t)
1367
+ throw new Error("useTree must be used within TreeProvider");
1368
+ return t;
1369
+ }, Le = ({ value: t, children: e }) => /* @__PURE__ */ m(Gt.Provider, { value: t, children: e }), ze = l.createContext(null), Xe = ({ value: t, children: e }) => /* @__PURE__ */ m(ze.Provider, { value: t, children: e }), Y = (t) => {
1370
+ const e = Dt(t, Number.POSITIVE_INFINITY);
1371
+ return M(e, 1);
1372
+ }, Ye = (t) => typeof t == "object" && t !== null, Fe = (t) => Ye(t) ? "rows" in t ? !0 : "cols" in t : !1, xt = (t) => {
1373
+ if (!t)
1374
+ return {
1375
+ rows: Number.POSITIVE_INFINITY,
1376
+ cols: Number.POSITIVE_INFINITY
1377
+ };
1378
+ if (typeof t == "number") {
1379
+ const n = Y(t);
1380
+ return { rows: n, cols: n };
1381
+ }
1382
+ if (Fe(t))
1383
+ return {
1384
+ rows: Y(t.rows),
1385
+ cols: Y(t.cols)
1386
+ };
1387
+ const e = t;
1388
+ return {
1389
+ rows: Y(e.maxHorizontal),
1390
+ cols: Y(e.maxVertical)
1391
+ };
1392
+ }, tt = (t) => {
1393
+ if (O(t))
1394
+ return { horizontal: 1, vertical: 1 };
1395
+ const e = tt(t.a), n = tt(t.b);
1396
+ return t.direction === "horizontal" ? { horizontal: e.horizontal + n.horizontal, vertical: Math.max(e.vertical, n.vertical) } : { horizontal: Math.max(e.horizontal, n.horizontal), vertical: e.vertical + n.vertical };
1397
+ }, je = (t, e, n) => {
1398
+ const { tree: r } = It(t, e, n, () => "__preview__");
1399
+ return r;
1400
+ }, rt = (t, e, n, r) => {
1401
+ if (!Number.isFinite(r.rows) && !Number.isFinite(r.cols))
1402
+ return !0;
1403
+ const o = je(t, e, n), s = tt(o);
1404
+ return !(s.horizontal > r.rows || s.vertical > r.cols);
1405
+ }, St = {
1406
+ splitFocused: k("panelState/splitFocused", (t) => ({ direction: t })),
1407
+ focusGroupIndex: k("panelState/focusGroupIndex", (t) => ({ index1Based: t })),
1408
+ focusNextGroup: k("panelState/focusNextGroup"),
1409
+ focusPrevGroup: k("panelState/focusPrevGroup"),
1410
+ setActiveTab: k("panelState/setActiveTab", (t, e) => ({ groupId: t, tabId: e })),
1411
+ addTab: k(
1412
+ "panelState/addTab",
1413
+ (t) => t
1414
+ ),
1415
+ addNewTab: k(
1416
+ "panelState/addNewTab",
1417
+ (t) => t
1418
+ ),
1419
+ removeTab: k("panelState/removeTab", (t, e) => ({ groupId: t, tabId: e })),
1420
+ contentDrop: k(
1421
+ "panelState/contentDrop",
1422
+ (t) => t
1423
+ ),
1424
+ tabDrop: k(
1425
+ "panelState/tabDrop",
1426
+ (t) => t
1427
+ ),
1428
+ adjustSplitRatio: k("panelState/adjustSplitRatio", (t) => t)
1429
+ }, Ke = (t, e, n) => {
1430
+ const r = t.groups[e.fromGroupId], o = t.groups[e.targetGroupId];
1431
+ if (!r || !o || !r.tabs.find((b) => b.id === e.tabId))
1432
+ return t;
1433
+ if (e.zone === "center" && e.fromGroupId === e.targetGroupId)
1434
+ return yt(t, e.fromGroupId, e.tabId);
1435
+ if (e.zone === "center") {
1436
+ const b = ct(t, e.fromGroupId, e.targetGroupId, e.tabId, !0);
1437
+ return H(b, e.targetGroupId);
1438
+ }
1439
+ const a = e.zone === "left" || e.zone === "right" ? "vertical" : "horizontal";
1440
+ if (!rt(t.tree, e.targetGroupId, a, n.splitLimits))
1441
+ return t;
1442
+ const i = n.createGroupId(), c = Tt(t, e.targetGroupId, a, () => i), u = e.zone === "left" || e.zone === "top" ? e.targetGroupId : i, d = ct(c, e.fromGroupId, u, e.tabId, !0);
1443
+ return H(d, u);
1444
+ }, We = (t, e) => {
1445
+ const n = t.groups[e.fromGroupId], r = t.groups[e.targetGroupId];
1446
+ if (!n || !r || !t.panels[e.tabId])
1447
+ return t;
1448
+ if (e.fromGroupId === e.targetGroupId) {
1449
+ const g = n.tabIds.filter((T) => T !== e.tabId), y = Math.max(0, Math.min(e.targetIndex, g.length)), h = g.slice(0, y).concat([e.tabId], g.slice(y)), v = h.map((T) => t.panels[T]).filter(Boolean), w = { ...t.groups, [e.fromGroupId]: { ...n, tabIds: h, tabs: v } };
1450
+ return { ...t, groups: w };
1451
+ }
1452
+ const s = { ...t.groups }, a = n.tabIds.filter((g) => g !== e.tabId), i = a.map((g) => t.panels[g]);
1453
+ s[e.fromGroupId] = {
1454
+ ...n,
1455
+ tabIds: a,
1456
+ tabs: i,
1457
+ activeTabId: n.activeTabId === e.tabId ? i[0]?.id ?? null : n.activeTabId
1458
+ };
1459
+ const c = r.tabIds.filter((g) => g !== e.tabId), u = Math.max(0, Math.min(e.targetIndex, c.length)), d = c.slice(0, u).concat([e.tabId], c.slice(u)), b = d.map((g) => t.panels[g]).filter(Boolean);
1460
+ return s[e.targetGroupId] = { ...r, tabIds: d, tabs: b, activeTabId: e.tabId }, { ...t, groups: s, focusedGroupId: e.targetGroupId };
1461
+ }, Ue = mt(St, {
1462
+ splitFocused: (t, e, n) => {
1463
+ const r = t.focusedGroupId ?? t.groupOrder[0] ?? null;
1464
+ return !r || !rt(t.tree, r, e.payload.direction, n.splitLimits) ? t : Tt(t, r, e.payload.direction, n.createGroupId);
1465
+ },
1466
+ focusGroupIndex: (t, e) => Oe(t, e.payload.index1Based),
1467
+ focusNextGroup: (t) => _e(t),
1468
+ focusPrevGroup: (t) => Be(t),
1469
+ setActiveTab: (t, e) => yt(t, e.payload.groupId, e.payload.tabId),
1470
+ addTab: (t, e) => {
1471
+ const { groupId: n, tab: r, index: o, makeActive: s } = e.payload;
1472
+ return typeof o == "number" ? ut(t, n, r, o, s ?? !0) : at(t, n, r, s ?? !0);
1473
+ },
1474
+ addNewTab: (t, e, n) => {
1475
+ if (!n.createPanelId)
1476
+ throw new Error("addNewTab requires PanelSystemProvider.createPanelId");
1477
+ const o = { id: n.createPanelId(), title: e.payload.title, render: () => e.payload.title }, { groupId: s, index: a, makeActive: i } = e.payload;
1478
+ return typeof a == "number" ? ut(t, s, o, a, i ?? !0) : at(t, s, o, i ?? !0);
1479
+ },
1480
+ removeTab: (t, e) => Me(t, e.payload.groupId, e.payload.tabId),
1481
+ contentDrop: (t, e, n) => Ke(t, e.payload, n),
1482
+ tabDrop: (t, e) => We(t, e.payload),
1483
+ adjustSplitRatio: (t, e) => {
1484
+ const n = q(t.tree, e.payload.path);
1485
+ if (O(n))
1486
+ return t;
1487
+ const r = ke(t.tree, e.payload.path, n.ratio + e.payload.deltaRatio);
1488
+ return { ...t, tree: r };
1489
+ }
1490
+ }), lt = (t, e, n) => {
1491
+ const r = Ue[e.type];
1492
+ if (!r)
1493
+ return t;
1494
+ const o = r(t, e, n);
1495
+ return Q(o);
1496
+ }, Ct = l.createContext(null), X = () => {
1497
+ const t = l.useContext(Ct);
1498
+ if (!t)
1499
+ throw new Error("usePanelSystem must be used within PanelSystemProvider");
1500
+ return t;
1501
+ }, Ve = ({
1502
+ initialState: t,
1503
+ createGroupId: e,
1504
+ createPanelId: n,
1505
+ state: r,
1506
+ onStateChange: o,
1507
+ splitLimits: s,
1508
+ children: a
1509
+ }) => {
1510
+ const i = l.useMemo(() => Q(t), [t]), c = l.useMemo(() => xt(s), [s]), u = l.useRef({ createGroupId: e, splitLimits: c, createPanelId: n });
1511
+ u.current.createGroupId = e, u.current.splitLimits = c, u.current.createPanelId = n;
1512
+ const [d, b] = l.useReducer(
1513
+ (G, C) => lt(G, C, u.current),
1514
+ i
1515
+ ), g = l.useMemo(
1516
+ () => r ? Q(r) : d,
1517
+ [r, d]
1518
+ ), y = l.useRef(g);
1519
+ y.current = g;
1520
+ const h = r !== void 0, v = l.useCallback(
1521
+ (G) => {
1522
+ if (h) {
1523
+ const C = lt(y.current, G, u.current);
1524
+ o?.(C);
1525
+ return;
1526
+ }
1527
+ b(G);
1528
+ },
1529
+ [h, o, b]
1530
+ ), w = l.useMemo(() => ue(St, v), [v]), T = l.useMemo(
1531
+ () => ({
1532
+ setActiveTab: w.setActiveTab,
1533
+ tabDrop: w.tabDrop
1534
+ }),
1535
+ [w]
1536
+ ), f = l.useMemo(
1537
+ () => ({
1538
+ adjustSplitRatio: w.adjustSplitRatio
1539
+ }),
1540
+ [w]
1541
+ ), I = l.useMemo(
1542
+ () => ({
1543
+ focusGroupIndex: w.focusGroupIndex,
1544
+ focusNextGroup: w.focusNextGroup,
1545
+ focusPrevGroup: w.focusPrevGroup
1546
+ }),
1547
+ [w]
1548
+ ), p = l.useMemo(
1549
+ () => ({
1550
+ state: g,
1551
+ dispatch: v,
1552
+ actions: w
1553
+ }),
1554
+ [g, v, w]
1555
+ );
1556
+ return /* @__PURE__ */ m(Ct.Provider, { value: p, children: /* @__PURE__ */ m(Ne, { value: T, children: /* @__PURE__ */ m(Le, { value: f, children: /* @__PURE__ */ m(Xe, { value: I, children: a }) }) }) });
1557
+ }, qe = () => {
1558
+ const { actions: t } = X();
1559
+ return l.useMemo(
1560
+ () => ({
1561
+ splitFocused: (e) => {
1562
+ t.splitFocused(e);
1563
+ },
1564
+ focusGroupIndex: (e) => {
1565
+ t.focusGroupIndex(e);
1566
+ },
1567
+ focusNextGroup: () => {
1568
+ t.focusNextGroup();
1569
+ },
1570
+ focusPrevGroup: () => {
1571
+ t.focusPrevGroup();
1572
+ },
1573
+ closeFocusedGroup: () => {
1574
+ }
1575
+ }),
1576
+ [t]
1577
+ );
1578
+ }, Ze = () => {
1579
+ const { actions: t } = X(), e = l.useCallback(
1580
+ ({ fromGroupId: r, tabId: o, targetGroupId: s, zone: a }) => {
1581
+ t.contentDrop({ fromGroupId: r, tabId: o, targetGroupId: s, zone: a });
1582
+ },
1583
+ [t]
1584
+ ), n = l.useCallback(
1585
+ ({ fromGroupId: r, tabId: o, targetGroupId: s, targetIndex: a }) => {
1586
+ t.tabDrop({ fromGroupId: r, tabId: o, targetGroupId: s, targetIndex: a });
1587
+ },
1588
+ [t]
1589
+ );
1590
+ return { onCommitContentDrop: e, onCommitTabDrop: n };
1591
+ }, Je = () => {
1592
+ const t = Ut(), e = qe();
1593
+ return l.useEffect(() => {
1594
+ Zt(t, e);
1595
+ }, [t, e]), null;
1596
+ }, Et = l.createContext(null), Qe = () => {
1597
+ const t = l.useContext(Et);
1598
+ if (!t)
1599
+ throw new Error("useContentRegistry must be used within ContentRegistryProvider");
1600
+ return t;
1601
+ }, tn = (t) => {
1602
+ const e = document.createElement("div");
1603
+ return e.setAttribute("data-panel-wrapper", t), e.style.display = "contents", e;
1604
+ }, en = (t, e, n) => {
1605
+ const [r] = l.useState(() => tn(t));
1606
+ return nt(() => (r.style.display = n ? "contents" : "none", e && r.parentElement !== e && e.appendChild(r), () => {
1607
+ r.parentElement?.removeChild(r);
1608
+ }), [r, e, n]), r;
1609
+ }, Pt = l.memo(
1610
+ ({ panelId: t, content: e, placement: n, containerElement: r }) => {
1611
+ const o = n?.isActive ?? !1, s = en(t, r, o);
1612
+ return Kt(
1613
+ /* @__PURE__ */ m(l.Activity, { mode: o ? "visible" : "hidden", children: e }),
1614
+ s
1615
+ );
1616
+ }
1617
+ );
1618
+ Pt.displayName = "PanelContentHost";
1619
+ const nn = ({
1620
+ children: t,
1621
+ panels: e,
1622
+ placements: n
1623
+ }) => {
1624
+ const [r, o] = l.useState(/* @__PURE__ */ new Map()), s = l.useCallback((g, y) => {
1625
+ o((h) => {
1626
+ const v = new Map(h);
1627
+ return y ? v.set(g, y) : v.delete(g), v;
1628
+ });
1629
+ }, []), a = l.useMemo(
1630
+ () => ({ registerContentContainer: s }),
1631
+ [s]
1632
+ ), i = l.useRef(e);
1633
+ i.current = e;
1634
+ const c = l.useCallback((g) => {
1635
+ const y = i.current[g];
1636
+ return y ? y.render(y.id) : null;
1637
+ }, []), u = l.useMemo(() => Object.keys(e), [e]), { getCachedContent: d } = Wt({
1638
+ resolveContent: c,
1639
+ validIds: u
1640
+ }), b = Object.keys(e);
1641
+ return /* @__PURE__ */ N(Et.Provider, { value: a, children: [
1642
+ t,
1643
+ b.map((g) => {
1644
+ if (!e[g])
1645
+ return null;
1646
+ const h = n[g] ?? null, v = h ? r.get(h.groupId) ?? null : null, w = d(g);
1647
+ return /* @__PURE__ */ m(
1648
+ Pt,
1649
+ {
1650
+ panelId: g,
1651
+ content: w,
1652
+ placement: h,
1653
+ containerElement: v
1654
+ },
1655
+ g
1656
+ );
1657
+ })
1658
+ ] });
1659
+ }, rn = ({
1660
+ children: t,
1661
+ emptyContentComponent: e,
1662
+ doubleClickToAdd: n
1663
+ }) => {
1664
+ const r = V(), { state: o, actions: s } = X(), { registerContentContainer: a } = Qe(), i = l.useCallback(() => l.createElement("div", { style: { color: "#888", fontSize: 12, padding: 12 } }, "No tabs"), []), c = e ?? i, u = l.useCallback(
1665
+ (T) => {
1666
+ const f = o.groups[T];
1667
+ if (!f)
1668
+ return null;
1669
+ const I = f.tabIds.map((p) => o.panels[p]).filter(Boolean);
1670
+ return { ...f, tabs: I };
1671
+ },
1672
+ [o.groups, o.panels]
1673
+ ), d = l.useCallback(
1674
+ (T) => {
1675
+ const f = o.groups[T];
1676
+ return !f || f.tabIds.length === 0 ? /* @__PURE__ */ m(c, {}) : null;
1677
+ },
1678
+ [o.groups, c]
1679
+ ), b = l.useCallback((T, f) => {
1680
+ s.setActiveTab(T, f);
1681
+ }, [s]), g = l.useCallback((T) => {
1682
+ s.addNewTab({ groupId: T, title: "New Tab", makeActive: !0 });
1683
+ }, [s]), y = l.useCallback((T, f) => {
1684
+ s.removeTab(T, f);
1685
+ }, [s]), h = l.useCallback((T, f, I) => {
1686
+ s.setActiveTab(f, T), r.onStartTabDrag(T, f, I);
1687
+ }, [s, r]), v = l.useCallback((T, f) => {
1688
+ const I = o.groups[T];
1689
+ !I || !I.activeTabId || r.onStartContentDrag(T, I.activeTabId, f);
1690
+ }, [o.groups, r]), w = l.useMemo(
1691
+ () => ({ getGroup: u, getGroupContent: d, onClickTab: b, onAddTab: g, onCloseTab: y, onStartTabDrag: h, onStartContentDrag: v, doubleClickToAdd: n, registerContentContainer: a }),
1692
+ [u, d, b, g, y, h, v, n, a]
1693
+ );
1694
+ return /* @__PURE__ */ m(ne, { value: w, children: t });
1695
+ }, on = ({
1696
+ children: t,
1697
+ emptyContentComponent: e,
1698
+ doubleClickToAdd: n
1699
+ }) => {
1700
+ const { state: r } = X(), o = l.useMemo(() => {
1701
+ const s = {};
1702
+ for (const [a, i] of Object.entries(r.groups))
1703
+ for (const c of i.tabIds)
1704
+ s[c] = {
1705
+ groupId: a,
1706
+ isActive: c === i.activeTabId
1707
+ };
1708
+ return s;
1709
+ }, [r.groups]);
1710
+ return /* @__PURE__ */ m(nn, { panels: r.panels, placements: o, children: /* @__PURE__ */ m(rn, { emptyContentComponent: e, doubleClickToAdd: n, children: t }) });
1711
+ }, F = (t, e, n, r) => {
1712
+ if (O(t))
1713
+ return r;
1714
+ const o = t.direction, s = o === "vertical" ? n.x + n.w * t.ratio : n.y + n.h * t.ratio;
1715
+ if (r.push({ path: e, direction: o, parentRect: n, linePos: s }), o === "vertical") {
1716
+ const c = n.w * t.ratio, u = n.w - c;
1717
+ return F(t.a, [...e, "a"], { x: n.x, y: n.y, w: c, h: n.h }, r), F(t.b, [...e, "b"], { x: n.x + c, y: n.y, w: u, h: n.h }, r), r;
1718
+ }
1719
+ const a = n.h * t.ratio, i = n.h - a;
1720
+ return F(t.a, [...e, "a"], { x: n.x, y: n.y, w: n.w, h: a }, r), F(t.b, [...e, "b"], { x: n.x, y: n.y + a, w: n.w, h: i }, r), r;
1721
+ }, sn = ({ containerRef: t }) => {
1722
+ const { state: e } = X(), { adjustSplitRatio: n } = He(), r = l.useMemo(() => F(e.tree, [], { x: 0, y: 0, w: 100, h: 100 }, []), [e.tree]), [o, s] = l.useState(null);
1723
+ if (nt(() => {
1724
+ const i = t.current;
1725
+ if (!i)
1726
+ return;
1727
+ const c = () => {
1728
+ const y = i.getBoundingClientRect();
1729
+ s({ left: y.left, top: y.top, width: y.width, height: y.height });
1730
+ };
1731
+ c();
1732
+ function u() {
1733
+ try {
1734
+ const y = window.ResizeObserver;
1735
+ return typeof y == "function" ? y : null;
1736
+ } catch {
1737
+ return null;
1738
+ }
1739
+ }
1740
+ const d = u(), b = d ? new d(() => c()) : null;
1741
+ b && b.observe(i);
1742
+ const g = () => c();
1743
+ return window.addEventListener("scroll", g, !0), () => {
1744
+ window.removeEventListener("scroll", g, !0), b && b.disconnect();
1745
+ };
1746
+ }, [t, e.tree]), !o)
1747
+ return null;
1748
+ const a = (i, c) => {
1749
+ const u = {
1750
+ left: o.left + o.width * i.parentRect.x / 100,
1751
+ top: o.top + o.height * i.parentRect.y / 100,
1752
+ width: o.width * i.parentRect.w / 100,
1753
+ height: o.height * i.parentRect.h / 100
1754
+ }, d = jt;
1755
+ if (i.direction === "vertical") {
1756
+ const h = u.left + u.width * (i.linePos - i.parentRect.x) / i.parentRect.w, v = {
1757
+ position: "fixed",
1758
+ left: `calc(${Math.round(h)}px - ${d} / 2)`,
1759
+ top: Math.round(u.top),
1760
+ width: d,
1761
+ height: Math.round(u.height),
1762
+ cursor: "col-resize",
1763
+ pointerEvents: "auto"
1764
+ };
1765
+ return /* @__PURE__ */ m("div", { style: v, children: /* @__PURE__ */ m(st, { direction: "vertical", onResize: (T) => {
1766
+ const f = o.width * i.parentRect.w / 100, I = f === 0 ? 0 : T / f;
1767
+ n({ path: i.path, deltaRatio: I });
1768
+ } }) }, `split-${c}`);
1769
+ }
1770
+ const b = u.top + u.height * (i.linePos - i.parentRect.y) / i.parentRect.h, g = {
1771
+ position: "fixed",
1772
+ left: Math.round(u.left),
1773
+ top: `calc(${Math.round(b)}px - ${d} / 2)`,
1774
+ width: Math.round(u.width),
1775
+ height: d,
1776
+ cursor: "row-resize",
1777
+ pointerEvents: "auto"
1778
+ };
1779
+ return /* @__PURE__ */ m("div", { style: g, children: /* @__PURE__ */ m(st, { direction: "horizontal", onResize: (h) => {
1780
+ const v = o.height * i.parentRect.h / 100, w = v === 0 ? 0 : h / v;
1781
+ n({ path: i.path, deltaRatio: w });
1782
+ } }) }, `split-${c}`);
1783
+ };
1784
+ return /* @__PURE__ */ m("div", { style: { position: "fixed", inset: 0, pointerEvents: "none" }, children: r.map((i, c) => a(i, c)) });
1785
+ }, an = {
1786
+ position: "relative",
1787
+ display: "flex",
1788
+ width: "100%",
1789
+ height: "100%"
1790
+ }, cn = ({
1791
+ state: t,
1792
+ layoutMode: e,
1793
+ gridTracksInteractive: n,
1794
+ view: r,
1795
+ tabBarComponent: o,
1796
+ panelGroupComponent: s
1797
+ }) => {
1798
+ const a = (c) => r ? /* @__PURE__ */ m(r, { groupId: c }) : /* @__PURE__ */ m(me, { id: c, TabBarComponent: o, PanelGroupComponent: s });
1799
+ if (e === "grid") {
1800
+ const c = te(t, a, !!n);
1801
+ return /* @__PURE__ */ m(ot, { config: c.config, layers: c.layers });
1802
+ }
1803
+ const i = Qt(t, a);
1804
+ return /* @__PURE__ */ m(ot, { config: i.config, layers: i.layers });
1805
+ }, un = ({
1806
+ containerRef: t,
1807
+ layoutMode: e,
1808
+ gridTracksInteractive: n,
1809
+ dragThresholdPx: r,
1810
+ view: o,
1811
+ style: s,
1812
+ className: a,
1813
+ tabBarComponent: i,
1814
+ panelGroupComponent: c,
1815
+ splitLimits: u,
1816
+ emptyContentComponent: d,
1817
+ doubleClickToAdd: b
1818
+ }) => {
1819
+ const { state: g } = X(), { onCommitContentDrop: y, onCommitTabDrop: h } = Ze(), v = l.useMemo(() => ({ ...an, ...s }), [s]), w = l.useCallback(
1820
+ ({ targetGroupId: T, zone: f }) => {
1821
+ if (f === "center")
1822
+ return !0;
1823
+ const I = f === "left" || f === "right" ? "vertical" : "horizontal";
1824
+ return rt(g.tree, T, I, u);
1825
+ },
1826
+ [g.tree, u]
1827
+ );
1828
+ return /* @__PURE__ */ m(re, { children: /* @__PURE__ */ N(
1829
+ pe,
1830
+ {
1831
+ containerRef: t,
1832
+ dragThresholdPx: r,
1833
+ onCommitContentDrop: y,
1834
+ onCommitTabDrop: h,
1835
+ isContentZoneAllowed: w,
1836
+ children: [
1837
+ /* @__PURE__ */ m(on, { emptyContentComponent: d, doubleClickToAdd: b, children: /* @__PURE__ */ m("div", { ref: t, className: a, style: v, children: /* @__PURE__ */ m(
1838
+ cn,
1839
+ {
1840
+ state: g,
1841
+ layoutMode: e,
1842
+ gridTracksInteractive: n,
1843
+ view: o,
1844
+ tabBarComponent: i,
1845
+ panelGroupComponent: c
1846
+ }
1847
+ ) }) }),
1848
+ /* @__PURE__ */ m(sn, { containerRef: t }),
1849
+ /* @__PURE__ */ m(ln, {})
1850
+ ]
1851
+ }
1852
+ ) });
1853
+ }, ln = () => {
1854
+ const t = V();
1855
+ return /* @__PURE__ */ N(et, { children: [
1856
+ /* @__PURE__ */ m(xe, { suggest: t.suggest }),
1857
+ /* @__PURE__ */ m(Re, {})
1858
+ ] });
1859
+ }, Tn = ({
1860
+ initialState: t,
1861
+ createGroupId: e,
1862
+ createPanelId: n,
1863
+ layoutMode: r,
1864
+ gridTracksInteractive: o,
1865
+ dragThresholdPx: s,
1866
+ view: a,
1867
+ emptyContentComponent: i,
1868
+ state: c,
1869
+ onStateChange: u,
1870
+ className: d,
1871
+ style: b,
1872
+ tabBarComponent: g,
1873
+ panelGroupComponent: y,
1874
+ splitLimits: h,
1875
+ doubleClickToAdd: v
1876
+ }) => {
1877
+ if (!t)
1878
+ throw new Error("PanelSystem requires initialState.");
1879
+ if (!e)
1880
+ throw new Error("PanelSystem requires explicit createGroupId function.");
1881
+ if (!r)
1882
+ throw new Error("PanelSystem requires explicit layoutMode ('absolute' | 'grid').");
1883
+ if (r === "grid" && o === void 0)
1884
+ throw new Error("PanelSystem(layoutMode='grid') requires explicit 'gridTracksInteractive' flag.");
1885
+ if (s === void 0)
1886
+ throw new Error("PanelSystem requires explicit 'dragThresholdPx' value.");
1887
+ const w = l.useRef(null), T = l.useMemo(() => xt(h), [h]);
1888
+ return /* @__PURE__ */ m(
1889
+ Ve,
1890
+ {
1891
+ initialState: t,
1892
+ createGroupId: e,
1893
+ createPanelId: n,
1894
+ state: c,
1895
+ onStateChange: u,
1896
+ splitLimits: h,
1897
+ children: /* @__PURE__ */ N(qt, { children: [
1898
+ /* @__PURE__ */ m(Je, {}),
1899
+ /* @__PURE__ */ m(
1900
+ un,
1901
+ {
1902
+ containerRef: w,
1903
+ layoutMode: r,
1904
+ gridTracksInteractive: o,
1905
+ dragThresholdPx: s,
1906
+ view: a,
1907
+ style: b,
1908
+ className: d,
1909
+ tabBarComponent: g,
1910
+ panelGroupComponent: y,
1911
+ splitLimits: T,
1912
+ emptyContentComponent: i,
1913
+ doubleClickToAdd: v
1914
+ }
1915
+ )
1916
+ ] })
1917
+ }
1918
+ );
1919
+ };
1920
+ export {
1921
+ xe as D,
1922
+ Tn as P,
1923
+ gt as a,
1924
+ Ve as b,
1925
+ z as c,
1926
+ De as d,
1927
+ ke as e,
1928
+ Ae as f,
1929
+ at as g,
1930
+ yt as h,
1931
+ O as i,
1932
+ wn as j,
1933
+ ut as k,
1934
+ H as l,
1935
+ ct as m,
1936
+ Oe as n,
1937
+ _e as o,
1938
+ Be as p,
1939
+ In as q,
1940
+ Me as r,
1941
+ It as s,
1942
+ Tt as t,
1943
+ X as u,
1944
+ yn as v
1945
+ };
1946
+ //# sourceMappingURL=PanelSystem-BqUzNtf2.js.map