efficient-shell 10.8.0 → 10.14.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 (278) hide show
  1. package/README.md +18 -1
  2. package/dist/{Browser-EMNG4HTB.js → Browser-LAMGXJI6.js} +13 -13
  3. package/dist/Calculator-ZFMTTDQ6.js +29 -0
  4. package/dist/{CurrencyConverter-L4WCQBUO.js → CurrencyConverter-577XB7A3.js} +8 -8
  5. package/dist/{Documents-DEBV3IGR.js → Documents-DW7I624C.js} +8 -8
  6. package/dist/Files-VLSMINW5.js +88 -0
  7. package/dist/Notepad-54H6KCGS.js +24 -0
  8. package/dist/PomodoroTimer-CXJVY7U3.js +91 -0
  9. package/dist/{Preview-OWM7JE4U.js → Preview-OWMTJFTO.js} +14 -14
  10. package/dist/{Sidebar-XMDORF77.js → Sidebar-7RR5WNIF.js} +19 -19
  11. package/dist/{Spreadsheet-I7LUDZTI.js → Spreadsheet-HWNS4TSX.js} +12 -12
  12. package/dist/{Stock-CN4KZVHA.js → Stock-M4TDRNCI.js} +2 -2
  13. package/dist/{Weather-N3AC6Q5Z.js → Weather-K634BVDX.js} +41 -41
  14. package/dist/{WorldClock-YTNLKOSF.js → WorldClock-56CYOGR2.js} +6 -6
  15. package/dist/ai/index.d.ts +8 -2
  16. package/dist/ai/index.js +36 -34
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChordChart.js +1 -1
  25. package/dist/charts/ColumnChart.js +1 -1
  26. package/dist/charts/HeatmapChart.js +1 -1
  27. package/dist/charts/HistogramChart.js +1 -1
  28. package/dist/charts/RadarChart.js +1 -1
  29. package/dist/charts/RangeChart.js +1 -1
  30. package/dist/charts/SankeyChart.js +1 -1
  31. package/dist/charts/ScatterChart.js +1 -1
  32. package/dist/charts/SpecChart.js +1 -1
  33. package/dist/charts/SunburstChart.js +1 -1
  34. package/dist/charts/TimeSeriesChart.js +1 -1
  35. package/dist/charts/TreemapChart.js +1 -1
  36. package/dist/charts/WaterfallChart.js +1 -1
  37. package/dist/chunk-2HMNOLKX.js +1 -0
  38. package/dist/{chunk-7T4E6VMR.js → chunk-2K2W6VIR.js} +1 -1
  39. package/dist/{chunk-235E63CP.js → chunk-37U326EL.js} +7 -7
  40. package/dist/chunk-3GL4OVBB.js +1 -0
  41. package/dist/chunk-3RVLLU2A.js +5 -0
  42. package/dist/chunk-44QWF5X2.js +2 -0
  43. package/dist/chunk-45VOQS5V.js +4 -0
  44. package/dist/chunk-5RE6R3XC.js +2 -0
  45. package/dist/chunk-5X4DBMS6.js +2 -0
  46. package/dist/{chunk-35DG7Y4M.js → chunk-6U6WVU5F.js} +1 -1
  47. package/dist/{chunk-ZQKZCQJA.js → chunk-7PUVPDUZ.js} +4 -4
  48. package/dist/{chunk-YDEIXM2A.js → chunk-7TC3LJQM.js} +1 -1
  49. package/dist/{chunk-PJQGYKN6.js → chunk-7YZ5TUXE.js} +6 -6
  50. package/dist/chunk-A4TFCYWN.js +2 -0
  51. package/dist/{chunk-456CJCDK.js → chunk-A5BV6NFA.js} +5 -5
  52. package/dist/chunk-A5SPSAWW.js +2 -0
  53. package/dist/{chunk-JGMQLQTE.js → chunk-AGG4RFXR.js} +9 -9
  54. package/dist/{chunk-2JG5JU4M.js → chunk-ALWVHNUO.js} +4 -4
  55. package/dist/chunk-APLKFBJH.js +2 -0
  56. package/dist/{chunk-CUO62I67.js → chunk-AZ3AR7U7.js} +3 -3
  57. package/dist/chunk-BJXDOM2N.js +2 -0
  58. package/dist/{chunk-JDBMIY7R.js → chunk-BS7IPLRR.js} +1 -1
  59. package/dist/{chunk-AJO72CPB.js → chunk-C2L33LDZ.js} +2 -2
  60. package/dist/{chunk-T2ULJNQP.js → chunk-CKKUFDZ3.js} +21 -21
  61. package/dist/chunk-COJYPNKF.js +2 -0
  62. package/dist/{chunk-4FX5FZ4Z.js → chunk-DDCMMOB4.js} +1 -1
  63. package/dist/chunk-DWMOUDMX.js +1 -0
  64. package/dist/{chunk-WMEYNKXZ.js → chunk-E3HSZQFI.js} +16 -16
  65. package/dist/chunk-EDKRGYZX.js +9 -0
  66. package/dist/{chunk-OYEAAX4A.js → chunk-EYZZW6SO.js} +5 -5
  67. package/dist/{chunk-UDRMZ22J.js → chunk-F5FNYNHF.js} +1 -1
  68. package/dist/{chunk-CNPEAHOY.js → chunk-F6JDUMM7.js} +2 -2
  69. package/dist/chunk-FIZKXNCZ.js +2 -0
  70. package/dist/{chunk-RPYFOQM2.js → chunk-FZO6H3ZB.js} +5 -5
  71. package/dist/{chunk-X2S2XDZI.js → chunk-GEYM4WN3.js} +1 -1
  72. package/dist/{chunk-NOYVZPAU.js → chunk-H64JJSXC.js} +4 -4
  73. package/dist/chunk-I5VYOWIX.js +2 -0
  74. package/dist/chunk-IABSP2GJ.js +2 -0
  75. package/dist/chunk-IKMWKOT5.js +1 -0
  76. package/dist/chunk-IXZGA4MS.js +2 -0
  77. package/dist/{chunk-ZZVE64OI.js → chunk-JAKOZNZK.js} +2 -2
  78. package/dist/{chunk-4YDCNWNU.js → chunk-JGFY54A4.js} +1 -1
  79. package/dist/{chunk-SKP66IK4.js → chunk-JRZ7PPVJ.js} +4 -4
  80. package/dist/chunk-KLHUKAD3.js +2 -0
  81. package/dist/chunk-KOBYM5JV.js +14 -0
  82. package/dist/{chunk-V4W5BG4A.js → chunk-KUMEDH5M.js} +1 -1
  83. package/dist/chunk-LF27WIN2.js +1 -0
  84. package/dist/{chunk-W35N7SL3.js → chunk-LKTBKVN6.js} +4 -4
  85. package/dist/chunk-LYJBMVUE.js +4 -0
  86. package/dist/chunk-MIOL4CDN.js +2 -0
  87. package/dist/{chunk-VTFZ6W2D.js → chunk-MKQZINBW.js} +2 -2
  88. package/dist/{chunk-BAPQOY7Q.js → chunk-NSLQ3UYJ.js} +2 -2
  89. package/dist/{chunk-WN5HHHLO.js → chunk-OOLPDASG.js} +1 -1
  90. package/dist/{chunk-5NIA6CSZ.js → chunk-ORIGX2H5.js} +4 -4
  91. package/dist/chunk-PGKNWSSC.js +2 -0
  92. package/dist/chunk-PJW3BL27.js +2 -0
  93. package/dist/chunk-QHUGCISZ.js +2 -0
  94. package/dist/chunk-QKWYCOMM.js +23 -0
  95. package/dist/{chunk-SW7ENSST.js → chunk-QNK2I4IH.js} +9 -9
  96. package/dist/{chunk-2SY76NFO.js → chunk-QPJQJRHZ.js} +4 -4
  97. package/dist/chunk-R7APUBZB.js +29 -0
  98. package/dist/{chunk-CBEKJTXU.js → chunk-RQSVBXBV.js} +5 -5
  99. package/dist/chunk-RRVBOD2U.js +2 -0
  100. package/dist/{chunk-7SIH7VPC.js → chunk-SCPCZCYQ.js} +1 -1
  101. package/dist/{chunk-3LPG6HMG.js → chunk-SMUH7NAN.js} +1 -1
  102. package/dist/chunk-SVUOPZCB.js +2 -0
  103. package/dist/chunk-TNPGO42S.js +4 -0
  104. package/dist/{chunk-GKIU55T5.js → chunk-TVH7IZQ4.js} +2 -2
  105. package/dist/chunk-UCWJA6LT.js +2 -0
  106. package/dist/{chunk-36R3R3IB.js → chunk-ULXCDM7Y.js} +4 -4
  107. package/dist/{chunk-4X75SGTT.js → chunk-UNRPRMQO.js} +11 -11
  108. package/dist/{chunk-TEIJOFHO.js → chunk-W6SC3ZNO.js} +2 -2
  109. package/dist/chunk-WH6NPZ6B.js +2 -0
  110. package/dist/chunk-WTTSB4SV.js +3 -0
  111. package/dist/{chunk-O6G72N3C.js → chunk-XBB6LSSB.js} +5 -5
  112. package/dist/chunk-XGAXRNZS.js +2 -0
  113. package/dist/chunk-XMTGZI2O.js +2 -0
  114. package/dist/chunk-Y3JW2GW5.js +1 -0
  115. package/dist/{chunk-B4KKEVHL.js → chunk-YGSU5KCP.js} +3 -3
  116. package/dist/chunk-Z6KYMY3R.js +5 -0
  117. package/dist/chunk-Z7TJ5Y7T.js +2 -0
  118. package/dist/chunk-ZE5FN26Z.js +5 -0
  119. package/dist/chunk-ZTPMMNAZ.js +1 -0
  120. package/dist/{chunk-I7EF6DW2.js → chunk-ZZOBG6GP.js} +13 -13
  121. package/dist/data/ListLoadError.js +1 -1
  122. package/dist/format/index.d.ts +1 -0
  123. package/dist/format/index.js +1 -1
  124. package/dist/forms/BorderInput.js +1 -1
  125. package/dist/forms/BrandAssetEditor.js +1 -1
  126. package/dist/forms/Calendar.d.ts +1 -5
  127. package/dist/forms/Calendar.js +1 -1
  128. package/dist/forms/ColorPicker.js +1 -1
  129. package/dist/forms/ComposerAttachments.js +1 -1
  130. package/dist/forms/CornersInput.js +1 -1
  131. package/dist/forms/DatePicker.js +1 -1
  132. package/dist/forms/DateRangePicker.d.ts +9 -7
  133. package/dist/forms/DateRangePicker.js +1 -1
  134. package/dist/forms/DateTimePicker.js +1 -1
  135. package/dist/forms/DisplayChips.js +1 -1
  136. package/dist/forms/IconPicker.js +1 -1
  137. package/dist/forms/InputNumber.js +1 -1
  138. package/dist/forms/LinkPicker.js +1 -1
  139. package/dist/forms/MediaLibrary.js +1 -1
  140. package/dist/forms/MediaUploadField.js +1 -1
  141. package/dist/forms/MediaUsedInList.js +1 -1
  142. package/dist/forms/PositionInput.js +1 -1
  143. package/dist/forms/Select.d.ts +1 -1
  144. package/dist/forms/SidesInput.js +1 -1
  145. package/dist/forms/Slider.js +1 -1
  146. package/dist/forms/Snippet.js +1 -1
  147. package/dist/forms/SplitButton.js +1 -1
  148. package/dist/forms/TextToolbar.d.ts +1 -1
  149. package/dist/forms/TextToolbar.js +1 -1
  150. package/dist/forms/TimePicker.js +1 -1
  151. package/dist/forms/WidthsBar.js +1 -1
  152. package/dist/forms/textAlign.d.ts +1 -1
  153. package/dist/icons/efficient-glyphs.d.ts +11 -0
  154. package/dist/icons/efficient-glyphs.js +1 -1
  155. package/dist/icons/efficient-looks.d.ts +16 -0
  156. package/dist/icons/efficient-looks.js +1 -1
  157. package/dist/icons/efficient-meanings.d.ts +11 -0
  158. package/dist/icons/efficient-meanings.js +1 -1
  159. package/dist/icons/efficient.d.ts +11 -0
  160. package/dist/icons/efficient.js +1 -1
  161. package/dist/icons/glyphs/BrandAlipayIcon.d.ts +11 -0
  162. package/dist/icons/glyphs/BrandAlipayIcon.js +1 -0
  163. package/dist/icons/glyphs/BrandDinersclubIcon.d.ts +11 -0
  164. package/dist/icons/glyphs/BrandDinersclubIcon.js +1 -0
  165. package/dist/icons/glyphs/BrandJcbIcon.d.ts +11 -0
  166. package/dist/icons/glyphs/BrandJcbIcon.js +1 -0
  167. package/dist/icons/glyphs/CountUpIcon.d.ts +8 -0
  168. package/dist/icons/glyphs/CountUpIcon.js +1 -0
  169. package/dist/icons/glyphs/DurationIcon.d.ts +8 -0
  170. package/dist/icons/glyphs/DurationIcon.js +1 -0
  171. package/dist/icons/glyphs/HoverLiftIcon.d.ts +8 -0
  172. package/dist/icons/glyphs/HoverLiftIcon.js +1 -0
  173. package/dist/icons/glyphs/HoverNextImageIcon.d.ts +8 -0
  174. package/dist/icons/glyphs/HoverNextImageIcon.js +1 -0
  175. package/dist/icons/glyphs/HoverNoneIcon.d.ts +8 -0
  176. package/dist/icons/glyphs/HoverNoneIcon.js +1 -0
  177. package/dist/icons/glyphs/HoverRotateIcon.d.ts +8 -0
  178. package/dist/icons/glyphs/HoverRotateIcon.js +1 -0
  179. package/dist/icons/glyphs/HoverZoomIcon.d.ts +8 -0
  180. package/dist/icons/glyphs/HoverZoomIcon.js +1 -0
  181. package/dist/icons/glyphs/LoopIcon.d.ts +8 -0
  182. package/dist/icons/glyphs/LoopIcon.js +1 -0
  183. package/dist/icons/index.d.ts +2 -2
  184. package/dist/icons/index.js +1 -1
  185. package/dist/icons/looks/CountUpMiniIcon.d.ts +8 -0
  186. package/dist/icons/looks/CountUpMiniIcon.js +1 -0
  187. package/dist/icons/looks/CountUpSolidIcon.d.ts +8 -0
  188. package/dist/icons/looks/CountUpSolidIcon.js +1 -0
  189. package/dist/icons/looks/DurationMiniIcon.d.ts +8 -0
  190. package/dist/icons/looks/DurationMiniIcon.js +1 -0
  191. package/dist/icons/looks/DurationSolidIcon.d.ts +8 -0
  192. package/dist/icons/looks/DurationSolidIcon.js +1 -0
  193. package/dist/icons/looks/HoverLiftMiniIcon.d.ts +8 -0
  194. package/dist/icons/looks/HoverLiftMiniIcon.js +1 -0
  195. package/dist/icons/looks/HoverLiftSolidIcon.d.ts +8 -0
  196. package/dist/icons/looks/HoverLiftSolidIcon.js +1 -0
  197. package/dist/icons/looks/HoverNextImageMiniIcon.d.ts +8 -0
  198. package/dist/icons/looks/HoverNextImageMiniIcon.js +1 -0
  199. package/dist/icons/looks/HoverNextImageSolidIcon.d.ts +8 -0
  200. package/dist/icons/looks/HoverNextImageSolidIcon.js +1 -0
  201. package/dist/icons/looks/HoverNoneMiniIcon.d.ts +8 -0
  202. package/dist/icons/looks/HoverNoneMiniIcon.js +1 -0
  203. package/dist/icons/looks/HoverNoneSolidIcon.d.ts +8 -0
  204. package/dist/icons/looks/HoverNoneSolidIcon.js +1 -0
  205. package/dist/icons/looks/HoverRotateMiniIcon.d.ts +8 -0
  206. package/dist/icons/looks/HoverRotateMiniIcon.js +1 -0
  207. package/dist/icons/looks/HoverRotateSolidIcon.d.ts +8 -0
  208. package/dist/icons/looks/HoverRotateSolidIcon.js +1 -0
  209. package/dist/icons/looks/HoverZoomMiniIcon.d.ts +8 -0
  210. package/dist/icons/looks/HoverZoomMiniIcon.js +1 -0
  211. package/dist/icons/looks/HoverZoomSolidIcon.d.ts +8 -0
  212. package/dist/icons/looks/HoverZoomSolidIcon.js +1 -0
  213. package/dist/icons/looks/LoopMiniIcon.d.ts +8 -0
  214. package/dist/icons/looks/LoopMiniIcon.js +1 -0
  215. package/dist/icons/looks/LoopSolidIcon.d.ts +8 -0
  216. package/dist/icons/looks/LoopSolidIcon.js +1 -0
  217. package/dist/icons/looks/map.js +1 -1
  218. package/dist/icons/payment.d.ts +46 -0
  219. package/dist/icons/payment.js +4 -0
  220. package/dist/icons/sets.js +1 -1
  221. package/dist/index.d.ts +3 -2
  222. package/dist/index.js +694 -694
  223. package/dist/map/index.js +1 -1
  224. package/dist/names-CwzeaUf6.d.ts +23 -0
  225. package/dist/page-tabs/index.js +5 -5
  226. package/dist/shell/AppUpdateBanner.js +1 -1
  227. package/dist/shell/ContextMenu.js +1 -1
  228. package/dist/shell/DropdownMenu.js +1 -1
  229. package/dist/shell/HelpCenter.js +1 -1
  230. package/dist/shell/ImageLightbox.js +1 -1
  231. package/dist/shell/LanguageSelect.js +1 -1
  232. package/dist/shell/Markdown.d.ts +1 -1
  233. package/dist/shell/Markdown.js +1 -1
  234. package/dist/shell/MilestoneTimeline.js +1 -1
  235. package/dist/shell/PopupMenu.js +1 -1
  236. package/dist/shell/ProductionTimeline.js +1 -1
  237. package/dist/shell/SearchableSelect.js +1 -1
  238. package/dist/shell/SettingRow.js +1 -1
  239. package/dist/shell/TimeAgo.js +1 -1
  240. package/dist/shell/TimelineTrack.js +1 -1
  241. package/dist/shell/TopNav.js +1 -1
  242. package/dist/shell/timelineDates.js +1 -1
  243. package/dist/telemetry/index.js +1 -1
  244. package/dist/templates/ChatTemplate.js +1 -1
  245. package/dist/templates/CheckoutTemplate.js +1 -1
  246. package/dist/templates/DashboardTemplate.js +1 -1
  247. package/dist/templates/DataTablePage.js +1 -1
  248. package/dist/templates/EmailTemplate.js +1 -1
  249. package/dist/templates/FormLayoutPage.js +1 -1
  250. package/dist/tokens/colour.d.ts +2 -2
  251. package/dist/ui/index.d.ts +3 -2
  252. package/dist/ui/index.js +1 -1
  253. package/dist/utils/date.js +1 -1
  254. package/dist/utils/dateKey.d.ts +25 -0
  255. package/dist/utils/dateKey.js +1 -0
  256. package/dist/utils/format.js +1 -1
  257. package/dist/version.js +1 -1
  258. package/package.json +6 -1
  259. package/dist/Calculator-QZCD6MHP.js +0 -29
  260. package/dist/Files-WMINXPW5.js +0 -88
  261. package/dist/Notepad-KM6GRBUP.js +0 -24
  262. package/dist/PomodoroTimer-2Q5DXEYT.js +0 -91
  263. package/dist/chunk-4BYJQU37.js +0 -2
  264. package/dist/chunk-4GSSOUOI.js +0 -29
  265. package/dist/chunk-5OTS2G3M.js +0 -1
  266. package/dist/chunk-632N62BY.js +0 -9
  267. package/dist/chunk-E5MVH3SH.js +0 -14
  268. package/dist/chunk-LPSFFJFK.js +0 -1
  269. package/dist/chunk-MNXRAZJV.js +0 -23
  270. package/dist/chunk-O2GPQ2MX.js +0 -1
  271. package/dist/chunk-P2HDCQBJ.js +0 -1
  272. package/dist/chunk-QZXN5IRK.js +0 -3
  273. package/dist/chunk-TFUIOEBX.js +0 -1
  274. package/dist/chunk-UVA3BITM.js +0 -2
  275. package/dist/chunk-XO7URRTM.js +0 -2
  276. package/dist/names-CyfXNkce.d.ts +0 -23
  277. /package/dist/{chunk-DSIDJYH7.js → chunk-744BFBBV.js} +0 -0
  278. /package/dist/{chunk-EHPZIBOL.js → chunk-NOKZ54GD.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as s,widthToFit as l,navIcons as c}from"./chunk-CY5N5OA3.js";import{ROW_HEIGHTS as u}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as d}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as h}from"./chunk-JDCM2VHG.js";import{Result as m}from"./chunk-URERZUX5.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-ZDMZM7HD.js";import{CopyButton as w}from"./chunk-RBQWIHYD.js";import{confirm as y}from"./chunk-GBCH3UHD.js";import{ItemCount as g}from"./chunk-QHOBK35Y.js";import{isInOverlayOver as v}from"./chunk-3DVNXNTF.js";import{dialogA11y as b}from"./chunk-VWGWZY7A.js";import{ColoredBadge as x}from"./chunk-PXQG5EIH.js";import{useIsMobile as k,useIsPhone as E}from"./chunk-UGTRSRIW.js";import{focusableIn as C}from"./chunk-CDAJKLGL.js";import{useShellPrefs as M}from"./chunk-KC3EX26K.js";import{PopupMenu as N,PopupMenuItem as S,PopupMenuDivider as L,PopupMenuLabel as T}from"./chunk-235E63CP.js";import{StatusBadge as z}from"./chunk-TXDA7TTP.js";import{Button_default as A}from"./chunk-I4VIEGCX.js";import{Icon as D}from"./chunk-KKSVRIMP.js";import{LoadingSpinner as P}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as I}from"./chunk-62LW225J.js";import{runEscapeInterceptors as R}from"./chunk-TWVUQUUD.js";import{useShellStrings as W}from"./chunk-4PAWQEXM.js";import{createContext as K,useContext as $,Component as O,useLayoutEffect as j,useRef as F,useEffect as q,useState as H,useSyncExternalStore as B,useCallback as U,isValidElement as Y,Fragment as X,Children as V,cloneElement as G,useMemo as _,useId as J,useReducer as Q,Suspense as Z}from"react";import{jsxs as ee,jsx as te,Fragment as ne}from"react/jsx-runtime";import{createPortal as re}from"react-dom";import{useLocation as oe}from"react-router-dom";import{useQueryClient as ie,useQuery as ae}from"@tanstack/react-query";function se(e){return"component"in e}function le(e){return"endpoint"in e}var ce={};function ue(e){ce=e}var de=new Proxy({},{get:(e,t)=>ce[t],has:(e,t)=>t in ce,ownKeys:()=>Object.keys(ce),getOwnPropertyDescriptor(e,t){if(t in ce)return{configurable:!0,enumerable:!0,value:ce[t]}}}),he=null;function me(e){he=e}function pe(){return null!==he}var fe=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),we=new Proxy({},{get:(e,t)=>he?he[t]:"string"==typeof t&&fe.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),ye=K(null);function ge(){return $(ye)?.pageSearch??""}var ve=null,be=/* @__PURE__ */new Set;function xe(e){ve!==e&&(ve=e,be.forEach(e=>e()))}function ke(){return ve}function Ee(e){return be.add(e),()=>{be.delete(e)}}var Ce=null;function Me(e){Ce=e}function Ne({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
1
+ import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as s,widthToFit as l,navIcons as c}from"./chunk-CY5N5OA3.js";import{ROW_HEIGHTS as u}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as d}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as h}from"./chunk-JDCM2VHG.js";import{Result as m}from"./chunk-URERZUX5.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-ZDMZM7HD.js";import{CopyButton as w}from"./chunk-RBQWIHYD.js";import{confirm as y}from"./chunk-GBCH3UHD.js";import{useShellPrefs as g}from"./chunk-KC3EX26K.js";import{ItemCount as v}from"./chunk-QHOBK35Y.js";import{isInOverlayOver as b}from"./chunk-3DVNXNTF.js";import{dialogA11y as x}from"./chunk-VWGWZY7A.js";import{useIsMobile as k,useIsPhone as E}from"./chunk-UGTRSRIW.js";import{ColoredBadge as C}from"./chunk-PXQG5EIH.js";import{focusableIn as M}from"./chunk-CDAJKLGL.js";import{PopupMenu as N,PopupMenuItem as S,PopupMenuDivider as L,PopupMenuLabel as T}from"./chunk-37U326EL.js";import{StatusBadge as z}from"./chunk-TXDA7TTP.js";import{Button_default as A}from"./chunk-I4VIEGCX.js";import{Icon as D}from"./chunk-KKSVRIMP.js";import{LoadingSpinner as P}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as I}from"./chunk-62LW225J.js";import{runEscapeInterceptors as R}from"./chunk-TWVUQUUD.js";import{useShellStrings as W}from"./chunk-4PAWQEXM.js";import{createContext as K,useContext as $,Component as O,useLayoutEffect as j,useRef as F,useEffect as q,useState as H,useSyncExternalStore as B,useCallback as U,isValidElement as Y,Fragment as X,Children as V,cloneElement as G,useMemo as _,useId as J,useReducer as Q,Suspense as Z}from"react";import{jsxs as ee,jsx as te,Fragment as ne}from"react/jsx-runtime";import{createPortal as re}from"react-dom";import{useLocation as oe}from"react-router-dom";import{useQueryClient as ie,useQuery as ae}from"@tanstack/react-query";function se(e){return"component"in e}function le(e){return"endpoint"in e}var ce={};function ue(e){ce=e}var de=new Proxy({},{get:(e,t)=>ce[t],has:(e,t)=>t in ce,ownKeys:()=>Object.keys(ce),getOwnPropertyDescriptor(e,t){if(t in ce)return{configurable:!0,enumerable:!0,value:ce[t]}}}),he=null;function me(e){he=e}function pe(){return null!==he}var fe=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),we=new Proxy({},{get:(e,t)=>he?he[t]:"string"==typeof t&&fe.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),ye=K(null);function ge(){return $(ye)?.pageSearch??""}var ve=null,be=/* @__PURE__ */new Set;function xe(e){ve!==e&&(ve=e,be.forEach(e=>e()))}function ke(){return ve}function Ee(e){return be.add(e),()=>{be.delete(e)}}var Ce=null;function Me(e){Ce=e}function Ne({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
2
2
  return ee("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
3
  /* @__PURE__ */te(D,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
4
  /* @__PURE__ */ee("div",{className:"min-w-0",children:[
@@ -23,30 +23,30 @@ return te("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.ent
23
23
  /* @__PURE__ */te("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:mt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{ft(),i()},children:e.map(e=>{const t=ot(e.id)??ut(e.label),o=t?function(e){if(dr(e))return null;const t=e.getBoundingClientRect(),n=ir(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
24
24
  return ee("div",{className:"group flex flex-col items-center",onMouseEnter:()=>pt(t),children:[!m&&/* @__PURE__ */te("span",{className:p,children:e.label}),
25
25
  /* @__PURE__ */te(wt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */te("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */ee("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
26
- /* @__PURE__ */te(D,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function gt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function vt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=W(),[a,s]=H(null);q(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const l=B(Nr,Mr),[,u]=H(0);q(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=H(0);q(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=ut(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=H(null),[f,w]=H(null),[y,v]=H(null),b=F(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!de[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],C=/* @__PURE__ */new Map;for(const e of k){const t=e.route?de[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=C.get(r);if(void 0!==o)E[o].items.push(e);else{C.set(r,E.length);const o=n?.label??t?.label??e.label;E.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return re(
26
+ /* @__PURE__ */te(D,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function gt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function vt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=W(),[a,s]=H(null);q(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const l=B(Nr,Mr),[,u]=H(0);q(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=H(0);q(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=ut(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=H(null),[f,w]=H(null),[y,g]=H(null),b=F(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!de[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],C=/* @__PURE__ */new Map;for(const e of k){const t=e.route?de[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=C.get(r);if(void 0!==o)E[o].items.push(e);else{C.set(r,E.length);const o=n?.label??t?.label??e.label;E.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return re(
27
27
  /* @__PURE__ */ee(ne,{children:[E.map(e=>{const n=e.route?c[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(l){const t=document.querySelector(`[data-modal-id="${l}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=ot(e.id)??ut(e.label);return!!t&&!dr(t)});/* @__PURE__ */
28
- return ee("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),p(null),w(null),s?v({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&Y(n)?G(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */te(D,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
29
- /* @__PURE__ */te("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */te("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */te(g,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */te("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */te(D,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
28
+ return ee("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),p(null),w(null),s?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&Y(n)?G(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */te(D,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
29
+ /* @__PURE__ */te("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */te("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */te(v,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */te("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */te(D,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
30
30
  /* @__PURE__ */te("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */ee("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
31
- /* @__PURE__ */te(D,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */ee(N,{portal:!0,minWidth:200,style:gt(y.x,y.y),onClose:()=>v(null),children:[
31
+ /* @__PURE__ */te(D,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */ee(N,{portal:!0,minWidth:200,style:gt(y.x,y.y),onClose:()=>g(null),children:[
32
32
  /* @__PURE__ */te(T,{children:y.label}),
33
- /* @__PURE__ */ee(S,{onClick:()=>{v(null),y.items.forEach(e=>function(e){const t=$n.get(e);t&&tr(t)}(e.id))},children:[
33
+ /* @__PURE__ */ee(S,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=$n.get(e);t&&tr(t)}(e.id))},children:[
34
34
  /* @__PURE__ */te(D,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
35
- /* @__PURE__ */ee(S,{onClick:()=>{v(null),y.items.forEach(e=>o(e.id))},children:[
35
+ /* @__PURE__ */ee(S,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
36
36
  /* @__PURE__ */te("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */te("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
37
37
  /* @__PURE__ */te(L,{}),
38
- /* @__PURE__ */ee(S,{danger:!0,onClick:()=>{v(null),y.items.forEach(e=>t(e.id))},children:[
38
+ /* @__PURE__ */ee(S,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
39
39
  /* @__PURE__ */te(D,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */te(yt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var bt=["/login","/forgot-password","/reset-password","/force-change-password"];function xt({children:e,windowAccentForRoute:t}){const n=oe(),r=bt.some(e=>n.pathname.startsWith(e)),[o,i]=H([]),a=F(o);j(()=>{a.current=o},[o]);const s=B(Ee,ke,ke),l=F(/* @__PURE__ */new Map),c=e=>{const t=Re(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};q(()=>{lt.clear();for(const e of o)e.route&&lt.set(e.id,e.route)},[o]);const u=U(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=U(e=>{var t;ot(e)||it(e)?(t=e,window.dispatchEvent(new CustomEvent(Sr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Pn;t&&tt.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(In.get(i)??-1)>a)||er(o),t&&tt.delete(e)},50)},m=(e,t,n)=>{const r=Ce;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Re(t))return e.length;if(t.shellOwned&&Ke(t,n.home))return 0;const r=Ke(t,n.home)?void 0:We(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Re(e)&&!Ke(e,n.home)&&We(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Ke(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Ke(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>Re(e[t])&&!Ke(e[t],n.home)?We(e[t])?.key:void 0;for(;r>0&&r<e.length&&void 0!==i(r)&&i(r)===i(r-1);)r++;return r}return e.length}(e,t,{home:ke(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=U(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),f=U((e,t,n,r,o,a={})=>{if(!de[e]||!le(de[e]))return;const s=`${e}:${t}`,l=st();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:Fe(n),openedFrom:l},!!a.append))})},[]),w=U((e,t={})=>{if(!de[e]||!se(de[e]))return;const n=de[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Hn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const p=st();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=U(()=>{},[]),g=U(()=>{},[]),v=d,b=d;/* @__PURE__ */
40
40
  return ee(Xe.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
41
41
  /* @__PURE__ */te(vt,{openWindows:o,onRemove:d,onSplitView:Xr,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&er(e)}})},onActivateById:at}),
42
42
  /* @__PURE__ */te(Vr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
43
43
  /* @__PURE__ */
44
- return te(ye.Provider,{value:c(e),children:/* @__PURE__ */te(Se,{fallback:(t,n)=>/* @__PURE__ */te(Gr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */te(Ne,{error:t,onReload:n})}),children:/* @__PURE__ */te(Jt,{spec:Qe(e),children:/* @__PURE__ */te(no,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */te(Ze,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */te(rt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var kt=400;function Et({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=F(null),s=F(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=F(!1),c=F(void 0),u=F(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},kt)};q(()=>{n&&!r&&h()},[n,r]),q(()=>{d&&n&&!r&&h()},[d]),q(()=>()=>clearTimeout(c.current),[]),q(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?C(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),j(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Ct=null,Mt=/* @__PURE__ */new Set;function Nt(){return Ct}function St(e){if(Ct!==e){Ct=e;for(const e of Mt)e()}}function Lt(e){return Mt.add(e),()=>{Mt.delete(e)}}var Tt=!1,zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},At=()=>{};function Dt(e){Tt=e,zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Pt(e,t){Tt&&("submenu"===e?zt.submenus++:zt.menus++,zt.menuKey=t)}function It(e){if(!Tt)return At;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Tt)return;const r=performance.now()-t;"move"===e?zt.moveMs+=r:zt.resizeMs+=r}}function Rt(){const e=zt;return zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Wt=/* @__PURE__ */new Set([z,x]),Kt=e=>Wt.has(e)||"function"==typeof e&&"badge"===e.titleRole,$t=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ot=/* @__PURE__ */new Set(["svg"]);function jt(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Ft(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Ft(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>Ft(e,t,n));if(!Y(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===X)return void V.toArray(r.props.children).forEach(e=>Ft(e,t,n));if("string"==typeof r.type){if(Ot.has(r.type))return;if(!$t.has(r.type))return n.push(" "),V.toArray(r.props.children).forEach(e=>Ft(e,t,n)),void n.push(" ")}const o=G(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Kt(r.type)?t.badges:t.actions).push(o)}var qt=/* @__PURE__ */new Map,Ht=/* @__PURE__ */new Set,Bt=0;function Ut(){Bt++,Ht.forEach(e=>e())}function Yt(e){return qt.get(e)}function Xt(e){return Ht.add(e),()=>{Ht.delete(e)}}function Vt(){return Bt}var Gt=K(""),_t=K(null);function Jt({spec:e,children:t}){/* @__PURE__ */
44
+ return te(ye.Provider,{value:c(e),children:/* @__PURE__ */te(Se,{fallback:(t,n)=>/* @__PURE__ */te(Gr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */te(Ne,{error:t,onReload:n})}),children:/* @__PURE__ */te(Jt,{spec:Qe(e),children:/* @__PURE__ */te(no,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */te(Ze,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */te(rt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var kt=400;function Et({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=F(null),s=F(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=F(!1),c=F(void 0),u=F(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},kt)};q(()=>{n&&!r&&h()},[n,r]),q(()=>{d&&n&&!r&&h()},[d]),q(()=>()=>clearTimeout(c.current),[]),q(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?M(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),j(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Ct=null,Mt=/* @__PURE__ */new Set;function Nt(){return Ct}function St(e){if(Ct!==e){Ct=e;for(const e of Mt)e()}}function Lt(e){return Mt.add(e),()=>{Mt.delete(e)}}var Tt=!1,zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},At=()=>{};function Dt(e){Tt=e,zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Pt(e,t){Tt&&("submenu"===e?zt.submenus++:zt.menus++,zt.menuKey=t)}function It(e){if(!Tt)return At;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Tt)return;const r=performance.now()-t;"move"===e?zt.moveMs+=r:zt.resizeMs+=r}}function Rt(){const e=zt;return zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Wt=/* @__PURE__ */new Set([z,C]),Kt=e=>Wt.has(e)||"function"==typeof e&&"badge"===e.titleRole,$t=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ot=/* @__PURE__ */new Set(["svg"]);function jt(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Ft(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Ft(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>Ft(e,t,n));if(!Y(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===X)return void V.toArray(r.props.children).forEach(e=>Ft(e,t,n));if("string"==typeof r.type){if(Ot.has(r.type))return;if(!$t.has(r.type))return n.push(" "),V.toArray(r.props.children).forEach(e=>Ft(e,t,n)),void n.push(" ")}const o=G(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Kt(r.type)?t.badges:t.actions).push(o)}var qt=/* @__PURE__ */new Map,Ht=/* @__PURE__ */new Set,Bt=0;function Ut(){Bt++,Ht.forEach(e=>e())}function Yt(e){return qt.get(e)}function Xt(e){return Ht.add(e),()=>{Ht.delete(e)}}function Vt(){return Bt}var Gt=K(""),_t=K(null);function Jt({spec:e,children:t}){/* @__PURE__ */
45
45
  return te(_t.Provider,{value:e,children:t})}var Qt=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Zt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',en='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function tn(e){return nn(e).replace(/\s+/g," ").trim()}function nn(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(nn).join("");if(Y(e)){const t=e,n="string"==typeof t.type?t.type:"";return Qt.has(n)?"":` ${nn(t.props?.children)} `}return""}function rn(e){const t=$(Gt);q(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var on={};function an(e,t,n){const r=$(Gt);q(()=>{if(!r)return;on[r]||(on[r]=[]);const o={label:e,icon:n,onClick:t};return on[r].push(o),()=>{on[r]=(on[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function sn({title:e}){const t=F(null);return q(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */te("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function ln(e){}var cn=K(null);function un(){return $(Gt)}function dn(){const e=B(Nr,Mr),t=$(cn);return t?.active??(zn.length<=1||null!=e)}function hn({children:e,position:t="right",quiet:n=!1}){const r=$(cn),[o,i]=H(null);return q(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?re(e,o):null}function mn({onClick:e,children:t,className:n}){const r=$(cn);/* @__PURE__ */
46
46
  return te("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var pn="erp_window_positions",fn={};try{const e=localStorage.getItem(pn);e&&(fn=JSON.parse(e))}catch{}var wn=null;function yn(){wn&&clearTimeout(wn),wn=setTimeout(()=>{try{localStorage.setItem(pn,JSON.stringify(fn))}catch{}},500)}var gn="erp_activation_order",vn=[];try{const e=localStorage.getItem(gn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(vn=t)}catch{}var bn=null;function xn(){bn&&clearTimeout(bn),bn=setTimeout(()=>{try{localStorage.setItem(gn,JSON.stringify(vn))}catch{}},500)}function kn(e,t){fn[e]||(fn[e]=t,yn())}function En(e){return fn[e]?{...fn[e]}:null}function Cn(e,t){fn[e]=t,yn()}function Mn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(fn))n(fn[e],r,o)&&(delete fn[e],i=!0);i&&yn()}var Nn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Sn=4e3,Ln=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},Tn={small:.8,medium:1,large:1.25,maximized:1.25},zn=[],An=/* @__PURE__ */new Set,Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var Rn=0;function Wn(){return Rn}function Kn(){Rn++,An.forEach(e=>e())}var $n=/* @__PURE__ */new Map,On=/* @__PURE__ */new Map,jn=/* @__PURE__ */new Map;function Fn(){for(let e=zn.length-1;e>=0;e--){const t=jn.get(zn[e]);if(t?.tab)return t.owner}return null}function qn(){return B(Nr,Fn,()=>null)}var Hn=/* @__PURE__ */new Set;var Bn=null;function Un(e){Bn=null,er(e)}function Yn(e){Bn=e;const t=$n.get(e);t&&Un(t)}var Xn=/* @__PURE__ */new Map;function Vn(e){return Xn.get(e)?.holdsChanges()??!1}function Gn(e){const t=Xn.get(e);return t?t.ask():Promise.resolve(!0)}function _n(e){Bn===e&&(Bn=null)}function Jn(e,t,n){if(n&&jn.set(e,n),t)if($n.set(t,e),On.set(e,t),Hn.delete(t)){zn.unshift(e);const n=vn.indexOf(t);-1!==n&&vn.splice(n,1),vn.unshift(t),xn()}else!function(e,t){const n=vn.indexOf(t);if(-1===n)return void zn.push(e);let r=zn.length;for(let e=0;e<zn.length;e++){const t=On.get(zn[e]);if(t&&vn.indexOf(t)>n){r=e;break}}zn.splice(r,0,e)}(e,t),-1===vn.indexOf(t)&&(vn.push(t),xn());else zn.push(e);Kn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Bn===t&&Un(e)}function Qn(e){return e?jn.get(e)?.owner??On.get(e)??null:null}var Zn=/* @__PURE__ */new Set;function er(e){const t=Qn(Mr()),n=zn.indexOf(e);-1!==n&&zn.splice(n,1),zn.push(e);const r=jn.get(e);if(r?.root)for(const[e,t]of jn){if(t.root||t.owner!==r.owner||Dn.has(e))continue;const n=zn.indexOf(e);-1!==n&&zn.splice(n,1),zn.push(e)}Dn.delete(e);const o=On.get(e);if(o){const e=vn.indexOf(o);-1!==e&&vn.splice(e,1),vn.push(o),xn(),Bn&&Bn!==o&&(Bn=null)}Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=Qn(Mr());i&&i!==t&&Zn.forEach(e=>e(i))}function tr(e){const t=zn.indexOf(e);-1!==t&&zn.splice(t,1),Dn.add(e),In.set(e,++Pn);const n=On.get(e);if(n){const e=vn.indexOf(n);-1!==e&&(vn.splice(e,1),xn())}Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var nr=/* @__PURE__ */new Set;var rr=8,or=32;function ir(){return e()}var ar=u.windowBar,sr=80,lr=384,cr=400;function ur(e,t=ir()){const n=Math.min(Math.max(e.x,t.x+sr-e.w),t.x+t.w-sr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-ar);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function dr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=ir();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function hr(e){const t=ir(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var mr=null;function pr(e){const t=(mr||((mr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${I.snapPreview}`,"border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(mr)),mr);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function fr(){mr&&(mr.style.opacity="0",mr.style.display="none")}var wr=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],yr=350,gr=200;function vr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=H(!1),s=F(void 0),l=F(void 0);q(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),yr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),gr)};/* @__PURE__ */
47
47
  return ee("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
48
48
  /* @__PURE__ */te("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */te("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */te("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */te("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var br="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(br))return;const e=document.createElement("style");e.id=br,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=It(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=zn.indexOf(e);if(-1===t)return-1;const n=I.window+t*I.windowStep,r=jn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of jn){if(!t.root||t.owner!==r.owner)continue;const n=zn.indexOf(e);-1!==n&&(o=Math.max(o,I.window+n*I.windowStep))}return o>=n?o+2+Math.min(t,7):n}function Mr(){return zn[zn.length-1]||null}function Nr(e){return An.add(e),()=>{An.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=zn.length-1;e>=0;e--)nr.has(zn[e])||zn.splice(e,1);vn=vn.filter(e=>{const t=$n.get(e);return null!=t&&nr.has(t)}),xn(),Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Sr="modal-close-request";function Lr(e){B(Nr,Wn);const t=$(cn);if(zn.length<=1)return!0;if(e){const t=$n.get(e);if(null!=t)return Mr()===t}return t?.active??null!=Mr()}var Tr=!1,zr=/* @__PURE__ */new Set;function Ar(e){return zr.add(e),()=>zr.delete(e)}function Dr(){return Tr}function Pr(e){Tr!==e&&(Tr=e,zr.forEach(e=>e()))}function Ir(){Pr(!Tr)}function Rr(){Pr(!1)}var Wr=null,Kr=/* @__PURE__ */new Set;function $r(e){return Kr.add(e),()=>Kr.delete(e)}function Or(){return Wr}function jr(e){Wr!==e&&(Wr=e,Kr.forEach(e=>e()))}var Fr=null,qr=/* @__PURE__ */new Set;function Hr(e){return qr.add(e),()=>qr.delete(e)}function Br(){return Fr}function Ur(e){Fr!==e&&(Fr=e,qr.forEach(e=>e()))}function Yr(){if(!Fr)return void Pr(!1);jr(Fr),Ur(null),Pr(!1)}function Xr(){Pr(!Tr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Vr(){const e=B(Ar,Dr),[t,n]=H(e),[r,o]=H(e);return q(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?re(
49
- /* @__PURE__ */te("div",{onMouseDown:e=>{e.stopPropagation(),Pr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:I.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Gr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:g,onMinimize:x,initialBox:C,actions:T,actionsLeft:z,editing:P=!1,edit:K,allowPinOnTop:O,initialPosition:X,widget:V,compact:Q,appStyle:Z,flushBody:oe,autoHeight:ie,autoMinHeight:ae,autoWidth:se,widgetMenu:le,dimensions:ce,windowKey:ue,openedFromKey:de,accentRgb:he,children:me}){const[pe,fe]=H(()=>r()),we=k()&&!pe,ge=E()&&!!V,[ve,be]=H(0),[xe,ke]=H(!1),Ee=F(null),Ce=F(0);q(()=>{Ce.current=ve},[ve]);const Me=U(e=>{we&&(Ee.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},ke(!0),St(de??null))},[we,de]),Ne=B(Lt,Nt);q(()=>{if(!xe)return;const e=e=>{if(!Ee.current)return;const t=e.clientX-Ee.current.startX;if(Math.abs(e.clientY-Ee.current.startY)>Math.abs(t)+12)return Ee.current=null,ke(!1),be(0),void St(null);be(Math.max(0,t))},t=()=>{if(!Ee.current)return;const e=.3*window.innerWidth,t=Ce.current>e;Ee.current=null,ke(!1),t?(be(window.innerWidth),setTimeout(()=>{i(),be(0),St(null)},180)):(be(0),St(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[xe]);const[Te,Ae]=H(c),De=W(),Pe=De.window;q(()=>{Ae(c)},[c]);const Ie=_(()=>tn(Te).trim()||void 0,[Te]),Re=J(),[We,Ke]=H(!1),$e=F(!1),[Oe,je]=H(!1),[Fe,qe]=H(null),He=$(_t),Be=$(ye),{prefs:Ue,save:Ye}=M(),Xe=!!Ue.window_accent_stripe,Ve=Ue.favorite_documents||[],_e=!!He&&Ve.some(e=>e.entityType===He.entityType&&e.entityId===He.entityId),Qe=U(()=>{if(!He)return;const e=_e?Ve.filter(e=>!(e.entityType===He.entityType&&e.entityId===He.entityId)):[...Ve,{entityType:He.entityType,entityId:He.entityId,label:He.label}];Ye({favorite_documents:e})},[He,_e,Ve,Ye]),[Ze,et]=H(null),[tt,nt]=H("top-right"===X?"right":"left"),rt=F(!1),ot=F(null);j(()=>{const e=ot.current;e&&(he?e.style.setProperty("--window-accent-rgb",he):e.style.removeProperty("--window-accent-rgb"))},[he]);const it=F(!1),at=F(null),st=F(null),lt=F(null),[ct,ut]=H(!1),dt=F(null),ht=F(null),mt=F(null),[pt,ft]=H(!1);j(()=>{const e=ht.current,t=mt.current;if(!e||!t)return;const n=()=>ft(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=w&&!1!==w]);const wt=!!K&&!V&&!Q&&!Z&&(K.editing||"hidden"!==K.state),yt=!!(w||T||z)||ct||wt,gt=$(Le),vt=""!==$(Gt),bt=F(null);bt.current=Be?{owner:Be.key,tab:Be.tab,root:!vt}:null;const xt=ue||(Be&&!vt?Be.key:null),kt=!!gt&&!vt&&gt.enabled&&gt.hasState&&(P||gt.declaredEditable)&&!gt.handMounted&&yt&&!V&&!Q&&!Z&&!we,Ct=/* @__PURE__ */te(D,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),Mt=u&&Y(u)?G(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Ct,Tt=()=>/* @__PURE__ */te("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();qe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:Mt}),zt=40,{minimize:At,items:Dt,restoreIfMinimized:Pt,openWindows:It}=Je(),Rt=F(`modal-${Math.random().toString(36).slice(2,8)}`).current;q(()=>{if(V)return nr.add(Rt),()=>{nr.delete(Rt)}},[V,Rt]),q(()=>{const e=e=>{const t=e.detail;t?.id===Rt&&Ae(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Rt]);const[Wt,Kt]=H(I.window),$t=function(e){const t=B(Nr,Mr);return zn.length<=1||t===e}(Rt),Ot=F(K);Ot.current=K;const Ft=!!K&&!K.editing&&"enabled"===K.state;q(()=>{if(!t||!$t||!Ft)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(v(e.target,ot.current)||(e.preventDefault(),e.stopPropagation(),Ot.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,$t,Ft]);const Ht=function(e){return B(Nr,()=>Dn.has(e))}(Rt);Et({panelRef:ot,bodyRef:at,open:t,widget:!!V,active:$t,minimized:Ht});const Bt=B(Ar,Dr),Yt=B($r,Or),Xt=B(Hr,Br),Vt=!O&&!V,Jt=Bt&&Vt,[Qt,nn]=H(!1),rn=Jt&&Xt===Rt,[an,sn]=H(!1),ln=an&&Vt&&Yt===Rt?"picked":null,un=F(Jt);q(()=>{if(un.current&&!Jt){sn(!0);const e=setTimeout(()=>{sn(!1),Wr===Rt&&jr(null)},700);return un.current=Jt,()=>clearTimeout(e)}un.current=Jt},[Jt,Rt]),q(()=>{Jt||nn(!1)},[Jt]),q(()=>{const e=st.current,t=lt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ut(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),q(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ot.current){const t=ot.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=st.current,n=lt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const dn=F(!1),hn=U(e,[]),mn=U(()=>{const t=e(),n=ce?ce[0]:Nn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Tn[Ln()],l=ce?Math.min(ce[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(zn.length-1),u=Math.max(zt,(i-l)/2),d=(o-a)/2,m=t.h-zt-l-u;return"top-right"===X?{x:t.x+t.w-a-zt,y:t.y+zt,w:a,h:l}:"top-left"===X?{x:t.x+zt,y:t.y+zt,w:a,h:l}:{x:t.x+Math.max(zt,(o-a)/2+zt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),pn=F(!1);t||(pn.current=!1);const wn=ue||d||null;q(()=>{if(!t)return;Jn(Rt,wn,bt.current??void 0),ue||er(Rt),dn.current=!1,Kt(Cr(Rt));const e=()=>{Kt(Cr(Rt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ue;if(!e.label)return!1;const t=ot.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(Rt),Pn.current)return;const t=ir(),n=Math.min(Un.current.w,t.w-40),o=Math.min(Un.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;bn({x:i,y:a,w:n,h:o}),Bn(!1)},i=e=>{const t=e.detail;r(t)&&(er(Rt),qe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ue)return;er(Rt);const t=Un.current,n=function(e,t=ir()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ot.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}bn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=zn.indexOf(e);-1!==t&&(zn.splice(t,1),Kn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=On.get(e);n&&(On.delete(e),$n.delete(n))}(Rt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,Rt,wn,hn]);const gn=!V&&"maximized"===Ln(),[vn,bn]=H(()=>{if(wn&&fn[wn]){const e={...fn[wn]};return ce&&(e.w=ce[0],ie||(e.h=ce[1])),ur(e)}return C?{x:C.x,y:C.y,w:C.w,h:C.h}:gn?hn():mn()}),[xn,kn]=H(()=>!ie),En=F(pe),Cn=F(null);q(()=>{const e=()=>{const e=r();e!==En.current&&Cn.current?.(e),En.current=e,fe(e),Kt(Cr(Rt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Rt]);const Mn=pe&&!!Be?.tab&&!vt&&!V&&!we,An=Mn,Pn=F(An);Pn.current=An;const Rn=qn(),Wn=pe&&!!Be?.tab&&!V&&!we&&!Bt&&Rn!==Be.key,Fn=!!V&&pe&&!Bt&&null!==Rn,[Hn,Bn]=H(()=>wn&&fn[wn]||C?An:An||gn),Un=F(vn);Un.current=vn;const Yn=F(Hn);j(()=>{Yn.current=Hn},[Hn]),j(()=>{if(xn||Mn)return;const e=ot.current,t=at.current;if(!e||!t)return;const n=ae??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Un.current.y)-24),g=w?Math.min(Un.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&kn(!0)},160)))},l=new ResizeObserver(s);s(),dt.current&&l.observe(dt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[xn,V,ae,yt,Mn]),j(()=>{if(!ie||!xn||V||!t)return;const e=dt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Hn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ae??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Un.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ie,xn,V,t,Hn,ae]);const Vn=!1!==se&&!V&&!Z&&!we,[Gn,_n]=H(()=>!Vn);j(()=>{if(Gn||!t)return;if(!Vn||Hn)return void _n(!0);const n=ot.current,r=at.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Un.current.w,c=0;const u=()=>_n(!0),d=()=>{c=0;const t=Un.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const v=s(t,l(t.w,w,g),d,zt);v!==t&&(i=v.w,bn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Sn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Gn,t,Vn,Hn]);const Qn=F(null),Zn=!(!Be?.tab||vt||V||we);Cn.current=t=>{if(!Zn)return;if(t)return Qn.current||(Qn.current={box:{...Un.current},maximized:Yn.current}),void(Yn.current=!0);const r=Qn.current;Qn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Bn(!0),void bn(o);const i=r?.box??(wn?fn[wn]:void 0);if(Yn.current=!1,Bn(!1),i&&!n(i,o,!1)){const e={...i};ce&&(e.w=ce[0],ie||(e.h=ce[1])),bn(ur(e))}else bn(mn())},q(()=>{An&&(Yn.current=!0,Bn(!0),bn(hn()))},[An,hn]),q(()=>{if(V)return;const e=()=>{const e=wn?fn[wn]:void 0;if(Yn.current=!1,Bn(!1),e){const t={...e};ce&&(t.w=ce[0],ie||(t.h=ce[1])),bn(ur(t))}else bn(mn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,mn,wn]),q(()=>{t&&wn&&!Mn&&(fn[wn]=vn,yn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[vn,t,wn,Mn]),q(()=>{if(!t)return;const e=()=>{Yn.current?bn(hn()):document.body.classList.contains("rosh-gesturing")||bn(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Hn&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Hn,hn]),q(()=>{if(t&&(Ke(!1),$e.current=!1,rt.current=!1,_n(!Vn),!Pn.current)){if(wn&&fn[wn]){const e=fn[wn];return void bn(t=>ur({...e,...ie?{h:t.h}:{},...Vn?{x:t.x,w:t.w}:{}}))}C&&(bn({x:C.x,y:C.y,w:C.w,h:C.h}),Bn(C.maximized))}},[t]),q(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ot.current?.contains(t.target)&&!$e.current&&($e.current=!0,e=setTimeout(()=>Ke(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const ar="auto"===m?We:!0===m,sr=Be&&!vt?Be.key:null,dr=_(()=>jt(Te),[Te]),mr=F({shortcutSpec:He,isOnDesktop:_e,toggleDesktopShortcut:Qe,taskbarStrings:De.taskbar});j(()=>{mr.current={shortcutSpec:He,isOnDesktop:_e,toggleDesktopShortcut:Qe,taskbarStrings:De.taskbar}});const wr=F(null);wr.current||(wr.current={open:(e,t)=>qe({x:e,y:t}),items:()=>{const e=mr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of on[Rt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),q(()=>{if(t&&sr)return()=>{return e=sr,void(qt.delete(e)&&Ut());var e}},[t,sr]),Ge(!(ue||!t)&&ar);const yr=U(()=>ar||"auto"===m&&$e.current,[ar,m]),gr=U(async e=>{if(rt.current)return!1;if(!yr())return!0;rt.current=!0;const t=Ie,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return rt.current=!1,r},[yr,Ie]),br=U(()=>rt.current?Promise.resolve():yr()?gr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[yr,gr,i]),Lr=U(async()=>{await gr("discard")&&($e.current=!1,Ke(!1),Ot.current?.onDiscard())},[gr]),Tr=U(async()=>{const e=await gr("switch");return e&&($e.current=!1,Ke(!1)),e},[gr]),zr=F(()=>!1);j(()=>{zr.current=yr}),j(()=>{if(!t||!ue)return;const e={holdsChanges:()=>zr.current(),ask:Tr};return Xn.set(ue,e),()=>{Xn.get(ue)===e&&Xn.delete(ue)}},[t,ue,Tr]),j(()=>{if(!t||!xt)return;const e=e=>{e.detail?.windowKey===xt&&br()};return window.addEventListener(Sr,e),()=>window.removeEventListener(Sr,e)},[t,xt,br]);const Ir=F(null),Rr=U(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(qe(null),er(Rt),Pn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ot.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Ir.current){const t=Ir.current;Ir.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Un.current.x,c=s?s.top:Un.current.y,u=s?s.height:Un.current.h,d=s?s.width:Un.current.w;Bn(!1),bn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Un.current={...Un.current,x:s,y:u},!V){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Un.current});if(Un.current=e,!V&&h){Ir.current={x:l,y:c,w:d,h:u};const e=hr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void bn(e)}if(V){const t=e.x+e.w/2,n=window.innerWidth/2;nt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),bn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Kr=U((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ot.current,l=s?.getBoundingClientRect(),c=l?l.left:Un.current.x,u=l?l.top:Un.current.y,d=l?l.width:Un.current.w,h=l?l.height:Un.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Bn(!1),bn({x:c,y:u,w:d,h:h}),Un.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Un.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),bn({...Un.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Fr=U(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),er(Rt),"Enter"===e.key)return void(Hn?(Bn(!1),bn(mn())):(Bn(!0),bn(hn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Ir.current||(Ir.current={...Un.current})};if(r<0)return e(),Bn(!0),void bn(hn());if(r>0){if(Hn)return Bn(!1),void bn(mn());if(Ir.current){const e=ur(Ir.current);return Ir.current=null,Un.current=e,void bn(e)}return void tr(Rt)}e(),Bn(!1);const t=hr(n<0?"left":"right");return Un.current=t,void bn(t)}if(Hn)return;const o=Un.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Un.current=i,bn(i)},[Rt,Hn,mn,hn]),qr=U(e=>{Ir.current||(Ir.current={...Un.current}),Bn(!1);const t=hr(e);Un.current=t,bn(t),er(Rt)},[Rt]),Ur=An||Jt?{}:{tabIndex:0,role:"group","aria-label":Ie?`${Ie} — ${Pe.windowSuffix}`:Pe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Fr},Yr=()=>{Bn(!0),bn(hn())},Xr=U(()=>{const e=ot.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Zt);t&&!t.disabled&&t.click()}},[]);q(()=>{if(!t)return;if(V)return;const e=e=>{if(zn[zn.length-1]===Rt&&!v(e.target,ot.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ot.current?.contains(t)))return;if(t.closest(en))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,Rt,V]),q(()=>{if(!t)return;const e=e=>{zn[zn.length-1]===Rt&&(v(e.target,ot.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Rt}})),$e.current=!1,Ke(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Rt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),q(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&zn[zn.length-1]===Rt){if(R(e))return e.preventDefault(),void e.stopPropagation();if(Mn&&!P)return;e.preventDefault(),e.stopPropagation(),br()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,br,Rt,V,Mn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Gr]=H(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),_r=Mn&&!Be?.home&&dr.actions.length>0;q(()=>{t&&sr&&function(e,t){const n=qt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(qt.set(e,t),Ut())}(sr,{title:dr.text||Ie,dirty:ar,copy:dr.copy,actions:_r&&Gr?Gr:void 0,menu:wr.current??void 0})},[t,sr,Ie,ar,dr.text,dr.copy,_r,Gr]);const Jr=U(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(q(()=>{if(!t)return;const e=e=>{if(zn[zn.length-1]!==Rt)return;if(v(e.target,ot.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Jr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Jr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Jr,Rt]),!t||pn.current)return null;const Qr=Jt?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=ir(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(Rt):null,Zr=Jt&&Qr?Math.min(Qr.w/vn.w,Qr.h/vn.h):1,eo=(()=>{if(Jt&&Qr){const e=Zr,t=vn.w*e,n=vn.h*e,r=Qr.x+(Qr.w-t)/2-vn.x,o=Qr.y+(Qr.h-n)/2-vn.y,i=Qt||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:I.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(an&&Vt){const e="picked"===ln;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:I.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!V&&(Mn?!Be?.home:!we)?Re:void 0,label:dr.text||Ie}),no=/* @__PURE__ */ee("div",{children:[
49
+ /* @__PURE__ */te("div",{onMouseDown:e=>{e.stopPropagation(),Pr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:I.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Gr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:v,onMinimize:C,initialBox:M,actions:T,actionsLeft:z,editing:P=!1,edit:K,allowPinOnTop:O,initialPosition:X,widget:V,compact:Q,appStyle:Z,flushBody:oe,autoHeight:ie,autoMinHeight:ae,autoWidth:se,widgetMenu:le,dimensions:ce,windowKey:ue,openedFromKey:de,accentRgb:he,children:me}){const[pe,fe]=H(()=>r()),we=k()&&!pe,ge=E()&&!!V,[ve,be]=H(0),[xe,ke]=H(!1),Ee=F(null),Ce=F(0);q(()=>{Ce.current=ve},[ve]);const Me=U(e=>{we&&(Ee.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},ke(!0),St(de??null))},[we,de]),Ne=B(Lt,Nt);q(()=>{if(!xe)return;const e=e=>{if(!Ee.current)return;const t=e.clientX-Ee.current.startX;if(Math.abs(e.clientY-Ee.current.startY)>Math.abs(t)+12)return Ee.current=null,ke(!1),be(0),void St(null);be(Math.max(0,t))},t=()=>{if(!Ee.current)return;const e=.3*window.innerWidth,t=Ce.current>e;Ee.current=null,ke(!1),t?(be(window.innerWidth),setTimeout(()=>{i(),be(0),St(null)},180)):(be(0),St(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[xe]);const[Te,Ae]=H(c),De=W(),Pe=De.window;q(()=>{Ae(c)},[c]);const Ie=_(()=>tn(Te).trim()||void 0,[Te]),Re=J(),[We,Ke]=H(!1),$e=F(!1),[Oe,je]=H(!1),[Fe,qe]=H(null),He=$(_t),Be=$(ye),{prefs:Ue,save:Ye}=g(),Xe=!!Ue.window_accent_stripe,Ve=Ue.favorite_documents||[],_e=!!He&&Ve.some(e=>e.entityType===He.entityType&&e.entityId===He.entityId),Qe=U(()=>{if(!He)return;const e=_e?Ve.filter(e=>!(e.entityType===He.entityType&&e.entityId===He.entityId)):[...Ve,{entityType:He.entityType,entityId:He.entityId,label:He.label}];Ye({favorite_documents:e})},[He,_e,Ve,Ye]),[Ze,et]=H(null),[tt,nt]=H("top-right"===X?"right":"left"),rt=F(!1),ot=F(null);j(()=>{const e=ot.current;e&&(he?e.style.setProperty("--window-accent-rgb",he):e.style.removeProperty("--window-accent-rgb"))},[he]);const it=F(!1),at=F(null),st=F(null),lt=F(null),[ct,ut]=H(!1),dt=F(null),ht=F(null),mt=F(null),[pt,ft]=H(!1);j(()=>{const e=ht.current,t=mt.current;if(!e||!t)return;const n=()=>ft(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=w&&!1!==w]);const wt=!!K&&!V&&!Q&&!Z&&(K.editing||"hidden"!==K.state),yt=!!(w||T||z)||ct||wt,gt=$(Le),vt=""!==$(Gt),bt=F(null);bt.current=Be?{owner:Be.key,tab:Be.tab,root:!vt}:null;const xt=ue||(Be&&!vt?Be.key:null),kt=!!gt&&!vt&&gt.enabled&&gt.hasState&&(P||gt.declaredEditable)&&!gt.handMounted&&yt&&!V&&!Q&&!Z&&!we,Ct=/* @__PURE__ */te(D,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),Mt=u&&Y(u)?G(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Ct,Tt=()=>/* @__PURE__ */te("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();qe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:Mt}),zt=40,{minimize:At,items:Dt,restoreIfMinimized:Pt,openWindows:It}=Je(),Rt=F(`modal-${Math.random().toString(36).slice(2,8)}`).current;q(()=>{if(V)return nr.add(Rt),()=>{nr.delete(Rt)}},[V,Rt]),q(()=>{const e=e=>{const t=e.detail;t?.id===Rt&&Ae(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Rt]);const[Wt,Kt]=H(I.window),$t=function(e){const t=B(Nr,Mr);return zn.length<=1||t===e}(Rt),Ot=F(K);Ot.current=K;const Ft=!!K&&!K.editing&&"enabled"===K.state;q(()=>{if(!t||!$t||!Ft)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ot.current)||(e.preventDefault(),e.stopPropagation(),Ot.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,$t,Ft]);const Ht=function(e){return B(Nr,()=>Dn.has(e))}(Rt);Et({panelRef:ot,bodyRef:at,open:t,widget:!!V,active:$t,minimized:Ht});const Bt=B(Ar,Dr),Yt=B($r,Or),Xt=B(Hr,Br),Vt=!O&&!V,Jt=Bt&&Vt,[Qt,nn]=H(!1),rn=Jt&&Xt===Rt,[an,sn]=H(!1),ln=an&&Vt&&Yt===Rt?"picked":null,un=F(Jt);q(()=>{if(un.current&&!Jt){sn(!0);const e=setTimeout(()=>{sn(!1),Wr===Rt&&jr(null)},700);return un.current=Jt,()=>clearTimeout(e)}un.current=Jt},[Jt,Rt]),q(()=>{Jt||nn(!1)},[Jt]),q(()=>{const e=st.current,t=lt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ut(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),q(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ot.current){const t=ot.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=st.current,n=lt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const dn=F(!1),hn=U(e,[]),mn=U(()=>{const t=e(),n=ce?ce[0]:Nn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Tn[Ln()],l=ce?Math.min(ce[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(zn.length-1),u=Math.max(zt,(i-l)/2),d=(o-a)/2,m=t.h-zt-l-u;return"top-right"===X?{x:t.x+t.w-a-zt,y:t.y+zt,w:a,h:l}:"top-left"===X?{x:t.x+zt,y:t.y+zt,w:a,h:l}:{x:t.x+Math.max(zt,(o-a)/2+zt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),pn=F(!1);t||(pn.current=!1);const wn=ue||d||null;q(()=>{if(!t)return;Jn(Rt,wn,bt.current??void 0),ue||er(Rt),dn.current=!1,Kt(Cr(Rt));const e=()=>{Kt(Cr(Rt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ue;if(!e.label)return!1;const t=ot.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(Rt),Pn.current)return;const t=ir(),n=Math.min(Un.current.w,t.w-40),o=Math.min(Un.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;bn({x:i,y:a,w:n,h:o}),Bn(!1)},i=e=>{const t=e.detail;r(t)&&(er(Rt),qe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ue)return;er(Rt);const t=Un.current,n=function(e,t=ir()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ot.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}bn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=zn.indexOf(e);-1!==t&&(zn.splice(t,1),Kn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=On.get(e);n&&(On.delete(e),$n.delete(n))}(Rt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,Rt,wn,hn]);const gn=!V&&"maximized"===Ln(),[vn,bn]=H(()=>{if(wn&&fn[wn]){const e={...fn[wn]};return ce&&(e.w=ce[0],ie||(e.h=ce[1])),ur(e)}return M?{x:M.x,y:M.y,w:M.w,h:M.h}:gn?hn():mn()}),[xn,kn]=H(()=>!ie),En=F(pe),Cn=F(null);q(()=>{const e=()=>{const e=r();e!==En.current&&Cn.current?.(e),En.current=e,fe(e),Kt(Cr(Rt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Rt]);const Mn=pe&&!!Be?.tab&&!vt&&!V&&!we,An=Mn,Pn=F(An);Pn.current=An;const Rn=qn(),Wn=pe&&!!Be?.tab&&!V&&!we&&!Bt&&Rn!==Be.key,Fn=!!V&&pe&&!Bt&&null!==Rn,[Hn,Bn]=H(()=>wn&&fn[wn]||M?An:An||gn),Un=F(vn);Un.current=vn;const Yn=F(Hn);j(()=>{Yn.current=Hn},[Hn]),j(()=>{if(xn||Mn)return;const e=ot.current,t=at.current;if(!e||!t)return;const n=ae??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Un.current.y)-24),g=w?Math.min(Un.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&kn(!0)},160)))},l=new ResizeObserver(s);s(),dt.current&&l.observe(dt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[xn,V,ae,yt,Mn]),j(()=>{if(!ie||!xn||V||!t)return;const e=dt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Hn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ae??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Un.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ie,xn,V,t,Hn,ae]);const Vn=!1!==se&&!V&&!Z&&!we,[Gn,_n]=H(()=>!Vn);j(()=>{if(Gn||!t)return;if(!Vn||Hn)return void _n(!0);const n=ot.current,r=at.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Un.current.w,c=0;const u=()=>_n(!0),d=()=>{c=0;const t=Un.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const v=s(t,l(t.w,w,g),d,zt);v!==t&&(i=v.w,bn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Sn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Gn,t,Vn,Hn]);const Qn=F(null),Zn=!(!Be?.tab||vt||V||we);Cn.current=t=>{if(!Zn)return;if(t)return Qn.current||(Qn.current={box:{...Un.current},maximized:Yn.current}),void(Yn.current=!0);const r=Qn.current;Qn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Bn(!0),void bn(o);const i=r?.box??(wn?fn[wn]:void 0);if(Yn.current=!1,Bn(!1),i&&!n(i,o,!1)){const e={...i};ce&&(e.w=ce[0],ie||(e.h=ce[1])),bn(ur(e))}else bn(mn())},q(()=>{An&&(Yn.current=!0,Bn(!0),bn(hn()))},[An,hn]),q(()=>{if(V)return;const e=()=>{const e=wn?fn[wn]:void 0;if(Yn.current=!1,Bn(!1),e){const t={...e};ce&&(t.w=ce[0],ie||(t.h=ce[1])),bn(ur(t))}else bn(mn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,mn,wn]),q(()=>{t&&wn&&!Mn&&(fn[wn]=vn,yn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[vn,t,wn,Mn]),q(()=>{if(!t)return;const e=()=>{Yn.current?bn(hn()):document.body.classList.contains("rosh-gesturing")||bn(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Hn&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Hn,hn]),q(()=>{if(t&&(Ke(!1),$e.current=!1,rt.current=!1,_n(!Vn),!Pn.current)){if(wn&&fn[wn]){const e=fn[wn];return void bn(t=>ur({...e,...ie?{h:t.h}:{},...Vn?{x:t.x,w:t.w}:{}}))}M&&(bn({x:M.x,y:M.y,w:M.w,h:M.h}),Bn(M.maximized))}},[t]),q(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ot.current?.contains(t.target)&&!$e.current&&($e.current=!0,e=setTimeout(()=>Ke(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const ar="auto"===m?We:!0===m,sr=Be&&!vt?Be.key:null,dr=_(()=>jt(Te),[Te]),mr=F({shortcutSpec:He,isOnDesktop:_e,toggleDesktopShortcut:Qe,taskbarStrings:De.taskbar});j(()=>{mr.current={shortcutSpec:He,isOnDesktop:_e,toggleDesktopShortcut:Qe,taskbarStrings:De.taskbar}});const wr=F(null);wr.current||(wr.current={open:(e,t)=>qe({x:e,y:t}),items:()=>{const e=mr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of on[Rt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),q(()=>{if(t&&sr)return()=>{return e=sr,void(qt.delete(e)&&Ut());var e}},[t,sr]),Ge(!(ue||!t)&&ar);const yr=U(()=>ar||"auto"===m&&$e.current,[ar,m]),gr=U(async e=>{if(rt.current)return!1;if(!yr())return!0;rt.current=!0;const t=Ie,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return rt.current=!1,r},[yr,Ie]),br=U(()=>rt.current?Promise.resolve():yr()?gr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[yr,gr,i]),Lr=U(async()=>{await gr("discard")&&($e.current=!1,Ke(!1),Ot.current?.onDiscard())},[gr]),Tr=U(async()=>{const e=await gr("switch");return e&&($e.current=!1,Ke(!1)),e},[gr]),zr=F(()=>!1);j(()=>{zr.current=yr}),j(()=>{if(!t||!ue)return;const e={holdsChanges:()=>zr.current(),ask:Tr};return Xn.set(ue,e),()=>{Xn.get(ue)===e&&Xn.delete(ue)}},[t,ue,Tr]),j(()=>{if(!t||!xt)return;const e=e=>{e.detail?.windowKey===xt&&br()};return window.addEventListener(Sr,e),()=>window.removeEventListener(Sr,e)},[t,xt,br]);const Ir=F(null),Rr=U(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(qe(null),er(Rt),Pn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ot.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Ir.current){const t=Ir.current;Ir.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Un.current.x,c=s?s.top:Un.current.y,u=s?s.height:Un.current.h,d=s?s.width:Un.current.w;Bn(!1),bn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Un.current={...Un.current,x:s,y:u},!V){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Un.current});if(Un.current=e,!V&&h){Ir.current={x:l,y:c,w:d,h:u};const e=hr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void bn(e)}if(V){const t=e.x+e.w/2,n=window.innerWidth/2;nt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),bn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Kr=U((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ot.current,l=s?.getBoundingClientRect(),c=l?l.left:Un.current.x,u=l?l.top:Un.current.y,d=l?l.width:Un.current.w,h=l?l.height:Un.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Bn(!1),bn({x:c,y:u,w:d,h:h}),Un.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Un.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),bn({...Un.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Fr=U(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),er(Rt),"Enter"===e.key)return void(Hn?(Bn(!1),bn(mn())):(Bn(!0),bn(hn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Ir.current||(Ir.current={...Un.current})};if(r<0)return e(),Bn(!0),void bn(hn());if(r>0){if(Hn)return Bn(!1),void bn(mn());if(Ir.current){const e=ur(Ir.current);return Ir.current=null,Un.current=e,void bn(e)}return void tr(Rt)}e(),Bn(!1);const t=hr(n<0?"left":"right");return Un.current=t,void bn(t)}if(Hn)return;const o=Un.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Un.current=i,bn(i)},[Rt,Hn,mn,hn]),qr=U(e=>{Ir.current||(Ir.current={...Un.current}),Bn(!1);const t=hr(e);Un.current=t,bn(t),er(Rt)},[Rt]),Ur=An||Jt?{}:{tabIndex:0,role:"group","aria-label":Ie?`${Ie} — ${Pe.windowSuffix}`:Pe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Fr},Yr=()=>{Bn(!0),bn(hn())},Xr=U(()=>{const e=ot.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Zt);t&&!t.disabled&&t.click()}},[]);q(()=>{if(!t)return;if(V)return;const e=e=>{if(zn[zn.length-1]===Rt&&!b(e.target,ot.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ot.current?.contains(t)))return;if(t.closest(en))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,Rt,V]),q(()=>{if(!t)return;const e=e=>{zn[zn.length-1]===Rt&&(b(e.target,ot.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Rt}})),$e.current=!1,Ke(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Rt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),q(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&zn[zn.length-1]===Rt){if(R(e))return e.preventDefault(),void e.stopPropagation();if(Mn&&!P)return;e.preventDefault(),e.stopPropagation(),br()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,br,Rt,V,Mn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Gr]=H(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),_r=Mn&&!Be?.home&&dr.actions.length>0;q(()=>{t&&sr&&function(e,t){const n=qt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(qt.set(e,t),Ut())}(sr,{title:dr.text||Ie,dirty:ar,copy:dr.copy,actions:_r&&Gr?Gr:void 0,menu:wr.current??void 0})},[t,sr,Ie,ar,dr.text,dr.copy,_r,Gr]);const Jr=U(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(q(()=>{if(!t)return;const e=e=>{if(zn[zn.length-1]!==Rt)return;if(b(e.target,ot.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Jr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Jr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Jr,Rt]),!t||pn.current)return null;const Qr=Jt?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=ir(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(Rt):null,Zr=Jt&&Qr?Math.min(Qr.w/vn.w,Qr.h/vn.h):1,eo=(()=>{if(Jt&&Qr){const e=Zr,t=vn.w*e,n=vn.h*e,r=Qr.x+(Qr.w-t)/2-vn.x,o=Qr.y+(Qr.h-n)/2-vn.y,i=Qt||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:I.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(an&&Vt){const e="picked"===ln;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:I.expose+30}:{}}}return null})(),to=x({modal:!1,titleId:!V&&(Mn?!Be?.home:!we)?Re:void 0,label:dr.text||Ie}),no=/* @__PURE__ */ee("div",{children:[
50
50
  /* @__PURE__ */ee("div",{ref:ot,"data-modal-panel":!0,"data-modal-id":Rt,"data-window-key":ue||void 0,...O?{"data-utility":""}:{},...Oe?{"data-pinned-top":""}:{},...V?{"data-widget":""}:{},...Be?{"data-window-owner":Be.key}:{},...Be&&!vt?{"data-window-root":""}:{},...Mn?{"data-window-tab":""}:{},...to,className:Mn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(V?$t?"shadow-xl":"shadow-lg":"border "+($t?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(it.current=!1,Jt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),jr(Rt),Pr(!1),void er(Rt)}if(!$t&&!V&&!Oe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ot.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),it.current=!0,qe(null),er(Rt),window.addEventListener("mouseup",()=>{setTimeout(()=>{it.current=!1},0)},{once:!0}))}},onClickCapture:e=>{it.current&&(it.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Jt)return;qe(null);e.target.closest("[data-modal-panel]")===ot.current&&(e.target.closest("button, input, a, select, textarea")||er(Rt))},style:we?{zIndex:Wt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ve}px)`,transition:xe?"none":"transform 180ms ease-out",...V?{display:"none"}:{},...Wt<0?{display:"none"}:{},...$t||Oe||Ne&&ue===Ne?{}:{display:"none"}}:{zIndex:Oe?I.pinnedWindow:Wt+1,width:vn.w,height:vn.h,top:vn.y,...V&&"right"===tt?{right:window.innerWidth-vn.x-vn.w}:{left:vn.x},...Wt<0&&!Oe?{display:"none"}:{},...ge?{display:"none"}:{},...Wn||Fn?{visibility:"hidden",pointerEvents:"none"}:{},...eo??{}},children:[we&&!V&&/* @__PURE__ */te("div",{onPointerDown:Me,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),V?null:Mn?Be?.home?null:/* @__PURE__ */ee(ne,{children:[
51
51
  /* @__PURE__ */te("h2",{id:Re,"data-window-title":!0,className:"sr-only",children:dr.text||Ie}),_r&&Gr&&re(
52
52
  /* @__PURE__ */te(ne,{children:dr.actions}),Gr),dr.badges.length>0&&/* @__PURE__ */te("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:dr.badges})]}):we?null:
@@ -62,7 +62,7 @@ return ee("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u
62
62
  /* @__PURE__ */te("span",{id:Re,className:"truncate",children:Jt?tn(Te):Te})]}),!Jt&&/* @__PURE__ */ee("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[O&&/* @__PURE__ */te("button",{onClick:()=>je(e=>!e),title:Oe?Pe.unpin:Pe.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */te(D,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
63
63
  /* @__PURE__ */te("button",{onClick:()=>tr(Rt),title:Pe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!An&&/* @__PURE__ */te(vr,{maximized:Hn,onToggleMax:()=>{Hn?(Bn(!1),bn(mn())):Yr()},onSnap:qr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Pe}),
64
64
  /* @__PURE__ */te("button",{type:"button",onClick:br,"aria-label":Pe.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */te(D,{name:"close",className:"h-5 w-5"})})]})]}),he&&Xe&&!V&&!we&&/* @__PURE__ */te("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${$t?.9:.55})`}}),
65
- /* @__PURE__ */te(Gt.Provider,{value:Rt,children:/* @__PURE__ */te(cn.Provider,{value:{rightRef:st,leftRef:lt,notify:()=>ut(!0),active:$t,isDirty:ar,footerOpen:yt&&!V&&!Q&&!Z&&!we},children:/* @__PURE__ */te("div",{ref:at,...V?{onPointerDown:Rr,onContextMenu:e=>{e.preventDefault(),et({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${V?"p-0 cursor-move":Z||oe?"p-0":Q?"p-2":"p-4"} ${V||Mn?"":"backdrop-blur-sm"} ${!1===g||Z||oe?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${V?"rounded-2xl select-none":""}`,style:{...V?{touchAction:"none"}:{},backgroundColor:V?"transparent":Mn?"rgb(var(--window-content-rgb))":$t?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */te(Se,{children:me})})})}),V&&Ze&&/* @__PURE__ */ee(N,{minWidth:160,style:{left:Ze.x,top:Ze.y},onClose:()=>et(null),children:[
65
+ /* @__PURE__ */te(Gt.Provider,{value:Rt,children:/* @__PURE__ */te(cn.Provider,{value:{rightRef:st,leftRef:lt,notify:()=>ut(!0),active:$t,isDirty:ar,footerOpen:yt&&!V&&!Q&&!Z&&!we},children:/* @__PURE__ */te("div",{ref:at,...V?{onPointerDown:Rr,onContextMenu:e=>{e.preventDefault(),et({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${V?"p-0 cursor-move":Z||oe?"p-0":Q?"p-2":"p-4"} ${V||Mn?"":"backdrop-blur-sm"} ${!1===v||Z||oe?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${V?"rounded-2xl select-none":""}`,style:{...V?{touchAction:"none"}:{},backgroundColor:V?"transparent":Mn?"rgb(var(--window-content-rgb))":$t?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */te(Se,{children:me})})})}),V&&Ze&&/* @__PURE__ */ee(N,{minWidth:160,style:{left:Ze.x,top:Ze.y},onClose:()=>et(null),children:[
66
66
  /* @__PURE__ */te(S,{onClick:()=>{et(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Rt}))},children:"Settings"}),
67
67
  /* @__PURE__ */te(L,{}),le&&/* @__PURE__ */ee(ne,{children:[le,
68
68
  /* @__PURE__ */te(L,{})]}),
@@ -1,2 +1,2 @@
1
- import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-4FX5FZ4Z.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-235E63CP.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),j=a(),[A,S]=d(null),C=s(w);C.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),F=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!F.current&&D&&(F.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>L.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
- return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
1
+ import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-DDCMMOB4.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-37U326EL.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:D="",autoFocus:H=!0}){const L=s(null),j=a(),[A,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),T=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!T.current&&H&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,H]),m(()=>{if(H)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
+ return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:D,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
@@ -0,0 +1,2 @@
1
+ import{brandBox as t}from"./chunk-64ACCUNN.js";import{jsx as h}from"react/jsx-runtime";function c({size:c,width:e,height:i,style:r,...o}){const s=t(c??e??i??18,3.648);/* @__PURE__ */
2
+ return h("svg",{width:s.width,height:s.height,viewBox:"-0.2 8.656 24.4 6.688",fill:"currentColor","aria-hidden":"true",...o,style:{...s.style,...r},children:/* @__PURE__ */h("path",{d:"M13.05 9.8643c.9723.0736 1.7257.3671 2.3545.6843v-1.31s-1.2577-.3162-2.4408-.368c-4.1256-.1849-5.295 1.4344-5.295 3.1292 0 1.6947 1.1694 3.3145 5.295 3.1296 1.1831-.0536 2.4408-.3694 2.4408-.3694v-1.3086c-.6193.3081-1.3826.6107-2.3545.683-1.6793.1272-2.6898-.6907-2.6898-2.1342 0-1.4448 1.0105-2.2613 2.6898-2.1354m7.685 4.1223c-.0513.0105-.1581.02-.215.02h-1.8005V12.376H20.52c.0568 0 .1636.01.2149.02a.8056.8056 0 01.6325.7951c0 .4162-.2872.721-.6325.796zm-2.0155-4.0374h1.6325c.059 0 .1454.0077.1772.0137.3376.0572.6256.3307.6256.7392 0 .409-.288.6815-.626.7392a1.571 1.571 0 01-.1773.0137h-1.6311V9.9506zm3.4994 1.9856v-.0364c.9133-.1331 1.4149-.726 1.4149-1.4199 0-.8828-.7343-1.3916-1.7293-1.4416-.0772-.0032-.203-.011-.3044-.011h-5.3323v5.9467h5.7548c1.13 0 1.9774-.6043 1.9774-1.5466 0-.8701-.7724-1.4222-1.781-1.4917zm-17.8644.6788c0 .8787-.5906 1.5311-1.6656 1.5311-.917 0-1.8174-.2726-2.6889-.6938V14.76s1.4021.383 3.191.383c2.9714 0 3.8374-1.125 3.8374-2.529V9.0266H4.3541v3.5876Z"})})}export{c as BrandJcbIcon};
@@ -0,0 +1,3 @@
1
+ import{DropdownMenu as e}from"./chunk-A5BV6NFA.js";import{Button_default as i}from"./chunk-I4VIEGCX.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import{Tooltip as a}from"./chunk-6XBWM453.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:I,align:W="end",side:z="bottom",menuMinWidth:A,linkAs:F,block:M=!1,className:R=""},B){const L=g&&(null!=N&&""!==N&&!1!==N)&&!v,V=x&&null!=j&&""!==j&&!1!==j,$=o(),D=/* @__PURE__ */t(i,{ref:B,type:b,variant:f,size:p,loading:v,leftIcon:k,block:M,disabled:g&&!L,"aria-disabled":!!L||void 0,disabledReason:L?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),K=M?"relative flex min-w-0 flex-1":"relative inline-flex",O=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
2
+ return s("div",{className:[M?"flex w-full":"inline-flex","items-stretch",R].filter(Boolean).join(" "),children:[null==w||""===w||L?D:/* @__PURE__ */t(a,{content:w,className:K,children:D}),
3
+ /* @__PURE__ */t(a,{content:V?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":V?$:void 0,items:h,align:W,side:z,minWidth:A,linkAs:F,disabled:x&&!V,"aria-disabled":V,onOpenChange:y,footer:C,footerLabel:I,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:O,strokeWidth:2,"aria-hidden":"true"})})}),V&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
@@ -1,6 +1,6 @@
1
- import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-4YDCNWNU.js";import{Tooltip as i}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const R=l().widths,z=a(),A=m(Math.round(x)||1,1,n),B=e($,A),D=B??[...t[A]??[]],S=[...D,100-p(D)],E=P||M,K=s(null),O=s({onChange:k,shown:D,locked:E,n:A,stored:B});O.current={onChange:k,shown:D,locked:E,n:A,stored:B};const T=t=>{const{onChange:r,shown:n,locked:o,n:i}=O.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},W=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],T(i.slice(0,-1))&&(ne.current=null)},X=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=S[e]+S[e+1],i="ArrowRight"===t.key?S[e]+n:"ArrowLeft"===t.key?S[e]-n:"PageUp"===t.key?S[e]+10:"PageDown"===t.key?S[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),W(S,e,i))},H=s(null),[I,L]=c(null),U=()=>{H.current=null,L(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>U,[]);const F=e=>t=>{if(0!==t.button||E)return;t.preventDefault();const r=K.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:S,moved:!1,pointer:t.pointerId},L(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},G=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void U();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}W(t.from,t.i,t.from[t.i]+r/t.width*100)},q=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),U())},J=(e,t)=>{const{shown:n}=O.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return T(o.slice(0,-1))?o:null},[Q,V]=c(0);u(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=O.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=S.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,Q]);const le=R.hint(A,r),ae=S.slice(0,-1).map((e,t)=>p(S.slice(0,t+1)));/* @__PURE__ */
2
- return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":A>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-JGFY54A4.js";import{Tooltip as i}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const A=l().widths,R=a(),z=m(Math.round(x)||1,1,n),B=e($,z),S=B??[...t[z]??[]],D=[...S,100-p(S)],E=P||M,K=s(null),O=s({onChange:k,shown:S,locked:E,n:z,stored:B});O.current={onChange:k,shown:S,locked:E,n:z,stored:B};const T=t=>{const{onChange:r,shown:n,locked:o,n:i}=O.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},W=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],T(i.slice(0,-1))&&(ne.current=null)},X=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=D[e]+D[e+1],i="ArrowRight"===t.key?D[e]+n:"ArrowLeft"===t.key?D[e]-n:"PageUp"===t.key?D[e]+10:"PageDown"===t.key?D[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),W(D,e,i))},F=s(null),[G,H]=c(null),I=()=>{F.current=null,H(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>I,[]);const L=e=>t=>{if(0!==t.button||E)return;t.preventDefault();const r=K.current?.getBoundingClientRect().width??0;r<=0||(F.current={i:e,x:t.clientX,width:r,from:D,moved:!1,pointer:t.pointerId},H(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const t=F.current;if(!t)return;if(0===e.buttons)return void I();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}W(t.from,t.i,t.from[t.i]+r/t.width*100)},U=e=>{const t=F.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),I())},q=(e,t)=>{const{shown:n}=O.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return T(o.slice(0,-1))?o:null},[Q,V]=c(0);u(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=O.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=D.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,Q]);const le=A.hint(z,r),ae=D.slice(0,-1).map((e,t)=>p(D.slice(0,t+1)));/* @__PURE__ */
2
+ return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?R:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
3
3
  /* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
4
- /* @__PURE__ */f("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:S.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===A&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
- /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&S.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(S.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
- return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>Q>0&&Q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(A-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":R.column(t+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||J(t,e)},onRevert:e=>((e,t)=>{O.current.locked||null===t||oe(e,t)||J(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:O.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<A-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":S[t],"aria-valuemin":r,"aria-valuemax":S[t]+S[t+1]-r,"aria-valuetext":R.dividerValue(t+1,S[t],t+2,S[t+1]),"aria-disabled":E||void 0,onKeyDown:E?void 0:X(t),onPointerDown:F(t),onPointerMove:G,onPointerUp:q,onPointerCancel:q,onLostPointerCapture:()=>{H.current&&U()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(E?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(E?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${I===t?"w-1":y}`)})})})})]},t))]}),A>1&&/* @__PURE__ */f("span",{id:z,className:"sr-only",children:le})]})}export{x as WidthsBar};
4
+ /* @__PURE__ */f("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
+ /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&D.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(D.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
+ return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>Q>0&&Q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":A.column(t+1),"aria-describedby":R,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||q(t,e)},onRevert:e=>((e,t)=>{O.current.locked||null===t||oe(e,t)||q(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:O.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:A.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":A.divider(t+1,t+2),"aria-valuenow":D[t],"aria-valuemin":r,"aria-valuemax":D[t]+D[t+1]-r,"aria-valuetext":A.dividerValue(t+1,D[t],t+2,D[t+1]),"aria-disabled":E||void 0,onKeyDown:E?void 0:X(t),onPointerDown:L(t),onPointerMove:J,onPointerUp:U,onPointerCancel:U,onLostPointerCapture:()=>{F.current&&I()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(E?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(E?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${G===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:R,className:"sr-only",children:le})]})}export{x as WidthsBar};
@@ -0,0 +1,2 @@
1
+ import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
2
+ return c("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M8.25,5.25h7.5c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v9c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-7.5c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-9c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM9.75,12.75l2.68934,0l-0.21967,0.21967c-0.29289,0.29289 -0.29289,0.76777 0,1.06066c0.29289,0.29289 0.76777,0.29289 1.06066,0l1.5,-1.5c0.07191,-0.07191 0.12616,-0.15478 0.16276,-0.24324c0.03667,-0.08843 0.05691,-0.1854 0.05691,-0.28709c0,-0.10169 -0.02024,-0.19866 -0.05691,-0.28709c-0.0366,-0.08846 -0.09085,-0.17134 -0.16276,-0.24324l-1.5,-1.5c-0.29289,-0.29289 -0.76777,-0.29289 -1.06066,0c-0.29289,0.29289 -0.29289,0.76777 0,1.06066l0.21967,0.21967h-2.68934c-0.41421,0 -0.75,0.33579 -0.75,0.75c0,0.41421 0.33579,0.75 0.75,0.75zM8.25,3.75c0,-0.41421 0.33579,-0.75 0.75,-0.75h9c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v10.5c0,0.41421 -0.33579,0.75 -0.75,0.75c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-10.5c0.03274,-0.26098 -0.04274,-0.3534 -0.21967,-0.53033c-0.17693,-0.17693 -0.26935,-0.25241 -0.53033,-0.21967h-9c-0.41421,0 -0.75,-0.33579 -0.75,-0.75z"})})}export{e as HoverNextImageSolidIcon};
@@ -0,0 +1,2 @@
1
+ import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
2
+ return c("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M7.125,16.5c-1.18877,0 -2.40885,-0.54489 -3.18198,-1.31802c-0.77313,-0.77313 -1.31802,-1.99321 -1.31802,-3.18198c0,-1.18877 0.54489,-2.40885 1.31802,-3.18198c0.77313,-0.77313 1.99321,-1.31802 3.18198,-1.31802c1.85878,0 3.47002,1.3403 4.875,3.20428c1.40498,-1.86397 3.01622,-3.20428 4.875,-3.20428c1.18877,0 2.40885,0.54489 3.18198,1.31802c0.77313,0.77313 1.31802,1.99321 1.31802,3.18198c0,1.18877 -0.54489,2.40885 -1.31802,3.18198c-0.77313,0.77313 -1.99321,1.31802 -3.18198,1.31802c-1.85878,0 -3.47002,-1.3403 -4.875,-3.20428c-1.40498,1.86397 -3.01622,3.20428 -4.875,3.20428z"})})}export{e as LoopSolidIcon};
@@ -0,0 +1 @@
1
+ import{EMPTY_VALUE as e}from"./chunk-36BRD5J3.js";import{pad2 as t}from"./chunk-LF27WIN2.js";var r=[{key:"DD/MM/YYYY",example:"24/04/2026"},{key:"MM/DD/YYYY",example:"04/24/2026"},{key:"YYYY-MM-DD",example:"2026-04-24"},{key:"DD-MM-YYYY",example:"24-04-2026"},{key:"MM-DD-YYYY",example:"04-24-2026"},{key:"DD.MM.YYYY",example:"24.04.2026"},{key:"YYYY.MM.DD",example:"2026.04.24"},{key:"YYYY/MM/DD",example:"2026/04/24"},{key:"DD/MM/YY",example:"24/04/26"},{key:"MM/DD/YY",example:"04/24/26"},{key:"DD/MMM/YYYY",example:"24/Apr/2026"},{key:"DD/MMM/YY",example:"24/Apr/26"},{key:"DD MMM YYYY",example:"24 Apr 2026"},{key:"MMM DD, YYYY",example:"Apr 24, 2026"},{key:"DD MMMM YYYY",example:"24 April 2026"},{key:"MMMM DD, YYYY",example:"April 24, 2026"}],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"];function o(e){return n[parseInt(e,10)-1]??e}function Y(e){return a[parseInt(e,10)-1]??e}function u(){if("undefined"==typeof window)return"DD/MM/YYYY";try{return localStorage.getItem("user_date_format")||"DD/MM/YYYY"}catch{return"DD/MM/YYYY"}}function m(e){localStorage.setItem("user_date_format",e)}var c="user_timezone",M="auto";function i(){if("undefined"!=typeof window)try{const e=localStorage.getItem(c);return e&&e!==M?e:void 0}catch{return}}function D(e){e&&e!==M?localStorage.setItem(c,e):localStorage.removeItem(c)}function l(e){e&&localStorage.setItem(c,e)}var s={dateStyle:"medium"},y=/* @__PURE__ */new Map;function $(e,t){const r=`${e}|${JSON.stringify(t)}`;let n=y.get(r);return n||(n=new Intl.DateTimeFormat(e,{...t,timeZone:"UTC",calendar:"gregory"}),y.set(r,n)),n}var f=/* @__PURE__ */new Map;function h(e,t){const r=function(e){const t=e??"";let r=f.get(t);if(!r){const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",calendar:"gregory"};try{r=new Intl.DateTimeFormat("en-GB",{...n,timeZone:e})}catch{r=new Intl.DateTimeFormat("en-GB",n)}f.set(t,r)}return r}(t).formatToParts(e),n=e=>r.find(t=>t.type===e)?.value??"";return{y:n("year"),m:n("month"),d:n("day"),hh:n("hour"),mm:n("minute")}}var d=/^(\d{4})-(\d{1,2})-(\d{1,2})$/;function p(r,n){const a=function(e,r){if(!e)return null;const n=d.exec(e);if(n){const[e,r,a]=n.slice(1).map(Number);return r<1||r>12||a<1||a>31?null:{y:String(e),m:t(r),d:t(a)}}const a=new Date(e);return Number.isNaN(a.getTime())?null:h(a,r)}(r,n?.timeZone||i());return a?n?.locale?$(n.locale,n.style??s).format(new Date(Date.UTC(Number(a.y),Number(a.m)-1,Number(a.d)))):function(e,t,r){switch(u()){case"MM/DD/YYYY":return`${t}/${r}/${e}`;case"YYYY-MM-DD":return`${e}-${t}-${r}`;case"DD-MM-YYYY":return`${r}-${t}-${e}`;case"MM-DD-YYYY":return`${t}-${r}-${e}`;case"DD.MM.YYYY":return`${r}.${t}.${e}`;case"YYYY.MM.DD":return`${e}.${t}.${r}`;case"YYYY/MM/DD":return`${e}/${t}/${r}`;case"DD/MM/YY":return`${r}/${t}/${e.slice(-2)}`;case"MM/DD/YY":return`${t}/${r}/${e.slice(-2)}`;case"DD/MMM/YYYY":return`${r}/${o(t)}/${e}`;case"DD/MMM/YY":return`${r}/${o(t)}/${e.slice(-2)}`;case"DD MMM YYYY":return`${r} ${o(t)} ${e}`;case"MMM DD, YYYY":return`${o(t)} ${r}, ${e}`;case"DD MMMM YYYY":return`${r} ${Y(t)} ${e}`;case"MMMM DD, YYYY":return`${Y(t)} ${r}, ${e}`;default:return`${r}/${t}/${e}`}}(a.y,a.m,a.d):e}function g(t,r){if(!t||d.test(t))return e;const n=new Date(t);if(Number.isNaN(n.getTime()))return e;const a=r?.timeZone||i();if(r?.locale)return function(e,t,r){const n={hour:"numeric",minute:"2-digit"};try{return e.toLocaleTimeString(t,{...n,timeZone:r})}catch{return e.toLocaleTimeString(t,n)}}(n,r.locale,a);const{hh:o,mm:Y}=h(n,a);return function(e,t){const r=Number(e);return`${r%12||12}:${t} ${r<12?"am":"pm"}`}(o,Y)}function k(t,r){const n=g(t,r);return n===e?e:`${p(t,r)}, ${n}`}var w={months:a,monthsShort:n,weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthYear:(e,t)=>`${a[t]} ${e}`,shortMonthYear:(e,t)=>`${n[t]} ${e}`,longDate:(e,t,r)=>`${r} ${a[t]} ${e}`},S=/* @__PURE__ */new Map;function x(e){if(!e)return w;const t=S.get(e);if(t)return t;const r=t=>$(e,t),n=(e,t,r=1)=>new Date(Date.UTC(e,t,r)),a=r({month:"long"}),o=r({month:"short"}),Y=r({weekday:"long"}),u=r({weekday:"short"}),m=r({month:"long",year:"numeric"}),c=r({month:"short",year:"numeric"}),M=r({day:"numeric",month:"long",year:"numeric"}),i=Array.from({length:12},(e,t)=>t),D=Array.from({length:7},(e,t)=>t),l={months:i.map(e=>a.format(n(2e3,e))),monthsShort:i.map(e=>o.format(n(2e3,e))),weekdays:D.map(e=>Y.format(n(2e3,0,2+e))),weekdaysShort:D.map(e=>u.format(n(2e3,0,2+e))),monthYear:(e,t)=>m.format(n(e,t)),shortMonthYear:(e,t)=>c.format(n(e,t)),longDate:(e,t,r)=>M.format(n(e,t,r))};return S.set(e,l),l}var I=/* @__PURE__ */new Map;function N(e){if(!e)return 0;let t=I.get(e);if(void 0===t){t=0;try{const r=new Intl.Locale(e),n="function"==typeof r.getWeekInfo?r.getWeekInfo():r.weekInfo;1===n?.firstDay&&(t=1)}catch{}I.set(e,t)}return t}export{r as DATE_FORMAT_OPTIONS,M as TZ_AUTO,x as calendarNames,N as firstDayOfWeek,p as formatDate,k as formatDateTime,g as formatTime,u as getUserDateFormat,i as getUserTimezone,m as setUserDateFormat,D as setUserTimezone,l as syncTimezoneFromProfile};
@@ -1,9 +1,9 @@
1
- import{ImageFocusPoint as e}from"./chunk-VKKK4WLS.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Segmented as i}from"./chunk-3ELLBQPS.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-67JCJ2MG.js";import{TransferProgress as u}from"./chunk-UYRITNQW.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-6RX4PVBU.js";import{Icon as p}from"./chunk-KKSVRIMP.js";import{useShellStrings as b}from"./chunk-4PAWQEXM.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function L({value:L,onChange:w,onPick:R,onFile:U,label:C,hint:P,error:F,required:K,className:$,accept:z="image/*",maxSizeBytes:B,fit:O="cover",height:S=112,placeholder:W,cta:I,acceptHint:V,showFilename:q=!0,allowReplace:H=!0,allowRemove:M=!0,replaceLabel:Q,removeLabel:A,busy:E=!1,busyLabel:J,choosingLabel:X,pickFailedLabel:Y,progress:_,disabled:D=!1,kind:G,onKindChange:T,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=I??ie.cta,oe=G??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof A&&A?A:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=E||ne,me=ne&&!E?X??ie.choosing:J??ie.uploading,he=F??(se?Y??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&w(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=D||ue,ke=!!L&&(t(L,z)||L===ve),je=W??o(z,ie),xe=Q??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):U?U(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),w(a)})(e)},Le=m({accept:z,maxSizeBytes:B,acceptHint:V,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:we}=Le,Re=()=>{ye||(R?pe():Le.open())},Ue=L?r(L):"",Ce=!ke&&!!ee,Pe=D||!H&&!M?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[H&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-VKKK4WLS.js";import{Segmented as i}from"./chunk-3ELLBQPS.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-67JCJ2MG.js";import{TransferProgress as u}from"./chunk-UYRITNQW.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-6RX4PVBU.js";import{Icon as p}from"./chunk-KKSVRIMP.js";import{useShellStrings as b}from"./chunk-4PAWQEXM.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function L({value:L,onChange:w,onPick:R,onFile:U,label:C,hint:P,error:F,required:K,className:$,accept:z="image/*",maxSizeBytes:B,fit:O="cover",height:S=112,placeholder:W,cta:I,acceptHint:V,showFilename:q=!0,allowReplace:H=!0,allowRemove:M=!0,replaceLabel:Q,removeLabel:A,busy:E=!1,busyLabel:J,choosingLabel:X,pickFailedLabel:Y,progress:_,disabled:D=!1,kind:G,onKindChange:T,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=I??ie.cta,oe=G??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof A&&A?A:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=E||ne,me=ne&&!E?X??ie.choosing:J??ie.uploading,he=F??(se?Y??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&w(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=D||ue,ke=!!L&&(t(L,z)||L===ve),je=W??o(z,ie),xe=Q??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):U?U(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),w(a)})(e)},Le=m({accept:z,maxSizeBytes:B,acceptHint:V,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:we}=Le,Re=()=>{ye||(R?pe():Le.open())},Ue=L?r(L):"",Ce=!ke&&!!ee,Pe=D||!H&&!M?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[H&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
2
  /* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),M&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),w("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Fe=/* @__PURE__ */k("div",{...Le.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",we?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:S},children:[Ce?
4
- /* @__PURE__ */j(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:L,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:L??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:O}}):/* @__PURE__ */j("img",{src:L??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:O,objectPosition:Z||void 0}}),q&&L&&/* @__PURE__ */j(n,{children:Ue}),Pe,ue&&/* @__PURE__ */j(l,{label:me,progress:_,rounded:"rounded-md"})]}),Ke=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":K||void 0,"aria-describedby":he?`${be}-error`:P?`${be}-hint`:void 0,...Le.zoneProps,className:c(we,ye,d(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:_}):/* @__PURE__ */k(x,{children:[
4
+ /* @__PURE__ */j(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:L,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:L??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:O}}):/* @__PURE__ */j("img",{src:L??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:O,objectPosition:Z||void 0}}),q&&L&&/* @__PURE__ */j(n,{children:Ue}),Pe,ue&&/* @__PURE__ */j(l,{label:me,progress:_,rounded:"rounded-md"})]}),Ke=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":K||void 0,"aria-describedby":he?`${be}-error`:P?`${be}-hint`:void 0,...Le.zoneProps,className:c(we,ye,d(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:_}):/* @__PURE__ */k(x,{children:[
5
5
  /* @__PURE__ */j("span",{className:"text-ink-faintest",children:/* @__PURE__ */j(s,{})}),
6
6
  /* @__PURE__ */j("span",{className:"px-3 text-xs text-ink-faint",children:je}),
7
7
  /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),V&&/* @__PURE__ */j("span",{className:"text-xs text-ink-faintest",children:V})]})});/* @__PURE__ */
8
- return k(a,{label:C,htmlFor:be,hint:P,error:he,required:K,className:$,children:[T&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>T(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),L?Fe:Ke,!R&&/* @__PURE__ */j("input",{...Le.inputProps}),
8
+ return k(e,{label:C,htmlFor:be,hint:P,error:he,required:K,className:$,children:[T&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>T(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),L?Fe:Ke,!R&&/* @__PURE__ */j("input",{...Le.inputProps}),
9
9
  /* @__PURE__ */j(h,{rejections:Le.rejections})]})}export{L as MediaUploadField};
@@ -0,0 +1,5 @@
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...i}){/* @__PURE__ */
2
+ return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:[
3
+ /* @__PURE__ */e("path",{d:"M8.25 6h7.5a1.5 1.5 0 0 1 1.5 1.5v9a1.5 1.5 0 0 1 -1.5 1.5h-7.5a1.5 1.5 0 0 1 -1.5 -1.5v-9a1.5 1.5 0 0 1 1.5 -1.5Z"}),
4
+ /* @__PURE__ */e("path",{d:"M18.75 4.5l2.25-2.25M18.75 2.25H21v2.25"}),
5
+ /* @__PURE__ */e("path",{d:"M5.25 19.5l-2.25 2.25M3 19.5v2.25h2.25"})]})}export{t as HoverZoomIcon};
@@ -0,0 +1,2 @@
1
+ import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
2
+ return c("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M5.9375,13.875c-1.01618,0 -2.08001,-0.47493 -2.74004,-1.13496c-0.66003,-0.66003 -1.13496,-1.72386 -1.13496,-2.74004c0,-1.01618 0.47493,-2.08001 1.13496,-2.74004c0.66003,-0.66003 1.72386,-1.13496 2.74004,-1.13496c1.54354,0 2.89761,1.08901 4.0625,2.59148c1.16489,-1.50247 2.51896,-2.59148 4.0625,-2.59148c1.01618,0 2.08001,0.47493 2.74004,1.13496c0.66003,0.66003 1.13496,1.72386 1.13496,2.74004c0,1.01618 -0.47493,2.08001 -1.13496,2.74004c-0.66003,0.66003 -1.72386,1.13496 -2.74004,1.13496c-1.54354,0 -2.89761,-1.08901 -4.0625,-2.59148c-1.16489,1.50247 -2.51896,2.59148 -4.0625,2.59148z"})})}export{e as LoopMiniIcon};
@@ -0,0 +1,5 @@
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...i}){/* @__PURE__ */
2
+ return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:[
3
+ /* @__PURE__ */e("path",{d:"M8.25 6h7.5a1.5 1.5 0 0 1 1.5 1.5v9a1.5 1.5 0 0 1 -1.5 1.5h-7.5a1.5 1.5 0 0 1 -1.5 -1.5v-9a1.5 1.5 0 0 1 1.5 -1.5Z"}),
4
+ /* @__PURE__ */e("path",{d:"M12 15V9M9.75 11.25 12 9l2.25 2.25"}),
5
+ /* @__PURE__ */e("path",{d:"M9 21h6"})]})}export{t as HoverLiftIcon};