efficient-shell 12.28.0 → 12.32.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 (335) hide show
  1. package/README.md +81 -1
  2. package/dist/{Browser-PC45PVTN.js → Browser-36SDGA64.js} +16 -16
  3. package/dist/Calculator-GDHNFSB6.js +29 -0
  4. package/dist/{CurrencyConverter-BB4QWNER.js → CurrencyConverter-PXCCCUS2.js} +9 -9
  5. package/dist/Files-NVUIAUO5.js +141 -0
  6. package/dist/{Notepad-BLUA2254.js → Notepad-QA2CD6GC.js} +8 -8
  7. package/dist/PdfViewer-627HEAIL.js +1 -0
  8. package/dist/{PomodoroTimer-KIJKDHVO.js → PomodoroTimer-HD2ZNOUV.js} +68 -68
  9. package/dist/{Preview-JVL2N5GN.js → Preview-FW2KT6FQ.js} +29 -29
  10. package/dist/Sidebar-QNJNEBT2.js +44 -0
  11. package/dist/{Stock-JQEJMIMG.js → Stock-EDZSOJAQ.js} +3 -3
  12. package/dist/{Weather-FAQX55XL.js → Weather-OTVZZEE7.js} +18 -18
  13. package/dist/{WorldClock-YSZNGEL2.js → WorldClock-PDKFE5S7.js} +6 -6
  14. package/dist/ai/index.js +111 -111
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChartBrush.js +1 -1
  24. package/dist/charts/ChartFrame.js +1 -1
  25. package/dist/charts/ChartSkeleton.js +1 -1
  26. package/dist/charts/ChordChart.js +1 -1
  27. package/dist/charts/ColumnChart.js +1 -1
  28. package/dist/charts/FunnelChart.js +1 -1
  29. package/dist/charts/HeatmapChart.js +1 -1
  30. package/dist/charts/HistogramChart.js +1 -1
  31. package/dist/charts/Meter.js +1 -1
  32. package/dist/charts/PieChart.js +1 -1
  33. package/dist/charts/RadarChart.js +1 -1
  34. package/dist/charts/RadialBarChart.js +1 -1
  35. package/dist/charts/RangeChart.js +1 -1
  36. package/dist/charts/RankedBars.js +1 -1
  37. package/dist/charts/SankeyChart.js +1 -1
  38. package/dist/charts/ScatterChart.js +1 -1
  39. package/dist/charts/SpecChart.js +1 -1
  40. package/dist/charts/StatTile.js +1 -1
  41. package/dist/charts/SunburstChart.js +1 -1
  42. package/dist/charts/TimeSeriesChart.js +1 -1
  43. package/dist/charts/TreemapChart.js +1 -1
  44. package/dist/charts/WaterfallChart.js +1 -1
  45. package/dist/{chunk-TKIYZE7V.js → chunk-246K337V.js} +1 -1
  46. package/dist/{chunk-TGLUENXE.js → chunk-25M4CAB3.js} +1 -1
  47. package/dist/{chunk-VBLCYL4L.js → chunk-26Y66IXU.js} +2 -2
  48. package/dist/chunk-2PNG5UR6.js +22 -0
  49. package/dist/chunk-3ECUHYHI.js +28 -0
  50. package/dist/{chunk-ZGWXSHVM.js → chunk-3MAGUYG2.js} +1 -1
  51. package/dist/{chunk-4PIQG2ZK.js → chunk-3TR6C5V4.js} +1 -1
  52. package/dist/{chunk-NOGSS432.js → chunk-3UMS74TZ.js} +1 -1
  53. package/dist/{chunk-GC4N4UQM.js → chunk-4U2OUX65.js} +5 -5
  54. package/dist/{chunk-MKNDDB6U.js → chunk-4XN6ACGV.js} +1 -1
  55. package/dist/{chunk-232YPI2L.js → chunk-555KW6TM.js} +4 -4
  56. package/dist/{chunk-6KOMF6WL.js → chunk-5OJFYNEZ.js} +1 -1
  57. package/dist/{chunk-SE6IQZYW.js → chunk-5R3NDBCD.js} +9 -9
  58. package/dist/{chunk-RBS3AWE7.js → chunk-5XHJ3H6Y.js} +4 -4
  59. package/dist/{chunk-XHSMDUEW.js → chunk-5XOF3O4B.js} +3 -3
  60. package/dist/{chunk-N2445WHJ.js → chunk-6AAGZ34A.js} +9 -9
  61. package/dist/{chunk-CON5NRCO.js → chunk-6MA7VXZR.js} +2 -2
  62. package/dist/{chunk-VLBIM33E.js → chunk-6ZTVZIPI.js} +6 -6
  63. package/dist/chunk-7CHEHWGL.js +9 -0
  64. package/dist/{chunk-XAEI36TW.js → chunk-7IRO4JAA.js} +1 -1
  65. package/dist/{chunk-JFGJJNT2.js → chunk-7JR2O3IX.js} +6 -6
  66. package/dist/{chunk-7TNZ3DTT.js → chunk-A6YUCAGF.js} +2 -2
  67. package/dist/{chunk-HSUTZCRT.js → chunk-A7JAHN75.js} +1 -1
  68. package/dist/chunk-ADNUV6OV.js +8 -0
  69. package/dist/chunk-AFLG5E4O.js +7 -0
  70. package/dist/{chunk-7K3FYCRZ.js → chunk-AFVI75RH.js} +9 -9
  71. package/dist/{chunk-WN3JHPJI.js → chunk-AGNHOSES.js} +6 -6
  72. package/dist/{chunk-63IGYBCQ.js → chunk-AJ2EEWZT.js} +2 -2
  73. package/dist/chunk-AWY2ZOXT.js +14 -0
  74. package/dist/{chunk-Y7KDCC6E.js → chunk-B7UT3W4C.js} +1 -1
  75. package/dist/chunk-BEN2LJWQ.js +5 -0
  76. package/dist/{chunk-QADNVFV5.js → chunk-BIBQAEHV.js} +1 -1
  77. package/dist/{chunk-AMIMNRYU.js → chunk-BLC6HAU3.js} +1 -1
  78. package/dist/{chunk-ZBJ7FTA5.js → chunk-BXPEEPYH.js} +1 -1
  79. package/dist/{chunk-CBVKGAZH.js → chunk-CAIUI3DC.js} +1 -1
  80. package/dist/{chunk-XSVQ5V7L.js → chunk-CHRK5R3Y.js} +9 -9
  81. package/dist/{chunk-7GJIIBJD.js → chunk-COF2CF5R.js} +1 -1
  82. package/dist/{chunk-ZGCCV4WE.js → chunk-CYTK7DCA.js} +6 -6
  83. package/dist/{chunk-HNEI2RKX.js → chunk-DGFC5BX4.js} +1 -1
  84. package/dist/{chunk-NUPK6CUV.js → chunk-DHLXSL3Y.js} +1 -1
  85. package/dist/{chunk-GEVNBBM7.js → chunk-DRIO2Y4R.js} +4 -4
  86. package/dist/{chunk-EEB5XPWP.js → chunk-DWGMTMDU.js} +1 -1
  87. package/dist/{chunk-XKNKRKHH.js → chunk-E6GGE7E5.js} +15 -15
  88. package/dist/{chunk-LAO6GLBY.js → chunk-FE6J5S5X.js} +6 -6
  89. package/dist/chunk-FKJPBQ6I.js +7 -0
  90. package/dist/{chunk-V3XS6BTJ.js → chunk-FXS2P23Q.js} +12 -12
  91. package/dist/chunk-G3NE4SGZ.js +11 -0
  92. package/dist/{chunk-WNOXHJVT.js → chunk-GX4CDXPK.js} +7 -7
  93. package/dist/chunk-H74VN7OI.js +2 -0
  94. package/dist/chunk-H7WMOY62.js +1 -0
  95. package/dist/{chunk-WPG3ZHYT.js → chunk-HGGDOMBV.js} +1 -1
  96. package/dist/{chunk-DIHHV6T6.js → chunk-HWV6UDFC.js} +1 -1
  97. package/dist/{chunk-HVYXJLAV.js → chunk-IBLRSK7V.js} +1 -1
  98. package/dist/{chunk-TDXRG43I.js → chunk-IE5XWHDU.js} +1 -1
  99. package/dist/chunk-IESNUXYH.js +1 -0
  100. package/dist/chunk-IYM5N7FH.js +4 -0
  101. package/dist/{chunk-KAKJ7ENS.js → chunk-J44SUUOG.js} +2 -2
  102. package/dist/chunk-JI55MXP4.js +12 -0
  103. package/dist/{chunk-X5MUSNKH.js → chunk-JIBU7YY4.js} +2 -2
  104. package/dist/{chunk-CMJD5URC.js → chunk-JLQ7N54N.js} +20 -20
  105. package/dist/chunk-JROPOGQP.js +2 -0
  106. package/dist/{chunk-N5RV73CI.js → chunk-JTJDXCJU.js} +4 -4
  107. package/dist/{chunk-SS3CROPR.js → chunk-JYVHFRKK.js} +5 -5
  108. package/dist/{chunk-56XCGOX5.js → chunk-JZ4V3RHK.js} +4 -4
  109. package/dist/{chunk-YO26RV3H.js → chunk-K4BM6PPZ.js} +1 -1
  110. package/dist/{chunk-DGHSCKOE.js → chunk-K4RY57UX.js} +4 -4
  111. package/dist/{chunk-FJVZ2W55.js → chunk-K73KBA5C.js} +4 -4
  112. package/dist/{chunk-V4XR4MOS.js → chunk-KDG7NWYX.js} +1 -1
  113. package/dist/{chunk-3YBXA72C.js → chunk-KFNQVNND.js} +1 -1
  114. package/dist/{chunk-24Y5JHIR.js → chunk-KTKFCR6T.js} +1 -1
  115. package/dist/chunk-L6XEON5Q.js +1 -0
  116. package/dist/{chunk-BT2YPDQL.js → chunk-LNXYVWEF.js} +3 -3
  117. package/dist/{chunk-574SLTKO.js → chunk-LOJAJARD.js} +8 -8
  118. package/dist/{chunk-JLRF6FN7.js → chunk-LOMNX5VH.js} +1 -1
  119. package/dist/{chunk-RZ2DWX4N.js → chunk-LQC5U5YT.js} +4 -4
  120. package/dist/chunk-LUAA4LKY.js +19 -0
  121. package/dist/{chunk-LL4KF43W.js → chunk-M2TQQKJO.js} +1 -1
  122. package/dist/chunk-M3D5FW5R.js +6 -0
  123. package/dist/{chunk-OXRQIWRT.js → chunk-M3FBPZ4G.js} +1 -1
  124. package/dist/{chunk-RVVQDBV7.js → chunk-MMSQZKJY.js} +5 -5
  125. package/dist/{chunk-4LOHQ4QB.js → chunk-NDGPJKE3.js} +5 -5
  126. package/dist/chunk-NMWV6BOL.js +8 -0
  127. package/dist/{chunk-O4YKOS74.js → chunk-NQ43KRRX.js} +9 -9
  128. package/dist/{chunk-SR4W2SYQ.js → chunk-NQA267J3.js} +8 -8
  129. package/dist/{chunk-75H4BWNC.js → chunk-NZ74N2IQ.js} +1 -1
  130. package/dist/{chunk-YYGJJ6EI.js → chunk-OA55OBDP.js} +1 -1
  131. package/dist/{chunk-47UH3D4B.js → chunk-OL2XKAX2.js} +1 -1
  132. package/dist/{chunk-WX2Q76WC.js → chunk-OQGCQQ7H.js} +6 -6
  133. package/dist/{chunk-OMFYTCBI.js → chunk-OU3J5TOO.js} +1 -1
  134. package/dist/{chunk-VFHKD7TQ.js → chunk-OWFJRER6.js} +1 -1
  135. package/dist/{chunk-MTYEY7HT.js → chunk-PK5KDLIG.js} +13 -13
  136. package/dist/chunk-PPVZMIBL.js +4 -0
  137. package/dist/{chunk-UEFIUTOU.js → chunk-PR5CON2G.js} +1 -1
  138. package/dist/chunk-PTEKHRNX.js +26 -0
  139. package/dist/{chunk-Z66QBDNU.js → chunk-PUXSFLWR.js} +1 -1
  140. package/dist/{chunk-VEQ45GAH.js → chunk-Q2LKH6RN.js} +1 -1
  141. package/dist/{chunk-NN32QUCE.js → chunk-Q2T5DRIK.js} +1 -1
  142. package/dist/{chunk-2DYVVHZA.js → chunk-QB4LAGMN.js} +1 -1
  143. package/dist/{chunk-GUHCKMC7.js → chunk-QBQMMOP6.js} +2 -2
  144. package/dist/{chunk-LIWBCIRZ.js → chunk-QJ6HVBAA.js} +5 -5
  145. package/dist/{chunk-W2663E4S.js → chunk-QPSKEDR7.js} +3 -3
  146. package/dist/{chunk-BKYRHQK2.js → chunk-QTWHMCCX.js} +11 -11
  147. package/dist/{chunk-MWTCGJAI.js → chunk-QUN3RSMN.js} +1 -1
  148. package/dist/{chunk-3FBXJO77.js → chunk-QXLYU5FR.js} +1 -1
  149. package/dist/{chunk-HLE4LTRU.js → chunk-QXTCEUFC.js} +1 -1
  150. package/dist/{chunk-7ZJRBFHA.js → chunk-QYKWVZ3R.js} +1 -1
  151. package/dist/{chunk-ATZ262BR.js → chunk-R3W6LZBG.js} +1 -1
  152. package/dist/{chunk-AFWLCXQD.js → chunk-R3ZEDJDZ.js} +7 -7
  153. package/dist/{chunk-DG2TGWXI.js → chunk-RIULA2CH.js} +11 -11
  154. package/dist/{chunk-2OUAPOLK.js → chunk-RLFZRIO4.js} +1 -1
  155. package/dist/{chunk-TU2L7NW3.js → chunk-RPSNYIDY.js} +5 -5
  156. package/dist/{chunk-WXZZGHET.js → chunk-RSRTE7RG.js} +1 -1
  157. package/dist/{chunk-EATV7FMU.js → chunk-S54Z2JAZ.js} +8 -8
  158. package/dist/{chunk-H2CPT6K3.js → chunk-T5UMQZ5X.js} +12 -12
  159. package/dist/{chunk-IB3LLQZC.js → chunk-TBXFRW3E.js} +1 -1
  160. package/dist/{chunk-JZBLOIL7.js → chunk-UJ23EKXU.js} +1 -1
  161. package/dist/{chunk-VLKJN6HX.js → chunk-V2OE6OTK.js} +13 -13
  162. package/dist/{chunk-EWVE5XG6.js → chunk-V7BHDLP2.js} +1 -1
  163. package/dist/{chunk-6Q7L32LL.js → chunk-VERSP62V.js} +1 -1
  164. package/dist/{chunk-QB2GJNGB.js → chunk-VI54L75G.js} +8 -8
  165. package/dist/{chunk-TYQ2JL4J.js → chunk-VTDW5GLS.js} +1 -1
  166. package/dist/chunk-VVI4Y6XA.js +23 -0
  167. package/dist/{chunk-BC4FE77W.js → chunk-VW3ZUWW2.js} +62 -62
  168. package/dist/{chunk-74JMBOQH.js → chunk-WJTZE3PL.js} +27 -27
  169. package/dist/chunk-WW5AXVBX.js +2 -0
  170. package/dist/{chunk-RF3ZFTAU.js → chunk-X4IFSC57.js} +1 -1
  171. package/dist/{chunk-OOWPLQD5.js → chunk-X6AMAYXV.js} +2 -2
  172. package/dist/{chunk-XAF5ZI7H.js → chunk-XBC7CBVJ.js} +1 -1
  173. package/dist/{chunk-T7D73HT7.js → chunk-XFC7AWPW.js} +10 -10
  174. package/dist/{chunk-4BKJ6A5H.js → chunk-XKBCF6SK.js} +10 -10
  175. package/dist/chunk-XOQH6VSU.js +14 -0
  176. package/dist/{chunk-4IHYWLWE.js → chunk-XOXTMWV3.js} +2 -2
  177. package/dist/{chunk-OM6VWUAZ.js → chunk-XR7SPONC.js} +1 -1
  178. package/dist/{chunk-UH5ZGWSA.js → chunk-Y7XX6Z3M.js} +7 -7
  179. package/dist/chunk-YELYAGCX.js +13 -0
  180. package/dist/{chunk-DJXXY23A.js → chunk-YG6ONZIB.js} +2 -2
  181. package/dist/{chunk-CEIIQRK5.js → chunk-ZFQI3EVU.js} +5 -5
  182. package/dist/{chunk-VP2GI3UP.js → chunk-ZGY2OK7Q.js} +8 -8
  183. package/dist/{chunk-YWNHK6Z5.js → chunk-ZHVWK5NL.js} +17 -17
  184. package/dist/{chunk-34L5SRM7.js → chunk-ZP3UAWJL.js} +18 -18
  185. package/dist/data/DataTable.js +1 -1
  186. package/dist/data/EntityList.js +1 -1
  187. package/dist/data/Gantt.d.ts +107 -0
  188. package/dist/data/Gantt.js +2 -0
  189. package/dist/data/Kanban.js +1 -1
  190. package/dist/data/ListFooter.js +1 -1
  191. package/dist/data/ListLoadError.js +1 -1
  192. package/dist/data/Pagination.js +1 -1
  193. package/dist/data/ResizableTable.js +1 -1
  194. package/dist/file-intake/index.js +1 -1
  195. package/dist/forms/BorderInput.js +1 -1
  196. package/dist/forms/BrandAssetEditor.js +1 -1
  197. package/dist/forms/Calendar.js +1 -1
  198. package/dist/forms/ColorPicker.js +1 -1
  199. package/dist/forms/ComposerAttachments.js +1 -1
  200. package/dist/forms/CornersInput.js +1 -1
  201. package/dist/forms/DatePicker.js +1 -1
  202. package/dist/forms/DateRangePicker.js +1 -1
  203. package/dist/forms/DateTimePicker.js +1 -1
  204. package/dist/forms/DisplayChips.js +1 -1
  205. package/dist/forms/FilePicker.js +1 -1
  206. package/dist/forms/FormErrorSummary.js +1 -1
  207. package/dist/forms/IconPicker.js +1 -1
  208. package/dist/forms/ImageFocusPoint.js +1 -1
  209. package/dist/forms/InputNumber.js +1 -1
  210. package/dist/forms/LinkPicker.js +1 -1
  211. package/dist/forms/MediaLibrary.js +1 -1
  212. package/dist/forms/MediaUploadField.js +1 -1
  213. package/dist/forms/MediaUploadGrid.js +1 -1
  214. package/dist/forms/MediaUsedInList.js +1 -1
  215. package/dist/forms/NumericKeypad.js +1 -1
  216. package/dist/forms/PictureTiles.d.ts +14 -2
  217. package/dist/forms/PictureTiles.js +1 -1
  218. package/dist/forms/PositionInput.js +1 -1
  219. package/dist/forms/Select.js +1 -1
  220. package/dist/forms/SidesInput.d.ts +13 -2
  221. package/dist/forms/SidesInput.js +1 -1
  222. package/dist/forms/Slider.js +1 -1
  223. package/dist/forms/Snippet.js +1 -1
  224. package/dist/forms/TagInput.js +1 -1
  225. package/dist/forms/TextToolbar.js +1 -1
  226. package/dist/forms/TimePicker.js +1 -1
  227. package/dist/forms/WidthsBar.js +1 -1
  228. package/dist/forms/mediaLibraryMenu.js +1 -1
  229. package/dist/forms/mediaMoveItems.js +1 -1
  230. package/dist/forms/textAlign.js +1 -1
  231. package/dist/forms/useFileIntake.js +1 -1
  232. package/dist/icons/efficient-glyphs.js +1 -1
  233. package/dist/icons/efficient-looks.js +1 -1
  234. package/dist/icons/efficient.js +1 -1
  235. package/dist/icons/looks/map.js +1 -1
  236. package/dist/icons/payment.js +1 -1
  237. package/dist/icons/sets.js +1 -1
  238. package/dist/index.d.ts +3 -2
  239. package/dist/index.js +665 -665
  240. package/dist/locales/zh-Hans.js +1 -1
  241. package/dist/map/index.js +4 -4
  242. package/dist/model-viewer/index.d.ts +123 -0
  243. package/dist/model-viewer/index.js +7 -0
  244. package/dist/page-tabs/index.js +5 -5
  245. package/dist/pdf/index.js +1 -1
  246. package/dist/shell/Accordion.js +1 -1
  247. package/dist/shell/AppUpdateBanner.js +1 -1
  248. package/dist/shell/Avatar.js +1 -1
  249. package/dist/shell/Banner.js +1 -1
  250. package/dist/shell/Breadcrumbs.js +1 -1
  251. package/dist/shell/BudgetBar.js +1 -1
  252. package/dist/shell/Card.js +1 -1
  253. package/dist/shell/ColoredBadge.js +1 -1
  254. package/dist/shell/ConfirmDialog.js +1 -1
  255. package/dist/shell/ContainerFillChart.js +1 -1
  256. package/dist/shell/CountBadge.js +1 -1
  257. package/dist/shell/Dialog.js +1 -1
  258. package/dist/shell/Drawer.js +1 -1
  259. package/dist/shell/EditableGrid.js +1 -1
  260. package/dist/shell/EmptyState.js +1 -1
  261. package/dist/shell/GlobalSearch.js +1 -1
  262. package/dist/shell/HelpCenter.js +1 -1
  263. package/dist/shell/IconRail.js +1 -1
  264. package/dist/shell/ImageLightbox.js +1 -1
  265. package/dist/shell/ItemCount.js +1 -1
  266. package/dist/shell/LanguageSelect.js +1 -1
  267. package/dist/shell/Markdown.js +1 -1
  268. package/dist/shell/MetricBar.js +1 -1
  269. package/dist/shell/MetricBarLegend.js +1 -1
  270. package/dist/shell/MilestoneTimeline.js +1 -1
  271. package/dist/shell/PageHeader.js +1 -1
  272. package/dist/shell/ProductionTimeline.js +1 -1
  273. package/dist/shell/ResizeHandle.js +1 -1
  274. package/dist/shell/Result.js +1 -1
  275. package/dist/shell/SearchableSelect.js +1 -1
  276. package/dist/shell/SettingReset.js +1 -1
  277. package/dist/shell/SettingRow.js +1 -1
  278. package/dist/shell/SidebarLayout.js +1 -1
  279. package/dist/shell/SidebarNav.js +1 -1
  280. package/dist/shell/SortableList.js +1 -1
  281. package/dist/shell/Statistic.js +1 -1
  282. package/dist/shell/TimeAgo.js +1 -1
  283. package/dist/shell/TimelineTrack.js +1 -1
  284. package/dist/shell/TransferProgress.js +1 -1
  285. package/dist/shell/Tree.js +1 -1
  286. package/dist/shell/discardGuard.js +1 -1
  287. package/dist/shell/language.js +1 -1
  288. package/dist/shell/strings.d.ts +32 -0
  289. package/dist/shell/strings.js +1 -1
  290. package/dist/shell/toast.js +1 -1
  291. package/dist/telemetry/index.js +1 -1
  292. package/dist/templates/AuthScreen.js +1 -1
  293. package/dist/templates/ChatTemplate.js +1 -1
  294. package/dist/templates/CheckoutTemplate.js +1 -1
  295. package/dist/templates/DashboardTemplate.js +1 -1
  296. package/dist/templates/DataTablePage.js +1 -1
  297. package/dist/templates/EmailTemplate.js +1 -1
  298. package/dist/templates/ErrorBoundary.js +1 -1
  299. package/dist/templates/ErrorPage.js +1 -1
  300. package/dist/templates/FormLayoutPage.js +1 -1
  301. package/dist/templates/GalleryTemplate.js +1 -1
  302. package/dist/ui/index.d.ts +3 -2
  303. package/dist/ui/index.js +1 -1
  304. package/dist/ui.css +35 -0
  305. package/dist/version.js +1 -1
  306. package/package.json +12 -1
  307. package/dist/Calculator-5TRNFPY4.js +0 -29
  308. package/dist/Files-BKEREVQK.js +0 -141
  309. package/dist/PdfViewer-4YLDY4JY.js +0 -1
  310. package/dist/Sidebar-SAGLPIOC.js +0 -44
  311. package/dist/chunk-2SGOKMUU.js +0 -13
  312. package/dist/chunk-4Y33Y4OX.js +0 -8
  313. package/dist/chunk-64J7TYJ3.js +0 -4
  314. package/dist/chunk-A4PFVMQ2.js +0 -7
  315. package/dist/chunk-BFRGDRFK.js +0 -23
  316. package/dist/chunk-BHHFVIAD.js +0 -2
  317. package/dist/chunk-DRMIQ3YE.js +0 -1
  318. package/dist/chunk-ENFXDIIZ.js +0 -8
  319. package/dist/chunk-FFUTSMF5.js +0 -28
  320. package/dist/chunk-FI6IJTAJ.js +0 -14
  321. package/dist/chunk-FVKXDF2Q.js +0 -12
  322. package/dist/chunk-GCTJIZTJ.js +0 -2
  323. package/dist/chunk-IATKDC52.js +0 -9
  324. package/dist/chunk-JJ2OXUK7.js +0 -14
  325. package/dist/chunk-JSHMIMAJ.js +0 -1
  326. package/dist/chunk-K5PDLRYH.js +0 -11
  327. package/dist/chunk-S6AN76R3.js +0 -4
  328. package/dist/chunk-UFM4YBZ7.js +0 -1
  329. package/dist/chunk-VDYF3WPJ.js +0 -2
  330. package/dist/chunk-WKYNPGFB.js +0 -7
  331. package/dist/chunk-XMY2HKVD.js +0 -19
  332. package/dist/chunk-XQWHKXLS.js +0 -22
  333. package/dist/chunk-Y4FWTYZS.js +0 -6
  334. package/dist/chunk-YX2OOGV7.js +0 -4
  335. /package/dist/{chunk-GMHMWDXU.js → chunk-KH3253OM.js} +0 -0
