@smwb/ui-solid 2.0.0 → 2.1.0

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 (207) hide show
  1. package/README.md +115 -0
  2. package/dist/assets/styles/less/components/appBar/appBar.entry.css +1 -1
  3. package/dist/assets/styles/less/components/avatar/avatar.entry.css +1 -1
  4. package/dist/assets/styles/less/components/breadcrumbs/breadcrumbs.entry.css +1 -1
  5. package/dist/assets/styles/less/components/button/button.entry.css +1 -1
  6. package/dist/assets/styles/less/components/buttonGroup/buttonGroup.entry.css +1 -1
  7. package/dist/assets/styles/less/components/dagView/dagView.entry.css +1 -1
  8. package/dist/assets/styles/less/components/meter/meter.entry.css +1 -1
  9. package/dist/assets/styles/less/components/screenDivider/screenDivider.entry.css +1 -1
  10. package/dist/assets/styles/less/components/sheet/sheet.entry.css +1 -1
  11. package/dist/assets/styles/less/components/statusDot/statusDot.entry.css +1 -1
  12. package/dist/assets/styles/less/components/tabGroups/tabGroups.entry.css +1 -1
  13. package/dist/assets/styles/less/components/tabs/tab/tab.entry.css +1 -1
  14. package/dist/assets/styles/less/components/toggle/toggle.entry.css +1 -1
  15. package/dist/assets/styles/less/components/treeView/treeView.entry.css +1 -1
  16. package/dist/assets/styles/less/tokens.entry.css +1 -1
  17. package/dist/components/dataDisplay/avatar/avatar.d.ts +5 -2
  18. package/dist/components/dataDisplay/avatar/avatar.js +9 -9
  19. package/dist/components/dataDisplay/avatar/avatar.js.map +1 -1
  20. package/dist/components/dataDisplay/chart/chart.d.ts +16 -8
  21. package/dist/components/dataDisplay/chart/chartFull.d.ts +14 -0
  22. package/dist/components/dataDisplay/chart/core.d.ts +19 -0
  23. package/dist/components/dataDisplay/chart/index.d.ts +1 -1
  24. package/dist/components/dataDisplay/dagView/dagView.d.ts +4 -0
  25. package/dist/components/dataDisplay/dagView/dagView.js +124 -123
  26. package/dist/components/dataDisplay/dagView/dagView.js.map +1 -1
  27. package/dist/components/dataDisplay/dagView/index.d.ts +1 -1
  28. package/dist/components/dataDisplay/meter/index.d.ts +1 -1
  29. package/dist/components/dataDisplay/meter/meter.d.ts +14 -0
  30. package/dist/components/dataDisplay/meter/meter.js +32 -30
  31. package/dist/components/dataDisplay/meter/meter.js.map +1 -1
  32. package/dist/components/dataDisplay/statusDot/index.d.ts +1 -1
  33. package/dist/components/dataDisplay/statusDot/statusDot.d.ts +10 -1
  34. package/dist/components/dataDisplay/statusDot/statusDot.js +20 -11
  35. package/dist/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  36. package/dist/components/dataDisplay/treeView/treeView.d.ts +18 -2
  37. package/dist/components/dataDisplay/treeView/treeView.js +140 -121
  38. package/dist/components/dataDisplay/treeView/treeView.js.map +1 -1
  39. package/dist/components/inputs/button/button.d.ts +7 -0
  40. package/dist/components/inputs/button/button.js +57 -51
  41. package/dist/components/inputs/button/button.js.map +1 -1
  42. package/dist/components/inputs/toggle/toggle.d.ts +6 -0
  43. package/dist/components/inputs/toggle/toggle.js +23 -23
  44. package/dist/components/inputs/toggle/toggle.js.map +1 -1
  45. package/dist/components/layout/appLayout/appLayout.d.ts +6 -1
  46. package/dist/components/layout/appLayout/appLayout.js +49 -42
  47. package/dist/components/layout/appLayout/appLayout.js.map +1 -1
  48. package/dist/components/layout/screenDivider/screenDivider.d.ts +12 -0
  49. package/dist/components/layout/screenDivider/screenDivider.js +87 -46
  50. package/dist/components/layout/screenDivider/screenDivider.js.map +1 -1
  51. package/dist/components/layout/sheet/sheet.d.ts +11 -0
  52. package/dist/components/layout/sheet/sheet.js +122 -102
  53. package/dist/components/layout/sheet/sheet.js.map +1 -1
  54. package/dist/components/layout/tabGroups/index.d.ts +1 -1
  55. package/dist/components/layout/tabGroups/tabGroups.d.ts +44 -1
  56. package/dist/components/layout/tabGroups/tabGroups.js +500 -460
  57. package/dist/components/layout/tabGroups/tabGroups.js.map +1 -1
  58. package/dist/components/layout/tabGroups/tabGroupsFocus.d.ts +16 -0
  59. package/dist/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  60. package/dist/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  61. package/dist/components/navigation/appBar/appBar.d.ts +12 -0
  62. package/dist/components/navigation/appBar/appBar.js.map +1 -1
  63. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +9 -0
  64. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +47 -31
  65. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  66. package/dist/components/navigation/tabs/tab/tab.js +71 -68
  67. package/dist/components/navigation/tabs/tab/tab.js.map +1 -1
  68. package/dist/components/navigation/tabs/tabs.d.ts +11 -0
  69. package/dist/components/navigation/tabs/tabs.js +19 -16
  70. package/dist/components/navigation/tabs/tabs.js.map +1 -1
  71. package/dist/components/navigation/tabs/tabsContext.d.ts +2 -0
  72. package/dist/components/navigation/tabs/tabsContext.js.map +1 -1
  73. package/dist/headless/components/dataDisplay/avatar/avatar.js +9 -9
  74. package/dist/headless/components/dataDisplay/avatar/avatar.js.map +1 -1
  75. package/dist/headless/components/dataDisplay/dagView/dagView.js +133 -132
  76. package/dist/headless/components/dataDisplay/dagView/dagView.js.map +1 -1
  77. package/dist/headless/components/dataDisplay/meter/meter.js +32 -30
  78. package/dist/headless/components/dataDisplay/meter/meter.js.map +1 -1
  79. package/dist/headless/components/dataDisplay/statusDot/statusDot.js +19 -10
  80. package/dist/headless/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  81. package/dist/headless/components/dataDisplay/treeView/treeView.js +139 -120
  82. package/dist/headless/components/dataDisplay/treeView/treeView.js.map +1 -1
  83. package/dist/headless/components/inputs/button/button.js +57 -51
  84. package/dist/headless/components/inputs/button/button.js.map +1 -1
  85. package/dist/headless/components/inputs/toggle/toggle.js +23 -23
  86. package/dist/headless/components/inputs/toggle/toggle.js.map +1 -1
  87. package/dist/headless/components/layout/appLayout/appLayout.js +52 -45
  88. package/dist/headless/components/layout/appLayout/appLayout.js.map +1 -1
  89. package/dist/headless/components/layout/screenDivider/screenDivider.js +88 -47
  90. package/dist/headless/components/layout/screenDivider/screenDivider.js.map +1 -1
  91. package/dist/headless/components/layout/sheet/sheet.js +124 -104
  92. package/dist/headless/components/layout/sheet/sheet.js.map +1 -1
  93. package/dist/headless/components/layout/tabGroups/tabGroups.js +500 -460
  94. package/dist/headless/components/layout/tabGroups/tabGroups.js.map +1 -1
  95. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  96. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  97. package/dist/headless/components/navigation/appBar/appBar.js.map +1 -1
  98. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js +46 -30
  99. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  100. package/dist/headless/components/navigation/tabs/tab/tab.js +70 -67
  101. package/dist/headless/components/navigation/tabs/tab/tab.js.map +1 -1
  102. package/dist/headless/components/navigation/tabs/tabs.js +19 -16
  103. package/dist/headless/components/navigation/tabs/tabs.js.map +1 -1
  104. package/dist/headless/components/navigation/tabs/tabsContext.js.map +1 -1
  105. package/dist/headless/primitives/publishHeaderOffset.js +19 -0
  106. package/dist/headless/primitives/publishHeaderOffset.js.map +1 -0
  107. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  108. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  109. package/dist/headless/source/components/dataDisplay/chart/chart.jsx +14 -12
  110. package/dist/headless/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  111. package/dist/headless/source/components/dataDisplay/chart/chartFull.js +12 -0
  112. package/dist/headless/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  113. package/dist/headless/source/components/dataDisplay/chart/core.js +11 -0
  114. package/dist/headless/source/components/dataDisplay/chart/core.js.map +7 -0
  115. package/dist/headless/source/components/dataDisplay/chart/index.js +1 -1
  116. package/dist/headless/source/components/dataDisplay/chart/index.js.map +1 -1
  117. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  118. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  119. package/dist/headless/source/components/dataDisplay/dagView/index.js.map +2 -2
  120. package/dist/headless/source/components/dataDisplay/meter/index.js.map +1 -1
  121. package/dist/headless/source/components/dataDisplay/meter/meter.jsx +14 -2
  122. package/dist/headless/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  123. package/dist/headless/source/components/dataDisplay/statusDot/index.js.map +1 -1
  124. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  125. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  126. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  127. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  128. package/dist/headless/source/components/inputs/button/button.jsx +26 -1
  129. package/dist/headless/source/components/inputs/button/button.jsx.map +1 -1
  130. package/dist/headless/source/components/inputs/toggle/toggle.jsx +9 -2
  131. package/dist/headless/source/components/inputs/toggle/toggle.jsx.map +1 -1
  132. package/dist/headless/source/components/layout/appLayout/appLayout.jsx +14 -2
  133. package/dist/headless/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  134. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  135. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  136. package/dist/headless/source/components/layout/sheet/sheet.jsx +14 -1
  137. package/dist/headless/source/components/layout/sheet/sheet.jsx.map +1 -1
  138. package/dist/headless/source/components/layout/tabGroups/index.js.map +1 -1
  139. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  140. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  141. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  142. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  143. package/dist/headless/source/components/navigation/appBar/appBar.jsx.map +1 -1
  144. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  145. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  146. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx +7 -1
  147. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  148. package/dist/headless/source/components/navigation/tabs/tabs.jsx +5 -1
  149. package/dist/headless/source/components/navigation/tabs/tabs.jsx.map +1 -1
  150. package/dist/headless/source/components/navigation/tabs/tabsContext.js.map +2 -2
  151. package/dist/headless/source/index.js +8 -1
  152. package/dist/headless/source/index.js.map +2 -2
  153. package/dist/headless/source/primitives/publishHeaderOffset.js +34 -0
  154. package/dist/headless/source/primitives/publishHeaderOffset.js.map +7 -0
  155. package/dist/index.d.ts +5 -5
  156. package/dist/primitives/publishHeaderOffset.d.ts +7 -0
  157. package/dist/primitives/publishHeaderOffset.js +19 -0
  158. package/dist/primitives/publishHeaderOffset.js.map +1 -0
  159. package/dist/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  160. package/dist/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  161. package/dist/source/components/dataDisplay/chart/chart.jsx +14 -12
  162. package/dist/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  163. package/dist/source/components/dataDisplay/chart/chartFull.js +12 -0
  164. package/dist/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  165. package/dist/source/components/dataDisplay/chart/core.js +11 -0
  166. package/dist/source/components/dataDisplay/chart/core.js.map +7 -0
  167. package/dist/source/components/dataDisplay/chart/index.js +1 -1
  168. package/dist/source/components/dataDisplay/chart/index.js.map +1 -1
  169. package/dist/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  170. package/dist/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  171. package/dist/source/components/dataDisplay/dagView/index.js.map +2 -2
  172. package/dist/source/components/dataDisplay/meter/index.js.map +1 -1
  173. package/dist/source/components/dataDisplay/meter/meter.jsx +14 -2
  174. package/dist/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  175. package/dist/source/components/dataDisplay/statusDot/index.js.map +1 -1
  176. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  177. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  178. package/dist/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  179. package/dist/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  180. package/dist/source/components/inputs/button/button.jsx +26 -1
  181. package/dist/source/components/inputs/button/button.jsx.map +1 -1
  182. package/dist/source/components/inputs/toggle/toggle.jsx +9 -2
  183. package/dist/source/components/inputs/toggle/toggle.jsx.map +1 -1
  184. package/dist/source/components/layout/appLayout/appLayout.jsx +14 -2
  185. package/dist/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  186. package/dist/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  187. package/dist/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  188. package/dist/source/components/layout/sheet/sheet.jsx +14 -1
  189. package/dist/source/components/layout/sheet/sheet.jsx.map +1 -1
  190. package/dist/source/components/layout/tabGroups/index.js.map +1 -1
  191. package/dist/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  192. package/dist/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  193. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  194. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  195. package/dist/source/components/navigation/appBar/appBar.jsx.map +1 -1
  196. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  197. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  198. package/dist/source/components/navigation/tabs/tab/tab.jsx +7 -1
  199. package/dist/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  200. package/dist/source/components/navigation/tabs/tabs.jsx +5 -1
  201. package/dist/source/components/navigation/tabs/tabs.jsx.map +1 -1
  202. package/dist/source/components/navigation/tabs/tabsContext.js.map +2 -2
  203. package/dist/source/index.js +8 -1
  204. package/dist/source/index.js.map +2 -2
  205. package/dist/source/primitives/publishHeaderOffset.js +34 -0
  206. package/dist/source/primitives/publishHeaderOffset.js.map +7 -0
  207. package/package.json +9 -3
