efficient-shell 11.2.0 → 11.5.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 (263) hide show
  1. package/README.md +17 -0
  2. package/dist/{Browser-2JOFXNUA.js → Browser-URFWAJYZ.js} +14 -14
  3. package/dist/Calculator-OJSMHQKW.js +29 -0
  4. package/dist/{CurrencyConverter-6WJWHZUQ.js → CurrencyConverter-CUIFL32O.js} +6 -6
  5. package/dist/{Documents-DY2OBQNR.js → Documents-Y62EQJWN.js} +13 -13
  6. package/dist/{Files-ADJB2IFU.js → Files-NXY7XRZD.js} +41 -41
  7. package/dist/{Notepad-HOJSMCCF.js → Notepad-LYK7OAGU.js} +9 -9
  8. package/dist/{PomodoroTimer-5GWSBJW5.js → PomodoroTimer-IMNUQQAC.js} +21 -21
  9. package/dist/{Preview-JZBO2SP5.js → Preview-ZKPVPYYL.js} +19 -19
  10. package/dist/Sidebar-BCTWRG7P.js +44 -0
  11. package/dist/{Spreadsheet-SS5Y3DV2.js → Spreadsheet-BPW2TLVQ.js} +14 -14
  12. package/dist/{Stock-3LSKLYGI.js → Stock-S6URCQBQ.js} +2 -2
  13. package/dist/{Weather-26PCYFUR.js → Weather-SM5ZQUE2.js} +19 -19
  14. package/dist/{WorldClock-KRL72Y53.js → WorldClock-I26FGYJO.js} +4 -4
  15. package/dist/ai/index.js +91 -91
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/charts/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/CartesianPlot.js +1 -1
  22. package/dist/charts/ChartTooltip.js +1 -1
  23. package/dist/charts/ChordChart.js +1 -1
  24. package/dist/charts/ColumnChart.js +1 -1
  25. package/dist/charts/FunnelChart.js +1 -1
  26. package/dist/charts/HeatmapChart.js +1 -1
  27. package/dist/charts/HistogramChart.js +1 -1
  28. package/dist/charts/PieChart.js +1 -1
  29. package/dist/charts/RadarChart.js +1 -1
  30. package/dist/charts/RadialBarChart.js +1 -1
  31. package/dist/charts/RangeChart.js +1 -1
  32. package/dist/charts/SankeyChart.js +1 -1
  33. package/dist/charts/ScatterChart.js +1 -1
  34. package/dist/charts/SpecChart.js +1 -1
  35. package/dist/charts/SunburstChart.js +1 -1
  36. package/dist/charts/TimeSeriesChart.js +1 -1
  37. package/dist/charts/TreemapChart.js +1 -1
  38. package/dist/charts/WaterfallChart.js +1 -1
  39. package/dist/{chunk-QMUIXKBQ.js → chunk-2N64TKI5.js} +1 -1
  40. package/dist/{chunk-OEQ52KWJ.js → chunk-2PGR2276.js} +1 -1
  41. package/dist/{chunk-SHO35OPO.js → chunk-36PJGT4W.js} +3 -3
  42. package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
  43. package/dist/{chunk-LJAYUDN2.js → chunk-3BFZVVAT.js} +1 -1
  44. package/dist/chunk-3XZFWR6T.js +13 -0
  45. package/dist/chunk-4BCFBF3C.js +9 -0
  46. package/dist/{chunk-OTVK7DJM.js → chunk-4DDL6NXB.js} +1 -1
  47. package/dist/{chunk-YDMXW2Q4.js → chunk-4EBJO7ER.js} +11 -11
  48. package/dist/{chunk-T7PVHIXI.js → chunk-4P3324KU.js} +1 -1
  49. package/dist/chunk-4P57TIFK.js +2 -0
  50. package/dist/{chunk-ZXVJL7MS.js → chunk-4RGMRXYH.js} +1 -1
  51. package/dist/{chunk-P4VKU3SL.js → chunk-55AEZX6K.js} +1 -1
  52. package/dist/chunk-5PDHKH2A.js +3 -0
  53. package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
  54. package/dist/{chunk-GAIB5FEE.js → chunk-5XFBZ7C3.js} +74 -74
  55. package/dist/{chunk-NEZA7V6H.js → chunk-6IOFNPR6.js} +4 -4
  56. package/dist/{chunk-G3KXB7SP.js → chunk-6KGIHI6X.js} +4 -4
  57. package/dist/{chunk-MDV7UQJD.js → chunk-6M5O2P64.js} +9 -9
  58. package/dist/{chunk-COGSXN4D.js → chunk-7FW2BQTV.js} +2 -2
  59. package/dist/{chunk-FA5FBNWF.js → chunk-7JVGF555.js} +1 -1
  60. package/dist/chunk-7LU3H72S.js +7 -0
  61. package/dist/{chunk-PFKXPSOM.js → chunk-A6FR2D46.js} +5 -5
  62. package/dist/{chunk-SXQZ5GTA.js → chunk-AFG34RBV.js} +6 -6
  63. package/dist/{chunk-SS5SQMIB.js → chunk-AIJ6OR6X.js} +2 -2
  64. package/dist/{chunk-BQPMZXNB.js → chunk-AWGJIDBR.js} +1 -1
  65. package/dist/{chunk-BTRV3SMB.js → chunk-BBXFIBXB.js} +1 -1
  66. package/dist/{chunk-SX5BSWTN.js → chunk-BMXTPJ7T.js} +5 -5
  67. package/dist/{chunk-3TXSYEQM.js → chunk-BUO7XCYR.js} +13 -13
  68. package/dist/chunk-CH3JQUDW.js +8 -0
  69. package/dist/chunk-CJSZW3OS.js +1 -0
  70. package/dist/{chunk-4TGZODSH.js → chunk-COF33H6J.js} +5 -5
  71. package/dist/{chunk-MIC2F3W3.js → chunk-D5HGRACW.js} +1 -1
  72. package/dist/{chunk-ESZHN7PV.js → chunk-DIEH76MB.js} +1 -1
  73. package/dist/{chunk-A3Q7X35W.js → chunk-DOF56HTO.js} +6 -6
  74. package/dist/{chunk-TQE6O2JA.js → chunk-DVYIBJ3S.js} +3 -3
  75. package/dist/{chunk-MTIP5DH2.js → chunk-DWAA4YZV.js} +3 -3
  76. package/dist/{chunk-3NRQNKVP.js → chunk-DZOJQURG.js} +3 -3
  77. package/dist/{chunk-5F2AIDPY.js → chunk-E3EJWNNK.js} +9 -9
  78. package/dist/chunk-EOVXFXVV.js +2 -0
  79. package/dist/chunk-EVX7AZII.js +9 -0
  80. package/dist/chunk-EXLHFM3V.js +6 -0
  81. package/dist/{chunk-LK5A2SGA.js → chunk-F56UUBKG.js} +1 -1
  82. package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
  83. package/dist/{chunk-6EIZOX6W.js → chunk-G66SG6JN.js} +9 -9
  84. package/dist/chunk-GBATZZX7.js +1 -0
  85. package/dist/{chunk-ZD36QKQS.js → chunk-H5NIW2KS.js} +1 -1
  86. package/dist/{chunk-4LQDORA6.js → chunk-HAYGUFNM.js} +13 -13
  87. package/dist/chunk-HFDSKCPL.js +1 -0
  88. package/dist/{chunk-HEGSRTXG.js → chunk-HNUKXGYP.js} +3 -3
  89. package/dist/{chunk-355CRSFS.js → chunk-HNVSVTNC.js} +11 -11
  90. package/dist/{chunk-6TJCIS5E.js → chunk-ILY4DU3D.js} +1 -1
  91. package/dist/{chunk-RRE2NNFS.js → chunk-IPO4LHSB.js} +6 -6
  92. package/dist/{chunk-IGLPL2QU.js → chunk-KXU4ORKE.js} +1 -1
  93. package/dist/{chunk-VUIGU2LQ.js → chunk-KYBXJL6A.js} +15 -15
  94. package/dist/{chunk-4XNVIKZZ.js → chunk-LCSMBVMU.js} +3 -3
  95. package/dist/chunk-LDZQJLMC.js +3 -0
  96. package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
  97. package/dist/chunk-M66ACZXQ.js +5 -0
  98. package/dist/{chunk-DU4WEVNS.js → chunk-MCAPJSB6.js} +1 -1
  99. package/dist/chunk-MHPFBVDD.js +8 -0
  100. package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
  101. package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
  102. package/dist/{chunk-3XTSXZAC.js → chunk-NRALUW6P.js} +7 -7
  103. package/dist/chunk-NWC6YCIJ.js +11 -0
  104. package/dist/{chunk-VQBEZNHC.js → chunk-NZ34BQKH.js} +1 -1
  105. package/dist/chunk-NZISMTQE.js +7 -0
  106. package/dist/{chunk-KBV2UOTG.js → chunk-OA54HARK.js} +6 -6
  107. package/dist/{chunk-4MBYFQOI.js → chunk-OEPYQUXZ.js} +8 -8
  108. package/dist/{chunk-BW47XJLH.js → chunk-OKHKY3ZZ.js} +1 -1
  109. package/dist/{chunk-UGGHQYDN.js → chunk-P7H2DXJB.js} +10 -10
  110. package/dist/{chunk-GSF2UZTX.js → chunk-PLC656AN.js} +1 -1
  111. package/dist/{chunk-LGDMGDSV.js → chunk-PSR6SXCC.js} +11 -11
  112. package/dist/chunk-Q2SCJQ5H.js +1 -0
  113. package/dist/{chunk-EB2IQNM5.js → chunk-QALPUJR2.js} +1 -1
  114. package/dist/{chunk-RABYGQQU.js → chunk-QO5E33DH.js} +2 -2
  115. package/dist/{chunk-CD7UWMPX.js → chunk-QOI4GQVH.js} +1 -1
  116. package/dist/{chunk-ZD56IH5K.js → chunk-QRU55BUS.js} +2 -2
  117. package/dist/chunk-RBZKV3ED.js +14 -0
  118. package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
  119. package/dist/{chunk-6UBOLLBC.js → chunk-RNBS6QGP.js} +16 -16
  120. package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
  121. package/dist/{chunk-VAPSWR5Q.js → chunk-SX3SG522.js} +9 -9
  122. package/dist/{chunk-5CXFABVD.js → chunk-T6BGS26U.js} +1 -1
  123. package/dist/{chunk-PVPMJ5G2.js → chunk-TDAI4J27.js} +1 -1
  124. package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
  125. package/dist/{chunk-DGNAUGZ3.js → chunk-TFSLPAGB.js} +4 -4
  126. package/dist/chunk-TNJ2VCH4.js +8 -0
  127. package/dist/{chunk-4QK4WNPB.js → chunk-U44DVPGB.js} +1 -1
  128. package/dist/{chunk-FXOYA2VJ.js → chunk-UNQ54QOF.js} +1 -1
  129. package/dist/{chunk-ALE56KOA.js → chunk-V2J2AHDW.js} +4 -4
  130. package/dist/{chunk-WMHZA4EO.js → chunk-VX4COEWP.js} +3 -3
  131. package/dist/{chunk-M4BPHBKI.js → chunk-VX6TKEEK.js} +1 -1
  132. package/dist/{chunk-47DO42IW.js → chunk-WDQEUNGE.js} +1 -1
  133. package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
  134. package/dist/{chunk-OFG3JZZE.js → chunk-WLYYC3AP.js} +1 -1
  135. package/dist/{chunk-ZS3TIQQ4.js → chunk-WOAMPTZI.js} +14 -14
  136. package/dist/chunk-WPCNJ4UL.js +2 -0
  137. package/dist/{chunk-YCWALB3A.js → chunk-XBHXGBJR.js} +1 -1
  138. package/dist/{chunk-MXGDFO6A.js → chunk-XCAUDTCC.js} +5 -5
  139. package/dist/{chunk-M3JNILT2.js → chunk-XFH64VIG.js} +3 -3
  140. package/dist/chunk-XKGEI6NL.js +28 -0
  141. package/dist/{chunk-34H3CK7R.js → chunk-XXL5RLNM.js} +9 -9
  142. package/dist/{chunk-GELPD7EY.js → chunk-YQOVUH5W.js} +8 -8
  143. package/dist/{chunk-EKCQ7XBZ.js → chunk-Z44JWU75.js} +2 -2
  144. package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
  145. package/dist/data/DataTable.js +1 -1
  146. package/dist/data/EntityList.js +1 -1
  147. package/dist/data/ListLoadError.js +1 -1
  148. package/dist/data/ResizableTable.js +1 -1
  149. package/dist/format/index.d.ts +2 -0
  150. package/dist/format/index.js +1 -1
  151. package/dist/forms/AlignmentGrid.js +1 -1
  152. package/dist/forms/BorderInput.d.ts +2 -2
  153. package/dist/forms/BorderInput.js +1 -1
  154. package/dist/forms/BrandAssetEditor.js +1 -1
  155. package/dist/forms/Button.js +1 -1
  156. package/dist/forms/ColorPicker.js +1 -1
  157. package/dist/forms/ComposerAttachments.js +1 -1
  158. package/dist/forms/CornersInput.js +1 -1
  159. package/dist/forms/DateRangePicker.js +1 -1
  160. package/dist/forms/DisplayChips.js +1 -1
  161. package/dist/forms/FilePicker.js +1 -1
  162. package/dist/forms/IconButton.js +1 -1
  163. package/dist/forms/IconPicker.d.ts +18 -1
  164. package/dist/forms/IconPicker.js +1 -1
  165. package/dist/forms/Input.js +1 -1
  166. package/dist/forms/InputNumber.js +1 -1
  167. package/dist/forms/LinkPicker.js +1 -1
  168. package/dist/forms/MediaLibrary.js +1 -1
  169. package/dist/forms/MediaUploadField.js +1 -1
  170. package/dist/forms/MediaUploadGrid.js +1 -1
  171. package/dist/forms/MediaUsedInList.js +1 -1
  172. package/dist/forms/NumericKeypad.js +1 -1
  173. package/dist/forms/PictureTiles.js +1 -1
  174. package/dist/forms/PositionInput.js +1 -1
  175. package/dist/forms/RenameField.d.ts +13 -0
  176. package/dist/forms/RenameField.js +2 -0
  177. package/dist/forms/Segmented.js +1 -1
  178. package/dist/forms/Select.js +1 -1
  179. package/dist/forms/SidesInput.js +1 -1
  180. package/dist/forms/Slider.js +1 -1
  181. package/dist/forms/Snippet.js +1 -1
  182. package/dist/forms/SplitButton.js +1 -1
  183. package/dist/forms/TagInput.js +1 -1
  184. package/dist/forms/TextToolbar.js +1 -1
  185. package/dist/forms/WidthsBar.js +1 -1
  186. package/dist/forms/colorMix.d.ts +38 -0
  187. package/dist/forms/colorMix.js +1 -0
  188. package/dist/hooks/useTheme.d.ts +1 -1
  189. package/dist/icons/efficient-glyphs.js +1 -1
  190. package/dist/icons/efficient-looks.js +1 -1
  191. package/dist/icons/efficient.js +1 -1
  192. package/dist/icons/looks/map.js +1 -1
  193. package/dist/icons/payment.js +1 -1
  194. package/dist/icons/sets.js +1 -1
  195. package/dist/index.d.ts +6 -3
  196. package/dist/index.js +666 -666
  197. package/dist/map/index.js +3 -3
  198. package/dist/motion/entrance.d.ts +38 -0
  199. package/dist/motion/entrance.js +1 -0
  200. package/dist/motion.css +101 -0
  201. package/dist/page-tabs/index.js +5 -5
  202. package/dist/shell/AppUpdateBanner.js +1 -1
  203. package/dist/shell/ColoredBadge.js +1 -1
  204. package/dist/shell/ContextMenu.js +1 -1
  205. package/dist/shell/DropdownMenu.js +1 -1
  206. package/dist/shell/EditableGrid.js +1 -1
  207. package/dist/shell/GlobalSearch.js +1 -1
  208. package/dist/shell/HelpCenter.js +1 -1
  209. package/dist/shell/IconRail.js +1 -1
  210. package/dist/shell/ImageLightbox.js +1 -1
  211. package/dist/shell/ItemCount.js +1 -1
  212. package/dist/shell/LanguageSelect.js +1 -1
  213. package/dist/shell/Markdown.js +1 -1
  214. package/dist/shell/PopupMenu.js +1 -1
  215. package/dist/shell/ResizeHandle.js +1 -1
  216. package/dist/shell/SearchableSelect.js +1 -1
  217. package/dist/shell/SettingReset.js +1 -1
  218. package/dist/shell/SidebarLayout.js +1 -1
  219. package/dist/shell/SidebarNav.js +1 -1
  220. package/dist/shell/SortableList.js +1 -1
  221. package/dist/shell/StatusBadge.js +1 -1
  222. package/dist/shell/Tabs.js +1 -1
  223. package/dist/shell/Tooltip.js +1 -1
  224. package/dist/shell/TopNav.js +1 -1
  225. package/dist/shell/TransferProgress.js +1 -1
  226. package/dist/shell/Tree.js +1 -1
  227. package/dist/telemetry/index.js +1 -1
  228. package/dist/templates/AuthScreen.js +1 -1
  229. package/dist/templates/ChatTemplate.js +1 -1
  230. package/dist/templates/CheckoutTemplate.js +1 -1
  231. package/dist/templates/DashboardTemplate.js +1 -1
  232. package/dist/templates/DataTablePage.js +1 -1
  233. package/dist/templates/EmailTemplate.js +1 -1
  234. package/dist/templates/ErrorBoundary.d.ts +1 -1
  235. package/dist/templates/ErrorBoundary.js +1 -1
  236. package/dist/templates/FormLayoutPage.js +1 -1
  237. package/dist/templates/GalleryTemplate.js +1 -1
  238. package/dist/ui/index.d.ts +3 -0
  239. package/dist/ui/index.js +1 -1
  240. package/dist/version.js +1 -1
  241. package/package.json +1 -1
  242. package/dist/Calculator-V3BHUF4G.js +0 -29
  243. package/dist/Sidebar-GQX7UM3M.js +0 -44
  244. package/dist/chunk-23G63EZ4.js +0 -29
  245. package/dist/chunk-56KADF2B.js +0 -11
  246. package/dist/chunk-7DI3VQCF.js +0 -2
  247. package/dist/chunk-DLWKDAYX.js +0 -4
  248. package/dist/chunk-EUAC2T5D.js +0 -2
  249. package/dist/chunk-EZYRHBOP.js +0 -13
  250. package/dist/chunk-FO6UPEZH.js +0 -7
  251. package/dist/chunk-GOZO6LU2.js +0 -8
  252. package/dist/chunk-HCXIXV4E.js +0 -8
  253. package/dist/chunk-IYXNRNAF.js +0 -8
  254. package/dist/chunk-L7XIGRIT.js +0 -6
  255. package/dist/chunk-LCMXVMF4.js +0 -14
  256. package/dist/chunk-MNMOBH2O.js +0 -1
  257. package/dist/chunk-OONJ43CQ.js +0 -9
  258. package/dist/chunk-RK7MN5L5.js +0 -3
  259. package/dist/chunk-RPL4H6LE.js +0 -9
  260. package/dist/chunk-RWPMLUFO.js +0 -4
  261. package/dist/chunk-WBJ6KNUF.js +0 -1
  262. package/dist/chunk-WUAKIM2B.js +0 -7
  263. /package/dist/{chunk-2F5SLLBJ.js → chunk-MXK7A6ZM.js} +0 -0