@@ -1,9 +1,9 @@
1
- import{Calendar as e}from"./chunk-BKYRHQK2.js";import{fromDateKey as t,toDateKey as r}from"./chunk-2HMNOLKX.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{calendarNames as i}from"./chunk-Y3JW2GW5.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as b}from"./chunk-JSHMIMAJ.js";import{forwardRef as f,useState as p,useRef as h,useId as v,useEffect as g}from"react";import{createPortal as y}from"react-dom";import{jsx as x,jsxs as N}from"react/jsx-runtime";var k=/^\d{4}-\d{2}-\d{2}$/,j=/^(aria|data)-/,w=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function D(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":r(e);if(k.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":r(t)}function S(e,r){const a=t(e);return a?r.longDate(a.getFullYear(),a.getMonth(),a.getDate()):""}var B=f(function({value:f,onChange:k,min:B,max:F,invalid:W,size:C,native:I,weekStartsOn:J,className:O="","aria-label":Y,"aria-describedby":$,"aria-labelledby":q,id:E,name:L,disabled:M,placeholder:z,required:H,clearable:T,form:U,title:G,tabIndex:K,autoFocus:P,onFocus:R,onBlur:A,...Q},V){const X=T??!H,Z=D(f),_=D(B),ee=D(F),te=m().datePicker,re=b(),ae=i(re),[ne,ie]=p(!1),oe=h(null),le=h(null),se=h(null),de=v(),ue=v(),ce=v(),me=d(le,ne,{popupRef:se}),[be,fe]=p(!1);u(()=>{const e=!!E&&(le.current?.labels?.length??0)>0;e!==be&&fe(e)});const pe=!Y&&(!!q||be);if(g(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),g(()=>{if(ne)return c(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),I)/* @__PURE__ */
2
- return x("input",{ref:V,type:"date",lang:re,id:E,name:L,disabled:M,"aria-label":Y,"aria-describedby":$,"aria-invalid":W||void 0,value:Z,min:_||void 0,max:ee||void 0,onChange:e=>k?.(t(e.target.value)),className:a({invalid:W,size:C,className:O}),"aria-labelledby":q,required:H,form:U,title:G,tabIndex:K,autoFocus:P,onFocus:R,onBlur:A,...Q});const he=Object.fromEntries(Object.entries(Q).filter(([e])=>j.test(e)&&!w.has(e))),ve=Q["aria-required"],ge=!!H||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,$].filter(Boolean).join(" ")||void 0,xe=r(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=z??te.placeholder;/* @__PURE__ */
1
+ import{Calendar as e}from"./chunk-QTWHMCCX.js";import{fromDateKey as t,toDateKey as r}from"./chunk-2HMNOLKX.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{calendarNames as i}from"./chunk-Y3JW2GW5.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as b}from"./chunk-L6XEON5Q.js";import{forwardRef as f,useState as p,useRef as h,useId as v,useEffect as g}from"react";import{createPortal as y}from"react-dom";import{jsx as x,jsxs as N}from"react/jsx-runtime";var k=/^\d{4}-\d{2}-\d{2}$/,j=/^(aria|data)-/,w=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function D(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":r(e);if(k.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":r(t)}function C(e,r){const a=t(e);return a?r.longDate(a.getFullYear(),a.getMonth(),a.getDate()):""}var W=f(function({value:f,onChange:k,min:W,max:F,invalid:O,size:S,native:B,weekStartsOn:E,className:L="","aria-label":$,"aria-describedby":q,"aria-labelledby":I,id:T,name:Y,disabled:z,placeholder:J,required:M,clearable:U,form:G,title:H,tabIndex:P,autoFocus:Q,onFocus:X,onBlur:R,...V},A){const K=U??!M,Z=D(f),_=D(W),ee=D(F),te=m().datePicker,re=b(),ae=i(re),[ne,ie]=p(!1),oe=h(null),le=h(null),se=h(null),de=v(),ue=v(),ce=v(),me=d(le,ne,{popupRef:se}),[be,fe]=p(!1);u(()=>{const e=!!T&&(le.current?.labels?.length??0)>0;e!==be&&fe(e)});const pe=!$&&(!!I||be);if(g(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),g(()=>{if(ne)return c(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),B)/* @__PURE__ */
2
+ return x("input",{ref:A,type:"date",lang:re,id:T,name:Y,disabled:z,"aria-label":$,"aria-describedby":q,"aria-invalid":O||void 0,value:Z,min:_||void 0,max:ee||void 0,onChange:e=>k?.(t(e.target.value)),className:a({invalid:O,size:S,className:L}),"aria-labelledby":I,required:M,form:G,title:H,tabIndex:P,autoFocus:Q,onFocus:X,onBlur:R,...V});const he=Object.fromEntries(Object.entries(V).filter(([e])=>j.test(e)&&!w.has(e))),ve=V["aria-required"],ge=!!M||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,q].filter(Boolean).join(" ")||void 0,xe=r(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=J??te.placeholder;/* @__PURE__ */
3
3
  return N("div",{ref:oe,className:"relative",children:[
4
- /* @__PURE__ */x("input",{ref:V,type:"hidden",name:L,form:U,value:Z}),
5
- /* @__PURE__ */N("button",{ref:le,type:"button",...he,id:E,disabled:M,title:G,tabIndex:K,autoFocus:P,onFocus:R,onBlur:A,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":q,"aria-describedby":ye,"aria-label":Y?`${Y}${Z?`, ${S(Z,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:W,size:C,className:O})} flex items-center justify-between text-left`,children:[
6
- /* @__PURE__ */x("span",{className:Z?"text-ink-strongest":n,children:Z?S(Z,ae):ke}),
7
- /* @__PURE__ */x(o,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */x("span",{id:ue,className:"sr-only",children:Z?S(Z,ae):ke}),ge&&/* @__PURE__ */x("span",{id:ce,className:"sr-only",children:te.required}),ne&&y(
8
- /* @__PURE__ */N("div",{ref:se,id:de,role:"dialog","aria-label":Y??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:s.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
9
- /* @__PURE__ */x(e,{value:Z||null,min:_||null,max:ee||null,weekStartsOn:J,onSelect:e=>{ie(!1),le.current?.focus(),k?.(t(e))}}),(X||Ne)&&/* @__PURE__ */N("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[X&&/* @__PURE__ */x("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */x("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{B as DatePicker_default};
4
+ /* @__PURE__ */x("input",{ref:A,type:"hidden",name:Y,form:G,value:Z}),
5
+ /* @__PURE__ */N("button",{ref:le,type:"button",...he,id:T,disabled:z,title:H,tabIndex:P,autoFocus:Q,onFocus:X,onBlur:R,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":I,"aria-describedby":ye,"aria-label":$?`${$}${Z?`, ${C(Z,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:O,size:S,className:L})} flex items-center justify-between text-left`,children:[
6
+ /* @__PURE__ */x("span",{className:Z?"text-ink-strongest":n,children:Z?C(Z,ae):ke}),
7
+ /* @__PURE__ */x(o,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */x("span",{id:ue,className:"sr-only",children:Z?C(Z,ae):ke}),ge&&/* @__PURE__ */x("span",{id:ce,className:"sr-only",children:te.required}),ne&&y(
8
+ /* @__PURE__ */N("div",{ref:se,id:de,role:"dialog","aria-label":$??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:s.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
9
+ /* @__PURE__ */x(e,{value:Z||null,min:_||null,max:ee||null,weekStartsOn:E,onSelect:e=>{ie(!1),le.current?.focus(),k?.(t(e))}}),(K||Ne)&&/* @__PURE__ */N("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[K&&/* @__PURE__ */x("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */x("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{W as DatePicker_default};
@@ -1,15 +1,15 @@
1
- import{Popover as e}from"./chunk-64RHGJXK.js";import{InputNumber_default as r}from"./chunk-63IGYBCQ.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
- return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function I(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function P(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function S({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:S,onClose:j,id:K,className:T=""}){const R=h().color,H=k(z),U=e=>{const r=k(e);N||r===H||S?.(r)},L=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:H},Y=a(f??""),[E,J]=p(()=>n(e||Y||"")),W=b(e);m(()=>{e!==W.current&&(W.current=e,e?J(n(e)):Y&&J(n(Y)))},[e]);const X=a=>{N||a===e||(W.current=a,r(a))},q=e=>{const r=a(e);r&&(J(n(r)),X(r))},G=e=>{J(e),X(o(e))},[Z,F]=p(!1),Q=b(E);Q.current=E;const V=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===x?(F(!0),J(a)):G(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,Q.current);"end"===x?J(a):G(a)},onPointerUp:r=>{"end"===x&&Z&&(F(!1),G(e(r,Q.current)))}}),_=V((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=V((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=Z?o(E):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||Y||"";/* @__PURE__ */
3
- return w("div",{id:K,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${T}`.trim(),onKeyDown:e=>{"Escape"===e.key&&j&&(e.preventDefault(),e.stopPropagation(),j())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":R.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:R.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":R.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(W.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
4
- return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>q(e.value)})},`${e.label??""}:${e.value}`)})]}),
5
- /* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":R.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*E.v),"aria-valuetext":R.squareValue(Math.round(100*E.s),Math.round(100*E.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=I(E,e.key,e.shiftKey);r&&(e.preventDefault(),G(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:E.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(E.s),top:ae(1-E.v),...M}})}),
6
- /* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":R.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(E.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=A(E.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),G({...E,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:E.h/360*100+"%",background:o({h:E.h,s:1,v:1}),...M}})}),S&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":R.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H,"aria-valuetext":`${H}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=P(H,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(L(e)))},onPointerMove:e=>{!N&&1&e.buttons&&U(L(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${H}%`,...C(te||"black",H),...M}})}),
1
+ import{Popover as e}from"./chunk-64RHGJXK.js";import{InputNumber_default as r}from"./chunk-AJ2EEWZT.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-L6XEON5Q.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
+ return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function P(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:S,id:T,className:K=""}){const E=h().color,R=k(z),L=e=>{const r=k(e);N||r===R||j?.(r)},U=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:R},H=a(f??""),[W,X]=p(()=>n(e||H||"")),Y=b(e);m(()=>{e!==Y.current&&(Y.current=e,e?X(n(e)):H&&X(n(H)))},[e]);const q=a=>{N||a===e||(Y.current=a,r(a))},J=e=>{const r=a(e);r&&(X(n(r)),q(r))},Z=e=>{X(e),q(o(e))},[F,G]=p(!1),Q=b(W);Q.current=W;const V=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===x?(G(!0),X(a)):Z(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,Q.current);"end"===x?X(a):Z(a)},onPointerUp:r=>{"end"===x&&F&&(G(!1),Z(e(r,Q.current)))}}),_=V((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=V((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=F?o(W):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||H||"";/* @__PURE__ */
3
+ return w("div",{id:T,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&S&&(e.preventDefault(),e.stopPropagation(),S())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":E.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:E.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":E.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(Y.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
4
+ return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>J(e.value)})},`${e.label??""}:${e.value}`)})]}),
5
+ /* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":E.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*W.v),"aria-valuetext":E.squareValue(Math.round(100*W.s),Math.round(100*W.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=A(W,e.key,e.shiftKey);r&&(e.preventDefault(),Z(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:W.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(W.s),top:ae(1-W.v),...M}})}),
6
+ /* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":E.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(W.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=I(W.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),Z({...W,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:W.h/360*100+"%",background:o({h:W.h,s:1,v:1}),...M}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":E.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":R,"aria-valuetext":`${R}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=P(R,e.key,e.shiftKey);null!==r&&(e.preventDefault(),L(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),L(U(e)))},onPointerMove:e=>{!N&&1&e.buttons&&L(U(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${R}%`,...C(te||"black",R),...M}})}),
7
7
  /* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
8
- /* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,S?H:null)}),
9
- /* @__PURE__ */v(B,{value:re,placeholder:!e&&Y?t(Y):void 0,onChange:q,label:R.hex(i),disabled:N}),S&&/* @__PURE__ */v(O,{value:H,onChange:U,label:R.opacity(i),disabled:N})]})]})}var j={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},K={sm:"h-6",md:"h-8",lg:"h-10"},T=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function B({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${T} ${K[c]} ${h}`.trim():u({size:c,className:`${j[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
10
- return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function O({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
11
- return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function R({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,I=k(p),A=f(),M=a(s??""),P=r||M||"",j=r?t(r):M?t(M):D.none;
8
+ /* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?R:null)}),
9
+ /* @__PURE__ */v(O,{value:re,placeholder:!e&&H?t(H):void 0,onChange:J,label:E.hex(i),disabled:N}),j&&/* @__PURE__ */v(B,{value:R,onChange:L,label:E.opacity(i),disabled:N})]})]})}var S={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},T={sm:"h-6",md:"h-8",lg:"h-10"},K=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function O({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${K} ${T[c]} ${h}`.trim():u({size:c,className:`${S[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
10
+ return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function B({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
11
+ return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function E({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,A=k(p),I=f(),M=a(s??""),P=r||M||"",S=r?t(r):M?t(M):D.none;
12
12
  /* @__PURE__ */
13
13
  return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
14
- /* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(P,b?I:null)}),triggerLabel:D.swatch(o,j),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(S,{id:A,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
15
- /* @__PURE__ */v(B,{value:r,placeholder:!r&&M?t(M):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(O,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,S as ColorPickerPanel,$ as ColorSwatch,B as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,A as stepHue,P as stepOpacity,I as stepSquare};
14
+ /* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(P,b?A:null)}),triggerLabel:D.swatch(o,S),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:I,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
15
+ /* @__PURE__ */v(O,{value:r,placeholder:!r&&M?t(M):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(B,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{E as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,O as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,I as stepHue,P as stepOpacity,A as stepSquare};
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a,stepRounding as e}from"./chunk-63IGYBCQ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
1
+ import{InputNumber_default as a,stepRounding as e}from"./chunk-AJ2EEWZT.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
2
2
  return n("div",{role:"group","aria-label":r,className:"grid min-w-0 grid-cols-2 gap-2",children:[x("x"),x("y")]})}export{m as PositionInput};
@@ -1,2 +1,2 @@
1
- import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{jsx as o}from"react/jsx-runtime";function i(){const i=r().loading;/* @__PURE__ */
1
+ import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-L6XEON5Q.js";import{jsx as o}from"react/jsx-runtime";function i(){const i=r().loading;/* @__PURE__ */
2
2
  return o(n,{size:"sm",padding:"p-8",label:i.label})}export{i as LoadingSpinner};
@@ -1,24 +1,24 @@
1
- import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{toast_default as n}from"./chunk-3YBXA72C.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
- /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[P,S]=s(0),[_,D]=s(1),[W,A]=s(!0),[L,$]=s(!0),O=i(x.loadFailed);O.current=x.loadFailed,l(()=>{let e=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(t=>{e||(j(t),S(t.numPages),$(!1))}).catch(()=>{e||(n.error(O.current),$(!1))}),()=>{e=!0}},[a,g,w]),l(()=>{if(!M||!W||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});D(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,W,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:_}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,_]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===d?x.fitPage:x.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{toast_default as n}from"./chunk-KFNQVNND.js";import{useShellStrings as r}from"./chunk-L6XEON5Q.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
+ /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),N=i(null),C=i(null),[j,E]=s(null),[M,z]=s(1),[D,P]=s(0),[_,S]=s(1),[L,W]=s(!0),[O,$]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let e=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(t=>{e||(E(t),P(t.numPages),$(!1))}).catch(()=>{e||(n.error(T.current),$(!1))}),()=>{e=!0}},[a,g,w]),l(()=>{if(!j||!L||!C.current)return;const e=()=>{const e=C.current;e&&j.getPage(M).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});S(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[j,M,L,d]),l(()=>{if(!j||!k.current)return;let e=!1,t=null,n=null;return j.getPage(M).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:_}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=N.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[j,M,_]),l(()=>{const e=()=>N.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===d?x.fitPage:x.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return m("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */m(f,{children:[
5
- /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,P)}),
7
- /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(P,e+1)),disabled:E>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
5
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
+ /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(M,D)}),
7
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(D,e+1)),disabled:M>=D,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
8
8
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{A(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(A(!1),D(Number(t)/100)):A(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
- /* @__PURE__ */u("option",{value:"fit",children:T}),!W&&!v.includes(Math.round(100*_))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*_),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{A(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */u("button",{type:"button",onClick:()=>A(!0),"aria-pressed":W,className:H+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
9
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{W(!1),S(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */m("select",{value:L?"fit":v.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(W(!1),S(Number(t)/100)):W(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
+ /* @__PURE__ */u("option",{value:"fit",children:A}),!L&&!v.includes(Math.round(100*_))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*_),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{W(!1),S(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>W(!0),"aria-pressed":L,className:H+(L?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
14
14
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=P;e++)t.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(t).then(t=>{var n;e.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),e.document.write(t.map(e=>`<img src="${e}"/>`).join("")),e.document.write("</body></html>"),e.document.close(),setTimeout(()=>{e.print(),e.close()},300)})},className:H,children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!j)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=D;e++)t.push(j.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(t).then(t=>{var n;e.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),e.document.write(t.map(e=>`<img src="${e}"/>`).join("")),e.document.write("</body></html>"),e.document.close(),setTimeout(()=>{e.print(),e.close()},300)})},className:H,children:[
16
16
  /* @__PURE__ */u(e,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
17
17
  /* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:H,children:[
18
18
  /* @__PURE__ */u(e,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:H,children:[
19
19
  /* @__PURE__ */u(e,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
20
- /* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<P?(e.preventDefault(),z(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<P&&(e.preventDefault(),z(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(P)))},children:L?/* @__PURE__ */u(t,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */u("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!j)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<D?(e.preventDefault(),z(e=>Math.min(D,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!j)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<D&&(e.preventDefault(),z(e=>Math.min(D,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(D)))},children:O?/* @__PURE__ */u(t,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
22
  /* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
24
- /* @__PURE__ */u("div",{ref:C,className:"preview-pdf-textlayer",onPointerDown:e=>e.currentTarget.classList.add("selecting")})]})]})})]})}export{f as PanelActions,x as PdfViewer,p as ToolbarSlotContext,b as fitScale,y as pdfWasmParams};
24
+ /* @__PURE__ */u("div",{ref:N,className:"preview-pdf-textlayer",onPointerDown:e=>e.currentTarget.classList.add("selecting")})]})]})})]})}export{f as PanelActions,x as PdfViewer,p as ToolbarSlotContext,b as fitScale,y as pdfWasmParams};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-CEIIQRK5.js";import{Select_default as l}from"./chunk-XMY2HKVD.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-ATZ262BR.js";import{Input_default as c}from"./chunk-PT4GMPUB.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-ZFQI3EVU.js";import{Select_default as l}from"./chunk-LUAA4LKY.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-R3W6LZBG.js";import{Input_default as c}from"./chunk-PT4GMPUB.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,4 +1,4 @@
1
- import{Breadcrumbs as e}from"./chunk-JLRF6FN7.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-LOMNX5VH.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
2
2
  return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
3
3
  /* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
4
4
  /* @__PURE__ */t("div",{children:[
@@ -1,14 +1,14 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-7GJIIBJD.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-V4XR4MOS.js";import{ColoredBadge as u}from"./chunk-NN32QUCE.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:T,onDragOutChange:C,dropType:K,onDropData:I,label:S,hint:A,error:O,required:F,className:M,accept:P="image/*",maxSizeBytes:z,maxFiles:E,fit:L="cover",thumbSize:$=96,placeholder:R,cta:H,acceptHint:B,showCover:J=!1,coverLabel:W,busy:Q=!1,busyLabel:q,progress:U,disabled:V=!1,readOnly:G=!1,selected:X,onItemClick:Y,onItemDoubleClick:Z,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=H??te.cta,ae=W??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=V||Q,de=!(!k&&!N||se||G),ce=!!w&&!se&&!G,ue=!!j&&!se&&!G,me=!!T&&!V&&!ue,pe=!(!K||!I||se||G),fe=t(se),he=R??r(P,te),ge=d({accept:P,maxSizeBytes:z,maxFiles:E,acceptHint:B,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(K),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(K);t&&I(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Te=null==X?null:new Set(X),Ce=!!Y,Ke=$<112,Ie=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=J&&(e.cover??0===t);/* @__PURE__ */
2
- return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Te?Te.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Z?()=>Z(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(T,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);C?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&C?t=>C("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Ce?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Te?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:L}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:L}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
3
- /* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ke?
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-COF2CF5R.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-KDG7NWYX.js";import{ColoredBadge as u}from"./chunk-Q2T5DRIK.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-L6XEON5Q.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:T,dropType:C,onDropData:O,label:I,hint:A,error:F,required:S,className:L,accept:P="image/*",maxSizeBytes:z,maxFiles:E,fit:R="cover",thumbSize:$=96,placeholder:M,cta:W,acceptHint:H,showCover:Q=!1,coverLabel:B,busy:q=!1,busyLabel:X,progress:Y,disabled:G=!1,readOnly:U=!1,selected:V,onItemClick:Z,onItemDoubleClick:J,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=W??te.cta,ae=B??te.cover,ne=X??te.uploading,le=g(),[ie,oe]=b(null),se=G||q,de=!(!k&&!N||se||U),ce=!!w&&!se&&!U,ue=!!j&&!se&&!U,me=!!K&&!G&&!ue,pe=!(!C||!O||se||U),fe=t(se),he=M??r(P,te),ge=d({accept:P,maxSizeBytes:z,maxFiles:E,acceptHint:H,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&O(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Ke=null==V?null:new Set(V),Te=!!Z,Ce=$<112,Oe=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=Q&&(e.cover??0===t);/* @__PURE__ */
2
+ return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||Z(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:J?()=>J(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Z(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:R}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:R}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
3
+ /* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ce?
4
4
  /* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
5
- /* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Se=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
5
+ /* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ie=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
6
6
  /* @__PURE__ */x(a,{className:"h-5 w-5"}),
7
7
  /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Ae=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
8
8
  /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
9
9
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
10
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:Q?"invisible":void 0,children:te.empty})});/* @__PURE__ */
11
- return v(e,{label:S,labelId:S?`${le}-label`:void 0,htmlFor:le,hint:A,error:O,required:F,className:M,children:[
12
- /* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":S?`${le}-label`:void 0,"aria-describedby":O?`${le}-error`:A?`${le}-hint`:void 0,"aria-busy":Q||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ae:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
13
- /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Te||void 0,"aria-label":"string"==typeof S?S:te.files,className:"contents",children:p.map(Ie)}):p.map(Ie),Se]}),Q&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
10
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),H&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:H})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:q?"invisible":void 0,children:te.empty})});/* @__PURE__ */
11
+ return v(e,{label:I,labelId:I?`${le}-label`:void 0,htmlFor:le,hint:A,error:F,required:S,className:L,children:[
12
+ /* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":I?`${le}-label`:void 0,"aria-describedby":F?`${le}-error`:A?`${le}-hint`:void 0,"aria-busy":q||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ae:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
13
+ /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof I?I:te.files,className:"contents",children:p.map(Oe)}):p.map(Oe),Ie]}),q&&/* @__PURE__ */x(l,{label:ne,progress:Y})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
14
14
  /* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
@@ -1,3 +1,3 @@
1
- import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{useShellStrings as n}from"./chunk-JSHMIMAJ.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
1
+ import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{useShellStrings as n}from"./chunk-L6XEON5Q.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
2
2
  return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
3
3
  /* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
@@ -0,0 +1,23 @@
1
+ import{Calendar as e}from"./chunk-QTWHMCCX.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-PT4GMPUB.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{Icon as u}from"./chunk-ISVODSRP.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{buttonClasses as b}from"./chunk-UQYNPYF4.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-L6XEON5Q.js";import{useState as w,useRef as N,useId as k,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as j,jsx as D}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=t;function F(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function O(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var H=/* @__PURE__ */new Map;function L({from:t,to:n,onChange:m,formatDisplay:Y,clearable:L,required:T=!1,name:B,id:E,"aria-labelledby":G,"aria-label":P,weekStartsOn:R,placeholder:U,fullWidth:I=!1,min:J,max:q,disabled:A=!1,allowOpenEnd:Q=!1}){const X=v().dateRange,V=y(),Z=Y??(V?function(e){let t=H.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),H.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(V):O),z=U??X.placeholder,K=L??!T,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=N(null),de=N(null),me=N(null),ue=k(),he=k(),pe=k(),[fe,ge]=w(!1),be=f(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=N(null),ve=N(null),[ye,we]=w(!0);g(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const Ne=N(null);g(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==Ne.current&&Ne.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;Ne.current=e,e>r+.5&&ge(!0)}});const[ke,Ce]=w(!1);g(()=>{const e=!!E&&(de.current?.labels?.length??0)>0;e!==ke&&Ce(e)});const Me=!!P||!!G||ke,We=/* @__PURE__ */new Date,[je,De]=w(()=>t?t.slice(0,7):S(We,J,q)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,We),J,q)),Ye=e=>e?Z(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=h(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{A&&ee(!1)},[A]);const Fe=()=>{m("",""),ee(!1)},Se=K&&!A&&Boolean(t||n),Oe=t&&n?`${Ye(t)} — ${Ye(n)}`:t?X.fromOnly(Ye(t)):n?X.toOnly(Ye(n)):"",He=d(V),Le=e=>{const t=r(e);return t?He.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Te=t&&n?X.range(Le(t),Le(n)):t?X.fromOnly(Le(t)):n?X.toOnly(Le(n)):z,Be=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ee=/* @__PURE__ */W(j,{children:[$e.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,We);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Be(e),"aria-label":fe?X[e]:void 0,children:fe?ye?X[e]:X[`${e}Short`]:X[e]},e)),
2
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Be("Custom"),children:X.custom})]}),Ge=(e,t)=>Q?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Pe=e=>Q&&ie===e?" ring-1 ring-blue-400":"",Re=
3
+ /* @__PURE__ */D(e,{mode:"range",min:J,max:q,value:te||null,endValue:ne||null,month:je,onMonthChange:De,onSelect:e=>{le("Custom"),Q?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:R,"aria-label":X.dialog});/* @__PURE__ */
4
+ return W("div",{className:"relative"+(I?" w-full":""),ref:ce,children:[
5
+ /* @__PURE__ */W("div",{className:`relative ${I?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${A?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{A||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(We,J,q)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:E,disabled:A||void 0,"aria-label":P,"aria-labelledby":G,"aria-describedby":[Me?he:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(I?" min-w-0 flex-1 justify-start":""),children:[
7
+ /* @__PURE__ */D(u,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
+ /* @__PURE__ */D("span",{className:"truncate",children:Oe||z})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:X.clearRange,icon:/* @__PURE__ */D(u,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Te}),T&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:X.required}),B&&/* @__PURE__ */W(j,{children:[
9
+ /* @__PURE__ */D("input",{type:"hidden",name:B.from,value:t,disabled:A||void 0}),
10
+ /* @__PURE__ */D("input",{type:"hidden",name:B.to,value:n,disabled:A||void 0})]}),_&&M(
11
+ /* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":X.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:p.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
12
+ /* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ge("from",/* @__PURE__ */W(j,{children:[
13
+ /* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:X.from}),
14
+ /* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("from")}`,children:te?Ye(te):X.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Ge("to",/* @__PURE__ */W(j,{children:[
15
+ /* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:X.to}),
16
+ /* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("to")}`,children:ne?Ye(ne):X.end})]}))]}),fe?/* @__PURE__ */W(j,{children:[$e.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:X.lastHeading}),
17
+ /* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ee,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:X[e]},e))]})]}),
18
+ /* @__PURE__ */D("div",{className:"w-full",children:Re})]}):
19
+ /* @__PURE__ */W("div",{ref:xe,className:"flex w-max gap-4",children:[
20
+ /* @__PURE__ */D("div",{className:"w-64",children:Re}),$e.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ee})]}),
21
+ /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[K&&/* @__PURE__ */D("button",{type:"button",onClick:Fe,className:b({variant:"ghost"}),children:X.clear}),
22
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:b({variant:"secondary"}),children:X.cancel}),
23
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:Q?!te&&!ne:!te||!ne,className:b({variant:"primary"}),children:X.apply})]})]}),document.body)]})}export{L as DateRangePicker,F as presetRange,Y as toISODate};