@jimka/typescript-ui 0.7.0 → 0.8.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 (296) hide show
  1. package/dist/lib/AbstractInput-Dt9ooHjo.js +2 -0
  2. package/dist/lib/AbstractInput-Dt9ooHjo.js.map +1 -0
  3. package/dist/lib/AccordionConstraints-DahZEfEp.js +2 -0
  4. package/dist/lib/AccordionConstraints-DahZEfEp.js.map +1 -0
  5. package/dist/lib/{Anchor-iZhsvMlT.js → Anchor-DdYgyn2V.js} +2 -2
  6. package/dist/lib/{Anchor-iZhsvMlT.js.map → Anchor-DdYgyn2V.js.map} +1 -1
  7. package/dist/lib/{AnimatedDropdown-D0RhVgv3.js → AnimatedDropdown-_KhHzX5D.js} +2 -2
  8. package/dist/lib/AnimatedDropdown-_KhHzX5D.js.map +1 -0
  9. package/dist/lib/Border-BELbqMDJ.js +2 -0
  10. package/dist/lib/Border-BELbqMDJ.js.map +1 -0
  11. package/dist/lib/Button-CKzjQyqA.js +2 -0
  12. package/dist/lib/Button-CKzjQyqA.js.map +1 -0
  13. package/dist/lib/{Card-C20k2YHU.js → Card-CAp7LcB5.js} +2 -2
  14. package/dist/lib/{Card-C20k2YHU.js.map → Card-CAp7LcB5.js.map} +1 -1
  15. package/dist/lib/Checkbox-CvAZJ4_T.js +2 -0
  16. package/dist/lib/Checkbox-CvAZJ4_T.js.map +1 -0
  17. package/dist/lib/CodeEditor-DoGGdL1Y.js +2 -0
  18. package/dist/lib/CodeEditor-DoGGdL1Y.js.map +1 -0
  19. package/dist/lib/ComboBox-DgjMnpdh.js +2 -0
  20. package/dist/lib/ComboBox-DgjMnpdh.js.map +1 -0
  21. package/dist/lib/Component-YrLXKJZS.js +2 -0
  22. package/dist/lib/Component-YrLXKJZS.js.map +1 -0
  23. package/dist/lib/Container-C5cxnioS.js +2 -0
  24. package/dist/lib/{Container-FWRjgF6T.js.map → Container-C5cxnioS.js.map} +1 -1
  25. package/dist/lib/DOM-DDhDN8lQ.js +2 -0
  26. package/dist/lib/DOM-DDhDN8lQ.js.map +1 -0
  27. package/dist/lib/Diagnostics-MI6Yw-3E.js +2 -0
  28. package/dist/lib/Diagnostics-MI6Yw-3E.js.map +1 -0
  29. package/dist/lib/Dialog-CXQXRQQK.js +2 -0
  30. package/dist/lib/Dialog-CXQXRQQK.js.map +1 -0
  31. package/dist/lib/DragManager-D5pBaPPg.js +2 -0
  32. package/dist/lib/DragManager-D5pBaPPg.js.map +1 -0
  33. package/dist/lib/{FieldDecorator-DyPX8CFh.js → FieldDecorator-37IgKHHm.js} +2 -2
  34. package/dist/lib/{FieldDecorator-DyPX8CFh.js.map → FieldDecorator-37IgKHHm.js.map} +1 -1
  35. package/dist/lib/{Fit-CaPMj7Up.js → Fit-amTWlJM2.js} +2 -2
  36. package/dist/lib/{Fit-CaPMj7Up.js.map → Fit-amTWlJM2.js.map} +1 -1
  37. package/dist/lib/{FloatingPanel-Dsy_vJxi.js → FloatingPanel-CwsFPYbc.js} +2 -2
  38. package/dist/lib/{FloatingPanel-Dsy_vJxi.js.map → FloatingPanel-CwsFPYbc.js.map} +1 -1
  39. package/dist/lib/Glyph-Cof7BxfJ.js +2 -0
  40. package/dist/lib/Glyph-Cof7BxfJ.js.map +1 -0
  41. package/dist/lib/{Grid-ft_UUpj8.js → Grid-BQZ4UIUH.js} +2 -2
  42. package/dist/lib/{Grid-ft_UUpj8.js.map → Grid-BQZ4UIUH.js.map} +1 -1
  43. package/dist/lib/GridConstraints-BkXa62z0.js +2 -0
  44. package/dist/lib/GridConstraints-BkXa62z0.js.map +1 -0
  45. package/dist/lib/{Header-Osm3IjDw.js → Header-Cj33ABP1.js} +2 -2
  46. package/dist/lib/{Header-Osm3IjDw.js.map → Header-Cj33ABP1.js.map} +1 -1
  47. package/dist/lib/{IconText-BBaYJ2Fx.js → IconText-Dp64iq_q.js} +2 -2
  48. package/dist/lib/{IconText-BBaYJ2Fx.js.map → IconText-Dp64iq_q.js.map} +1 -1
  49. package/dist/lib/LabeledGrid-Dpelrc1k.js +2 -0
  50. package/dist/lib/LabeledGrid-Dpelrc1k.js.map +1 -0
  51. package/dist/lib/LayoutSerialization-DgLJSuew.js +2 -0
  52. package/dist/lib/LayoutSerialization-DgLJSuew.js.map +1 -0
  53. package/dist/lib/Link-DE8tE3u3.js +2 -0
  54. package/dist/lib/Link-DE8tE3u3.js.map +1 -0
  55. package/dist/lib/List-TfgHScl3.js +2 -0
  56. package/dist/lib/List-TfgHScl3.js.map +1 -0
  57. package/dist/lib/ListenerBag-DYRl4TSb.js +2 -0
  58. package/dist/lib/ListenerBag-DYRl4TSb.js.map +1 -0
  59. package/dist/lib/{MemoryStore-DhPoU-7X.js → MemoryStore-ByGDEKYI.js} +2 -2
  60. package/dist/lib/{MemoryStore-DhPoU-7X.js.map → MemoryStore-ByGDEKYI.js.map} +1 -1
  61. package/dist/lib/Menu-BCQISKiQ.js +2 -0
  62. package/dist/lib/Menu-BCQISKiQ.js.map +1 -0
  63. package/dist/lib/{MenuButton-BqCT-1yv.js → MenuButton-BO4y3jf2.js} +2 -2
  64. package/dist/lib/{MenuButton-BqCT-1yv.js.map → MenuButton-BO4y3jf2.js.map} +1 -1
  65. package/dist/lib/{OverlayFade-CuEXgimf.js → OverlayFade-C1yQKffL.js} +2 -2
  66. package/dist/lib/{OverlayFade-CuEXgimf.js.map → OverlayFade-C1yQKffL.js.map} +1 -1
  67. package/dist/lib/{Panel-CtViePqY.js → Panel-DlsVVuvn.js} +2 -2
  68. package/dist/lib/{Panel-CtViePqY.js.map → Panel-DlsVVuvn.js.map} +1 -1
  69. package/dist/lib/{Position-BIEU1Eze.js → Position-DWR1nIpA.js} +2 -2
  70. package/dist/lib/{Position-BIEU1Eze.js.map → Position-DWR1nIpA.js.map} +1 -1
  71. package/dist/lib/ProgressSpinner-BI9tFIVm.js +2 -0
  72. package/dist/lib/ProgressSpinner-BI9tFIVm.js.map +1 -0
  73. package/dist/lib/RadioButton-BxcuFChp.js +2 -0
  74. package/dist/lib/RadioButton-BxcuFChp.js.map +1 -0
  75. package/dist/lib/RadioMenuRow-B2bthoxj.js +2 -0
  76. package/dist/lib/RadioMenuRow-B2bthoxj.js.map +1 -0
  77. package/dist/lib/{RovingTabIndex--w28AnXc.js → RovingTabIndex-BttlsARv.js} +2 -2
  78. package/dist/lib/{RovingTabIndex--w28AnXc.js.map → RovingTabIndex-BttlsARv.js.map} +1 -1
  79. package/dist/lib/Scrollbar-orAWHWap.js +2 -0
  80. package/dist/lib/Scrollbar-orAWHWap.js.map +1 -0
  81. package/dist/lib/SelectableText-BbS_lRzY.js +2 -0
  82. package/dist/lib/SelectableText-BbS_lRzY.js.map +1 -0
  83. package/dist/lib/Slider-BvXc-cx5.js +2 -0
  84. package/dist/lib/Slider-BvXc-cx5.js.map +1 -0
  85. package/dist/lib/Spacer-C6faKe1V.js +2 -0
  86. package/dist/lib/Spacer-C6faKe1V.js.map +1 -0
  87. package/dist/lib/StyleTraits-CAtzeyRR.js +2 -0
  88. package/dist/lib/StyleTraits-CAtzeyRR.js.map +1 -0
  89. package/dist/lib/TabButton-BQDaBszs.js +2 -0
  90. package/dist/lib/TabButton-BQDaBszs.js.map +1 -0
  91. package/dist/lib/TabCloseButton-B-iLVPGZ.js +2 -0
  92. package/dist/lib/TabCloseButton-B-iLVPGZ.js.map +1 -0
  93. package/dist/lib/Table-3McEw5gr.js +7 -0
  94. package/dist/lib/Table-3McEw5gr.js.map +1 -0
  95. package/dist/lib/Text-CGFXPhHD.js +2 -0
  96. package/dist/lib/Text-CGFXPhHD.js.map +1 -0
  97. package/dist/lib/Tooltip-DgRHQZhL.js +3 -0
  98. package/dist/lib/Tooltip-DgRHQZhL.js.map +1 -0
  99. package/dist/lib/Tree-Bq2pjjAz.js +2 -0
  100. package/dist/lib/Tree-Bq2pjjAz.js.map +1 -0
  101. package/dist/lib/{VBox-DVe4UXwX.js → VBox-hFIZAEpT.js} +2 -2
  102. package/dist/lib/{VBox-DVe4UXwX.js.map → VBox-hFIZAEpT.js.map} +1 -1
  103. package/dist/lib/{VirtualScroller-ggPTCQb0.js → VirtualScroller-Csa3GBSM.js} +2 -2
  104. package/dist/lib/{VirtualScroller-ggPTCQb0.js.map → VirtualScroller-Csa3GBSM.js.map} +1 -1
  105. package/dist/lib/Window-CQ14_65z.js +2 -0
  106. package/dist/lib/Window-CQ14_65z.js.map +1 -0
  107. package/dist/lib/component/button.es.js +1 -1
  108. package/dist/lib/component/button.es.js.map +1 -1
  109. package/dist/lib/component/chart.es.js +1 -1
  110. package/dist/lib/component/chart.es.js.map +1 -1
  111. package/dist/lib/component/container.es.js +1 -1
  112. package/dist/lib/component/container.es.js.map +1 -1
  113. package/dist/lib/component/diagram.es.js +1 -1
  114. package/dist/lib/component/diagram.es.js.map +1 -1
  115. package/dist/lib/component/display.es.js +1 -1
  116. package/dist/lib/component/display.es.js.map +1 -1
  117. package/dist/lib/component/editor.es.js +2 -2
  118. package/dist/lib/component/editor.es.js.map +1 -1
  119. package/dist/lib/component/input.es.js +1 -1
  120. package/dist/lib/component/input.es.js.map +1 -1
  121. package/dist/lib/component/list.es.js +1 -1
  122. package/dist/lib/component/list.es.js.map +1 -1
  123. package/dist/lib/component/menubar.es.js +1 -1
  124. package/dist/lib/component/menubar.es.js.map +1 -1
  125. package/dist/lib/component/table.es.js +1 -6
  126. package/dist/lib/component/table.es.js.map +1 -1
  127. package/dist/lib/component/tree.es.js +1 -1
  128. package/dist/lib/component/tree.es.js.map +1 -1
  129. package/dist/lib/core-DpzpKLWE.js +2 -0
  130. package/dist/lib/core-DpzpKLWE.js.map +1 -0
  131. package/dist/lib/core.es.js +1 -2
  132. package/dist/lib/data.es.js +1 -1
  133. package/dist/lib/diagnostics.es.js +24 -0
  134. package/dist/lib/diagnostics.es.js.map +1 -0
  135. package/dist/lib/glyphs/solid/index.es.js +1 -1
  136. package/dist/lib/layout.es.js +1 -1
  137. package/dist/lib/layout.es.js.map +1 -1
  138. package/dist/lib/overlay.es.js +1 -1
  139. package/dist/lib/overlay.es.js.map +1 -1
  140. package/dist/lib/primitive-8YvORgGS.js +2 -0
  141. package/dist/lib/primitive-8YvORgGS.js.map +1 -0
  142. package/dist/lib/primitive.es.js +1 -2
  143. package/dist/lib/router.es.js +1 -1
  144. package/dist/lib/selectionsEqual-DWdW5pxP.js +2 -0
  145. package/dist/lib/{selectionsEqual-C7MrKMQr.js.map → selectionsEqual-DWdW5pxP.js.map} +1 -1
  146. package/dist/lib/types/component/button/Button.d.ts +6 -14
  147. package/dist/lib/types/component/button/TabButton.d.ts +3 -5
  148. package/dist/lib/types/component/button/TabCloseButton.d.ts +3 -0
  149. package/dist/lib/types/component/button/ToggleButton.d.ts +2 -5
  150. package/dist/lib/types/component/chart/AbstractChart.d.ts +2 -2
  151. package/dist/lib/types/component/container/AccordionHeader.d.ts +6 -1
  152. package/dist/lib/types/component/container/AccordionIndicator.d.ts +2 -0
  153. package/dist/lib/types/component/container/FieldSet.d.ts +2 -0
  154. package/dist/lib/types/component/container/LabeledFieldSet.d.ts +1 -1
  155. package/dist/lib/types/component/container/LabeledGrid.d.ts +4 -1
  156. package/dist/lib/types/component/container/Legend.d.ts +2 -2
  157. package/dist/lib/types/component/container/MenuItem.d.ts +1 -0
  158. package/dist/lib/types/component/container/WindowBorder.d.ts +2 -2
  159. package/dist/lib/types/component/container/WindowHeader.d.ts +6 -0
  160. package/dist/lib/types/component/diagram/DiagramEdgeLayer.d.ts +10 -0
  161. package/dist/lib/types/component/diagram/DiagramGroupNode.d.ts +2 -0
  162. package/dist/lib/types/component/diagram/DiagramNode.d.ts +6 -2
  163. package/dist/lib/types/component/diagram/DiagramNodeLayer.d.ts +25 -0
  164. package/dist/lib/types/component/diagram/DiagramResidency.d.ts +11 -0
  165. package/dist/lib/types/component/diagram/DiagramView.d.ts +22 -0
  166. package/dist/lib/types/component/input/AbstractCalendarDropdown.d.ts +4 -4
  167. package/dist/lib/types/component/input/AbstractInput.d.ts +1 -0
  168. package/dist/lib/types/component/input/AbstractPickerField.d.ts +4 -2
  169. package/dist/lib/types/component/input/AutoCompleteDropdown.d.ts +2 -2
  170. package/dist/lib/types/component/input/AutoCompleteField.d.ts +1 -0
  171. package/dist/lib/types/component/input/ComboBox.d.ts +5 -2
  172. package/dist/lib/types/component/input/Link.d.ts +2 -2
  173. package/dist/lib/types/component/input/PasswordField.d.ts +2 -2
  174. package/dist/lib/types/component/input/PickerButton.d.ts +5 -2
  175. package/dist/lib/types/component/input/PickerInput.d.ts +2 -2
  176. package/dist/lib/types/component/input/SelectableText.d.ts +2 -2
  177. package/dist/lib/types/component/input/SpinButton.d.ts +3 -2
  178. package/dist/lib/types/component/input/Text.d.ts +3 -7
  179. package/dist/lib/types/component/input/TextArea.d.ts +2 -2
  180. package/dist/lib/types/component/input/TextField.d.ts +2 -2
  181. package/dist/lib/types/component/input/TextInput.d.ts +4 -2
  182. package/dist/lib/types/component/input/TimePickerDropdown.d.ts +2 -2
  183. package/dist/lib/types/component/input/UsernameField.d.ts +2 -2
  184. package/dist/lib/types/component/list/AbstractMarkerList.d.ts +2 -0
  185. package/dist/lib/types/component/list/AbstractSelectableList.d.ts +4 -2
  186. package/dist/lib/types/component/list/ListItem.d.ts +2 -1
  187. package/dist/lib/types/component/menubar/MenuBarButton.d.ts +3 -0
  188. package/dist/lib/types/component/menubar/ToolBar.d.ts +2 -0
  189. package/dist/lib/types/component/table/Body.d.ts +14 -6
  190. package/dist/lib/types/component/table/Column.d.ts +2 -0
  191. package/dist/lib/types/component/table/ColumnConfig.d.ts +1 -0
  192. package/dist/lib/types/component/table/Footer.d.ts +2 -0
  193. package/dist/lib/types/component/table/Header.d.ts +7 -0
  194. package/dist/lib/types/component/table/Row.d.ts +2 -0
  195. package/dist/lib/types/component/table/Table.d.ts +4 -1
  196. package/dist/lib/types/component/table/TablePanel.d.ts +5 -0
  197. package/dist/lib/types/component/table/TreeTablePanel.d.ts +5 -0
  198. package/dist/lib/types/component/table/cell/Cell.d.ts +3 -2
  199. package/dist/lib/types/component/table/cell/Header.d.ts +4 -3
  200. package/dist/lib/types/component/table/cell/ParentHeader.d.ts +4 -0
  201. package/dist/lib/types/component/tree/TreeRow.d.ts +2 -0
  202. package/dist/lib/types/core/AnimatedDropdown.d.ts +2 -2
  203. package/dist/lib/types/core/Binding.d.ts +1 -0
  204. package/dist/lib/types/core/ClassStyleRules.d.ts +44 -22
  205. package/dist/lib/types/core/Component.d.ts +55 -28
  206. package/dist/lib/types/core/DOM.d.ts +6 -0
  207. package/dist/lib/types/core/Diagnostics.d.ts +22 -0
  208. package/dist/lib/types/core/Event.d.ts +7 -0
  209. package/dist/lib/types/core/LayerManager.d.ts +2 -0
  210. package/dist/lib/types/core/ListenerBag.d.ts +1 -0
  211. package/dist/lib/types/core/StyleTarget.d.ts +12 -0
  212. package/dist/lib/types/core/StyleTraits.d.ts +4 -0
  213. package/dist/lib/types/core/Theme.d.ts +5 -2
  214. package/dist/lib/types/core/index.d.ts +5 -2
  215. package/dist/lib/types/diagnostics/DiagnosticsOverlay.d.ts +29 -0
  216. package/dist/lib/types/diagnostics/DiagnosticsSampler.d.ts +61 -0
  217. package/dist/lib/types/diagnostics/StyleAudit.d.ts +19 -0
  218. package/dist/lib/types/diagnostics/StyleAuditOverlay.d.ts +12 -0
  219. package/dist/lib/types/diagnostics/StyleAuditView.d.ts +13 -0
  220. package/dist/lib/types/diagnostics/index.d.ts +7 -0
  221. package/dist/lib/types/layout/LayoutManager.d.ts +3 -0
  222. package/dist/lib/types/layout/Table.d.ts +1 -0
  223. package/dist/lib/types/overlay/AbstractWindow.d.ts +35 -2
  224. package/dist/lib/types/overlay/ButtonGroup.d.ts +1 -0
  225. package/dist/lib/types/overlay/Dialog.d.ts +1 -0
  226. package/dist/lib/types/overlay/Menu.d.ts +2 -0
  227. package/dist/lib/types/overlay/Notification.d.ts +0 -1
  228. package/dist/lib/types/overlay/PopupPanel.d.ts +2 -2
  229. package/dist/lib/types/overlay/RailHandle.d.ts +4 -5
  230. package/dist/lib/types/overlay/TabWindow.d.ts +3 -0
  231. package/dist/lib/types/overlay/Tooltip.d.ts +1 -0
  232. package/dist/lib/types/overlay/Window.d.ts +4 -1
  233. package/dist/lib/validation.es.js +1 -1
  234. package/llms.txt +2 -0
  235. package/package.json +5 -1
  236. package/dist/lib/AbstractInput-W2PLJV5_.js +0 -2
  237. package/dist/lib/AbstractInput-W2PLJV5_.js.map +0 -1
  238. package/dist/lib/AnimatedDropdown-D0RhVgv3.js.map +0 -1
  239. package/dist/lib/Border-6GsTNV-2.js +0 -2
  240. package/dist/lib/Border-6GsTNV-2.js.map +0 -1
  241. package/dist/lib/Button-CnFAiQuV.js +0 -2
  242. package/dist/lib/Button-CnFAiQuV.js.map +0 -1
  243. package/dist/lib/Checkbox-CM1z8keM.js +0 -2
  244. package/dist/lib/Checkbox-CM1z8keM.js.map +0 -1
  245. package/dist/lib/CheckboxMenuRow-C1h4LPHR.js +0 -2
  246. package/dist/lib/CheckboxMenuRow-C1h4LPHR.js.map +0 -1
  247. package/dist/lib/CodeEditor-CTL2WjF8.js +0 -2
  248. package/dist/lib/CodeEditor-CTL2WjF8.js.map +0 -1
  249. package/dist/lib/ComboBox-PZ5YPL0X.js +0 -2
  250. package/dist/lib/ComboBox-PZ5YPL0X.js.map +0 -1
  251. package/dist/lib/Component-D99-15Zt.js +0 -2
  252. package/dist/lib/Component-D99-15Zt.js.map +0 -1
  253. package/dist/lib/Container-FWRjgF6T.js +0 -2
  254. package/dist/lib/DOM-Cjh7_7TF.js +0 -2
  255. package/dist/lib/DOM-Cjh7_7TF.js.map +0 -1
  256. package/dist/lib/Dialog-DN78RaVH.js +0 -2
  257. package/dist/lib/Dialog-DN78RaVH.js.map +0 -1
  258. package/dist/lib/Glyph-DiEpD3gy.js +0 -2
  259. package/dist/lib/Glyph-DiEpD3gy.js.map +0 -1
  260. package/dist/lib/GridConstraints-CvZ0Nzaw.js +0 -2
  261. package/dist/lib/GridConstraints-CvZ0Nzaw.js.map +0 -1
  262. package/dist/lib/LayoutSerialization-BC64__O7.js +0 -2
  263. package/dist/lib/LayoutSerialization-BC64__O7.js.map +0 -1
  264. package/dist/lib/List-CQbZK_pT.js +0 -2
  265. package/dist/lib/List-CQbZK_pT.js.map +0 -1
  266. package/dist/lib/ListenerBag-WPdKuuds.js +0 -2
  267. package/dist/lib/ListenerBag-WPdKuuds.js.map +0 -1
  268. package/dist/lib/Menu-CwHluLGT.js +0 -2
  269. package/dist/lib/Menu-CwHluLGT.js.map +0 -1
  270. package/dist/lib/ProgressSpinner-BuBvC1FY.js +0 -2
  271. package/dist/lib/ProgressSpinner-BuBvC1FY.js.map +0 -1
  272. package/dist/lib/RadioButton-Df5J-H6m.js +0 -2
  273. package/dist/lib/RadioButton-Df5J-H6m.js.map +0 -1
  274. package/dist/lib/RadioMenuRow-Cfv0x6Qj.js +0 -2
  275. package/dist/lib/RadioMenuRow-Cfv0x6Qj.js.map +0 -1
  276. package/dist/lib/Scrollbar-DcnueNJd.js +0 -2
  277. package/dist/lib/Scrollbar-DcnueNJd.js.map +0 -1
  278. package/dist/lib/SelectableText-DZNxjKXR.js +0 -2
  279. package/dist/lib/SelectableText-DZNxjKXR.js.map +0 -1
  280. package/dist/lib/Slider-DNfd8Lxz.js +0 -2
  281. package/dist/lib/Slider-DNfd8Lxz.js.map +0 -1
  282. package/dist/lib/Spacer-BznfGbwG.js +0 -2
  283. package/dist/lib/Spacer-BznfGbwG.js.map +0 -1
  284. package/dist/lib/TabButton-CAACsMov.js +0 -2
  285. package/dist/lib/TabButton-CAACsMov.js.map +0 -1
  286. package/dist/lib/TabCloseButton-CCiqsX3y.js +0 -2
  287. package/dist/lib/TabCloseButton-CCiqsX3y.js.map +0 -1
  288. package/dist/lib/Text-O-FWa5Cy.js +0 -2
  289. package/dist/lib/Text-O-FWa5Cy.js.map +0 -1
  290. package/dist/lib/Tooltip-CyICVu15.js +0 -3
  291. package/dist/lib/Tooltip-CyICVu15.js.map +0 -1
  292. package/dist/lib/Tree-CSEguhlk.js +0 -2
  293. package/dist/lib/Tree-CSEguhlk.js.map +0 -1
  294. package/dist/lib/core.es.js.map +0 -1
  295. package/dist/lib/primitive.es.js.map +0 -1
  296. package/dist/lib/selectionsEqual-C7MrKMQr.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButton-BxcuFChp.js","names":[],"sources":["../../src/typescript/lib/component/input/RadioButton.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Animation } from \"~/core/Animation.js\";\nimport { AbstractBooleanInput, AbstractBooleanInputOptions } from \"~/component/input/AbstractBooleanInput.js\";\nimport { Component, ComponentOptions } from \"~/core/Component.js\";\nimport { DOM, type Handle } from \"~/core/DOM.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { Glyph, GlyphOptions } from \"~/component/display/Glyph.js\";\nimport { HBox } from \"~/layout/HBox.js\";\nimport { type StyleBag, type StyleStateSpec } from \"~/core/ClassStyleRules.js\";\nimport { ThemeManager } from \"~/core/Theme.js\";\nimport { callable } from \"~/core/Callable.js\";\nimport { circle } from \"~/glyphs/solid/circle.js\";\n\n// Idempotent registration: makes the `\"circle\"` glyph available for the dot\n// regardless of which control imports first.\nGlyph.register(circle);\n\n// Physical width of `_ring`'s own border on every side — fixed regardless\n// of theme; mirrors `Checkbox.ts`'s `CHECKBOX_BOX_BORDER_PX`.\nconst RADIO_RING_BORDER_PX = 1;\n\n/**\n * Square edge length of `_ring` — the theme's `glyphLg` icon step (16px at\n * the shipped base). Resolved per construction; mirrors `Checkbox.ts`'s\n * `checkboxBoxSizePx()`.\n */\nfunction radioRingSizePx(): number {\n return ThemeManager.getResolvedScale().glyphLg;\n}\n\n/**\n * Square edge length of the dot's ink — the theme's `glyphXs` icon step\n * (8px at the shipped base), fitted inside `_ring`'s `glyphLg` padding box.\n */\nfunction radioDotSizePx(): number {\n return ThemeManager.getResolvedScale().glyphXs;\n}\n\nconst _defaultRadioButtonRingOptions: Partial<ComponentOptions> = {\n cursor: \"pointer\",\n backgroundColor: \"var(--ts-ui-radio-bg, var(--ts-ui-form-bg, rgb(255, 255, 255)))\",\n border: \"1px solid var(--ts-ui-form-border, rgb(160, 160, 160))\",\n borderRadius: \"50%\",\n};\n\n/** `_ring`'s selected-state declarations, read by `ownStyleStates`' `.selected` entry. */\nconst RADIO_SELECTED_DECLARATIONS: Readonly<Record<string, string>> = Object.freeze({\n backgroundColor: \"var(--ts-ui-radio-bg-selected, rgb(30, 100, 200))\",\n border: \"1px solid var(--ts-ui-radio-bg-selected, rgb(30, 100, 200))\",\n});\n\n/**\n * The ring graphic behind a {@link RadioButton}. See `CheckboxBox`'s doc\n * comment (Checkbox.ts) for the shape this mirrors — static geometry/cursor\n * and the resting backgroundColor/border are class defaults; the selected\n * background and border come from this class's own declared `ownStyleStates`\n * entry below, resolved onto the shared `.RadioButtonRing.selected` class-tier\n * rule — see `plans/implemented/checkbox-radio-delegate-state-style-defaults.md`.\n */\nclass RadioButtonRing extends Component {\n // Single-entry list: with only one declared state, its guarded suffix\n // is just its own selector (no `:not(...)` to add against a\n // higher-priority entry that doesn't exist).\n protected static readonly ownStyleStates: readonly StyleStateSpec[] = [\n {\n selector: \".selected\",\n extract: (): StyleBag => ({\n backgroundColor: RADIO_SELECTED_DECLARATIONS.backgroundColor,\n border: RADIO_SELECTED_DECLARATIONS.border,\n }),\n },\n ];\n\n private _selected: boolean = false;\n\n constructor() {\n const size = radioRingSizePx();\n\n super(undefined, {\n ..._defaultRadioButtonRingOptions,\n preferredSize: { width: size, height: size },\n minSize: { width: size, height: size },\n maxSize: { width: size, height: size },\n });\n }\n\n /** See `CheckboxBox.applyState`'s doc comment (Checkbox.ts) — identical reasoning, one state instead of two. */\n applyState(selected: boolean): void {\n this._selected = selected;\n\n // Unconditional, not gated on `this.getElement()`: `setStyleState`\n // updates `_activeStates` regardless of whether an element exists\n // yet — see `Checkbox.ts`'s `CheckboxBox.applyState` for the same\n // reasoning.\n this.setStyleState(\".selected\", selected);\n }\n\n protected render(): Handle {\n const element = super.render();\n DOM.sink.apply(element, { toggleClass: { selected: this._selected } });\n return element;\n }\n}\n\nconst _defaultRadioButtonDotOptions: Partial<GlyphOptions> = {\n foregroundColor: \"var(--ts-ui-radio-dot-color, rgb(255, 255, 255))\",\n};\n\n/**\n * The filled dot inside a {@link RadioButton}'s ring. `foregroundColor` and\n * `minSize`/`maxSize` are class defaults, so every instance shares one\n * `.RadioButtonDot` CSS rule instead of repeating them. `RadioButton`'s own\n * constructor still calls `setPreferredSize`/`setMaxSize` imperatively (a\n * `Glyph`'s construction-time size pin cannot itself be deferred to a\n * defaults bag — see `Glyph.applyOptions`), but that call now resolves to\n * the same value this class already defaults, so `Component.applyStyle`'s\n * render-time reconciliation (`reconcileRuleDeclaration`, since\n * `plans/implemented/reconciled-write-path-widening.md`) turns it into a\n * removal instead of a redundant per-instance declaration.\n */\nclass RadioButtonDot extends Glyph {\n constructor() {\n const size = radioDotSizePx();\n\n super(\"circle\", undefined, {\n ..._defaultRadioButtonDotOptions,\n minSize: { width: size, height: size },\n maxSize: { width: size, height: size },\n });\n }\n}\n\n/**\n * Construction-time options for {@link RadioButton}.\n *\n * @category Components\n */\nexport interface RadioButtonOptions extends AbstractBooleanInputOptions {\n selected?: boolean;\n value?: boolean;\n text?: string;\n radioName?: string;\n /**\n * Construction-time listener bag — the declarative form of `on()`. Adds the\n * radio button's `action` shorthand to the inherited `change` / `binding`.\n */\n listeners?: {\n action?: () => void;\n change?: (value: boolean) => void;\n binding?: () => void;\n };\n}\n\nconst _defaultRadioButtonOptions: Partial<RadioButtonOptions> = {\n outline: \"none\",\n};\n\n/**\n * A custom-drawn radio button rendered as a focusable `<div>` with\n * `role=\"radio\"`. The ring + dot is drawn with framework primitives; the\n * native `<input type=\"radio\">` is intentionally not used. Group selection\n * is coordinated by [`ButtonGroup`](/api/overlay/classes/ButtonGroup); keyboard\n * navigation within a group is provided by\n * [`RovingTabIndex`](/api/core/classes/RovingTabIndex).\n *\n * @category Components\n */\nclass RadioButton<TOptions extends RadioButtonOptions = RadioButtonOptions>\n extends AbstractBooleanInput<TOptions>\n{\n private _ring: RadioButtonRing;\n private _dot: Glyph;\n\n /**\n * Constructs a RadioButton.\n *\n * @param text - Optional label text. Equivalent to `options.label`; kept\n * positional for back-compat with consumers that wrote\n * `new RadioButton(\"Hello\")`.\n * @param options - Optional construction-time options bag.\n * @param subclassDefaults - Per-subclass default bag layered over this\n * class's defaults; subclasses forward their `_defaultXxxOptions`\n * constant here.\n */\n constructor(text?: string, options?: RadioButtonOptions, subclassDefaults?: Partial<RadioButtonOptions>);\n constructor(text?: string, options?: TOptions, subclassDefaults?: Partial<TOptions>) {\n super(\n { ...(options ?? {}) } as TOptions,\n { ..._defaultRadioButtonOptions, ...(subclassDefaults ?? {}) } as Partial<TOptions>,\n );\n\n this.setLayoutManager(new HBox());\n\n const ringSize = radioRingSizePx();\n const dotSize = radioDotSizePx();\n\n this._ring = new RadioButtonRing();\n // Min = preferred = max so the outer HBox shrink-on-overallocation\n // can't collapse the ring graphic when the radio is packed into a\n // tight container with siblings that have flexible widths. The\n // explicit setMinSize/setMaxSize calls (not just setSize) matter\n // here: `RadioButtonRing`'s own constructor-time minSize/maxSize\n // only ever materialises into `.RadioButtonRing`'s shared\n // class-level CSS rule, which is cached from whichever instance is\n // constructed first in the page's lifetime — a later instance built\n // after a `setTheme` raises `scale.base` would still render clamped\n // to that first-cached value without an explicit per-instance\n // override here, the same reason `_dot`'s size is re-asserted\n // imperatively below.\n this._ring.setSize({ width: ringSize, height: ringSize });\n this._ring.setMinSize({ width: ringSize, height: ringSize });\n this._ring.setMaxSize({ width: ringSize, height: ringSize });\n\n this._dot = new RadioButtonDot();\n this._dot.setPreferredSize({ width: dotSize, height: dotSize });\n this._dot.setMaxSize({ width: dotSize, height: dotSize });\n // Centres the dot inside `_ring`'s padding box — same formula as\n // `Checkbox.ts`'s `_check` offset. `ringSize` and `dotSize` come from the\n // same live theme snapshot, so this stays correct at any `scale.base`.\n const dotOffset = (ringSize - 2 * RADIO_RING_BORDER_PX - dotSize) / 2;\n this._dot.setX(dotOffset);\n this._dot.setY(dotOffset);\n this._dot.setOpacity(0);\n // Pass-through so clicks on the dot still hit the ring underneath.\n this._dot.setPointerEvents(\"none\");\n\n if (!Animation.isReducedMotion()) {\n this._dot.setTransition(\"opacity 120ms ease-out\");\n this._ring.setTransition(\"background-color 120ms ease-out, border-color 120ms ease-out\");\n }\n\n this._ring.addComponent(this._dot);\n super.addComponent(this._ring);\n\n this.getAria().setRole(\"radio\");\n this.getAria().setTabIndex(0);\n this.getAria().setChecked(false);\n\n // The ring owns the user-select click so the pointer/click + cursor\n // surface is exactly the visible ring graphic — clicks on a label or\n // in any stretched empty area pass through to the root, which has no\n // listener of its own. This pointer line stays per-subclass (a closure\n // over the widget `this`) because a listener registered on the child\n // ring would otherwise bind `this` to the ring; only the keyboard path,\n // registered on the root, moves into the base.\n Event.addListener(this._ring, \"click\", () => this.activateFromPointer());\n this.installKeyboard();\n\n // The positional `text` arg wins only when `options.label` (or\n // `options.text`) was not provided.\n if (this._options.label === undefined && this._options.text === undefined && text !== undefined) {\n this._options.label = text;\n } else if (this._options.label === undefined && this._options.text !== undefined) {\n this._options.label = this._options.text;\n }\n\n if (this._options.value !== undefined && this._options.selected === undefined) {\n this._options.selected = this._options.value;\n }\n\n if (this._options.selected !== undefined) {\n this.applySelected(this._options.selected);\n }\n\n if (this._options.label !== undefined) {\n this.applyLabel(this._options.label);\n }\n\n if (this._options.enabled !== undefined) {\n this.applyEnabled(this._options.enabled);\n }\n\n if (this._options.readOnly !== undefined) {\n this.applyReadOnly(this._options.readOnly);\n }\n }\n\n /**\n * Applies a {@link RadioButtonOptions} bag. Inherited Component fields\n * cascade through `super.applyOptions`; radio-button-specific fields are\n * stored pure on `_options` so the constructor body can dispatch them\n * after children are built.\n *\n * @param options - The options bag carrying the values to apply.\n *\n * @returns This component, for method chaining.\n */\n protected applyOptions(options: TOptions): this {\n super.applyOptions(options);\n\n if (options.selected !== undefined) this._options.selected = options.selected;\n if (options.value !== undefined) this._options.value = options.value;\n if (options.label !== undefined) this._options.label = options.label;\n if (options.text !== undefined) this._options.text = options.text;\n if (options.radioName !== undefined) this._options.radioName = options.radioName;\n if (options.enabled !== undefined) this._options.enabled = options.enabled;\n if (options.readOnly !== undefined) this._options.readOnly = options.readOnly;\n\n return this;\n }\n\n /**\n * Activates the radio button from a click or key: radio buttons can only be\n * selected, never directly deselected by the user (the `ButtonGroup`\n * deselects siblings on change), so this selects and fires the DOM `change`\n * only on a real off→on transition. The enabled/read-only guard is applied\n * by the base before this runs.\n */\n protected activate(): void {\n if (!this.isSelected()) {\n this.setSelected(true);\n Event.fireEvent(this, \"change\");\n }\n }\n\n /**\n * Returns the inner ring graphic — the click + cursor surface.\n *\n * @returns The ring component.\n */\n protected getInteractiveSurface(): Component {\n return this._ring;\n }\n\n /**\n * Returns whether the radio button is currently selected.\n *\n * @returns `true` when selected.\n */\n isSelected(): boolean {\n return this._options.selected ?? false;\n }\n\n /**\n * Sets the selected state and updates the visual + ARIA cache. Used both\n * by user-driven selection and by `ButtonGroup` when it deselects\n * siblings.\n *\n * @param value - `true` to select, `false` to deselect.\n *\n * @returns This component, for method chaining.\n */\n setSelected(value: boolean): this {\n const next = !!value;\n if (next === this.isSelected()) {\n return this;\n }\n\n this._options.selected = next;\n this.applySelected(next);\n this.notifyChange(next);\n\n return this;\n }\n\n /**\n * Returns the current value (alias for {@link isSelected}, satisfies\n * [`Bindable`](/api/core/interfaces/Bindable)).\n *\n * @returns `true` when selected.\n */\n getValue(): boolean {\n return this.isSelected();\n }\n\n /**\n * Sets the value (alias for {@link setSelected}, satisfies [`Bindable`](/api/core/interfaces/Bindable)).\n *\n * @param value - The new selected state.\n *\n * @returns This component, for method chaining.\n */\n setValue(value: boolean): this {\n return this.setSelected(value);\n }\n\n /**\n * Back-compat shim that stores the supplied group name on `_options` but\n * does not emit a `name` attribute (the host element is no longer\n * `<input>`). Consumers that read the group name through\n * {@link getRadioName} keep working.\n *\n * @param name - Group name string.\n *\n * @returns This component, for method chaining.\n */\n setRadioName(name: string): this {\n this._options.radioName = name;\n\n return this;\n }\n\n /**\n * Clears the back-compat radio-name field.\n *\n * @returns This component, for method chaining.\n */\n clearRadioName(): this {\n this._options.radioName = undefined;\n\n return this;\n }\n\n /**\n * Returns the group name set via {@link setRadioName}, or `null`.\n *\n * @returns The group name string, or `null`.\n */\n getRadioName(): string | null {\n return this._options.radioName ?? null;\n }\n\n /**\n * Registers a listener for one of this radio button's events.\n * `\"action\"` is a typed semantic shorthand over {@link Event.addListener}\n * for the DOM change event — fired on user-driven selection and used by\n * [`ButtonGroup`](/api/overlay/classes/ButtonGroup) to enforce mutual\n * exclusivity. `\"change\"` and `\"binding\"` are the inherited\n * {@link AbstractInput} listener-bag events.\n *\n * @param event - The event name.\n * @param listener - The callback to invoke when the event fires.\n *\n * @returns This component, for method chaining.\n */\n on(event: \"action\", listener: Event.Listener): this;\n on(event: \"change\", listener: (value: boolean) => void): this;\n on(event: \"binding\", listener: () => void): this;\n on(event: \"action\" | \"change\" | \"binding\", listener: Function): this {\n if (event === \"action\") {\n Event.addListener(this, \"change\", listener as Event.Listener);\n\n return this;\n }\n\n return super.on(event as \"change\", listener as (value: boolean) => void);\n }\n\n /**\n * Removes a previously registered listener. The exact callback\n * reference must match the one passed to {@link on}.\n *\n * @param event - The event the listener was registered for.\n * @param listener - The callback to remove.\n *\n * @returns This component, for method chaining.\n */\n off(event: \"action\" | \"change\" | \"binding\", listener: Function): this {\n if (event === \"action\") {\n Event.removeListener(this, \"change\", listener as Event.Listener);\n\n return this;\n }\n\n return super.off(event, listener);\n }\n\n /**\n * Updates the visual + ARIA state for the given selected flag.\n */\n private applySelected(selected: boolean): void {\n this.getAria().setChecked(selected);\n\n this._ring.applyState(selected);\n\n this._dot.setOpacity(selected ? 1 : 0);\n }\n\n}\n\nconst RadioButtonCallable = callable(RadioButton);\ntype RadioButtonCallable<TOptions extends RadioButtonOptions = RadioButtonOptions> = RadioButton<TOptions>;\nexport {\n RadioButton as _RadioButton,\n RadioButtonCallable as RadioButton\n};\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./DOM-DDhDN8lQ.js";import{l as t,n}from"./Position-DWR1nIpA.js";import{T as r,g as i,h as a,i as o,p as s,t as c,y as l}from"./Component-YrLXKJZS.js";import{t as u}from"./ListenerBag-DYRl4TSb.js";import{t as d}from"./Container-C5cxnioS.js";import{t as f}from"./Glyph-Cof7BxfJ.js";import{t as p}from"./Panel-DlsVVuvn.js";import{t as m}from"./RovingTabIndex-BttlsARv.js";import{t as h}from"./Tooltip-DgRHQZhL.js";import{n as g,r as _}from"./VBox-hFIZAEpT.js";import{t as v}from"./RadioButton-BxcuFChp.js";import{a as y,i as b,o as x,r as S,s as C,t as w}from"./Window-CQ14_65z.js";import{n as T,r as E,t as D}from"./DragManager-D5pBaPPg.js";import{i as O,r as k,t as A}from"./Menu-BCQISKiQ.js";import{t as j}from"./LayoutConstraints-LIHYYd2F.js";import{t as M}from"./Button-CKzjQyqA.js";import{t as N}from"./TabButton-BQDaBszs.js";import{angle_left as ee}from"./glyphs/solid/angle_left.es.js";import{angle_right as te}from"./glyphs/solid/angle_right.es.js";import{angle_up as P}from"./glyphs/solid/angle_up.es.js";import{angle_down as F}from"./glyphs/solid/angle_down.es.js";var ButtonGroup=class{buttons=[];_groupId=`bg-`+Math.random().toString(36).slice(2,10);_allowDeselect=!1;_rovingTabIndex=null;_listeners=new u;constructor(e){if(e?.allowDeselect!==void 0&&(this._allowDeselect=e.allowDeselect),e?.buttons!==void 0&&this.addButtons(e.buttons),e?.listeners!==void 0){let t=e.listeners;for(let e of Object.keys(t)){let n=t[e];n!==void 0&&this.on(e,n)}}}updateButtonStates(e){e.isSelected()?this.buttons.forEach(t=>{t!==e&&t.setSelected(!1)}):this._allowDeselect||e.setSelected(!0),this.emit(`selection`,e)}setAllowDeselect(e){return this._allowDeselect=e,this}dispose(){this._listeners.clear()}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}getButtons(){return this.buttons.slice()}addButtons(...e){for(let t of e){let e=Array.isArray(t)?t:[t];for(let t of e)this.addButton(t)}return this}addButton(e){return this.buttons.push(e),e.on(`action`,()=>{this.updateButtonStates(e)}),e instanceof v&&e.setRadioName(this._groupId),this._rovingTabIndex!==null&&this._rovingTabIndex.add(e),this}removeButton(e){let t=this.buttons.indexOf(e);return t<0?this:(this.buttons.splice(t,1),this._rovingTabIndex!==null&&this._rovingTabIndex.remove(e),this)}setContainer(e){this._rovingTabIndex=new m;for(let e of this.buttons)this._rovingTabIndex.add(e);return r.addSubtreeListener(e,`keydown`,e=>{if(e.key===`ArrowRight`||e.key===`ArrowDown`)this._rovingTabIndex.moveNext();else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)this._rovingTabIndex.movePrev();else return;return{prevent:!0}}),this}},I=i(ButtonGroup);f.register(ee,te,P,F);var L=24,R=80,z={backgroundColor:`transparent`},ScrollStrip=class extends p{_stepProvider=null;_clip=new p;_leadArrow=null;_trailArrow=null;constructor(e,t){super(e,{...z,...t??{}}),this._orientation??=`horizontal`,this._scrollable??=!0,this._arrowBackground??=null,this._arrowStep??=R,this.setScrollbarStyle(`native`),this.clearInsets(),this._clip.setOverflow(`hidden`),this._clip.setBackgroundColor(`transparent`),this._clip.clearInsets(),this.installBox(this._orientation)}init(t){super.init(t);let n=t??this.getElement(!0);return e.sink.appendChild(n,this._clip.getElement(!0)),this}applyOptions(e){return super.applyOptions(e),e.orientation!==void 0&&this.setOrientation(e.orientation),e.scrollable!==void 0&&this.setScrollable(e.scrollable),e.arrowBackground!==void 0&&this.setArrowBackground(e.arrowBackground),e.arrowStep!==void 0&&this.setArrowStep(e.arrowStep),this}installBox(e){if(!this._clip)return;let t=e===`vertical`?new g({mode:`equal`,spacing:0,stretching:!0}):new _({mode:`equal`,spacing:0,stretching:!0});this._clip.setLayoutManager(t)}isVertical(){return this._orientation===`vertical`}setOrientation(e){return this._orientation===e?this:(this._orientation=e,this.installBox(e),this)}getOrientation(){return this._orientation}setScrollable(e){return this._scrollable=e,this}isScrollable(){return this._scrollable}setArrowBackground(e){return this._arrowBackground=e,this._leadArrow?.setBackgroundColor(e),this._trailArrow?.setBackgroundColor(e),this}setArrowStep(e){return this._arrowStep=e,this}setStepProvider(e){return this._stepProvider=e,this}resolveStep(){return this._stepProvider?this._stepProvider():this._arrowStep}addItem(e){return this._clip.addComponent(e),this}removeItem(e){return this._clip.removeComponent(e),this}moveItem(e,t){return this._clip.moveComponent(e,t),this}getItems(){return this._clip.getComponents()}getContentBox(){return this._clip.getLayoutManager()}layoutItems(){return this._clip.doLayout(),this._clip.syncScrollOffsets(),this}getClipElement(e){return this._clip.getElement(e)??null}arrowReserve(e,t){return this._scrollable&&e>t+1?L:0}ensureArrows(){if(this._leadArrow&&this._trailArrow)return;let t=new M({glyph:`angle-left`}),n=new M({glyph:`angle-right`});for(let e of[t,n])this._arrowBackground!==null&&e.setBackgroundColor(this._arrowBackground),e.setBackgroundImage(`none`),e.clearBorder(),e.clearShadow(),e.setBorderRadius(`0`),e.clearInsets(),e.setZIndex(3);t.on(`action`,this.leadClicked),n.on(`action`,this.trailClicked);let r=this.getElement(!0);e.sink.appendChild(r,t.getElement(!0)),e.sink.appendChild(r,n.getElement(!0)),this._leadArrow=t,this._trailArrow=n}layoutContent(e,t){let r=this.getContentBounds()??{x:0,y:0,width:this.getWidth()||0,height:this.getHeight()||0},i=this.isVertical(),a=i?r.height:r.width,o=i?r.width:r.height,s=a-2*e;return i?(this._clip.setX(r.x),this._clip.setY(r.y+e),this._clip.setWidth(o),this._clip.setHeight(s),this._clip.setInsets(new n(t,0,0,0))):(this._clip.setX(r.x+e),this._clip.setY(r.y),this._clip.setWidth(s),this._clip.setHeight(o),this._clip.setInsets(new n(0,0,0,t))),this.layoutItems(),this.layoutArrows(r,e),this}layoutArrows(e,t){if(!this._scrollable||t<=0){this.hideArrows();return}this.ensureArrows();let n=this._leadArrow,r=this._trailArrow,i=this.isVertical(),a=i?e.height:e.width,o=i?e.width:e.height;n.setGlyph(i?`angle-up`:`angle-left`),r.setGlyph(i?`angle-down`:`angle-right`),n.setVisible(!0),r.setVisible(!0),this.refreshArrows();let s=(i?e.y:e.x)+a-t;for(let a of[n,r])i?(a.setMinSize({width:0,height:t}),a.setMaxSize({width:Number.MAX_VALUE,height:t}),a.setX(e.x),a.setWidth(o),a.setHeight(t)):(a.setMinSize({width:t,height:0}),a.setMaxSize({width:t,height:Number.MAX_VALUE}),a.setY(e.y),a.setHeight(o),a.setWidth(t));i?(n.setY(e.y),r.setY(s)):(n.setX(e.x),r.setX(s))}hideArrows(){this._leadArrow?.setVisible(!1),this._trailArrow?.setVisible(!1)}mainScroll(){return this.isVertical()?this._clip.getScrollTop():this._clip.getScrollLeft()}mainScrollMax(){return this.isVertical()?this._clip.getMaxScrollTop():this._clip.getMaxScrollLeft()}setMainScroll(e){this.isVertical()?this._clip.setScrollTop(e):this._clip.setScrollLeft(e)}resetScroll(){return this._clip.setScrollLeft(0),this._clip.setScrollTop(0),this}refreshArrows(){let e=this._leadArrow,t=this._trailArrow;if(!e||!t)return;let n=this.mainScroll();e.setEnabled(n>0),t.setEnabled(n<this.mainScrollMax()-1)}scrollBy(e){this.setMainScroll(this.mainScroll()+e),this.refreshArrows()}leadClicked=()=>{this.scrollBy(-this.resolveStep())};trailClicked=()=>{this.scrollBy(this.resolveStep())};revealItem(t){let n=this._clip.getElement();if(!n)return;let r=this.isVertical(),i=e.source.getElementRect(n),a=e.source.getElementRect(t),o=r?i.top:i.left,s=r?i.bottom:i.right,c=r?a.top:a.left,l=r?a.bottom:a.right,u=0;c<o?u=c-o:l>s&&(u=l-s),u!==0&&(this.setMainScroll(this.mainScroll()+u),this.refreshArrows())}containsArrow(t){if(!e.source.isNode(t))return!1;let n=e.source.intern(t);for(let t of[this._leadArrow,this._trailArrow]){let r=t?.getElement()??null;if(r&&e.source.contains(r,n))return!0}return!1}destructor(){this._clip.dispose(),this._leadArrow?.dispose(),this._trailArrow?.dispose(),super.destructor()}},B=i(ScrollStrip);function computeBulkCloseIds(e,t,n,r){return e.filter((e,n)=>{switch(r){case`all`:return!0;case`others`:return n!==t;case`right`:return n>t;case`left`:return n<t}}).filter(n)}var V=120,H=30,U=24,W=4,G=80,TabIndicator=class extends c{_mainPos=0;_mainExtent=0;_side=`north`;constructor(){super(),this.setBackgroundColor(`var(--ts-ui-tab-indicator-color, #1a73e8)`),this.setTransition(`transform ${V}ms ease, width ${V}ms ease, height ${V}ms ease`),this.setPointerEvents(`none`),this.setZIndex(2)}slideTo(e,t,n){return this._mainPos=e,this._mainExtent=t,this._side=n,this.getElement()&&this.applyBarGeometry(),this}applyStyle(e){return super.applyStyle(e),this.applyBarGeometry(),this}applyBarGeometry(){let e=`var(--ts-ui-tab-indicator-thickness, 2px)`;return this._side===`west`||this._side===`east`?(this.setTranslate(0,this._mainPos),this.setElementStyles({top:`0`,bottom:`auto`,left:this._side===`east`?`0`:`auto`,right:this._side===`west`?`0`:`auto`,width:e,height:this._mainExtent+`px`})):(this.setTranslate(this._mainPos,0),this.setElementStyles({left:`0`,right:`auto`,top:this._side===`south`?`0`:`auto`,bottom:this._side===`north`?`0`:`auto`,width:this._mainExtent+`px`,height:e}))}},K=class TabReorderBar extends c{static THICKNESS=2;constructor(){super(),this.setBackgroundColor(`var(--ts-ui-drag-reorder-color, #1a73e8)`),this.setPointerEvents(`none`),this.setZIndex(2),this.setVisible(!1)}placeAt(e,t,n){return n?(this.setX(0),this.setY(e),this.setWidth(t),this.setHeight(TabReorderBar.THICKNESS)):(this.setX(e),this.setY(0),this.setWidth(TabReorderBar.THICKNESS),this.setHeight(t)),this.setVisible(!0),this}hide(){return this.setVisible(!1),this}},TabDropTint=class extends c{constructor(){super(),this.setBackgroundColor(`var(--ts-ui-drag-dropzone-bg)`),this.setPointerEvents(`none`),this.setZIndex(1),this.setVisible(!1)}showOver(e){return this.setX(0),this.setY(0),this.setWidth(e.getWidth()),this.setHeight(e.getHeight()),this.setVisible(!0),this}hide(){return this.setVisible(!1),this}},q={backgroundColor:`var(--ts-ui-tab-toolbar-bg, #eee)`,preferredSize:{width:0,height:H}},TabBar=class extends d{_tabClip=new B({scrollable:!1});_entries=[];_buttonGroup=new I;_rovingTabIndex=new m({preventScroll:!0});_activeId=null;_listeners=this.registerListenerBag(new u);_widthMode=`equal`;_maxWidth=null;_fixedWidth=120;_underBorderFullWidth=!0;_underBorderFromTheme=!0;_indicator=new TabIndicator;_side=`north`;_align=`start`;_orientation=`horizontal`;_scrollable=!1;_compact=!1;_textAlign=`center`;_contextMenu=new A;_tools=[];_toolMenuItems=new Map;_toolGroup=new p;_leadGroup=new p;_leadWidget=null;_scrollToSelected=!1;_reorderable=!1;_reorderBar=new K;_dropTint=new TabDropTint;_dndTeardowns=[];_dragMouseTarget=null;_moveTriggerTeardown=null;_dragShiftHeld=!1;_dragInsertIndex=-1;_springRaiseTimer=null;constructor(e,t){super(e,{...q,...t??{}}),this.setLayoutManager(new _({mode:`equal`,spacing:0,stretching:!0})),this._underBorderFullWidth=o.getTheme().tab.underBorderFullWidth,this.applyUnderBorder(e),this.getAria().setRole(`tablist`),this._tabClip.setArrowBackground(`var(--ts-ui-tab-toolbar-bg, #eee)`),this._tabClip.setStepProvider(()=>this.scrollStepExtent()),this._toolGroup.setLayoutManager(new _({spacing:0,stretching:!0})),this._toolGroup.setBackgroundColor(`var(--ts-ui-tab-toolbar-bg, #eee)`),this._toolGroup.clearInsets(),this._toolGroup.setZIndex(1),this._leadGroup.setLayoutManager(new _({spacing:0,stretching:!0})),this._leadGroup.setBackgroundColor(`transparent`),this._leadGroup.clearInsets(),this._leadGroup.setZIndex(1),this._leadGroup.setPointerEvents(`none`),this.subscribeTheme(()=>{this._underBorderFromTheme&&(this._underBorderFullWidth=o.getTheme().tab.underBorderFullWidth,this.applyUnderBorder())}),this.dispatchBarOptions(e)}dispatchBarOptions(e){if(e){if(e.widthMode!==void 0&&this.setWidthMode(e.widthMode),e.maxWidth!==void 0&&this.setMaxWidth(e.maxWidth),e.fixedWidth!==void 0&&this.setFixedWidth(e.fixedWidth),e.underBorderFullWidth!==void 0&&this.setUnderBorderFullWidth(e.underBorderFullWidth),e.side!==void 0&&this.setSide(e.side),e.align!==void 0&&this.setAlign(e.align),e.orientation!==void 0&&this.setOrientation(e.orientation),e.scrollable!==void 0&&this.setScrollable(e.scrollable),e.compact!==void 0&&this.setCompact(e.compact),e.reorderable!==void 0&&this.setReorderable(e.reorderable),e.textAlign!==void 0&&this.setTextAlign(e.textAlign),e.tools!==void 0)for(let t of e.tools)t instanceof c,this.addTool(t);this.applyListeners(e?.listeners)}}setBarSurfaceColor(e){return this.setBackgroundColor(e),this._toolGroup.setBackgroundColor(e),this._tabClip.setArrowBackground(e),this}init(t){super.init(t);let n=t??this.getElement(!0);e.sink.appendChild(n,this._tabClip.getElement(!0)),e.sink.appendChild(n,this._toolGroup.getElement(!0)),e.sink.appendChild(n,this._leadGroup.getElement(!0));let i=this._tabClip.getClipElement(!0);return e.sink.appendChild(i,this._indicator.getElement(!0)),e.sink.appendChild(i,this._dropTint.getElement(!0)),e.sink.appendChild(i,this._reorderBar.getElement(!0)),r.addSubtreeListener(this,`keydown`,this.onToolbarKeyDown),this._reorderable&&this.installTabDnD(),this}destructor(){this.teardownTabDnD(),this.clearSpringRaise(),this._moveTriggerTeardown?.(),this._moveTriggerTeardown=null,this._tabClip.dispose(),this._toolGroup.dispose(),this._leadGroup.dispose(),this._indicator.dispose(),this._dropTint.dispose(),this._reorderBar.dispose(),this._contextMenu.dispose(),super.destructor()}applyUnderBorder(e){if(e?.border!==void 0){this.setBorder(e.border);return}if(!this._underBorderFullWidth){this.clearBorder();return}let t=`1px solid var(--ts-ui-tab-toolbar-border, #e1e1e8)`;this.setBorder({borderTop:this._side===`south`?t:`none`,borderBottom:this._side===`north`?t:`none`,borderLeft:this._side===`east`?t:`none`,borderRight:this._side===`west`?t:`none`})}setWidthMode(e){return this._widthMode=e,this.scheduleLayout(),this}getWidthMode(){return this._widthMode}setMaxWidth(e){return this._maxWidth=e,this.scheduleLayout(),this}getMaxWidth(){return this._maxWidth}setFixedWidth(e){return this._fixedWidth=e,this.scheduleLayout(),this}getFixedWidth(){return this._fixedWidth}setUnderBorderFullWidth(e){return this._underBorderFromTheme=!1,this._underBorderFullWidth=e,this.applyUnderBorder(),this.scheduleLayout(),this}isUnderBorderFullWidth(){return this._underBorderFullWidth}setSide(e){return this._side=e,this._tabClip.resetScroll(),this._scrollable&&(this._scrollToSelected=!0),this.applyUnderBorder(),this.scheduleLayout(),this}getSide(){return this._side}setAlign(e){return this._align=e,this.scheduleLayout(),this}getAlign(){return this._align}setOrientation(e){return this._orientation=e,this.scheduleLayout(),this}getOrientation(){return this._orientation}setTextAlign(e){return this._textAlign=e,this.scheduleLayout(),this}getTextAlign(){return this._textAlign}setScrollable(e){return e&&!this._scrollable&&(this._scrollToSelected=!0),this._scrollable=e,this._tabClip.setScrollable(e),this.scheduleLayout(),this}isScrollable(){return this._scrollable}setCompact(e){return this._compact=e,this._scrollable&&(this._scrollToSelected=!0),this.scheduleLayout(),this}isCompact(){return this._compact}setReorderable(e){return this._reorderable===e||(this._reorderable=e,!this.getElement())||(e?this.installTabDnD():this.teardownTabDnD()),this}isReorderable(){return this._reorderable}addTool(e){let t=e instanceof c?e:this.buildDescriptorTool(e);return this._tools.push(t),this._toolGroup.addComponent(t),this.scheduleLayout(),this}buildDescriptorTool(e){let t=new M({glyph:e.glyph});return t.setFlat(!0),h.attach(t,e.label),t.on(`action`,e.action),this._toolMenuItems.set(t,e),t}removeTool(e){let t=this._tools.indexOf(e);return t<0?this:(this._tools.splice(t,1),this._toolMenuItems.delete(e),this._toolGroup.removeComponent(e),this.scheduleLayout(),this)}setLeadingWidget(e){return this._leadWidget&&this._leadGroup.removeComponent(this._leadWidget),this._leadWidget=e,e&&this._leadGroup.addComponent(e),this.scheduleLayout(),this}getLeadingWidget(){return this._leadWidget}isBarChromeTarget(t){if(!e.source.isNode(t))return!1;let n=e.source.intern(t);for(let t of this._entries){let r=t.button.getElement();if(r&&e.source.contains(r,n))return!0}let r=this._toolGroup.getElement();if(r&&e.source.contains(r,n))return!0;let i=this._leadWidget?.getElement();return!!(i&&e.source.contains(i,n)||this._tabClip.containsArrow(t))}installMoveTrigger(e,t){this._moveTriggerTeardown?.(),this._moveTriggerTeardown=null;let onBarMouseDown=t=>{t.shiftKey||this.isBarChromeTarget(t.target)||e(t)};r.addSubtreeListener(this,`mousedown`,onBarMouseDown);let n=[()=>r.removeSubtreeListener(this,`mousedown`,onBarMouseDown)];if(t){let onBarDoubleClick=e=>{this.isBarChromeTarget(e.target)||t(e)};r.addSubtreeListener(this,`dblclick`,onBarDoubleClick),n.push(()=>r.removeSubtreeListener(this,`dblclick`,onBarDoubleClick))}return this._moveTriggerTeardown=()=>{for(let e of n)e()},this}getEntryIds(){return this._entries.map(e=>e.id)}getActiveEntryId(){return this._activeId}isEntryCloseable(e){return this.entryById(e)?.constraints?.closeable===!0}getEntryName(e){return this.entryById(e)?.name??``}setEntryContentId(e,t){let n=this.entryById(e);return n&&(n.contentId=t,n.button.getAria().setControls(t)),this}setEntryBusy(e,t){return this.entryById(e)?.button.setBusy(t),this}isEntryBusy(e){return this.entryById(e)?.button.isBusy()??!1}getEntryButtonId(e){return this.entryById(e)?.button.getId()??``}entryById(e){return this._entries.find(t=>t.id===e)??null}activeEntry(){return this._activeId===null?null:this.entryById(this._activeId)}createBarEntry(e,t,n){let i=new N(t,{glyph:n?.glyph??void 0,closeable:n?.closeable});i.setInsets(this.computeTabButtonInsets(n)),n?.tooltip&&h.attach(i,n.tooltip),i.on(`action`,()=>this.onTabPressed(i));let a=i.getCloseButton()??void 0,onContextMenu=e=>{this.openTabMenu(o,e.clientX,e.clientY)},o={id:e,button:i,closeButton:a,name:t,constraints:n,contextMenuListener:onContextMenu,contentId:``};a&&a.on(`action`,()=>this.emit(`tabclose`,e)),r.addSubtreeListener(i,`contextmenu`,{prevent:!0,handler:onContextMenu}),this._entries.push(o);let s=this._activeId===null;return s&&(i.setSelected(!0),this._activeId=e),this._buttonGroup.addButton(i),this._rovingTabIndex.add(i),this._tabClip.addItem(i),i.getAria().setRole(`tab`),i.getAria().setSelected(s),this._reorderable&&this.getElement()&&this._dndTeardowns.push(this.makeTabDragSource(o)),this}removeBarEntry(e){let t=this._entries.findIndex(t=>t.id===e);if(t<0)return this;let n=this._entries[t];return this._buttonGroup.removeButton(n.button),this._rovingTabIndex.remove(n.button),this._entries.splice(t,1),this._tabClip.removeItem(n.button),h.detach(n.button),this._activeId===e&&(this._activeId=null),n.button.dispose(),this}moveBarEntry(e,t){let n=this._entries.findIndex(t=>t.id===e);if(n<0)return this;let r=Math.max(0,Math.min(t,this._entries.length-1));if(r===n)return this;let i=this._entries.splice(n,1)[0];return this._entries.splice(r,0,i),this._tabClip.moveItem(i.button,r),this}setActiveEntry(e){let t=this._entries.findIndex(t=>t.id===e);return t<0?this:(this._entries.forEach(e=>e.button.setSelected(!1)),this._entries[t].button.setSelected(!0),this.onTabPressed(this._entries[t].button),this)}setActiveVisual(e){let t=this._entries.findIndex(t=>t.id===e);return t<0?this:(this._entries.forEach(e=>e.button.setSelected(!1)),this._entries[t].button.setSelected(!0),this._activeId=e,this)}openTabMenu(e,t,n){let r=this.activeEntry(),i=this.getEntryIds(),a=i.indexOf(e.id),closeable=e=>this.isEntryCloseable(e),o=this._entries.map(e=>({text:e.name,enabled:e!==r,action:()=>this.setActiveEntry(e.id)})),s=this._side===`west`||this._side===`east`,c=s?`Close all above`:`Close all to the left`,l=s?`Close all below`:`Close all to the right`,u=[{text:`Switch to`,submenu:{label:`Switch to`,items:o}},{separator:!0},{text:`Close`,enabled:e.constraints?.closeable===!0,action:()=>this.emit(`tabclose`,e.id)},this.bulkCloseItem(`Close others`,i,a,closeable,`others`),this.bulkCloseItem(c,i,a,closeable,`left`),this.bulkCloseItem(l,i,a,closeable,`right`),this.bulkCloseItem(`Close all`,i,a,closeable,`all`)],d=this._tools.filter(e=>this._toolMenuItems.has(e)).map(e=>{let t=this._toolMenuItems.get(e);return{text:t.label,glyph:t.glyph,action:t.action}});d.length>0&&(u.push({separator:!0}),u.push({text:`Tools`,submenu:{label:`Tools`,items:d}})),this._contextMenu.show(t,n,u)}bulkCloseItem(e,t,n,r,i){let a=computeBulkCloseIds(t,n,r,i);return{text:e,enabled:a.length>0,action:()=>{for(let e of a)this.emit(`tabclose`,e)}}}onTabPressed(e){let t=this._entries.findIndex(t=>t.button===e);t>=0&&(this._activeId=this._entries[t].id,this._rovingTabIndex.moveTo(t),this._scrollable&&(this._scrollToSelected=!0),this.emit(`tabpressed`,this._entries[t].id))}computeTabButtonInsets(e){let t=o.getResolvedScale(),r=this._compact?Math.round(t.tabButtonInset/2):t.tabButtonInset,i=e?.closeable?t.tabClose:0;return this.isRotatedText()?this._orientation===`vertical-ccw`?new n(i+r*2,r*2,r*2,r*2):new n(r*2,r*2,i+r*2,r*2):this.isVertical()?new n(r*2,i+r*2,r*2,r*2):new n(0,i+r*2,0,r*2)}computeToolButtonInsets(){let e=o.getResolvedScale().tabButtonInset,t=this._compact?Math.round(e/2):e;return this.isVertical()?new n(t*2,0,t*2,0):new n(0,t*2,0,t*2)}clampWrapperMain(e,t,n){this.isVertical()?(e.setMinSize({width:0,height:t}),e.setMaxSize({width:Number.MAX_VALUE,height:n})):(e.setMinSize({width:t,height:0}),e.setMaxSize({width:n,height:Number.MAX_VALUE}))}isRotatedText(){return this.isVertical()&&this._orientation!==`horizontal`}buttonMainExtent(e){let t=e.getPreferredSize();return t?this.isVertical()?t.height:t.width:0}buttonCrossExtent(e){let t=e.getPreferredSize();return t?this.isVertical()?t.width:t.height:0}stripThickness(){let e=this._compact?U:H;if(!this.isVertical()){let t=e;for(let e of this._entries)t=Math.max(t,this.buttonCrossExtent(e.button)+this.stripChrome());return t}if(this._widthMode===`fixed`&&!this.isRotatedText())return Math.max(e,this._fixedWidth);let t=e;for(let e of this._entries)t=Math.max(t,this.buttonCrossExtent(e.button));let n=this._tools.length>0?this._toolGroup.getPreferredSize():null;return n&&(t=Math.max(t,n.width)),t}stripChrome(){let e=o.getResolvedScale().tabButtonInset;return(this._compact?Math.round(e/2):e)*2*2}tabModeExtent(e){switch(this._widthMode){case`fixed`:return this.isVertical()&&!this.isRotatedText()?0:this._fixedWidth;case`equal`:{let e=0;for(let t of this._entries)e=Math.max(e,this.buttonMainExtent(t.button));return Math.min(e,this._maxWidth??Number.MAX_VALUE)}case`content`:return Math.min(this.buttonMainExtent(e),this._maxWidth??Number.MAX_VALUE);default:return 0}}applyTabWidths(e){let t=this._tabClip.getContentBox();if(this._scrollable){t.setMode(`preferred`),t.setOverflowing(!this.isVertical(),this.isVertical());for(let e of this._entries){let t=this.tabModeExtent(e.button);if(t>0)this.clampWrapperMain(e.button,t,t);else{let t=this.isRotatedText()?this.buttonMainExtent(e.button):0;this.clampWrapperMain(e.button,t,Number.MAX_VALUE)}}return}if(t.setOverflowing(!1,!1),this._widthMode===`fill`){t.setMode(`equal`);for(let e of this._entries)this.clampWrapperMain(e.button,0,Number.MAX_VALUE);return}if(t.setMode(`preferred`),this._widthMode===`content`){let e=this._maxWidth??Number.MAX_VALUE;for(let t of this._entries)if(this.isRotatedText()){let n=Math.min(this.buttonMainExtent(t.button),e);this.clampWrapperMain(t.button,n,n)}else this.clampWrapperMain(t.button,0,e);return}let n=this._entries.length>0?this.tabModeExtent(this._entries[0].button):0;if(n<=0){for(let e of this._entries)this.clampWrapperMain(e.button,0,Number.MAX_VALUE);return}if(this._widthMode===`equal`&&this._entries.length>0&&n*this._entries.length>e){t.setMode(`equal`);for(let e of this._entries)this.clampWrapperMain(e.button,0,Number.MAX_VALUE);return}for(let e of this._entries)this.clampWrapperMain(e.button,n,n)}isVertical(){return this._side===`west`||this._side===`east`}syncToolbarOrientation(){let e=this.isVertical();this._tabClip.setOrientation(e?`vertical`:`horizontal`),this._toolGroup.getLayoutManager()instanceof g!==e&&this._toolGroup.setLayoutManager(e?new g({spacing:0,stretching:!0}):new _({spacing:0,stretching:!0})),this._leadGroup.getLayoutManager()instanceof g!==e&&this._leadGroup.setLayoutManager(e?new g({spacing:0,stretching:!0}):new _({spacing:0,stretching:!0}))}toolGroupMainExtent(){let e=this._toolGroup.getPreferredSize();return e?this.isVertical()?e.height:e.width:0}leadWidgetMainExtent(){if(!this._leadWidget)return 0;let e=this._leadGroup.getPreferredSize();return e?(this.isVertical()?e.height:e.width)+W:0}predictTabsExtent(){let e=0;for(let t of this._entries)e+=this.predictedTabExtent(t.button);return e}predictedTabExtent(e){let t=this.tabModeExtent(e);return t>0?t:this.buttonMainExtent(e)}positionClipFrame(e,t,n,r,i,a){let o=this._align===`end`,s=t+(o?e:0),c=o?0:e,l=r-s-c;this.isVertical()?(this._tabClip.setX(i),this._tabClip.setY(s+a),this._tabClip.setWidth(n),this._tabClip.setHeight(l)):(this._tabClip.setX(s+a),this._tabClip.setY(i),this._tabClip.setWidth(l),this._tabClip.setHeight(n))}applyTabButtonStyles(){let e=this._orientation===`vertical-cw`?`sideways-rl`:this._orientation===`vertical-ccw`?`sideways-lr`:null;for(let t of this._entries)t.button.setInsets(this.computeTabButtonInsets(t.constraints)),this.isVertical()&&e?t.button.setWritingMode(e):t.button.clearWritingMode(),t.button.setTextAlign(this._textAlign);let t=this.computeToolButtonInsets();for(let e of this._tools)e.setInsets(t);this._leadWidget&&this._leadWidget.setInsets(t)}endAlignGap(e){return this._align!==`end`||this._widthMode===`fill`||this._entries.length===0?0:Math.max(0,e-this.predictTabsExtent())}positionToolGroup(e,t,n,r,i){if(this._tools.length===0||t<=0){this._toolGroup.setVisible(!1);return}this._toolGroup.setVisible(!0);let a=(this._align===`end`?0:e-t)+i;this.isVertical()?(this._toolGroup.setX(r),this._toolGroup.setY(a),this._toolGroup.setWidth(n),this._toolGroup.setHeight(t)):(this._toolGroup.setX(a),this._toolGroup.setY(r),this._toolGroup.setWidth(t),this._toolGroup.setHeight(n)),this._toolGroup.doLayout()}positionLeadGroup(e,t,n){let r=this._leadWidget?this._leadGroup.getPreferredSize():null,i=r?this.isVertical()?r.height:r.width:0;if(i<=0){this._leadGroup.setVisible(!1);return}this._leadGroup.setVisible(!0),this.isVertical()?(this._leadGroup.setX(t),this._leadGroup.setY(n),this._leadGroup.setWidth(e),this._leadGroup.setHeight(i)):(this._leadGroup.setX(n),this._leadGroup.setY(t),this._leadGroup.setWidth(i),this._leadGroup.setHeight(e)),this._leadGroup.doLayout()}positionIndicator(){let e=this.activeEntry()?.button;if(!e)return;let t=this.isVertical(),n=t?e.getHeight():e.getWidth();if(n<=0)return;let r=t?e.getY()+e.getTranslateY():e.getX()+e.getTranslateX();this._indicator.slideTo(r,n,this._side)}positionCloseButtons(){let e=this.isRotatedText(),t=o.getResolvedScale(),n=t.tabClose,r=t.glyphXs;for(let t of this._entries){let i=t.closeButton;!i||t.button.getWidth()<=0||(i.setWidth(n),i.setHeight(n),i.pinGlyphSize(r),e?(i.setX(Math.round((t.button.getWidth()-n)/2)),i.setY(this._orientation===`vertical-ccw`?2:t.button.getHeight()-n-2)):(i.setX(t.button.getWidth()-n-2),i.setY(Math.round((t.button.getHeight()-n)/2))))}}scrollStepExtent(){return this._entries.length>0&&this.predictedTabExtent(this._entries[0].button)||G}revealSelectedIfRequested(){if(!this._scrollToSelected||(this._scrollToSelected=!1,!this._scrollable))return;let e=this.activeEntry()?.button.getElement();e&&this._tabClip.revealItem(e)}prepareStrip(){this.syncToolbarOrientation(),this.applyTabButtonStyles();for(let e of this._entries)e.button.getAria().setSelected(e.id===this._activeId);return this}placeStrip(e,t,n,r){return this.setX(e),this.setY(t),this.setWidth(n),this.setHeight(r),this.layoutChrome(n,r),this}layoutChrome(e,t){let n=this.getContentInsets(),r=this.isVertical(),i=r?n.getLeft():n.getTop(),a=r?n.getTop():n.getLeft(),o=r?n.getBottom():n.getRight(),s=this._tools.length>0?this.toolGroupMainExtent():0,c=this.stripThickness(),l=this.leadWidgetMainExtent(),u=(r?t:e)-a-o,d=this._tabClip.arrowReserve(this.predictTabsExtent(),u-s-l),f=u-s-l-2*d,p=this.endAlignGap(f);this.positionClipFrame(s,l,c,u,i,a),this.applyTabWidths(f),this._tabClip.layoutContent(d,p),this.revealSelectedIfRequested(),this.positionToolGroup(u,s,c,i,a),this.positionLeadGroup(c,i,a),this.positionIndicator(),this.positionCloseButtons()}installTabDnD(){this.teardownTabDnD();let recordMouseTarget=e=>{this._dragMouseTarget=e.target,this._dragShiftHeld=e.shiftKey};r.addSubtreeListener(this,`mousedown`,recordMouseTarget),this._dndTeardowns.push(()=>r.removeSubtreeListener(this,`mousedown`,recordMouseTarget));for(let e of this._entries)this._dndTeardowns.push(this.makeTabDragSource(e));this._dndTeardowns.push(this.makeTabDropTarget())}makeTabDragSource(t){return t.constraints?.transient?()=>{}:D.makeDragSource(t.button,{dragData:()=>({tabDrag:!0,sourceTabId:this.stripId(),componentId:t.contentId,label:t.name}),onDragStart:()=>{let n=this._dragMouseTarget;this._dragMouseTarget=null;let r=t.closeButton?.getElement();if(r&&e.source.isNode(n)&&e.source.contains(r,e.source.intern(n)))return!1;this.emit(`tabdragstart`,t.id)},onDragEnd:(e,n)=>this.onTabDragEnd(t,e,n)})}makeTabDropTarget(){return D.makeDropTarget(this._tabClip,{suppressValidityTint:!0,accepts:e=>this.isTabHeaderDrag(e),onDragOver:e=>(this._dropTint.showOver(this._tabClip),this.updateReorderSlot(e),e.dragData.sourceTabId!==this.stripId()&&this.scheduleSpringRaise(),null),onDragLeave:()=>{this.clearSpringRaise(),this.hideDropAffordance()},onDrop:e=>{this.clearSpringRaise(),this.dropTabHeader(e)}})}scheduleSpringRaise(){this._springRaiseTimer===null&&(this._springRaiseTimer=setTimeout(()=>{this._springRaiseTimer=null,D.isDragging()&&this.emit(`dockhover`)},T))}clearSpringRaise(){this._springRaiseTimer!==null&&(clearTimeout(this._springRaiseTimer),this._springRaiseTimer=null)}hideDropAffordance(){this._reorderBar.hide(),this._dropTint.hide()}isTabHeaderDrag(e){return e.dragData.tabDrag===!0}dropTabHeader(e){if(e.dragData.sourceTabId===this.stripId()){this.dropReorder(e);return}this.emit(`dockrequested`,e.dragData.componentId,this._dragInsertIndex),this.hideDropAffordance(),this._dragInsertIndex=-1}stripId(){return this.getId()}onTabDragEnd(e,t,n){if(!n){this.emit(`tearoffrequested`,e.id,t.clientX,t.clientY,this._dragShiftHeld);return}this.emit(`detach`,e.id)}updateReorderSlot(t){let n=this._tabClip.getClipElement();if(!n)return;let r=e.source.getElementRect(n),i=this.isVertical(),a=(i?t.clientY-r.top:t.clientX-r.left)+this._tabClip.mainScroll(),o=this._entries.length;for(let e=0;e<this._entries.length;e++){let t=this._entries[e].button;if(a<(i?t.getY()+t.getTranslateY():t.getX()+t.getTranslateX())+(i?t.getHeight():t.getWidth())/2){o=e;break}}this._dragInsertIndex=o;let s=this.slotBoundary(o,i),c=i?this._tabClip.getWidth():this._tabClip.getHeight();this._reorderBar.placeAt(s,c,i)}slotBoundary(e,t){if(e<this._entries.length){let n=this._entries[e].button;return t?n.getY()+n.getTranslateY():n.getX()+n.getTranslateX()}if(this._entries.length>0){let e=this._entries[this._entries.length-1].button;return t?e.getY()+e.getTranslateY()+e.getHeight():e.getX()+e.getTranslateX()+e.getWidth()}return 0}dropReorder(e){this.hideDropAffordance();let t=this._entries.findIndex(t=>t.button.getId()===e.sourceId);t<0||this._dragInsertIndex<0||(this.reorderTab(t,this._dragInsertIndex),this._dragInsertIndex=-1)}reorderTab(e,t){if(e<0||e>=this._entries.length)return;let n=t>e?t-1:t;if(n=Math.max(0,Math.min(n,this._entries.length-1)),n===e)return;let r=this._entries[e].id,i=this._entries[e];this._entries.splice(e,1),this._entries.splice(n,0,i),this._tabClip.moveItem(i.button,n),this.emit(`reorder`,r,n)}teardownTabDnD(){for(let e of this._dndTeardowns)e();this._dndTeardowns=[],this.hideDropAffordance()}onToolbarKeyDown(e){if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=this._entries.length;if(t===0)return;let n=this._entries.findIndex(e=>e.id===this._activeId),r=n>=0?n:0,i=e.key===`ArrowRight`?(r+1)%t:(r-1+t)%t,a=this._entries[i].button;return this._entries.forEach(e=>e.button.setSelected(!1)),a.setSelected(!0),this.onTabPressed(a),{prevent:!0}}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}},J=i(TabBar),Y=480,X=360,Z=120,Tab=class extends s{_bar=new J;_barVisible=!0;_contents=[];_selectedTabIndex=0;_pendingActiveContent=null;_lastFadedTabIndex=-1;_tabFadeAnimation=null;_listeners=this.registerListenerBag(new u);_barIgnoreParentInsets=!1;_detachWindowMode=`strip`;_closeHostWindowWhenEmpty=!1;_idSeq=0;_themeCleanup=null;constructor(e){super(),this._themeCleanup=o.onThemeChange(()=>{this.getContainer()?.scheduleLayout()}),e&&this.applyOptions(e)}applyOptions(e){if(super.applyOptions(e),e.listeners!==void 0){let t=e.listeners;for(let e of Object.keys(t)){let n=t[e];n!==void 0&&this.on(e,n)}}if(e.widthMode!==void 0&&this.setWidthMode(e.widthMode),e.maxWidth!==void 0&&this.setMaxWidth(e.maxWidth),e.fixedWidth!==void 0&&this.setFixedWidth(e.fixedWidth),e.underBorderFullWidth!==void 0&&this.setUnderBorderFullWidth(e.underBorderFullWidth),e.side!==void 0&&this.setSide(e.side),e.align!==void 0&&this.setAlign(e.align),e.orientation!==void 0&&this.setOrientation(e.orientation),e.scrollable!==void 0&&this.setScrollable(e.scrollable),e.compact!==void 0&&this.setCompact(e.compact),e.reorderable!==void 0&&this.setReorderable(e.reorderable),e.barIgnoreParentInsets!==void 0&&this.setBarIgnoreParentInsets(e.barIgnoreParentInsets),e.detachWindowMode!==void 0&&this.setDetachWindowMode(e.detachWindowMode),e.textAlign!==void 0&&this.setTextAlign(e.textAlign),e.tools!==void 0)for(let t of e.tools)t instanceof c,this.addTool(t)}setWidthMode(e){return this._bar.setWidthMode(e),this.getContainer()?.scheduleLayout(),this}getWidthMode(){return this._bar.getWidthMode()}setMaxWidth(e){return this._bar.setMaxWidth(e),this.getContainer()?.scheduleLayout(),this}getMaxWidth(){return this._bar.getMaxWidth()}setFixedWidth(e){return this._bar.setFixedWidth(e),this.getContainer()?.scheduleLayout(),this}getFixedWidth(){return this._bar.getFixedWidth()}setUnderBorderFullWidth(e){return this._bar.setUnderBorderFullWidth(e),this.getContainer()?.scheduleLayout(),this}isUnderBorderFullWidth(){return this._bar.isUnderBorderFullWidth()}setSide(e){return this._bar.setSide(e),this.getContainer()?.scheduleLayout(),this}getSide(){return this._bar.getSide()}setAlign(e){return this._bar.setAlign(e),this.getContainer()?.scheduleLayout(),this}getAlign(){return this._bar.getAlign()}setOrientation(e){return this._bar.setOrientation(e),this.getContainer()?.scheduleLayout(),this}getOrientation(){return this._bar.getOrientation()}setTextAlign(e){return this._bar.setTextAlign(e),this.getContainer()?.scheduleLayout(),this}getTextAlign(){return this._bar.getTextAlign()}setScrollable(e){return this._bar.setScrollable(e),this.getContainer()?.scheduleLayout(),this}isScrollable(){return this._bar.isScrollable()}setCompact(e){return this._bar.setCompact(e),this.getContainer()?.scheduleLayout(),this}isCompact(){return this._bar.isCompact()}setReorderable(e){return this._bar.setReorderable(e),this}isReorderable(){return this._bar.isReorderable()}setBarVisible(e){return this._barVisible===e?this:(this._barVisible=e,this.getContainer()?.scheduleLayout(),this)}isBarVisible(){return this._barVisible}isEmpty(){return this._contents.length===0}setBarIgnoreParentInsets(e){return this._barIgnoreParentInsets=e,this.getContainer()?.scheduleLayout(),this}isBarIgnoreParentInsets(){return this._barIgnoreParentInsets}setDetachWindowMode(e){return this._detachWindowMode=e,this}getDetachWindowMode(){return this._detachWindowMode}setCloseHostWindowWhenEmpty(e){return this._closeHostWindowWhenEmpty=e,this}addTool(e){return e instanceof c&&e instanceof M&&e.setFlat(!0),this._bar.addTool(e),this.getContainer()?.scheduleLayout(),this}removeTool(e){return this._bar.removeTool(e),this.getContainer()?.scheduleLayout(),this}setBarLeadingWidget(e){return this._bar.setLeadingWidget(e),this.getContainer()?.scheduleLayout(),this}setBarBackgroundColor(e){return this._bar.setBarSurfaceColor(e),this}installBarMoveTrigger(e,t){return this._bar.installMoveTrigger(e,t),this}mintId(){return`tab-`+this._idSeq++}attach(t){return super.attach(t),e.sink.appendChild(t.getElement(!0),this._bar.getElement(!0)),this._bar.on(`tabpressed`,this._onBarTabPressed),this._bar.on(`reorder`,this._onBarReordered),this._bar.on(`tabclose`,this._onBarTabClose),this._bar.on(`dockrequested`,this._onBarDockRequested),this._bar.on(`tabdragstart`,this._onBarTabDragStart),this._bar.on(`tearoffrequested`,this._onBarTearOffRequested),this._bar.on(`detach`,this._onBarDetached),this._bar.on(`dockhover`,this._onBarDockHover),this}detach(){this._tabFadeAnimation?.cancel(),this._tabFadeAnimation=null;for(let e of this._contents)e.materializeAnimation?.cancel(),e.materializeAnimation=null;return super.detach(),this._themeCleanup&&=(this._themeCleanup(),null),this._bar.off(`tabpressed`,this._onBarTabPressed),this._bar.off(`reorder`,this._onBarReordered),this._bar.off(`tabclose`,this._onBarTabClose),this._bar.off(`dockrequested`,this._onBarDockRequested),this._bar.off(`tabdragstart`,this._onBarTabDragStart),this._bar.off(`tearoffrequested`,this._onBarTearOffRequested),this._bar.off(`detach`,this._onBarDetached),this._bar.off(`dockhover`,this._onBarDockHover),this._bar.dispose(),this}_onBarTabPressed=e=>{let t=this._contents.findIndex(t=>t.id===e);if(t>=0){this._selectedTabIndex=t;let e=this._contents[t];this.emit(`select`,t,this._bar.getEntryName(e.id)),e.state===`lazy`&&this.materializeAsync(t),e.component?this.emit(`activate`,e.component,t):e.announceActivation=!0}this.getContainer()?.scheduleLayout()};_onBarReordered=(e,t)=>{let n=this._bar.getEntryIds(),r=this._contents[this._selectedTabIndex]??null;if(this._contents.sort((e,t)=>n.indexOf(e.id)-n.indexOf(t.id)),r){let e=this._contents.indexOf(r);e>=0&&(this._selectedTabIndex=e)}this.getContainer()?.scheduleLayout()};_onBarTabClose=e=>{this.closeEntry(e)};closeEntry(e){let t=this.getContainer();if(!t)return;let n=this._contents.findIndex(t=>t.id===e);if(n<0)return;let r=this._selectedTabIndex===n,i=this._contents[n].component,a=this._contents[n].spinner;this._contents[n].materializeAnimation?.cancel(),this._bar.removeBarEntry(e),this._contents.splice(n,1);let o;i&&(o=t.removeComponent(i)),a&&(t.removeComponent(a),a.dispose()),i&&(this.emit(`tabclose`,i),o?.disposeOnClose!==!1&&i.getParentComponent()===null&&i.dispose()),this.selectNextContent(n,r),this.getContainer()?.scheduleLayout(),this.syncHostWindowCloseable(),this.closeHostWindowIfEmpty(),this._contents.length===0&&this.emit(`empty`)}closeTab(e){let t=this._contents.find(t=>t.component===e);return t?(this.closeEntry(t.id),!0):!1}setTabBusy(e,t){let n=this._contents.find(t=>t.component===e);return n?(this.setEntryBusy(n,t),!0):!1}isTabBusy(e){let t=this._contents.find(t=>t.component===e);return t?this._bar.isEntryBusy(t.id):!1}_onBarDockRequested=(e,t)=>{let n=E.get(e);n&&(this.dockComponent(n,t),this.ancestorWindow()?.bringToFront(),this.emit(`dock`,n))};_onBarDockHover=()=>{this.ancestorWindow()?.bringToFront()};_onBarTabDragStart=e=>{let t=this._contents.find(t=>t.id===e);t&&t.state===`ready`&&t.component&&E.set(t.component.getId(),t.component)};_onBarTearOffRequested=(e,t,n,r)=>{let i=this._contents.find(t=>t.id===e);i&&(i.component&&E.delete(i.component.getId()),!(i.state!==`ready`||!i.component)&&this.detachTabToWindow(e,i.component,t,n,r))};_onBarDetached=e=>{let t=this._contents.find(t=>t.id===e);if(!t)return;let n=t.component;n&&E.delete(n.getId()),!(t.state!==`ready`||!n)&&((this.getContainer()?.getComponents().includes(n)??!1)||this.removeEntryKeepingContent(e))};getVisibleComponent(){let e=this.getContainer();if(!e)return null;let t=this._contents[this._selectedTabIndex];return t?t.state===`building`&&t.spinner?t.spinner:t.component?t.component:null:e.getComponents()[this._selectedTabIndex]??null}getPreferredSize(){return this.composeSize(this.getVisibleComponent()?.getPreferredSize())}getMinSize(){return this.composeSize(this.getVisibleComponent()?.getMinSize())}getMaxSize(){return this.composeSize(this.getVisibleComponent()?.getMaxSize())}isVertical(){let e=this._bar.getSide();return e===`west`||e===`east`}composeSize(e){let t=this.getContainer();if(!t||!e)return null;let n=t.getPerimeterSize(),r=n.left+n.right,i=n.top+n.bottom,a=this._bar.stripThickness();return this.isVertical()?{width:e.width+a+r,height:e.height+i}:{width:e.width+r,height:e.height+a+i}}createTab(e){let t=this.getLayoutConstraints(e),n=t?.name??e.getName()??e.getId(),r=this.mintId();this._bar.createBarEntry(r,n,t),this._contents.push({id:r,component:e,factory:null,spinner:null,state:`ready`,materializeAnimation:null,announceActivation:!1}),this.wireComponentAria(r,e),this.syncHostWindowCloseable()}wireComponentAria(e,t){this._bar.setEntryContentId(e,t.getId()),t.getAria().setRole(`tabpanel`),t.getAria().setTabIndex(-1),t.getAria().setLabelledBy(this._bar.getEntryButtonId(e))}addDeferredComponent(e,t){if(t?.lazy===!1)return!1;this.syncUntabbedChildren();let n=this.mintId();return this._bar.createBarEntry(n,t?.name??n,t),this._contents.push({id:n,component:null,factory:e,spinner:null,state:`lazy`,materializeAnimation:null,announceActivation:!1}),this.getContainer()?.scheduleLayout(),!0}addLazyTab(e,t,n){this.addDeferredComponent(e,Object.assign(new j,n,{name:t,lazy:!0}))}syncUntabbedChildren(){let e=this.getContainer();if(!e)return;let t=new Set;for(let e of this._contents)e.component&&t.add(e.component),e.spinner&&t.add(e.spinner);for(let n of e.getComponents())t.has(n)||this.createTab(n)}setEntryBusy(e,t){this._bar.isEntryBusy(e.id)!==t&&(this._bar.setEntryBusy(e.id,t),this.emit(`busychange`,t,this._bar.getEntryName(e.id)))}materializeAsync(e){let t=this._contents[e];if(!t||t.state!==`lazy`)return;let n=t.factory;if(!n)return;let r=this.getContainer();if(!r)return;let i=C();t.spinner=i,t.state=`building`,this.setEntryBusy(t,!0),t.materializeAnimation?.cancel(),t.materializeAnimation=l.materialize({host:r,factory:()=>{let e=n();return e instanceof Promise?e.then(e=>(t.component=e,e)):(t.component=e,e)},spinnerComponent:i,isStale:()=>!this._contents.includes(t),onError:e=>this.failEntry(t,e),onReady:e=>{this.setEntryBusy(t,!1),t.component=e,t.factory=null,t.spinner=null,t.state=`ready`,this.wireComponentAria(t.id,e),r.scheduleLayout(),this.announcePendingActivation(t)}})}announcePendingActivation(e){!e.announceActivation||!e.component||(e.announceActivation=!1,this._contents[this._selectedTabIndex]===e&&this.emit(`activate`,e.component,this._selectedTabIndex))}failEntry(e,t){let n=this._bar.getEntryName(e.id);e.spinner=null,e.factory=null,this.closeEntry(e.id),this.emit(`exception`,t,n)}computeTotalMinSize(){let e=this.getContainer();return e?(this.getVisibleComponent()??e.getComponents()[0])?.getMinSize()??{width:0,height:0}:{width:0,height:0}}doLayout(){let e=this.getContainer();if(!e)return;let t=e.getComponents(),r=e.getInnerSize(),i=e.getContentInsets();if(this.syncUntabbedChildren(),this._pendingActiveContent){let e=this.indexOfContent(this._pendingActiveContent);e>=0&&(this._pendingActiveContent=null,this.setActiveTabIndex(e))}let o=this._contents[this._selectedTabIndex];o&&o.state===`lazy`&&this.materializeAsync(this._selectedTabIndex);for(let e of t)e.setVisible(!1),e.getAria().setHidden(!0);let s=this.getVisibleComponent();!s&&t.length>0&&(s=t[0]),this._bar.setVisible(this._barVisible),this._barVisible&&this._bar.prepareStrip();let c=r??{width:0,height:0},u=i.getLeft(),d=i.getTop(),f=this._barVisible?this._bar.stripThickness():0,p=u,m=d,h=c.width,g=f,_=u,v=d,y=c.width,b=c.height;switch(this._bar.getSide()){case`north`:v=d+f,b=c.height-f;break;case`south`:m=d+c.height-f,b=c.height-f;break;case`west`:h=f,g=c.height,_=u+f,y=c.width-f;break;case`east`:p=u+c.width-f,h=f,g=c.height,y=c.width-f}if(this._barIgnoreParentInsets){let e=i.getLeft(),t=i.getTop(),r=i.getRight(),a=i.getBottom();switch(this._bar.getSide()){case`north`:p=0,m=0,h=c.width+e+r,g=f+t,this._bar.setInsets(new n(t,r,0,e));break;case`south`:p=0,m=d+c.height-f,h=c.width+e+r,g=f+a,this._bar.setInsets(new n(0,r,a,e));break;case`west`:p=0,m=0,h=f+e,g=c.height+t+a,this._bar.setInsets(new n(t,0,a,e));break;case`east`:p=u+c.width-f,m=0,h=f+r,g=c.height+t+a,this._bar.setInsets(new n(t,r,a,0))}}else this._bar.clearInsets();if(this._barVisible&&this._bar.placeStrip(p,m,h,g),!s)return;s.setVisible(!0),s.getAria().setHidden(!1);let x=this.inflateForOverflow({width:y,height:b}),S=x.width,C=x.height;if(this.placeComponent(s,_,v,S,C,a.BOTH),this._contents[this._selectedTabIndex]?.state===`ready`&&this._lastFadedTabIndex!==this._selectedTabIndex){this._lastFadedTabIndex=this._selectedTabIndex;let e=s.getElement();e&&(this._tabFadeAnimation?.cancel(),this._tabFadeAnimation=l.play(e,{from:{opacity:`0`},to:{opacity:`1`},durationMs:Z,properties:[`opacity`]}))}}getActiveTabIndex(){return this._selectedTabIndex}getActiveContent(){return this._contents[this._selectedTabIndex]?.component??null}indexOfContent(e){return this._contents.findIndex(t=>t.component===e)}getActiveTabLabel(){let e=this._bar.getActiveEntryId();return e===null?null:this._bar.getEntryName(e)}setActiveContent(e){let t=this.indexOfContent(e);return t>=0?(this._pendingActiveContent=null,this.setActiveTabIndex(t)):this._pendingActiveContent=e,this}setActiveTabIndex(e){if(this._contents.length===0)return this;let n=t.clamp(e,0,this._contents.length-1);return this._bar.setActiveEntry(this._contents[n].id),this}dockComponent(e,n){let r=this.getContainer();if(!r)return;r.moveComponent(e,n),this.createTab(e);let i=this._contents.length-1,a=t.clamp(n,0,i);if(a!==i){let e=this._contents[i];this._contents.splice(i,1),this._contents.splice(a,0,e),this._bar.moveBarEntry(e.id,a)}this.setActiveTabIndex(a),r.scheduleLayout()}removeEntryKeepingContent(e){let t=this._contents.findIndex(t=>t.id===e);if(t<0)return;let n=this._selectedTabIndex===t;this._contents[t].materializeAnimation?.cancel(),this._bar.removeBarEntry(e),this._contents.splice(t,1),this.selectNextContent(t,n),this.getContainer()?.scheduleLayout(),this.syncHostWindowCloseable(),this.closeHostWindowIfEmpty(),this._contents.length===0&&this.emit(`empty`)}detachTabToWindow(e,t,n,r,i){let a=!i&&this._detachWindowMode===`strip`,o=a?new $({closeable:this._bar.isEntryCloseable(e)}):new w(this._bar.getEntryName(e),{closeable:this._bar.isEntryCloseable(e)});o.setX(n),o.setY(r),o.setSize({width:Y,height:X}),o.clampPositionToViewport(),a?this.fillWindowWithStrip(o,t):(o.moveComponent(t),o.show()),this.removeEntryKeepingContent(e),o.bringToFront(),this.emit(`detach`,o)}fillWindowWithStrip(e,t){e.createTab(t),e.show()}hostWindow(){if(!this._closeHostWindowWhenEmpty)return null;let e=this.getContainer();for(;e&&!(e instanceof x);)e=e.getParentComponent();return e instanceof x?e:null}ancestorWindow(){for(let e=this.getContainer();e;e=e.getParentComponent())if(e instanceof x)return e;return null}closeHostWindowIfEmpty(){this._contents.length>0||this.hostWindow()?.requestClose()}syncHostWindowCloseable(){let e=this.hostWindow();e&&e.setCloseable(this._bar.getEntryIds().every(e=>this._bar.isEntryCloseable(e)))}selectNextContent(e,t){if(this._contents.length===0){this._selectedTabIndex=0;return}if(!t){this._selectedTabIndex>e&&--this._selectedTabIndex;return}let n=e>0?e-1:0;this._selectedTabIndex=n,this._bar.setActiveVisual(this._contents[n].id)}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}},Q=i(Tab),ne=30,re=120,TabWindow=class extends x{_tab;_closeTool;_minTool;_maxTool;_leadGlyphBtn;_boundOnLeadGlyphAction=()=>this.onLeadGlyphAction();constructor(e){super(e),this._tab=new Q({reorderable:!0,widthMode:`fixed`,textAlign:`start`,compact:!0,barIgnoreParentInsets:!0}),this._tab.setCloseHostWindowWhenEmpty(!0),this.setLayoutManager(this._tab),this._minTool=S(`window-minimize`),this._maxTool=S(`window-maximize`),this._closeTool=S(`xmark`),this._minTool.on(`action`,()=>this.toggleMinimize()),this._maxTool.on(`action`,()=>this.toggleMaximize()),this._closeTool.on(`action`,()=>this.requestClose()),this._tab.addTool(this._minTool),this._tab.addTool(this._maxTool),this._tab.addTool(this._closeTool),this._leadGlyphBtn=b(this._options.glyph??`window-maximize`),this._leadGlyphBtn.on(`action`,this._boundOnLeadGlyphAction),this._tab.setBarLeadingWidget(this._leadGlyphBtn),this.initChrome(e)}createTab(e){return this.addContent(e),this}setGlyph(e){return this._leadGlyphBtn.setGlyph(e),this}wireMoveTrigger(){this._tab.installBarMoveTrigger(e=>this.startMoveFrom(e),()=>this.onBarDoubleClick())}onBarDoubleClick(){if(this.getWindowState()===`minimized`){this.setWindowState(this._preMinimizeState);return}this.canMaximize()&&this.toggleMaximize()}onLeadGlyphAction(){this.openWindowMenu(this._leadGlyphBtn)}reflectCloseable(e){this._closeTool.setEnabled(e)}reflectMinimizable(e){this._minTool.setVisible(e)}reflectMaximizable(e){this._maxTool.setVisible(e)}reflectMaximizeAvailability(e){this._maxTool.setEnabled(e)}reflectMaximizeState(e){}paintActive(e){this._tab.setBarBackgroundColor(e?`var(--ts-ui-tab-toolbar-bg, #eee)`:`var(--ts-ui-gutter-bg, rgb(200, 200, 200))`),this.setControlsActive(e)}setControlsActive(e){y([this._minTool,this._maxTool,this._closeTool],e)}getTitle(){return this._tab.getActiveTabLabel()??``}minContentWidthSeed(){return re}chromeHeight(){return ne}addContent(e){this.moveComponent(e),this._tab.createTab(e)}isChromeComponent(e){return!1}},$=i(TabWindow);function toLayoutSizes(e,t){let clean=e=>Number.isFinite(e)&&e>0?e:0,n=e.filter(e=>e===`ratio`).length,r=0;for(let n=0;n<e.length;n+=1)e[n]===`ratio`&&(r+=clean(t[n]));return e.map((e,i)=>e===`px`?{unit:e,value:clean(t[i])}:{unit:e,value:r>0?clean(t[i])/r:1/n})}function fromLayoutSizes(e,t){let n=0,r=0,i=0;for(let t of e)t.unit===`px`?n+=t.value:(r+=t.value,i+=1);let a=t>0?Math.max(0,t-n):0,o=a>0?a:1;return e.map(e=>e.unit===`px`?e.value:r>0?e.value/r*o:o/i)}function isRestorableSizes(e,t){return t.length===0||e.length!==t.length?!1:e.every((e,n)=>e!=null&&e.unit===t[n]&&Number.isFinite(e.value)&&e.value>=0)&&e.some(e=>e.value>0)}function normalizeRatios(e,t){let n=[];for(let r=0;r<t;r+=1){let t=e[r];n.push(Number.isFinite(t)&&t>0?t:0)}let r=n.reduce((e,t)=>e+t,0);return r>0?n.map(e=>e/r):n.map(()=>1/t)}var ie=.5,RadioMenuRow=class extends O{_radio;_iconStart=null;_checkZone=null;_onMouseOver;_onMouseOut;_onClick;constructor(e,t){super(e,t),this._radio=new v(e?.text??``,{selected:e?.checked??!1,enabled:e?.enabled??!0}),this._radio.setPointerEvents(`none`),this.addComponent(this._radio),e?.enabled===!1&&(this.setPointerEvents(`none`),this.setOpacity(ie)),this._onMouseOver=()=>{this.setFocused(!0)},this._onMouseOut=()=>{this.setFocused(!1)},this._onClick=()=>{this.activate()},r.addListener(this,`mouseover`,this._onMouseOver),r.addListener(this,`mouseout`,this._onMouseOut),r.addListener(this,`click`,this._onClick),this.applyListeners(e?.listeners)}isChecked(){return this._radio.isSelected()}setChecked(e){return this._radio.setSelected(e),this}isNavigable(){return!0}isEnabled(){return this._radio.isEnabled()}activate(){this.isEnabled()&&this.setChecked(!0)}getContentWidth(){return Math.ceil(this._radio.getPreferredSize()?.width??0)+k.RIGHT_PAD}setColumns(e,t,n){this._checkZone=e,this._iconStart=t,this.scheduleLayout()}doLayout(){super.doLayout();let e=this.getContentBounds();if(!e)return this;let t=this._radio.getPreferredSize()??{width:0,height:0},n=this._checkZone??0,r=this._iconStart!==null&&this._iconStart-n===k.ICON_ZONE?n+4:this._iconStart??k.TEXT_INSET,i=Math.max(0,Math.floor((e.height-t.height)/2));return this._radio.setX(e.x+r),this._radio.setY(e.y+i),this._radio.setWidth(Math.max(0,e.width-r-k.RIGHT_PAD)),this._radio.setHeight(t.height),this}on(e,t){return r.addListener(this,`click`,t),this}off(e,t){return r.removeListener(this,`click`,t),this}},ae=i(RadioMenuRow);export{toLayoutSizes as a,J as c,normalizeRatios as i,B as l,fromLayoutSizes as n,$ as o,isRestorableSizes as r,Q as s,ae as t,I as u};
2
+ //# sourceMappingURL=RadioMenuRow-B2bthoxj.js.map