efficient-shell 12.32.0 → 12.33.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 (312) hide show
  1. package/README.md +34 -2
  2. package/dist/{Browser-36SDGA64.js → Browser-TYVPZ2NT.js} +16 -16
  3. package/dist/{Calculator-GDHNFSB6.js → Calculator-2N7WJ6NR.js} +23 -23
  4. package/dist/{CurrencyConverter-PXCCCUS2.js → CurrencyConverter-LJ73P5P7.js} +7 -7
  5. package/dist/{Files-NVUIAUO5.js → Files-VUZWJMCE.js} +103 -103
  6. package/dist/{Notepad-QA2CD6GC.js → Notepad-LXLUGQUN.js} +8 -8
  7. package/dist/PdfViewer-OLQBTKOC.js +1 -0
  8. package/dist/{PomodoroTimer-HD2ZNOUV.js → PomodoroTimer-T34U5BLE.js} +20 -20
  9. package/dist/Preview-VRYWLVJY.js +177 -0
  10. package/dist/Sidebar-I5QQHJSA.js +44 -0
  11. package/dist/{Stock-EDZSOJAQ.js → Stock-BV36WRZA.js} +3 -3
  12. package/dist/{Weather-OTVZZEE7.js → Weather-YQQT5XYX.js} +20 -20
  13. package/dist/{WorldClock-PDKFE5S7.js → WorldClock-WN2X3YIV.js} +7 -7
  14. package/dist/ai/index.js +49 -49
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.d.ts +51 -1
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/SpecChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/chunk-2FQBY4ED.js +6 -0
  47. package/dist/{chunk-MMSQZKJY.js → chunk-2LRSUDGN.js} +6 -6
  48. package/dist/{chunk-QB4LAGMN.js → chunk-2UBR4YUF.js} +1 -1
  49. package/dist/{chunk-NDGPJKE3.js → chunk-3DV5YLAI.js} +5 -5
  50. package/dist/chunk-3RX5KCUH.js +9 -0
  51. package/dist/{chunk-246K337V.js → chunk-3TCGXYUC.js} +1 -1
  52. package/dist/{chunk-3MAGUYG2.js → chunk-3U4IIEEY.js} +1 -1
  53. package/dist/{chunk-OU3J5TOO.js → chunk-3YCU6V3U.js} +1 -1
  54. package/dist/{chunk-V2OE6OTK.js → chunk-44ZHEIJZ.js} +13 -13
  55. package/dist/{chunk-DGFC5BX4.js → chunk-4HJNHI4A.js} +1 -1
  56. package/dist/{chunk-A6YUCAGF.js → chunk-4HJX2M4W.js} +1 -1
  57. package/dist/{chunk-QXTCEUFC.js → chunk-4RSBPRCQ.js} +1 -1
  58. package/dist/{chunk-BEN2LJWQ.js → chunk-4YWQE67T.js} +1 -1
  59. package/dist/{chunk-UJ23EKXU.js → chunk-5LHEPE4B.js} +1 -1
  60. package/dist/{chunk-ZP3UAWJL.js → chunk-5PSFENSW.js} +15 -15
  61. package/dist/{chunk-FXS2P23Q.js → chunk-5UPLN44S.js} +9 -9
  62. package/dist/{chunk-HWV6UDFC.js → chunk-65JCQLM4.js} +1 -1
  63. package/dist/{chunk-AGNHOSES.js → chunk-6D6Q3ZCG.js} +6 -6
  64. package/dist/{chunk-PUXSFLWR.js → chunk-6SOS6OBB.js} +1 -1
  65. package/dist/{chunk-5R3NDBCD.js → chunk-6XPS3H5Z.js} +9 -9
  66. package/dist/{chunk-DRIO2Y4R.js → chunk-75TPMXA7.js} +4 -4
  67. package/dist/{chunk-S54Z2JAZ.js → chunk-7VIRSTRC.js} +7 -7
  68. package/dist/{chunk-BXPEEPYH.js → chunk-7WMFHPKS.js} +1 -1
  69. package/dist/chunk-A6KFGANR.js +23 -0
  70. package/dist/{chunk-NZ74N2IQ.js → chunk-AEMTJGD4.js} +1 -1
  71. package/dist/{chunk-AFVI75RH.js → chunk-AJ5GLMGD.js} +7 -7
  72. package/dist/{chunk-VERSP62V.js → chunk-AKKDFFUO.js} +1 -1
  73. package/dist/{chunk-DWGMTMDU.js → chunk-APGIPXR7.js} +1 -1
  74. package/dist/{chunk-LQC5U5YT.js → chunk-ARBS2EZ6.js} +1 -1
  75. package/dist/{chunk-FKJPBQ6I.js → chunk-B3KQELHS.js} +6 -6
  76. package/dist/chunk-B447IHIL.js +4 -0
  77. package/dist/{chunk-LOJAJARD.js → chunk-BLXEDMZM.js} +6 -6
  78. package/dist/{chunk-TBXFRW3E.js → chunk-BLXHT72M.js} +1 -1
  79. package/dist/{chunk-VI54L75G.js → chunk-BNPJHOAC.js} +9 -9
  80. package/dist/{chunk-3TR6C5V4.js → chunk-BRFUQAVC.js} +1 -1
  81. package/dist/{chunk-M3FBPZ4G.js → chunk-BSEQJM7X.js} +1 -1
  82. package/dist/{chunk-BIBQAEHV.js → chunk-BXZLSY2S.js} +1 -1
  83. package/dist/{chunk-6MA7VXZR.js → chunk-CBXEMPZL.js} +3 -3
  84. package/dist/{chunk-COF2CF5R.js → chunk-CCPUNN4F.js} +1 -1
  85. package/dist/{chunk-YG6ONZIB.js → chunk-COHFFGFE.js} +2 -2
  86. package/dist/{chunk-ZFQI3EVU.js → chunk-CVXJKHPD.js} +6 -6
  87. package/dist/chunk-D53FU245.js +8 -0
  88. package/dist/{chunk-OL2XKAX2.js → chunk-DASRJ26L.js} +1 -1
  89. package/dist/{chunk-L6XEON5Q.js → chunk-DEJIH3ZQ.js} +1 -1
  90. package/dist/{chunk-A7JAHN75.js → chunk-DFOKJAIS.js} +1 -1
  91. package/dist/{chunk-RIULA2CH.js → chunk-DGFFDZCY.js} +11 -11
  92. package/dist/{chunk-K4BM6PPZ.js → chunk-DU7TJVX5.js} +1 -1
  93. package/dist/{chunk-ZGY2OK7Q.js → chunk-DYOFTZOC.js} +9 -9
  94. package/dist/{chunk-OA55OBDP.js → chunk-E44RNULN.js} +1 -1
  95. package/dist/{chunk-XKBCF6SK.js → chunk-E6PDAYBR.js} +10 -10
  96. package/dist/chunk-EEFUXXYJ.js +22 -0
  97. package/dist/{chunk-WJTZE3PL.js → chunk-EQFWFQOZ.js} +10 -10
  98. package/dist/{chunk-XR7SPONC.js → chunk-F3MO56N4.js} +1 -1
  99. package/dist/chunk-FBMYLCCE.js +11 -0
  100. package/dist/{chunk-VW3ZUWW2.js → chunk-FCILLVVT.js} +61 -61
  101. package/dist/{chunk-CYTK7DCA.js → chunk-FCWBO7I3.js} +12 -12
  102. package/dist/{chunk-RPSNYIDY.js → chunk-FEQQMRHJ.js} +3 -3
  103. package/dist/chunk-FOE2QHDE.js +13 -0
  104. package/dist/{chunk-LNXYVWEF.js → chunk-FUNGLFQE.js} +3 -3
  105. package/dist/{chunk-26Y66IXU.js → chunk-FVORTWUY.js} +2 -2
  106. package/dist/{chunk-X4IFSC57.js → chunk-FXG7TOZN.js} +1 -1
  107. package/dist/{chunk-XOXTMWV3.js → chunk-G5U7IRH4.js} +2 -2
  108. package/dist/{chunk-J44SUUOG.js → chunk-GAGCE2ML.js} +1 -1
  109. package/dist/{chunk-IBLRSK7V.js → chunk-GHLXZDLU.js} +1 -1
  110. package/dist/{chunk-OWFJRER6.js → chunk-H4GOJ26X.js} +1 -1
  111. package/dist/chunk-HTHD7STJ.js +9 -0
  112. package/dist/{chunk-B7UT3W4C.js → chunk-HTHNDX32.js} +1 -1
  113. package/dist/{chunk-Y7XX6Z3M.js → chunk-HWJQLLJA.js} +8 -8
  114. package/dist/chunk-I4RJAMLJ.js +1 -0
  115. package/dist/{chunk-R3W6LZBG.js → chunk-ID35S5Y6.js} +1 -1
  116. package/dist/{chunk-QJ6HVBAA.js → chunk-IEW5JTIR.js} +4 -4
  117. package/dist/{chunk-XBC7CBVJ.js → chunk-IFLIE3EQ.js} +1 -1
  118. package/dist/{chunk-5XOF3O4B.js → chunk-IODIQ77P.js} +1 -1
  119. package/dist/{chunk-CHRK5R3Y.js → chunk-IRCASURW.js} +8 -8
  120. package/dist/{chunk-KDG7NWYX.js → chunk-ITEOA45V.js} +1 -1
  121. package/dist/{chunk-7IRO4JAA.js → chunk-IYTOOV7Q.js} +1 -1
  122. package/dist/{chunk-NQ43KRRX.js → chunk-JOYGSKWG.js} +9 -9
  123. package/dist/chunk-JTMR3EH3.js +28 -0
  124. package/dist/{chunk-3UMS74TZ.js → chunk-JWUNK2PW.js} +1 -1
  125. package/dist/{chunk-LUAA4LKY.js → chunk-KITSIQCV.js} +16 -16
  126. package/dist/{chunk-PK5KDLIG.js → chunk-KRCWLZV7.js} +12 -12
  127. package/dist/{chunk-ZHVWK5NL.js → chunk-KV6XCHAG.js} +18 -18
  128. package/dist/{chunk-JI55MXP4.js → chunk-KZQRUVII.js} +7 -7
  129. package/dist/{chunk-DHLXSL3Y.js → chunk-LPAOHDUE.js} +1 -1
  130. package/dist/chunk-LSONG4QV.js +1 -0
  131. package/dist/{chunk-HGGDOMBV.js → chunk-MZCYB2MW.js} +1 -1
  132. package/dist/{chunk-25M4CAB3.js → chunk-NDWX5Z4D.js} +1 -1
  133. package/dist/{chunk-Q2LKH6RN.js → chunk-NGG6DYNN.js} +1 -1
  134. package/dist/{chunk-RSRTE7RG.js → chunk-NLHGFQ54.js} +1 -1
  135. package/dist/{chunk-QYKWVZ3R.js → chunk-NUDL6UO3.js} +1 -1
  136. package/dist/{chunk-YELYAGCX.js → chunk-P62QGXRW.js} +12 -12
  137. package/dist/{chunk-4U2OUX65.js → chunk-PA3OU3Y7.js} +5 -5
  138. package/dist/{chunk-X6AMAYXV.js → chunk-PC3MYH2K.js} +2 -2
  139. package/dist/{chunk-V7BHDLP2.js → chunk-PGATHOTX.js} +1 -1
  140. package/dist/{chunk-QUN3RSMN.js → chunk-PR6FNBKR.js} +1 -1
  141. package/dist/{chunk-6AAGZ34A.js → chunk-PZNF2TEB.js} +9 -9
  142. package/dist/{chunk-CAIUI3DC.js → chunk-Q6GECV4J.js} +1 -1
  143. package/dist/{chunk-BLC6HAU3.js → chunk-QDEQHT2T.js} +1 -1
  144. package/dist/{chunk-QXLYU5FR.js → chunk-QDIPNQ6M.js} +1 -1
  145. package/dist/{chunk-JZ4V3RHK.js → chunk-QO7UHTUE.js} +4 -4
  146. package/dist/chunk-QXXMRV4E.js +2 -0
  147. package/dist/{chunk-JTJDXCJU.js → chunk-R5SVNFUG.js} +4 -4
  148. package/dist/{chunk-FE6J5S5X.js → chunk-R5TSUJTK.js} +6 -6
  149. package/dist/{chunk-7JR2O3IX.js → chunk-RJ24VXBZ.js} +6 -6
  150. package/dist/chunk-RMEYKJEH.js +8 -0
  151. package/dist/{chunk-K73KBA5C.js → chunk-ROKUEMAK.js} +4 -4
  152. package/dist/{chunk-IE5XWHDU.js → chunk-ROPVIMIR.js} +1 -1
  153. package/dist/chunk-RTGGGZ2R.js +2 -0
  154. package/dist/{chunk-JLQ7N54N.js → chunk-S26FG4RF.js} +15 -15
  155. package/dist/{chunk-RLFZRIO4.js → chunk-SQ4ZFG2B.js} +1 -1
  156. package/dist/{chunk-VTDW5GLS.js → chunk-TAEO2JC6.js} +1 -1
  157. package/dist/{chunk-QPSKEDR7.js → chunk-TDG5WGLR.js} +1 -1
  158. package/dist/{chunk-KFNQVNND.js → chunk-TMSSR5UH.js} +1 -1
  159. package/dist/{chunk-G3NE4SGZ.js → chunk-UHQBHSWL.js} +8 -8
  160. package/dist/{chunk-6ZTVZIPI.js → chunk-V3KQIY6T.js} +6 -6
  161. package/dist/{chunk-AFLG5E4O.js → chunk-V5VAKDLS.js} +6 -6
  162. package/dist/chunk-VMKTA5HL.js +6 -0
  163. package/dist/{chunk-JYVHFRKK.js → chunk-VUM6BYAX.js} +5 -5
  164. package/dist/{chunk-IYM5N7FH.js → chunk-VVXBBU6R.js} +3 -3
  165. package/dist/{chunk-5XHJ3H6Y.js → chunk-VWYICGVA.js} +1 -1
  166. package/dist/{chunk-QTWHMCCX.js → chunk-W5HT23P7.js} +11 -11
  167. package/dist/{chunk-XOQH6VSU.js → chunk-WEZ2RO72.js} +11 -11
  168. package/dist/{chunk-JIBU7YY4.js → chunk-WKWZILZA.js} +2 -2
  169. package/dist/chunk-WUEH6DLJ.js +14 -0
  170. package/dist/{chunk-NQA267J3.js → chunk-X22SFR5F.js} +5 -5
  171. package/dist/{chunk-PTEKHRNX.js → chunk-XBX3N3VG.js} +15 -15
  172. package/dist/{chunk-5OJFYNEZ.js → chunk-XCY7A5UM.js} +1 -1
  173. package/dist/{chunk-QBQMMOP6.js → chunk-XPSWZQR4.js} +2 -2
  174. package/dist/{chunk-M2TQQKJO.js → chunk-XYMEC63O.js} +1 -1
  175. package/dist/{chunk-T5UMQZ5X.js → chunk-Y43S6YS5.js} +11 -11
  176. package/dist/{chunk-KTKFCR6T.js → chunk-YAM3L5N4.js} +1 -1
  177. package/dist/{chunk-K4RY57UX.js → chunk-YEEMRWBS.js} +1 -1
  178. package/dist/{chunk-LOMNX5VH.js → chunk-YM7AWNMY.js} +1 -1
  179. package/dist/{chunk-555KW6TM.js → chunk-YMUHIJDJ.js} +4 -4
  180. package/dist/{chunk-PR5CON2G.js → chunk-YW6BODBX.js} +1 -1
  181. package/dist/{chunk-AJ2EEWZT.js → chunk-ZDCCYRFF.js} +2 -2
  182. package/dist/{chunk-4XN6ACGV.js → chunk-ZDDMFFQK.js} +1 -1
  183. package/dist/{chunk-Q2T5DRIK.js → chunk-ZGIAMYTI.js} +1 -1
  184. package/dist/{chunk-E6GGE7E5.js → chunk-ZHR2HNT2.js} +14 -14
  185. package/dist/data/DataTable.js +1 -1
  186. package/dist/data/EntityList.js +1 -1
  187. package/dist/data/Gantt.js +1 -1
  188. package/dist/data/Kanban.js +1 -1
  189. package/dist/data/ListFooter.js +1 -1
  190. package/dist/data/ListLoadError.js +1 -1
  191. package/dist/data/Pagination.js +1 -1
  192. package/dist/data/ResizableTable.js +1 -1
  193. package/dist/file-intake/index.js +1 -1
  194. package/dist/forms/BorderInput.js +1 -1
  195. package/dist/forms/BrandAssetEditor.js +1 -1
  196. package/dist/forms/Calendar.js +1 -1
  197. package/dist/forms/ColorPicker.js +1 -1
  198. package/dist/forms/ComposerAttachments.js +1 -1
  199. package/dist/forms/CornersInput.js +1 -1
  200. package/dist/forms/DatePicker.js +1 -1
  201. package/dist/forms/DateRangePicker.js +1 -1
  202. package/dist/forms/DateTimePicker.js +1 -1
  203. package/dist/forms/DisplayChips.js +1 -1
  204. package/dist/forms/FilePicker.js +1 -1
  205. package/dist/forms/FormErrorSummary.js +1 -1
  206. package/dist/forms/IconPicker.js +1 -1
  207. package/dist/forms/ImageFocusPoint.js +1 -1
  208. package/dist/forms/InputNumber.js +1 -1
  209. package/dist/forms/LinkPicker.js +1 -1
  210. package/dist/forms/MediaLibrary.js +1 -1
  211. package/dist/forms/MediaUploadField.js +1 -1
  212. package/dist/forms/MediaUploadGrid.js +1 -1
  213. package/dist/forms/MediaUsedInList.js +1 -1
  214. package/dist/forms/NumericKeypad.js +1 -1
  215. package/dist/forms/PositionInput.js +1 -1
  216. package/dist/forms/Select.js +1 -1
  217. package/dist/forms/SidesInput.js +1 -1
  218. package/dist/forms/Slider.js +1 -1
  219. package/dist/forms/Snippet.js +1 -1
  220. package/dist/forms/TagInput.js +1 -1
  221. package/dist/forms/TextToolbar.js +1 -1
  222. package/dist/forms/TimePicker.js +1 -1
  223. package/dist/forms/WidthsBar.js +1 -1
  224. package/dist/forms/mediaLibraryMenu.js +1 -1
  225. package/dist/forms/mediaMoveItems.js +1 -1
  226. package/dist/forms/textAlign.js +1 -1
  227. package/dist/forms/useFileIntake.js +1 -1
  228. package/dist/index.js +665 -665
  229. package/dist/locales/zh-Hans.js +1 -1
  230. package/dist/map/index.js +2 -2
  231. package/dist/model-viewer/index.js +3 -3
  232. package/dist/page-tabs/index.js +5 -5
  233. package/dist/pdf/index.js +1 -1
  234. package/dist/shell/Accordion.js +1 -1
  235. package/dist/shell/AppUpdateBanner.js +1 -1
  236. package/dist/shell/Avatar.js +1 -1
  237. package/dist/shell/Banner.js +1 -1
  238. package/dist/shell/Breadcrumbs.js +1 -1
  239. package/dist/shell/BudgetBar.js +1 -1
  240. package/dist/shell/Card.js +1 -1
  241. package/dist/shell/ColoredBadge.js +1 -1
  242. package/dist/shell/ConfirmDialog.js +1 -1
  243. package/dist/shell/ContainerFillChart.js +1 -1
  244. package/dist/shell/CountBadge.js +1 -1
  245. package/dist/shell/Dialog.js +1 -1
  246. package/dist/shell/Drawer.js +1 -1
  247. package/dist/shell/EditableGrid.js +1 -1
  248. package/dist/shell/EmptyState.js +1 -1
  249. package/dist/shell/GlobalSearch.js +1 -1
  250. package/dist/shell/HelpCenter.js +1 -1
  251. package/dist/shell/IconRail.js +1 -1
  252. package/dist/shell/ImageLightbox.js +1 -1
  253. package/dist/shell/ItemCount.js +1 -1
  254. package/dist/shell/LanguageSelect.js +1 -1
  255. package/dist/shell/Markdown.js +1 -1
  256. package/dist/shell/MetricBar.js +1 -1
  257. package/dist/shell/MetricBarLegend.js +1 -1
  258. package/dist/shell/MilestoneTimeline.js +1 -1
  259. package/dist/shell/PageHeader.js +1 -1
  260. package/dist/shell/ProductionTimeline.js +1 -1
  261. package/dist/shell/ResizeHandle.js +1 -1
  262. package/dist/shell/Result.js +1 -1
  263. package/dist/shell/SearchableSelect.js +1 -1
  264. package/dist/shell/SettingReset.js +1 -1
  265. package/dist/shell/SettingRow.js +1 -1
  266. package/dist/shell/SidebarLayout.js +1 -1
  267. package/dist/shell/SidebarNav.js +1 -1
  268. package/dist/shell/SortableList.js +1 -1
  269. package/dist/shell/Statistic.js +1 -1
  270. package/dist/shell/TimeAgo.js +1 -1
  271. package/dist/shell/TimelineTrack.js +1 -1
  272. package/dist/shell/TransferProgress.js +1 -1
  273. package/dist/shell/Tree.js +1 -1
  274. package/dist/shell/discardGuard.js +1 -1
  275. package/dist/shell/language.js +1 -1
  276. package/dist/shell/strings.d.ts +8 -0
  277. package/dist/shell/strings.js +1 -1
  278. package/dist/shell/toast.js +1 -1
  279. package/dist/telemetry/index.js +1 -1
  280. package/dist/templates/AuthScreen.js +1 -1
  281. package/dist/templates/ChatTemplate.js +1 -1
  282. package/dist/templates/CheckoutTemplate.js +1 -1
  283. package/dist/templates/DashboardTemplate.js +1 -1
  284. package/dist/templates/DataTablePage.js +1 -1
  285. package/dist/templates/EmailTemplate.js +1 -1
  286. package/dist/templates/ErrorBoundary.js +1 -1
  287. package/dist/templates/ErrorPage.js +1 -1
  288. package/dist/templates/FormLayoutPage.js +1 -1
  289. package/dist/templates/GalleryTemplate.js +1 -1
  290. package/dist/ui/index.js +1 -1
  291. package/dist/version.js +1 -1
  292. package/package.json +1 -1
  293. package/dist/PdfViewer-627HEAIL.js +0 -1
  294. package/dist/Preview-FW2KT6FQ.js +0 -177
  295. package/dist/Sidebar-QNJNEBT2.js +0 -44
  296. package/dist/chunk-2PNG5UR6.js +0 -22
  297. package/dist/chunk-3ECUHYHI.js +0 -28
  298. package/dist/chunk-7CHEHWGL.js +0 -9
  299. package/dist/chunk-ADNUV6OV.js +0 -8
  300. package/dist/chunk-AWY2ZOXT.js +0 -14
  301. package/dist/chunk-ESL5TDNA.js +0 -1
  302. package/dist/chunk-GX4CDXPK.js +0 -9
  303. package/dist/chunk-H74VN7OI.js +0 -2
  304. package/dist/chunk-H7WMOY62.js +0 -1
  305. package/dist/chunk-JROPOGQP.js +0 -2
  306. package/dist/chunk-M3D5FW5R.js +0 -6
  307. package/dist/chunk-NMWV6BOL.js +0 -8
  308. package/dist/chunk-OQGCQQ7H.js +0 -6
  309. package/dist/chunk-PPVZMIBL.js +0 -4
  310. package/dist/chunk-R3ZEDJDZ.js +0 -13
  311. package/dist/chunk-VVI4Y6XA.js +0 -23
  312. package/dist/chunk-XFC7AWPW.js +0 -11
