efficient-shell 13.25.0 → 14.0.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 (269) hide show
  1. package/README.md +8 -4
  2. package/dist/{Browser-W2WVSAEN.js → Browser-FYVRNXOL.js} +13 -13
  3. package/dist/Calculator-7CY2CRGB.js +29 -0
  4. package/dist/{CurrencyConverter-VH4UVYLO.js → CurrencyConverter-FXWM3DBQ.js} +9 -9
  5. package/dist/{Files-6QZFFGSH.js → Files-VDQYQSDZ.js} +85 -85
  6. package/dist/{Notepad-YU4HIJD2.js → Notepad-J3Z3CYEC.js} +9 -9
  7. package/dist/PomodoroTimer-RPGWT26T.js +91 -0
  8. package/dist/{Preview-H7N2MMAI.js → Preview-ISEPDV3A.js} +37 -37
  9. package/dist/Sidebar-2TYZENQL.js +44 -0
  10. package/dist/{Stock-YL732PKW.js → Stock-TUPZORQN.js} +4 -4
  11. package/dist/{Weather-3CBRXNNM.js → Weather-URCO6JML.js} +23 -23
  12. package/dist/{WorldClock-LONNWCRG.js → WorldClock-EBBUWG5L.js} +6 -6
  13. package/dist/ai/index.js +92 -92
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/charts/ChordChart.js +1 -1
  19. package/dist/charts/FlowChart.js +1 -1
  20. package/dist/charts/RadarChart.js +1 -1
  21. package/dist/charts/SankeyChart.js +1 -1
  22. package/dist/charts/SpecChart.js +1 -1
  23. package/dist/charts/SunburstChart.js +1 -1
  24. package/dist/charts/TreemapChart.js +1 -1
  25. package/dist/{chunk-XVMCSUAV.js → chunk-22SVN2ZM.js} +1 -1
  26. package/dist/{chunk-ZDFMYAQB.js → chunk-24BF22NF.js} +1 -1
  27. package/dist/{chunk-JIJZBM25.js → chunk-2RLWGWOU.js} +13 -13
  28. package/dist/{chunk-VP2IQJUD.js → chunk-2SOGTOUQ.js} +4 -4
  29. package/dist/{chunk-4VFEPP2W.js → chunk-2XDO7FZC.js} +13 -13
  30. package/dist/{chunk-SLEA47VA.js → chunk-3L7BEEBW.js} +1 -1
  31. package/dist/{chunk-GZRNOIEE.js → chunk-3ZJAQSFS.js} +3 -3
  32. package/dist/{chunk-BQQEQCSK.js → chunk-47BGAQWD.js} +1 -1
  33. package/dist/{chunk-7AVPMO4F.js → chunk-4BRVZAIW.js} +1 -1
  34. package/dist/chunk-4DNPUG3T.js +7 -0
  35. package/dist/{chunk-VKZC3NPM.js → chunk-5O4HMXPQ.js} +2 -2
  36. package/dist/{chunk-JLSXDYS4.js → chunk-5SQHRDFC.js} +2 -2
  37. package/dist/{chunk-LQIHBIXG.js → chunk-6AYAB5FN.js} +5 -5
  38. package/dist/{chunk-VGUB7LPF.js → chunk-6IP4Q3AT.js} +52 -52
  39. package/dist/{chunk-527WMFTR.js → chunk-6RU2PGQK.js} +1 -1
  40. package/dist/{chunk-UVPDEGIA.js → chunk-6X32SWQI.js} +1 -1
  41. package/dist/{chunk-A5FC4LR7.js → chunk-7D2QZ6JA.js} +1 -1
  42. package/dist/{chunk-77N3REYY.js → chunk-7KNVO46D.js} +2 -2
  43. package/dist/{chunk-2YHS5E27.js → chunk-7OVMWXFM.js} +1 -1
  44. package/dist/{chunk-LC2UF3AA.js → chunk-7WF6LFOJ.js} +1 -1
  45. package/dist/{chunk-IJG4UEKF.js → chunk-A3VLZZHJ.js} +8 -8
  46. package/dist/{chunk-LG6NDTHZ.js → chunk-AH5MLH54.js} +1 -1
  47. package/dist/chunk-AJPQJ7TC.js +6 -0
  48. package/dist/{chunk-TNALBYLY.js → chunk-ALZHFQRX.js} +1 -1
  49. package/dist/{chunk-S5MTTJ3F.js → chunk-AZZ4NO2D.js} +12 -12
  50. package/dist/{chunk-P4VOUPRF.js → chunk-CHDGSJLV.js} +6 -6
  51. package/dist/{chunk-VY6OQRZA.js → chunk-CJ4OEY3T.js} +1 -1
  52. package/dist/{chunk-Q36KB5RQ.js → chunk-CXEELIRW.js} +11 -11
  53. package/dist/{chunk-MZ3JADHG.js → chunk-DBBOD5QW.js} +1 -1
  54. package/dist/chunk-DBQNYJZ6.js +1 -0
  55. package/dist/{chunk-65BW43PF.js → chunk-DNPAYNNU.js} +1 -1
  56. package/dist/{chunk-TTRLYWP4.js → chunk-DO6P6LYU.js} +1 -1
  57. package/dist/chunk-DOJSWVBX.js +6 -0
  58. package/dist/chunk-DTFX624I.js +8 -0
  59. package/dist/chunk-E57C7NBA.js +2 -0
  60. package/dist/{chunk-D5PXRJHA.js → chunk-EBODRYXS.js} +14 -14
  61. package/dist/{chunk-YDJ5IZOU.js → chunk-EDRELF6L.js} +1 -1
  62. package/dist/{chunk-M3HTP2N6.js → chunk-EHNW3UNC.js} +6 -6
  63. package/dist/{chunk-AH2NEKEN.js → chunk-EHSK43WG.js} +8 -8
  64. package/dist/{chunk-VMAIZU5S.js → chunk-EN3GYSCE.js} +1 -1
  65. package/dist/{chunk-TTYTOLVV.js → chunk-EOYKUV2U.js} +1 -1
  66. package/dist/chunk-FFPIT2LB.js +3 -0
  67. package/dist/{chunk-TD3ZQD5R.js → chunk-G3TC2GIA.js} +1 -1
  68. package/dist/{chunk-UQV4TSWB.js → chunk-GTZML3V3.js} +1 -1
  69. package/dist/{chunk-JYR4V4AG.js → chunk-GUUBFQ6L.js} +2 -2
  70. package/dist/{chunk-K42FXX7J.js → chunk-GVAVIYE6.js} +1 -1
  71. package/dist/{chunk-2Y4AH7NC.js → chunk-GY7MJTIZ.js} +1 -1
  72. package/dist/{chunk-XYXCZIJY.js → chunk-HAEZUUDT.js} +3 -3
  73. package/dist/{chunk-J5W63XNR.js → chunk-HTBACICQ.js} +6 -6
  74. package/dist/{chunk-5URXJCNC.js → chunk-HX5QSQ2C.js} +1 -1
  75. package/dist/{chunk-VLBLDSA6.js → chunk-I7WAOKU2.js} +2 -2
  76. package/dist/{chunk-LLDGRPLF.js → chunk-ION3XGLN.js} +1 -1
  77. package/dist/{chunk-EXDSYFHB.js → chunk-ISWTJBOA.js} +1 -1
  78. package/dist/{chunk-BUFAJJDZ.js → chunk-IVEM2BPC.js} +1 -1
  79. package/dist/{chunk-D4432YRW.js → chunk-IZ6D4KGR.js} +1 -1
  80. package/dist/{chunk-KC2EQCBE.js → chunk-JPVD3VS7.js} +6 -6
  81. package/dist/{chunk-C7Z3ZMJH.js → chunk-KE7P74XM.js} +13 -13
  82. package/dist/chunk-KEFNQEXZ.js +1 -0
  83. package/dist/{chunk-DUEEAP4Y.js → chunk-LPL7BWGG.js} +1 -1
  84. package/dist/{chunk-JVENCUUG.js → chunk-LRMDLZMM.js} +4 -4
  85. package/dist/chunk-M5IZ7QLQ.js +7 -0
  86. package/dist/{chunk-MCLVTQSF.js → chunk-MEDOESQD.js} +8 -8
  87. package/dist/chunk-MEP6CZJ3.js +2 -0
  88. package/dist/{chunk-ZYKY4Z7R.js → chunk-MKHOXO5O.js} +1 -1
  89. package/dist/chunk-MNZAAQLH.js +15 -0
  90. package/dist/{chunk-DTRJLQWO.js → chunk-MPC3CHAO.js} +1 -1
  91. package/dist/{chunk-7PAZO65L.js → chunk-MXRF5YVN.js} +5 -5
  92. package/dist/{chunk-NWS5G7FE.js → chunk-MYH5H43C.js} +1 -1
  93. package/dist/{chunk-5OHFBS2B.js → chunk-NC5FIFAY.js} +1 -1
  94. package/dist/chunk-NDCS4COQ.js +11 -0
  95. package/dist/{chunk-IJ4JX6WP.js → chunk-NHALP3MW.js} +4 -4
  96. package/dist/{chunk-R5WBDXI2.js → chunk-OYQWBJ37.js} +1 -1
  97. package/dist/{chunk-UU42O5ON.js → chunk-P3XXFQG5.js} +1 -1
  98. package/dist/{chunk-YBE66FBR.js → chunk-P5J7G7OV.js} +1 -1
  99. package/dist/{chunk-4L5YRMJ4.js → chunk-PEA5Y6DD.js} +9 -9
  100. package/dist/{chunk-DPFEQQQU.js → chunk-POBVGDZP.js} +1 -1
  101. package/dist/{chunk-RFWBNKKB.js → chunk-PPHGBEJA.js} +10 -10
  102. package/dist/{chunk-IMH5H47S.js → chunk-PTLVNC3V.js} +6 -6
  103. package/dist/chunk-PU2GJVMG.js +1 -0
  104. package/dist/{chunk-TJG76Y7I.js → chunk-PWERFHOU.js} +9 -9
  105. package/dist/{chunk-ZFWCTHR4.js → chunk-PWON7O3N.js} +6 -6
  106. package/dist/{chunk-6MFKKTCE.js → chunk-Q7FPGOUY.js} +24 -24
  107. package/dist/{chunk-M4REKOGO.js → chunk-QCLKRFL4.js} +5 -5
  108. package/dist/{chunk-N4LMFGRI.js → chunk-R36VZ35L.js} +6 -6
  109. package/dist/{chunk-CCZHSISF.js → chunk-REFPTKRD.js} +2 -2
  110. package/dist/{chunk-THAPVKEJ.js → chunk-RTK77DMP.js} +11 -11
  111. package/dist/{chunk-PWOVSR7N.js → chunk-RXCBSQA2.js} +2 -2
  112. package/dist/{chunk-JDLJ7DHV.js → chunk-S4RFJTGR.js} +1 -1
  113. package/dist/{chunk-D5HFWOW7.js → chunk-SP4S4HUJ.js} +16 -16
  114. package/dist/{chunk-P73ZJ6QR.js → chunk-T46I4YOI.js} +1 -1
  115. package/dist/{chunk-VY3UA6AR.js → chunk-TAHHZGRH.js} +1 -1
  116. package/dist/{chunk-FBZUEZK7.js → chunk-TTD2M6RF.js} +1 -1
  117. package/dist/{chunk-AAJSE5HA.js → chunk-U6W3OU2X.js} +1 -1
  118. package/dist/{chunk-RB3BMRNA.js → chunk-U75MSD4F.js} +1 -1
  119. package/dist/{chunk-XC2GUCTG.js → chunk-UGA5NGW4.js} +1 -1
  120. package/dist/chunk-UZESZ3EB.js +1 -0
  121. package/dist/chunk-VUBDHFG5.js +4 -0
  122. package/dist/{chunk-K4KUGKWP.js → chunk-W4IH3BE3.js} +21 -21
  123. package/dist/{chunk-B5KX7PDG.js → chunk-W6REY3SV.js} +3 -3
  124. package/dist/{chunk-WZWSFYXJ.js → chunk-WBUAO7T7.js} +1 -1
  125. package/dist/{chunk-P6H2B635.js → chunk-WNFZYTWW.js} +9 -9
  126. package/dist/{chunk-HPKQYUQT.js → chunk-WYAKASF3.js} +1 -1
  127. package/dist/{chunk-C5OPAULN.js → chunk-XGEN76DG.js} +1 -1
  128. package/dist/{chunk-ZKILZFUI.js → chunk-XIX72C7K.js} +1 -1
  129. package/dist/{chunk-3AUN7JSM.js → chunk-XJK6VNXV.js} +1 -1
  130. package/dist/{chunk-26KHYLJN.js → chunk-XLPUIGMO.js} +1 -1
  131. package/dist/{chunk-VQBKRBBR.js → chunk-XNKNX5L3.js} +1 -1
  132. package/dist/chunk-Y2M5PP2C.js +28 -0
  133. package/dist/{chunk-66NJCU4W.js → chunk-Y5RTVKMB.js} +8 -8
  134. package/dist/{chunk-JXJNQHPY.js → chunk-Y5YVKUM4.js} +19 -19
  135. package/dist/{chunk-5CHJA4RL.js → chunk-Y6FULJWJ.js} +7 -7
  136. package/dist/chunk-Y7D2CZ4H.js +13 -0
  137. package/dist/chunk-YTLUSBDY.js +14 -0
  138. package/dist/{chunk-2YUAR2EH.js → chunk-YX3JD6PA.js} +5 -5
  139. package/dist/{chunk-3WUVYXCF.js → chunk-ZA6ANC2D.js} +5 -5
  140. package/dist/{chunk-5ZOYYL46.js → chunk-ZEGCKIAL.js} +3 -3
  141. package/dist/chunk-ZSVU44OB.js +6 -0
  142. package/dist/data/DataTable.js +1 -1
  143. package/dist/data/EntityList.js +1 -1
  144. package/dist/data/Gantt.js +1 -1
  145. package/dist/data/Kanban.js +1 -1
  146. package/dist/data/ListLoadError.js +1 -1
  147. package/dist/data/ResizableTable.js +1 -1
  148. package/dist/data/statusColumn.js +1 -1
  149. package/dist/data/useColumnConfig.js +1 -1
  150. package/dist/data/useSort.js +1 -1
  151. package/dist/format/index.js +1 -1
  152. package/dist/forms/AlignmentGrid.js +1 -1
  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/Calendar.js +1 -1
  157. package/dist/forms/ColorPicker.js +1 -1
  158. package/dist/forms/ComposerAttachments.js +1 -1
  159. package/dist/forms/CornersInput.js +1 -1
  160. package/dist/forms/DatePicker.js +1 -1
  161. package/dist/forms/DateRangePicker.js +1 -1
  162. package/dist/forms/DisplayChips.js +1 -1
  163. package/dist/forms/FilePicker.js +1 -1
  164. package/dist/forms/IconButton.js +1 -1
  165. package/dist/forms/IconPicker.js +1 -1
  166. package/dist/forms/Input.js +1 -1
  167. package/dist/forms/InputNumber.js +1 -1
  168. package/dist/forms/LinkPicker.js +1 -1
  169. package/dist/forms/MediaLibrary.js +1 -1
  170. package/dist/forms/MediaUploadField.js +1 -1
  171. package/dist/forms/MediaUploadGrid.js +1 -1
  172. package/dist/forms/MediaUsedInList.js +1 -1
  173. package/dist/forms/NumericKeypad.js +1 -1
  174. package/dist/forms/PictureTiles.js +1 -1
  175. package/dist/forms/PositionInput.js +1 -1
  176. package/dist/forms/RenameField.js +1 -1
  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/UnitMenu.js +1 -1
  186. package/dist/forms/WidthsBar.js +1 -1
  187. package/dist/forms/dropdownPosition.js +1 -1
  188. package/dist/hooks/index.d.ts +15 -14
  189. package/dist/hooks/index.js +1 -1
  190. package/dist/hooks/useTheme.js +1 -1
  191. package/dist/icons/index.js +1 -1
  192. package/dist/index.d.ts +43 -2
  193. package/dist/index.js +126 -126
  194. package/dist/map/index.js +5 -5
  195. package/dist/markdown/index.js +1 -1
  196. package/dist/page-tabs/index.js +5 -5
  197. package/dist/shell/AppUpdateBanner.js +1 -1
  198. package/dist/shell/ColoredBadge.js +1 -1
  199. package/dist/shell/ConfirmDialog.js +1 -1
  200. package/dist/shell/ContextMenu.js +1 -1
  201. package/dist/shell/Dialog.js +1 -1
  202. package/dist/shell/Drawer.js +1 -1
  203. package/dist/shell/DropdownMenu.js +1 -1
  204. package/dist/shell/EditableGrid.js +1 -1
  205. package/dist/shell/FloatingBar.js +1 -1
  206. package/dist/shell/GlobalSearch.js +1 -1
  207. package/dist/shell/HelpCenter.js +1 -1
  208. package/dist/shell/IconRail.js +1 -1
  209. package/dist/shell/ImageLightbox.js +1 -1
  210. package/dist/shell/ItemCount.js +1 -1
  211. package/dist/shell/Kbd.js +1 -1
  212. package/dist/shell/LanguageSelect.js +1 -1
  213. package/dist/shell/Markdown.js +1 -1
  214. package/dist/shell/MilestoneTimeline.js +1 -1
  215. package/dist/shell/Popover.js +1 -1
  216. package/dist/shell/PopupMenu.js +1 -1
  217. package/dist/shell/ProductionTimeline.js +1 -1
  218. package/dist/shell/ResizeHandle.js +1 -1
  219. package/dist/shell/SearchableSelect.js +1 -1
  220. package/dist/shell/SettingReset.js +1 -1
  221. package/dist/shell/SettingRow.js +1 -1
  222. package/dist/shell/ShellPrefs.js +1 -1
  223. package/dist/shell/SidebarLayout.js +1 -1
  224. package/dist/shell/SidebarNav.js +1 -1
  225. package/dist/shell/SortableList.js +1 -1
  226. package/dist/shell/StatusBadge.js +1 -1
  227. package/dist/shell/Tabs.js +1 -1
  228. package/dist/shell/TimelineTrack.js +1 -1
  229. package/dist/shell/Tooltip.js +1 -1
  230. package/dist/shell/TopNav.js +1 -1
  231. package/dist/shell/TransferProgress.js +1 -1
  232. package/dist/shell/Tree.js +1 -1
  233. package/dist/shell/discardGuard.js +1 -1
  234. package/dist/telemetry/index.js +1 -1
  235. package/dist/templates/AuthScreen.js +1 -1
  236. package/dist/templates/ChatTemplate.js +1 -1
  237. package/dist/templates/CheckoutTemplate.js +1 -1
  238. package/dist/templates/DashboardTemplate.js +1 -1
  239. package/dist/templates/DataTablePage.js +1 -1
  240. package/dist/templates/EmailTemplate.js +1 -1
  241. package/dist/templates/ErrorBoundary.js +1 -1
  242. package/dist/templates/FormLayoutPage.js +1 -1
  243. package/dist/templates/GalleryTemplate.js +1 -1
  244. package/dist/ui/index.js +1 -1
  245. package/dist/version.js +1 -1
  246. package/package.json +1 -1
  247. package/dist/Calculator-PKAM5ERT.js +0 -29
  248. package/dist/PomodoroTimer-PBSAKRX5.js +0 -91
  249. package/dist/Sidebar-HAIHWIJD.js +0 -44
  250. package/dist/chunk-2AEYVQ2R.js +0 -2
  251. package/dist/chunk-3GJVTK4H.js +0 -11
  252. package/dist/chunk-3TD3GH53.js +0 -7
  253. package/dist/chunk-44ERJYNW.js +0 -6
  254. package/dist/chunk-AAFPAQXH.js +0 -13
  255. package/dist/chunk-EX3DARI3.js +0 -7
  256. package/dist/chunk-F2RAIGCG.js +0 -6
  257. package/dist/chunk-FLQXMCB3.js +0 -8
  258. package/dist/chunk-N6PMH6DU.js +0 -6
  259. package/dist/chunk-O5ZBRG2G.js +0 -1
  260. package/dist/chunk-PP3WUT2G.js +0 -15
  261. package/dist/chunk-PWX64YBI.js +0 -28
  262. package/dist/chunk-RJVIKGHJ.js +0 -4
  263. package/dist/chunk-SRI2D23Y.js +0 -14
  264. package/dist/chunk-UTISUEO4.js +0 -2
  265. package/dist/chunk-UVHXVSB2.js +0 -1
  266. package/dist/chunk-WCCS4VFE.js +0 -1
  267. package/dist/chunk-ZDXRSY2Y.js +0 -1
  268. package/dist/chunk-ZISKHQZY.js +0 -3
  269. /package/dist/{chunk-4BYJABCX.js → chunk-5YTZBYG4.js} +0 -0