@@ -1,31 +1,31 @@
1
- import{useCopyText as e,CopyGlyph as n}from"./chunk-2E2SUEEE.js";import{ItemCount as t}from"./chunk-P4VKU3SL.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-G3KXB7SP.js";import{Icon as a}from"./chunk-2UO47XB4.js";import{useShellStrings as o}from"./chunk-GDQJBQ5B.js";import{useState as s,useMemo as d,useEffect as c,useRef as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as h}from"react/jsx-runtime";function g(e){const n=[];let t=0;for(;t<e.length;){const r=e[t].group;let i=t;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;n.push(i>t?{group:r,start:t,end:i}:{start:t,end:t}),t=i+1}return n}function k(e,n){return e.find(e=>n>=e.start&&n<=e.end)}function b(e,n,t,r){const i=e.findIndex(e=>e.key===n.key);let l=e.findIndex(e=>e.key===t);if(i<0||l<0)return null;const a=g(e),o=k(a,i),s="group"===n.kind&&void 0!==o.group?e.slice(o.start,o.end+1).map(e=>e.key):[n.key];if(s.includes(t))return null;const d=k(a,l);if("tab"===n.kind&&void 0!==o.group){if(d!==o)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,n,t,r){const i=b(e,n,t,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),a=l.indexOf(i.key)+("after"===i.side?1:0),o=[...l.slice(0,a),...i.moving,...l.slice(a)];return o.every((n,t)=>n===e[t].key)?null:o}var v="flex-[0_1_15rem] [contain-intrinsic-inline-size:15rem]",w=v,N="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500",$="pointer-events-none absolute bottom-0 size-2 [background:inherit]";function C(){/* @__PURE__ */
1
+ import{useCopyText as e,CopyGlyph as n}from"./chunk-2E2SUEEE.js";import{ItemCount as t}from"./chunk-55AEZX6K.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-6KGIHI6X.js";import{Icon as a}from"./chunk-2UO47XB4.js";import{useShellStrings as o}from"./chunk-GDQJBQ5B.js";import{useState as s,useMemo as d,useEffect as c,useRef as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as h}from"react/jsx-runtime";function g(e){const n=[];let t=0;for(;t<e.length;){const r=e[t].group;let i=t;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;n.push(i>t?{group:r,start:t,end:i}:{start:t,end:t}),t=i+1}return n}function k(e,n){return e.find(e=>n>=e.start&&n<=e.end)}function b(e,n,t,r){const i=e.findIndex(e=>e.key===n.key);let l=e.findIndex(e=>e.key===t);if(i<0||l<0)return null;const a=g(e),o=k(a,i),s="group"===n.kind&&void 0!==o.group?e.slice(o.start,o.end+1).map(e=>e.key):[n.key];if(s.includes(t))return null;const d=k(a,l);if("tab"===n.kind&&void 0!==o.group){if(d!==o)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,n,t,r){const i=b(e,n,t,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),a=l.indexOf(i.key)+("after"===i.side?1:0),o=[...l.slice(0,a),...i.moving,...l.slice(a)];return o.every((n,t)=>n===e[t].key)?null:o}var v="flex-[0_1_15rem] [contain-intrinsic-inline-size:15rem]",w=v,N="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500",$="pointer-events-none absolute bottom-0 size-2 [background:inherit]";function C(){/* @__PURE__ */
2
2
  return p(h,{children:[
3
3
  /* @__PURE__ */y("span",{"aria-hidden":"true",className:`${$} -left-2 [mask-image:radial-gradient(circle_at_0_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`}),
4
4
  /* @__PURE__ */y("span",{"aria-hidden":"true",className:`${$} -right-2 [mask-image:radial-gradient(circle_at_100%_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`})]})}function z(){/* @__PURE__ */
5
5
  return y(a,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function I({text:t,label:r,copiedLabel:i}){const{copied:l,copy:a}=e(t);/* @__PURE__ */
6
- return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:$,onClose:j,onCloseMany:D,label:E,className:B,activeClassName:S,end:T,afterPinned:A,onIconMenu:K,menuItems:M,sizing:G="even",tall:O=!1,onReorder:R,groupInfo:L}){const X=o().pageTabs,P=o().count,[U,F]=s(null),Q=O?"h-[34px]":"h-8",V=d(()=>e.map(e=>({key:e.key,group:L?e.group:void 0})),[e,L]),W=d(()=>g(V),[V]),[H,J]=s(()=>/* @__PURE__ */new Set),Y=t=>{if(!H.has(t)){const r=W.find(e=>e.group===t),i=e.findIndex(e=>e.key===n);if(r&&i>=r.start&&i<=r.end){const n=e[r.end+1]??e[r.start-1];n&&$(n.key)}}J(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},q=n?V.find(e=>e.key===n)?.group:void 0;c(()=>{void 0!==q&&J(e=>{if(!e.has(q))return e;const n=new Set(e);return n.delete(q),n})},[n]);const Z=d(()=>{const n=[];for(const t of W)for(let r=t.start;r<=t.end;r++)void 0!==t.group&&H.has(t.group)||n.push(e[r]);return n},[W,H,e]),ee=u(null),[ne,te]=s(null),re=(n,t)=>R?{draggable:!0,onDragStart:t=>{ee.current=n,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.find(e=>e.key===n.key)?.title??"")},onDragOver:e=>{const r=ee.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=t!==n.key||"tab"===n.kind?e.clientX<i.left+i.width/2?"before":"after":"before",a=x(V,r,t,l)?b(V,r,t,l):null;if(!a)return void(ne&&te(null));e.preventDefault(),e.dataTransfer.dropEffect="move";const o=e=>V.find(n=>n.key===e)?.group,s="tab"===r.kind&&void 0!==o(r.key)&&o(r.key)===o(a.key);ne?.key===a.key&&ne.side===a.side&&ne.inGroup===s||te({key:a.key,side:a.side,inGroup:s})},onDrop:e=>{const n=ee.current;if(!n||!ne)return;e.preventDefault();const t=x(V,n,ne.key,ne.side);ee.current=null,te(null),t&&R(t)},onDragEnd:()=>{ee.current=null,te(null)}}:{},ie=d(()=>new Set(W.filter(e=>void 0!==e.group&&L).map(n=>e[n.start].key)),[W,e,L]),le=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ae=e=>ne?.key===e&&!("before"===ne.side&&ie.has(e)&&!ne.inGroup)&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le(ne.side)}),oe=e.length;c(()=>{if(!n)return;const e=document.getElementById(f(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,n,oe]);const se=A?Z.findIndex(e=>!e.pinned):-1,de=Z.some(e=>e.key===n)?n:Z[0]?.key,ce=e=>{const n=Z[(e+Z.length)%Z.length];n&&document.getElementById(f(n.key,"tab"))?.focus()},ue=(e,n)=>{const t=Z[e+n];if(!R||!t)return;const r=x(V,{kind:"tab",key:Z[e].key},t.key,n<0?"before":"after");r&&(R(r),setTimeout(()=>document.getElementById(f(Z[e].key,"tab"))?.focus(),0))},me=U?e.find(e=>e.key===U.key):void 0,fe=me&&M?M(me.key):[],pe=me?e.indexOf(me):-1,ye=e=>e.some(e=>!e.pinned),he=e=>()=>{F(null),e()},ge=(e,t)=>{const r=e.key===n,i=!!e.dirty,l=e.icon,o=r?S??"z-[1] border-transparent bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!t&&!r&&t.key!==n,d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":k?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===de?0:-1,title:e.title,onClick:()=>$(e.key)},c={onContextMenu:n=>((e,n)=>{e.preventDefault(),F({x:e.clientX,y:e.clientY,key:n.key})})(n,e),onAuxClick:n=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),j(n.key))})(n,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
6
+ return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:$,onClose:j,onCloseMany:D,label:E,className:A,activeClassName:B,end:T,afterPinned:K,onIconMenu:M,menuItems:S,sizing:G="even",tall:O=!1,onReorder:R,groupInfo:X}){const L=o().pageTabs,F=o().count,[H,Q]=s(null),U=O?"h-[34px]":"h-8",W=d(()=>e.map(e=>({key:e.key,group:X?e.group:void 0})),[e,X]),J=d(()=>g(W),[W]),[P,V]=s(()=>/* @__PURE__ */new Set),Y=t=>{if(!P.has(t)){const r=J.find(e=>e.group===t),i=e.findIndex(e=>e.key===n);if(r&&i>=r.start&&i<=r.end){const n=e[r.end+1]??e[r.start-1];n&&$(n.key)}}V(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},Z=n?W.find(e=>e.key===n)?.group:void 0;c(()=>{void 0!==Z&&V(e=>{if(!e.has(Z))return e;const n=new Set(e);return n.delete(Z),n})},[n]);const q=d(()=>{const n=[];for(const t of J)for(let r=t.start;r<=t.end;r++)void 0!==t.group&&P.has(t.group)||n.push(e[r]);return n},[J,P,e]),ee=u(null),[ne,te]=s(null),re=(n,t)=>R?{draggable:!0,onDragStart:t=>{ee.current=n,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.find(e=>e.key===n.key)?.title??"")},onDragOver:e=>{const r=ee.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=t!==n.key||"tab"===n.kind?e.clientX<i.left+i.width/2?"before":"after":"before",a=x(W,r,t,l)?b(W,r,t,l):null;if(!a)return void(ne&&te(null));e.preventDefault(),e.dataTransfer.dropEffect="move";const o=e=>W.find(n=>n.key===e)?.group,s="tab"===r.kind&&void 0!==o(r.key)&&o(r.key)===o(a.key);ne?.key===a.key&&ne.side===a.side&&ne.inGroup===s||te({key:a.key,side:a.side,inGroup:s})},onDrop:e=>{const n=ee.current;if(!n||!ne)return;e.preventDefault();const t=x(W,n,ne.key,ne.side);ee.current=null,te(null),t&&R(t)},onDragEnd:()=>{ee.current=null,te(null)}}:{},ie=d(()=>new Set(J.filter(e=>void 0!==e.group&&X).map(n=>e[n.start].key)),[J,e,X]),le=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ae=e=>ne?.key===e&&!("before"===ne.side&&ie.has(e)&&!ne.inGroup)&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le(ne.side)}),oe=e.length;c(()=>{if(!n)return;const e=document.getElementById(f(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,n,oe]);const se=K?q.findIndex(e=>!e.pinned):-1,de=q.some(e=>e.key===n)?n:q[0]?.key,ce=e=>{const n=q[(e+q.length)%q.length];n&&document.getElementById(f(n.key,"tab"))?.focus()},ue=(e,n)=>{const t=q[e+n];if(!R||!t)return;const r=x(W,{kind:"tab",key:q[e].key},t.key,n<0?"before":"after");r&&(R(r),setTimeout(()=>document.getElementById(f(q[e].key,"tab"))?.focus(),0))},me=H?e.find(e=>e.key===H.key):void 0,fe=me&&S?S(me.key):[],pe=me?e.indexOf(me):-1,ye=e=>e.some(e=>!e.pinned),he=e=>()=>{Q(null),e()},ge=(e,t)=>{const r=e.key===n,i=!!e.dirty,l=e.icon,o=r?B??"z-[1] border-transparent bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!t&&!r&&t.key!==n,d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":k?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===de?0:-1,title:e.title,onClick:()=>$(e.key)},c={onContextMenu:n=>((e,n)=>{e.preventDefault(),Q({x:e.clientX,y:e.clientY,key:n.key})})(n,e),onAuxClick:n=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),j(n.key))})(n,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
7
7
  /* @__PURE__ */p("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[l,i&&!r&&!e.pinned&&
8
- /* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!K&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${Q} ${l?"w-10":""} ${o}`,...c,...re({kind:"tab",key:e.key},e.key),children:[ae(e.key),r&&/* @__PURE__ */y(C,{}),
8
+ /* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!M&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${U} ${l?"w-10":""} ${o}`,...c,...re({kind:"tab",key:e.key},e.key),children:[ae(e.key),r&&/* @__PURE__ */y(C,{}),
9
9
  /* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-lg ${l?"w-full":"px-3"} ${N}`,children:[u,
10
10
  /* @__PURE__ */y("span",{className:l?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */p(m,{children:[s&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
11
- /* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${Q} ${"active-full"===G&&r?"":"@container"} ${"active-full"===G?r?"flex-[0_0_15rem] min-w-0":w:r&&(e.copy||h)?"flex-[0_1_20rem]":v} ${r?"active-full"===G?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${o}`,...c,...re({kind:"tab",key:e.key},e.key),children:[ae(e.key),r&&/* @__PURE__ */y(C,{}),h&&
12
- /* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":X.tabMenu,title:X.tabMenu,onClick:n=>{const t=n.currentTarget.getBoundingClientRect();K?.(e.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${N}`,children:u}),
11
+ /* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${U} ${"active-full"===G&&r?"":"@container"} ${"active-full"===G?r?"flex-[0_0_15rem] min-w-0":w:r&&(e.copy||h)?"flex-[0_1_20rem]":v} ${r?"active-full"===G?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${o}`,...c,...re({kind:"tab",key:e.key},e.key),children:[ae(e.key),r&&/* @__PURE__ */y(C,{}),h&&
12
+ /* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":L.tabMenu,title:L.tabMenu,onClick:n=>{const t=n.currentTarget.getBoundingClientRect();M?.(e.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${N}`,children:u}),
13
13
  /* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-lg pr-1 text-left ${h?"pl-2":"pl-3"} ${N} ${r?h?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!h&&u,
14
14
  /* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===G&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
15
- /* @__PURE__ */y("span",{role:"img","aria-label":X.favorite,title:X.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(a,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(_,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y(I,{text:e.copy,label:X.copy(e.copy),copiedLabel:X.copied}),
16
- /* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":X.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
17
- /* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":X.closeTab?.(e.title)??`${X.close} ${e.title}`,onClick:()=>j(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(z,{})})]})]})]},e.key)},ke=[];let be,xe=0,ve=!A;for(const r of W){const i=Z.filter(n=>{const t=e.indexOf(n);return t>=r.start&&t<=r.end});if(ve||xe!==se||(ve=!0,ke.push(/* @__PURE__ */y(m,{children:A},"rosh-after-pinned")),be=void 0),xe+=i.length,void 0===r.group||!L){for(const e of i)ke.push(ge(e,be)),be=e;continue}be=void 0;const l=r.group,o=L(l),s=r.end-r.start+1,d=!H.has(l),c=e[r.start].key,u=i.some(e=>e.key===n);ke.push(
15
+ /* @__PURE__ */y("span",{role:"img","aria-label":L.favorite,title:L.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(a,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(_,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y(I,{text:e.copy,label:L.copy(e.copy),copiedLabel:L.copied}),
16
+ /* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":L.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
17
+ /* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":L.closeTab?.(e.title)??`${L.close} ${e.title}`,onClick:()=>j(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(z,{})})]})]})]},e.key)},ke=[];let be,xe=0,ve=!K;for(const r of J){const i=q.filter(n=>{const t=e.indexOf(n);return t>=r.start&&t<=r.end});if(ve||xe!==se||(ve=!0,ke.push(/* @__PURE__ */y(m,{children:K},"rosh-after-pinned")),be=void 0),xe+=i.length,void 0===r.group||!X){for(const e of i)ke.push(ge(e,be)),be=e;continue}be=void 0;const l=r.group,o=X(l),s=r.end-r.start+1,d=!P.has(l),c=e[r.start].key,u=i.some(e=>e.key===n);ke.push(
18
18
  /* @__PURE__ */p("div",{role:"group","aria-label":o.label,"data-tab-group":l,className:"relative mx-1 flex items-end first:ml-0 min-w-0 "+(u?"shrink-[0.01]":"shrink"),children:[
19
- /* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:X.groupToggle(o.label,s),onClick:()=>Y(l),...re({kind:"group",key:c},c),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${N}`,children:[
19
+ /* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:L.groupToggle(o.label,s),onClick:()=>Y(l),...re({kind:"group",key:c},c),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${N}`,children:[
20
20
  /* @__PURE__ */y(a,{name:d?"chevron-down":"chevron-right","aria-hidden":"true",className:"size-3",strokeWidth:2}),o.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:o.icon}),
21
21
  /* @__PURE__ */y("span",{className:d?"sr-only":"max-w-[12rem] truncate",children:o.label}),
22
- /* @__PURE__ */y(t,{count:s,label:P.tabs(s),active:!0})]}),ne?.key===c&&"before"===ne.side&&!ne.inGroup&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le("before")}),i.map((e,n)=>ge(e,n>0?i[n-1]:void 0)),
23
- /* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return ve||ke.push(/* @__PURE__ */y(m,{children:A},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:B??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
22
+ /* @__PURE__ */y(t,{count:s,label:F.tabs(s),active:!0})]}),ne?.key===c&&"before"===ne.side&&!ne.inGroup&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le("before")}),i.map((e,n)=>ge(e,n>0?i[n-1]:void 0)),
23
+ /* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return ve||ke.push(/* @__PURE__ */y(m,{children:K},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:A??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
24
24
  /* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
25
- /* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const n=Z.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(Z.length-1);else{if("Delete"!==e.key||Z[n].pinned)return;j(Z[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ke}),T&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:T}),U&&me&&/* @__PURE__ */p(r,{portal:!0,style:{left:U.x,top:U.y},onClose:()=>F(null),children:[fe.length>0&&/* @__PURE__ */p(h,{children:[fe.map((e,n)=>/* @__PURE__ */p(i,{onClick:he(e.onSelect),children:[e.icon,e.label]},n)),
25
+ /* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const n=q.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(q.length-1);else{if("Delete"!==e.key||q[n].pinned)return;j(q[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ke}),T&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:T}),H&&me&&/* @__PURE__ */p(r,{portal:!0,style:{left:H.x,top:H.y},onClose:()=>Q(null),children:[fe.length>0&&/* @__PURE__ */p(h,{children:[fe.map((e,n)=>/* @__PURE__ */p(i,{onClick:he(e.onSelect),children:[e.icon,e.label]},n)),
26
26
  /* @__PURE__ */y(l,{})]}),
27
- /* @__PURE__ */y(i,{disabled:me.pinned,onClick:he(()=>j(me.key)),children:X.close}),
27
+ /* @__PURE__ */y(i,{disabled:me.pinned,onClick:he(()=>j(me.key)),children:L.close}),
28
28
  /* @__PURE__ */y(l,{}),
29
- /* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:he(()=>D("others",me.key)),children:X.closeOthers}),
30
- /* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:he(()=>D("right",me.key)),children:X.closeRight}),
31
- /* @__PURE__ */y(i,{disabled:!ye(e),onClick:he(()=>D("all",null)),children:X.closeAll})]})]})}export{j as TabStrip};
29
+ /* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:he(()=>D("others",me.key)),children:L.closeOthers}),
30
+ /* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:he(()=>D("right",me.key)),children:L.closeRight}),
31
+ /* @__PURE__ */y(i,{disabled:!ye(e),onClick:he(()=>D("all",null)),children:L.closeAll})]})]})}export{j as TabStrip};
@@ -1,4 +1,4 @@
1
- import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-JDQGHQ2C.js";import{Tooltip as r}from"./chunk-QQ2LDC6C.js";import{useId as s}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";function t({value:t,onChange:c,options:d,name:b,size:u="md",block:m=!1,label:h,className:p="","aria-labelledby":v,"aria-describedby":f}){const g={"aria-label":v?void 0:h,"aria-labelledby":v,"aria-describedby":f},N=s(),y=e(m,p),k=l(m);/* @__PURE__ */
2
- return n("div",b?{role:"radiogroup",...g,className:y,children:d.map(e=>{const l=`${N}-${e.value}`,s=e.value===t,d=/* @__PURE__ */o("label",{htmlFor:l,className:i({size:u,selected:s,disabled:e.disabled,block:m}),children:[
1
+ import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-JDQGHQ2C.js";import{Tooltip as r}from"./chunk-NJN5IKWO.js";import{useId as s}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";function t({value:t,onChange:c,options:d,name:b,size:u="md",block:m=!1,label:h,className:p="","aria-labelledby":v,"aria-describedby":f}){const N={"aria-label":v?void 0:h,"aria-labelledby":v,"aria-describedby":f},g=s(),y=e(m,p),k=l(m);/* @__PURE__ */
2
+ return n("div",b?{role:"radiogroup",...N,className:y,children:d.map(e=>{const l=`${g}-${e.value}`,s=e.value===t,d=/* @__PURE__ */o("label",{htmlFor:l,className:i({size:u,selected:s,disabled:e.disabled,block:m}),children:[
3
3
  /* @__PURE__ */n("input",{id:l,type:"radio",name:b,value:e.value,checked:s,disabled:e.disabled,"aria-describedby":e.title?`${l}-note`:void 0,onChange:()=>c(e.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
4
- /* @__PURE__ */n(a,{icon:e.icon,label:e.label}),e.title&&/* @__PURE__ */n("span",{id:`${l}-note`,className:"sr-only",children:e.title})]},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:d},e.value):d})}:{role:"group",...g,className:y,children:d.map(e=>{const l=e.value===t,s=/* @__PURE__ */n("button",{type:"button","aria-pressed":l,disabled:e.disabled,onClick:()=>c(e.value),className:i({size:u,selected:l,disabled:e.disabled,block:m}),children:/* @__PURE__ */n(a,{icon:e.icon,label:e.label})},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:s},e.value):s})})}export{t as Segmented};
4
+ /* @__PURE__ */n(a,{icon:e.icon,label:e.label}),e.title&&/* @__PURE__ */n("span",{id:`${l}-note`,className:"sr-only",children:e.title})]},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:d},e.value):d})}:{role:"group",...N,className:y,children:d.map(e=>{const l=e.value===t,s=/* @__PURE__ */n("button",{type:"button","aria-pressed":l,disabled:e.disabled,onClick:()=>c(e.value),className:i({size:u,selected:l,disabled:e.disabled,block:m}),children:/* @__PURE__ */n(a,{icon:e.icon,label:e.label})},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:s},e.value):s})})}export{t as Segmented};
@@ -1,13 +1,13 @@
1
- import{copyToClipboard as e,selectionAt as t}from"./chunk-TMMNCXQT.js";import{ResizableTable as n}from"./chunk-355CRSFS.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-4ULRP4Y4.js";import{ListLoadError as a}from"./chunk-FXOYA2VJ.js";import{LoadingSpinner as c}from"./chunk-O3MBPAWZ.js";import{toast_default as d}from"./chunk-7ELJQL7J.js";import{PopupMenu as s,PopupMenuLabel as h,PopupMenuItem as m,PopupMenuDivider as u}from"./chunk-G3KXB7SP.js";import{keepsNativeMenu as p}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as f}from"./chunk-R2VKEMZH.js";import{shellHttp as g}from"./chunk-STKJA4PV.js";import{useShellStrings as y}from"./chunk-GDQJBQ5B.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:L,emptyState:N,totalCount:T,isError:$,onRetry:M,errorTitle:P,errorMessage:A,tableId:K,columns:E,renderCell:F,getRowId:B=e=>e.id,sort:D,onSort:J,selected:U,setSelected:I,onRowClick:O,onRowHover:Q,getRowClassName:W,footerLabel:G,footerExtra:H,sentinelRef:X,isFetchingNextPage:Z,saveDefaultPerms:_,exportEndpoint:V,exportFilename:Y="export.csv",contextActions:z}=S,[q,ee]=k(null),te=b(null),ne=y(),re=ne.entityList,oe=e=>{I(t=>{const n=new Set(t),r=B(e);return n.has(r)?n.delete(r):n.add(r),n})},le=()=>{I(e=>{const t=R.map(B),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ie=r(R,O,oe,le,(e,t)=>{I(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(B(R[n]));return r})},te),ae=R.filter(e=>U.has(B(e))),ce=()=>{const e=[...te.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&U.has(B(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(E.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{ee(null);const{header:t,body:n}=ce();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(re.copiedRows(n.length),r,l)},se=async()=>{ee(null);const e=ae.map(B);if(!e.length||!V)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(E.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${K}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return E.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=V.includes("?")?"&":"?";try{const n=await g.get(`${V}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=Y,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void d.notify(Number.isFinite(a)?re.exportTruncated(a,e.length):re.exportTruncatedUnknown(e.length));d.success(re.exported(e.length))}catch{d.error(re.exportFailed)}};if(L)/* @__PURE__ */return x(c,{});if($&&0===R.length)/* @__PURE__ */
2
- return x(a,{title:P,message:A,onRetry:M});if(0===R.length)/* @__PURE__ */return x(w,{children:N});const he=R.length>0&&ae.length===R.length,me=ae.length>0&&!he,ue=U.size-ae.length,pe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":ne.table.selectAll,checked:he,indeterminate:me,onChange:le,style:{height:14,width:14}})},...E],fe=/* @__PURE__ */x(i,{selectedCount:ae.length,hiddenSelectedCount:ue,loadedCount:R.length,totalCount:T,label:G,isFetchingMore:Z,extra:H}),ge=X?/* @__PURE__ */C(w,{children:[
3
- /* @__PURE__ */x("div",{ref:X}),Z&&/* @__PURE__ */x(f,{size:"sm",padding:"py-3",label:ne.list.loadingMore})]}):void 0;let ye=null;if(q){const{x:t,y:n,item:r,text:o,firstColumn:l}=q,i=z?z(ae):[],a=ae.length,c=()=>ee(null),d=void 0!==T&&T>R.length;ye=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
1
+ import{copyToClipboard as e,selectionAt as t}from"./chunk-TMMNCXQT.js";import{ResizableTable as n}from"./chunk-HNVSVTNC.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-4ULRP4Y4.js";import{ListLoadError as a}from"./chunk-UNQ54QOF.js";import{LoadingSpinner as c}from"./chunk-O3MBPAWZ.js";import{toast_default as d}from"./chunk-7ELJQL7J.js";import{PopupMenu as s,PopupMenuLabel as h,PopupMenuItem as m,PopupMenuDivider as u}from"./chunk-6KGIHI6X.js";import{keepsNativeMenu as p}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as f}from"./chunk-R2VKEMZH.js";import{shellHttp as g}from"./chunk-STKJA4PV.js";import{useShellStrings as y}from"./chunk-GDQJBQ5B.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:N,isLoading:R,emptyState:L,totalCount:T,isError:$,onRetry:M,errorTitle:K,errorMessage:P,tableId:A,columns:E,renderCell:F,getRowId:I=e=>e.id,sort:Q,onSort:U,selected:D,setSelected:B,onRowClick:H,onRowHover:J,getRowClassName:O,footerLabel:W,footerExtra:G,sentinelRef:V,isFetchingNextPage:Z,saveDefaultPerms:_,exportEndpoint:X,exportFilename:z="export.csv",contextActions:Y}=S,[q,ee]=k(null),te=b(null),ne=y(),re=ne.entityList,oe=e=>{B(t=>{const n=new Set(t),r=I(e);return n.has(r)?n.delete(r):n.add(r),n})},le=()=>{B(e=>{const t=N.map(I),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ie=r(N,H,oe,le,(e,t)=>{B(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(I(N[n]));return r})},te),ae=N.filter(e=>D.has(I(e))),ce=()=>{const e=[...te.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=N[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(I(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(E.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{ee(null);const{header:t,body:n}=ce();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(re.copiedRows(n.length),r,l)},se=async()=>{ee(null);const e=ae.map(I);if(!e.length||!X)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(E.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${A}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return E.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=X.includes("?")?"&":"?";try{const n=await g.get(`${X}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=z,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void d.notify(Number.isFinite(a)?re.exportTruncated(a,e.length):re.exportTruncatedUnknown(e.length));d.success(re.exported(e.length))}catch{d.error(re.exportFailed)}};if(R)/* @__PURE__ */return x(c,{});if($&&0===N.length)/* @__PURE__ */
2
+ return x(a,{title:K,message:P,onRetry:M});if(0===N.length)/* @__PURE__ */return x(w,{children:L});const he=N.length>0&&ae.length===N.length,me=ae.length>0&&!he,ue=D.size-ae.length,pe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":ne.table.selectAll,checked:he,indeterminate:me,onChange:le,style:{height:14,width:14}})},...E],fe=/* @__PURE__ */x(i,{selectedCount:ae.length,hiddenSelectedCount:ue,loadedCount:N.length,totalCount:T,label:W,isFetchingMore:Z,extra:G}),ge=V?/* @__PURE__ */C(w,{children:[
3
+ /* @__PURE__ */x("div",{ref:V}),Z&&/* @__PURE__ */x(f,{size:"sm",padding:"py-3",label:ne.list.loadingMore})]}):void 0;let ye=null;if(q){const{x:t,y:n,item:r,text:o,firstColumn:l}=q,i=Y?Y(ae):[],a=ae.length,c=()=>ee(null),d=void 0!==T&&T>N.length;ye=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
4
4
  /* @__PURE__ */x(h,{children:ue>0?ne.list.selectedNotShown(a,ue):ne.list.selected(a)}),
5
- /* @__PURE__ */x(m,{className:"font-medium",onClick:()=>{c(),O(r)},children:re.open}),
5
+ /* @__PURE__ */x(m,{className:"font-medium",onClick:()=>{c(),H(r)},children:re.open}),
6
6
  /* @__PURE__ */x(u,{}),o&&/* @__PURE__ */x(m,{onClick:()=>{c(),e(re.copiedText,o.text,o.html)},children:re.copy}),l&&/* @__PURE__ */x(m,{onClick:()=>(t=>{ee(null);const{keys:n,body:r}=ce(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:re.copyColumn(l.label)}),
7
- /* @__PURE__ */x(m,{disabled:0===a,onClick:de,children:re.copyRows(a)}),V&&/* @__PURE__ */x(m,{onClick:se,children:re.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(u,{}),
7
+ /* @__PURE__ */x(m,{disabled:0===a,onClick:de,children:re.copyRows(a)}),X&&/* @__PURE__ */x(m,{onClick:se,children:re.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(u,{}),
8
8
  /* @__PURE__ */x(m,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ae)},children:e.label})]},t)),
9
- /* @__PURE__ */x(u,{}),!he&&/* @__PURE__ */x(m,{onClick:()=>{c(),I(e=>/* @__PURE__ */new Set([...e,...R.map(B)]))},children:d?re.selectAllLoaded(R.length):re.selectAll}),
10
- /* @__PURE__ */x(m,{onClick:()=>{c(),I(/* @__PURE__ */new Set)},children:re.clearSelection}),M&&/* @__PURE__ */x(m,{onClick:()=>{c(),M()},children:re.refresh})]})}/* @__PURE__ */
9
+ /* @__PURE__ */x(u,{}),!he&&/* @__PURE__ */x(m,{onClick:()=>{c(),B(e=>/* @__PURE__ */new Set([...e,...N.map(I)]))},children:d?re.selectAllLoaded(N.length):re.selectAll}),
10
+ /* @__PURE__ */x(m,{onClick:()=>{c(),B(/* @__PURE__ */new Set)},children:re.clearSelection}),M&&/* @__PURE__ */x(m,{onClick:()=>{c(),M()},children:re.refresh})]})}/* @__PURE__ */
11
11
  return C("div",{className:"flex-1 flex flex-col mb-1 bg-white rounded-lg shadow overflow-hidden",children:[
12
- /* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:K,columns:pe,sort:D,onSort:J,footer:fe,afterBody:ge,saveDefaultPerms:_,children:e=>/* @__PURE__ */x("tbody",{ref:te,className:"divide-y divide-gray-100",children:R.map((n,r)=>{const o=B(n);/* @__PURE__ */
13
- return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ie===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":U.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${W?.(n)??""}`,onClick:()=>O(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||p(e.target))return;e.preventDefault();const r=B(n);U.has(r)||I(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?E.find(e=>e.key===o)?.label:void 0;ee({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:Q?()=>Q(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":ne.table.selectRow,checked:U.has(o),onChange:()=>oe(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):F(n,e.key)},e.key))},o)})})})}),ye]})}export{S as EntityList};
12
+ /* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:A,columns:pe,sort:Q,onSort:U,footer:fe,afterBody:ge,saveDefaultPerms:_,children:e=>/* @__PURE__ */x("tbody",{ref:te,className:"divide-y divide-gray-100",children:N.map((n,r)=>{const o=I(n);/* @__PURE__ */
13
+ return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ie===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${O?.(n)??""}`,onClick:()=>H(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||p(e.target))return;e.preventDefault();const r=I(n);D.has(r)||B(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?E.find(e=>e.key===o)?.label:void 0;ee({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:J?()=>J(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":ne.table.selectRow,checked:D.has(o),onChange:()=>oe(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):F(n,e.key)},e.key))},o)})})})}),ye]})}export{S as EntityList};
@@ -1,4 +1,4 @@
1
- import{DropdownMenu as e}from"./chunk-WUAKIM2B.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
1
+ import{DropdownMenu as e}from"./chunk-NZISMTQE.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
2
2
  return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
3
3
  return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
4
4
  /* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{GROUP_COLORS as e}from"./chunk-JPNAEN53.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-QQ2LDC6C.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
1
+ import{GROUP_COLORS as e}from"./chunk-FZM3ZPW3.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
2
2
  return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
3
3
  return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
4
4
  /* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const y=u??g.uploading,N=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),$="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,k=e=>[e,m,null==N?"":`${N}%`].filter(Boolean).join(" ");/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Tooltip as e}from"./chunk-QQ2LDC6C.js";import{jsxs as r,Fragment as n,jsx as i}from"react/jsx-runtime";var l=e=>!0===e||"true"===e;function o(e){e.preventDefault(),e.stopPropagation()}var t=(e,r)=>[e,r].filter(Boolean).join(" ")||void 0;function a({reason:l,id:o,block:t=!1,children:a}){/* @__PURE__ */
1
+ import{Tooltip as e}from"./chunk-NJN5IKWO.js";import{jsxs as r,Fragment as n,jsx as i}from"react/jsx-runtime";var l=e=>!0===e||"true"===e;function o(e){e.preventDefault(),e.stopPropagation()}var t=(e,r)=>[e,r].filter(Boolean).join(" ")||void 0;function a({reason:l,id:o,block:t=!1,children:a}){/* @__PURE__ */
2
2
  return r(n,{children:[
3
3
  /* @__PURE__ */i(e,{content:l,describe:!1,className:t?"relative flex w-full":"relative inline-flex",children:a}),
4
4
  /* @__PURE__ */i("span",{id:o,className:"sr-only",children:l})]})}export{a as OffWithReason,t as describedByWith,l as isAriaDisabled,o as swallowPress};
@@ -1,5 +1,5 @@
1
- import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-QQ2LDC6C.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),C=b?j.backTo(b):x?j.backToDefault:j.backToAuto,Q=m??(b?j.tip(g,C):g);
1
+ import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,N=i(),y=["es-default-reset"];if(c&&y.push("is-changed"),k&&y.push(k),!c&&h)return y.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:y.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:y.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):x?j.backToDefault:j.backToAuto,q=m??(b?j.tip(g,T):g);
2
2
  /* @__PURE__ */
3
- return r(t,{content:Q,describe:!1,children:[
4
- /* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":g,"aria-describedby":y,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
5
- /* @__PURE__ */a("span",{id:y,hidden:!0,children:C})]})}export{o as SettingReset};
3
+ return r(t,{content:q,describe:!1,children:[
4
+ /* @__PURE__ */a("button",{type:"button",className:y.join(" "),"aria-label":g,"aria-describedby":N,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
5
+ /* @__PURE__ */a("span",{id:N,hidden:!0,children:T})]})}export{o as SettingReset};
@@ -0,0 +1,8 @@
1
+ import{AccessibleTable as t}from"./chunk-5PP435FL.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-36VIGB6J.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),j=M??$.noFlows,[y,F]=c(null),{highlighted:E}=o(),C=h(u,f,x,$.other),{labels:I,matrix:Q,otherIndex:z,foldedCount:A}=C,B=(t,e)=>Q[t]?.[e]??0,L=t=>t===z?r.muted:a(t),P=C.totals,O=I.map((t,e)=>e).sort((t,e)=>P[e]-P[t]),V=O.reduce((t,e)=>t+P[e],0);if(V<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const G=p/2,H=p/2,J=p/2-44,R=J-b,T=g*O.length,U=/* @__PURE__ */new Map;let W=-Math.PI/2;O.forEach((t,e)=>{const o=P[t]/V*(2*Math.PI-T);U.set(t,{start:W,end:W+o,slot:e}),W+=o+g});const Y=/* @__PURE__ */new Map,D=[];for(const t of O)for(const e of O){const o=B(t,e);if(o<=0)continue;const n=U.get(t),r=o/Math.max(1,P[t])*(n.end-n.start),a=Y.get(t)??0;Y.set(t,a+r),D.push({from:t,to:e,value:o,a:n.start+a+r/2,b:U.get(e).start+(U.get(e).end-U.get(e).start)/2})}const S=(t,e)=>[G+e*Math.cos(t),H+e*Math.sin(t)],Z="arc"===y?.kind?y.index:void 0,q="ribbon"===y?.kind?D[y.index]:void 0;/* @__PURE__ */
2
+ return m("div",{className:`relative ${v??""}`,children:[
3
+ /* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(O.length),onMouseLeave:()=>F(null),children:[D.map((t,e)=>{const[o,n]=S(t.a,R),[r,a]=S(t.b,R),l=L(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==E?I[t.from]===E||I[t.to]===E:null)(t,e);/* @__PURE__ */
4
+ return d("path",{d:`M${o},${n} Q${G},${H} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/V*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>F({kind:"ribbon",index:e})},`${I[t.from]}→${I[t.to]}`)}),O.map(t=>{const o=U.get(t),n=(o.start+o.end)/2,[a,l]=S(n,J+16),i=(t=>y?"arc"===y.kind?y.index===t:D[y.index].from===t||D[y.index].to===t:null!==E?I[t]===E:null)(t);/* @__PURE__ */
5
+ return m("g",{onMouseEnter:()=>F({kind:"arc",index:t}),children:[
6
+ /* @__PURE__ */d("path",{d:e(G,H,R,J,o.start,o.end),fill:L(t),fillOpacity:null===i||i?1:.45}),
7
+ /* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:I[t]})]},t)})]}),A>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(A)}),void 0!==Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I[Z],rows:[{key:"total",label:$.totalFlow,color:L(Z),value:N(P[Z])}]})}),q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${I[q.from]} → ${I[q.to]}`,rows:[{key:"value",label:$.flow,color:L(q.from),value:N(q.value)}]})}),
8
+ /* @__PURE__ */d(t,{caption:$.chord(O.length),head:[$.tableFrom,$.tableTo,$.value],rows:D.map(t=>[I[t.from],I[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
@@ -1,4 +1,4 @@
1
- import{Tabs as e}from"./chunk-RQDVAUXD.js";import{Card as a}from"./chunk-P3RXXWXN.js";import{StatusBadgeProvider as r,StatusBadge as t}from"./chunk-JPNAEN53.js";import{Button_default as l}from"./chunk-7DI3VQCF.js";import{useState as i}from"react";import{jsx as d,jsxs as s}from"react/jsx-runtime";var n={featured:"success",new:"active",draft:"draft"},c=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,a)=>({id:a,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][a],tag:["featured","new","draft"][a%3],bg:e}));function m(){const[m,g]=i("all"),f="all"===m?c:c.filter(e=>e.tag===m);/* @__PURE__ */
1
+ import{Tabs as e}from"./chunk-N5KO2IHG.js";import{Card as a}from"./chunk-P3RXXWXN.js";import{StatusBadgeProvider as r,StatusBadge as t}from"./chunk-FZM3ZPW3.js";import{Button_default as l}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as d,jsxs as s}from"react/jsx-runtime";var n={featured:"success",new:"active",draft:"draft"},c=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,a)=>({id:a,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][a],tag:["featured","new","draft"][a%3],bg:e}));function m(){const[m,g]=i("all"),f="all"===m?c:c.filter(e=>e.tag===m);/* @__PURE__ */
2
2
  return d(r,{groups:n,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */s("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */s("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
@@ -1,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-7DI3VQCF.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{useShellStrings as t}from"./chunk-GDQJBQ5B.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
1
+ import{Button_default as e}from"./chunk-EOVXFXVV.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{useShellStrings as t}from"./chunk-GDQJBQ5B.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
2
2
  return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
3
3
  /* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
4
4
  /* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
@@ -1,4 +1,4 @@
1
- import{InputNumber_default as e}from"./chunk-ZD56IH5K.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
- return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput:$=!0,emptyLabel:D,placeholderValue:K,stepFrom:L,label:M,"aria-labelledby":A,valueText:C,id:B,disabled:E,size:R="md",boxSize:W="sm",className:H="",auto:I}){const J=n(),P=o(),Q=t(),T=I??Q,V=o(),q=B??P,G=F??p(S),O=k??w,U=N??g,Z=void 0!==D||void 0!==K,X=L??K,Y=f(r??K??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,$]);const ne=e=>C?C(e):"string"==typeof j?`${e.toFixed(G)} ${j}`:void 0,re=null==r?D??(null!=K?ne(K)??String(K):void 0):ne(r),le=`calc(${x([w.toFixed(G),g.toFixed(G),r?.toFixed(G),D,K?.toFixed(G)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,$?le:null)},[de,oe,le,$]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${H}`.trim(),children:[
3
- /* @__PURE__ */c("input",{id:q,type:"range",min:w,max:g,step:S,value:Y,disabled:E,"aria-label":A?void 0:M,"aria-labelledby":A,"aria-valuetext":re,"aria-describedby":T?V:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=X))return;e.preventDefault();a(b((r??X??Y)+t*(i?z??S:S),w,g,G))},onChange:e=>a(b(Number(e.target.value),w,g,G)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===R?"h-1":"h-1.5")}),$&&
4
- /* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<O||e>U||a(e):Z&&a(null)},min:O,max:U,step:S,shiftStep:z,stepFrom:X,precision:G,snap:!0,allowEmpty:Z,suffix:j,disabled:E,placeholder:D??(null!=K?K.toFixed(G):void 0),size:W,auto:T,"aria-label":M?J.slider.value(M):void 0,"aria-labelledby":M?void 0:A})}),T&&/* @__PURE__ */c("span",{id:V,hidden:!0,children:J.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
1
+ import{InputNumber_default as e}from"./chunk-QRU55BUS.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
+ return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput:$=!0,emptyLabel:L,placeholderValue:M,stepFrom:D,label:K,"aria-labelledby":A,valueText:B,id:C,disabled:R,size:E="md",boxSize:Q="sm",className:U="",auto:W}){const J=n(),P=o(),T=t(),V=W??T,q=o(),G=C??P,H=F??p(S),I=k??w,O=N??g,X=void 0!==L||void 0!==M,Y=D??M,Z=f(r??M??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,$]);const ne=e=>B?B(e):"string"==typeof j?`${e.toFixed(H)} ${j}`:void 0,re=null==r?L??(null!=M?ne(M)??String(M):void 0):ne(r),le=`calc(${x([w.toFixed(H),g.toFixed(H),r?.toFixed(H),L,M?.toFixed(H)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,$?le:null)},[de,oe,le,$]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${U}`.trim(),children:[
3
+ /* @__PURE__ */c("input",{id:G,type:"range",min:w,max:g,step:S,value:Z,disabled:R,"aria-label":A?void 0:K,"aria-labelledby":A,"aria-valuetext":re,"aria-describedby":V?q:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(b((r??Y??Z)+t*(i?z??S:S),w,g,H))},onChange:e=>a(b(Number(e.target.value),w,g,H)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===E?"h-1":"h-1.5")}),$&&
4
+ /* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<I||e>O||a(e):X&&a(null)},min:I,max:O,step:S,shiftStep:z,stepFrom:Y,precision:H,snap:!0,allowEmpty:X,suffix:j,disabled:R,placeholder:L??(null!=M?M.toFixed(H):void 0),size:Q,auto:V,"aria-label":K?J.slider.value(K):void 0,"aria-labelledby":K?void 0:A})}),V&&/* @__PURE__ */c("span",{id:q,hidden:!0,children:J.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
@@ -1,4 +1,4 @@
1
- import{AccessibleTable as e}from"./chunk-EYPKBJYG.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-GDQJBQ5B.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,B]=u(null),{highlighted:E}=r(),Q=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",Q),0===Q.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const C=Math.max(...Q.map(e=>e.depth))+1,F=f/2,I=f/2,L=(f/2-8-b)/C,Y=Q.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),z=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,A=e=>null!==w?e.id===w:null===E||e.branchKey===E,D=w?Q.find(e=>e.id===w):void 0,G=e=>c(e.value/Y*100,1,$);/* @__PURE__ */
1
+ import{AccessibleTable as e}from"./chunk-5PP435FL.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-36VIGB6J.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-GDQJBQ5B.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,B]=u(null),{highlighted:L}=r(),C=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",C),0===C.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const E=Math.max(...C.map(e=>e.depth))+1,F=f/2,I=f/2,P=(f/2-8-b)/E,Q=C.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),z=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,A=e=>null!==w?e.id===w:null===L||e.branchKey===L,G=w?C.find(e=>e.id===w):void 0,R=e=>c(e.value/Q*100,1,$);/* @__PURE__ */
2
2
  return d("div",{className:`relative ${g??""}`,children:[
3
- /* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(Y),C),onMouseLeave:()=>B(null),children:[Q.map(e=>/* @__PURE__ */s("path",{d:t(F,I,b+e.depth*L+v/2,b+(e.depth+1)*L-v/2,e.start,e.end),fill:z(e),fillOpacity:A(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>B(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:F,y:I+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),D&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:D.label,rows:[{key:"value",label:M.value,color:z(D),value:j(D.value)},{key:"share",label:M.share,color:a.muted,value:G(D)}]})}),
4
- /* @__PURE__ */s(e,{caption:M.sunburst(j(Y),C),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:Q.map(e=>[e.depth+1,e.label,j(e.value),G(e)])})]})}export{f as SunburstChart};
3
+ /* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(Q),E),onMouseLeave:()=>B(null),children:[C.map(e=>/* @__PURE__ */s("path",{d:t(F,I,b+e.depth*P+v/2,b+(e.depth+1)*P-v/2,e.start,e.end),fill:z(e),fillOpacity:A(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>B(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:F,y:I+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),G&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:G.label,rows:[{key:"value",label:M.value,color:z(G),value:j(G.value)},{key:"share",label:M.share,color:a.muted,value:R(G)}]})}),
4
+ /* @__PURE__ */s(e,{caption:M.sunburst(j(Q),E),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:C.map(e=>[e.depth+1,e.label,j(e.value),R(e)])})]})}export{f as SunburstChart};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-SXQZ5GTA.js";import{Avatar as t}from"./chunk-AFYLVV74.js";import{ItemCount as r}from"./chunk-P4VKU3SL.js";import{Button_default as a}from"./chunk-7DI3VQCF.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-AFG34RBV.js";import{Avatar as t}from"./chunk-AFYLVV74.js";import{ItemCount as r}from"./chunk-55AEZX6K.js";import{Button_default as a}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
2
2
  return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