@@ -1,177 +0,0 @@
1
- import{PdfViewer as e,ToolbarSlotContext as t,PanelActions as n}from"./chunk-V2OE6OTK.js";import{ImageAnnotator_default as r}from"./chunk-WJTZE3PL.js";import{AboutApp as s}from"./chunk-JIBU7YY4.js";import{peekPdfPreviewStage as i,claimPdfPreviewStage as o,PDF_PREVIEW_UPDATE_EVENT as a}from"./chunk-ESL5TDNA.js";import{WindowTitle as l}from"./chunk-VW3ZUWW2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-OL2XKAX2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-IBLRSK7V.js";import"./chunk-ZHVWK5NL.js";import"./chunk-PPVZMIBL.js";import"./chunk-EIFNESXS.js";import"./chunk-QUN3RSMN.js";import"./chunk-RIG5FEVS.js";import"./chunk-25M4CAB3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-Q2T5DRIK.js";import"./chunk-UJ23EKXU.js";import{getActiveModalId as c}from"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-H7WMOY62.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as d}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{SpinnerRing as u,LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import{toast_default as m}from"./chunk-KFNQVNND.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as f,splitAround as x}from"./chunk-L6XEON5Q.js";import"./chunk-C3QOHMR6.js";import{useRef as y,useState as g,useEffect as b}from"react";import{jsxs as w,jsx as v,Fragment as k}from"react/jsx-runtime";var N=!1;function C(e,t){return e?.url&&e.url!==t.url&&e.url.startsWith("blob:")&&URL.revokeObjectURL(e.url),t}function A(){const n=y(void 0);void 0===n.current&&(n.current=i());const[r,u]=g(n.current?.data??null);b(()=>{const e=n.current;null!=e&&(o(e),u(t=>t===e.data?t:C(t,e.data)))},[]),b(()=>{const e=n.current?.token;if(null==e)return;const t=t=>{const n=t.detail;n&&n.token===e&&u(e=>C(e,n.data))};return window.addEventListener(a,t),()=>window.removeEventListener(a,t)},[]);const p=y(void 0);b(()=>{p.current=r?.url},[r?.url]);const h=y(null);b(()=>(null!==h.current&&(clearTimeout(h.current),h.current=null),()=>{const e=p.current;e?.startsWith("blob:")&&(h.current=setTimeout(()=>URL.revokeObjectURL(e),0))}),[]);const N=f().preview,A=r?.filename?(L=r.filename).length>24?`${L.slice(0,23)}…`:L:N.untitled;var L;const M=y(null),j=y(null),[z,T]=g(null),[R,D]=g(!1),W=y(0),H=()=>M.current?.click(),O=()=>{W.current=0,D(!1)},I=e=>{const t=e.closest("[data-modal-id]");return!t||c()===t.dataset.modalId};b(()=>{const e=()=>O(),t=()=>O(),n=e=>{"Escape"===e.key&&O()};return window.addEventListener("dragend",e),window.addEventListener("drop",t),window.addEventListener("keydown",n),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",t),window.removeEventListener("keydown",n)}},[]);const X=e=>{const t=(e.name.split(".").pop()||"").toLowerCase(),n="pdf"===t?"pdf":"dxf"===t?"dxf":["jpg","jpeg","png","gif","webp","svg","avif","bmp"].includes(t)?"image":["stp","step","stl","obj","gltf","glb","3mf","iges","igs","ply","fbx"].includes(t)?"3d":void 0;if(!n)return void("dwg"===t?m.error(N.dwgUnsupported):m.error(N.unsupportedType(t)));const r=URL.createObjectURL(e);u(t=>(t?.url?.startsWith("blob:")&&t.url!==r&&URL.revokeObjectURL(t.url),{url:r,filename:e.name,kind:n}))},U=/* @__PURE__ */w("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
2
- /* @__PURE__ */v("input",{ref:M,type:"file",accept:".pdf,.dxf,.jpg,.jpeg,.png,.gif,.webp,.svg,.avif,.bmp,.stp,.step,.stl,.obj,.gltf,.glb,.3mf,.iges,.igs,.ply,.fbx",onChange:e=>{const t=e.target.files?.[0];t&&X(t),M.current&&(M.current.value="")},className:"hidden"}),
3
- /* @__PURE__ */w("button",{onClick:H,className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
4
- /* @__PURE__ */v(d,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),N.open]}),
5
- /* @__PURE__ */v("span",{className:"text-2xs text-ink-faintest ml-1",children:N.formats}),r?.filename&&/* @__PURE__ */w(k,{children:[
6
- /* @__PURE__ */v("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
7
- /* @__PURE__ */v("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:r.filename,children:r.filename})]}),
8
- /* @__PURE__ */v("div",{ref:T,className:"ml-auto flex items-center gap-1 text-xs"})]});let B;if(r)B=r.converting||!r.url?/* @__PURE__ */v(E,{filename:r.filename,message:r.convertingMessage}):"dxf"===r.kind?/* @__PURE__ */v(S,{url:r.url,filename:r.filename,onDownload:r.onDownload,onEmail:r.onEmail},r.url):"3d"===r.kind?/* @__PURE__ */v(F,{url:r.url,filename:r.filename,onDownload:r.onDownload,onEmail:r.onEmail},r.url):"image"===r.kind?/* @__PURE__ */v(P,{url:r.url,filename:r.filename,onDownload:r.onDownload,onEmail:r.onEmail},r.url):/* @__PURE__ */v(e,{url:r.url,filename:r.filename,onDownload:r.onDownload,onEmail:r.onEmail},r.url);else{const[e,t]=x(N.dropHere),[n,r]=x(N.formatDxf),[s,i]=x(N.format3d);B=/* @__PURE__ */w("div",{className:"flex flex-1 flex-col items-center justify-center text-gray-500 text-sm gap-3 p-8 text-center",children:[
9
- /* @__PURE__ */v(d,{name:"page",className:"h-12 w-12 text-gray-300",strokeWidth:1.5}),
10
- /* @__PURE__ */w("p",{className:"font-medium text-gray-700",children:[e,
11
- /* @__PURE__ */v("button",{onClick:H,className:"text-blue-600 hover:underline",children:N.open}),t]}),
12
- /* @__PURE__ */w("div",{className:"text-xs text-gray-500 max-w-sm",children:[
13
- /* @__PURE__ */v("p",{className:"font-semibold uppercase tracking-wide text-3xs text-ink-faintest mb-1",children:N.supportedFormats}),
14
- /* @__PURE__ */w("ul",{className:"space-y-0.5",children:[
15
- /* @__PURE__ */w("li",{children:[
16
- /* @__PURE__ */v("span",{className:"font-mono text-gray-700",children:".pdf"})," — ",N.formatPdf]}),
17
- /* @__PURE__ */w("li",{children:[
18
- /* @__PURE__ */v("span",{className:"font-mono text-gray-700",children:".dxf"})," — ",n,
19
- /* @__PURE__ */v("span",{className:"font-mono",children:"dxf-viewer"}),r]}),
20
- /* @__PURE__ */w("li",{children:[
21
- /* @__PURE__ */v("span",{className:"font-mono text-gray-700",children:".stp .step .stl .obj .gltf .glb .3mf .iges"})," — ",s,
22
- /* @__PURE__ */v("span",{className:"font-mono",children:"online-3d-viewer"}),i]}),
23
- /* @__PURE__ */w("li",{children:[
24
- /* @__PURE__ */v("span",{className:"font-mono text-gray-700",children:".jpg .jpeg .png .gif .webp .svg .avif .bmp"})," — ",N.formatImage]})]}),
25
- /* @__PURE__ */v("p",{className:"mt-2 text-2xs text-ink-faintest italic",children:N.dwgNote})]})]})}/* @__PURE__ */
26
- return w("div",{className:"relative flex flex-col h-full",ref:j,onDragEnter:e=>{e.dataTransfer?.types?.includes?.("Files")&&I(e.currentTarget)&&(e.preventDefault(),W.current++,R||D(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&I(e.currentTarget)&&e.preventDefault()},onDragLeave:()=>{W.current>0&&W.current--,0===W.current&&D(!1)},onDrop:e=>{I(e.currentTarget)?(e=>{e.preventDefault(),O();const t=e.dataTransfer.files?.[0];t&&X(t)})(e):O()},children:[
27
- /* @__PURE__ */v(l,{title:N.windowTitle(A)}),
28
- /* @__PURE__ */v(s,{app:"preview"}),U,
29
- /* @__PURE__ */v(t.Provider,{value:z,children:/* @__PURE__ */v("div",{className:"flex-1 min-h-0",children:B})}),R&&/* @__PURE__ */v("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */v("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:N.dropToOpen})})]})}function E({filename:e,message:t}){const n=f().preview;/* @__PURE__ */
30
- return w("div",{className:"flex flex-col items-center justify-center h-full bg-gray-100 gap-4 px-8",children:[
31
- /* @__PURE__ */w("div",{className:"flex flex-col items-center gap-3",children:[
32
- /* @__PURE__ */v(u,{className:"h-12 w-12"}),
33
- /* @__PURE__ */v("div",{className:"text-base font-semibold tracking-wide text-gray-700 uppercase",children:t||n.converting}),
34
- /* @__PURE__ */v("div",{className:"text-xs text-gray-400 truncate max-w-md",children:e})]}),
35
- /* @__PURE__ */v("div",{className:"w-72 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */v("div",{className:"h-full w-1/3 bg-blue-500 rounded-full animate-pulse",style:{animation:"preview-bar 1.4s ease-in-out infinite"}})}),
36
- /* @__PURE__ */v("style",{children:"@keyframes preview-bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }"})]})}var L=["https://cdn.jsdelivr.net/gh/vagran/dxf-viewer-example-src@master/src/assets/fonts/Roboto-LightItalic.ttf","https://cdn.jsdelivr.net/gh/vagran/dxf-viewer-example-src@master/src/assets/fonts/NotoSansDisplay-SemiCondensedLightItalic.ttf","https://cdn.jsdelivr.net/gh/vagran/dxf-viewer-example-src@master/src/assets/fonts/NanumGothic-Regular.ttf"],M={l:"LINE",line:"LINE",pl:"PLINE",pline:"PLINE",ex:"EXTEND",extend:"EXTEND",tr:"TRIM",trim:"TRIM",e:"ERASE",erase:"ERASE",m:"MOVE",move:"MOVE",co:"COPY",cp:"COPY",copy:"COPY",o:"OFFSET",offset:"OFFSET",f:"FILLET",fillet:"FILLET",cha:"CHAMFER",chamfer:"CHAMFER",x:"EXPLODE",explode:"EXPLODE",mi:"MIRROR",mirror:"MIRROR",ro:"ROTATE",rotate:"ROTATE",sc:"SCALE",scale:"SCALE",s:"STRETCH",stretch:"STRETCH",ar:"ARRAY",array:"ARRAY",rec:"RECTANG",rectang:"RECTANG",rectangle:"RECTANG",c:"CIRCLE",circle:"CIRCLE",a:"ARC",arc:"ARC",el:"ELLIPSE",ellipse:"ELLIPSE",t:"MTEXT",mt:"MTEXT",mtext:"MTEXT",text:"TEXT",b:"BLOCK",block:"BLOCK",i:"INSERT",insert:"INSERT",ha:"HATCH",hatch:"HATCH"};function S({url:e,filename:t,onDownload:r,onEmail:s}){const i=y(null),o=y(null),[a,l]=g(!0),[u,m]=g(null),[N,C]=g([]),[A,E]=g(!1),[S,j]=g(!0),z=f(),T=z.drawing,R=z.preview,F=y(T);F.current=T;const[P,W]=g(!1),[H,O]=g("auto"),[I,X]=g(null),[U,B]=g(null),[G,V]=g(null),[Y,_]=g(""),$=y(H),K=y(G);b(()=>{$.current=H},[H]),b(()=>{K.current=G},[G]);const Z=y(null),Q=y(null),J=y(null),[q,ee]=g(""),[te,ne]=g(null),re=y(""),se=y(null),ie=y(null),oe=y(null);b(()=>{let t=!1,n=null;return l(!0),m(null),C([]),(async()=>{let r;try{r=(await(import("dxf-viewer"))).DxfViewer}catch(e){return void(t||(m(F.current.notInstalled),l(!1)))}if(!t&&i.current)try{if(await new Promise(e=>{const t=()=>{const n=i.current?.getBoundingClientRect();n&&n.width>4&&n.height>4?e():requestAnimationFrame(t)};t()}),t||!i.current)return;const s={autoResize:!0},a=r.DefaultOptions?.clearColor;"function"==typeof a?.clone&&(s.clearColor=a.clone().setHex(16777215)),n=new r(i.current,s),o.current=n;const c="undefined"!=typeof window&&window.__REACT_OS_SHELL_DXF_FONTS__||L;if(await n.Load({url:e,fonts:c,workerFactory:null}),t)return;try{const e=n.GetLayers?.()??[];Array.isArray(e)&&C(e.map(e=>({name:e.name,displayName:e.displayName??e.name,color:"number"==typeof e.color?e.color:void 0,visible:!0})))}catch{}const d=()=>{try{const e=i.current?.getBoundingClientRect();e&&e.width>0&&e.height>0&&n.SetSize?.(Math.round(e.width),Math.round(e.height));const t=n.GetBounds?.(),r=n.GetOrigin?.();t&&r&&n.FitView(t.minX-r.x,t.maxX-r.x,t.minY-r.y,t.maxY-r.y),n.Render?.()}catch(e){console.warn("[Preview] DXF refit failed",e)}};d(),requestAnimationFrame(d),l(!1)}catch(e){t||(m(e?.message||F.current.renderFailed),l(!1))}})(),()=>{t=!0;try{n?.Destroy?.()}catch{}o.current=null}},[e]),b(()=>{if(!S||a)return;const e=setTimeout(()=>j(!1),5e3);return()=>clearTimeout(e)},[S,a]);const ae=N.map(e=>e.visible?"1":"0").join("");b(()=>{const e=o.current;if(a||u||!e)return;const t=e.GetScene?.(),n=e.GetCamera?.(),r=e.GetCanvas?.();if(!(t&&n&&r&&i.current))return;const s=()=>{const e=oe.current;e&&(e.overlay&&e.overlay.parentElement&&e.overlay.parentElement.removeChild(e.overlay),oe.current=null)};if(!P)return s(),X(null),void B(null);const l=document.createElement("div");l.style.cssText="position:absolute;inset:0;pointer-events:none;z-index:5;",i.current.appendChild(l);const c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;pointer-events:none;");const d=document.createElementNS("http://www.w3.org/2000/svg","defs"),p=document.createElementNS("http://www.w3.org/2000/svg","marker");p.setAttribute("id","dxf-measure-arrow"),p.setAttribute("viewBox","0 0 10 10"),p.setAttribute("refX","9"),p.setAttribute("refY","5"),p.setAttribute("markerWidth","6"),p.setAttribute("markerHeight","6"),p.setAttribute("orient","auto-start-reverse");const m=document.createElementNS("http://www.w3.org/2000/svg","path");m.setAttribute("d","M 0 0 L 10 5 L 0 10 z"),m.setAttribute("fill","#ff8800"),p.appendChild(m),d.appendChild(p),c.appendChild(d),l.appendChild(c);const h=()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","line");return e.setAttribute("stroke","#ff8800"),e.setAttribute("stroke-width","1"),e.setAttribute("stroke-dasharray","6,4"),e.setAttribute("opacity","0.55"),e.style.display="none",c.appendChild(e),e},f=h(),x=h(),y=document.createElementNS("http://www.w3.org/2000/svg","line");y.setAttribute("stroke","#ff8800"),y.setAttribute("stroke-width","1"),y.setAttribute("opacity","0.85"),y.style.display="none",c.appendChild(y);const g=document.createElementNS("http://www.w3.org/2000/svg","line");g.setAttribute("stroke","#ff8800"),g.setAttribute("stroke-width","1"),g.setAttribute("opacity","0.85"),g.style.display="none",c.appendChild(g);const b=document.createElementNS("http://www.w3.org/2000/svg","line");b.setAttribute("stroke","#ff8800"),b.setAttribute("stroke-width","1.5"),b.setAttribute("stroke-linecap","round"),b.style.display="none",c.appendChild(b);const w=document.createElementNS("http://www.w3.org/2000/svg","line");w.setAttribute("stroke","#ff8800"),w.setAttribute("stroke-width","1.5"),w.setAttribute("stroke-linecap","round"),w.style.display="none",c.appendChild(w);const v=document.createElement("div");v.style.cssText="position:absolute;transform:translate(-50%,-50%);pointer-events:none;display:none;";const k="http://www.w3.org/2000/svg",N=document.createElementNS(k,"svg");N.setAttribute("width","22"),N.setAttribute("height","22"),N.setAttribute("viewBox","0 0 22 22"),N.setAttribute("style","overflow:visible;display:block"),v.appendChild(N);const C=e=>{const t=document.createElementNS(k,"g");return e(t),t.style.display="none",N.appendChild(t),t},A=C(e=>{const t=document.createElementNS(k,"rect");t.setAttribute("x","4"),t.setAttribute("y","4"),t.setAttribute("width","14"),t.setAttribute("height","14"),t.setAttribute("fill","rgba(255,255,255,0.9)"),t.setAttribute("stroke","#ff8800"),t.setAttribute("stroke-width","1.8"),e.appendChild(t)}),E=C(e=>{const t=(e,t,n,r)=>{const s=document.createElementNS(k,"line");return s.setAttribute("x1",String(e)),s.setAttribute("y1",String(t)),s.setAttribute("x2",String(n)),s.setAttribute("y2",String(r)),s.setAttribute("stroke","#ff8800"),s.setAttribute("stroke-width","2.2"),s.setAttribute("stroke-linecap","round"),s};e.appendChild(t(4,4,18,18)),e.appendChild(t(18,4,4,18))}),L=C(e=>{const t=document.createElementNS(k,"polygon");t.setAttribute("points","4,4 18,4 4,18 18,18"),t.setAttribute("fill","rgba(255,255,255,0.9)"),t.setAttribute("stroke","#ff8800"),t.setAttribute("stroke-width","1.8"),t.setAttribute("stroke-linejoin","round"),e.appendChild(t)}),M=C(e=>{const t=document.createElementNS(k,"polygon");t.setAttribute("points","11,3 19,18 3,18"),t.setAttribute("fill","rgba(255,255,255,0.9)"),t.setAttribute("stroke","#ff8800"),t.setAttribute("stroke-width","1.8"),t.setAttribute("stroke-linejoin","round"),e.appendChild(t)}),S=C(e=>{const t=document.createElementNS(k,"circle");t.setAttribute("cx","11"),t.setAttribute("cy","11"),t.setAttribute("r","7"),t.setAttribute("fill","rgba(255,255,255,0.9)"),t.setAttribute("stroke","#ff8800"),t.setAttribute("stroke-width","1.8"),e.appendChild(t);const n=(e,t,n,r)=>{const s=document.createElementNS(k,"line");return s.setAttribute("x1",String(e)),s.setAttribute("y1",String(t)),s.setAttribute("x2",String(n)),s.setAttribute("y2",String(r)),s.setAttribute("stroke","#ff8800"),s.setAttribute("stroke-width","1.6"),s.setAttribute("stroke-linecap","round"),s};e.appendChild(n(6.5,6.5,15.5,15.5)),e.appendChild(n(15.5,6.5,6.5,15.5))});l.appendChild(v),oe.current={picks:[],rawSecondClick:null,overlay:l,svg:c,line:b,fixedLine:w,fixedLabel:null,refLine:f,refLineV:x,extLineA:y,extLineB:g,markers:[],label:null,snap:v,segs:null,nodes:null};const j=n?.position?.constructor??t?.position?.constructor??null;let z=!1;const T=(e,t)=>{if(!j)return{x:0,y:0};const s=new j(e,t,0).project(n),i=r.clientWidth,o=r.clientHeight;return{x:(s.x+1)/2*i,y:(1-s.y)/2*o}};(()=>{try{const e=oe.current;if(!e)return;const n=[],r=[];let s=!1;const i=e=>{const t=e?.attributes?.instanceTransform0,n=e?.attributes?.instanceTransform1;if(t&&n){const e=[],r=Math.min(t.count,n.count);for(let s=0;s<r;s++)e.push([t.getX(s),t.getY(s),t.getZ(s),n.getX(s),n.getY(s),n.getZ(s)]);return e}const r=e?.attributes?.instanceTransform;if(r){const e=[];for(let t=0;t<r.count;t++)e.push([1,0,r.getX(t),0,1,r.getY(t)]);return e}return[[1,0,0,0,1,0]]},o=e=>{const t=!!e?.isLineSegments;if(!t&&!!!e?.isPoints)return;const o=e.geometry,a=o?.attributes?.position;if(!a)return;const l=i(o);if(t){const e=o.index,t=Math.floor((e?e.count:a.count)/2);for(let r=0;r<t;r++){const t=e?e.getX(2*r):2*r,i=e?e.getX(2*r+1):2*r+1,o=a.getX(t),c=a.getY(t),d=a.getX(i),u=a.getY(i);if(Number.isFinite(o+c+d+u))for(const e of l){if(n.length>=16e5)return void(s=!0);const t=e[0]*o+e[1]*c+e[2],r=e[3]*o+e[4]*c+e[5],i=e[0]*d+e[1]*u+e[2],a=e[3]*d+e[4]*u+e[5];t===i&&r===a||n.push(t,r,i,a)}}}else for(let e=0;e<a.count;e++){const t=a.getX(e),n=a.getY(e);if(Number.isFinite(t+n))for(const e of l)r.push(e[0]*t+e[1]*n+e[2],e[3]*t+e[4]*n+e[5])}};"function"==typeof t.traverseVisible?t.traverseVisible(o):t.traverse(o),e.segs=new Float64Array(n),e.nodes=new Float64Array(r),s&&console.warn("[Preview] DXF snap cache truncated at 400000 segments — snapping may miss some geometry."),z=!0}catch{}})();const R=(e,t,n,r,s,i,o,a)=>{const l=(n-e)*(a-i)-(r-t)*(o-s);if(Math.abs(l)<1e-9)return null;const c=((s-e)*(a-i)-(i-t)*(o-s))/l,d=((s-e)*(r-t)-(i-t)*(n-e))/l,u=1e-4;return c<-u||c>1+u||d<-u||d>1+u?null:{px:e+c*(n-e),py:t+c*(r-t),t:c}},H=()=>{const e=document.createElement("div");return e.style.cssText="position:absolute;width:10px;height:10px;border-radius:50%;background:#ff8800;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,0.25);transform:translate(-50%,-50%);pointer-events:none;",l.appendChild(e),e},O=(e,t,n)=>{const r=T(t,n);e.style.left=`${r.x}px`,e.style.top=`${r.y}px`},I=()=>{const e=oe.current;if(!e||!e.rawSecondClick||e.picks.length<2)return;const t=e.picks[0],n=e.rawSecondClick,r=K.current,s=$.current;if(null===r||!Number.isFinite(r)||"horizontal"!==s&&"vertical"!==s)e.picks[1]={x:n.x,y:n.y};else if("horizontal"===s){const s=n.x>=t.x?1:-1;e.picks[1]={x:t.x+s*Math.abs(r),y:n.y}}else{const s=n.y>=t.y?1:-1;e.picks[1]={x:n.x,y:t.y+s*Math.abs(r)}}},U=(e,t)=>{const n=$.current;return"auto"!==n?n:e&&t?Math.abs(t.x-e.x)>=Math.abs(t.y-e.y)?"horizontal":"vertical":"horizontal"},G=()=>{const e=oe.current;if(!e)return;I();const t=$.current,n=K.current,s=null!==n&&Number.isFinite(n)&&("horizontal"===t||"vertical"===t);e.markers[0]&&O(e.markers[0],e.picks[0].x,e.picks[0].y),e.markers[1]&&O(e.markers[1],e.picks[1].x,e.picks[1].y);const i=(t,n,s)=>{if(!t)return;if(!s||e.picks.length<1)return void(t.style.display="none");const i=e.picks[0],o=r.clientWidth,a=r.clientHeight,l=4*Math.hypot(o,a),c=T(i.x,i.y),d=T(i.x+n.dx,i.y+n.dy),u=l/(Math.hypot(d.x-c.x,d.y-c.y)||1),p=T(i.x-n.dx*u,i.y-n.dy*u),m=T(i.x+n.dx*u,i.y+n.dy*u);t.setAttribute("x1",String(p.x)),t.setAttribute("y1",String(p.y)),t.setAttribute("x2",String(m.x)),t.setAttribute("y2",String(m.y)),t.style.display=""};let o="horizontal"===t,a="vertical"===t;if("auto"===t)if(e.picks.length>=2){const t=U(e.picks[0],e.picks[1]);o="horizontal"===t,a="vertical"===t}else o=!0,a=!0;if(i(e.refLine,{dx:1,dy:0},o),i(e.refLineV,{dx:0,dy:1},a),2===e.picks.length){const t=e.picks[0],i=e.picks[1],o=U(t,i),a=(()=>{const e=oe.current,t=e.picks[0],n=e.picks[1],r=U(t,n),s=$.current,i=K.current;return null!==i&&Number.isFinite(i)&&"horizontal"===s?{from:{x:n.x,y:t.y},to:{x:n.x,y:n.y}}:null!==i&&Number.isFinite(i)&&"vertical"===s?{from:{x:t.x,y:n.y},to:{x:n.x,y:n.y}}:"horizontal"===r?{from:t,to:{x:n.x,y:t.y}}:"vertical"===r?{from:t,to:{x:t.x,y:n.y}}:{from:t,to:n}})(),l=T(a.from.x,a.from.y),c=T(a.to.x,a.to.y);e.line.setAttribute("x1",String(l.x)),e.line.setAttribute("y1",String(l.y)),e.line.setAttribute("x2",String(c.x)),e.line.setAttribute("y2",String(c.y)),e.line.setAttribute("marker-start","url(#dxf-measure-arrow)"),e.line.setAttribute("marker-end","url(#dxf-measure-arrow)");const d=Math.hypot(c.x-l.x,c.y-l.y);if(e.line.style.display=d>.5?"":"none",s&&e.fixedLine){const s="horizontal"===o?{x:i.x,y:t.y}:{x:t.x,y:i.y},a=T(t.x,t.y),l=T(s.x,s.y);e.fixedLine.setAttribute("x1",String(a.x)),e.fixedLine.setAttribute("y1",String(a.y)),e.fixedLine.setAttribute("x2",String(l.x)),e.fixedLine.setAttribute("y2",String(l.y)),e.fixedLine.setAttribute("marker-start","url(#dxf-measure-arrow)"),e.fixedLine.setAttribute("marker-end","url(#dxf-measure-arrow)"),e.fixedLine.style.display="";const c=V();c.textContent=D(Math.abs(n));const d=(a.x+l.x)/2,u=(a.y+l.y)/2;c.style.left=`${d}px`,c.style.top=`${u}px`;const p=r.clientWidth,m=r.clientHeight;c.style.display=d<0||u<0||d>p||u>m?"none":""}else e.fixedLine&&(e.fixedLine.style.display="none"),e.fixedLabel&&(e.fixedLabel.style.display="none");const u=e.extLineA,p=e.extLineB;if(!s&&"horizontal"===o&&Math.abs(i.y-t.y)>1e-9){const e=T(i.x,t.y),n=T(i.x,i.y);p.setAttribute("x1",String(e.x)),p.setAttribute("y1",String(e.y)),p.setAttribute("x2",String(n.x)),p.setAttribute("y2",String(n.y)),p.style.display="",u.style.display="none"}else if(!s&&"vertical"===o&&Math.abs(i.x-t.x)>1e-9){const e=T(t.x,i.y),n=T(i.x,i.y);p.setAttribute("x1",String(e.x)),p.setAttribute("y1",String(e.y)),p.setAttribute("x2",String(n.x)),p.setAttribute("y2",String(n.y)),p.style.display="",u.style.display="none"}else u.style.display="none",p.style.display="none";if(e.label){const t=(l.x+c.x)/2,n=(l.y+c.y)/2;e.label.style.left=`${t}px`,e.label.style.top=`${n}px`;const s=r.clientWidth,i=r.clientHeight;e.label.style.display=t<0||n<0||t>s||n>i?"none":"",d<=.5&&(e.label.style.display="none")}}else e.line.style.display="none",e.fixedLine&&(e.fixedLine.style.display="none"),e.fixedLabel&&(e.fixedLabel.style.display="none"),e.extLineA&&(e.extLineA.style.display="none"),e.extLineB&&(e.extLineB.style.display="none")},V=()=>{const e=oe.current;if(e.fixedLabel)return e.fixedLabel;const t=document.createElement("div");return t.style.cssText="position:absolute;left:-9999px;top:-9999px;transform:translate(-50%,-50%);padding:2px 6px;font-size:var(--text-2xs);font-weight:600;font-family:system-ui,-apple-system,sans-serif;background:rgba(255,136,0,0.75);color:#fff;border-radius:4px;white-space:nowrap;box-shadow:0 1px 4px rgba(0,0,0,0.25);pointer-events:none;",l.appendChild(t),e.fixedLabel=t,t};let Y=0,_=0,q=0,ee=!1,te=!1,re=null;const se=e=>{const t=e?.detail;t&&0===t.domEvent?.button&&(Y=t.canvasCoord.x,_=t.canvasCoord.y,q=performance.now(),te=!1,ee=!0)},ie=e=>{const t=r.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;ee&&(n-Y)**2+(s-_)**2>16&&(te=!0);const i=oe.current;var o;if(i&&i.snap)if(ee&&te)i.snap.style.display="none";else if(re=((e,t)=>{const n=oe.current;if(!n||!z||!n.segs)return null;const r=T(0,0),s=T(1,0),i=T(0,1),o=s.x-r.x,a=s.y-r.y,l=i.x-r.x,c=i.y-r.y,d=o*c-l*a;if(!d)return null;const u=((e-r.x)*c-(t-r.y)*l)/d,p=((t-r.y)*o-(e-r.x)*a)/d,m=18/(Math.hypot(o,a)||1),h=18/(Math.hypot(l,c)||1),f=u-m,x=u+m,y=p-h,g=p+h,b=324;let w=null,v=b,k=null,N=b,C=null,A=b,E=null,L=b;const M=[],S=n.segs;for(let n=0;n<S.length;n+=4){const s=S[n],i=S[n+1],d=S[n+2],u=S[n+3];if(s<f&&d<f||s>x&&d>x||i<y&&u<y||i>g&&u>g)continue;const p=r.x+o*s+l*i,m=r.y+a*s+c*i,h=r.x+o*d+l*u,E=r.y+a*d+c*u;let L=!1,j=e-p,z=t-m,T=j*j+z*z;T<b&&(L=!0,T<v&&(v=T,w={sx:s,sy:i,type:"endpoint"})),j=e-h,z=t-E,T=j*j+z*z,T<b&&(L=!0,T<v&&(v=T,w={sx:d,sy:u,type:"endpoint"})),j=e-(p+h)/2,z=t-(m+E)/2,T=j*j+z*z,T<b&&(L=!0,T<N&&(N=T,k={sx:(s+d)/2,sy:(i+u)/2,type:"midpoint"}));const R=h-p,D=E-m,F=R*R+D*D;if(F>0){const n=((e-p)*R+(t-m)*D)/F;n>0&&n<1&&(j=e-(p+n*R),z=t-(m+n*D),T=j*j+z*z,T<b&&(L=!0,T<A&&(A=T,C={sx:s+n*(d-s),sy:i+n*(u-i),type:"line"})))}L&&M.push({ax:s,ay:i,bx:d,by:u,apx:p,apy:m,bpx:h,bpy:E})}const j=n.nodes;if(j)for(let n=0;n<j.length;n+=2){const s=j[n],i=j[n+1];if(s<f||s>x||i<y||i>g)continue;const d=e-(r.x+o*s+l*i),u=t-(r.y+a*s+c*i),p=d*d+u*u;p<v&&(v=p,w={sx:s,sy:i,type:"node"})}for(let n=0;n<M.length;n++){const r=M[n];for(let s=n+1;s<M.length;s++){const n=M[s],i=R(r.apx,r.apy,r.bpx,r.bpy,n.apx,n.apy,n.bpx,n.bpy);if(!i)continue;const o=e-i.px,a=t-i.py,l=o*o+a*a;l>=b||l>=L||(L=l,E={sx:r.ax+i.t*(r.bx-r.ax),sy:r.ay+i.t*(r.by-r.ay),type:"intersection"})}}return(E&&w?L<v-1?E:w:E??w)??k??C})(n,s),re){const e=T(re.sx,re.sy);i.snap.style.left=`${e.x}px`,i.snap.style.top=`${e.y}px`,i.snap.style.display="",o=re.type,A.style.display="endpoint"===o?"":"none",E.style.display="intersection"===o?"":"none",L.style.display="line"===o?"":"none",M.style.display="midpoint"===o?"":"none",S.style.display="node"===o?"":"none"}else i.snap.style.display="none"},ae=e=>{if(!ee)return;ee=!1;const t=performance.now()-q;if(te||t>350)return;const n=e?.detail?.position;if(!n)return;const r=re?{x:re.sx,y:re.sy}:{x:n.x,y:n.y};ue(r)},le=()=>{const e=oe.current;if(!e||2!==e.picks.length)return;I();const t=e.picks[0],n=e.picks[1],r=$.current,s=U(t,n),i=K.current,o=null!==i&&Number.isFinite(i)&&("horizontal"===r||"vertical"===r);let a,c,d="",u=s;const p=Math.abs(n.x-t.x),m=Math.abs(n.y-t.y);if(o&&"horizontal"===r?(a=m,d=" ↕",u="vertical",c=F.current.echoLocked("ΔY",D(m),"ΔX",D(Math.abs(i)))):o&&"vertical"===r?(a=p,d=" ↔",u="horizontal",c=F.current.echoLocked("ΔX",D(p),"ΔY",D(Math.abs(i)))):"horizontal"===s?(a=p,d=" ↔",c=F.current.echoLinear(D(p),"ΔX")):"vertical"===s?(a=m,d=" ↕",c=F.current.echoLinear(D(m),"ΔY")):(a=Math.hypot(n.x-t.x,n.y-t.y),c=F.current.echoDistance(D(a),D(p),D(m))),!Number.isFinite(a))return X(null),B(null),void(e.label&&(e.label.style.opacity="0"));X(a),B(u),ne(c);const h=(()=>{const e=oe.current;if(e.label)return e.label;const t=document.createElement("div");return t.style.cssText="position:absolute;left:-9999px;top:-9999px;transform:translate(-50%,-50%);padding:2px 6px;font-size:var(--text-2xs);font-weight:600;font-family:system-ui,-apple-system,sans-serif;background:rgba(255,136,0,0.95);color:#fff;border-radius:4px;white-space:nowrap;box-shadow:0 1px 4px rgba(0,0,0,0.25);pointer-events:none;",l.appendChild(t),e.label=t,t})();h.style.opacity="1",h.textContent=`${D(a)}${d}`};Z.current=()=>{le(),G()};const ce=e=>{e.line.style.display="none",e.fixedLine&&(e.fixedLine.style.display="none"),e.fixedLabel&&(e.fixedLabel.style.display="none"),e.extLineA&&(e.extLineA.style.display="none"),e.extLineB&&(e.extLineB.style.display="none"),e.label&&(e.label.style.opacity="0"),X(null),B(null)},de=()=>{const e=oe.current;if(e){for(const t of e.markers)t.parentElement?.removeChild(t);e.markers=[],e.picks=[],e.rawSecondClick=null,e.refLine&&(e.refLine.style.display="none"),e.refLineV&&(e.refLineV.style.display="none"),ce(e)}};Q.current=de,J.current=()=>{const e=oe.current;if(!e||0===e.picks.length)return;e.picks.pop();const t=e.markers.pop();t?.parentElement?.removeChild(t),e.rawSecondClick=null,ce(e),G()};const ue=e=>{const t=oe.current;t&&(2===t.picks.length&&de(),0===t.picks.length?(t.picks.push({x:e.x,y:e.y}),t.markers.push(H())):(t.rawSecondClick={x:e.x,y:e.y},t.picks.push({x:e.x,y:e.y}),t.markers.push(H()),le()),G())},pe=e=>{"Escape"===e.key&&W(!1)};r.style.cursor="crosshair";try{e.Subscribe?.("pointerdown",se)}catch{}try{e.Subscribe?.("pointerup",ae)}catch{}try{e.Subscribe?.("viewChanged",G)}catch{}return r.addEventListener("pointermove",ie),window.addEventListener("keydown",pe),()=>{r.style.cursor="";try{e.Unsubscribe?.("pointerdown",se)}catch{}try{e.Unsubscribe?.("pointerup",ae)}catch{}try{e.Unsubscribe?.("viewChanged",G)}catch{}r.removeEventListener("pointermove",ie),window.removeEventListener("keydown",pe),Z.current=null,Q.current=null,J.current=null,s(),X(null),B(null)}},[P,a,u,ae]),b(()=>{Z.current?.()},[H,G]);const le=e=>{C(t=>t.map(t=>{if(t.visible===e)return t;try{o.current?.ShowLayer?.(t.name,e)}catch{}return{...t,visible:e}}))},ce=()=>{try{const e=o.current,t=e?.GetBounds?.(),n=e?.GetOrigin?.();t&&n?e.FitView(t.minX-n.x,t.maxX-n.x,t.minY-n.y,t.maxY-n.y):e?.FitView?.(),e?.Render?.()}catch{}};b(()=>{const e=e=>{if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)return;if(1!==e.key.length||" "===e.key)return;const t=e.target;if(t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable))return;const n=ie.current;if(!n)return;const r=n.closest("[data-modal-id]");r&&c()!==r.dataset.modalId||se.current?.focus()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);const de=y(q),ue=y(P);b(()=>{de.current=q},[q]),b(()=>{ue.current=P},[P]),b(()=>h(()=>{const e=ie.current;if(!e)return!1;const t=e.closest("[data-modal-id]");return!(!t||c()!==t.dataset.modalId)&&(de.current?(ee(""),ne(F.current.cancelled),!0):!!ue.current&&(W(!1),ne(F.current.measureOff),!0))}),[]);const pe="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1",[me,he]=x(T.typeToMeasure);/* @__PURE__ */
37
- return w("div",{ref:ie,className:"flex flex-col h-full",children:[
38
- /* @__PURE__ */w(n,{children:[
39
- /* @__PURE__ */w("button",{onClick:()=>E(e=>!e),className:pe+(A?" bg-gray-200":""),title:T.layersHint,disabled:0===N.length,children:[
40
- /* @__PURE__ */v(d,{name:"layers",className:"h-3.5 w-3.5",strokeWidth:1.5}),T.layers," ",N.length>0&&/* @__PURE__ */w("span",{className:"text-gray-400",children:["(",N.filter(e=>e.visible).length,"/",N.length,")"]})]}),
41
- /* @__PURE__ */v("button",{onClick:()=>j(e=>!e),className:pe,title:R.howToNavigate,children:/* @__PURE__ */v(d,{name:"help",className:"h-3.5 w-3.5",strokeWidth:1.5})}),
42
- /* @__PURE__ */w("button",{onClick:()=>W(e=>!e),className:pe+(P?" bg-gray-200":""),title:P?R.stopMeasuring:T.measureHint,children:[
43
- /* @__PURE__ */w("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[
44
- /* @__PURE__ */v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 14.25l6-6 6 6 4.5-4.5M9.75 8.25v3M12.75 11.25v3M15.75 14.25v3"}),
45
- /* @__PURE__ */v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75h19.5"})]}),T.measure]}),P&&/* @__PURE__ */w(k,{children:[
46
- /* @__PURE__ */w("div",{className:"flex items-stretch h-7 rounded border border-line overflow-hidden text-2xs font-semibold",children:[
47
- /* @__PURE__ */v("button",{onClick:()=>O("auto"),className:"px-2 transition-colors "+("auto"===H?"bg-orange-500 text-white":"bg-white text-gray-600 hover:bg-gray-50"),title:T.autoHint,children:T.auto}),
48
- /* @__PURE__ */v("button",{onClick:()=>O("horizontal"),className:"px-2 transition-colors "+("horizontal"===H?"bg-orange-500 text-white":"bg-white text-gray-600 hover:bg-gray-50"),title:T.horizontalHint,children:"H"}),
49
- /* @__PURE__ */v("button",{onClick:()=>O("vertical"),className:"px-2 transition-colors "+("vertical"===H?"bg-orange-500 text-white":"bg-white text-gray-600 hover:bg-gray-50"),title:T.verticalHint,children:"V"}),
50
- /* @__PURE__ */v("button",{onClick:()=>O("point"),className:"px-2 transition-colors "+("point"===H?"bg-orange-500 text-white":"bg-white text-gray-600 hover:bg-gray-50"),title:T.pointHint,children:T.point})]}),("horizontal"===H||"vertical"===H)&&/* @__PURE__ */w("div",{className:"flex items-center gap-1",children:[
51
- /* @__PURE__ */v("input",{type:"number",inputMode:"decimal",step:"any",value:Y,placeholder:"horizontal"===H?T.fixX:T.fixY,onChange:e=>{const t=e.target.value;if(_(t),""===t.trim())V(null);else{const e=parseFloat(t);V(Number.isFinite(e)&&0!==e?e:null)}},className:"h-7 w-20 px-2 text-2xs font-mono rounded border border-line bg-surface text-ink focus:outline-none focus:border-orange-400",title:T.fixHint}),null!==G&&/* @__PURE__ */v("button",{onClick:()=>{V(null),_("")},className:"text-ink-faintest hover:text-gray-600 text-2xs px-1",title:T.clearFixed,children:"×"})]})]}),P&&null!==I&&/* @__PURE__ */w("div",{className:"px-2 py-1 text-2xs font-mono font-semibold text-orange-600 bg-orange-50 border border-orange-200 rounded whitespace-nowrap",title:"horizontal"===U?T.horizontalDistance("auto"===H):"vertical"===U?T.verticalDistance("auto"===H):T.straightDistance,children:[D(I),"horizontal"===U?" ↔":"vertical"===U?" ↕":""]}),
52
- /* @__PURE__ */v("button",{onClick:ce,className:pe,title:T.fitHint,children:T.fit}),
53
- /* @__PURE__ */w("button",{onClick:r??(()=>{const n=document.createElement("a");n.href=e,n.download=t,n.click()}),className:pe,children:[
54
- /* @__PURE__ */v(d,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),R.download]}),s&&/* @__PURE__ */w("button",{onClick:s,className:pe,children:[
55
- /* @__PURE__ */v(d,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),R.email]})]}),
56
- /* @__PURE__ */w("div",{className:"relative flex-1 bg-white min-h-0",children:[
57
- /* @__PURE__ */v("div",{ref:i,style:{width:"100%",height:"100%"}}),A&&N.length>0&&/* @__PURE__ */w("div",{className:"absolute top-2 right-2 w-64 max-h-[70%] flex flex-col bg-white/95 backdrop-blur border border-gray-200 rounded-md shadow-xl z-10 text-xs",children:[
58
- /* @__PURE__ */w("div",{className:"flex items-center justify-between px-2 min-h-8 py-1 border-b border-line bg-surface-sunken",children:[
59
- /* @__PURE__ */v("span",{className:"font-medium text-gray-700",children:T.layers}),
60
- /* @__PURE__ */w("div",{className:"flex items-center gap-1",children:[
61
- /* @__PURE__ */v("button",{onClick:()=>le(!0),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-600",children:T.allLayers}),
62
- /* @__PURE__ */v("button",{onClick:()=>le(!1),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-600",children:T.noLayers}),
63
- /* @__PURE__ */v("button",{onClick:()=>E(!1),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-600",title:R.closePanel,children:"×"})]})]}),
64
- /* @__PURE__ */v("div",{className:"overflow-y-auto py-1",children:N.map(e=>{/* @__PURE__ */return w("label",{className:"flex items-center gap-2 px-2 py-1 hover:bg-gray-100 cursor-pointer",children:[
65
- /* @__PURE__ */v("input",{type:"checkbox",checked:e.visible,onChange:()=>{return t=e.name,void C(e=>e.map(e=>{if(e.name!==t)return e;const n=!e.visible;try{o.current?.ShowLayer?.(t,n)}catch{}return{...e,visible:n}}));var t},className:"h-3.5 w-3.5"}),
66
- /* @__PURE__ */v("span",{className:"inline-block h-3 w-3 rounded-sm border border-gray-300 shrink-0",style:{background:(t=e.color,"number"!=typeof t?"#999":"#"+t.toString(16).padStart(6,"0"))}}),
67
- /* @__PURE__ */v("span",{className:"truncate text-gray-700",title:e.displayName,children:e.displayName||e.name})]},e.name);var t})})]}),S&&!a&&!u&&/* @__PURE__ */w("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 bg-gray-900/85 text-on-accent text-2xs px-3 min-h-8 py-1 rounded-full shadow-lg flex items-center gap-3 z-10 pointer-events-none",children:[
68
- /* @__PURE__ */w("span",{className:"flex items-center gap-1",children:[
69
- /* @__PURE__ */v("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})}),T.dragToPan]}),
70
- /* @__PURE__ */v("span",{className:"text-white/40",children:"•"}),
71
- /* @__PURE__ */w("span",{className:"flex items-center gap-1",children:[
72
- /* @__PURE__ */v(d,{name:"zoom-in",className:"h-3.5 w-3.5",strokeWidth:1.8}),R.scrollToZoom]}),
73
- /* @__PURE__ */v("span",{className:"text-white/40",children:"•"}),
74
- /* @__PURE__ */v("span",{children:T.fitToReset}),
75
- /* @__PURE__ */v("span",{className:"text-white/40",children:"•"}),
76
- /* @__PURE__ */w("span",{children:[me,
77
- /* @__PURE__ */v("span",{className:"font-mono font-semibold",children:"DI"})," / ",
78
- /* @__PURE__ */v("span",{className:"font-mono font-semibold",children:"DIM"}),he]})]}),a&&/* @__PURE__ */v("div",{className:"absolute inset-0 flex items-center justify-center bg-white/80",children:/* @__PURE__ */v(p,{size:"sm",padding:"",label:T.loading})}),u&&/* @__PURE__ */v("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-red-600 px-6 text-center",children:u})]}),
79
- /* @__PURE__ */w("div",{className:"shrink-0 border-t border-gray-200 bg-gray-50",children:[te&&/* @__PURE__ */v("div",{className:"px-3 pt-1 text-2xs font-mono text-ink-faint truncate",title:te,children:te}),
80
- /* @__PURE__ */w("div",{className:"flex items-center gap-2 px-3 h-7",children:[
81
- /* @__PURE__ */v("span",{className:"text-2xs font-mono font-semibold text-ink-faintest select-none",children:">"}),
82
- /* @__PURE__ */v("input",{ref:se,value:q,onChange:e=>ee(e.target.value),onKeyDown:e=>{"Enter"===e.key||" "===e.key?(e.preventDefault(),(e=>{const t=e.trim()||re.current;if(ee(""),!t)return;const n=t.toLowerCase().split(/\s+/)[0],r=()=>{re.current=t},s=(e,t)=>{W(!0),O(e),Q.current?.(),ne(t),r()};if(/^-?(\d+\.?\d*|\.\d+)$/.test(n))if(!P||"horizontal"!==H&&"vertical"!==H)ne(T.fixedNeedsAxis);else{const e=parseFloat(n);e?(_(n),V(e),ne(T.axisLocked("horizontal"===H?"ΔX":"ΔY",D(Math.abs(e))))):(_(""),V(null),ne(T.fixedCleared))}else switch(n){case"di":case"dist":case"mea":case"measuregeom":s("point",T.echoDist);break;case"dim":case"dli":case"dimlin":case"dimlinear":s("auto",T.echoDimLinear);break;case"h":case"hor":case"horizontal":W(!0),O("horizontal"),ne(T.echoHorizontal),r();break;case"v":case"ver":case"vertical":W(!0),O("vertical"),ne(T.echoVertical),r();break;case"au":case"auto":W(!0),O("auto"),ne(T.echoAuto),r();break;case"measure":W(!P),ne(P?T.measureOff:T.measureOn),r();break;case"u":case"undo":J.current?.(),ne(T.pickRemoved),r();break;case"z":case"ze":case"zoom":case"fit":case"zoomextents":ce(),ne(T.zoomExtents),r();break;case"la":case"layer":case"layers":E(e=>!e),ne(T.layersToggled),r();break;case"off":case"clear":V(null),_(""),Q.current?.(),ne(T.measurementCleared),r();break;case"?":case"help":ne(T.commandHelp);break;default:{const e=M[n];ne(e?T.readOnly(e):T.unknownCommand(n.toUpperCase()))}}})(q)):"Escape"===e.key&&(q?(e.stopPropagation(),ee(""),ne(T.cancelled)):e.target.blur())},placeholder:T.commandPlaceholder,spellCheck:!1,autoComplete:"off",className:"flex-1 min-w-0 bg-transparent text-2xs font-mono text-ink focus:outline-none placeholder:text-gray-300"})]})]})]})}var j="https://cdn.jsdelivr.net/npm/online-3d-viewer@0.18.0/libs/";function z(e,t,n=0){return{id:e.GetId?.()??0,name:e.GetName?.()||(0===n?t.root:t.node),isMeshNode:!!e.IsMeshNode?.(),meshIndices:e.GetMeshIndices?.()??[],children:(e.GetChildNodes?.()??[]).map(e=>z(e,t,n+1))}}function T(e,t){t.add(e.id);for(const n of e.children)T(n,t)}function R(e,t){const n=/^#?([0-9a-f]{6})$/i.exec(t),r=n?parseInt(n[1],16):0;return new e.RGBColor(r>>16&255,r>>8&255,255&r)}function D(e){return e>=1e3?`${(e/1e3).toFixed(3)} m`:`${e.toFixed(2)} mm`}function F({url:e,filename:t,onDownload:r,onEmail:s}){const i=y(null),o=y(null),a=y(null),[l,c]=g(!0),[u,m]=g(null),[h,x]=g(!0),k=f(),C=k.model,A=k.preview,E=y(C);E.current=C;const[L,M]=g(null),[S,F]=g({}),[P,W]=g(/* @__PURE__ */new Set),[H,O]=g("#f5f6f8"),[I,X]=g(!0),[U,B]=g("#000000"),[G,V]=g(1),[Y,_]=g(!1),[$,K]=g(!1),[Z,Q]=g(!1),[J,q]=g(!1),[ee,te]=g("x"),[ne,re]=g(!1),[se,ie]=g(.5),[oe,ae]=g(0),[le,ce]=g(!1),[de,ue]=g("point"),[pe,me]=g(null),he=y(null),fe=y(null);b(()=>{let n=!1,r=null,s=null;return c(!0),m(null),M(null),F({}),W(/* @__PURE__ */new Set),(async()=>{let l;try{l=await(import("online-3d-viewer"))}catch{return void(n||(m(E.current.notInstalled),c(!1)))}if(a.current=l,!n&&i.current&&(await new Promise(e=>{const t=()=>{const n=i.current?.getBoundingClientRect();n&&n.width>4&&n.height>4?e():requestAnimationFrame(t)};t()}),!n&&i.current))try{const a="undefined"!=typeof window&&window.__REACT_OS_SHELL_O3DV_LIBS__||j;l.SetExternalLibLocation?.(a),function(){if(N)return;if("undefined"==typeof HTMLCanvasElement)return;N=!0;const e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,n){return"webgl"!==t&&"webgl2"!==t&&"experimental-webgl"!==t||(n={...n||{},stencil:!0}),e.call(this,t,n)},console.info("[Preview] section: canvas getContext patched (force stencil=true)")}(),r=new l.EmbeddedViewer(i.current,{backgroundColor:new l.RGBAColor(245,246,248,255),defaultColor:new l.RGBColor(180,188,200),edgeSettings:new l.EdgeSettings(!0,new l.RGBColor(0,0,0),1),onModelLoaded:()=>{if(!n){try{const e=r.GetModel?.(),t=e?.GetRootNode?.();if(t){const e=z(t,{root:E.current.rootNode,node:E.current.node});M(e);const n={[e.id]:!0};for(const t of e.children)n[t.id]=!0;F(n)}}catch(e){console.warn("[Preview] mesh tree extraction failed",e)}c(!1)}},onModelLoadFailed:()=>{n||(m(E.current.loadFailed),c(!1))}}),o.current=r;const d=new l.InputFile(t,l.FileSource.Url,e);r.LoadModelFromInputFiles([d]),i.current&&"undefined"!=typeof ResizeObserver&&(s=new ResizeObserver(()=>{try{const e=o.current;e?.Resize?e.Resize():e?.viewer?.Resize&&e.viewer.Resize(),e?.viewer?.Render?.()}catch{}}),s.observe(i.current))}catch(e){n||(m(e?.message||E.current.loadFailed),c(!1))}})(),()=>{n=!0;try{s?.disconnect()}catch{}try{r?.Destroy?.()}catch{}o.current=null}},[e,t]),b(()=>{const e=o.current;if(e?.viewer)try{const t=e=>{if(e.userData?.__sectionHelper)return;const t=e.userData?.originalMeshInstance??e.userData,n=t?.id?.nodeId??t?.nodeId;"number"==typeof n&&(e.visible=!P.has(n))};e.viewer.mainModel?.EnumerateMeshesAndLines?.(t),e.viewer.mainModel?.EnumerateEdges?.(t),e.viewer.Render?.()}catch(e){console.warn("[Preview] visibility update failed",e)}},[P,L]),b(()=>{const e=a.current,t=o.current;if(e&&t?.viewer)try{t.viewer.SetEdgeSettings(new e.EdgeSettings(I,R(e,U),G));const n=fe.current;if(n){const e=[];t.viewer.mainModel?.EnumerateEdges?.(t=>{t.userData?.__sectionHelper&&e.push(t)});for(const t of e)t.parent?.remove(t),t.geometry?.dispose?.(),t.material?.dispose?.();const r=n.plane,s=e=>{e&&!n.materialState.has(e)&&(n.materialState.set(e,{clippingPlanes:e.clippingPlanes,clipShadows:e.clipShadows}),e.clippingPlanes=[r],e.clipShadows=!0,e.needsUpdate=!0)};t.viewer.mainModel?.EnumerateEdges?.(e=>{const t=e.material;if(Array.isArray(t))for(const e of t)s(e);else s(t)})}t.viewer.Render?.()}catch{}},[I,U,G]),b(()=>{const e=a.current,t=o.current;if(e&&t?.viewer)try{const n=R(e,H);t.viewer.SetBackgroundColor(new e.RGBAColor(n.r,n.g,n.b,255)),t.viewer.Render?.()}catch{}},[H]),b(()=>{const e=o.current;if(!e?.viewer||l)return;const t=e.viewer.renderer,n=e.viewer.scene;if(!t||!n)return;if(fe.current){const e=fe.current;for(const[t,n]of e.materialState.entries())t.clippingPlanes=n.clippingPlanes,t.clipShadows=n.clipShadows,t.needsUpdate=!0;for(const t of e.helpers)t.parent?.remove(t),t.material?.dispose?.();e.capMesh&&(n.remove(e.capMesh),e.capMesh.geometry?.dispose?.(),e.capMesh.material?.dispose?.()),fe.current=null}if(!J)return t.localClippingEnabled=!1,void e.viewer.Render?.();const r=e.viewer.GetBoundingBox?.(()=>!0);if(!r)return;const s=[];if(e.viewer.mainModel?.EnumerateMeshes?.(e=>{e.userData?.__sectionHelper||s.push(e)}),!s.length)return t.localClippingEnabled=!1,void e.viewer.Render?.();const i=s[0],a=i.constructor,c=i.material?.constructor,d=i.geometry?.constructor,u=i.geometry?.attributes?.position?.constructor;a&&c&&d&&u||console.warn("[Preview] section: missing THREE constructors, falling back to no cap");const p=7681;let m=!0;try{const e=t.getContext?.(),n=e?.getContextAttributes?.();m=!1!==n?.stencil,t.autoClearStencil=!0,console.info("[Preview] section: stencil buffer =",m,"targets =",s.length)}catch{}t.localClippingEnabled=!0;const h={normal:{x:0,y:0,z:-1},constant:0,clone:function e(){const t={normal:{x:this.normal.x,y:this.normal.y,z:this.normal.z},constant:this.constant};return t.clone=e,t}},f=[],x=/* @__PURE__ */new Map,y=e=>{e&&!x.has(e)&&(x.set(e,{clippingPlanes:e.clippingPlanes,clipShadows:e.clipShadows}),e.clippingPlanes=[h],e.clipShadows=!0,e.needsUpdate=!0)};for(const e of s){const t=e.material;if(Array.isArray(t))for(const e of t)y(e);else y(t);const n=Array.isArray(t)?t[0]:t;if(a&&m&&n?.clone){const t=(t,r)=>{const s=n.clone();s.depthWrite=!1,s.depthTest=!1,s.colorWrite=!1,s.stencilWrite=!0,s.stencilFunc=519,s.stencilFail=r,s.stencilZFail=r,s.stencilZPass=r,s.side=t,s.transparent=!1,s.clippingPlanes=[h],s.clipShadows=!0,s.needsUpdate=!0;const i=new a(e.geometry,s);i.matrixAutoUpdate=!1,i.renderOrder=1,i.userData.__sectionHelper=!0,e.add(i),f.push(i)};t(1,7682),t(0,7683)}}e.viewer.mainModel?.EnumerateEdges?.(e=>{const t=e.material;if(Array.isArray(t))for(const e of t)y(e);else y(t)});let g=null;const b=s[0]?.material&&(Array.isArray(s[0].material)?s[0].material[0]:s[0].material);if(m&&a&&d&&u&&b?.clone){const e=r.max.x-r.min.x,t=r.max.y-r.min.y,s=r.max.z-r.min.z,i=2*Math.max(e,t,s,1)/2,o=new d,l=new Float32Array([-i,-i,0,i,-i,0,i,i,0,-i,i,0]),c=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1]);o.setAttribute("position",new u(l,3)),o.setAttribute("normal",new u(c,3)),o.setIndex([0,1,2,0,2,3]);const m=b.clone(),h=b.color?.getHex?.()??11844808;m.emissive?.setHex?.(h),"emissiveIntensity"in m&&(m.emissiveIntensity=.25),m.side=2,m.transparent=!1,m.opacity=1,m.stencilWrite=!0,m.stencilRef=0,m.stencilFunc=517,m.stencilFail=p,m.stencilZFail=p,m.stencilZPass=p,m.clippingPlanes=[],m.polygonOffset=!0,m.polygonOffsetFactor=-1,m.polygonOffsetUnits=-1,m.needsUpdate=!0,g=new a(o,m),g.renderOrder=2,g.userData.__sectionHelper=!0,n.add(g)}fe.current={plane:h,capMesh:g,helpers:f,materialState:x,bbox:r},console.info("[Preview] section: helpers =",f.length,"cap =",!!g),e.viewer.Render?.()},[J,l,L]),b(()=>{const e=o.current,t=fe.current;if(e?.viewer&&t&&J)try{const n=t.bbox,r="x"===ee?0:"y"===ee?1:2,s=[n.min.x,n.min.y,n.min.z][r],i=s+([n.max.x,n.max.y,n.max.z][r]-s)*se,o=oe*Math.PI/180,a=Math.cos(o),l=Math.sin(o),c=ne?-1:1;let d=0,u=0,p=0;"x"===ee?(d=c*a,p=c*l):"y"===ee?(u=c*a,d=c*l):(p=c*a,u=c*l);const m={x:(n.min.x+n.max.x)/2,y:(n.min.y+n.max.y)/2,z:(n.min.z+n.max.z)/2},h="x"===ee?i:m.x,f="y"===ee?i:m.y,x="z"===ee?i:m.z;if(t.plane.normal.x=d,t.plane.normal.y=u,t.plane.normal.z=p,t.plane.constant=-(d*h+u*f+p*x),t.capMesh){const e=m.x,n=m.y,r=m.z,s=d*e+u*n+p*r+t.plane.constant,i=e-d*s,o=n-u*s,a=r-p*s;t.capMesh.position.set(i,o,a),t.capMesh.lookAt?.(i+d,o+u,a+p)}e.viewer.Render?.()}catch(e){console.warn("[Preview] section update failed",e)}},[J,ee,ne,se,oe]),b(()=>{const e=o.current;if(!e?.viewer||l||!i.current)return;const t=e.viewer.renderer,n=e.viewer.scene,r=t?.domElement;if(!t||!n||!r)return;let s=null;if(e.viewer.mainModel?.EnumerateMeshes?.(e=>{s||e.userData?.__sectionHelper||e.userData?.__measureHelper||(s=e)}),!s)return;const c=s.position.constructor,d=s.constructor,u=(Array.isArray(s.material)?s.material[0]:s.material)?.constructor,p=s.geometry.constructor,m=s.geometry.attributes?.position?.constructor;if(!(c&&d&&u&&p&&m))return;let h=null,f=null;n.traverse(e=>{if(h&&f)return;if(!e?.isLineSegments)return;h=e.constructor;const t=Array.isArray(e.material)?e.material[0]:e.material;t?.constructor&&(f=t.constructor)});const x=()=>{const t=he.current;if(t){null!==t.rafId&&cancelAnimationFrame(t.rafId);for(const e of t.markers)n.remove(e),e.geometry?.dispose?.(),e.material?.dispose?.();t.line&&(n.remove(t.line),t.line.geometry?.dispose?.(),t.line.material?.dispose?.()),t.label&&t.label.parentElement&&t.label.parentElement.removeChild(t.label),he.current=null,e.viewer.Render?.()}};if(!le)return x(),void me(null);he.current={points:[],normals:[],markers:[],line:null,label:null,rafId:null};const y=a.current,g=y?.IntersectionMode?.MeshOnly??1,b=e.viewer.GetBoundingBox?.(()=>!0),w=b?Math.sqrt((b.max.x-b.min.x)**2+(b.max.y-b.min.y)**2+(b.max.z-b.min.z)**2):100,v=Math.max(.005*w,.2),k=e=>{const t=[],r=[];for(let e=0;e<=12;e++){const n=e/12*Math.PI;for(let e=0;e<=16;e++){const r=e/16*Math.PI*2;t.push(v*Math.sin(n)*Math.cos(r),v*Math.cos(n),v*Math.sin(n)*Math.sin(r))}}for(let e=0;e<12;e++)for(let t=0;t<16;t++){const n=17*e+t,s=n+16+1;r.push(n,s,n+1,s,s+1,n+1)}const s=new p;s.setAttribute("position",new m(new Float32Array(t),3)),s.setIndex(r),s.computeVertexNormals?.();const i=new u;i.color?.setHex?.(16746496),i.depthTest=!1,i.depthWrite=!1,i.transparent=!0,i.opacity=.95;const o=new d(s,i);return o.position.copy(e),o.renderOrder=9999,o.userData.__measureHelper=!0,n.add(o),o},N=()=>{const t=he.current;t&&((()=>{const t=he.current;if(!t||t.points.length<2||!t.label)return;const n=e.viewer.camera;if(!n)return;const s=t.points[0],i=t.points[1],o=new c((s.x+i.x)/2,(s.y+i.y)/2,(s.z+i.z)/2).clone();o.project?.(n);const a=r.getBoundingClientRect(),l=(o.x+1)/2*a.width,d=(1-o.y)/2*a.height;t.label.style.left=`${l}px`,t.label.style.top=`${d}px`;const u=l<0||d<0||l>a.width||d>a.height;t.label.style.opacity=o.z>1||u?"0":"1"})(),t.rafId=requestAnimationFrame(N))};he.current.rafId=requestAnimationFrame(N);let C=0,A=0,E=0,L=!1,M=!1;const S=t=>{if(!e.viewer.camera)return;const s=r.getBoundingClientRect(),o={x:t.clientX-s.left,y:t.clientY-s.top},a=e.viewer.GetMeshIntersectionUnderMouse?.(g,o);if(!a)return;const l=he.current,x=new c(a.point.x,a.point.y,a.point.z),y=(e=>{const t=e?.face?.normal,n=e?.object;if(!t||!n)return null;try{const e=new c(t.x,t.y,t.z);return e.transformDirection?.(n.matrixWorld),{x:e.x,y:e.y,z:e.z}}catch{return{x:t.x,y:t.y,z:t.z}}})(a);if(2===l.points.length){for(const e of l.markers)n.remove(e),e.geometry?.dispose?.(),e.material?.dispose?.();l.line&&(n.remove(l.line),l.line.geometry?.dispose?.(),l.line.material?.dispose?.()),l.label&&(l.label.style.opacity="0"),l.points=[],l.markers=[],l.line=null,l.normals=[],me(null)}if(l.points.push(x),l.normals.push(y),"perp"===de){const e=((e,t)=>{const r=e?.geometry,s=r?.attributes?.position;if(!r||!s||!t?.face?.normal)return null;const i=s.array,o=r.index?r.index.array:null,a=new c(t.point.x,t.point.y,t.point.z);e.worldToLocal?.(a);const l=t.face.normal,h=-(l.x*a.x+l.y*a.y+l.z*a.z);r.computeBoundingBox?.();const f=r.boundingBox,x=f?Math.sqrt((f.max.x-f.min.x)**2+(f.max.y-f.min.y)**2+(f.max.z-f.min.z)**2):100,y=Math.max(.001*x,.005),g=o?o.length/3:s.count/3,b=[],w=new c;for(let t=0;t<g;t++){const n=o?o[3*t]:3*t,r=o?o[3*t+1]:3*t+1,s=o?o[3*t+2]:3*t+2,a=i[3*n],c=i[3*n+1],d=i[3*n+2],u=i[3*r],p=i[3*r+1],m=i[3*r+2],f=i[3*s],x=i[3*s+1],g=i[3*s+2],v=u-a,k=p-c,N=m-d,C=f-a,A=x-c,E=g-d;let L=k*E-N*A,M=N*C-v*E,S=v*A-k*C;const j=Math.sqrt(L*L+M*M+S*S);if(0===j)continue;if(L/=j,M/=j,S/=j,L*l.x+M*l.y+S*l.z<.9995)continue;const z=(a+u+f)/3,T=(c+p+x)/3,R=(d+m+g)/3;if(!(Math.abs(l.x*z+l.y*T+l.z*R+h)>y))for(const[t,n,r]of[[a,c,d],[u,p,m],[f,x,g]])w.set?.(t,n,r),e.localToWorld?.(w),b.push(w.x,w.y,w.z)}if(0===b.length)return null;const v=new p;v.setAttribute("position",new m(new Float32Array(b),3)),v.computeVertexNormals?.();const k=new u;k.color?.setHex?.(16746496),k.transparent=!0,k.opacity=.45,k.depthWrite=!1,k.polygonOffset=!0,k.polygonOffsetFactor=-2,k.polygonOffsetUnits=-2;const N=new d(v,k);return N.renderOrder=9998,N.userData.__measureHelper=!0,n.add(N),N})(a.object,a);l.markers.push(e??k(x))}else l.markers.push(k(x));if(2===l.points.length){const e=l.points[0];let t,r=l.points[1],s="";if("perp"===de){const n=l.normals[0]??l.normals[1];if(n){const i=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z)||1,o=n.x/i,a=n.y/i,d=n.z/i,u=(r.x-e.x)*o+(r.y-e.y)*a+(r.z-e.z)*d,p=new c(e.x+o*u,e.y+a*u,e.z+d*u);l.points[1]=p,r=p,t=Math.abs(u),s=" ⊥"}else{const n=r.x-e.x,s=r.y-e.y,i=r.z-e.z;t=Math.sqrt(n*n+s*s+i*i)}}else{const n=r.x-e.x,s=r.y-e.y,i=r.z-e.z;t=Math.sqrt(n*n+s*s+i*i)}l.line=((e,t)=>{const r=new p;r.setAttribute("position",new m(new Float32Array([e.x,e.y,e.z,t.x,t.y,t.z]),3));const s=new(h??d)(r,new(f??u)({color:16746496,depthTest:!1,depthWrite:!1,transparent:!0,opacity:.95}));return s.renderOrder=9998,s.userData.__measureHelper=!0,n.add(s),s})(e,r),me(t);const o=(()=>{const e=he.current;if(e.label)return e.label;const t=document.createElement("div");return t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.transform="translate(-50%, -50%)",t.style.padding="2px 6px",t.style.fontSize="11px",t.style.fontWeight="600",t.style.fontFamily="system-ui, -apple-system, sans-serif",t.style.background="rgba(255, 136, 0, 0.95)",t.style.color="#fff",t.style.borderRadius="4px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.boxShadow="0 1px 4px rgba(0,0,0,0.25)",t.style.zIndex="5",i.current.appendChild(t),e.label=t,t})();o.textContent=`${D(t)}${s}`}e.viewer.Render?.()},j=e=>{0===e.button&&(C=e.clientX,A=e.clientY,E=performance.now(),L=!1,M=!0)},z=e=>{if(!M)return;const t=e.clientX-C,n=e.clientY-A;t*t+n*n>16&&(L=!0)},T=e=>{if(0!==e.button||!M)return;const t=performance.now()-E;M=!1,!L&&t<350&&S(e)},R=e=>{"Escape"===e.key&&ce(!1)};return r.style.cursor="crosshair",r.addEventListener("pointerdown",j),r.addEventListener("pointermove",z),r.addEventListener("pointerup",T),r.addEventListener("pointercancel",T),window.addEventListener("keydown",R),()=>{r.style.cursor="",r.removeEventListener("pointerdown",j),r.removeEventListener("pointermove",z),r.removeEventListener("pointerup",T),r.removeEventListener("pointercancel",T),window.removeEventListener("keydown",R),x(),me(null)}},[le,de,l,L]),b(()=>{if(!h||l)return;const e=setTimeout(()=>x(!1),5e3);return()=>clearTimeout(e)},[h,l]);const xe=e=>{const t=/* @__PURE__ */new Set;T(e,t),W(e=>{const n=new Set(e),r=[...t].some(e=>!n.has(e));for(const e of t)r?n.add(e):n.delete(e);return n})},ye=()=>{try{const e=o.current,t=e?.viewer?.GetBoundingSphere?.(()=>!0);t&&e.viewer.FitSphereToWindow(t,!0),e?.viewer?.Render?.()}catch{}};b(()=>{const e=a.current,t=o.current;if(e&&t?.viewer&&!l)try{t.viewer.SetProjectionMode(Z?e.ProjectionMode.Perspective:e.ProjectionMode.Orthographic)}catch{}},[Z,l]);const ge=e=>{const t=a.current,n=o.current;if(t&&n?.viewer)try{const r=n.viewer.GetBoundingSphere?.(()=>!0);if(!r)return;const s=r.center,i=3*(r.radius||1),o=s.x??0,a=s.y??0,l=s.z??0;let c,d;switch(e){case"top":c=new t.Coord3D(o,a,l+i),d=new t.Coord3D(0,1,0);break;case"front":c=new t.Coord3D(o,a-i,l),d=new t.Coord3D(0,0,1);break;case"side":c=new t.Coord3D(o+i,a,l),d=new t.Coord3D(0,0,1);break;default:{const e=i/Math.sqrt(3);c=new t.Coord3D(o+e,a-e,l+e),d=new t.Coord3D(0,0,1);break}}const u=new t.Coord3D(o,a,l),p=new t.Camera(c,u,d,45);n.viewer.SetCamera(p),n.viewer.AdjustClippingPlanesToSphere?.(r),n.viewer.Render?.()}catch{}},be=(t.split(".").pop()||"").toUpperCase(),we=(e,t=0)=>{const n=e.children.length>0,r=!1!==S[e.id],s=!P.has(e.id);/* @__PURE__ */
83
- return w("div",{children:[
84
- /* @__PURE__ */w("div",{className:"group flex items-center gap-1 px-2 py-1 hover:bg-gray-100 cursor-default text-xs text-ink",style:{paddingLeft:12*t+6+"px"},children:[n?/* @__PURE__ */v("button",{onClick:()=>{return t=e.id,void F(e=>({...e,[t]:!e[t]}));var t},className:"h-4 w-4 shrink-0 flex items-center justify-center text-gray-500 hover:text-gray-900",title:r?C.collapse:C.expand,children:/* @__PURE__ */v(d,r?{name:"chevron-down",className:"h-3 w-3",strokeWidth:2}:{name:"chevron-right",className:"h-3 w-3",strokeWidth:2})}):/* @__PURE__ */v("span",{className:"h-4 w-4 shrink-0 flex items-center justify-center",children:/* @__PURE__ */v("span",{className:"h-1 w-1 rounded-full bg-gray-400"})}),
85
- /* @__PURE__ */v("span",{className:"flex-1 truncate "+(s?"":"opacity-40"),title:e.name,children:e.name}),
86
- /* @__PURE__ */v("button",{onClick:()=>{ye()},className:"h-4 w-4 shrink-0 text-gray-400 hover:text-gray-900 opacity-0 group-hover:opacity-100 transition-opacity",title:C.fitToView,children:/* @__PURE__ */v(d,{name:"expand",className:"h-3.5 w-3.5",strokeWidth:1.5})}),
87
- /* @__PURE__ */v("button",{onClick:()=>xe(e),className:"h-4 w-4 shrink-0 text-gray-500 hover:text-gray-900",title:s?C.hide:C.show,children:/* @__PURE__ */v(d,s?{name:"eye",className:"h-3.5 w-3.5",strokeWidth:1.5}:{name:"eye-off",className:"h-3.5 w-3.5",strokeWidth:1.5})})]}),r&&n&&/* @__PURE__ */v("div",{children:e.children.map(e=>we(e,t+1))})]},e.id)},ve="h-8 w-8 shrink-0 flex items-center justify-center rounded text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors",ke="h-8 w-8 shrink-0 flex items-center justify-center rounded bg-gray-200 text-gray-900",Ne="h-5 w-px bg-gray-300 mx-1";/* @__PURE__ */
88
- return w("div",{className:"flex flex-col h-full bg-white",children:[
89
- /* @__PURE__ */w(n,{children:[
90
- /* @__PURE__ */v("button",{onClick:ye,className:ve,title:C.fitToView,children:/* @__PURE__ */v(d,{name:"expand",className:"h-4 w-4",strokeWidth:1.5})}),
91
- /* @__PURE__ */v("div",{className:Ne}),
92
- /* @__PURE__ */v("button",{onClick:()=>ge("iso"),className:ve,title:C.isometricView,children:/* @__PURE__ */v("span",{className:"text-2xs font-semibold",children:C.isometric})}),
93
- /* @__PURE__ */v("button",{onClick:()=>ge("top"),className:ve,title:C.topView,children:/* @__PURE__ */v("span",{className:"text-2xs font-semibold",children:C.top})}),
94
- /* @__PURE__ */v("button",{onClick:()=>ge("front"),className:ve,title:C.frontView,children:/* @__PURE__ */v("span",{className:"text-2xs font-semibold",children:C.front})}),
95
- /* @__PURE__ */v("button",{onClick:()=>ge("side"),className:ve,title:C.sideView,children:/* @__PURE__ */v("span",{className:"text-2xs font-semibold",children:C.side})}),
96
- /* @__PURE__ */v("button",{onClick:()=>Q(e=>!e),className:Z?"h-8 shrink-0 flex items-center justify-center px-2 rounded bg-gray-200 text-gray-900":"h-8 shrink-0 flex items-center justify-center px-2 rounded text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors",title:Z?C.toOrthographic:C.toPerspective,children:/* @__PURE__ */v("span",{className:"text-2xs font-semibold whitespace-nowrap",children:Z?C.perspective:C.orthographic})}),
97
- /* @__PURE__ */v("div",{className:Ne}),
98
- /* @__PURE__ */v("button",{onClick:()=>{try{const e=o.current,n=e?.viewer?.GetCanvasSize?.()??{width:1280,height:720},r=e?.viewer?.GetImageAsDataUrl?.(n.width,n.height,!1);if(!r)return;const s=document.createElement("a");s.href=r,s.download=`${t.replace(/\.[^.]+$/,"")}-snapshot.png`,s.click()}catch{}},className:ve,title:C.snapshot,children:/* @__PURE__ */v(d,{name:"camera",className:"h-4 w-4",strokeWidth:1.5})}),
99
- /* @__PURE__ */v("button",{onClick:()=>x(e=>!e),className:ve,title:A.howToNavigate,children:/* @__PURE__ */v(d,{name:"help",className:"h-4 w-4",strokeWidth:1.5})}),
100
- /* @__PURE__ */v("button",{onClick:()=>ce(e=>!e),className:le?ke:ve,title:le?A.stopMeasuring:C.measureHint,children:/* @__PURE__ */w("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[
101
- /* @__PURE__ */v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 14.25l6-6 6 6 4.5-4.5M9.75 8.25v3M12.75 11.25v3M15.75 14.25v3"}),
102
- /* @__PURE__ */v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75h19.5"})]})}),le&&/* @__PURE__ */w("div",{className:"flex items-stretch h-8 rounded border border-gray-200 overflow-hidden",children:[
103
- /* @__PURE__ */v("button",{onClick:()=>ue("point"),className:"px-2 text-2xs font-semibold transition-colors "+("point"===de?"bg-orange-500 text-on-accent":"bg-surface text-gray-600 hover:bg-row-hover"),title:C.pointHint,children:C.point}),
104
- /* @__PURE__ */v("button",{onClick:()=>ue("perp"),className:"px-2 text-xs font-semibold transition-colors "+("perp"===de?"bg-orange-500 text-on-accent":"bg-surface text-gray-600 hover:bg-row-hover"),title:C.perpendicularHint,children:"⊥"})]}),le&&null!==pe&&/* @__PURE__ */w("div",{className:"px-2 py-1 text-2xs font-mono font-semibold text-orange-600 bg-orange-50 border border-orange-200 rounded whitespace-nowrap",title:"perp"===de?C.perpendicularDistance:C.straightDistance,children:[D(pe),"perp"===de?" ⊥":""]}),
105
- /* @__PURE__ */v("div",{className:Ne}),
106
- /* @__PURE__ */v("button",{onClick:()=>_(e=>!e),className:Y?ke:ve,title:C.meshesHint,children:/* @__PURE__ */v(d,{name:"menu",className:"h-4 w-4",strokeWidth:1.5})}),
107
- /* @__PURE__ */v("button",{onClick:()=>K(e=>!e),className:$?ke:ve,title:C.displayHint,children:/* @__PURE__ */v(d,{name:"settings",className:"h-4 w-4",strokeWidth:1.5})}),
108
- /* @__PURE__ */v("button",{onClick:r??(()=>{const n=document.createElement("a");n.href=e,n.download=t,n.click()}),className:ve,title:C.downloadOriginal,children:/* @__PURE__ */v(d,{name:"download",className:"h-4 w-4",strokeWidth:1.5})}),s&&/* @__PURE__ */v("button",{onClick:s,className:ve,title:A.email,children:/* @__PURE__ */v(d,{name:"email",className:"h-4 w-4",strokeWidth:1.5})})]}),
109
- /* @__PURE__ */v("div",{className:"flex-1 flex min-h-0",children:/* @__PURE__ */w("div",{className:"relative flex-1 min-w-0",style:{background:H},children:[
110
- /* @__PURE__ */v("div",{ref:i,style:{width:"100%",height:"100%"}}),Y&&/* @__PURE__ */w("div",{className:"absolute top-2 left-2 w-64 max-h-[80%] flex flex-col bg-white/95 backdrop-blur border border-gray-200 rounded-md shadow-xl z-10 text-xs",children:[
111
- /* @__PURE__ */w("div",{className:"flex items-center justify-between px-2 min-h-8 py-1 border-b border-line bg-surface-sunken",children:[
112
- /* @__PURE__ */v("span",{className:"font-medium text-gray-700",children:C.meshes}),
113
- /* @__PURE__ */v("button",{onClick:()=>_(!1),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-600",title:A.closePanel,children:"×"})]}),
114
- /* @__PURE__ */v("div",{className:"flex-1 overflow-y-auto py-1",children:L?we(L):l?/* @__PURE__ */v(p,{size:"sm",padding:"py-3",label:C.readingModel}):/* @__PURE__ */v("div",{className:"px-3 py-3 text-2xs text-ink-faint italic",children:C.noStructure})}),L&&/* @__PURE__ */v("div",{className:"px-3 py-2 text-2xs text-ink-faint border-t border-line",children:0===P.size?C.allVisible:C.hiddenCount(P.size)})]}),h&&!l&&!u&&/* @__PURE__ */w("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 bg-gray-900/85 text-on-accent text-2xs px-3 min-h-8 py-1 rounded-full shadow-lg flex items-center gap-3 z-10 pointer-events-none",children:[
115
- /* @__PURE__ */v("span",{children:C.dragToRotate}),
116
- /* @__PURE__ */v("span",{className:"text-white/40",children:"•"}),
117
- /* @__PURE__ */v("span",{children:C.rightDragToPan}),
118
- /* @__PURE__ */v("span",{className:"text-white/40",children:"•"}),
119
- /* @__PURE__ */v("span",{children:A.scrollToZoom})]}),l&&/* @__PURE__ */w("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-white/85 gap-2",children:[
120
- /* @__PURE__ */v(p,{size:"sm",padding:"",label:C.loading}),"STP"===be||"STEP"===be?/* @__PURE__ */v("span",{className:"text-2xs text-ink-faintest",children:C.stepNote}):null]}),u&&/* @__PURE__ */v("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-red-600 px-6 text-center bg-white/85",children:u}),$&&/* @__PURE__ */w("div",{className:"absolute top-2 right-2 w-64 max-h-[80%] flex flex-col bg-white/95 backdrop-blur border border-gray-200 rounded-md shadow-xl z-10 text-xs",children:[
121
- /* @__PURE__ */w("div",{className:"flex items-center justify-between px-2 min-h-8 py-1 border-b border-line bg-surface-sunken",children:[
122
- /* @__PURE__ */v("span",{className:"font-medium text-gray-700",children:C.display}),
123
- /* @__PURE__ */v("button",{onClick:()=>K(!1),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-600",title:A.closePanel,children:"×"})]}),
124
- /* @__PURE__ */w("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 text-xs text-ink",children:[
125
- /* @__PURE__ */w("label",{className:"flex items-center justify-between gap-2",children:[
126
- /* @__PURE__ */v("span",{children:C.backgroundColor}),
127
- /* @__PURE__ */v("input",{type:"color",value:H,onChange:e=>O(e.target.value),className:"h-6 w-10 rounded border border-gray-300 bg-white"})]}),
128
- /* @__PURE__ */w("label",{className:"flex items-center justify-between gap-2",children:[
129
- /* @__PURE__ */v("span",{children:C.showEdges}),
130
- /* @__PURE__ */v("button",{onClick:()=>X(e=>!e),role:"switch","aria-checked":I,className:"relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors "+(I?"bg-blue-500":"bg-gray-300"),children:/* @__PURE__ */v("span",{className:"inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform "+(I?"translate-x-[18px]":"translate-x-0.5")})})]}),
131
- /* @__PURE__ */w("label",{className:"flex items-center justify-between gap-2",children:[
132
- /* @__PURE__ */v("span",{className:I?"":"opacity-40",children:C.edgeColor}),
133
- /* @__PURE__ */v("input",{type:"color",value:U,onChange:e=>B(e.target.value),disabled:!I,className:"h-6 w-10 rounded border border-gray-300 bg-white disabled:opacity-40"})]}),
134
- /* @__PURE__ */w("div",{className:I?"":"opacity-40 pointer-events-none",children:[
135
- /* @__PURE__ */w("div",{className:"flex items-center justify-between gap-2 mb-1",children:[
136
- /* @__PURE__ */v("span",{children:C.edgeThreshold}),
137
- /* @__PURE__ */w("span",{className:"text-gray-500 tabular-nums",children:[G,"°"]})]}),
138
- /* @__PURE__ */v("input",{type:"range",min:0,max:45,step:1,value:G,onChange:e=>V(Number(e.target.value)),className:"w-full accent-blue-500"})]}),
139
- /* @__PURE__ */w("div",{className:"border-t border-gray-200 -mx-3 px-3 pt-3 mt-1",children:[
140
- /* @__PURE__ */w("label",{className:"flex items-center justify-between gap-2",children:[
141
- /* @__PURE__ */v("span",{className:"font-medium",children:C.sectionView}),
142
- /* @__PURE__ */v("button",{onClick:()=>q(e=>!e),role:"switch","aria-checked":J,className:"relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors "+(J?"bg-blue-500":"bg-gray-300"),children:/* @__PURE__ */v("span",{className:"inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform "+(J?"translate-x-[18px]":"translate-x-0.5")})})]}),
143
- /* @__PURE__ */w("div",{className:J?"mt-2 space-y-2":"mt-2 space-y-2 opacity-40 pointer-events-none",children:[
144
- /* @__PURE__ */w("div",{children:[
145
- /* @__PURE__ */w("div",{className:"flex items-center justify-between gap-2 mb-1",children:[
146
- /* @__PURE__ */v("span",{children:C.angle}),
147
- /* @__PURE__ */w("span",{className:"text-gray-500 tabular-nums",children:[oe,"°"]})]}),
148
- /* @__PURE__ */v("input",{type:"range",min:0,max:180,step:1,value:oe,onChange:e=>ae(Number(e.target.value)),className:"w-full accent-blue-500"})]}),
149
- /* @__PURE__ */w("div",{children:[
150
- /* @__PURE__ */w("div",{className:"flex items-center justify-between gap-2 mb-1",children:[
151
- /* @__PURE__ */v("span",{children:C.axis}),
152
- /* @__PURE__ */v("button",{onClick:()=>re(e=>!e),className:"text-2xs text-gray-600 hover:text-ink-strongest px-2 py-0.5 rounded bg-gray-100 hover:bg-gray-200",title:C.flipHint,children:ne?C.flipped:C.flip})]}),
153
- /* @__PURE__ */v("div",{className:"grid grid-cols-3 gap-1",children:["x","y","z"].map(e=>/* @__PURE__ */v("button",{onClick:()=>te(e),className:"py-1 rounded text-2xs font-semibold "+(ee===e?"bg-blue-500 text-on-accent":"bg-gray-100 text-ink hover:bg-gray-200"),children:e.toUpperCase()},e))})]}),
154
- /* @__PURE__ */w("div",{children:[
155
- /* @__PURE__ */w("div",{className:"flex items-center justify-between gap-2 mb-1",children:[
156
- /* @__PURE__ */v("span",{children:C.position}),
157
- /* @__PURE__ */w("span",{className:"text-gray-500 tabular-nums",children:[Math.round(100*se),"%"]})]}),
158
- /* @__PURE__ */v("input",{type:"range",min:0,max:1,step:.01,value:se,onChange:e=>ie(Number(e.target.value)),className:"w-full accent-blue-500"})]})]})]})]}),
159
- /* @__PURE__ */v("div",{className:"px-3 py-2 border-t border-gray-200",children:/* @__PURE__ */v("button",{onClick:()=>{O("#f5f6f8"),X(!0),B("#000000"),V(1),q(!1),te("x"),re(!1),ie(.5),ae(0)},className:"w-full text-2xs text-ink bg-gray-100 hover:bg-gray-200 rounded py-2 transition-colors",children:C.resetDisplay})})]})]})})]})}function P({url:e,filename:t,onDownload:s,onEmail:i}){const[o,a]=g(1),[l,c]=g(!1),[u,p]=g(!1),h=y(null),x=f().preview,b="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
160
- return w("div",{className:"flex flex-col h-full",children:[
161
- /* @__PURE__ */w(n,{children:[!u&&/* @__PURE__ */w(k,{children:[
162
- /* @__PURE__ */v("button",{onClick:()=>a(e=>Math.max(.1,Math.round(100*(e-.25))/100)),className:b,children:"−"}),
163
- /* @__PURE__ */w("span",{className:"text-gray-500 w-12 text-center tabular-nums",children:[Math.round(100*o),"%"]}),
164
- /* @__PURE__ */v("button",{onClick:()=>a(e=>Math.min(8,Math.round(100*(e+.25))/100)),className:b,children:"+"}),
165
- /* @__PURE__ */v("button",{onClick:()=>a(1),className:b,children:"1:1"}),
166
- /* @__PURE__ */v("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
167
- /* @__PURE__ */w("button",{onClick:()=>p(!0),className:b,title:x.annotateHint,children:[
168
- /* @__PURE__ */v(d,{name:"edit",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.annotate]})]}),u&&/* @__PURE__ */w(k,{children:[
169
- /* @__PURE__ */w("button",{onClick:()=>p(!1),className:b,title:x.viewHint,children:[
170
- /* @__PURE__ */v(d,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.view]}),
171
- /* @__PURE__ */w("button",{onClick:()=>h.current?.copy(),className:b,children:[
172
- /* @__PURE__ */v(d,{name:"duplicate",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.copy]}),
173
- /* @__PURE__ */w("button",{onClick:()=>h.current?.save(),className:b,children:[
174
- /* @__PURE__ */v(d,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.save]})]}),
175
- /* @__PURE__ */w("button",{onClick:s??(async()=>{if(e.startsWith("blob:")||e.startsWith("data:")){const n=document.createElement("a");return n.href=e,n.download=t,void n.click()}const n=async t=>{const n=await fetch(e,t);if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.blob()};try{let e;try{e=await n({credentials:"include"})}catch{e=await n({credentials:"omit"})}const r=URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.download=t,s.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch{m.error(x.downloadFailed)}}),className:b,children:[
176
- /* @__PURE__ */v(d,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),i&&/* @__PURE__ */w("button",{onClick:i,className:b,children:[
177
- /* @__PURE__ */v(d,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),u?/* @__PURE__ */v(r,{ref:h,src:e,filename:t}):/* @__PURE__ */v("div",{className:"flex-1 overflow-auto bg-gray-100 flex items-center justify-center p-4",children:l?/* @__PURE__ */v("div",{className:"text-sm text-red-600",children:x.imageFailed}):/* @__PURE__ */v("img",{src:e,alt:t,onError:()=>c(!0),style:{transform:`scale(${o})`,transformOrigin:"center center",transition:"transform 120ms ease"},className:"max-w-full max-h-full shadow-lg rounded bg-white"})})]})}export{A as default};
@@ -1,44 +0,0 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-U6LKNGC6.js";import{ResizeHandle as l}from"./chunk-X6AMAYXV.js";import{openGlobalSearch as s}from"./chunk-6AAGZ34A.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{IconButton_default as p}from"./chunk-SV5RRBVA.js";import{RAIL_MENU_GAP as b,navSections as f,startMenuCategories as g,RAIL_W as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_MAX_W as v,RAIL_MIN_W as N,navIcons as w,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as C,PopupMenuItem as S,PopupMenuDivider as L}from"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as A}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as $}from"./chunk-L6XEON5Q.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as W,useRef as I,useEffect as T,isValidElement as H,cloneElement as M}from"react";import{jsx as K,jsxs as R,Fragment as D}from"react/jsx-runtime";var O="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),P=150,Q=250;function X(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var U=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),B="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",E="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function G({open:e,children:t}){const r=I(null);return T(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */K("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */K("div",{className:"min-h-0 overflow-hidden",children:t})})}function J({open:e}){/* @__PURE__ */
2
- return K(A,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function V({dir:e}){/* @__PURE__ */
3
- return K(A,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function Y({className:e}){/* @__PURE__ */
4
- return K(A,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var F=e=>.75+1.75*e+"rem";function Z({width:b,openWidth:P=x,collapsed:Q,onToggleCollapsed:Z,onResize:_,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=$().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=W(()=>t(r(n))),we=z(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),je=(e,t=we)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Ce,Se]=W(!1),Le=I(null),Ae=Q&&!le,[$e,ze]=W(!1),We=I("pointer"),Ie=I(void 0),Te=I(!1),He=I(null),Me=()=>{clearTimeout(Ie.current),Ie.current=void 0},Ke=e=>{Me(),We.current=e,ze(!0)},Re=()=>{Me(),ze(!1)};T(()=>{Me(),ze(!1)},[Q]),T(()=>()=>Me(),[]),T(()=>{if(!$e)return;const e=e=>{const t=e.target;t&&(He.current?.contains(t)||t.closest?.('[role="menu"]'))||(Me(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[$e]);const De=Q&&!$e,Oe=Q&&$e?P:b,Pe=(e,t)=>{Re(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Qe=(e,t)=>{const r=t[e];/* @__PURE__ */
5
- return K("span",{className:E,"aria-hidden":"true",children:r&&H(r)?M(r,{className:"size-[18px]"}):r})},Xe=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Ue=(e,t,r=we)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
6
- return R("div",{children:[
7
- /* @__PURE__ */R("button",{type:"button",onClick:()=>je(a,r),"aria-expanded":o,className:U(l,!1),style:t>0?{paddingLeft:F(t)}:void 0,children:[0===t&&Qe(e.to,ce),
8
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:i}),
9
- /* @__PURE__ */K(J,{open:o})]}),
10
- /* @__PURE__ */K(G,{open:o,children:/* @__PURE__ */K("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Ue(e,t+1,Xe(n)))})}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:F(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
11
- return R("div",{children:[
12
- /* @__PURE__ */R("button",{type:"button",onClick:t=>Pe(e,t),onAuxClick:t=>{1===t.button&&Pe(e,t)},"aria-current":a?"page":void 0,className:U(a,!1),style:t>0?{paddingLeft:F(t)}:void 0,children:[0===t&&Qe(e.to,ce),
13
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:F(t)},"aria-hidden":"true"})]},e.to)},Be=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */K("span",{className:E,"aria-hidden":"true",children:e.icon}):Qe(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(De)/* @__PURE__ */
14
- return R("div",{children:[
15
- /* @__PURE__ */K("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),Ke("tap")},className:U(a,!0),children:n}),o&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
16
- return R("div",{children:[
17
- /* @__PURE__ */R("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:U(!l&&a,!1),children:[n,
18
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:i}),
19
- /* @__PURE__ */K(J,{open:l})]}),
20
- /* @__PURE__ */K(G,{open:l,children:/* @__PURE__ */K("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Ue(e,1,Xe(r)))})}),o&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Ee=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Ge=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Je=re?.avatar_url?/* @__PURE__ */K("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */K("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ge}),Ve=Ce?Le.current?.getBoundingClientRect():void 0,Ye=De?"":"px-3",Fe=De?{paddingInline:y}:void 0,Ze=`${Q?xe.expandSidebar:xe.collapseSidebar} (${O?"⌘":"Ctrl"} .)`,_e=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:Z,label:Q?xe.expandSidebar:xe.collapseSidebar,title:Ze},qe=/* @__PURE__ */R(D,{children:[he&&/* @__PURE__ */K(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!De&&/* @__PURE__ */R("span",{className:"min-w-0 text-left leading-tight",children:[
21
- /* @__PURE__ */K("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */K("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),et=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
22
- return R("aside",{ref:He,"aria-label":xe.navLabel,"data-rail-peek":$e?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${Q?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${$e?"rounded-r-(--radius-panel)":""}`,style:{width:Oe,boxShadow:$e?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(Te.current=!0,Ae&&($e?Me():(Me(),Ie.current=setTimeout(()=>Ke("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(Te.current=!1,Ae&&(Me(),$e&&!Ce&&"pointer"===We.current&&(Ie.current=setTimeout(Re,250))))},onFocus:e=>{Ae&&!$e&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&Ke("focus")},onBlur:e=>{if(!$e||"focus"!==We.current)return;const t=e.relatedTarget;t&&He.current?.contains(t)||Ce||Te.current||Re()},onKeyDown:e=>{"Escape"===e.key&&$e&&Re()},children:[
23
- /* @__PURE__ */R("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(De?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[_e?/* @__PURE__ */K("button",{type:"button",onClick:_e.run,"aria-label":_e.label,title:_e.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(De?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */K("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */K(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */K(A,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):Q?$e&&
24
- /* @__PURE__ */K("button",{type:"button",onClick:()=>{Re(),Z()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${O?"⌘":"Ctrl"} .)`,className:B,children:/* @__PURE__ */K(V,{dir:"right"})}):/* @__PURE__ */K("button",{type:"button",onClick:Z,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${O?"⌘":"Ctrl"} .)`,className:B,children:/* @__PURE__ */K(V,{dir:"left"})})]}),
25
- /* @__PURE__ */K("div",{className:`shrink-0 pt-3 ${Ye}`,style:Fe,children:De?/* @__PURE__ */K("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${O?"⌘K":"Ctrl K"})`,className:U(!1,!0),children:/* @__PURE__ */K(Y,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */R("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
26
- /* @__PURE__ */K(Y,{className:"size-3.5 text-gray-500"}),
27
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
28
- /* @__PURE__ */K("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:O?"⌘K":"Ctrl K"})]})}),
29
- /* @__PURE__ */R("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ye} ${De?"space-y-1":"space-y-0.5"}`,style:Fe,children:[De&&/* @__PURE__ */K("button",{type:"button",onClick:Z,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${O?"⌘":"Ctrl"} .)`,className:`${U(!1,!0)} mb-3`,children:/* @__PURE__ */K(V,{dir:"right"})}),ye.topItems.map(e=>{if(!De)return Ue(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
30
- return R("div",{children:[
31
- /* @__PURE__ */K("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Pe(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),Ke("tap")},className:U(r,!0),children:Qe(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Be(e,!1)),ye.systemSections.map(e=>Be(e,!1)),ye.virtualSections.map(e=>Be(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Be(e,!1))]}),
32
- /* @__PURE__ */K("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ye}`,style:Fe,children:/* @__PURE__ */R("button",{ref:Le,type:"button",onClick:()=>Se(e=>!e),"aria-haspopup":"menu","aria-expanded":Ce,"aria-label":De?xe.accountMenu(Ee):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(De?"justify-center py-2":"px-2 py-2"),children:[Je,!De&&/* @__PURE__ */R("span",{className:"min-w-0 flex-1 text-left",children:[
33
- /* @__PURE__ */K("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Ee}),ne?.email&&Ee!==ne.email&&/* @__PURE__ */K("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),_&&!Q&&!le&&/* @__PURE__ */K(l,{side:"left",width:b,onResize:_,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Ce&&Ve&&/* @__PURE__ */R(C,{portal:!0,minWidth:224,onClose:()=>{Se(!1),$e&&"pointer"===We.current&&!Te.current&&Re()},style:X(Oe,Ve,window.innerHeight),children:[De&&/* @__PURE__ */R("div",{className:"border-b border-line px-3 py-3",children:[
34
- /* @__PURE__ */K("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ee}),ne?.email&&/* @__PURE__ */K("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
- /* @__PURE__ */R(S,{onClick:()=>{Se(!1),Re(),ee("/profile",!1)},children:[
36
- /* @__PURE__ */K(A,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */R(S,{onClick:()=>{Se(!1),Pe(e)},children:[
37
- /* @__PURE__ */K("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */R(S,{onClick:()=>{Se(!1),Re(),oe()},children:[
38
- /* @__PURE__ */K(A,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
39
- /* @__PURE__ */K(L,{}),ae&&/* @__PURE__ */R(D,{children:[
40
- /* @__PURE__ */R(S,{onClick:()=>{Se(!1),Re(),ae()},children:[
41
- /* @__PURE__ */K(A,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
42
- /* @__PURE__ */K(L,{})]}),
43
- /* @__PURE__ */R(S,{danger:!0,onClick:()=>{Se(!1),Re(),ie()},children:[
44
- /* @__PURE__ */K(A,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{Q as RAIL_PEEK_CLOSE_MS,P as RAIL_PEEK_OPEN_MS,X as accountMenuPosition,Z as default};
@@ -1,22 +0,0 @@
1
- import{ChartBrush as t}from"./chunk-RPSNYIDY.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-RSRTE7RG.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-QB4LAGMN.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as R}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as V,CHART_INK as z,STATUS_VARS as A}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as L}from"./chunk-TWVUQUUD.js";import{useShellStrings as S,useShellLocale as E}from"./chunk-L6XEON5Q.js";import{formatPercent as W,formatPlain as D}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as T,useId as I,useEffect as U}from"react";import{jsx as P,jsxs as F}from"react/jsx-runtime";var O=12,Q=16,Y=26,B=52,G=t=>"number"==typeof t&&Number.isFinite(t);function H({series:H,labels:K,height:X=200,stacked:Z=!1,stackMode:J="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=S().charts,Rt=E(),Vt=rt??(t=>D(t,Rt)),zt=ot??Vt,At=jt??$t.noData,Lt=C(null),St=x(Lt),Et=Nt??St,[Wt,Dt]=T(null),[Ct,Tt]=T(null),{highlighted:It}=u(),Ut=I(),Pt=ut??Ct,Ft=p(ht&&Pt?Pt[1]-Pt[0]+1:K.length,pt);if(U(()=>{if(null!==Wt)return L(t=>"Escape"===t.key&&(Dt(null),!0))},[Wt]),kt)/* @__PURE__ */
2
- return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P(h,{height:X,width:Nt??St})});const Ot=K,Qt=ut??Ct??[0,Math.max(0,Ot.length-1)],[Yt,Bt]=Qt,Gt=t=>Ft.slice(ht?t.slice(Yt,Bt+1):t),Ht=lt?Gt(lt):void 0,Kt=H.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(G)).map(t=>({...t,data:Gt(t.data),pointTones:t.pointTones?Gt(t.pointTones):void 0})),Xt=t=>(ht?Yt:0)+(Ft.view?.[0]??0)+t;if(K=Gt(Ot),0===Kt.length||0===K.length)/* @__PURE__ */
3
- return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:X},children:At})});const Zt=K.map((t,e)=>Kt.reduce((t,a)=>t+(G(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=K.map(()=>0);for(const e of Kt)t=t.map((t,a)=>t+(G(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Kt.some(te)&&Kt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Kt.filter(t=>!te(t)):Kt).filter(t=>!re(t)),le=ee?Kt.filter(te).flatMap(t=>t.data.filter(G)):[],ne=Z?(qt.at(-1)??[]).filter(G):oe.flatMap(t=>t.data.filter(G)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:Z&&"percent"===J||_t||void 0!==et?null:b(Z?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=Z&&"percent"===J?1:se?se.hi:et??M(Math.max(...ne,0)),me=Z&&"percent"===J?t=>W(Math.round(100*t),0,Rt):Vt,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),B),fe=ie?w(ie.right.ticks.map(Vt),Q):Q,pe={left:ue,right:Math.max(ue+1,Et-fe),top:O,bottom:X-Y},ge=j(K.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Kt.filter(re),Me=Math.max(0,...K.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,G(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Re=t=>e=>{e.preventDefault(),Dt(e=>{const a=(e??0)+t;return Math.min(K.length-1,Math.max(0,a))})},Ve=Math.max(1,Math.ceil(K.length/Math.max(1,Math.floor(Et/96))));/* @__PURE__ */
4
- return F("div",{className:`relative ${wt??""}`,ref:Lt,children:[
5
- /* @__PURE__ */F("svg",{width:"100%",height:X,viewBox:`0 0 ${Et} ${X}`,role:"img","aria-label":$t.overIntervals(Kt.map(t=>t.label),K.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Dt(null),onBlur:()=>Dt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Wt&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Xt(Wt));"ArrowRight"===t.key&&Re(1)(t),"ArrowLeft"===t.key&&Re(-1)(t)},children:[
6
- /* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:Ut,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
7
- /* @__PURE__ */P(n,{id:Ut,fills:Kt.map((t,e)=>({color:V(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:Z?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:z.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
8
- /* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:z.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:z.label,children:nt}),
9
- /* @__PURE__ */P("g",{clipPath:`url(#${Ut})`,mask:xt&&vt?`url(#${m(Ut)})`:void 0,children:Kt.map((t,e)=>{const n=V(t.slot,t.color,t.tone),m=t.mode??(Z?"area":"line"),h=f(t.key,It);if("step"===m){const e=K.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>G(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
- return P("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=K.map((a,r)=>{const o=Z?qt[e]?.[r]:t.data[r];return G(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:K.map((o,l)=>{const i=t.data[l];if(!G(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Kt[t]?.key)).reduce((t,a)=>t+Math.max(0,G(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
- return P("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?A[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:K.map((l,c)=>{const d=Z?qt[e]?.[c]:t.data[c];if(!G(d))return null;const m=o(d);/* @__PURE__ */
12
- return P("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=Z&&e>0?K.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
13
- return F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||Z)&&
14
- /* @__PURE__ */P("path",{d:y,fill:c(Ut,e,t.fillVariant??bt,n),stroke:"none"}),
15
- /* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??A[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
16
- return F("g",{children:[
17
- /* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Kt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=V(t.slot,t.color,t.tone),l=[...t.data].map(G).lastIndexOf(!0),n="all"===r?K.map((t,e)=>e).filter(e=>G(Z?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
18
- return F("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:t.data[r];return G(n)?/* @__PURE__ */P(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${K[r]}: ${t.label} ${Vt(n)}`},r):null}),st&&l>=0&&G(Z?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */P("text",{x:ge.center(l)-10,y:je(t)(Z?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(Z?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),K.map((t,e)=>e%Ve===0?/* @__PURE__ */P("text",{x:ge.center(e),y:X-8,textAnchor:"middle",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */P("line",{x1:ge.center(Wt),y1:pe.top,x2:ge.center(Wt),y2:pe.bottom,stroke:z.axis,strokeWidth:1}),ae&&Me>0&&
19
- /* @__PURE__ */F("g",{pointerEvents:"none","data-column-strip":"true",children:[
20
- /* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:z.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
21
- /* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(Me)})]}),Ft.drag&&/* @__PURE__ */P(g,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),K.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Dt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Xt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */P(y,{from:Ht?.[0]??K[0],to:Ht?.at(-1)??K[K.length-1],count:K.length,total:Z&&"percent"!==J?zt(Zt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(G).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Kt).filter(t=>t.data.some(G)).map(t=>{const e=t.data.filter(G),a=V(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=Z||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Ot.length>2&&/* @__PURE__ */P(t,{className:"mt-1",labels:Ot,width:Et,data:H[0]?.data??[],range:Qt,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Wt&&
22
- /* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Wt),ge.bandwidth,Et),children:/* @__PURE__ */P(R,{title:Ht?.[Wt]??K[Wt],rows:Kt.map((t,e)=>({key:t.key,label:t.label,color:V(t.slot,t.color,t.tone),value:G(t.data[Wt])?Z&&"percent"===J?`${W(100*(Jt(t.data[Wt],Wt)??0),1,Rt)} · ${zt(t.data[Wt])}`:zt(t.data[Wt]):void 0})),footnote:Z&&"percent"===J?$t.inBucket(zt(Zt[Wt])):void 0})})]})}export{H as TimeSeriesChart};
@@ -1,28 +0,0 @@
1
- import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-CYTK7DCA.js";import{ImageLightbox as r}from"./chunk-Y7XX6Z3M.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-246K337V.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-7CHEHWGL.js";import{Breadcrumbs as d}from"./chunk-LOMNX5VH.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-OU3J5TOO.js";import{useMediaMoveItems as u}from"./chunk-3UMS74TZ.js";import{RenameField as m}from"./chunk-QIPO4EVJ.js";import{NativeSelect as p}from"./chunk-LUAA4LKY.js";import{MediaUploadGrid as h}from"./chunk-VI54L75G.js";import{MediaUsedInList as f}from"./chunk-4XN6ACGV.js";import{useGridSelection as g}from"./chunk-VLKDWKVR.js";import{useMarquee as v}from"./chunk-OLFYNMTD.js";import{Segmented as k}from"./chunk-HNIIDDLJ.js";import{copyToClipboard as y}from"./chunk-B7UT3W4C.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-QMBMK6PP.js";import{Banner as C}from"./chunk-R3W6LZBG.js";import{Input_default as N}from"./chunk-PT4GMPUB.js";import{DropdownMenu as I}from"./chunk-3DSGJIC7.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-KDG7NWYX.js";import{setModalDragAside as L,modalIdHolding as T}from"./chunk-EIFNESXS.js";import{ColoredBadge as z}from"./chunk-Q2T5DRIK.js";import{Button_default as O}from"./chunk-EVYD6UFQ.js";import{Icon as F}from"./chunk-ISVODSRP.js";import{Tooltip as E}from"./chunk-SOZCWT6I.js";import{buttonClasses as P}from"./chunk-UQYNPYF4.js";import{usePlotWidth as A}from"./chunk-MAFUXCPZ.js";import{useShellStrings as M}from"./chunk-L6XEON5Q.js";import{useRef as U,useMemo as R,useCallback as K,useState as V,useEffect as B}from"react";import{jsxs as G,Fragment as W,jsx as H}from"react/jsx-runtime";var J="application/x-efficient-media-files",X="application/x-efficient-media-folder",Y="application/x-efficient-media-file";function Q(e){if(!e||!Array.from(e.types).includes(Y))return null;try{const n=JSON.parse(e.getData(Y));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var $={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */H(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */H(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */H(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */H(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */H(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */H(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */H(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */H(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */H(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */H(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */H(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */H(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */H(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */H(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */H(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */H(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */H(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */H(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */H(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */H(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(F){const{mode:Q="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:re,allFilesCount:ae,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=$,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ce,onRename:Ne,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:Le,onEmptyTrash:Te,onReplace:ze,onCropEdit:Oe,onOpenInDesign:Fe,onChoose:Ee,onCancel:Pe,pickNote:Ae,onDragOut:Me,className:Ue=""}=F,Re=M().mediaLibrary,Ke=M().media,Ve="pick"===Q,Be=!Ve,Ge=U(null),We=A(Ge,"phone"===_?343:1200),He="phone"===_||"auto"===_&&We<640,Je=R(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(re),[re]),Xe=R(()=>new Map(le.map(e=>[e.id,e])),[le]),Ye=R(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&Xe.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,Xe]),Qe=K(e=>{const n=[];for(let l=e?Xe.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?Xe.get(l.parentId):void 0);return n},[Xe,le.length]),$e=K((e,n)=>Qe(e).some(e=>e.id===n),[Qe]),[Ze,qe]=V(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=K(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;B(()=>{if("files"===ee.place)en(["@files",...Qe(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Je.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const rn="products"===ee.place,an="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=rn&&ee.nodeId?Je.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Re.readOnly} ${Re.editedAtHq(e.sharedFrom)}`:Re.readOnly,cn=R(()=>te.map(e=>e.id),[te]),un=R(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=g(cn),pn=R(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=U(!0);B(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");B(()=>{he&&mn.setSelection(he)},[gn]);const vn=U(gn??""),kn=pn.join("\0");B(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Ve?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=V(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?Xe.get(n.id)?.name:un.get(n.id)?.name)&&Ne?.(n,e)},Cn=async e=>{if(!Ce)return;const n=await Ce(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Nn=K(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Re.alreadyHere:void 0;const l=Xe.get(e.id);return n===e.id||n&&$e(n,e.id)?Re.notIntoItself:(l?.parentId??null)===n?Re.folderAlreadyHere:void 0};n.push({key:s,label:Re.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of Ye.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[Ye,Xe,tn,$e,on,Re]),In=K(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=V(null),jn={words:Re,media:Ke,denied:ve,moveTargets:Nn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ce&&Be?e=>{Cn(e)}:void 0,rename:Ne&&Be?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&Be?Ie:void 0,trash:De&&Be?De:void 0,deleteFolder:Se&&Be?Se:void 0,folderNotEmpty:e=>!!Xe.get(e)?.notEmpty,replace:ze&&Be?ze:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Re.urlLabel,n)},openInDesign:Fe,restore:je,deleteForever:Le},Ln=e=>c(e,jn),Tn=w(),zn=(e,n)=>{Ve||(mn.isSelected(e)||mn.select(e),Tn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return rn?{kind:"render",id:e}:an?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[On,Fn]=V(null),[En,Pn]=V(null),[An,Mn]=V(null);B(()=>{if(!En&&!On)return;const e=()=>{Pn(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[En,On]);const Un=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Rn=(e,n)=>!(!Ie||ve.move||Ve)&&(!!Un(e,J)||!(!Un(e,X)||!An)&&(n!==An&&!(n&&$e(n,An)))),Kn=(e,n)=>({onDragEnter:l=>{Rn(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{Rn(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",On!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(Rn(e,n))if(e.preventDefault(),Fn(null),Un(e,J)){let l;try{l=JSON.parse(e.dataTransfer.getData(J))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else An&&(Ie({kind:"folder",id:An},n),Mn(null))}}),Vn=e=>{const n=e=>Un(e,J)||Un(e,X)||Un(e,"Files");return{onDragEnter:l=>{n(l)&&Pn(e)},onDragOver:l=>{n(l)&&En!==e&&Pn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Pn(n=>n===e?null:n)}}},Bn=(e,n,l)=>/* @__PURE__ */H(E,{side:"right",content:En===e?Re.noDropProducts:sn(l),open:En===e||!En&&void 0,children:/* @__PURE__ */H("span",{children:n})}),Gn=e=>({onContextMenu:n=>{Tn.open(n,e)}}),Wn=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=Ze.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
2
- return G("div",{role:"none",className:"contents",children:[
3
- /* @__PURE__ */H(n,{label:Bn(i,e.name,t),level:r,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Re.fileCount(e.count):void 0,selected:rn&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Vn(i),...Be?Gn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */H(l,{children:Wn(d,r+1,t)})]},e.id)}),Hn=(e,r)=>(Ye.get(e)??[]).map(e=>{const a=Ye.get(e.id),i=Ze.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=Ln({kind:"folder",id:e.id});/* @__PURE__ */
4
- return G("div",{role:"none",className:"contents",children:[
5
- /* @__PURE__ */H(n,{label:e.name,level:r,icon:a&&i?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Re.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:On===e.id?"into":void 0,dragging:An===e.id,draggable:Be&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */H(m,{value:e.name,label:Re.folderName,onDone:xn}):void 0,actions:Be&&o.length?/* @__PURE__ */H(I,{align:"end","aria-label":Re.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Kn(e.id,e.id),...Be?Gn({kind:"folder",id:e.id}):{},...Be&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(X,e.id),Mn(e.id)},onDragEnd:()=>{Mn(null),Fn(null)}}:{}}}),a&&i&&/* @__PURE__ */H(l,{children:Hn(e.id,r+1)})]},e.id)}),Jn=Ze.has("@files"),Xn=Ze.has("@products"),Yn=/* @__PURE__ */G(e,{"aria-label":Re.folders,children:[re&&/* @__PURE__ */G(W,{children:[
6
- /* @__PURE__ */H(n,{label:Bn("@products",Re.products),level:1,icon:Z.lock,badge:{label:Re.readOnlyBadge,tone:"neutral"},expanded:re.length?Xn:void 0,onToggle:()=>_e("@products"),selected:rn&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Vn("@products")}}),Xn&&re.length>0&&/* @__PURE__ */H(l,{children:Wn(re,2)})]}),
7
- /* @__PURE__ */H(n,{label:Re.allFiles,level:1,icon:Jn?Z.folderOpen:Z.folder,count:ae,countLabel:null!=ae?Re.fileCount(ae):void 0,expanded:Ye.get(null)?.length?Jn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===On?"into":void 0,rowProps:{"data-media-row":"@files",...Kn("@files",null)}}),Jn&&(Ye.get(null)?.length??0)>0&&/* @__PURE__ */H(l,{children:Hn(null,2)}),Be&&/* @__PURE__ */H(n,{label:Re.trash,level:1,icon:Z.trash,count:ie,countLabel:null!=ie?Re.fileCount(ie):void 0,selected:an,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Qn=(()=>{if(an)return[{label:Re.trash}];if(rn){const e=ee.nodeId?Je.get(ee.nodeId)?.path??[]:[];return[{label:Re.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=Qe(on);return[{label:Re.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),$n=rn?Re.readOnly:ve.upload,Zn=!!xe&&!an&&!$n,qn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Zn,onAccept:e=>xe?.(e,on)}),_n=rn?Re.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */G("div",{className:"flex flex-wrap items-center gap-2",children:[Be&&Ce&&!an&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{Cn(on)},...el(_n),children:Re.newFolder}),xe&&!an&&/* @__PURE__ */H(O,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>qn.open(),...el($n),children:Re.upload}),Be&&an&&Te&&te.length>0&&/* @__PURE__ */H(O,{variant:"danger",size:"sm",onClick:Te,...el(ve.deleteForever),children:Re.emptyTrash})]}),ll=(e,n,l,r,a)=>/* @__PURE__ */H("div",{style:{width:He?void 0:a,flex:He?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */H(p,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),rl=e=>n=>ce?.({...se,[e]:n}),al=/* @__PURE__ */G("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */H("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */H(N,{size:"sm",type:"search",leftIcon:Z.search,placeholder:rn?Re.searchProducts:Re.search,"aria-label":rn?Re.searchProducts:Re.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Re.mediaType,se.type,[{value:"all",label:Re.allTypes},{value:"image",label:Re.images},{value:"video",label:Re.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],rl("type"),130),ce&&!rn&&!an&&ll(Re.use,se.use,[{value:"any",label:Re.anyUse},{value:"email",label:Re.emailOnly},{value:"website",label:Re.websiteOnly},{value:"unused",label:Re.notUsed}],rl("use"),130),ce&&Be&&ll(Re.sort,se.sort,[{value:"newest",label:Re.newest},{value:"name",label:Re.byName},{value:"size",label:Re.bySize}],rl("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */H(k,{size:"sm",label:Re.view,value:me,onChange:pe,options:[{value:"grid",label:Re.grid,icon:Z.grid},{value:"list",label:Re.list,icon:Z.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Re.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Re.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Re.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Re.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */H(z,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=Be&&tn&&!!Ie&&!ve.move,dl=!!Me&&!an,sl=U(""),cl=U(null),ul=()=>cl.current?.dropped?"dropped":"cancelled",ml=U(Me);ml.current=Me;const pl=K(e=>{const n=cl.current;n&&(cl.current=null,n.stop(),L(sl.current,!1),e&&ml.current?.(e))},[]),hl=K(e=>{pl(ul());const n=Ge.current?.ownerDocument;if(!n)return;sl.current=T(Ge.current);const l=Ge.current?.closest("[data-modal-panel]"),r=e=>{sl.current&&!l?.contains(e.target)&&L(sl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=cl.current;if(e){if(a())return pl("dropped");e.dropped=!0,L(sl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;pl(n&&"none"!==n?"dropped":a()?ul():"cancelled")},o=()=>{a()&&pl(ul())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);cl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[pl]);B(()=>()=>pl(ul()),[pl]);const fl=(e,n,l)=>{if("start"!==e)return;const r=un.get(n);r&&gl(r)&&(hl(l??null),Me(e))},gl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),vl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):gl(e),...ol&&gl(e)?{dragAlso:{[Y]:gl(e)}}:{}})),kl=He?Math.max(72,Math.floor((We-24-16-1)/3)):112,yl=U(null),bl=v({containerRef:yl,enabled:Be&&!He&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),wl=e=>{if(Ve){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Ee?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},xl=te.length?null:oe?/* @__PURE__ */H(i,{variant:"dashed",title:Re.noMatches}):rn?/* @__PURE__ */H(i,{variant:"dashed",title:Re.emptyProducts,description:sn(dn)}):an?/* @__PURE__ */H(i,{variant:"dashed",title:Re.trashEmpty}):!Zn||Ve?/* @__PURE__ */H(i,{variant:"dashed",title:Re.emptyFolder}):null,Cl="list"===me&&te.length>0,Nl=xl??(Cl?/* @__PURE__ */H("ul",{role:"listbox","aria-multiselectable":Be||void 0,"aria-label":Re.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */G("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>wl(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!gl(e)||void 0,onDragStart:gl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Y,gl(e)),fl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
8
- /* @__PURE__ */H("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
9
- /* @__PURE__ */H("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
10
- /* @__PURE__ */H("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */H("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */H(h,{items:vl,readOnly:!Zn||Ve,onFiles:Zn&&!Ve?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:kl,dragType:ol?J:dl?Y:void 0,onDragOutChange:dl?(e,n,l)=>fl(e,n,l):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:wl,onItemContextMenu:Be?zn:void 0,menuOnMedia:Be})),Il=u({count:pn.length,kind:In(pn),targets:Nn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Dl=P({variant:"secondary",size:"sm"}),Sl=/* @__PURE__ */H(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */G(W,{children:[Z.folder,Re.moveTo]}),items:Il,disabled:!!ve.move}),jl=Be&&pn.length>1&&!rn?/* @__PURE__ */G("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
11
- /* @__PURE__ */H(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Re.selected(pn.length)}),/* @__PURE__ */G(W,an?{children:[je&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>je(pn),...el(ve.restore),children:Re.restore}),Le&&/* @__PURE__ */H(O,{variant:"secondary-danger",size:"sm",onClick:()=>Le(pn),...el(ve.deleteForever),children:Re.deleteForever})]}:{children:[Ie&&Sl,Ne&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Re.rename}),De&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Re.moveFilesToTrash(pn.length)})]}),
12
- /* @__PURE__ */H(O,{variant:"ghost",size:"sm",onClick:mn.clear,children:Re.clearSelection})]}):null,Ll=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===bn?.kind&&bn.id===e.id;l("name",Re.name,r?/* @__PURE__ */H(m,{value:e.name,label:Re.fileName,onDone:xn}):e.name),l("type",Re.type,e.typeLabel),l("size",Re.size,e.sizeLabel),l("resolution",Re.resolution,e.resolution),rn?(l("design",Re.design,e.design),l("finish",Re.finish,e.finish),l("angle",Re.angleLug,e.angleLug),l("owner",Re.owner,e.owner)):(l("added",Re.addedBy,e.addedBy),l("folder",Re.folder,e.folderPath)),l("used",Re.usedIn,null!=e.usedCount?Re.places(e.usedCount):void 0);const a=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
13
- return G("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
14
- /* @__PURE__ */H("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),rn&&/* @__PURE__ */H(C,{tone:"neutral",title:Re.readOnlyBadge,children:sn(dn)}),
15
- /* @__PURE__ */H(t,{size:"sm",columns:1,items:n}),!an&&/* @__PURE__ */G("div",{className:"flex gap-2",children:[
16
- /* @__PURE__ */H("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */H(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Re.fileUrl,onFocus:e=>e.currentTarget.select()})}),
17
- /* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>jn.copyUrl(e.id),children:Re.copyUrl})]}),tn&&Be&&/* @__PURE__ */G("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>ze(e.id),...el(ve.replace),children:Re.replace}),Oe&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Oe(e.id),children:Re.cropEdit}),Ie&&"submenu"===a?.type&&/* @__PURE__ */H(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */G(W,{children:[Z.folder,Re.moveTo]}),items:a.items,disabled:!!ve.move}),Ne&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Re.rename}),De&&/* @__PURE__ */H(D,{"aria-label":Re.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:Z.trash})]}),an&&Be&&/* @__PURE__ */G("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */H(O,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Re.restore}),Le&&/* @__PURE__ */H(O,{variant:"danger",size:"sm",onClick:()=>Le([e.id]),...el(ve.deleteForever),children:Re.deleteForever})]}),rn&&Fe&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Re.openInDesign}),ge&&/* @__PURE__ */H(f,{items:ge})]})},Tl=hn?hn.private?Re.privateNoPick:hn.pickDisabledReason:void 0,zl=Ve?/* @__PURE__ */G("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
18
- /* @__PURE__ */H("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Re.oneChosen(hn.name):Re.noneChosen}),
19
- /* @__PURE__ */G("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */H(O,{variant:"secondary",size:"sm",onClick:Pe,children:Re.cancel}),
20
- /* @__PURE__ */H(O,{variant:"primary",size:"sm",disabled:!hn,...el(Tl),onClick:()=>{hn&&!Tl&&Ee?.(hn)},children:Re.chooseImage})]})]}):null,Ol=Be&&!!hn,Fl=/* @__PURE__ */G("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */H(C,{tone:"neutral",children:Ae}),
21
- /* @__PURE__ */G("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
22
- /* @__PURE__ */H(d,{items:Qn}),nl]}),al,jl,
23
- /* @__PURE__ */G("div",{ref:yl,className:"relative",onPointerDown:bl.onPointerDown,onKeyDown:e=>{Be&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Nl,
24
- /* @__PURE__ */H(a,{rect:bl.rect})]}),Zn&&/* @__PURE__ */H("input",{...qn.inputProps}),
25
- /* @__PURE__ */H(j,{rejections:qn.rejections})]});/* @__PURE__ */
26
- return G("div",{ref:Ge,"data-media-library":"","data-layout":He?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ue}`.trim(),children:[/* @__PURE__ */G("div",He?{className:"flex flex-col gap-3 p-3",children:[Yn,Fl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
27
- /* @__PURE__ */H("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Yn}),
28
- /* @__PURE__ */H("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Fl}),Ol&&/* @__PURE__ */H("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:Ll(hn)})]}),zl,He&&/* @__PURE__ */H(o,{open:Ol,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&Ll(hn)}),Tn.state&&/* @__PURE__ */H(x,{...Tn.props,items:Ln(Tn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */H(r,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{J as MEDIA_FILES_DRAG_TYPE,Y as MEDIA_FILE_DRAG_TYPE,X as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,Q as readMediaFileDrag};
@@ -1,9 +0,0 @@
1
- import{useOverlayTarget as e,usePopupAnchor as t,usePopupLevel as r,usePopupLevelBindings as i,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as a}from"./chunk-25M4CAB3.js";import{dialogA11y as d}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-7QSDPSXP.js";import{useFocusTrap as m,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{Icon as u}from"./chunk-ISVODSRP.js";import{useHydrated as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as b}from"./chunk-L6XEON5Q.js";import{useRef as g,useId as x,useState as y,useEffect as v}from"react";import{createPortal as w}from"react-dom";import{jsxs as k,Fragment as N,jsx as j}from"react/jsx-runtime";var C={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},D={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function W(e,t){const r=window.innerHeight-(t.top+t.height);if("bottom"===e)return{left:t.left,width:t.width,bottom:r};const i={top:t.top,height:t.height};return"left"===e?{...i,left:t.left}:{...i,right:window.innerWidth-(t.left+t.width)}}function S({onClose:e}){const t=b().dialog;/* @__PURE__ */
2
- return j("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */j(u,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function V({open:u,onClose:b,side:V="right",size:B="md",title:E,description:G,footer:H,children:I,blocking:O=!1,dirty:P=!1,initialFocus:Q,"aria-label":U,"aria-labelledby":z,"aria-describedby":A,className:F=""}){const L=g(null),R=x(),T=x(),X=x(),Y=e(p()),[J,M]=y(null),Z=a({open:u,dirty:P,onClose:b,title:E,layer:J}),$=g(null),q=t(u&&null!==Y,$),K=r(u&&null!==Y,$),_=i(K,J),ee=o(K),te=null!==K.host;if(c(u),m(L,u&&null!==Y,Q,_),h(u),v(()=>{if(u)return f(()=>!_.current?.(document.activeElement)&&(O||Z(),!0),()=>L.current)},[u,O,Z,_]),!u||!Y)return null;const re="bottom"===V,ie={...re?{maxHeight:"85vh"}:{},...q?W(V,q):{}};/* @__PURE__ */
3
- return k(N,{children:[/* @__PURE__ */j("span",{ref:$,hidden:!0,"data-popup-anchor":""}),w(
4
- /* @__PURE__ */j(n,{value:J,children:/* @__PURE__ */k("div",{ref:M,className:te?"fixed inset-0 pointer-events-none":"fixed inset-0",style:s(K),role:"presentation","data-overlay-layer":"",children:[
5
- /* @__PURE__ */j("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(te?"pointer-events-auto"+(l(K)?" rounded-(--radius-window)":""):"inset-0"),style:ee??void 0,hidden:te&&!ee,onClick:O?void 0:Z,"aria-hidden":"true","data-popup-scrim":te?"window":"system"}),
6
- /* @__PURE__ */k("div",{ref:L,...d({modal:!0,titleId:E?X:void 0,labelledBy:z,label:U}),"aria-describedby":A??(G?T:I?R:void 0),"data-drawer-side":V,"data-popup-panel":"",style:ie,className:["fixed flex flex-col bg-white shadow-xl",te?"pointer-events-auto":"",re?"":`w-full max-w-full ${C[B]}`,q?"":D[V],re?"rounded-t-xl":"",F].filter(Boolean).join(" "),children:[E?/* @__PURE__ */k("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
7
- /* @__PURE__ */k("div",{className:"min-w-0",children:[
8
- /* @__PURE__ */j("h2",{id:X,className:"text-base font-semibold text-gray-900",children:E}),G&&/* @__PURE__ */j("p",{id:T,className:"mt-0.5 text-sm text-gray-500",children:G})]}),!O&&/* @__PURE__ */j(S,{onClose:Z})]}):!O&&/* @__PURE__ */j("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */j(S,{onClose:Z})}),
9
- /* @__PURE__ */k("div",{id:R,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[G&&!E&&/* @__PURE__ */j("p",{id:T,className:("mb-3 text-sm text-gray-500 "+(O?"":"pr-8")).trim(),children:G}),I]}),H&&/* @__PURE__ */j("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:H})]})]})}),Y)]})}export{V as Drawer};