@@ -1,19 +1,19 @@
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-K5YT5PMJ.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-ISVODSRP.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-VY3UA6AR.js";import{useBrowserLayoutEffect as g}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-NRHG4R2Q.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as S,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as I}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=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,S=w(),H=/* @__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?S: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
- /* @__PURE__ */E(z,{items:r})]});return j?/* @__PURE__ */C(I,{children:[H,
3
- /* @__PURE__ */E("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function z({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(I,{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 A=N(function({value:l,onChange:u,options:N,placeholder:R,invalid:A,className:Y="",id:V,disabled:K,size:P,touchSize:U,title:B,multiple:M,renderOption:W,renderValue:F,valueText:G,readOnly:L=!1,footer:X,changed:q=!1,auto:J,"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=!!X?.length,me="sm"===P,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=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=J??je,He=`${ke}-auto`,Te=[Q,q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=M?l:[],Ie=u,Oe=f(oe,re,{matchTriggerWidth:!0,...X?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[Re]),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,Re]);const ze=M?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ae=M?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ce[ze].label:void 0,Ye=!M&&ze>=0?Ce[ze].lang:void 0,Ve=M?Ce.filter(e=>Ee.includes(e.value)):ze>=0?[Ce[ze]]:[],Ke=F&&Ve.length?F(Ve):void 0,Pe=void 0!==Ke&&G?G(Ve):void 0,Ue=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Be=S(()=>{K||L||(ae(ze>=0?ze:e(Ce)),ie(!0))},[K,L,Ce,ze]),Me=S(e=>{const t=Ce[e];if(t&&!t.disabled){if(M){const r=l;return Ie(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ie(t.value),Ue()}},[Ce,M,l,Ie,Ue]);H(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Ue(),!0),ue)},[re,Ue]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ue(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ue(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ue]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const We=S(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:ze,n=t(Ce,r.buffer,i);n<0||(re?ae(n):M?(ae(n),ie(!0)):Me(n))},[re,ne,ze,Ce,Me,M]),Fe=re?a(N,(e,t)=>{const r=(i=e.value,M?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
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:()=>Me(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${M?" 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:[M&&/* @__PURE__ */E(o,{selected:r}),W?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):M?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
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-K5YT5PMJ.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-ISVODSRP.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-TAHHZGRH.js";import{useBrowserLayoutEffect as g}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-NRHG4R2Q.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as H,useCallback as j,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as I}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=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(),H=f??D,j=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,H?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:H,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
2
+ /* @__PURE__ */E(z,{items:r})]});return H?/* @__PURE__ */C(I,{children:[S,
3
+ /* @__PURE__ */E("span",{id:j,hidden:!0,children:$.settingView.auto})]}):S});function z({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(I,{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 A=N(function({value:l,onChange:u,options:N,placeholder:R,invalid:A,className:P="",id:V,disabled:K,size:U,touchSize:G,title:M,multiple:Y,renderOption:B,renderValue:W,valueText:F,readOnly:L=!1,footer:J,changed:q=!1,auto:Q,"aria-describedby":X,"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=!!J?.length,me="sm"===U,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=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,He=d(),je=Q??He,Se=`${ke}-auto`,Te=[X,q?De:void 0,je?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=H(()=>n(N),[N]),Ee=Y?l:[],Ie=u,Oe=f(oe,re,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[Re]),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,Re]);const ze=Y?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ae=Y?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ce[ze].label:void 0,Pe=!Y&&ze>=0?Ce[ze].lang:void 0,Ve=Y?Ce.filter(e=>Ee.includes(e.value)):ze>=0?[Ce[ze]]:[],Ke=W&&Ve.length?W(Ve):void 0,Ue=void 0!==Ke&&F?F(Ve):void 0,Ge=j((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Me=j(()=>{K||L||(ae(ze>=0?ze:e(Ce)),ie(!0))},[K,L,Ce,ze]),Ye=j(e=>{const t=Ce[e];if(t&&!t.disabled){if(Y){const r=l;return Ie(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ie(t.value),Ge()}},[Ce,Y,l,Ie,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 Be=j(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:ze,n=t(Ce,r.buffer,i);n<0||(re?ae(n):Y?(ae(n),ie(!0)):Ye(n))},[re,ne,ze,Ce,Ye,Y]),We=re?a(N,(e,t)=>{const r=(i=e.value,Y?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
+ return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||B?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Ye(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${Y?" 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:[Y&&/* @__PURE__ */E(o,{selected:r}),B?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:B(e,{selected:r,active:n})}):Y?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
6
6
  /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
7
  /* @__PURE__ */C(I,{children:[
8
- /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ge=void 0!==Ke?
8
+ /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(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===Pe?Ye:void 0,className:"sr-only",children:Pe??Ae})]}):/* @__PURE__ */E("span",{lang:Ye,className:`block truncate ${void 0===Ae?c:""}`,children:Ae??R??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Xe=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":M||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?{...Le,maxHeight:fe}:Le,children:Fe}),qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Xe,
12
- /* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:X.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||(Ue(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(X?.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 Ue());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ue()}})(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
- /* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Xe;/* @__PURE__ */
11
+ /* @__PURE__ */E("span",{lang:void 0===Ue?Pe:void 0,className:"sr-only",children:Ue??Ae})]}):/* @__PURE__ */E("span",{lang:Pe,className:`block truncate ${void 0===Ae?c:""}`,children:Ae??R??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Je=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":Y||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?{...Le,maxHeight:fe}:Le,children:We}),qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Je,
12
+ /* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.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=(J?.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
+ /* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
14
14
  return C("div",{ref:le,className:"relative",children:[
15
- /* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:B,disabled:K,"aria-readonly":L||void 0,onClick:()=>re?Ue():Be(),onKeyDown:t=>{if(!K&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Be());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Be());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),Me(ne)));case" ":return t.preventDefault(),void(re?Me(ne):Be());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Ue()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Ue(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),We(t.key))}},className:s({invalid:A,size:P,readOnly:L,auto:Se,className:`${L?"":"pr-8 "}text-left ${Y}`.trim()}),children:q?
16
- /* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
17
- /* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),q&&/* @__PURE__ */E("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */E("span",{id:He,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */E(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
- /* @__PURE__ */C("select",{ref:te,value:l,multiple:M||void 0,onChange:e=>Ie(M?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:K,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!M&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:R}),
19
- /* @__PURE__ */E(z,{items:N})]}),re&&T(qe,document.body)]})}),Y=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */E(R,{ref:r,...t,size:n}):/* @__PURE__ */E(A,{ref:r,...t}):/* @__PURE__ */E(A,{ref:r,...t,size:n})});export{R as NativeSelect,Y as Select_default};
15
+ /* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:M,disabled:K,"aria-readonly":L||void 0,onClick:()=>re?Ge():Me(),onKeyDown:t=>{if(!K&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Me());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Me());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),Ye(ne)));case" ":return t.preventDefault(),void(re?Ye(ne):Me());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Ge()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Ge(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Be(t.key))}},className:s({invalid:A,size:U,readOnly:L,auto:je,className:`${L?"":"pr-8 "}text-left ${P}`.trim()}),children:q?
16
+ /* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Fe,
17
+ /* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Fe}),q&&/* @__PURE__ */E("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */E("span",{id:Se,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */E(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
+ /* @__PURE__ */C("select",{ref:te,value:l,multiple:Y||void 0,onChange:e=>Ie(Y?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:K,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!Y&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:R}),
19
+ /* @__PURE__ */E(z,{items:N})]}),re&&T(qe,document.body)]})}),P=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */E(R,{ref:r,...t,size:n}):/* @__PURE__ */E(A,{ref:r,...t}):/* @__PURE__ */E(A,{ref:r,...t,size:n})});export{R as NativeSelect,P as Select_default};
@@ -1,3 +1,3 @@
1
- import{OneLineLabel as t}from"./chunk-TD3ZQD5R.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
1
+ import{OneLineLabel as t}from"./chunk-G3TC2GIA.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
2
2
  return o(l.Provider,{value:t,children:/* @__PURE__ */o(c.Provider,{value:s,children:a})})}function f(){const t=a(c);return r(s=>t?.(s)??d(s),[t])}function g({status:s,label:r,emphasis:n="subtle"}){const u=i(a(l)[s]??"neutral",n),v=a(c),f=r??v?.(s)??d(s);/* @__PURE__ */
3
3
  return o("span",{className:`${e} px-3 py-0.5 text-xs font-medium ${u}`,children:/* @__PURE__ */o(t,{children:f})})}export{e as BADGE_PILL,n as GROUP_COLORS,u as GROUP_COLORS_SOLID,g as StatusBadge,v as StatusBadgeProvider,i as groupColors,d as statusLabel,f as useStatusLabel};