3
3
  /* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
4
4
  /* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
@@ -1,3 +1,3 @@
1
- import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-7DI3VQCF.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
1
+ import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-EOVXFXVV.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
2
2
  return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
3
3
  /* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
@@ -1 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-QQ2LDC6C.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
1
+ import{useInsideTooltip as e,Tooltip as n}from"./chunk-NJN5IKWO.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a}from"./chunk-ZD56IH5K.js";import{Icon as e}from"./chunk-2UO47XB4.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
1
+ import{InputNumber_default as a}from"./chunk-QRU55BUS.js";import{Icon as e}from"./chunk-2UO47XB4.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
2
2
  return r("div",{role:"group","aria-label":e,className:"grid min-w-0 grid-cols-2 gap-2",children:[u("x"),u("y")]})}export{s as PositionInput};
@@ -1,20 +1,20 @@
1
- import{Pagination as e}from"./chunk-LXL2UCUR.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-CJH2BGXY.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
1
+ import{Pagination as e}from"./chunk-LXL2UCUR.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-WGLHB6WE.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
2
2
  return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
3
3
  /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
4
- /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:B,loading:M=!1,bordered:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:T,rowHref:I,onRowPress:L,linkAs:D,emptyText:R,selection:A,footer:E,virtualized:F,stackOnNarrow:O=!1,stackBelow:P,className:G=""}){const J=s(),K=R??J.table.empty,W=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),Q=O&&!F,U=Q?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),X=e=>Q?{role:e}:{},Z=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[V,Y]=i(0),q=F?.overscan??6,_=F?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/F.rowHeight)-q);Y(e=>e===t?e:t)}:void 0,ee=F?Math.ceil(F.height/F.rowHeight)+2*q:v.length,te=F?Math.min(V,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=F?te*F.rowHeight:0,ne=F?(v.length-re)*F.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!F)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=U.flatMap(e=>m(e)?e.columns:[e]),he=U.some(m),ue=/* @__PURE__ */new Map;if(Q)for(const e of U)if(m(e))for(const t of e.columns)ue.set(t,Z(e.title,e.label));const me=e=>{const t=Z(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(A?.selected??[]),ge=A?v.map((e,t)=>W(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=A?36:0,we=de.length+(A?1:0),xe=de.some(e=>"left"===e.fixed),ve=Q&&!A&&de.some(e=>e.cardCorner),ke=D??"a",Ne=`${p[S]} ${"sm"===S?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
- return h("th",{scope:"col",...X("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Me[t]??0)+be}:{},...F?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?F?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":F?"sticky z-10 bg-gray-50":"",Q&&d?"rosh-dt-sort":"",Q?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":Q?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
4
+ /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:B,loading:M=!1,bordered:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:L,rowHref:T,onRowPress:I,linkAs:D,emptyText:E,selection:R,footer:W,virtualized:A,stackOnNarrow:F=!1,stackBelow:O,className:P=""}){const G=s(),K=E??G.table.empty,J=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),Q=F&&!A,U=Q?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),Z=e=>Q?{role:e}:{},V=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[X,q]=i(0),Y=A?.overscan??6,_=A?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/A.rowHeight)-Y);q(e=>e===t?e:t)}:void 0,ee=A?Math.ceil(A.height/A.rowHeight)+2*Y:v.length,te=A?Math.min(X,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=A?te*A.rowHeight:0,ne=A?(v.length-re)*A.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!A)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=U.flatMap(e=>m(e)?e.columns:[e]),he=U.some(m),ue=/* @__PURE__ */new Map;if(Q)for(const e of U)if(m(e))for(const t of e.columns)ue.set(t,V(e.title,e.label));const me=e=>{const t=V(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(R?.selected??[]),ge=R?v.map((e,t)=>J(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=R?36:0,we=de.length+(R?1:0),xe=de.some(e=>"left"===e.fixed),ve=Q&&!R&&de.some(e=>e.cardCorner),ke=D??"a",Ne=`${p[S]} ${"sm"===S?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
+ return h("th",{scope:"col",...Z("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Me[t]??0)+be}:{},...A?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?A?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":A?"sticky z-10 bg-gray-50":"",Q&&d?"rosh-dt-sort":"",Q?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":Q?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
6
6
  /* @__PURE__ */h(n,{children:e.title}),
7
7
  /* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Be=0;const Me=de.map(e=>{if("left"!==e.fixed)return null;const t=Be;return Be+=e.width??0,t}),$e=/* @__PURE__ */c(d,{children:[
8
- /* @__PURE__ */c("div",{onScroll:_,style:F?{maxHeight:F.height}:void 0,className:`relative overflow-x-auto ${F?"overflow-y-auto":""} ${$?"rounded-lg border border-gray-200":""}${Q?" rosh-dt-scroll":""}`.trim(),children:[M&&
8
+ /* @__PURE__ */c("div",{onScroll:_,style:A?{maxHeight:A.height}:void 0,className:`relative overflow-x-auto ${A?"overflow-y-auto":""} ${$?"rounded-lg border border-gray-200":""}${Q?" rosh-dt-scroll":""}`.trim(),children:[M&&
9
9
  /* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
10
10
  /* @__PURE__ */h(r,{className:"h-6 w-6"}),
11
- /* @__PURE__ */h("span",{className:"sr-only",children:J.table.loading})]}),
12
- /* @__PURE__ */c("table",{...X("table"),className:(Q?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[B&&/* @__PURE__ */h("caption",{className:"sr-only",children:B}),
13
- /* @__PURE__ */c("thead",{...X("rowgroup"),className:Q?"rosh-dt-head":void 0,children:[
14
- /* @__PURE__ */c("tr",{ref:le,...X("row"),className:"border-b border-gray-200 bg-gray-50",children:[A&&/* @__PURE__ */h("th",{scope:"col",...X("columnheader"),rowSpan:he?2:void 0,style:{width:36,...F?{top:0}:{}},className:[Ne,o,xe||F?"sticky z-20 bg-gray-50":"",xe?"left-0":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":J.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!A)return;const e=new Set(ge);A.onChange(pe?A.selected.filter(t=>!e.has(t)):[...A.selected,...ge.filter(e=>!fe.has(e))])}})}),U.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...X("columnheader"),colSpan:e.columns.length,style:F?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",F?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...X("row"),className:"border-b border-gray-200 bg-gray-50",children:U.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
- /* @__PURE__ */h("tbody",{...X("rowgroup"),className:Q?"rosh-dt-body":void 0,children:0!==v.length||M?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=T?.(e,o),l=!!n?.current,s=I?.(e,o),i=void 0===s&&L?()=>L(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
- return c("tr",{...u(n),...X("row"),style:F?{height:F.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[Q?A?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",Q&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[A&&(()=>{const r=W(e,o);/* @__PURE__ */
17
- return h("td",{...X("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":J.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{A&&A.onChange(fe.has(e)?A.selected.filter(t=>t!==e):[...A.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=Q&&!n&&"wide"!==e.only;/* @__PURE__ */
18
- return h("td",{...X("cell"),"data-label":l?me(e):void 0,style:r?{left:(Me[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",Q?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],Q?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:Q?
19
- /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},W(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...X("row"),className:Q?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...X("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:K})})})]}),E]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:Q?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
- return h("div",Q?void 0!==P&&P>0&&40!==P?{className:`rosh-dt-at ${G}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/P*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:P/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${G}`.trim(),children:$e}:{className:G,children:$e})}export{x as DataTable};
11
+ /* @__PURE__ */h("span",{className:"sr-only",children:G.table.loading})]}),
12
+ /* @__PURE__ */c("table",{...Z("table"),className:(Q?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[B&&/* @__PURE__ */h("caption",{className:"sr-only",children:B}),
13
+ /* @__PURE__ */c("thead",{...Z("rowgroup"),className:Q?"rosh-dt-head":void 0,children:[
14
+ /* @__PURE__ */c("tr",{ref:le,...Z("row"),className:"border-b border-gray-200 bg-gray-50",children:[R&&/* @__PURE__ */h("th",{scope:"col",...Z("columnheader"),rowSpan:he?2:void 0,style:{width:36,...A?{top:0}:{}},className:[Ne,o,xe||A?"sticky z-20 bg-gray-50":"",xe?"left-0":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":G.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!R)return;const e=new Set(ge);R.onChange(pe?R.selected.filter(t=>!e.has(t)):[...R.selected,...ge.filter(e=>!fe.has(e))])}})}),U.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...Z("columnheader"),colSpan:e.columns.length,style:A?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",A?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...Z("row"),className:"border-b border-gray-200 bg-gray-50",children:U.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
+ /* @__PURE__ */h("tbody",{...Z("rowgroup"),className:Q?"rosh-dt-body":void 0,children:0!==v.length||M?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=L?.(e,o),l=!!n?.current,s=T?.(e,o),i=void 0===s&&I?()=>I(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
+ return c("tr",{...u(n),...Z("row"),style:A?{height:A.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[Q?R?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",Q&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[R&&(()=>{const r=J(e,o);/* @__PURE__ */
17
+ return h("td",{...Z("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":G.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{R&&R.onChange(fe.has(e)?R.selected.filter(t=>t!==e):[...R.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=Q&&!n&&"wide"!==e.only;/* @__PURE__ */
18
+ return h("td",{...Z("cell"),"data-label":l?me(e):void 0,style:r?{left:(Me[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",Q?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],Q?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:Q?
19
+ /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},J(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...Z("row"),className:Q?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...Z("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:K})})})]}),W]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:Q?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
+ return h("div",Q?void 0!==O&&O>0&&40!==O?{className:`rosh-dt-at ${P}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/O*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:O/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${P}`.trim(),children:$e}:{className:P,children:$e})}export{x as DataTable};
@@ -0,0 +1,2 @@
1
+ import{Input_default as e}from"./chunk-HNUKXGYP.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
2
+ return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
@@ -1,4 +1,4 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-ZD36QKQS.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-JTMEFXRL.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const $=m(),z=l().files,C=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),F=j?`${$}-error`:N?`${$}-hint`:void 0;/* @__PURE__ */
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-H5NIW2KS.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-JTMEFXRL.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const $=m(),z=l().files,C=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),F=j?`${$}-error`:N?`${$}-hint`:void 0;/* @__PURE__ */
2
2
  return o(e,{label:g,htmlFor:$,hint:N,error:j,required:k,className:v,children:[
3
3
  /* @__PURE__ */o("button",{ref:B,type:"button",id:$,disabled:y,onClick:C.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":F,...C.zoneProps,className:t(C.dragOver,y,a(y),"px-4 py-6"),children:[
4
4
  /* @__PURE__ */o("span",{children:[
@@ -1,4 +1,4 @@
1
- import{CloseGlyph as e}from"./chunk-ZD36QKQS.js";import{IconButton_default as t}from"./chunk-VCMHBUKI.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-JTMEFXRL.js";import{Button_default as s}from"./chunk-7DI3VQCF.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-GDQJBQ5B.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{CloseGlyph as e}from"./chunk-H5NIW2KS.js";import{IconButton_default as t}from"./chunk-LE5LWALR.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-JTMEFXRL.js";import{Button_default as s}from"./chunk-EOVXFXVV.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-GDQJBQ5B.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
@@ -6,8 +6,8 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
7
7
  /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:t.name,children:t.name}),
8
8
  /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(t.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(t.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${t.name}-${t.size}-${s}`)})})}function b({onClick:e,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
- /* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==y.current&&(y.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
10
- /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
9
+ /* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:L}){const v=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&v.rejections.length>0&&v.rejections!==y.current&&(y.current=v.rejections,j(v.rejections))},[v.rejections,j]),/* @__PURE__ */u(h,{intake:v,dropLabel:p,className:N,children:[L,
10
+ /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{v.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
11
11
  /* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
12
- /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
13
- /* @__PURE__ */d(a,{rejections:L.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
12
+ /* @__PURE__ */d(b,{onClick:v.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
13
+ /* @__PURE__ */d(a,{rejections:v.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
@@ -1,14 +1,14 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-LJN77RG6.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-2UO47XB4.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-GDQJBQ5B.js";import{solidSurfaceStyle as k}from"./chunk-5FYDNH4Y.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as H,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as O}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},k){const N=t,$=x(),D=d(),j=f??D,H=w(),S=/* @__PURE__ */C("select",{ref:k,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?H:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-LJN77RG6.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-2UO47XB4.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as y}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useShellStrings as k}from"./chunk-GDQJBQ5B.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as H,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as O}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,H=w(),S=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?H:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
2
2
  /* @__PURE__ */E(B,{items:r})]});return j?/* @__PURE__ */C(O,{children:[S,
3
3
  /* @__PURE__ */E("span",{id:H,hidden:!0,children:$.settingView.auto})]}):S});function B({items:e}){const t=e=>/* @__PURE__ */E("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return E(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var U=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:U,className:A="",id:R,disabled:K,size:V,touchSize:G,title:L,multiple:P,renderOption:W,renderValue:Y,valueText:F,readOnly:J=!1,footer:M,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!M?.length,me="sm"===V,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=x(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=R??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),He=X??je,Se=`${ke}-auto`,Te=[q,Q?De:void 0,He?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=P?l:[],Oe=u,Ie=f(oe,re,{matchTriggerWidth:!0,...M?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Be=P?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ue=P?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:Be>=0?Ce[Be].label:void 0,Ae=!P&&Be>=0?Ce[Be].lang:void 0,Re=P?Ce.filter(e=>Ee.includes(e.value)):Be>=0?[Ce[Be]]:[],Ke=Y&&Re.length?Y(Re):void 0,Ve=void 0!==Ke&&F?F(Re):void 0,Ge=H((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Le=H(()=>{K||J||(ae(Be>=0?Be:e(Ce)),ie(!0))},[K,J,Ce,Be]),Pe=H(e=>{const t=Ce[e];if(t&&!t.disabled){if(P){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Oe(t.value),Ge()}},[Ce,P,l,Oe,Ge]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Ge(),!0),ue)},[re,Ge]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ge(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ge(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ge]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const We=H(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Be,n=t(Ce,r.buffer,i);n<0||(re?ae(n):P?(ae(n),ie(!0)):Pe(n))},[re,ne,Be,Ce,Pe,P]),Ye=re?a(N,(e,t)=>{const r=(i=e.value,P?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
4
+ return E(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var U=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:U,className:A="",id:R,disabled:K,size:V,touchSize:G,title:L,multiple:P,renderOption:W,renderValue:Y,valueText:F,readOnly:J=!1,footer:M,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!M?.length,me="sm"===V,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=R??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),He=X??je,Se=`${ke}-auto`,Te=[q,Q?De:void 0,He?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=P?l:[],Oe=u,Ie=f(oe,re,{matchTriggerWidth:!0,...M?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Be=P?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ue=P?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:Be>=0?Ce[Be].label:void 0,Ae=!P&&Be>=0?Ce[Be].lang:void 0,Re=P?Ce.filter(e=>Ee.includes(e.value)):Be>=0?[Ce[Be]]:[],Ke=Y&&Re.length?Y(Re):void 0,Ve=void 0!==Ke&&F?F(Re):void 0,Ge=H((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Le=H(()=>{K||J||(ae(Be>=0?Be:e(Ce)),ie(!0))},[K,J,Ce,Be]),Pe=H(e=>{const t=Ce[e];if(t&&!t.disabled){if(P){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Oe(t.value),Ge()}},[Ce,P,l,Oe,Ge]);S(()=>{if(!re)return;return x(e=>!("Escape"!==e.key||!ye.current)&&(Ge(),!0),ue)},[re,Ge]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ge(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ge(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ge]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const We=H(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Be,n=t(Ce,r.buffer,i);n<0||(re?ae(n):P?(ae(n),ie(!0)):Pe(n))},[re,ne,Be,Ce,Pe,P]),Ye=re?a(N,(e,t)=>{const r=(i=e.value,P?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
5
  return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Pe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${P?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[P&&/* @__PURE__ */E(o,{selected:r}),W?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):P?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
6
6
  /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
7
  /* @__PURE__ */C(O,{children:[
8
8
  /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Fe=void 0!==Ke?
9
9
  /* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
10
10
  /* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ke}),
11
- /* @__PURE__ */E("span",{lang:void 0===Ve?Ae:void 0,className:"sr-only",children:Ve??Ue})]}):/* @__PURE__ */E("span",{lang:Ae,className:`block truncate ${void 0===Ue?c:""}`,children:Ue??z??" "}),Je={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...k()},Me=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":P||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Je,maxHeight:fe}:Je,children:Ye}),Qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Je,children:[Me,
11
+ /* @__PURE__ */E("span",{lang:void 0===Ve?Ae:void 0,className:"sr-only",children:Ve??Ue})]}):/* @__PURE__ */E("span",{lang:Ae,className:`block truncate ${void 0===Ue?c:""}`,children:Ue??z??" "}),Je={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...y()},Me=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":P||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Je,maxHeight:fe}:Je,children:Ye}),Qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Je,children:[Me,
12
12
  /* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:M.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ge(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(M?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Ge());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ge()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */E(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
13
  /* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Me;/* @__PURE__ */
14
14
  return C("div",{ref:le,className:"relative",children:[