@@ -1,94 +1,94 @@
1
- import { isServer as $, use as Ct, spread as dr, mergeProps as re, insert as _, createComponent as w, effect as j, className as _t, setAttribute as v, setStyleProperty as gt, addEventListener as Z, memo as fr, template as M, delegateEvents as gr } from "solid-js/web";
2
- import { splitProps as pr, createUniqueId as mr, createMemo as m, createComputed as br, createSignal as N, createEffect as xt, on as hr, onCleanup as pt, onMount as vr, children as wr, mapArray as Ot, createRenderEffect as yr, Show as st, For as oe } from "solid-js";
3
- import mt from "clsx";
4
- import { Tabs as Sr } from "../../navigation/tabs/tabs.js";
5
- import { Tab as Er } from "../../navigation/tabs/tab/tab.js";
6
- import { Menu as Ar } from "../../navigation/menu/menu.js";
7
- import { MenuItem as X } from "../../navigation/menu/menuItem.js";
8
- import { mergeRefs as Tr } from "../../../primitives/mergeRefs.js";
9
- import { mergeStyle as Dr } from "../../../primitives/mergeStyle.js";
10
- import { createControllableState as Cr } from "../../../primitives/createControllableState.js";
11
- import { callHandler as Q } from "../../../primitives/callHandler.js";
12
- import { matchesKeyboardShortcut as Rt } from "../../../utils/keyboardShortcut.js";
13
- import { throttle as _r } from "../../../utils/throttle.js";
14
- import { TAB_GROUPS_LABELS as xr, createTabGroupsLayout as Or, computeTabGroupsGrid as Rr, getGroups as k, groupBodyArea as ne, setActiveGroup as Mr, moveTab as K, gridTemplateRows as Lr, gridTemplateColumns as Pr, moveTabInDirection as Nr, selectTab as kr, groupHeaderArea as Fr, dropZoneAt as Gr, findGroupOfTab as bt, removeTab as zr, adjacentGroup as $r, separatorArea as Kr, describeTabGroupsChange as Br, resizeSplit as se } from "./tabGroupsLayout.js";
15
- import { ownerRootOf as ae, frameExitTarget as Hr, ownGroupIdOf as ie, deepActiveElement as ht, containsDeep as ce, tabMove as Ur, lastStopOf as qr, focusFromEnd as Vr } from "./tabGroupsFocus.js";
16
- import { Icon as Wr } from "../../base/icon/icon.js";
17
- var Yr = /* @__PURE__ */ M("<button type=button class=smwb-tab-groups__actions-trigger aria-haspopup=menu>"), jr = /* @__PURE__ */ M("<div>"), Zr = /* @__PURE__ */ M("<span class=smwb-tab-groups__panel-end tabindex=-1 aria-hidden=true>"), Xr = /* @__PURE__ */ M('<div class="smwb-tab-panel smwb-tab-groups__panel"role=tabpanel tabindex=0>'), Qr = /* @__PURE__ */ M("<div role=separator tabindex=0 aria-valuemin=0 aria-valuemax=100>"), Jr = /* @__PURE__ */ M("<div class=smwb-tab-groups__empty>"), Ir = /* @__PURE__ */ M("<span class=smwb-tab-groups__focus-guard tabindex=0>"), to = /* @__PURE__ */ M("<div><div class=smwb-tab-groups__status role=status data-testid=tab-groups-status>"), eo = /* @__PURE__ */ M("<div aria-hidden=true>");
18
- const ro = ["Alt+Shift+ArrowLeft", "Alt+Shift+ArrowRight", "Alt+Shift+ArrowUp", "Alt+Shift+ArrowDown", "Control+Shift+ArrowLeft", "Meta+Shift+ArrowLeft", "Control+Shift+ArrowRight", "Meta+Shift+ArrowRight"].join(" "), oo = [["left", ["Alt", "Shift", "ArrowLeft"]], ["right", ["Alt", "Shift", "ArrowRight"]], ["top", ["Alt", "Shift", "ArrowUp"]], ["bottom", ["Alt", "Shift", "ArrowDown"]]], no = '[role^="menuitem"]:not([aria-disabled="true"])';
19
- function Mt(f) {
20
- let c = f ?? null;
1
+ import { isServer as H, use as Rt, spread as wr, mergeProps as ae, insert as O, createComponent as S, effect as J, className as Lt, setAttribute as E, setStyleProperty as vt, addEventListener as I, memo as yr, template as R, delegateEvents as Sr } from "solid-js/web";
2
+ import { splitProps as Er, createUniqueId as Ar, createMemo as m, createComputed as ce, createSignal as N, createEffect as Ft, on as Tr, onCleanup as wt, onMount as Dr, children as ue, mapArray as Gt, createRenderEffect as Cr, Show as tt, For as le } from "solid-js";
3
+ import yt from "clsx";
4
+ import { Tabs as _r } from "../../navigation/tabs/tabs.js";
5
+ import { Tab as xr } from "../../navigation/tabs/tab/tab.js";
6
+ import { Menu as Or } from "../../navigation/menu/menu.js";
7
+ import { MenuItem as et } from "../../navigation/menu/menuItem.js";
8
+ import { mergeRefs as Mr } from "../../../primitives/mergeRefs.js";
9
+ import { mergeStyle as Rr } from "../../../primitives/mergeStyle.js";
10
+ import { createControllableState as Lr } from "../../../primitives/createControllableState.js";
11
+ import { callHandler as rt } from "../../../primitives/callHandler.js";
12
+ import { matchesKeyboardShortcut as Pt } from "../../../utils/keyboardShortcut.js";
13
+ import { throttle as Fr } from "../../../utils/throttle.js";
14
+ import { TAB_GROUPS_LABELS as Gr, createTabGroupsLayout as Pr, computeTabGroupsGrid as kr, getGroups as $, groupBodyArea as de, setActiveGroup as Nr, moveTab as q, gridTemplateRows as $r, gridTemplateColumns as zr, moveTabInDirection as Kr, selectTab as Br, groupHeaderArea as Hr, dropZoneAt as qr, findGroupOfTab as St, removeTab as Ur, adjacentGroup as Vr, separatorArea as Wr, describeTabGroupsChange as Yr, resizeSplit as fe } from "./tabGroupsLayout.js";
15
+ import { ownerRootOf as ge, slotFocusOf as jr, frameExitTarget as Zr, ownGroupIdOf as pe, deepActiveElement as lt, containsDeep as me, tabMove as Xr, lastStopOf as Qr, focusFromEnd as Jr, slotFocusHeir as Ir } from "./tabGroupsFocus.js";
16
+ import { Icon as to } from "../../base/icon/icon.js";
17
+ var eo = /* @__PURE__ */ R("<div class=smwb-tab-groups__strip-actions>"), ro = /* @__PURE__ */ R("<button type=button class=smwb-tab-groups__actions-trigger aria-haspopup=menu>"), oo = /* @__PURE__ */ R("<div>"), no = /* @__PURE__ */ R("<span class=smwb-tab-groups__panel-end tabindex=-1 aria-hidden=true>"), so = /* @__PURE__ */ R('<div class="smwb-tab-panel smwb-tab-groups__panel"role=tabpanel tabindex=0>'), io = /* @__PURE__ */ R("<div role=separator tabindex=0 aria-valuemin=0 aria-valuemax=100>"), ao = /* @__PURE__ */ R("<div class=smwb-tab-groups__empty>"), co = /* @__PURE__ */ R("<span class=smwb-tab-groups__focus-guard tabindex=0>"), uo = /* @__PURE__ */ R("<div><div class=smwb-tab-groups__status role=status data-testid=tab-groups-status>"), lo = /* @__PURE__ */ R("<div aria-hidden=true>");
18
+ const fo = ["Alt+Shift+ArrowLeft", "Alt+Shift+ArrowRight", "Alt+Shift+ArrowUp", "Alt+Shift+ArrowDown", "Control+Shift+ArrowLeft", "Meta+Shift+ArrowLeft", "Control+Shift+ArrowRight", "Meta+Shift+ArrowRight"].join(" "), go = [["left", ["Alt", "Shift", "ArrowLeft"]], ["right", ["Alt", "Shift", "ArrowRight"]], ["top", ["Alt", "Shift", "ArrowUp"]], ["bottom", ["Alt", "Shift", "ArrowDown"]]], po = (l) => l != null && typeof l != "boolean" && l !== "", mo = '[role^="menuitem"]:not([aria-disabled="true"])';
19
+ function kt(l) {
20
+ let c = l ?? null;
21
21
  for (; c; ) {
22
- const T = c.getAttribute("data-group-id");
23
- if (T !== null) return T;
22
+ const _ = c.getAttribute("data-group-id");
23
+ if (_ !== null) return _;
24
24
  c = c.parentElement;
25
25
  }
26
26
  return null;
27
27
  }
28
- function ue(f) {
29
- return f.closest(".smwb-tab-item") ?? f;
28
+ function be(l) {
29
+ return l.closest(".smwb-tab-item") ?? l;
30
30
  }
31
- function le(f) {
32
- if (!f) return null;
33
- const c = f.closest('[role="tab"]');
34
- return c || (f.closest(".smwb-tab-item")?.querySelector('[role="tab"]') ?? null);
31
+ function he(l) {
32
+ if (!l) return null;
33
+ const c = l.closest('[role="tab"]');
34
+ return c || (l.closest(".smwb-tab-item")?.querySelector('[role="tab"]') ?? null);
35
35
  }
36
- function at(f, c) {
37
- if (f.type !== "group") {
38
- if (f.id === c) return f;
39
- for (const T of f.children) {
40
- const E = at(T, c);
41
- if (E) return E;
36
+ function dt(l, c) {
37
+ if (l.type !== "group") {
38
+ if (l.id === c) return l;
39
+ for (const _ of l.children) {
40
+ const D = dt(_, c);
41
+ if (D) return D;
42
42
  }
43
43
  }
44
44
  }
45
- function fe(f) {
46
- return f.type === "group" ? [f.id] : f.children.flatMap(fe);
45
+ function we(l) {
46
+ return l.type === "group" ? [l.id] : l.children.flatMap(we);
47
47
  }
48
- function de(f) {
49
- const c = [], T = (E) => {
50
- if (E.type === "group") {
51
- c.push(`h:${E.id}`, `p:${E.id}`);
48
+ function ve(l) {
49
+ const c = [], _ = (D) => {
50
+ if (D.type === "group") {
51
+ c.push(`h:${D.id}`, `p:${D.id}`);
52
52
  return;
53
53
  }
54
- E.children.forEach((D, A) => {
55
- T(D), A < E.children.length - 1 && c.push(`s:${E.id}:${A}`);
54
+ D.children.forEach((x, C) => {
55
+ _(x), C < D.children.length - 1 && c.push(`s:${D.id}:${C}`);
56
56
  });
57
57
  };
58
- return T(f), c;
58
+ return _(l), c;
59
59
  }
60
- function so(f, c, T) {
61
- const E = new Set(c);
62
- T.forEach((d) => {
63
- !E.has(d) && d.parentNode === f && d.remove();
60
+ function bo(l, c, _) {
61
+ const D = new Set(c);
62
+ _.forEach((d) => {
63
+ !D.has(d) && d.parentNode === l && d.remove();
64
64
  });
65
- const D = Array.from(f.children), A = /* @__PURE__ */ new Map();
66
- D.forEach((d, l) => A.set(d, l));
67
- const B = f.ownerDocument.activeElement, L = B === null ? -1 : c.findIndex((d) => d.contains(B)), H = L < 0 ? void 0 : A.get(c[L]), x = [];
68
- c.forEach((d, l) => {
69
- const y = A.get(d);
70
- y !== void 0 && (H !== void 0 && l !== L && l < L != y < H || x.push(y));
65
+ const x = Array.from(l.children), C = /* @__PURE__ */ new Map();
66
+ x.forEach((d, u) => C.set(d, u));
67
+ const U = l.ownerDocument.activeElement, P = U === null ? -1 : c.findIndex((d) => d.contains(U)), V = P < 0 ? void 0 : C.get(c[P]), L = [];
68
+ c.forEach((d, u) => {
69
+ const A = C.get(d);
70
+ A !== void 0 && (V !== void 0 && u !== P && u < P != A < V || L.push(A));
71
71
  });
72
- const O = x.map(() => 1), J = x.map(() => -1);
73
- let U = -1;
74
- x.forEach((d, l) => {
75
- for (let y = 0; y < l; y++)
76
- x[y] < d && O[y] + 1 > O[l] && (O[l] = O[y] + 1, J[l] = y);
77
- (U < 0 || O[l] > O[U]) && (U = l);
72
+ const F = L.map(() => 1), ot = L.map(() => -1);
73
+ let W = -1;
74
+ L.forEach((d, u) => {
75
+ for (let A = 0; A < u; A++)
76
+ L[A] < d && F[A] + 1 > F[u] && (F[u] = F[A] + 1, ot[u] = A);
77
+ (W < 0 || F[u] > F[W]) && (W = u);
78
78
  });
79
- const F = /* @__PURE__ */ new Set();
80
- for (let d = U; d >= 0; d = J[d]) F.add(x[d]);
81
- let it = F.size > 0 ? D[Math.max(...F)].nextSibling : f.firstChild;
79
+ const z = /* @__PURE__ */ new Set();
80
+ for (let d = W; d >= 0; d = ot[d]) z.add(L[d]);
81
+ let ft = z.size > 0 ? x[Math.max(...z)].nextSibling : l.firstChild;
82
82
  for (let d = c.length - 1; d >= 0; d--) {
83
- const l = c[d], y = A.get(l);
84
- (y === void 0 || !F.has(y)) && f.insertBefore(l, it), it = l;
83
+ const u = c[d], A = C.get(u);
84
+ (A === void 0 || !z.has(A)) && l.insertBefore(u, ft), ft = u;
85
85
  }
86
86
  }
87
- function Lt(f) {
88
- return k(f).map((c) => c.active).filter((c) => c !== null);
87
+ function Nt(l) {
88
+ return $(l).map((c) => c.active).filter((c) => c !== null);
89
89
  }
90
- function Ao(f) {
91
- const [c, T] = pr(f, [
90
+ function Fo(l) {
91
+ const [c, _] = Er(l, [
92
92
  "class",
93
93
  "style",
94
94
  "id",
@@ -104,7 +104,9 @@ function Ao(f) {
104
104
  "minGroupSize",
105
105
  "keyboardStep",
106
106
  "groupActions",
107
+ "stripActions",
107
108
  "dense",
109
+ "fit",
108
110
  "labels",
109
111
  // Wrapped so that the caller's handler still runs, first.
110
112
  "onDragStart",
@@ -113,62 +115,62 @@ function Ao(f) {
113
115
  "onDragEnd",
114
116
  "onFocusIn",
115
117
  "onKeyDown"
116
- ]), E = mr(), D = () => c.id ?? E, A = (t) => encodeURIComponent(t), B = (t) => `${D()}-tab-${A(t)}`, L = (t) => `${D()}-panel-${A(t)}`, H = (t) => `${D()}-menu-${A(t)}`, x = (t) => `${D()}-header-${A(t)}`, O = (t, e) => `${D()}-separator-${A(t)}-${e}`, J = () => `${D()}-status`, U = () => c.minGroupSize ?? 120, F = () => c.keyboardStep ?? 5, it = () => c.groupActions !== !1, d = m(() => ({
117
- ...xr,
118
+ ]), D = Ar(), x = () => c.id ?? D, C = (t) => encodeURIComponent(t), U = (t) => `${x()}-tab-${C(t)}`, P = (t) => `${x()}-panel-${C(t)}`, V = (t) => `${x()}-menu-${C(t)}`, L = (t) => `${x()}-header-${C(t)}`, F = (t, e) => `${x()}-separator-${C(t)}-${e}`, ot = () => `${x()}-status`, W = () => c.minGroupSize ?? 120, z = () => c.keyboardStep ?? 5, ft = () => c.groupActions !== !1, d = m(() => ({
119
+ ...Gr,
118
120
  ...c.labels
119
- })), [l, y] = Cr({
121
+ })), [u, A] = Lr({
120
122
  value: () => c.layout,
121
- defaultValue: c.defaultLayout ?? Or()
123
+ defaultValue: c.defaultLayout ?? Pr()
122
124
  });
123
- let b = l();
124
- br(() => {
125
- b = l();
125
+ let v = u();
126
+ ce(() => {
127
+ v = u();
126
128
  });
127
- const R = m(() => Rr(l())), G = m(() => k(l())), ge = m(() => G().length), pe = m(() => G().length > 1), me = m(() => new Set(Lt(l()))), vt = m(() => {
129
+ const G = m(() => kr(u())), K = m(() => $(u())), $t = m(() => K().length), ye = m(() => K().length > 1), Se = m(() => new Set(Nt(u()))), Et = m(() => {
128
130
  const t = /* @__PURE__ */ new Map();
129
- return k(l()).forEach((e) => e.tabs.forEach((r) => t.set(r, e.id))), t;
130
- }), S = (t, e) => k(t).find((r) => r.id === e), Pt = (t) => G().findIndex((e) => e.id === t), q = m(() => {
131
- const t = G();
131
+ return $(u()).forEach((e) => e.tabs.forEach((r) => t.set(r, e.id))), t;
132
+ }), T = (t, e) => $(t).find((r) => r.id === e), At = (t) => K().findIndex((e) => e.id === t), Y = m(() => {
133
+ const t = K();
132
134
  return t.length === 1 && (t[0]?.tabs.length ?? 0) === 0;
133
- }), be = m(() => G().map((t) => t.id)), he = m(() => de(l().root).filter((t) => t.startsWith("s:"))), ve = m((t) => {
134
- const e = vt(), r = t.filter((n) => e.has(n)), o = new Set(r);
135
- return G().forEach((n) => n.tabs.forEach((s) => {
135
+ }), Ee = m(() => K().map((t) => t.id)), Ae = m(() => ve(u().root).filter((t) => t.startsWith("s:"))), Te = m((t) => {
136
+ const e = Et(), r = t.filter((n) => e.has(n)), o = new Set(r);
137
+ return K().forEach((n) => n.tabs.forEach((s) => {
136
138
  o.has(s) || (o.add(s), r.push(s));
137
139
  })), r.length === t.length && r.every((n, s) => n === t[s]) ? t : r;
138
- }, []), we = m(() => {
139
- if (q()) return;
140
- const t = l();
141
- return [...de(t.root).flatMap((e) => {
142
- if (e.startsWith("h:")) return [x(e.slice(2))];
143
- if (e.startsWith("p:")) return (S(t, e.slice(2))?.tabs ?? []).map(L);
140
+ }, []), De = m(() => {
141
+ if (Y()) return;
142
+ const t = u();
143
+ return [...ve(t.root).flatMap((e) => {
144
+ if (e.startsWith("h:")) return [L(e.slice(2))];
145
+ if (e.startsWith("p:")) return (T(t, e.slice(2))?.tabs ?? []).map(P);
144
146
  const r = e.lastIndexOf(":");
145
- return [O(e.slice(2, r), Number(e.slice(r + 1)))];
146
- }), J()].join(" ");
147
- }), [ye, Se] = N(new Set(Lt(l())));
148
- $ || xt(() => {
149
- const t = l(), e = /* @__PURE__ */ new Set();
150
- k(t).forEach((o) => o.tabs.forEach((n) => e.add(n)));
151
- const r = Lt(t);
152
- Se((o) => {
147
+ return [F(e.slice(2, r), Number(e.slice(r + 1)))];
148
+ }), ot()].join(" ");
149
+ }), [Ce, _e] = N(new Set(Nt(u())));
150
+ H || Ft(() => {
151
+ const t = u(), e = /* @__PURE__ */ new Set();
152
+ $(t).forEach((o) => o.tabs.forEach((n) => e.add(n)));
153
+ const r = Nt(t);
154
+ _e((o) => {
153
155
  const n = /* @__PURE__ */ new Set();
154
156
  let s = !1;
155
- return o.forEach((a) => {
156
- e.has(a) ? n.add(a) : s = !0;
157
- }), r.forEach((a) => {
158
- n.has(a) || (n.add(a), s = !0);
157
+ return o.forEach((i) => {
158
+ e.has(i) ? n.add(i) : s = !0;
159
+ }), r.forEach((i) => {
160
+ n.has(i) || (n.add(i), s = !0);
159
161
  }), s || n.size !== o.size ? n : o;
160
162
  });
161
163
  });
162
- const [Ee, Ae] = N(""), [ct, ut] = N(null), [Te, Nt] = N(!1), [De, I] = N(null), [Ce, tt] = N(null), [kt, Ft] = N(null);
163
- let h, lt, wt = null;
164
- const yt = /* @__PURE__ */ new WeakMap();
165
- let Gt = 0, St = !1, dt = !1, et = null, Et = !1;
166
- const _e = (t, e) => {
167
- const r = Br(e, t, Re, d());
168
- r !== "" && Ae((o) => o.replace(/\u00a0+$/, "") === r ? `${r} ` : r);
169
- }, zt = (t, e, r) => {
170
- const o = bt(e, t);
171
- o && (wt = {
164
+ const [xe, Oe] = N(""), [gt, pt] = N(null), [Me, zt] = N(!1), [Re, nt] = N(null), [Le, st] = N(null), [Kt, Bt] = N(null);
165
+ let b, mt, Tt = null;
166
+ const Dt = /* @__PURE__ */ new WeakMap();
167
+ let Ht = 0, Ct = !1, bt = !1, j = null, _t = !1, M = null;
168
+ const Fe = (t, e) => {
169
+ const r = Yr(e, t, $e, d());
170
+ r !== "" && Oe((o) => o.replace(/\u00a0+$/, "") === r ? `${r} ` : r);
171
+ }, qt = (t, e, r) => {
172
+ const o = St(e, t);
173
+ o && (Tt = {
172
174
  tab: t,
173
175
  group: o.id,
174
176
  index: o.tabs.indexOf(t),
@@ -176,276 +178,286 @@ function Ao(f) {
176
178
  gone: r
177
179
  },
178
180
  after: e,
179
- base: l(),
180
- from: h ? ht(h.ownerDocument) : null
181
+ base: u(),
182
+ from: b ? lt(b.ownerDocument) : null
181
183
  });
182
- }, xe = (t, e) => {
184
+ }, Ge = (t, e) => {
183
185
  if (e === t.base) return !0;
184
- const r = yt.get(e), o = yt.get(t.after);
186
+ const r = Dt.get(e), o = Dt.get(t.after);
185
187
  return r !== void 0 && o !== void 0 && r < o;
186
- }, $t = () => {
187
- const t = wt, e = l();
188
- if (!t || xe(t, e)) return;
189
- const r = h?.ownerDocument, o = bt(e, t.tab), n = o?.id === t.group && o.tabs.indexOf(t.tab) === t.index && (t.gone === void 0 || !S(e, t.gone)), s = n ? r?.getElementById(B(t.tab)) : null;
190
- if (n && (!s || Mt(s) !== t.group) || (wt = null, !s || !h || !r)) return;
191
- const a = ht(r);
192
- a !== s && (a !== null && a !== r.body && a !== t.from && !ce(h, a) || s.focus());
193
- }, V = (t, e) => {
194
- t !== b && (b = t, Gt += 1, yt.set(t, Gt), y(() => t), c.onLayoutChange?.(t, e), _e(t, e), $t(), c.layout !== void 0 && !St && (St = !0, queueMicrotask(Oe)));
195
- }, Oe = () => {
196
- St = !1, !(c.layout === void 0 || b === l()) && (b = l());
188
+ }, Ut = () => {
189
+ const t = Tt, e = u();
190
+ if (!t || Ge(t, e)) return;
191
+ const r = b?.ownerDocument, o = St(e, t.tab), n = o?.id === t.group && o.tabs.indexOf(t.tab) === t.index && (t.gone === void 0 || !T(e, t.gone)), s = n ? r?.getElementById(U(t.tab)) : null;
192
+ if (n && (!s || kt(s) !== t.group) || (Tt = null, !s || !b || !r)) return;
193
+ const i = lt(r);
194
+ i !== s && (i !== null && i !== r.body && i !== t.from && !me(b, i) || s.focus());
195
+ }, Pe = () => {
196
+ const t = M;
197
+ if (!t || !b || t.element.isConnected) return;
198
+ M = null;
199
+ const e = b.ownerDocument, r = lt(e);
200
+ r !== null && r !== e.body || Ir(b, t, u().activeGroup)?.focus();
201
+ }, ke = () => {
202
+ M && !M.element.isConnected && (M = null);
203
+ }, Z = (t, e) => {
204
+ t !== v && (v = t, Ht += 1, Dt.set(t, Ht), A(() => t), c.onLayoutChange?.(t, e), Fe(t, e), Ut(), c.layout !== void 0 && !Ct && (Ct = !0, queueMicrotask(Ne)));
205
+ }, Ne = () => {
206
+ Ct = !1, !(c.layout === void 0 || v === u()) && (v = u());
197
207
  };
198
- $ || xt(hr(l, () => {
199
- $t();
208
+ H || (ce(() => {
209
+ u(), ke();
210
+ }), Ft(Tr(u, () => {
211
+ Ut(), Pe();
200
212
  }, {
201
213
  defer: !0
202
- }));
203
- const Re = (t) => {
214
+ })));
215
+ const $e = (t) => {
204
216
  const e = c.getTab(t);
205
217
  return e ? e.title !== void 0 ? e.title : typeof e.label == "string" ? e.label : t : t;
206
- }, P = (t, e, r, o, n = {}) => {
218
+ }, k = (t, e, r, o, n = {}) => {
207
219
  if (t === e) return;
208
- const s = bt(t, r)?.id, a = s !== void 0 ? S(t, s) : void 0;
209
- if (!s || !a) return;
210
- const i = !k(t).some((p) => p.id === o), u = k(e).some((p) => p.id === s), g = n.edge !== void 0 && !u ? {
220
+ const s = St(t, r)?.id, i = s !== void 0 ? T(t, s) : void 0;
221
+ if (!s || !i) return;
222
+ const a = !$(t).some((w) => w.id === o), g = $(e).some((w) => w.id === s), p = n.edge !== void 0 && !g ? {
211
223
  type: "split",
212
224
  tab: r,
213
225
  from: o,
214
226
  to: s,
215
227
  edge: n.edge,
216
- sourceClosed: i
228
+ sourceClosed: a
217
229
  } : {
218
230
  type: "move",
219
231
  tab: r,
220
232
  from: o,
221
233
  to: s,
222
- index: a.tabs.indexOf(r),
223
- sourceClosed: i
234
+ index: i.tabs.indexOf(r),
235
+ sourceClosed: a
224
236
  };
225
- n.focus && zt(r, t), V(t, g);
226
- }, Me = (t) => (e, r) => {
237
+ n.focus && qt(r, t), Z(t, p);
238
+ }, ze = (t) => (e, r) => {
227
239
  if (e.type === "drop") return;
228
- const o = b, n = S(o, t), s = n?.tabs[r];
229
- !n || s === void 0 || V(kr(o, s), {
240
+ const o = v, n = T(o, t), s = n?.tabs[r];
241
+ !n || s === void 0 || Z(Br(o, s), {
230
242
  type: "select",
231
243
  tab: s,
232
244
  group: t
233
245
  });
234
- }, Le = (t) => (e, r) => {
235
- const o = b, n = S(o, t), s = n?.tabs[e];
236
- !n || s === void 0 || P(K(o, s, {
246
+ }, Ke = (t) => (e, r) => {
247
+ const o = v, n = T(o, t), s = n?.tabs[e];
248
+ !n || s === void 0 || k(q(o, s, {
237
249
  group: t,
238
250
  index: r
239
251
  }), o, s, t, {
240
- focus: Y?.hadFocus ?? !1
252
+ focus: Q?.hadFocus ?? !1
241
253
  });
242
- }, Pe = (t, e, r) => {
243
- const o = b, n = bt(o, t);
254
+ }, Be = (t, e, r) => {
255
+ const o = v, n = St(o, t);
244
256
  if (!n || c.onTabClose?.(t, e, r) === !1) return;
245
- const s = zr(o, t);
257
+ const s = Ur(o, t);
246
258
  if (s === o) return;
247
- const a = !k(s).some((C) => C.id === n.id), i = h, u = i ? ht(i.ownerDocument) : null, g = r === "actions" || i !== void 0 && ie(i, u) === n.id, p = a && g ? $r(o, n.id) : void 0;
248
- if (p !== void 0) {
249
- const C = S(s, p)?.active;
250
- C && zt(C, s, n.id);
259
+ const i = !$(s).some((h) => h.id === n.id), a = b, g = a ? lt(a.ownerDocument) : null, p = r === "actions" || a !== void 0 && pe(a, g) === n.id, w = i && p ? Vr(o, n.id) : void 0;
260
+ if (w !== void 0) {
261
+ const h = T(s, w)?.active;
262
+ h && qt(h, s, n.id);
251
263
  }
252
- V(s, {
264
+ Z(s, {
253
265
  type: "close",
254
266
  tab: t,
255
267
  group: n.id,
256
- groupClosed: a
268
+ groupClosed: i
257
269
  });
258
- }, Ne = (t) => (e) => {
270
+ }, He = (t) => (e) => {
259
271
  if (e.defaultPrevented || e.repeat || e.isComposing) return;
260
272
  const r = e.target;
261
273
  if (!(r instanceof Element)) return;
262
274
  const o = r.closest('[role="tab"]');
263
- if (!o || Mt(o) !== t || o.getAttribute("aria-disabled") === "true") return;
275
+ if (!o || kt(o) !== t || o.getAttribute("aria-disabled") === "true") return;
264
276
  const n = o.getAttribute("data-tab-id");
265
277
  if (!n) return;
266
- const s = b, a = S(s, t);
267
- if (!a) return;
268
- for (const [p, C] of oo) {
269
- if (!Rt(e, C)) continue;
270
- const nt = Nr(s, n, p);
271
- if (nt === s) return;
272
- e.preventDefault(), P(nt, s, n, t, {
273
- edge: p,
278
+ const s = v, i = T(s, t);
279
+ if (!i) return;
280
+ for (const [w, h] of go) {
281
+ if (!Pt(e, h)) continue;
282
+ const f = Kr(s, n, w);
283
+ if (f === s) return;
284
+ e.preventDefault(), k(f, s, n, t, {
285
+ edge: w,
274
286
  focus: !0
275
287
  });
276
288
  return;
277
289
  }
278
- const i = Rt(e, ["Mod", "Shift", "ArrowLeft"]) ? -1 : Rt(e, ["Mod", "Shift", "ArrowRight"]) ? 1 : 0;
279
- if (i === 0) return;
280
- const u = a.tabs.indexOf(n), g = u + i;
281
- u < 0 || g < 0 || g >= a.tabs.length || (e.preventDefault(), P(K(s, n, {
290
+ const a = Pt(e, ["Mod", "Shift", "ArrowLeft"]) ? -1 : Pt(e, ["Mod", "Shift", "ArrowRight"]) ? 1 : 0;
291
+ if (a === 0) return;
292
+ const g = i.tabs.indexOf(n), p = g + a;
293
+ g < 0 || p < 0 || p >= i.tabs.length || (e.preventDefault(), k(q(s, n, {
282
294
  group: t,
283
- index: g
295
+ index: p
284
296
  }), s, n, t, {
285
297
  focus: !0
286
298
  }));
287
- }, ke = (t) => {
288
- h?.ownerDocument?.getElementById(H(t))?.querySelector(no)?.focus({
299
+ }, qe = (t) => {
300
+ b?.ownerDocument?.getElementById(V(t))?.querySelector(mo)?.focus({
289
301
  preventScroll: !0
290
302
  });
291
- }, Kt = (t, e) => {
292
- ut(t), e && ke(t);
293
- }, Fe = (t, e) => {
294
- if (ct() === t) {
295
- ut(null);
303
+ }, Vt = (t, e) => {
304
+ pt(t), e && qe(t);
305
+ }, Ue = (t, e) => {
306
+ if (gt() === t) {
307
+ pt(null);
296
308
  return;
297
309
  }
298
- Kt(t, e.detail === 0);
299
- }, Ge = (t, e) => {
300
- e.defaultPrevented || e.repeat || e.key !== "ArrowDown" || (e.preventDefault(), Kt(t, !0));
301
- }, Bt = (t) => {
302
- const e = S(l(), t);
310
+ Vt(t, e.detail === 0);
311
+ }, Ve = (t, e) => {
312
+ e.defaultPrevented || e.repeat || e.key !== "ArrowDown" || (e.preventDefault(), Vt(t, !0));
313
+ }, Wt = (t) => {
314
+ const e = T(u(), t);
303
315
  return !!(e && e.active !== null && e.tabs.length >= 2);
304
- }, Ht = (t, e) => G()[Pt(t) + e]?.id, Ut = (t, e) => {
305
- const r = S(l(), t);
306
- return !!(r && r.active !== null && Ht(t, e) !== void 0);
307
- }, qt = (t, e) => {
308
- const r = S(l(), t);
316
+ }, Yt = (t, e) => K()[At(t) + e]?.id, jt = (t, e) => {
317
+ const r = T(u(), t);
318
+ return !!(r && r.active !== null && Yt(t, e) !== void 0);
319
+ }, Zt = (t, e) => {
320
+ const r = T(u(), t);
309
321
  if (!r || r.active === null) return !1;
310
322
  const o = r.tabs.indexOf(r.active) + e;
311
323
  return o >= 0 && o < r.tabs.length;
312
- }, W = (t, e) => {
313
- ut(null);
314
- const r = b, o = S(r, t), n = o?.active;
324
+ }, X = (t, e) => {
325
+ pt(null);
326
+ const r = v, o = T(r, t), n = o?.active;
315
327
  if (!o || !n) return;
316
328
  if (e === "splitRight" || e === "splitDown") {
317
- const i = e === "splitRight" ? "right" : "bottom";
318
- P(K(r, n, {
329
+ const a = e === "splitRight" ? "right" : "bottom";
330
+ k(q(r, n, {
319
331
  group: t,
320
- edge: i
332
+ edge: a
321
333
  }), r, n, t, {
322
- edge: i,
334
+ edge: a,
323
335
  focus: !0
324
336
  });
325
337
  return;
326
338
  }
327
339
  if (e === "previous" || e === "next") {
328
- const i = Ht(t, e === "previous" ? -1 : 1);
329
- if (!i) return;
330
- P(K(r, n, {
331
- group: i
340
+ const a = Yt(t, e === "previous" ? -1 : 1);
341
+ if (!a) return;
342
+ k(q(r, n, {
343
+ group: a
332
344
  }), r, n, t, {
333
345
  focus: !0
334
346
  });
335
347
  return;
336
348
  }
337
- const s = o.tabs.indexOf(n), a = s + (e === "left" ? -1 : 1);
338
- s < 0 || a < 0 || a >= o.tabs.length || P(K(r, n, {
349
+ const s = o.tabs.indexOf(n), i = s + (e === "left" ? -1 : 1);
350
+ s < 0 || i < 0 || i >= o.tabs.length || k(q(r, n, {
339
351
  group: t,
340
- index: a
352
+ index: i
341
353
  }), r, n, t, {
342
354
  focus: !0
343
355
  });
344
- }, ze = (t) => {
345
- const e = l(), r = at(e.root, t);
356
+ }, We = (t) => {
357
+ const e = u(), r = dt(e.root, t);
346
358
  if (!r) return 0;
347
- const o = new Set(fe(r)), n = R().groups.filter((g) => o.has(g.id));
359
+ const o = new Set(we(r)), n = G().groups.filter((p) => o.has(p.id));
348
360
  if (n.length === 0) return 0;
349
- const s = r.direction === "row" ? R().columns : R().rows;
350
- let a = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY;
351
- n.forEach((g) => {
352
- const p = r.direction === "row" ? g.column : g.row;
353
- a = Math.min(a, p[0]), i = Math.max(i, p[1]);
361
+ const s = r.direction === "row" ? G().columns : G().rows;
362
+ let i = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
363
+ n.forEach((p) => {
364
+ const w = r.direction === "row" ? p.column : p.row;
365
+ i = Math.min(i, w[0]), a = Math.max(a, w[1]);
354
366
  });
355
- let u = 0;
356
- for (let g = a; g < i; g += 1) u += s[g] ?? 0;
357
- return u;
358
- }, Vt = (t) => {
359
- const e = h?.getBoundingClientRect(), r = at(l().root, t);
360
- return !e || !r ? 0 : (r.direction === "row" ? e.width : e.height) * ze(t) / 100;
361
- }, Wt = (t) => t > 0 ? U() / t * 100 : 0, Yt = (t, e) => {
362
- const r = at(t.root, e);
367
+ let g = 0;
368
+ for (let p = i; p < a; p += 1) g += s[p] ?? 0;
369
+ return g;
370
+ }, Xt = (t) => {
371
+ const e = b?.getBoundingClientRect(), r = dt(u().root, t);
372
+ return !e || !r ? 0 : (r.direction === "row" ? e.width : e.height) * We(t) / 100;
373
+ }, Qt = (t) => t > 0 ? W() / t * 100 : 0, Jt = (t, e) => {
374
+ const r = dt(t.root, e);
363
375
  return {
364
376
  type: "resize",
365
377
  split: e,
366
378
  sizes: r ? [...r.sizes] : []
367
379
  };
368
- }, $e = (t, e, r, o) => {
369
- const n = b, s = se(n, t, e, r, o);
370
- s !== n && V(s, Yt(s, t));
371
- }, Ke = (t, e, r) => (o) => {
380
+ }, Ye = (t, e, r, o) => {
381
+ const n = v, s = fe(n, t, e, r, o);
382
+ s !== n && Z(s, Jt(s, t));
383
+ }, je = (t, e, r) => (o) => {
372
384
  if (o.defaultPrevented) return;
373
- const n = r === "vertical", s = o.key === (n ? "ArrowLeft" : "ArrowUp"), a = o.key === (n ? "ArrowRight" : "ArrowDown"), i = o.key === "Home" || o.key === "End";
374
- if (!s && !a && !i) return;
385
+ const n = r === "vertical", s = o.key === (n ? "ArrowLeft" : "ArrowUp"), i = o.key === (n ? "ArrowRight" : "ArrowDown"), a = o.key === "Home" || o.key === "End";
386
+ if (!s && !i && !a) return;
375
387
  o.preventDefault();
376
- const u = i ? o.key === "Home" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY : s ? -F() : F();
377
- $e(t, e, u, Wt(Vt(t)));
388
+ const g = a ? o.key === "Home" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY : s ? -z() : z();
389
+ Ye(t, e, g, Qt(Xt(t)));
378
390
  };
379
- let rt = null;
380
- const At = (t, e) => e === "vertical" ? t.clientX : t.clientY, jt = (t) => {
381
- const e = rt;
391
+ let it = null;
392
+ const xt = (t, e) => e === "vertical" ? t.clientX : t.clientY, It = (t) => {
393
+ const e = it;
382
394
  if (!e) return;
383
- const r = t - e.start, o = e.extentPx > 0 ? r / e.extentPx * 100 : 0, n = se(e.layout, e.split, e.index, o, e.min);
384
- n !== b && V(n, Yt(n, e.split));
385
- }, Tt = _r(jt, 1e3 / 60);
386
- pt(() => Tt.cancel()), $ || xt(() => {
387
- const t = kt();
395
+ const r = t - e.start, o = e.extentPx > 0 ? r / e.extentPx * 100 : 0, n = fe(e.layout, e.split, e.index, o, e.min);
396
+ n !== v && Z(n, Jt(n, e.split));
397
+ }, Ot = Fr(It, 1e3 / 60);
398
+ wt(() => Ot.cancel()), H || Ft(() => {
399
+ const t = Kt();
388
400
  if (!t) return;
389
401
  const e = document.body, r = e.style.cursor;
390
- e.style.cursor = t.orientation === "vertical" ? "col-resize" : "row-resize", pt(() => {
402
+ e.style.cursor = t.orientation === "vertical" ? "col-resize" : "row-resize", wt(() => {
391
403
  e.style.cursor = r;
392
404
  });
393
405
  });
394
- const Be = (t, e, r, o) => (n) => {
395
- if ($ || n.pointerType === "mouse" && n.button !== 0) return;
396
- const s = Vt(e);
397
- rt = {
406
+ const Ze = (t, e, r, o) => (n) => {
407
+ if (H || n.pointerType === "mouse" && n.button !== 0) return;
408
+ const s = Xt(e);
409
+ it = {
398
410
  key: t,
399
411
  split: e,
400
412
  index: r,
401
413
  orientation: o,
402
414
  pointerId: n.pointerId,
403
- start: At(n, o),
415
+ start: xt(n, o),
404
416
  extentPx: s,
405
- min: Wt(s),
406
- layout: b
407
- }, Ft({
417
+ min: Qt(s),
418
+ layout: v
419
+ }, Bt({
408
420
  key: t,
409
421
  orientation: o
410
422
  });
411
- const a = n.currentTarget;
412
- if (typeof a.setPointerCapture == "function")
423
+ const i = n.currentTarget;
424
+ if (typeof i.setPointerCapture == "function")
413
425
  try {
414
- a.setPointerCapture(n.pointerId);
426
+ i.setPointerCapture(n.pointerId);
415
427
  } catch {
416
428
  }
417
- }, He = (t) => (e) => {
418
- const r = rt;
419
- !r || r.pointerId !== e.pointerId || Tt(At(e, t));
420
- }, Zt = (t) => (e) => {
421
- const r = rt;
422
- !r || r.pointerId !== e.pointerId || (Tt.cancel(), jt(At(e, t)), rt = null, Ft(null), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
429
+ }, Xe = (t) => (e) => {
430
+ const r = it;
431
+ !r || r.pointerId !== e.pointerId || Ot(xt(e, t));
432
+ }, te = (t) => (e) => {
433
+ const r = it;
434
+ !r || r.pointerId !== e.pointerId || (Ot.cancel(), It(xt(e, t)), it = null, Bt(null), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
423
435
  };
424
- let Y = null, ft = null, z;
425
- pt(() => {
426
- z !== void 0 && cancelAnimationFrame(z);
436
+ let Q = null, ht = null, B;
437
+ wt(() => {
438
+ B !== void 0 && cancelAnimationFrame(B);
427
439
  });
428
- const ot = (t) => {
429
- ft !== t && (ft?.classList.remove("smwb-tab-item--drop-target"), ft = t, t?.classList.add("smwb-tab-item--drop-target"));
430
- }, Dt = () => {
431
- const t = Y?.group;
432
- Array.from(h?.querySelectorAll(":scope > .smwb-tab-groups__header") ?? []).find((r) => r.getAttribute("data-group-id") === t)?.querySelectorAll(".smwb-tab-item--drop-target").forEach((r) => {
433
- r !== ft && r.classList.remove("smwb-tab-item--drop-target");
440
+ const at = (t) => {
441
+ ht !== t && (ht?.classList.remove("smwb-tab-item--drop-target"), ht = t, t?.classList.add("smwb-tab-item--drop-target"));
442
+ }, Mt = () => {
443
+ const t = Q?.group;
444
+ Array.from(b?.querySelectorAll(":scope > .smwb-tab-groups__header") ?? []).find((r) => r.getAttribute("data-group-id") === t)?.querySelectorAll(".smwb-tab-item--drop-target").forEach((r) => {
445
+ r !== ht && r.classList.remove("smwb-tab-item--drop-target");
434
446
  });
435
- }, Xt = () => {
436
- Y = null, z !== void 0 && (cancelAnimationFrame(z), z = void 0), ot(null), I(null), tt(null), Nt(!1);
437
- }, Qt = (t) => {
438
- if (!h || !t || t.closest(".smwb-tab-groups") !== h) return null;
447
+ }, ee = () => {
448
+ Q = null, B !== void 0 && (cancelAnimationFrame(B), B = void 0), at(null), nt(null), st(null), zt(!1);
449
+ }, re = (t) => {
450
+ if (!b || !t || t.closest(".smwb-tab-groups") !== b) return null;
439
451
  const e = t.closest(".smwb-tab-groups__header");
440
452
  if (e) {
441
453
  const n = e.getAttribute("data-group-id");
442
454
  if (!n) return null;
443
- const s = le(t), a = s?.getAttribute("data-tab-id"), i = S(b, n)?.tabs ?? [], u = a ? i.indexOf(a) : -1;
455
+ const s = he(t), i = s?.getAttribute("data-tab-id"), a = T(v, n)?.tabs ?? [], g = i ? a.indexOf(i) : -1;
444
456
  return {
445
457
  kind: "row",
446
458
  group: n,
447
- index: u >= 0 ? u : null,
448
- item: u >= 0 && s ? ue(s) : null
459
+ index: g >= 0 ? g : null,
460
+ item: g >= 0 && s ? be(s) : null
449
461
  };
450
462
  }
451
463
  const r = t.closest(".smwb-tab-groups__drop-target");
@@ -456,57 +468,57 @@ function Ao(f) {
456
468
  group: o,
457
469
  element: r
458
470
  } : null;
459
- }, Jt = (t, e) => {
471
+ }, oe = (t, e) => {
460
472
  const r = t.getBoundingClientRect();
461
- return Gr(e.clientX - r.left, e.clientY - r.top, r.width, r.height);
462
- }, It = (t, e, r) => t !== e ? !0 : r === "center" ? !1 : (S(b, e)?.tabs.length ?? 0) >= 2, Ue = (t) => {
463
- if (Q(c.onDragStart, t), $) return;
473
+ return qr(e.clientX - r.left, e.clientY - r.top, r.width, r.height);
474
+ }, ne = (t, e, r) => t !== e ? !0 : r === "center" ? !1 : (T(v, e)?.tabs.length ?? 0) >= 2, Qe = (t) => {
475
+ if (rt(c.onDragStart, t), H) return;
464
476
  const e = t.target;
465
- if (!(e instanceof Element) || !h || e.closest(".smwb-tab-groups") !== h) return;
466
- const r = le(e), o = r?.getAttribute("data-tab-id");
477
+ if (!(e instanceof Element) || !b || e.closest(".smwb-tab-groups") !== b) return;
478
+ const r = he(e), o = r?.getAttribute("data-tab-id");
467
479
  if (!r || !o || r.getAttribute("aria-disabled") === "true") return;
468
- const n = Mt(r);
480
+ const n = kt(r);
469
481
  if (!n) return;
470
- const s = h.ownerDocument, a = s.activeElement;
471
- Y = {
482
+ const s = b.ownerDocument, i = s.activeElement;
483
+ Q = {
472
484
  tab: o,
473
485
  group: n,
474
- hadFocus: !!(a && a !== s.body && ue(r).contains(a))
486
+ hadFocus: !!(i && i !== s.body && be(r).contains(i))
475
487
  };
476
- const i = s.defaultView;
477
- i && (z = i.requestAnimationFrame(() => {
478
- z = void 0, Nt(!0);
488
+ const a = s.defaultView;
489
+ a && (B = a.requestAnimationFrame(() => {
490
+ B = void 0, zt(!0);
479
491
  }));
480
- }, qe = (t) => {
481
- Q(c.onDragOver, t);
482
- const e = Y;
492
+ }, Je = (t) => {
493
+ rt(c.onDragOver, t);
494
+ const e = Q;
483
495
  if (!e) return;
484
- const r = Qt(t.target);
496
+ const r = re(t.target);
485
497
  if (!r) {
486
- ot(null), Dt(), I(null), tt(null);
498
+ at(null), Mt(), nt(null), st(null);
487
499
  return;
488
500
  }
489
501
  if (r.kind === "row") {
490
502
  if (r.group === e.group) {
491
- ot(null), r.item?.classList.add("smwb-tab-item--drop-target");
503
+ at(null), r.item?.classList.add("smwb-tab-item--drop-target");
492
504
  return;
493
505
  }
494
- Dt(), t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), I(null), tt(null), ot(r.item);
506
+ Mt(), t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), nt(null), st(null), at(r.item);
495
507
  return;
496
508
  }
497
- ot(null), Dt();
498
- const o = Jt(r.element, t);
499
- if (!It(e.group, r.group, o)) {
500
- I(null), tt(null);
509
+ at(null), Mt();
510
+ const o = oe(r.element, t);
511
+ if (!ne(e.group, r.group, o)) {
512
+ nt(null), st(null);
501
513
  return;
502
514
  }
503
- t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), I(r.group), tt(o);
504
- }, Ve = (t) => {
505
- Q(c.onDrop, t);
506
- const e = Y;
515
+ t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), nt(r.group), st(o);
516
+ }, Ie = (t) => {
517
+ rt(c.onDrop, t);
518
+ const e = Q;
507
519
  if (!e) return;
508
- const r = t.defaultPrevented ? null : Qt(t.target), o = r && r.kind === "body" ? Jt(r.element, t) : null;
509
- if (Xt(), !r) return;
520
+ const r = t.defaultPrevented ? null : re(t.target), o = r && r.kind === "body" ? oe(r.element, t) : null;
521
+ if (ee(), !r) return;
510
522
  if (r.kind === "row") {
511
523
  if (r.group === e.group) return;
512
524
  const s = r.index === null ? {
@@ -515,33 +527,33 @@ function Ao(f) {
515
527
  group: r.group,
516
528
  index: r.index
517
529
  };
518
- P(K(b, e.tab, s), b, e.tab, e.group, {
530
+ k(q(v, e.tab, s), v, e.tab, e.group, {
519
531
  focus: e.hadFocus
520
532
  });
521
533
  return;
522
534
  }
523
- if (!o || !It(e.group, r.group, o)) return;
535
+ if (!o || !ne(e.group, r.group, o)) return;
524
536
  const n = o === "center" ? {
525
537
  group: r.group
526
538
  } : {
527
539
  group: r.group,
528
540
  edge: o
529
541
  };
530
- P(K(b, e.tab, n), b, e.tab, e.group, {
542
+ k(q(v, e.tab, n), v, e.tab, e.group, {
531
543
  edge: o === "center" ? void 0 : o,
532
544
  focus: e.hadFocus
533
545
  });
534
- }, We = (t) => {
535
- Q(c.onDragEnd, t), Xt();
536
- }, Ye = (t) => {
537
- Q(c.onFocusIn, t);
538
- const e = h, r = t.target;
546
+ }, tr = (t) => {
547
+ rt(c.onDragEnd, t), ee();
548
+ }, er = (t) => {
549
+ rt(c.onFocusIn, t);
550
+ const e = b, r = t.target;
539
551
  if (!e || !(r instanceof HTMLElement)) return;
540
- const o = et;
541
- if (et = ae(r) === e ? r : null, o instanceof HTMLElement && o.localName === "iframe" && o !== r && !Et) {
542
- const s = Hr(e, o, r);
543
- if (s !== null && s === lt) {
544
- dt = !0, s !== r && s.focus({
552
+ const o = j;
553
+ if (j = ge(r) === e ? r : null, M = j === null ? null : jr(e, r), o instanceof HTMLElement && o.localName === "iframe" && o !== r && !_t) {
554
+ const s = Zr(e, o, r);
555
+ if (s !== null && s === mt) {
556
+ bt = !0, s !== r && s.focus({
545
557
  preventScroll: !0
546
558
  });
547
559
  return;
@@ -551,74 +563,81 @@ function Ao(f) {
551
563
  return;
552
564
  }
553
565
  }
554
- if (r === lt) {
555
- Ze();
566
+ if (r === mt) {
567
+ or();
556
568
  return;
557
569
  }
558
- const n = ie(e, r);
559
- !n || b.activeGroup === n || V(Mr(b, n), {
570
+ const n = pe(e, r);
571
+ !n || v.activeGroup === n || Z(Nr(v, n), {
560
572
  type: "activate",
561
573
  group: n
562
574
  });
563
- }, je = (t) => {
564
- if (Q(c.onKeyDown, t), t.defaultPrevented || t.key !== "Tab" || t.altKey || t.ctrlKey || t.metaKey || t.isComposing) return;
565
- const e = h, r = e ? ht(e.ownerDocument) : null;
566
- if (!e || !r || !ce(e, r)) return;
567
- const o = Ur(e, r, t.shiftKey ? -1 : 1);
568
- o && (o.element === lt && (dt = !0), et = null, o.prevent ? (t.preventDefault(), o.element.focus()) : o.element.focus({
575
+ }, rr = (t) => {
576
+ if (rt(c.onKeyDown, t), t.defaultPrevented || t.key !== "Tab" || t.altKey || t.ctrlKey || t.metaKey || t.isComposing) return;
577
+ const e = b, r = e ? lt(e.ownerDocument) : null;
578
+ if (!e || !r || !me(e, r)) return;
579
+ const o = Xr(e, r, t.shiftKey ? -1 : 1);
580
+ o && (o.element === mt && (bt = !0), j = null, o.prevent ? (t.preventDefault(), o.element.focus()) : o.element.focus({
569
581
  preventScroll: !0
570
582
  }));
571
583
  };
572
- vr(() => {
573
- const t = h, e = t?.ownerDocument.defaultView;
584
+ Dr(() => {
585
+ const t = b, e = t?.ownerDocument.defaultView;
574
586
  if (!t || !e) return;
575
587
  let r;
576
588
  const o = () => {
577
- Et = !0, e.clearTimeout(r), r = e.setTimeout(() => {
578
- Et = !1;
589
+ _t = !0, e.clearTimeout(r), r = e.setTimeout(() => {
590
+ _t = !1;
579
591
  }, 0);
580
- }, n = (a) => {
581
- a.relatedTarget instanceof Node && !t.contains(a.relatedTarget) && (et = null);
592
+ }, n = (i) => {
593
+ if (i.relatedTarget instanceof Node && !t.contains(i.relatedTarget)) {
594
+ j = null, M = null;
595
+ return;
596
+ }
597
+ const a = M;
598
+ i.relatedTarget === null && a?.element === i.target && queueMicrotask(() => {
599
+ M === a && a.element.isConnected && (M = null);
600
+ });
582
601
  }, s = () => {
583
- const a = t.ownerDocument.activeElement;
584
- a instanceof e.HTMLIFrameElement && ae(a) === t && (et = a);
602
+ const i = t.ownerDocument.activeElement;
603
+ i instanceof e.HTMLIFrameElement && ge(i) === t && (j = i);
585
604
  };
586
- t.addEventListener("pointerdown", o, !0), t.addEventListener("focusout", n), e.addEventListener("blur", s), pt(() => {
605
+ t.addEventListener("pointerdown", o, !0), t.addEventListener("focusout", n), e.addEventListener("blur", s), wt(() => {
587
606
  e.clearTimeout(r), t.removeEventListener("pointerdown", o, !0), t.removeEventListener("focusout", n), e.removeEventListener("blur", s);
588
607
  });
589
608
  });
590
- const Ze = () => {
591
- if (dt || !h) return;
592
- const t = qr(h);
593
- t && Vr(t);
594
- }, Xe = () => Dr(c.style, {
595
- "grid-template-columns": Pr(R()),
596
- "grid-template-rows": Lr(R())
597
- }), Qe = (t) => {
598
- const e = R().groups.find((r) => r.id === t);
599
- return e ? Fr(e) : "auto";
600
- }, Je = (t) => {
601
- const e = vt().get(t), r = e === void 0 ? void 0 : R().groups.find((o) => o.id === e);
602
- return r ? ne(r) : "auto";
603
- }, Ie = (t, e) => R().separators.find((r) => r.split === t && r.index === e), tr = (t, e) => {
604
- const r = at(l().root, t);
609
+ const or = () => {
610
+ if (bt || !b) return;
611
+ const t = Qr(b);
612
+ t && Jr(t);
613
+ }, nr = () => Rr(c.style, {
614
+ "grid-template-columns": zr(G()),
615
+ "grid-template-rows": $r(G())
616
+ }), sr = (t) => {
617
+ const e = G().groups.find((r) => r.id === t);
618
+ return e ? Hr(e) : "auto";
619
+ }, ir = (t) => {
620
+ const e = Et().get(t), r = e === void 0 ? void 0 : G().groups.find((o) => o.id === e);
621
+ return r ? de(r) : "auto";
622
+ }, ar = (t, e) => G().separators.find((r) => r.split === t && r.index === e), cr = (t, e) => {
623
+ const r = dt(u().root, t);
605
624
  if (!r) return 0;
606
625
  const o = r.sizes[e] ?? 0, n = o + (r.sizes[e + 1] ?? 0);
607
626
  return n > 0 ? Math.round(o / n * 100) : 0;
608
- }, er = (t) => {
609
- const e = De() === t ? Ce() : null;
627
+ }, ur = (t) => {
628
+ const e = Re() === t ? Le() : null;
610
629
  return e ? `smwb-tab-groups__drop-target--${e}` : void 0;
611
- }, rr = wr(() => c.empty), or = (t, e) => {
630
+ }, lr = ue(() => c.empty), dr = (t, e) => {
612
631
  const r = () => c.getTab(e), o = m(() => r()?.closable !== !1), n = m(() => {
613
- const a = r(), i = {};
614
- return a?.disabled && (i.disabled = !0), a?.closeLabel !== void 0 && (i.closeLabel = a.closeLabel), a?.actions !== void 0 && (i.actions = a.actions), i;
615
- }), s = m(() => r()?.disabled ? void 0 : ro);
616
- return w(Er, re(n, {
632
+ const i = r(), a = {};
633
+ return i?.disabled && (a.disabled = !0), i?.closeLabel !== void 0 && (a.closeLabel = i.closeLabel), i?.actions !== void 0 && (a.actions = i.actions), c.fit === !0 && i?.title !== void 0 && (a.title = i.title), a;
634
+ }), s = m(() => r()?.disabled ? void 0 : fo);
635
+ return S(xr, ae(n, {
617
636
  get id() {
618
- return B(e);
637
+ return U(e);
619
638
  },
620
639
  get "aria-controls"() {
621
- return L(e);
640
+ return P(e);
622
641
  },
623
642
  "data-tab-id": e,
624
643
  get "aria-keyshortcuts"() {
@@ -633,120 +652,141 @@ function Ao(f) {
633
652
  get closable() {
634
653
  return o();
635
654
  },
636
- onClose: (a, i) => Pe(e, a, i)
655
+ onClose: (i, a) => Be(e, i, a)
637
656
  }));
638
- }, nr = (t) => {
639
- const [e, r] = N(null), o = () => S(l(), t), n = () => o()?.tabs ?? [], s = () => {
640
- const a = o()?.active;
641
- if (a == null) return 0;
642
- const i = n().indexOf(a);
643
- return i < 0 ? 0 : i;
644
- };
657
+ }, fr = (t) => {
658
+ const [e, r] = N(null), o = () => T(u(), t), n = () => o()?.tabs ?? [], s = () => {
659
+ const h = o()?.active;
660
+ if (h == null) return 0;
661
+ const f = n().indexOf(h);
662
+ return f < 0 ? 0 : f;
663
+ }, i = m(() => At(t)), a = m(() => u().activeGroup === t), g = {
664
+ get index() {
665
+ return i();
666
+ },
667
+ get count() {
668
+ return $t();
669
+ },
670
+ get active() {
671
+ return a();
672
+ }
673
+ }, p = ue(() => c.stripActions?.(g)), w = () => p.toArray().some(po);
645
674
  return (() => {
646
- var a = jr();
647
- return Z(a, "keydown", Ne(t), !0), v(a, "data-group-id", t), _(a, w(Sr, {
675
+ var h = oo();
676
+ return I(h, "keydown", He(t), !0), E(h, "data-group-id", t), O(h, S(_r, {
648
677
  class: "smwb-tab-groups__tabs",
649
678
  get value() {
650
679
  return s();
651
680
  },
652
681
  get onChange() {
653
- return Me(t);
682
+ return ze(t);
654
683
  },
655
684
  get onReorder() {
656
- return Le(t);
685
+ return Ke(t);
657
686
  },
658
687
  get "aria-label"() {
659
- return d().group(Pt(t) + 1, ge());
688
+ return d().group(At(t) + 1, $t());
660
689
  },
661
690
  scrollable: !0,
662
691
  overflowMenu: !0,
663
692
  get dense() {
664
693
  return c.dense === !0;
665
694
  },
695
+ get fit() {
696
+ return c.fit === !0;
697
+ },
666
698
  get children() {
667
- return w(oe, {
699
+ return S(le, {
668
700
  get each() {
669
701
  return n();
670
702
  },
671
- children: (i) => or(t, i)
703
+ children: (f) => dr(t, f)
672
704
  });
673
705
  }
674
- }), null), _(a, w(st, {
706
+ }), null), O(h, S(tt, {
707
+ get when() {
708
+ return w();
709
+ },
710
+ get children() {
711
+ var f = eo();
712
+ return O(f, p), f;
713
+ }
714
+ }), null), O(h, S(tt, {
675
715
  get when() {
676
- return it();
716
+ return ft();
677
717
  },
678
718
  get children() {
679
719
  return [(() => {
680
- var i = Yr();
681
- return i.$$keydown = (u) => Ge(t, u), i.$$click = (u) => Fe(t, u), Ct((u) => r(() => u), i), _(i, w(Wr, {
720
+ var f = ro();
721
+ return f.$$keydown = (y) => Ve(t, y), f.$$click = (y) => Ue(t, y), Rt((y) => r(() => y), f), O(f, S(to, {
682
722
  name: "more_vert",
683
723
  size: 20
684
- })), j((u) => {
685
- var g = d().groupActions, p = ct() === t, C = ct() === t ? H(t) : void 0;
686
- return g !== u.e && v(i, "aria-label", u.e = g), p !== u.t && v(i, "aria-expanded", u.t = p), C !== u.a && v(i, "aria-controls", u.a = C), u;
724
+ })), J((y) => {
725
+ var ct = d().groupActions, ut = gt() === t, ie = gt() === t ? V(t) : void 0;
726
+ return ct !== y.e && E(f, "aria-label", y.e = ct), ut !== y.t && E(f, "aria-expanded", y.t = ut), ie !== y.a && E(f, "aria-controls", y.a = ie), y;
687
727
  }, {
688
728
  e: void 0,
689
729
  t: void 0,
690
730
  a: void 0
691
- }), i;
692
- })(), w(Ar, {
731
+ }), f;
732
+ })(), S(Or, {
693
733
  get id() {
694
- return H(t);
734
+ return V(t);
695
735
  },
696
736
  get anchorElement() {
697
737
  return e();
698
738
  },
699
739
  get isOpen() {
700
- return ct() === t;
740
+ return gt() === t;
701
741
  },
702
- onClose: () => ut(null),
742
+ onClose: () => pt(null),
703
743
  placement: "bottom-end",
704
744
  get children() {
705
- return [w(X, {
745
+ return [S(et, {
706
746
  get disabled() {
707
- return !Bt(t);
747
+ return !Wt(t);
708
748
  },
709
- onClick: () => W(t, "splitRight"),
749
+ onClick: () => X(t, "splitRight"),
710
750
  get children() {
711
751
  return d().splitRight;
712
752
  }
713
- }), w(X, {
753
+ }), S(et, {
714
754
  get disabled() {
715
- return !Bt(t);
755
+ return !Wt(t);
716
756
  },
717
- onClick: () => W(t, "splitDown"),
757
+ onClick: () => X(t, "splitDown"),
718
758
  get children() {
719
759
  return d().splitDown;
720
760
  }
721
- }), w(X, {
761
+ }), S(et, {
722
762
  get disabled() {
723
- return !Ut(t, -1);
763
+ return !jt(t, -1);
724
764
  },
725
- onClick: () => W(t, "previous"),
765
+ onClick: () => X(t, "previous"),
726
766
  get children() {
727
767
  return d().moveToPreviousGroup;
728
768
  }
729
- }), w(X, {
769
+ }), S(et, {
730
770
  get disabled() {
731
- return !Ut(t, 1);
771
+ return !jt(t, 1);
732
772
  },
733
- onClick: () => W(t, "next"),
773
+ onClick: () => X(t, "next"),
734
774
  get children() {
735
775
  return d().moveToNextGroup;
736
776
  }
737
- }), w(X, {
777
+ }), S(et, {
738
778
  get disabled() {
739
- return !qt(t, -1);
779
+ return !Zt(t, -1);
740
780
  },
741
- onClick: () => W(t, "left"),
781
+ onClick: () => X(t, "left"),
742
782
  get children() {
743
783
  return d().moveLeft;
744
784
  }
745
- }), w(X, {
785
+ }), S(et, {
746
786
  get disabled() {
747
- return !qt(t, 1);
787
+ return !Zt(t, 1);
748
788
  },
749
- onClick: () => W(t, "right"),
789
+ onClick: () => X(t, "right"),
750
790
  get children() {
751
791
  return d().moveRight;
752
792
  }
@@ -754,31 +794,31 @@ function Ao(f) {
754
794
  }
755
795
  })];
756
796
  }
757
- }), null), j((i) => {
758
- var u = mt("smwb-tab-groups__header", {
759
- "smwb-tab-groups__header--active": l().activeGroup === t
760
- }), g = x(t), p = Qe(t);
761
- return u !== i.e && _t(a, i.e = u), g !== i.t && v(a, "id", i.t = g), p !== i.a && gt(a, "grid-area", i.a = p), i;
797
+ }), null), J((f) => {
798
+ var y = yt("smwb-tab-groups__header", {
799
+ "smwb-tab-groups__header--active": u().activeGroup === t
800
+ }), ct = L(t), ut = sr(t);
801
+ return y !== f.e && Lt(h, f.e = y), ct !== f.t && E(h, "id", f.t = ct), ut !== f.a && vt(h, "grid-area", f.a = ut), f;
762
802
  }, {
763
803
  e: void 0,
764
804
  t: void 0,
765
805
  a: void 0
766
- }), a;
806
+ }), h;
767
807
  })();
768
- }, sr = (t) => {
769
- const e = m(() => ye().has(t)), r = m(() => me().has(t)), o = m(() => vt().get(t) ?? "");
808
+ }, gr = (t) => {
809
+ const e = m(() => Ce().has(t)), r = m(() => Se().has(t)), o = m(() => Et().get(t) ?? "");
770
810
  return (() => {
771
- var n = Xr();
772
- return v(n, "data-tab-id", t), _(n, w(st, {
811
+ var n = so();
812
+ return E(n, "data-tab-id", t), O(n, S(tt, {
773
813
  get when() {
774
814
  return e();
775
815
  },
776
816
  get children() {
777
- return [fr(() => c.renderPanel(t)), Zr()];
817
+ return [yr(() => c.renderPanel(t)), no()];
778
818
  }
779
- })), j((s) => {
780
- var a = L(t), i = B(t), u = r() ? void 0 : !0, g = o(), p = Je(t);
781
- return a !== s.e && v(n, "id", s.e = a), i !== s.t && v(n, "aria-labelledby", s.t = i), u !== s.a && (n.hidden = s.a = u), g !== s.o && v(n, "data-group-id", s.o = g), p !== s.i && gt(n, "grid-area", s.i = p), s;
819
+ })), J((s) => {
820
+ var i = P(t), a = U(t), g = r() ? void 0 : !0, p = o(), w = ir(t);
821
+ return i !== s.e && E(n, "id", s.e = i), a !== s.t && E(n, "aria-labelledby", s.t = a), g !== s.a && (n.hidden = s.a = g), p !== s.o && E(n, "data-group-id", s.o = p), w !== s.i && vt(n, "grid-area", s.i = w), s;
782
822
  }, {
783
823
  e: void 0,
784
824
  t: void 0,
@@ -787,18 +827,18 @@ function Ao(f) {
787
827
  i: void 0
788
828
  }), n;
789
829
  })();
790
- }, ar = (t, e, r) => {
791
- const o = () => Ie(e, r), n = () => o()?.orientation ?? "vertical", s = () => {
792
- const a = o();
793
- return a ? Kr(a) : "auto";
830
+ }, pr = (t, e, r) => {
831
+ const o = () => ar(e, r), n = () => o()?.orientation ?? "vertical", s = () => {
832
+ const i = o();
833
+ return i ? Wr(i) : "auto";
794
834
  };
795
835
  return (() => {
796
- var a = Qr();
797
- return Z(a, "pointercancel", Zt(n())), Z(a, "pointerup", Zt(n()), !0), Z(a, "pointermove", He(n()), !0), Z(a, "pointerdown", Be(t, e, r, n()), !0), Z(a, "keydown", Ke(e, r, n()), !0), v(a, "data-split-id", e), v(a, "data-index", r), j((i) => {
798
- var u = mt("smwb-tab-groups__separator", `smwb-tab-groups__separator--${n()}`, {
799
- "smwb-tab-groups__separator--dragging": kt()?.key === t
800
- }), g = O(e, r), p = n(), C = tr(e, r), nt = d().resize, ee = s();
801
- return u !== i.e && _t(a, i.e = u), g !== i.t && v(a, "id", i.t = g), p !== i.a && v(a, "aria-orientation", i.a = p), C !== i.o && v(a, "aria-valuenow", i.o = C), nt !== i.i && v(a, "aria-label", i.i = nt), ee !== i.n && gt(a, "grid-area", i.n = ee), i;
836
+ var i = io();
837
+ return I(i, "pointercancel", te(n())), I(i, "pointerup", te(n()), !0), I(i, "pointermove", Xe(n()), !0), I(i, "pointerdown", Ze(t, e, r, n()), !0), I(i, "keydown", je(e, r, n()), !0), E(i, "data-split-id", e), E(i, "data-index", r), J((a) => {
838
+ var g = yt("smwb-tab-groups__separator", `smwb-tab-groups__separator--${n()}`, {
839
+ "smwb-tab-groups__separator--dragging": Kt()?.key === t
840
+ }), p = F(e, r), w = n(), h = cr(e, r), f = d().resize, y = s();
841
+ return g !== a.e && Lt(i, a.e = g), p !== a.t && E(i, "id", a.t = p), w !== a.a && E(i, "aria-orientation", a.a = w), h !== a.o && E(i, "aria-valuenow", a.o = h), f !== a.i && E(i, "aria-label", a.i = f), y !== a.n && vt(i, "grid-area", a.n = y), a;
802
842
  }, {
803
843
  e: void 0,
804
844
  t: void 0,
@@ -806,65 +846,65 @@ function Ao(f) {
806
846
  o: void 0,
807
847
  i: void 0,
808
848
  n: void 0
809
- }), a;
849
+ }), i;
810
850
  })();
811
- }, ir = (t) => {
851
+ }, mr = (t) => {
812
852
  const e = t.lastIndexOf(":");
813
- return ar(t, t.slice(2, e), Number(t.slice(e + 1)));
814
- }, cr = m(Ot(() => q() ? [] : be(), nr)), ur = m(Ot(() => q() ? [] : he(), ir)), lr = m(Ot(() => q() ? [] : ve(), sr)), te = m(() => [...cr(), ...ur(), ...lr()]);
853
+ return pr(t, t.slice(2, e), Number(t.slice(e + 1)));
854
+ }, br = m(Gt(() => Y() ? [] : Ee(), fr)), hr = m(Gt(() => Y() ? [] : Ae(), mr)), vr = m(Gt(() => Y() ? [] : Te(), gr)), se = m(() => [...br(), ...hr(), ...vr()]);
815
855
  return (() => {
816
- var t = to(), e = t.firstChild, r = Tr(c.ref, (o) => {
817
- h = o, !$ && yr((n) => {
818
- const s = te();
819
- return so(o, s, n), s;
856
+ var t = uo(), e = t.firstChild, r = Mr(c.ref, (o) => {
857
+ b = o, !H && Cr((n) => {
858
+ const s = se();
859
+ return bo(o, s, n), s;
820
860
  }, []);
821
861
  });
822
- return typeof r == "function" && Ct(r, t), dr(t, re(T, {
862
+ return typeof r == "function" && Rt(r, t), wr(t, ae(_, {
823
863
  get id() {
824
- return D();
864
+ return x();
825
865
  },
826
866
  get class() {
827
- return mt("smwb-tab-groups", {
828
- "smwb-tab-groups--split": pe()
867
+ return yt("smwb-tab-groups", {
868
+ "smwb-tab-groups--split": ye()
829
869
  }, c.class);
830
870
  },
831
871
  get style() {
832
- return Xe();
872
+ return nr();
833
873
  },
834
874
  get "data-testid"() {
835
875
  return c["data-testid"] ?? "tab-groups";
836
876
  },
837
877
  get "aria-owns"() {
838
- return we();
878
+ return De();
839
879
  },
840
- onKeyDown: je,
841
- onDragStart: Ue,
842
- onDragOver: qe,
843
- onDrop: Ve,
844
- onDragEnd: We,
845
- onFocusIn: Ye
846
- }), !1, !0), _(t, () => $ ? te() : void 0, e), _(t, w(st, {
880
+ onKeyDown: rr,
881
+ onDragStart: Qe,
882
+ onDragOver: Je,
883
+ onDrop: Ie,
884
+ onDragEnd: tr,
885
+ onFocusIn: er
886
+ }), !1, !0), O(t, () => H ? se() : void 0, e), O(t, S(tt, {
847
887
  get when() {
848
- return q();
888
+ return Y();
849
889
  },
850
890
  get children() {
851
- var o = Jr();
852
- return _(o, rr), o;
891
+ var o = ao();
892
+ return O(o, lr), o;
853
893
  }
854
- }), e), _(t, w(st, {
894
+ }), e), O(t, S(tt, {
855
895
  get when() {
856
- return Te();
896
+ return Me();
857
897
  },
858
898
  get children() {
859
- return w(oe, {
899
+ return S(le, {
860
900
  get each() {
861
- return R().groups;
901
+ return G().groups;
862
902
  },
863
903
  children: (o) => (() => {
864
- var n = eo();
865
- return j((s) => {
866
- var a = mt("smwb-tab-groups__drop-target", er(o.id)), i = o.id, u = ne(o);
867
- return a !== s.e && _t(n, s.e = a), i !== s.t && v(n, "data-group-id", s.t = i), u !== s.a && gt(n, "grid-area", s.a = u), s;
904
+ var n = lo();
905
+ return J((s) => {
906
+ var i = yt("smwb-tab-groups__drop-target", ur(o.id)), a = o.id, g = de(o);
907
+ return i !== s.e && Lt(n, s.e = i), a !== s.t && E(n, "data-group-id", s.t = a), g !== s.a && vt(n, "grid-area", s.a = g), s;
868
908
  }, {
869
909
  e: void 0,
870
910
  t: void 0,
@@ -873,21 +913,21 @@ function Ao(f) {
873
913
  })()
874
914
  });
875
915
  }
876
- }), e), _(t, w(st, {
916
+ }), e), O(t, S(tt, {
877
917
  get when() {
878
- return !q();
918
+ return !Y();
879
919
  },
880
920
  get children() {
881
- var o = Ir();
921
+ var o = co();
882
922
  return o.addEventListener("blur", () => {
883
- dt = !1;
884
- }), Ct((n) => lt = n, o), o;
923
+ bt = !1;
924
+ }), Rt((n) => mt = n, o), o;
885
925
  }
886
- }), e), v(e, "aria-atomic", !0), _(e, Ee), j(() => v(e, "id", J())), t;
926
+ }), e), E(e, "aria-atomic", !0), O(e, xe), J(() => E(e, "id", ot())), t;
887
927
  })();
888
928
  }
889
- gr(["keydown", "click", "pointerdown", "pointermove", "pointerup"]);
929
+ Sr(["keydown", "click", "pointerdown", "pointermove", "pointerup"]);
890
930
  export {
891
- Ao as TabGroups
931
+ Fo as TabGroups
892
932
  };
893
933
  //# sourceMappingURL=tabGroups.js.map