@@ -1,4 +1,4 @@
1
- import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-HGOWQO63.js";import{useDismissPopupsOnOpen as i}from"./chunk-UVHXVSB2.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-5FYDNH4Y.js";import{useShellStrings as m}from"./chunk-NRHG4R2Q.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
1
+ import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-HGOWQO63.js";import{useDismissPopupsOnOpen as i}from"./chunk-DBQNYJZ6.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-5FYDNH4Y.js";import{useShellStrings as m}from"./chunk-NRHG4R2Q.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
2
2
  return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */v("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
3
3
  /* @__PURE__ */v("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:[
4
4
  /* @__PURE__ */w("span",{children:e.title}),
@@ -6,22 +6,22 @@ return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.m
6
6
  return v("div",{id:C(r,n),role:"option","aria-selected":s,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(s?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>o(n),children:[
7
7
  /* @__PURE__ */w("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:E(e,a)})}),
8
8
  /* @__PURE__ */v("div",{className:"flex-1 min-w-0",children:[
9
- /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:R,onRecord:K,favorites:H,hotkey:M=!0}={}){const $=m().search,B=E??$.placeholder,[P,S]=h(!1),[V,W]=h(""),[z,F]=h(0),G=f(null),{results:O,truncatedTypes:Q,loading:U,failure:Y,reset:q}=L(V,l,2);y(()=>{const e=e=>{M&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),S(e=>!e)),"Escape"===e.key&&P&&S(!1)},t=()=>S(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[P,M]),i(P);const[J,X]=h(!1);P!==J&&(X(P),P&&(W(""),F(0),q())),y(()=>{P?setTimeout(()=>G.current?.focus(),50):W("")},[P]),y(()=>{F(0)},[O]);const Z=V.length>=2,_=g(()=>Z?e(O,D,V,$.actions,{truncatedTypes:Q,listRoutes:A,typeLabels:N,seeAllLabel:$.seeAll}):t({recent:R,favorites:H,actions:D,typeLabels:N},$),[Z,O,Q,A,N,D,V,R,H,$]),ee=g(()=>r(_),[_]),te=Math.min(z,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{P&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[P,te,ee.length,re]);const ae=b(e=>{S(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||K?.(e.result),I?.(e.result)):e.action.onSelect()},[I,K]);return P?k(
10
- /* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>S(!1),children:[
9
+ /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:R,onRecord:K,favorites:M,hotkey:H=!0}={}){const $=m().search,B=E??$.placeholder,[P,W]=h(!1),[z,F]=h(""),[G,Q]=h(0),S=f(null),{results:Y,truncatedTypes:J,loading:O,failure:V,reset:Z}=L(z,l,2);y(()=>{const e=e=>{H&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),W(e=>!e)),"Escape"===e.key&&P&&W(!1)},t=()=>W(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[P,H]),i(P);const[q,U]=h(!1);P!==q&&(U(P),P&&(F(""),Q(0),Z())),y(()=>{P?setTimeout(()=>S.current?.focus(),50):F("")},[P]),y(()=>{Q(0)},[Y]);const _=z.length>=2,X=g(()=>_?e(Y,D,z,$.actions,{truncatedTypes:J,listRoutes:A,typeLabels:N,seeAllLabel:$.seeAll}):t({recent:R,favorites:M,actions:D,typeLabels:N},$),[_,Y,J,A,N,D,z,R,M,$]),ee=g(()=>r(X),[X]),te=Math.min(G,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{P&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[P,te,ee.length,re]);const ae=b(e=>{W(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||K?.(e.result),I?.(e.result)):e.action.onSelect()},[I,K]);return P?k(
10
+ /* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>W(!1),children:[
11
11
  /* @__PURE__ */w("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
12
  /* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:p(),children:[
13
13
  /* @__PURE__ */v("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
14
  /* @__PURE__ */w("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:n})}),
15
- /* @__PURE__ */w("input",{ref:G,type:"text",value:V,onChange:e=>{W(e.target.value),F(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),F(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),F(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),F(s(_.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:B,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),U&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":$.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
15
+ /* @__PURE__ */w("input",{ref:S,type:"text",value:z,onChange:e=>{F(e.target.value),Q(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),Q(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),Q(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),Q(s(X.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:B,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),O&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":$.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
16
16
  /* @__PURE__ */w("kbd",{className:"hidden sm:inline-flex items-center rounded border border-line-strong px-2 py-0.5 text-2xs font-medium text-ink-faintest",children:$.escBadge})]}),
17
- /* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[U&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:$.searching}),!U&&"all"===Y&&Z&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:$.searchFailed}),!U&&Z&&0===ee.length&&"all"!==Y&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:$.noResults}),ne&&/* @__PURE__ */w(T,{sections:_,activeIdx:te,listId:re,label:$.listLabel,typeIcons:o,groupCount:$.groupCount,groupLabel:$.groupLabel,onHover:F,onPick:ae}),!U&&"some"===Y&&Z&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:$.partialFailure}),!U&&!Z&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:$.minChars(2)})]}),
17
+ /* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[O&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:$.searching}),!O&&"all"===V&&_&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:$.searchFailed}),!O&&_&&0===ee.length&&"all"!==V&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:$.noResults}),ne&&/* @__PURE__ */w(T,{sections:X,activeIdx:te,listId:re,label:$.listLabel,typeIcons:o,groupCount:$.groupCount,groupLabel:$.groupLabel,onHover:Q,onPick:ae}),!O&&"some"===V&&_&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:$.partialFailure}),!O&&!_&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:$.minChars(2)})]}),
18
18
  /* @__PURE__ */v("div",{className:"flex items-center justify-between px-4 py-2 border-t border-line-subtle bg-surface-sunken text-2xs text-ink-faintest",children:[
19
19
  /* @__PURE__ */v("div",{className:"flex items-center gap-3",children:[
20
20
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
21
21
  /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
22
22
  /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${$.navigate}`]}),
23
23
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
24
- /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.enterKey}),` ${$.open}`]}),_.length>1&&/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
24
+ /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.enterKey}),` ${$.open}`]}),X.length>1&&/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
25
25
  /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.tabKey}),` ${$.nextGroup}`]})]}),
26
26
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
27
27
  /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.escKey}),` ${$.close}`]})]})]})]}),document.body):null}export{I as GlobalSearch,D as openGlobalSearch};
@@ -1,4 +1,4 @@
1
- import{Markdown as e}from"./chunk-D4432YRW.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),R=N.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!R||e.title.toLowerCase().includes(R)||e.body.toLowerCase().includes(R)||e.category_label.toLowerCase().includes(R),L=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,R]),Y=n(()=>L.flatMap(e=>e.docs),[L]),A=(w?Y.find(e=>e.slug===w):void 0)??Y[0]??null,E=e=>!!R||(C[e]??e===A?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-IZ6D4KGR.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),R=N.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!R||e.title.toLowerCase().includes(R)||e.body.toLowerCase().includes(R)||e.category_label.toLowerCase().includes(R),L=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,R]),A=n(()=>L.flatMap(e=>e.docs),[L]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,Y=e=>!!R||(C[e]??e===E?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
8
  /* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:R?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=E(e.key);/* @__PURE__ */
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:R?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=Y(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!E(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!Y(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=A?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:A?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:A.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[A.category_label,!1===A.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(A),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(A):A.body?/* @__PURE__ */o(e,{children:A.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a,stepRounding as e}from"./chunk-VLBLDSA6.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
1
+ import{InputNumber_default as a,stepRounding as e}from"./chunk-I7WAOKU2.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
2
2
  return n("div",{role:"group","aria-label":r,className:"grid min-w-0 grid-cols-2 gap-2",children:[x("x"),x("y")]})}export{m as PositionInput};
@@ -1,4 +1,4 @@
1
- import{useShellLanguage as e}from"./chunk-GKYGPCGL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-D5PXRJHA.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
1
+ import{useShellLanguage as e}from"./chunk-GKYGPCGL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-EBODRYXS.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
2
2
  /* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
4
4
  /* @__PURE__ */s("div",{children:[
@@ -0,0 +1,3 @@
1
+ import{DropdownMenu as e}from"./chunk-M5IZ7QLQ.js";import{Button_default as i}from"./chunk-MEP6CZJ3.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as r}from"./chunk-AJPQJ7TC.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:z,align:I="end",side:L="bottom",menuMinWidth:M,linkAs:P,block:Q=!1,className:R=""},W){const A=g&&(null!=N&&""!==N&&!1!==N)&&!v,D=x&&null!=j&&""!==j&&!1!==j,F=o(),J=/* @__PURE__ */t(i,{ref:W,type:b,variant:f,size:p,loading:v,leftIcon:k,block:Q,disabled:g&&!A,"aria-disabled":!!A||void 0,disabledReason:A?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),O=Q?"relative flex min-w-0 flex-1":"relative inline-flex",$=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
2
+ return s("div",{className:[Q?"flex w-full":"inline-flex","items-stretch",R].filter(Boolean).join(" "),children:[null==w||""===w||A?J:/* @__PURE__ */t(r,{content:w,className:O,children:J}),
3
+ /* @__PURE__ */t(r,{content:D?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":D?F:void 0,items:h,align:I,side:L,minWidth:M,linkAs:P,disabled:x&&!D,"aria-disabled":D,onOpenChange:y,footer:C,footerLabel:z,triggerClassName:a({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(n,{name:"chevron-down",className:$,strokeWidth:2,"aria-hidden":"true"})})}),D&&/* @__PURE__ */t("span",{id:F,className:"sr-only",children:j})]})});export{c as SplitButton_default};
@@ -1 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-F2RAIGCG.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-AJPQJ7TC.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 +1 @@
1
- import{client_default as a}from"./chunk-VGUB7LPF.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-6IP4Q3AT.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,2 +1,2 @@
1
- import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-DPFEQQQU.js";import{toast_default as n}from"./chunk-I2NVBDKH.js";import{useSyncExternalStore as o,useCallback as a,useMemo as r}from"react";var i=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],c=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}];function l(e=/* @__PURE__ */new Date){return t(e)??""}function s(t=/* @__PURE__ */new Date){return`pomodoro-day-${l(t)}`}var u={focus:1500,short:300,long:900},d="bell",f=100,m=1,h="none",g=50,p={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},k={running:!1,remaining:u.focus,mode:"focus",total:u.focus,streak:0,count:"undefined"!=typeof localStorage?function(t=/* @__PURE__ */new Date){const e=l(t);if(!e)return 0;try{const n=localStorage.getItem(s(t)),o=null===n?localStorage.getItem(`pomodoro-${e}`):null;return parseInt(n??o??"0",10)||0}catch{return 0}}():0},w=null,M=/* @__PURE__ */new Set,S=t=>{k={...k,...t},M.forEach(t=>t())};function b(){return k}function y(t){return M.add(t),()=>{M.delete(t)}}function v(t){u=t,k.running||k.remaining!==k.total||S({remaining:t[k.mode],total:t[k.mode]})}function T(t){d=t}function A(t,e){f=Math.max(0,Math.min(100,Math.round(t))),m=Math.max(1,Math.min(5,Math.round(e)))}function I(t){p={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function x(t,e){h=t,g=Math.max(0,Math.min(100,Math.round(e))),k.running&&"focus"===k.mode?(j(),V()):"none"!==t&&0!==g||j()}function B(){k.running||(S({running:!0}),w=setInterval(P,1e3),"focus"===k.mode&&V())}function N(){(k.running||null!==w)&&(null!==w&&(clearInterval(w),w=null),S({running:!1}),j())}function D(t){N(),S({mode:t,remaining:u[t],total:u[t]})}function P(){k.remaining<=1?function(){null!==w&&(clearInterval(w),w=null);j(),C(d,{volume:f,repeat:m});const t="focus"===k.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{n.info(t)}catch{}if("focus"===k.mode){const t=k.streak+1,e=k.count+1;(t=>{try{l()&&localStorage.setItem(s(),String(t))}catch{}})(e);const n=t%p.longBreakInterval===0?"long":"short";S({running:!1,streak:t,count:e,mode:n,remaining:u[n],total:u[n]}),p.autoStartBreaks&&setTimeout(()=>B(),50)}else S({running:!1,mode:"focus",remaining:u.focus,total:u.focus}),p.autoStartPomodoros&&setTimeout(()=>B(),50)}():S({remaining:k.remaining-1})}function C(t=d,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>_(t,n),2500*e)}function _(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var F=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function R(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function V(){if(!F&&"none"!==h&&0!==g)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=R(e,h);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=g/100*O[h],o.connect(a).connect(e.destination),o.start(),F={ctx:e,src:o,gain:a}}catch{}}function j(){if(F){try{F.src.stop()}catch{}try{F.ctx.close()}catch{}F=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=R(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var H="pomodoro_tasks",Q="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
- return(new Date).toISOString()}var W=null,$=[],q=!1,J=null,L=/* @__PURE__ */new Set;function U(){for(const t of L)t()}function z(t){$=t,U()}function X(){const t=W;return t?J=t.list().then(e=>{W===t&&($=e,q=!0,U())}).catch(()=>{W===t&&(q=!0,U())}).finally(()=>{J=null}):($=[],q=!0,U(),Promise.resolve())}function Y(t){W=t,$=[],q=!1,t?X():U()}function Z(t){return L.add(t),!W||q||J||X(),()=>{L.delete(t)}}function tt(){return $}function et(){const t=function(){const{prefs:t,save:n}=e(),o=r(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=a(t=>{n({todo_tasks:t})},[n]),c=a(t=>{const e=E(),n=K(),a={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...o,a]),e},[o,i]),l=a((t,e)=>{i(o.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:K()}:n))},[o,i]),s=a(t=>{i(o.filter(e=>e.id!==t))},[o,i]),u=a(t=>{const e=o.find(e=>e.id===t);e&&l(t,{done:!e.done})},[o,l]);return{tasks:o,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),n=o(Z,tt,tt),i=a(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+E(),a=K(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return z([...$,r]),n.create({...e,name:e.name.trim()}).then(t=>z($.map(e=>e.id===o?{...r,...t}:e))).catch(()=>z($.filter(t=>t.id!==o))),o},[t]),c=a((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);z($.map(t=>t.id===e?{...t,...n,id:e,updatedAt:K()}:t)),o.update(e,n).catch(()=>{X()})},[t]),l=a(e=>{const n=W;if(!n)return t.removeTask(e);const o=$;z($.filter(t=>t.id!==e)),n.remove(e).catch(()=>z(o))},[t]),s=a(e=>{if(!W)return t.toggleDone(e);const n=$.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=a(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:n,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function nt(t,e){try{if(localStorage.getItem(Q))return;const n=localStorage.getItem(H);if(!n)return void localStorage.setItem(Q,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(H),void localStorage.setItem(Q,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(H),localStorage.setItem(Q,"1")}catch{try{localStorage.setItem(Q,"1")}catch{}}}export{i as ALARM_OPTIONS,c as FOCUS_SOUND_OPTIONS,b as getPomoSnapshot,nt as migratePomodoroTasksOnce,C as playAlarm,N as pomoPause,B as pomoStart,D as pomoSwitchMode,l as pomodoroToday,G as previewFocusSound,T as setPomoAlarm,A as setPomoAlarmConfig,I as setPomoBehaviour,v as setPomoDurations,x as setPomoFocusSound,Y as setShellTodoProvider,y as subscribePomo,et as useTodoTasks};
1
+ import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-POBVGDZP.js";import{toast_default as n}from"./chunk-I2NVBDKH.js";import{useSyncExternalStore as o,useCallback as a,useMemo as r}from"react";var i=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],c=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}];function l(e=/* @__PURE__ */new Date){return t(e)??""}function s(t=/* @__PURE__ */new Date){return`pomodoro-day-${l(t)}`}var u={focus:1500,short:300,long:900},d="bell",f=100,m=1,h="none",g=50,p={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},k={running:!1,remaining:u.focus,mode:"focus",total:u.focus,streak:0,count:"undefined"!=typeof localStorage?function(t=/* @__PURE__ */new Date){const e=l(t);if(!e)return 0;try{const n=localStorage.getItem(s(t)),o=null===n?localStorage.getItem(`pomodoro-${e}`):null;return parseInt(n??o??"0",10)||0}catch{return 0}}():0},w=null,M=/* @__PURE__ */new Set,S=t=>{k={...k,...t},M.forEach(t=>t())};function b(){return k}function y(t){return M.add(t),()=>{M.delete(t)}}function v(t){u=t,k.running||k.remaining!==k.total||S({remaining:t[k.mode],total:t[k.mode]})}function T(t){d=t}function A(t,e){f=Math.max(0,Math.min(100,Math.round(t))),m=Math.max(1,Math.min(5,Math.round(e)))}function I(t){p={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function x(t,e){h=t,g=Math.max(0,Math.min(100,Math.round(e))),k.running&&"focus"===k.mode?(j(),R()):"none"!==t&&0!==g||j()}function B(){k.running||(S({running:!0}),w=setInterval(D,1e3),"focus"===k.mode&&R())}function N(){(k.running||null!==w)&&(null!==w&&(clearInterval(w),w=null),S({running:!1}),j())}function P(t){N(),S({mode:t,remaining:u[t],total:u[t]})}function D(){k.remaining<=1?function(){null!==w&&(clearInterval(w),w=null);j(),C(d,{volume:f,repeat:m});const t="focus"===k.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{n.info(t)}catch{}if("focus"===k.mode){const t=k.streak+1,e=k.count+1;(t=>{try{l()&&localStorage.setItem(s(),String(t))}catch{}})(e);const n=t%p.longBreakInterval===0?"long":"short";S({running:!1,streak:t,count:e,mode:n,remaining:u[n],total:u[n]}),p.autoStartBreaks&&setTimeout(()=>B(),50)}else S({running:!1,mode:"focus",remaining:u.focus,total:u.focus}),p.autoStartPomodoros&&setTimeout(()=>B(),50)}():S({remaining:k.remaining-1})}function C(t=d,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>_(t,n),2500*e)}function _(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var O=null,V={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function G(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!O&&"none"!==h&&0!==g)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=G(e,h);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=g/100*V[h],o.connect(a).connect(e.destination),o.start(),O={ctx:e,src:o,gain:a}}catch{}}function j(){if(O){try{O.src.stop()}catch{}try{O.ctx.close()}catch{}O=null}}function F(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=G(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*V[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var H="pomodoro_tasks",K="pomodoro_tasks_migrated";function W(){return Math.random().toString(36).slice(2,11)}function $(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var q=null,E=[],J=!1,L=null,Z=/* @__PURE__ */new Set;function z(){for(const t of Z)t()}function Q(t){E=t,z()}function U(){const t=q;return t?L=t.list().then(e=>{q===t&&(E=e,J=!0,z())}).catch(()=>{q===t&&(J=!0,z())}).finally(()=>{L=null}):(E=[],J=!0,z(),Promise.resolve())}function X(t){q=t,E=[],J=!1,t?U():z()}function Y(t){return Z.add(t),!q||J||L||U(),()=>{Z.delete(t)}}function tt(){return E}function et(){const t=function(){const{prefs:t,save:n}=e(),o=r(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=a(t=>{n({todo_tasks:t})},[n]),c=a(t=>{const e=W(),n=$(),a={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...o,a]),e},[o,i]),l=a((t,e)=>{i(o.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:$()}:n))},[o,i]),s=a(t=>{i(o.filter(e=>e.id!==t))},[o,i]),u=a(t=>{const e=o.find(e=>e.id===t);e&&l(t,{done:!e.done})},[o,l]);return{tasks:o,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),n=o(Y,tt,tt),i=a(e=>{const n=q;if(!n)return t.addTask(e);const o="tmp-"+W(),a=$(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return Q([...E,r]),n.create({...e,name:e.name.trim()}).then(t=>Q(E.map(e=>e.id===o?{...r,...t}:e))).catch(()=>Q(E.filter(t=>t.id!==o))),o},[t]),c=a((e,n)=>{const o=q;if(!o)return t.updateTask(e,n);Q(E.map(t=>t.id===e?{...t,...n,id:e,updatedAt:$()}:t)),o.update(e,n).catch(()=>{U()})},[t]),l=a(e=>{const n=q;if(!n)return t.removeTask(e);const o=E;Q(E.filter(t=>t.id!==e)),n.remove(e).catch(()=>Q(o))},[t]),s=a(e=>{if(!q)return t.toggleDone(e);const n=E.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=a(e=>{q||t.setAllTasks(e)},[t]);return null===q?t:{tasks:n,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function nt(t,e){try{if(localStorage.getItem(K))return;const n=localStorage.getItem(H);if(!n)return void localStorage.setItem(K,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(H),void localStorage.setItem(K,"1");const a=$(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||W(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(H),localStorage.setItem(K,"1")}catch{try{localStorage.setItem(K,"1")}catch{}}}export{i as ALARM_OPTIONS,c as FOCUS_SOUND_OPTIONS,b as getPomoSnapshot,nt as migratePomodoroTasksOnce,C as playAlarm,N as pomoPause,B as pomoStart,P as pomoSwitchMode,l as pomodoroToday,F as previewFocusSound,T as setPomoAlarm,A as setPomoAlarmConfig,I as setPomoBehaviour,v as setPomoDurations,x as setPomoFocusSound,X as setShellTodoProvider,y as subscribePomo,et as useTodoTasks};
@@ -1,4 +1,4 @@
1
- import{WidestLabel as e}from"./chunk-X3LMTOMA.js";import{DropdownMenu as n,TRIGGER_CLASS as o}from"./chunk-EX3DARI3.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{jsx as r}from"react/jsx-runtime";function t(e,n,o){if(n&&!(n.options.length<2))/* @__PURE__ */
1
+ import{WidestLabel as e}from"./chunk-X3LMTOMA.js";import{DropdownMenu as n,TRIGGER_CLASS as o}from"./chunk-M5IZ7QLQ.js";import{Tooltip as i}from"./chunk-AJPQJ7TC.js";import{jsx as r}from"react/jsx-runtime";function t(e,n,o){if(n&&!(n.options.length<2))/* @__PURE__ */
2
2
  return r(l,{value:e,options:n.options,onChange:n.onChange,label:n.label,disabled:o})}var a=`${o} -ml-1 h-6 px-1 text-xs`;function l({value:o,options:t,onChange:l,label:s,disabled:m}){
3
3
  /* @__PURE__ */
4
4
  return r(i,{content:s,describe:!1,children:/* @__PURE__ */r(n,{trigger:
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-D5PXRJHA.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-B5KX7PDG.js";import{Button_default as s}from"./chunk-UTISUEO4.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-EBODRYXS.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-W6REY3SV.js";import{Button_default as s}from"./chunk-MEP6CZJ3.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,5 +1,5 @@
1
- import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-F2RAIGCG.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.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,R=p??(x?j.resetName(o):j.inheritName(o)),S=b?j.backTo(b):x?j.backToDefault:j.backToAuto,g=m??(b?j.tip(R,S):R);
1
+ import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-AJPQJ7TC.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.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,S=p??(x?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):x?j.backToDefault:j.backToAuto,g=m??(b?j.tip(S,T):S);
2
2
  /* @__PURE__ */
3
3
  return r(t,{content:g,describe:!1,children:[
4
- /* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":R,"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:S})]})}export{o as SettingReset};
4
+ /* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":S,"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:T})]})}export{o as SettingReset};
@@ -1,8 +1,8 @@
1
- import{AccessibleTable as t}from"./chunk-ZDFMYAQB.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-NRHG4R2Q.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)),F=M??$.noFlows,[j,y]=c(null),{highlighted:E}=o(),C=h(u,f,x,$.other),{labels:Q,matrix:A,otherIndex:I,foldedCount:z}=C,R=(t,e)=>A[t]?.[e]??0,H=t=>t===I?r.muted:a(t),L=C.totals,O=Q.map((t,e)=>e).sort((t,e)=>L[e]-L[t]),V=O.reduce((t,e)=>t+L[e],0);if(V<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:F});const W=p/2,Y=p/2,B=p/2-44,D=B-b,P=g*O.length,T=/* @__PURE__ */new Map;let U=-Math.PI/2;O.forEach((t,e)=>{const o=L[t]/V*(2*Math.PI-P);T.set(t,{start:U,end:U+o,slot:e}),U+=o+g});const Z=/* @__PURE__ */new Map,G=[];for(const t of O)for(const e of O){const o=R(t,e);if(o<=0)continue;const n=T.get(t),r=o/Math.max(1,L[t])*(n.end-n.start),a=Z.get(t)??0;Z.set(t,a+r),G.push({from:t,to:e,value:o,a:n.start+a+r/2,b:T.get(e).start+(T.get(e).end-T.get(e).start)/2})}const S=(t,e)=>[W+e*Math.cos(t),Y+e*Math.sin(t)],q="arc"===j?.kind?j.index:void 0,J="ribbon"===j?.kind?G[j.index]:void 0;/* @__PURE__ */
1
+ import{AccessibleTable as t}from"./chunk-24BF22NF.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-NRHG4R2Q.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,N=i(),w=k??(t=>s(t,N)),F=M??$.noFlows,[j,y]=c(null),{highlighted:E}=o(),C=h(u,f,x,$.other),{labels:I,matrix:Q,otherIndex:z,foldedCount:A}=C,R=(t,e)=>Q[t]?.[e]??0,H=t=>t===z?r.muted:a(t),L=C.totals,O=I.map((t,e)=>e).sort((t,e)=>L[e]-L[t]),V=O.reduce((t,e)=>t+L[e],0);if(V<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:F});const W=p/2,B=p/2,P=p/2-44,T=P-b,U=g*O.length,Y=/* @__PURE__ */new Map;let D=-Math.PI/2;O.forEach((t,e)=>{const o=L[t]/V*(2*Math.PI-U);Y.set(t,{start:D,end:D+o,slot:e}),D+=o+g});const G=/* @__PURE__ */new Map,S=[];for(const t of O)for(const e of O){const o=R(t,e);if(o<=0)continue;const n=Y.get(t),r=o/Math.max(1,L[t])*(n.end-n.start),a=G.get(t)??0;G.set(t,a+r),S.push({from:t,to:e,value:o,a:n.start+a+r/2,b:Y.get(e).start+(Y.get(e).end-Y.get(e).start)/2})}const Z=(t,e)=>[W+e*Math.cos(t),B+e*Math.sin(t)],q="arc"===j?.kind?j.index:void 0,J="ribbon"===j?.kind?S[j.index]:void 0;/* @__PURE__ */
2
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:()=>y(null),children:[G.map((t,e)=>{const[o,n]=S(t.a,D),[r,a]=S(t.b,D),l=H(t.from),i=((t,e)=>j?"ribbon"===j.kind?j.index===e:j.index===t.from||j.index===t.to:null!==E?Q[t.from]===E||Q[t.to]===E:null)(t,e);/* @__PURE__ */
4
- return d("path",{d:`M${o},${n} Q${W},${Y} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/V*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>y({kind:"ribbon",index:e})},`${Q[t.from]}→${Q[t.to]}`)}),O.map(t=>{const o=T.get(t),n=(o.start+o.end)/2,[a,l]=S(n,B+16),i=(t=>j?"arc"===j.kind?j.index===t:G[j.index].from===t||G[j.index].to===t:null!==E?Q[t]===E:null)(t);/* @__PURE__ */
3
+ /* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(O.length),onMouseLeave:()=>y(null),children:[S.map((t,e)=>{const[o,n]=Z(t.a,T),[r,a]=Z(t.b,T),l=H(t.from),i=((t,e)=>j?"ribbon"===j.kind?j.index===e:j.index===t.from||j.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${W},${B} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/V*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>y({kind:"ribbon",index:e})},`${I[t.from]}→${I[t.to]}`)}),O.map(t=>{const o=Y.get(t),n=(o.start+o.end)/2,[a,l]=Z(n,P+16),i=(t=>j?"arc"===j.kind?j.index===t:S[j.index].from===t||S[j.index].to===t:null!==E?I[t]===E:null)(t);/* @__PURE__ */
5
5
  return m("g",{onMouseEnter:()=>y({kind:"arc",index:t}),children:[
6
- /* @__PURE__ */d("path",{d:e(W,Y,D,B,o.start,o.end),fill:H(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:Q[t]})]},t)})]}),z>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(z)}),void 0!==q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:Q[q],rows:[{key:"total",label:$.totalFlow,color:H(q),value:N(L[q])}]})}),J&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${Q[J.from]} → ${Q[J.to]}`,rows:[{key:"value",label:$.flow,color:H(J.from),value:N(J.value)}]})}),
8
- /* @__PURE__ */d(t,{caption:$.chord(O.length),head:[$.tableFrom,$.tableTo,$.value],rows:G.map(t=>[Q[t.from],Q[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
6
+ /* @__PURE__ */d("path",{d:e(W,B,T,P,o.start,o.end),fill:H(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!==q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I[q],rows:[{key:"total",label:$.totalFlow,color:H(q),value:w(L[q])}]})}),J&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${I[J.from]} → ${I[J.to]}`,rows:[{key:"value",label:$.flow,color:H(J.from),value:w(J.value)}]})}),
8
+ /* @__PURE__ */d(t,{caption:$.chord(O.length),head:[$.tableFrom,$.tableTo,$.value],rows:S.map(t=>[I[t.from],I[t.to],w(t.value)])})]})}export{u as ChordChart,h as foldChord};
@@ -1,2 +1,2 @@
1
- import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-VY3UA6AR.js";import{useHydrated as o}from"./chunk-WCCS4VFE.js";import{useBrowserLayoutEffect as i}from"./chunk-ZDXRSY2Y.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as f}from"react/jsx-runtime";var l=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const j=o(),v=c(null),k=c(p);k.current=p;const W=c(m);W.current=m;const Y=a(()=>{const t=v.current,n=k.current();if(!t||!n)return;const o=(W.current??l)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{j&&Y()}),u(()=>{if(!j)return;const t=n(()=>k.current(),Y),e=v.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>Y());return r.observe(e),()=>{t(),r.disconnect()}},[j,Y]);return j&&p()?d(
1
+ import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-TAHHZGRH.js";import{useHydrated as o}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as i}from"./chunk-PU2GJVMG.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as f}from"react/jsx-runtime";var l=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const j=o(),v=c(null),H=c(p);H.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=v.current,n=H.current();if(!t||!n)return;const o=(k.current??l)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{j&&y()}),u(()=>{if(!j)return;const t=n(()=>H.current(),y),e=v.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[j,y]);return j&&p()?d(
2
2
  /* @__PURE__ */f("div",{ref:v,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
@@ -1,3 +1,3 @@
1
- import{unitBox as e}from"./chunk-K42FXX7J.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-NWS5G7FE.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:t,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":t,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(n,{size:"sm",...v,children:u})}var j=c(function({value:n,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:E,disabled:D,readOnly:B,invalid:S,placeholder:C,size:F,prefix:$,suffix:O,suffixControl:R,units:K,id:M,name:P,className:W="",onBlur:U,onFocus:Y,steppers:z,stepFrom:L,snap:T=!1,allowEmpty:I=!0,appearance:V="box",display:X,reportWhileTyping:A=!0,onRevert:G,"aria-label":Q,"aria-labelledby":Z,"aria-describedby":H,auto:J,...q},_){const ee="bare"===V,re=R??("string"==typeof O?e(O,K,D||B):void 0),te=r(),ne=J??te,oe=s(),ie="string"==typeof O&&""!==O.trim()?O.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(O||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(n,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(n),he=d(n);he.current=n;const be=Boolean(D||B),ge=z??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==n&&de(x(n,g))},[n,g]);const Ee=e=>{if(be)return;let r=(ae(pe.current)??L??(C?ae(C):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Oe()},De=d(Ee);De.current=Ee;const Be=d({unit:j??1,big:E??10*(j??1),locked:be});Be.current={unit:j??1,big:E??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),De.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Se,Ce]=u(!1),[Fe,$e]=u(0),Oe=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Se&&document.activeElement===fe.current&&fe.current?.select()},[ee,Se,Fe]);const Re=d(!1);f(()=>{if(Se&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(G??o)(r),Oe(),!0})},[Se,be,g,o,G]);const Ke=()=>{const e=ae(pe.current);if(null==e){if(!I){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(T?Math.max(b(j??1),b(i??0)):void 0);T&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Me=/* @__PURE__ */m("input",{ref:me,id:M,"data-number-input":"",name:P,type:"text",inputMode:0===g?"numeric":"decimal",value:!Se&&X?X(n):ue,disabled:D,readOnly:B,placeholder:C,step:j,role:"spinbutton","aria-valuenow":n??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==n?C||void 0:`${x(n,g)}${ee&&ie?ie:""}`,"aria-describedby":[H,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":S||void 0,"aria-label":Q,"aria-labelledby":Z,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!A)return;const t=ae(e);(null!==t||I)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Ke(),void Oe();const r=j??1,t=E??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),Ee(n))},onFocus:()=>{ve.current=he.current,Ce(!0),Re.current=!0,Y?.()},onMouseUp:ee?e=>{Re.current&&(Re.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Ce(!1),Re.current=!1,Ke(),U?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Se?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",W].filter(Boolean).join(" "):t({invalid:S,size:F,readOnly:B,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Se?"text-ellipsis":"",W].filter(Boolean).join(" ")})}),Pe=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Pe?/* @__PURE__ */v(h,{children:[Me,Pe]}):Me;const We=ae(ue);/* @__PURE__ */
2
- return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Me,Pe,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):O&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:O}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=We&&We<=i,onStep:e=>De.current(-(e?E??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=We&&We>=c,onStep:e=>De.current(e?E??10*(j??1):j??1)});/* @__PURE__ */
1
+ import{unitBox as e}from"./chunk-GVAVIYE6.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-MYH5H43C.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:t,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":t,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(n,{size:"sm",...v,children:u})}var j=c(function({value:n,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:E,disabled:D,readOnly:B,invalid:C,placeholder:M,size:S,prefix:$,suffix:O,suffixControl:P,units:F,id:R,name:U,className:V="",onBlur:K,onFocus:W,steppers:Y,stepFrom:z,snap:I=!1,allowEmpty:L=!0,appearance:T="box",display:A,reportWhileTyping:G=!0,onRevert:H,"aria-label":Q,"aria-labelledby":J,"aria-describedby":X,auto:Z,...q},_){const ee="bare"===T,re=P??("string"==typeof O?e(O,F,D||B):void 0),te=r(),ne=Z??te,oe=s(),ie="string"==typeof O&&""!==O.trim()?O.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(O||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(n,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(n),he=d(n);he.current=n;const be=Boolean(D||B),ge=Y??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==n&&de(x(n,g))},[n,g]);const Ee=e=>{if(be)return;let r=(ae(pe.current)??z??(M?ae(M):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Oe()},De=d(Ee);De.current=Ee;const Be=d({unit:j??1,big:E??10*(j??1),locked:be});Be.current={unit:j??1,big:E??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),De.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Ce,Me]=u(!1),[Se,$e]=u(0),Oe=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Ce&&document.activeElement===fe.current&&fe.current?.select()},[ee,Ce,Se]);const Pe=d(!1);f(()=>{if(Ce&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(H??o)(r),Oe(),!0})},[Ce,be,g,o,H]);const Fe=()=>{const e=ae(pe.current);if(null==e){if(!L){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(I?Math.max(b(j??1),b(i??0)):void 0);I&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Re=/* @__PURE__ */m("input",{ref:me,id:R,"data-number-input":"",name:U,type:"text",inputMode:0===g?"numeric":"decimal",value:!Ce&&A?A(n):ue,disabled:D,readOnly:B,placeholder:M,step:j,role:"spinbutton","aria-valuenow":n??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==n?M||void 0:`${x(n,g)}${ee&&ie?ie:""}`,"aria-describedby":[X,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":C||void 0,"aria-label":Q,"aria-labelledby":J,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!G)return;const t=ae(e);(null!==t||L)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Fe(),void Oe();const r=j??1,t=E??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),Ee(n))},onFocus:()=>{ve.current=he.current,Me(!0),Pe.current=!0,W?.()},onMouseUp:ee?e=>{Pe.current&&(Pe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Me(!1),Pe.current=!1,Fe(),K?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Ce?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",V].filter(Boolean).join(" "):t({invalid:C,size:S,readOnly:B,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Ce?"text-ellipsis":"",V].filter(Boolean).join(" ")})}),Ue=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Ue?/* @__PURE__ */v(h,{children:[Re,Ue]}):Re;const Ve=ae(ue);/* @__PURE__ */
2
+ return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Re,Ue,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):O&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:O}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Ve&&Ve<=i,onStep:e=>De.current(-(e?E??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Ve&&Ve>=c,onStep:e=>De.current(e?E??10*(j??1):j??1)});/* @__PURE__ */
3
3
  return v("span",xe?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{j as InputNumber_default,g as stepRounding};
@@ -1,4 +1,4 @@
1
- import{GROUP_COLORS as e}from"./chunk-YDJ5IZOU.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.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-EDRELF6L.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.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,$=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),k="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,N=e=>[e,m,null==$?"":`${$}%`].filter(Boolean).join(" ");/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-MCLVTQSF.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-B5KX7PDG.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-MEDOESQD.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-W6REY3SV.js";import{Button_default as i}from"./chunk-MEP6CZJ3.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
2
2
  return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
3
3
  /* @__PURE__ */n(t,{name:e.name,status:e.status}),
4
4
  /* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
@@ -1,4 +1,4 @@
1
- import{Tooltip as e}from"./chunk-F2RAIGCG.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-AJPQJ7TC.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,4 +1,4 @@
1
- import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-UTISUEO4.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useShellStrings as r}from"./chunk-NRHG4R2Q.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
1
+ import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-MEP6CZJ3.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useShellStrings as r}from"./chunk-NRHG4R2Q.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
2
2
  return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
3
3
  /* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
4
4
  /* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
@@ -1,7 +1,7 @@
1
- import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-YBE66FBR.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as a}from"./chunk-ZDXRSY2Y.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
- return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:P=""}){const R=x||!!p,S=n(u),I=l(null),Y=s(),$=[B?.["aria-describedby"],j?Y:void 0].filter(Boolean).join(" ")||void 0,A=B?.tabIndex;a(()=>{const e=I.current;if(!e||void 0!==A)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const K="comfortable"===S?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},q=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
1
+ import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-P5J7G7OV.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as a}from"./chunk-PU2GJVMG.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
+ return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:P,rowRef:D,className:B=""}){const G=x||!!p,I=n(u),S=l(null),V=s(),$=[P?.["aria-describedby"],j?V:void 0].filter(Boolean).join(" ")||void 0,A=P?.tabIndex;a(()=>{const e=S.current;if(!e||void 0!==A)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const J="comfortable"===I?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},K=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
3
3
  /* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
4
- return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":R||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":R?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${K[k]}`}),
5
- /* @__PURE__ */c("div",{...B,ref:e=>{var r,t;I.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":$,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",P].filter(Boolean).join(" "),children:[
6
- /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[q&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[q,
7
- /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:q})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:Y})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
4
+ return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":G||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":G?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${J[k]}`}),
5
+ /* @__PURE__ */c("div",{...P,ref:e=>{var r,t;S.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":P?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":$,onKeyDown:e=>{if(P?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",B].filter(Boolean).join(" "),children:[
6
+ /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[K&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[K,
7
+ /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:K})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:V})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};