@spacecorexdev/core 0.0.5 → 0.2.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 (414) hide show
  1. package/dist/api/index.js +1 -0
  2. package/dist/contract.js +1 -0
  3. package/dist/hooks/index.js +1 -0
  4. package/dist/index.js +7 -0
  5. package/{src → dist}/styles/ant-table.css +5 -26
  6. package/{src → dist}/styles/index.css +8 -8
  7. package/dist/types/index.js +1 -0
  8. package/dist/ui/index.js +1 -0
  9. package/dist/utils/index.js +7 -0
  10. package/package.json +67 -70
  11. package/types/api/project.d.ts +10 -1
  12. package/types/index.d.ts +4 -4
  13. package/types/types/index.d.ts +1 -3
  14. package/types/types/project/base.d.ts +6 -1
  15. package/types/types/project/index.d.ts +1 -0
  16. package/types/types/project/member.d.ts +1 -1
  17. package/types/types/{projectRole.d.ts → project/projectRole.d.ts} +2 -2
  18. package/types/ui/ResizableTable/index.d.ts +7 -0
  19. package/types/ui/RoleSelector/index.d.ts +7 -1
  20. package/types/ui/UIFileUpload.d.ts +2 -2
  21. package/types/ui/index.d.ts +1 -10
  22. package/types/ui/upload/index.d.ts +6 -0
  23. package/types/utils/CacheIndexedDB.d.ts +9 -0
  24. package/types/utils/index.d.ts +2 -2
  25. package/types/utils/mailto.d.ts +12 -0
  26. package/public/cmaps/78-EUC-H.bcmap +0 -0
  27. package/public/cmaps/78-EUC-V.bcmap +0 -0
  28. package/public/cmaps/78-H.bcmap +0 -0
  29. package/public/cmaps/78-RKSJ-H.bcmap +0 -0
  30. package/public/cmaps/78-RKSJ-V.bcmap +0 -0
  31. package/public/cmaps/78-V.bcmap +0 -0
  32. package/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
  33. package/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
  34. package/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
  35. package/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
  36. package/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
  37. package/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
  38. package/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
  39. package/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
  40. package/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
  41. package/public/cmaps/Add-H.bcmap +0 -0
  42. package/public/cmaps/Add-RKSJ-H.bcmap +0 -0
  43. package/public/cmaps/Add-RKSJ-V.bcmap +0 -0
  44. package/public/cmaps/Add-V.bcmap +0 -0
  45. package/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
  46. package/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
  47. package/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
  48. package/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
  49. package/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
  50. package/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
  51. package/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
  52. package/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  53. package/public/cmaps/Adobe-GB1-0.bcmap +0 -0
  54. package/public/cmaps/Adobe-GB1-1.bcmap +0 -0
  55. package/public/cmaps/Adobe-GB1-2.bcmap +0 -0
  56. package/public/cmaps/Adobe-GB1-3.bcmap +0 -0
  57. package/public/cmaps/Adobe-GB1-4.bcmap +0 -0
  58. package/public/cmaps/Adobe-GB1-5.bcmap +0 -0
  59. package/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  60. package/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
  61. package/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
  62. package/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
  63. package/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
  64. package/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
  65. package/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
  66. package/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
  67. package/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  68. package/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
  69. package/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
  70. package/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
  71. package/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  72. package/public/cmaps/B5-H.bcmap +0 -0
  73. package/public/cmaps/B5-V.bcmap +0 -0
  74. package/public/cmaps/B5pc-H.bcmap +0 -0
  75. package/public/cmaps/B5pc-V.bcmap +0 -0
  76. package/public/cmaps/CNS-EUC-H.bcmap +0 -0
  77. package/public/cmaps/CNS-EUC-V.bcmap +0 -0
  78. package/public/cmaps/CNS1-H.bcmap +0 -0
  79. package/public/cmaps/CNS1-V.bcmap +0 -0
  80. package/public/cmaps/CNS2-H.bcmap +0 -0
  81. package/public/cmaps/CNS2-V.bcmap +0 -3
  82. package/public/cmaps/ETHK-B5-H.bcmap +0 -0
  83. package/public/cmaps/ETHK-B5-V.bcmap +0 -0
  84. package/public/cmaps/ETen-B5-H.bcmap +0 -0
  85. package/public/cmaps/ETen-B5-V.bcmap +0 -0
  86. package/public/cmaps/ETenms-B5-H.bcmap +0 -3
  87. package/public/cmaps/ETenms-B5-V.bcmap +0 -0
  88. package/public/cmaps/EUC-H.bcmap +0 -0
  89. package/public/cmaps/EUC-V.bcmap +0 -0
  90. package/public/cmaps/Ext-H.bcmap +0 -0
  91. package/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
  92. package/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
  93. package/public/cmaps/Ext-V.bcmap +0 -0
  94. package/public/cmaps/GB-EUC-H.bcmap +0 -0
  95. package/public/cmaps/GB-EUC-V.bcmap +0 -0
  96. package/public/cmaps/GB-H.bcmap +0 -4
  97. package/public/cmaps/GB-V.bcmap +0 -0
  98. package/public/cmaps/GBK-EUC-H.bcmap +0 -0
  99. package/public/cmaps/GBK-EUC-V.bcmap +0 -0
  100. package/public/cmaps/GBK2K-H.bcmap +0 -0
  101. package/public/cmaps/GBK2K-V.bcmap +0 -0
  102. package/public/cmaps/GBKp-EUC-H.bcmap +0 -0
  103. package/public/cmaps/GBKp-EUC-V.bcmap +0 -0
  104. package/public/cmaps/GBT-EUC-H.bcmap +0 -0
  105. package/public/cmaps/GBT-EUC-V.bcmap +0 -0
  106. package/public/cmaps/GBT-H.bcmap +0 -0
  107. package/public/cmaps/GBT-V.bcmap +0 -0
  108. package/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
  109. package/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
  110. package/public/cmaps/GBpc-EUC-H.bcmap +0 -0
  111. package/public/cmaps/GBpc-EUC-V.bcmap +0 -0
  112. package/public/cmaps/H.bcmap +0 -0
  113. package/public/cmaps/HKdla-B5-H.bcmap +0 -0
  114. package/public/cmaps/HKdla-B5-V.bcmap +0 -0
  115. package/public/cmaps/HKdlb-B5-H.bcmap +0 -0
  116. package/public/cmaps/HKdlb-B5-V.bcmap +0 -0
  117. package/public/cmaps/HKgccs-B5-H.bcmap +0 -0
  118. package/public/cmaps/HKgccs-B5-V.bcmap +0 -0
  119. package/public/cmaps/HKm314-B5-H.bcmap +0 -0
  120. package/public/cmaps/HKm314-B5-V.bcmap +0 -0
  121. package/public/cmaps/HKm471-B5-H.bcmap +0 -0
  122. package/public/cmaps/HKm471-B5-V.bcmap +0 -0
  123. package/public/cmaps/HKscs-B5-H.bcmap +0 -0
  124. package/public/cmaps/HKscs-B5-V.bcmap +0 -0
  125. package/public/cmaps/Hankaku.bcmap +0 -0
  126. package/public/cmaps/Hiragana.bcmap +0 -0
  127. package/public/cmaps/KSC-EUC-H.bcmap +0 -0
  128. package/public/cmaps/KSC-EUC-V.bcmap +0 -0
  129. package/public/cmaps/KSC-H.bcmap +0 -0
  130. package/public/cmaps/KSC-Johab-H.bcmap +0 -0
  131. package/public/cmaps/KSC-Johab-V.bcmap +0 -0
  132. package/public/cmaps/KSC-V.bcmap +0 -0
  133. package/public/cmaps/KSCms-UHC-H.bcmap +0 -0
  134. package/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  135. package/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  136. package/public/cmaps/KSCms-UHC-V.bcmap +0 -0
  137. package/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
  138. package/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
  139. package/public/cmaps/Katakana.bcmap +0 -0
  140. package/public/cmaps/LICENSE +0 -36
  141. package/public/cmaps/NWP-H.bcmap +0 -0
  142. package/public/cmaps/NWP-V.bcmap +0 -0
  143. package/public/cmaps/RKSJ-H.bcmap +0 -0
  144. package/public/cmaps/RKSJ-V.bcmap +0 -0
  145. package/public/cmaps/Roman.bcmap +0 -0
  146. package/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  147. package/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  148. package/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  149. package/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  150. package/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  151. package/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  152. package/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  153. package/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  154. package/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
  155. package/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
  156. package/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
  157. package/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
  158. package/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
  159. package/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
  160. package/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
  161. package/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
  162. package/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  163. package/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  164. package/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  165. package/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  166. package/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  167. package/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  168. package/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  169. package/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  170. package/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  171. package/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  172. package/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  173. package/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  174. package/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  175. package/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  176. package/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  177. package/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  178. package/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  179. package/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  180. package/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  181. package/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  182. package/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  183. package/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  184. package/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  185. package/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
  186. package/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
  187. package/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
  188. package/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
  189. package/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
  190. package/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
  191. package/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
  192. package/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
  193. package/public/cmaps/V.bcmap +0 -0
  194. package/public/cmaps/WP-Symbol.bcmap +0 -0
  195. package/public/polyfills/polyfills.js +0 -802
  196. package/public/vendor/docx/docx.worker.js +0 -5
  197. package/public/vendor/docx/jszip.min.js +0 -13
  198. package/public/vendor/libarchive/libarchive.wasm +0 -0
  199. package/public/vendor/libarchive/worker-bundle.js +0 -6
  200. package/public/vendor/pptx/pptx.worker.js +0 -26
  201. package/public/wasm/cad/0.8.2/dwfv-render.wasm +0 -0
  202. package/public/wasm/cad/0.8.2/dwg-worker.js +0 -24
  203. package/public/wasm/cad/0.8.2/dwg-worker.js.map +0 -1
  204. package/public/wasm/cad/0.8.2/libredwg-web.js +0 -2
  205. package/public/wasm/cad/0.8.2/libredwg-web.wasm +0 -0
  206. package/public/wasm/cad/dwfv-render.wasm +0 -0
  207. package/public/wasm/cad/dwg-worker.js +0 -24
  208. package/public/wasm/cad/dwg-worker.js.map +0 -1
  209. package/public/wasm/cad/libredwg-web.js +0 -2
  210. package/public/wasm/cad/libredwg-web.wasm +0 -0
  211. package/public/wasm/data/sql-wasm.wasm +0 -0
  212. package/public/wasm/hdiff.wasm +0 -0
  213. package/public/wasm/model/LICENSE.occt-import-js.txt +0 -504
  214. package/public/wasm/model/LICENSE.occt.txt +0 -502
  215. package/public/wasm/model/occt-import-js.js +0 -19
  216. package/public/wasm/model/occt-import-js.wasm +0 -0
  217. package/public/wasm/model/occt-worker.js +0 -83
  218. package/public/wasm/typst/fonts/DejaVuSansMono-Bold.ttf +0 -0
  219. package/public/wasm/typst/fonts/DejaVuSansMono-BoldOblique.ttf +0 -0
  220. package/public/wasm/typst/fonts/DejaVuSansMono-Oblique.ttf +0 -0
  221. package/public/wasm/typst/fonts/DejaVuSansMono.ttf +0 -0
  222. package/public/wasm/typst/fonts/LibertinusSerif-Bold.otf +0 -0
  223. package/public/wasm/typst/fonts/LibertinusSerif-BoldItalic.otf +0 -0
  224. package/public/wasm/typst/fonts/LibertinusSerif-Italic.otf +0 -0
  225. package/public/wasm/typst/fonts/LibertinusSerif-Regular.otf +0 -0
  226. package/public/wasm/typst/fonts/LibertinusSerif-Semibold.otf +0 -0
  227. package/public/wasm/typst/fonts/LibertinusSerif-SemiboldItalic.otf +0 -0
  228. package/public/wasm/typst/fonts/NewCM10-Bold.otf +0 -0
  229. package/public/wasm/typst/fonts/NewCM10-BoldItalic.otf +0 -0
  230. package/public/wasm/typst/fonts/NewCM10-Italic.otf +0 -0
  231. package/public/wasm/typst/fonts/NewCM10-Regular.otf +0 -0
  232. package/public/wasm/typst/fonts/NewCMMath-Bold.otf +0 -0
  233. package/public/wasm/typst/fonts/NewCMMath-Book.otf +0 -0
  234. package/public/wasm/typst/fonts/NewCMMath-Regular.otf +0 -0
  235. package/public/wasm/typst/fonts/README.md +0 -7
  236. package/public/wasm/typst/typst_ts_renderer_bg.wasm +0 -0
  237. package/public/wasm/typst/typst_ts_web_compiler_bg.wasm +0 -0
  238. package/scripts/patch-docx-grid.cjs +0 -412
  239. package/src/api/_base.ts +0 -243
  240. package/src/api/index.ts +0 -17
  241. package/src/api/project.ts +0 -1345
  242. package/src/api/user.ts +0 -1174
  243. package/src/contract.ts +0 -50
  244. package/src/hooks/index.ts +0 -2
  245. package/src/hooks/useLongPress.ts +0 -137
  246. package/src/hooks/useOnlineStatus.ts +0 -22
  247. package/src/index.ts +0 -14
  248. package/src/types/id.ts +0 -2
  249. package/src/types/index.ts +0 -5
  250. package/src/types/project/base.ts +0 -63
  251. package/src/types/project/contract.ts +0 -79
  252. package/src/types/project/contractStatus.tsx +0 -15
  253. package/src/types/project/index.ts +0 -5
  254. package/src/types/project/member.ts +0 -46
  255. package/src/types/project/progress.ts +0 -43
  256. package/src/types/projectRole.ts +0 -17
  257. package/src/types/theme.ts +0 -1
  258. package/src/types/user/index.ts +0 -1
  259. package/src/types/user/role.ts +0 -7
  260. package/src/ui/CommentTimeline/index.tsx +0 -330
  261. package/src/ui/FileManager/FileContextMenu.tsx +0 -628
  262. package/src/ui/FileManager/FileGridView.tsx +0 -529
  263. package/src/ui/FileManager/FileTableView.tsx +0 -405
  264. package/src/ui/FileManager/FileToolbar.tsx +0 -119
  265. package/src/ui/FileManager/FileVersionHistoryModal.tsx +0 -175
  266. package/src/ui/FileManager/MoveCopyToProjectModal.tsx +0 -119
  267. package/src/ui/FileManager/ShareToWechatModal.tsx +0 -419
  268. package/src/ui/FileManager/hooks/useFileManagerActions.ts +0 -2532
  269. package/src/ui/FileManager/hooks/useFileManagerState.ts +0 -419
  270. package/src/ui/FileManager/index.tsx +0 -580
  271. package/src/ui/FileManager/projectFileManagerApi.ts +0 -57
  272. package/src/ui/FileManager/types.ts +0 -184
  273. package/src/ui/FileManager/utils/fileDeltaWorker.ts +0 -193
  274. package/src/ui/FileManager/utils/fileTree.ts +0 -178
  275. package/src/ui/FileManager/utils/fileUpload.ts +0 -714
  276. package/src/ui/FileManager/utils/fileUtils.ts +0 -65
  277. package/src/ui/InvoiceRecordsList/index.tsx +0 -813
  278. package/src/ui/MyFileSelectorModal.tsx +0 -261
  279. package/src/ui/ProjectSelector/index.tsx +0 -472
  280. package/src/ui/ProjectSelector/projectCache.ts +0 -40
  281. package/src/ui/RoleSelector/index.tsx +0 -473
  282. package/src/ui/RoleSelector/roleCache.ts +0 -40
  283. package/src/ui/UIAlert.tsx +0 -399
  284. package/src/ui/UIAlertExample.tsx +0 -129
  285. package/src/ui/UIConfirm.tsx +0 -335
  286. package/src/ui/UIConfirmExample.tsx +0 -165
  287. package/src/ui/UIDatePicker.tsx +0 -146
  288. package/src/ui/UIDateRangePicker.tsx +0 -38
  289. package/src/ui/UIFilePreview/ExcelEditor/index.tsx +0 -617
  290. package/src/ui/UIFilePreview/ExcelEditor/types.ts +0 -24
  291. package/src/ui/UIFilePreview/ExportDropdown.css +0 -85
  292. package/src/ui/UIFilePreview/ExportDropdown.tsx +0 -109
  293. package/src/ui/UIFilePreview/IndexedDBUtils.ts +0 -564
  294. package/src/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.ts +0 -576
  295. package/src/ui/UIFilePreview/MarkdownEditor/index.tsx +0 -677
  296. package/src/ui/UIFilePreview/MarkdownEditor/markdownEditor.css +0 -1005
  297. package/src/ui/UIFilePreview/MarkdownEditor/types.ts +0 -15
  298. package/src/ui/UIFilePreview/PPTXEditor/index.tsx +0 -602
  299. package/src/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.ts +0 -77
  300. package/src/ui/UIFilePreview/RichDocEditor/exportRDocPdf.ts +0 -374
  301. package/src/ui/UIFilePreview/RichDocEditor/index.tsx +0 -730
  302. package/src/ui/UIFilePreview/RichDocEditor/richdoc-editor.css +0 -59
  303. package/src/ui/UIFilePreview/UIFilePreview.tsx +0 -611
  304. package/src/ui/UIFilePreview/WordEditor/index.tsx +0 -3933
  305. package/src/ui/UIFilePreview/WordEditor/style.ts +0 -1213
  306. package/src/ui/UIFilePreview/WordEditor/word-editor.css +0 -999
  307. package/src/ui/UIFilePreview/filePreview.css +0 -193
  308. package/src/ui/UIFilePreview/filetypes/archive.tsx +0 -66
  309. package/src/ui/UIFilePreview/filetypes/cad.tsx +0 -287
  310. package/src/ui/UIFilePreview/filetypes/excel.tsx +0 -355
  311. package/src/ui/UIFilePreview/filetypes/image.tsx +0 -20
  312. package/src/ui/UIFilePreview/filetypes/imageLoader.ts +0 -63
  313. package/src/ui/UIFilePreview/filetypes/pdf.tsx +0 -156
  314. package/src/ui/UIFilePreview/filetypes/ppt.tsx +0 -535
  315. package/src/ui/UIFilePreview/filetypes/pptExportPdf.ts +0 -523
  316. package/src/ui/UIFilePreview/filetypes/video.tsx +0 -482
  317. package/src/ui/UIFilePreview/filetypes/word.tsx +0 -245
  318. package/src/ui/UIFilePreview/filetypes/wordExportMarkdown.ts +0 -86
  319. package/src/ui/UIFilePreview/filetypes/wordExportPdf.tsx +0 -427
  320. package/src/ui/UIFilePreview/index.ts +0 -35
  321. package/src/ui/UIFilePreview/pdfPagination.ts +0 -143
  322. package/src/ui/UIFilePreview/previewUtils.tsx +0 -531
  323. package/src/ui/UIFileUpload.tsx +0 -382
  324. package/src/ui/UIImageUpload.tsx +0 -195
  325. package/src/ui/UILoading.tsx +0 -255
  326. package/src/ui/UILoadingExample.tsx +0 -139
  327. package/src/ui/UISelect.tsx +0 -105
  328. package/src/ui/UIToast.tsx +0 -381
  329. package/src/ui/UIToastExample.tsx +0 -69
  330. package/src/ui/UIToastSingle.tsx +0 -279
  331. package/src/ui/UIViewToggle.tsx +0 -64
  332. package/src/ui/UserSelector/index.tsx +0 -583
  333. package/src/ui/index.ts +0 -84
  334. package/src/ui/upload/image.ts +0 -135
  335. package/src/ui/upload/index.ts +0 -73
  336. package/src/ui/upload/submitFile.ts +0 -106
  337. package/src/ui/upload/submitForm.ts +0 -124
  338. package/src/ui/upload/upload.err.ts +0 -15
  339. package/src/ui/upload/upload.ts +0 -250
  340. package/src/utils/CacheDepartmentInfo.ts +0 -372
  341. package/src/utils/CacheFileContent.ts +0 -315
  342. package/src/utils/CachePermissionInfo.ts +0 -235
  343. package/src/utils/CacheRoleInfo.ts +0 -303
  344. package/src/utils/CacheUserInfo.ts +0 -818
  345. package/src/utils/CacheViewToggleInfo.ts +0 -182
  346. package/src/utils/MessageContentUtils.ts +0 -268
  347. package/src/utils/clipboard.ts +0 -70
  348. package/src/utils/companyEmail.ts +0 -19
  349. package/src/utils/forbidDebugger.ts +0 -59
  350. package/src/utils/formatters.ts +0 -94
  351. package/src/utils/htmlUtils.tsx +0 -59
  352. package/src/utils/index.ts +0 -18
  353. package/src/utils/keyboard.ts +0 -114
  354. package/src/utils/mammothApi.ts +0 -16
  355. package/src/utils/polyfills.ts +0 -928
  356. package/src/utils/regex.ts +0 -14
  357. package/src/utils/storage.ts +0 -95
  358. package/src/utils/workerBootstrap.ts +0 -87
  359. package/types/hooks.d.ts +0 -5
  360. package/types/types/user/index.d.ts +0 -1
  361. package/types/types/user/role.d.ts +0 -7
  362. package/types/ui/FileManager/FileContextMenu.d.ts +0 -50
  363. package/types/ui/FileManager/FileGridView.d.ts +0 -51
  364. package/types/ui/FileManager/FileTableView.d.ts +0 -49
  365. package/types/ui/FileManager/FileToolbar.d.ts +0 -16
  366. package/types/ui/FileManager/FileVersionHistoryModal.d.ts +0 -9
  367. package/types/ui/FileManager/MoveCopyToProjectModal.d.ts +0 -17
  368. package/types/ui/FileManager/ShareToWechatModal.d.ts +0 -10
  369. package/types/ui/FileManager/hooks/useFileManagerActions.d.ts +0 -143
  370. package/types/ui/FileManager/hooks/useFileManagerState.d.ts +0 -146
  371. package/types/ui/FileManager/index.d.ts +0 -16
  372. package/types/ui/FileManager/projectFileManagerApi.d.ts +0 -6
  373. package/types/ui/FileManager/types.d.ts +0 -178
  374. package/types/ui/FileManager/utils/fileDeltaWorker.d.ts +0 -14
  375. package/types/ui/FileManager/utils/fileTree.d.ts +0 -7
  376. package/types/ui/FileManager/utils/fileUpload.d.ts +0 -60
  377. package/types/ui/FileManager/utils/fileUtils.d.ts +0 -26
  378. package/types/ui/InvoiceRecordsList/index.d.ts +0 -43
  379. package/types/ui/MyFileSelectorModal.d.ts +0 -16
  380. package/types/ui/UIFilePreview/ExcelEditor/index.d.ts +0 -20
  381. package/types/ui/UIFilePreview/ExcelEditor/types.d.ts +0 -29
  382. package/types/ui/UIFilePreview/ExportDropdown.d.ts +0 -26
  383. package/types/ui/UIFilePreview/IndexedDBUtils.d.ts +0 -109
  384. package/types/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.d.ts +0 -27
  385. package/types/ui/UIFilePreview/MarkdownEditor/index.d.ts +0 -34
  386. package/types/ui/UIFilePreview/MarkdownEditor/types.d.ts +0 -14
  387. package/types/ui/UIFilePreview/PPTXEditor/index.d.ts +0 -19
  388. package/types/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.d.ts +0 -23
  389. package/types/ui/UIFilePreview/RichDocEditor/exportRDocPdf.d.ts +0 -22
  390. package/types/ui/UIFilePreview/RichDocEditor/index.d.ts +0 -39
  391. package/types/ui/UIFilePreview/UIFilePreview.d.ts +0 -34
  392. package/types/ui/UIFilePreview/WordEditor/index.d.ts +0 -20
  393. package/types/ui/UIFilePreview/WordEditor/style.d.ts +0 -81
  394. package/types/ui/UIFilePreview/filetypes/archive.d.ts +0 -6
  395. package/types/ui/UIFilePreview/filetypes/cad.d.ts +0 -5
  396. package/types/ui/UIFilePreview/filetypes/excel.d.ts +0 -6
  397. package/types/ui/UIFilePreview/filetypes/image.d.ts +0 -6
  398. package/types/ui/UIFilePreview/filetypes/imageLoader.d.ts +0 -7
  399. package/types/ui/UIFilePreview/filetypes/pdf.d.ts +0 -7
  400. package/types/ui/UIFilePreview/filetypes/ppt.d.ts +0 -5
  401. package/types/ui/UIFilePreview/filetypes/pptExportPdf.d.ts +0 -28
  402. package/types/ui/UIFilePreview/filetypes/video.d.ts +0 -6
  403. package/types/ui/UIFilePreview/filetypes/word.d.ts +0 -5
  404. package/types/ui/UIFilePreview/filetypes/wordExportMarkdown.d.ts +0 -19
  405. package/types/ui/UIFilePreview/filetypes/wordExportPdf.d.ts +0 -32
  406. package/types/ui/UIFilePreview/index.d.ts +0 -46
  407. package/types/ui/UIFilePreview/pdfPagination.d.ts +0 -25
  408. package/types/ui/UIFilePreview/previewUtils.d.ts +0 -62
  409. package/types/ui.d.ts +0 -5
  410. package/types/utils/CacheFileContent.d.ts +0 -31
  411. package/types/utils/mammothApi.d.ts +0 -14
  412. package/types/utils.d.ts +0 -5
  413. /package/{src → dist}/styles/ant-modal.css +0 -0
  414. /package/{src → dist}/styles/ant-spin.css +0 -0
@@ -0,0 +1 @@
1
+ var O=Object.defineProperty;var X=(e,t,s)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var v=(e,t)=>{for(var s in t)O(e,s,{get:t[s],enumerable:!0})};var d=(e,t,s)=>X(e,typeof t!="symbol"?t+"":t,s);var U={};v(U,{AuthorizationHandler:()=>C,HttpRequest:()=>n,ResponseCode:()=>V});import ne,{AxiosError as se}from"axios";import{useEffect as Ie,useState as _e,useRef as be}from"react";import{notification as g}from"antd";import{CheckCircleOutlined as K,CloseCircleOutlined as G,InfoCircleOutlined as W,WarningOutlined as Q}from"@ant-design/icons";import{Fragment as Se,jsx as T,jsxs as De}from"react/jsx-runtime";var z={success:T(K,{style:{color:"#52c41a"}}),error:T(G,{style:{color:"#ff4d4f"}}),info:T(W,{style:{color:"#1677ff"}}),warning:T(Q,{style:{color:"#faad14"}})};g.config({placement:"topRight",duration:3,zIndex:1e4});var y=class y{constructor(){d(this,"currentToast",null);d(this,"api",null);d(this,"isInitialized",!1);d(this,"pendingToast",null)}static getInstance(){return y.instance||(y.instance=new y),y.instance}init(t){if(this.api=t,this.isInitialized=!0,this.pendingToast){let s=this.pendingToast;this.pendingToast=null,this.show(s)}}show(t){let{key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i}=t;if(!this.isInitialized||!this.api){this.pendingToast=t;return}this.currentToast?.timer&&clearTimeout(this.currentToast.timer),this.currentToast&&this.currentToast.key===s?(g.destroy(s),this.createNotification({key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i})):(this.currentToast&&g.destroy(this.currentToast.key),this.createNotification({key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i}))}createNotification(t){if(!this.api)return;let{key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i}=t,N={success:this.api.success.bind(this.api),error:this.api.error.bind(this.api),info:this.api.info.bind(this.api),warning:this.api.warning.bind(this.api)}[r];N({key:s,message:a,description:p,duration:m,placement:c||"topRight",icon:z[r],onClose:()=>{this.currentToast?.key===s&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),this.currentToast=null),i?.()}}),this.currentToast={key:s,type:r,message:a,descs:p,duration:m,placement:c,timer:null}}close(){this.currentToast&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),g.destroy(this.currentToast.key),this.currentToast=null)}destroy(){this.close(),g.destroy()}};d(y,"instance");var k=y,Re=k.getInstance();function R(e){return typeof e=="string"?{message:e,duration:3}:e}function I(e){return z[e]}var Z={success:e=>{if(!e)return;let t=R(e);g.success({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("success"),onClose:t.onClose})},error:e=>{if(!e)return;let t=R(e);g.error({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("error"),onClose:t.onClose})},info:e=>{if(!e)return;let t=R(e);g.info({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("info"),onClose:t.onClose})},warning:e=>{if(!e)return;let t=R(e);g.warning({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("warning"),onClose:t.onClose})},custom:(e,t)=>{let{message:s,descs:r,duration:a,placement:p,onClose:m}=t;g[e]({message:s,description:r,duration:a,placement:p,icon:I(e),onClose:m})}};var S=Z;import{Spin as Y}from"antd";import{LoadingOutlined as $}from"@ant-design/icons";import{createRoot as ee}from"react-dom/client";import{jsx as _}from"react/jsx-runtime";var M=Symbol("loading");function B(){let e=window[M];return e||(e={count:0,timeoutId:0,inTimeout:!1},window[M]=e),e}var L={tip:"",fullscreen:!0,delay:0,mask:!0,iconSize:40,wrapperClassName:"ui-loading-wrapper"},te=e=>{let t={...L,...e},{tip:s,fullscreen:r,mask:a,maskStyle:p,iconSize:m,iconStyle:c,containerStyle:i,wrapperClassName:N}=t,H=_($,{style:{fontSize:m,color:"#1677ff",...c},spin:!0}),q=r?{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:a?"rgba(0, 0, 0, 0.45)":"transparent",...p}:{},J={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...i};return _("div",{style:q,className:N,children:_("div",{style:J,children:_(Y,{indicator:H,children:s})})})},l=null,u=null,x=(e={})=>(l&&u&&(u.unmount(),document.body.removeChild(l),l=null,u=null),l=document.createElement("div"),document.body.appendChild(l),u=ee(l),u.render(_(te,{...e})),l),D={show:(e={})=>{let t=B();t.count++;let s={...L,...e};if(s.delay&&s.delay>0){t.timeoutId!=0&&(window.clearTimeout(t.timeoutId),t.timeoutId=0),t.timeoutId=window.setTimeout(()=>{t.timeoutId=0,x(s)},s.delay);return}else x(s)},hide:()=>{let e=B();if(e.count<=0){console.warn("Loading count is less than 0");return}e.count--,e.timeoutId!=0&&(window.clearTimeout(e.timeoutId),e.timeoutId=0),e.count==0&&l&&u&&(u.unmount(),document.body.removeChild(l),l=null,u=null)},service:(e,t={})=>(D.show(t),e.then(s=>(D.hide(),s)).catch(s=>{throw D.hide(),s}))},b=D;import*as w from"febs-browser";import*as P from"febs-browser";import F from"store2";var j=class{constructor(t){d(this,"s");this.s=t}get length(){return this.s.size()}keys(){return this.s.keys()}set(t,s){return s?(s=JSON.stringify(s),s=P.crypt.base64_encode(s),this.s.set(t,s,!0),this):this.remove(t)}get(t,s=null){if(!this.s.has(t))return s;let r=this.s.get(t);if(r){r=P.crypt.base64_decode(r),r=P.string.bytesToUtf8(r||[]);try{return JSON.parse(r)}catch{return this.remove(t),null}}return r}remove(t){return this.s.remove(t),this}clear(){return this.s.clearAll(),this}},f={namespace:function(e){return new j(F.namespace(e||"default"))},namespace_session:function(e){return new j(F.session.namespace(e||"default"))}};var V=(i=>(i[i.SUCCESS=200]="SUCCESS",i[i.OPERATOR_ERROR=400]="OPERATOR_ERROR",i[i.UNAUTHORIZED=401]="UNAUTHORIZED",i[i.UNPERMISSION=402]="UNPERMISSION",i[i.NOT_FOUND=404]="NOT_FOUND",i[i.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",i[i.PARAM_ERROR=601]="PARAM_ERROR",i[i.REQUEST_LIMIT=602]="REQUEST_LIMIT",i))(V||{});function re(e){switch(e){case 404:return"\u8D44\u6E90\u4E0D\u5B58\u5728";case 400:return"\u7CFB\u7EDF\u64CD\u4F5C\u9519\u8BEF";case 601:return"\u53C2\u6570\u9519\u8BEF";case 602:return"\u8FBE\u5230\u8BBF\u95EE\u9650\u5236";case 503:return"\u670D\u52A1\u4E0D\u53EF\u7528";case 401:return"\u672A\u767B\u5F55";case 402:return"\u65E0\u6743\u9650";default:return"\u672A\u77E5\u9519\u8BEF"}}var h=ne.create({baseURL:import.meta.env.VITE_API_BASE,timeout:Number(import.meta.env.VITE_API_TIMEOUT)||5e3,headers:{"Content-Type":"application/json;charset=UTF-8"},withCredentials:!0}),o=class o{static clearStoreToken(){this.setStoreToken(null,0)}static getStoreToken(){let t=f.namespace("bp.ss").get("ss");if(t){let s=f.namespace("bp.ss").get("exp");return{token:JSON.parse(t),exp:s?JSON.parse(s):0}}return null}static getValidStoreToken(){let t=o.getStoreToken();return t&&t.exp>Date.now()-o.TOKEN_EXP?t.token:null}static setStoreToken(t,s){t?(f.namespace("bp.ss").set("ss",JSON.stringify(t)),f.namespace("bp.ss").set("exp",JSON.stringify(s))):f.namespace("bp.ss").clear()}static requestHandleSid(t){let s=o.getStoreToken();s&&s.exp>Date.now()-o.TOKEN_EXP&&t.headers.set(o.HEADER_NAME,o.HEADER_PREFIX+s.token)}static responseHandleSid(t){let s=t.headers.get(o.HEADER_NAME);if(s&&s.startsWith(o.HEADER_PREFIX.trim())){s=s.replace(o.HEADER_PREFIX,"");let r=s;if(s=s.split(".")[1],s&&(s=w.string.bytesToUtf8(w.crypt.base64_decode(s)),s)){let a=JSON.parse(s);return a.exp<Date.now()-o.TOKEN_EXP?(o.clearStoreToken(),!1):(o.setStoreToken(r,a.exp),!0)}o.clearStoreToken(),typeof navigator<"u"&&navigator.onLine&&(window.location.href="/")}return!1}};d(o,"HEADER_NAME","Authorization"),d(o,"HEADER_PREFIX","SPBearer "),d(o,"TOKEN_EXP",20*1e3);var C=o;h.interceptors.request.use(e=>(b.show({delay:5e3}),C.requestHandleSid(e),e),e=>(b.hide(),console.log("Request Error =========="),Promise.reject(e)));h.interceptors.response.use(e=>(b.hide(),e.data.code!==200&&S.warning(e.data.message||re(e.data.code)),C.responseHandleSid(e),e.data),e=>(b.hide(),e instanceof se&&(e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?S.error("\u7F51\u7EDC\u9519\u8BEF"):e.code==="ERR_BAD_RESPONSE"&&S.error("\u670D\u52A1\u5668\u65E0\u54CD\u5E94")),console.log("Response Error =========="),Promise.reject(e)));var n={get(e,t,s){return h({method:"get",url:e,params:t,data:s})},post(e,t,s){return h({method:"post",url:e,params:t,data:s})},put(e,t,s){return h({method:"put",url:e,params:t,data:s})},delete(e,t,s){return h({method:"delete",url:e,params:t,data:s})}};var E={};v(E,{admin:()=>ie,gateway:()=>oe,message:()=>ae,role:()=>de,user:()=>ge});var ie={registerAdmin:e=>n.post("/api/admin/registerAdmin",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode}).then(t=>t),registerUser:e=>n.post("/api/admin/registerUser",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),updateInfoByAdmin:e=>n.post("/api/admin/updateByAdmin",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),list:e=>n.get("/api/admin/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)},oe={register:e=>n.post("/api/register",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),sendSms:e=>n.post("/api/sendSms",{phone:e.phone,imageCode:e.imageCode},null).then(t=>t),isLogin:()=>n.get("/api/isLogin",null,null).then(e=>e),login:e=>n.post("/api/login",null,{phone:e.phone,pwd:e.pwd,pwdSN:e.pwdSN,smsCode:e.smsCode}).then(t=>t),verifyPasswordHash:e=>n.post("/api/verifyPasswordHash",null,{passwordHash:e.passwordHash,passwordSalt:e.passwordSalt}).then(t=>t),logout:()=>n.get("/api/logout",null,null).then(e=>e),listPermissions:()=>n.get("/api/listPermissions",null,null).then(e=>e),listRolePermissions:e=>n.get("/api/listRolePermissions",{id:e.id},null).then(t=>t)},ae={list:e=>n.get("/api/user/message/list",{pageNum:e.pageNum,pageSize:e.pageSize,unread_only:e.unread_only},null).then(t=>t),countUnread:()=>n.get("/api/user/message/unread/count",null,null).then(e=>e),markRead:e=>n.post("/api/user/message/read",null,{messageIds:e.messageIds}).then(t=>t),clearReaded:e=>n.delete("/api/user/message/clearReaded",null,{messageIds:e.messageIds}).then(t=>t)},de={listRoles:()=>n.get("/api/role/listRoles",null,null).then(e=>e),createRole:e=>n.post("/api/role/createRole",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),updateRole:e=>n.post("/api/role/updateRole",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),assignPermissionsToRole:e=>n.post("/api/role/assignPermissionsToRole",null,{role_id:e.role_id,permissions:e.permissions}).then(t=>t),assignRoleToUserPermission:()=>n.post("/api/role/assignRoleToUserPermission",null,null).then(e=>e),assignRoleToUser:e=>n.post("/api/role/assignRoleToUser",null,{user_id:e.user_id,role_ids:e.role_ids}).then(t=>t),listUserRoles:e=>n.get("/api/role/listUserRoles",{user_id:e.user_id},null).then(t=>t),listUserPermissions:e=>n.get("/api/role/listUserPermissions",{user_id:e.user_id},null).then(t=>t),listCompanies:()=>n.get("/api/role/listCompanies",null,null).then(e=>e),createCompany:e=>n.post("/api/role/createCompany",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),updateCompany:e=>n.post("/api/role/updateCompany",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),listDepartments:()=>n.get("/api/role/listDepartments",null,null).then(e=>e),createDepartment:e=>n.post("/api/role/createDepartment",{name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),updateDepartment:e=>n.post("/api/role/updateDepartment",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),assignUserToDepartment:e=>n.post("/api/role/assignUserToDepartment",{user_id:e.user_id,department_id:e.department_id,position:e.position},null).then(t=>t),removeUserFromDepartment:e=>n.post("/api/role/removeUserFromDepartment",{user_id:e.user_id,department_id:e.department_id},null).then(t=>t),listCompanyDepartments:e=>n.get("/api/role/listCompanyDepartments",{company_id:e.company_id},null).then(t=>t),listUserDepartments:e=>n.get("/api/role/listUserDepartments",{user_id:e.user_id},null).then(t=>t),listDepartmentUsers:e=>n.get("/api/role/listDepartmentUsers",{department_id:e.department_id},null).then(t=>t)},ge={getInfoByUsername:e=>n.get("/api/user/infoByUsername",{username:e.username},null).then(t=>t),getInfo:e=>n.get("/api/user/info",{id:e.id},null).then(t=>t),getAvatar:e=>n.get("/api/user/avatar",{id:e.id,tick:e.tick},null).then(t=>t),getAvatarList:e=>n.get("/api/user/avatar_list",{ids:e.ids},null).then(t=>t),updateAvatar:e=>n.post("/api/user/updateAvatar",null,{id:e.id,avatar:e.avatar,avatar_small:e.avatar_small,tick_self:e.tick_self}).then(t=>t),updateManager:e=>n.post("/api/user/updateManager",{id:e.id,managerid:e.managerid},null).then(t=>t),updateInfo:e=>n.post("/api/user/update",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),updatePassword:e=>n.post("/api/user/updatePassword",null,{old_password:e.old_password,old_password_sn:e.old_password_sn,new_password:e.new_password}).then(t=>t),deleteUser:e=>n.post("/api/user/delete",{id:e.id},null).then(t=>t),list:e=>n.get("/api/user/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),listByIds:e=>n.get("/api/user/list_by_ids",{ids:e.ids},null).then(t=>t),search:e=>n.get("/api/user/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),forbid:e=>n.post("/api/user/forbid",{id:e.id,forbid:e.forbid},null).then(t=>t)};var A={};v(A,{contract:()=>le,file:()=>pe,fileversion:()=>me,project:()=>ue,projectprogress:()=>ce});var le={createContract:e=>n.post("/api/project/contract/create",null,{projectId:e.projectId,name:e.name,tag:e.tag,code:e.code,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs}).then(t=>t),deleteContract:e=>n.delete("/api/project/contract/delete",{id:e.id},null).then(t=>t),updateContract:e=>n.post("/api/project/contract/update",null,{id:e.id,name:e.name,code:e.code,tag:e.tag,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs,markdown:e.markdown}).then(t=>t),getContractDetail:e=>n.get("/api/project/contract/detail",{id:e.id},null).then(t=>t),getContractList:e=>n.get("/api/project/contract/list",{projectId:e.projectId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),submitApproval:e=>n.post("/api/project/contract/submit",{id:e.id,sealType:e.sealType},null).then(t=>t),cancelApproval:e=>n.post("/api/project/contract/cancelApproval",{id:e.id},null).then(t=>t),uploadVersion:e=>n.post("/api/project/contract/version/upload",null,{contractId:e.contractId,fileName:e.fileName,fileType:e.fileType,fileSize:e.fileSize,changeLog:e.changeLog}).then(t=>t),getVersionList:e=>n.get("/api/project/contract/version/list",{contractId:e.contractId},null).then(t=>t),deleteVersion:e=>n.delete("/api/project/contract/version/delete",{id:e.id},null).then(t=>t),renameVersion:e=>n.post("/api/project/contract/version/rename",null,{id:e.id,fileName:e.fileName}).then(t=>t),getVersionDetail:e=>n.get("/api/project/contract/version/detail",{id:e.id},null).then(t=>t),setVersionLayerOpinion:e=>n.post("/api/project/contract/version/layerOpinion",null,{contractId:e.contractId,version:e.version,opinion:e.opinion}).then(t=>t),getNewContractCode:e=>n.get("/api/project/contract/newCode",{contractCode:e.contractCode,sequenceLength:e.sequenceLength},null).then(t=>t),getContractHistoryParties:()=>n.get("/api/project/contract/historyParties",null,null).then(e=>e)},pe={getDetail:e=>n.get("/api/project/files/detail",{fileId:e.fileId},null).then(t=>t),listFiles:e=>n.get("/api/project/files/list",{projectId:e.projectId},null).then(t=>t),searchFiles:e=>n.get("/api/project/files/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),addFile:(e,t)=>n.post("/api/project/files/add",{projectId:e.projectId},{fileName:t.fileName,filePath:t.filePath,isSecure:t.isSecure,descs:t.descs,fileType:t.fileType,fileSize:t.fileSize,crc32:t.crc32,fileResourcePath:t.fileResourcePath}).then(s=>s),removeFile:e=>n.post("/api/project/files/remove",{fileId:e.fileId},null).then(t=>t),moveFile:(e,t)=>n.post("/api/project/files/move",{projectId:e.projectId},{oldFileName:t.oldFileName,oldFilePath:t.oldFilePath,newFileName:t.newFileName,newFilePath:t.newFilePath}).then(s=>s),updateFileDescs:e=>n.post("/api/project/files/updateDescs",null,{fileId:e.fileId,descs:e.descs}).then(t=>t),copyFileToProject:e=>n.post("/api/project/files/copyToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),moveFileToProject:e=>n.post("/api/project/files/moveToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),updateFileDelta:e=>n.post("/api/project/files/updateDelta",null,{fileId:e.fileId,deltaData:e.deltaData,deltaSize:e.deltaSize,newFileSize:e.newFileSize,crc32:e.crc32,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),updateFile:e=>n.post("/api/project/files/updateData",null,{fileId:e.fileId,fileSize:e.fileSize,crc32:e.crc32,fileName:e.fileName,fileResourcePath:e.fileResourcePath,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),generateTempAccessToken:e=>n.post("/api/project/files/generateTempAccessToken",{fileId:e.fileId,expireSeconds:e.expireSeconds},null).then(t=>t),folderDownload:(e,t)=>n.post("/api/project/files/folderDownload",{projectId:e.projectId},{folderPath:t.folderPath,folderName:t.folderName}).then(s=>s),folderDownloadStatus:e=>n.get("/api/project/files/folderDownloadStatus",{jobId:e.jobId},null).then(t=>t),listFilesByTempAccessToken:e=>n.get("/api/project/files/listByTempAccessToken",{tempToken:e.tempToken},null).then(t=>t)},me={listVersions:e=>n.get("/api/project/files/version/list",{fileId:e.fileId},null).then(t=>t),getVersionDetail:e=>n.get("/api/project/files/version/detail",{versionId:e.versionId},null).then(t=>t)},ue={enableUserPrivateProject:()=>n.post("/api/project/enablePrivateProject",null,null).then(e=>e),createProject:e=>n.post("/api/project/create",null,{name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate}).then(t=>t),updateProject:e=>n.post("/api/project/update",null,{id:e.id,name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,status:e.status,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate,createTime:e.createTime,updateTime:e.updateTime,createBy:e.createBy,updateBy:e.updateBy}).then(t=>t),updateUserdataOrder:e=>n.post("/api/project/updateUserdataOrder",null,{projectIds:e.projectIds}).then(t=>t),getUserdataOrder:()=>n.get("/api/project/userdataOrder",null,null).then(e=>e),getProjectDetail:e=>n.get("/api/project/detail",{id:e.id},null).then(t=>t),getProjectName:e=>n.get("/api/project/name",{projectId:e.projectId},null).then(t=>t),listProjects:e=>n.get("/api/project/list",{pageNum:e.pageNum,pageSize:e.pageSize,status:e.status,companyId:e.companyId,customerId:e.customerId,userId:e.userId},null).then(t=>t),listProjectsByManager:e=>n.get("/api/project/listByManager",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),changeStatus:e=>n.put("/api/project/status",{id:e.id,status:e.status},null).then(t=>t),getProjectMembers:e=>n.get("/api/project/members",{projectId:e.projectId},null).then(t=>t),getMemberRole:e=>n.get("/api/project/member/role",{projectId:e.projectId,userId:e.userId},null).then(t=>t),assignMember:e=>n.post("/api/project/members/assign",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t),removeMember:e=>n.post("/api/project/members/remove",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t)},ce={createProgress:e=>n.post("/api/project/progress/create",null,{projectId:e.projectId,descs:e.descs,commentCount:e.commentCount,progressTime:e.progressTime}).then(t=>t),updateProgress:e=>n.put("/api/project/progress/update",null,{id:e.id,descs:e.descs,progressTime:e.progressTime}).then(t=>t),deleteProgress:e=>n.delete("/api/project/progress/delete",{id:e.id},null).then(t=>t),getProgressList:e=>n.get("/api/project/progress/list",{projectId:e.projectId},null).then(t=>t),addComment:e=>n.post("/api/project/progress/comment/add",null,{progressId:e.progressId,comment:e.comment}).then(t=>t),deleteComment:e=>n.delete("/api/project/progress/comment/delete",{id:e.id},null).then(t=>t),updateComment:e=>n.put("/api/project/progress/comment/update",{id:e.id},{}).then(t=>t),getCommentList:e=>n.get("/api/project/progress/comment/list",{progressId:e.progressId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)};var Ge={base:U,user:E,project:A};export{Ge as API,C as AuthorizationHandler,n as HttpRequest,V as ResponseCode,ie as admin,le as contract,pe as file,me as fileversion,oe as gateway,ae as message,ue as project,ce as projectprogress,de as role,ge as user};
@@ -0,0 +1 @@
1
+ var n="0.1.0";export{n as CORE_VERSION};
@@ -0,0 +1 @@
1
+ import{useCallback as c,useEffect as E,useRef as v}from"react";var C=1200,w=0,h=0,M=o=>{Date.now()>w||(o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation())},R=()=>{w=Date.now()+C};function D(o,d={}){let{delay:i=500,smallView:r=!1,moveThreshold:T=10}=d,a=v(new Map),l=v(new Map),m=v(new Map),n=c(e=>typeof e=="string"?e:typeof e=="object"&&e!==null&&"id"in e?String(e.id):String(e),[]);E(()=>()=>{a.current.forEach(e=>clearTimeout(e)),a.current.clear(),l.current.clear(),m.current.clear()},[]),E(()=>{if(r)return h===0&&document.addEventListener("contextmenu",M,!0),h+=1,()=>{h-=1,h===0&&document.removeEventListener("contextmenu",M,!0)}},[r]);let f=c(e=>{let t=a.current.get(e);t&&(clearTimeout(t),a.current.delete(e)),m.current.delete(e)},[]),y=c(e=>t=>{if(!r||t.touches.length!==1)return;let s=n(e);l.current.set(s,!1);let u=t.touches[0];m.current.set(s,{x:u.clientX,y:u.clientY});let p=setTimeout(()=>{R(),l.current.set(s,!0),o(e,t)},i);a.current.set(s,p)},[r,i,o,n]),x=c(e=>t=>{if(!r)return;let s=n(e),u=m.current.get(s);if(!u||!t.touches[0]){f(s);return}let p=t.touches[0],S=Math.abs(p.clientX-u.x),O=Math.abs(p.clientY-u.y);(S>T||O>T)&&f(s)},[r,T,n,f]),g=c(e=>()=>{let t=n(e);f(t)},[n,f]),b=c(e=>()=>{g(e)()},[g]),L=c(e=>{let t=n(e);return l.current.get(t)||!1},[n]),P=c(e=>{let t=n(e);l.current.set(t,!1)},[n]);return{handleTouchStart:y,handleTouchMove:x,handleTouchEnd:g,handleTouchCancel:b,wasLongPressed:L,resetLongPress:P}}import{useEffect as U,useState as k}from"react";function _(){let[o,d]=k(typeof navigator<"u"?navigator.onLine:!0);return U(()=>{let i=()=>d(!0),r=()=>d(!1);return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}},[]),o}export{D as useLongPress,_ as useOnlineStatus};
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ var Me=Object.defineProperty;var mt=(e,t,r)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var he=(e,t)=>{for(var r in t)Me(e,r,{get:t[r],enumerable:!0})};var c=(e,t,r)=>mt(e,typeof t!="symbol"?t+"":t,r);var pt="0.1.0";var we={};he(we,{AuthorizationHandler:()=>x,HttpRequest:()=>a,ResponseCode:()=>_e});import It,{AxiosError as Tt}from"axios";import{useEffect as an,useState as ln,useRef as cn}from"react";import{notification as T}from"antd";import{CheckCircleOutlined as gt,CloseCircleOutlined as ft,InfoCircleOutlined as yt,WarningOutlined as ht}from"@ant-design/icons";import{Fragment as gn,jsx as ne,jsxs as fn}from"react/jsx-runtime";var je={success:ne(gt,{style:{color:"#52c41a"}}),error:ne(ft,{style:{color:"#ff4d4f"}}),info:ne(yt,{style:{color:"#1677ff"}}),warning:ne(ht,{style:{color:"#faad14"}})};T.config({placement:"topRight",duration:3,zIndex:1e4});var A=class A{constructor(){c(this,"currentToast",null);c(this,"api",null);c(this,"isInitialized",!1);c(this,"pendingToast",null)}static getInstance(){return A.instance||(A.instance=new A),A.instance}init(t){if(this.api=t,this.isInitialized=!0,this.pendingToast){let r=this.pendingToast;this.pendingToast=null,this.show(r)}}show(t){let{key:r,type:n,message:i,descs:s,duration:o,placement:l,onClose:d}=t;if(!this.isInitialized||!this.api){this.pendingToast=t;return}this.currentToast?.timer&&clearTimeout(this.currentToast.timer),this.currentToast&&this.currentToast.key===r?(T.destroy(r),this.createNotification({key:r,type:n,message:i,descs:s,duration:o,placement:l,onClose:d})):(this.currentToast&&T.destroy(this.currentToast.key),this.createNotification({key:r,type:n,message:i,descs:s,duration:o,placement:l,onClose:d}))}createNotification(t){if(!this.api)return;let{key:r,type:n,message:i,descs:s,duration:o,placement:l,onClose:d}=t,u={success:this.api.success.bind(this.api),error:this.api.error.bind(this.api),info:this.api.info.bind(this.api),warning:this.api.warning.bind(this.api)}[n];u({key:r,message:i,description:s,duration:o,placement:l||"topRight",icon:je[n],onClose:()=>{this.currentToast?.key===r&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),this.currentToast=null),d?.()}}),this.currentToast={key:r,type:n,message:i,descs:s,duration:o,placement:l,timer:null}}close(){this.currentToast&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),T.destroy(this.currentToast.key),this.currentToast=null)}destroy(){this.close(),T.destroy()}};c(A,"instance");var be=A,mn=be.getInstance();function re(e){return typeof e=="string"?{message:e,duration:3}:e}function V(e){return je[e]}var bt={success:e=>{if(!e)return;let t=re(e);T.success({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:V("success"),onClose:t.onClose})},error:e=>{if(!e)return;let t=re(e);T.error({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:V("error"),onClose:t.onClose})},info:e=>{if(!e)return;let t=re(e);T.info({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:V("info"),onClose:t.onClose})},warning:e=>{if(!e)return;let t=re(e);T.warning({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:V("warning"),onClose:t.onClose})},custom:(e,t)=>{let{message:r,descs:n,duration:i,placement:s,onClose:o}=t;T[e]({message:r,description:n,duration:i,placement:s,icon:V(e),onClose:o})}};var se=bt;import{Spin as _t}from"antd";import{LoadingOutlined as wt}from"@ant-design/icons";import{createRoot as Ct}from"react-dom/client";import{jsx as W}from"react/jsx-runtime";var Ue=Symbol("loading");function Be(){let e=window[Ue];return e||(e={count:0,timeoutId:0,inTimeout:!1},window[Ue]=e),e}var Oe={tip:"",fullscreen:!0,delay:0,mask:!0,iconSize:40,wrapperClassName:"ui-loading-wrapper"},Pt=e=>{let t={...Oe,...e},{tip:r,fullscreen:n,mask:i,maskStyle:s,iconSize:o,iconStyle:l,containerStyle:d,wrapperClassName:u}=t,m=W(wt,{style:{fontSize:o,color:"#1677ff",...l},spin:!0}),P=n?{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:i?"rgba(0, 0, 0, 0.45)":"transparent",...s}:{},I={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...d};return W("div",{style:P,className:u,children:W("div",{style:I,children:W(_t,{indicator:m,children:r})})})},v=null,k=null,Le=(e={})=>(v&&k&&(k.unmount(),document.body.removeChild(v),v=null,k=null),v=document.createElement("div"),document.body.appendChild(v),k=Ct(v),k.render(W(Pt,{...e})),v),ie={show:(e={})=>{let t=Be();t.count++;let r={...Oe,...e};if(r.delay&&r.delay>0){t.timeoutId!=0&&(window.clearTimeout(t.timeoutId),t.timeoutId=0),t.timeoutId=window.setTimeout(()=>{t.timeoutId=0,Le(r)},r.delay);return}else Le(r)},hide:()=>{let e=Be();if(e.count<=0){console.warn("Loading count is less than 0");return}e.count--,e.timeoutId!=0&&(window.clearTimeout(e.timeoutId),e.timeoutId=0),e.count==0&&v&&k&&(k.unmount(),document.body.removeChild(v),v=null,k=null)},service:(e,t={})=>(ie.show(t),e.then(r=>(ie.hide(),r)).catch(r=>{throw ie.hide(),r}))},H=ie;import*as ae from"febs-browser";import*as q from"febs-browser";import ze from"store2";var oe=class{constructor(t){c(this,"s");this.s=t}get length(){return this.s.size()}keys(){return this.s.keys()}set(t,r){return r?(r=JSON.stringify(r),r=q.crypt.base64_encode(r),this.s.set(t,r,!0),this):this.remove(t)}get(t,r=null){if(!this.s.has(t))return r;let n=this.s.get(t);if(n){n=q.crypt.base64_decode(n),n=q.string.bytesToUtf8(n||[]);try{return JSON.parse(n)}catch{return this.remove(t),null}}return n}remove(t){return this.s.remove(t),this}clear(){return this.s.clearAll(),this}},_={namespace:function(e){return new oe(ze.namespace(e||"default"))},namespace_session:function(e){return new oe(ze.session.namespace(e||"default"))}};var _e=(d=>(d[d.SUCCESS=200]="SUCCESS",d[d.OPERATOR_ERROR=400]="OPERATOR_ERROR",d[d.UNAUTHORIZED=401]="UNAUTHORIZED",d[d.UNPERMISSION=402]="UNPERMISSION",d[d.NOT_FOUND=404]="NOT_FOUND",d[d.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",d[d.PARAM_ERROR=601]="PARAM_ERROR",d[d.REQUEST_LIMIT=602]="REQUEST_LIMIT",d))(_e||{});function vt(e){switch(e){case 404:return"\u8D44\u6E90\u4E0D\u5B58\u5728";case 400:return"\u7CFB\u7EDF\u64CD\u4F5C\u9519\u8BEF";case 601:return"\u53C2\u6570\u9519\u8BEF";case 602:return"\u8FBE\u5230\u8BBF\u95EE\u9650\u5236";case 503:return"\u670D\u52A1\u4E0D\u53EF\u7528";case 401:return"\u672A\u767B\u5F55";case 402:return"\u65E0\u6743\u9650";default:return"\u672A\u77E5\u9519\u8BEF"}}var B=It.create({baseURL:import.meta.env.VITE_API_BASE,timeout:Number(import.meta.env.VITE_API_TIMEOUT)||5e3,headers:{"Content-Type":"application/json;charset=UTF-8"},withCredentials:!0}),g=class g{static clearStoreToken(){this.setStoreToken(null,0)}static getStoreToken(){let t=_.namespace("bp.ss").get("ss");if(t){let r=_.namespace("bp.ss").get("exp");return{token:JSON.parse(t),exp:r?JSON.parse(r):0}}return null}static getValidStoreToken(){let t=g.getStoreToken();return t&&t.exp>Date.now()-g.TOKEN_EXP?t.token:null}static setStoreToken(t,r){t?(_.namespace("bp.ss").set("ss",JSON.stringify(t)),_.namespace("bp.ss").set("exp",JSON.stringify(r))):_.namespace("bp.ss").clear()}static requestHandleSid(t){let r=g.getStoreToken();r&&r.exp>Date.now()-g.TOKEN_EXP&&t.headers.set(g.HEADER_NAME,g.HEADER_PREFIX+r.token)}static responseHandleSid(t){let r=t.headers.get(g.HEADER_NAME);if(r&&r.startsWith(g.HEADER_PREFIX.trim())){r=r.replace(g.HEADER_PREFIX,"");let n=r;if(r=r.split(".")[1],r&&(r=ae.string.bytesToUtf8(ae.crypt.base64_decode(r)),r)){let i=JSON.parse(r);return i.exp<Date.now()-g.TOKEN_EXP?(g.clearStoreToken(),!1):(g.setStoreToken(n,i.exp),!0)}g.clearStoreToken(),typeof navigator<"u"&&navigator.onLine&&(window.location.href="/")}return!1}};c(g,"HEADER_NAME","Authorization"),c(g,"HEADER_PREFIX","SPBearer "),c(g,"TOKEN_EXP",20*1e3);var x=g;B.interceptors.request.use(e=>(H.show({delay:5e3}),x.requestHandleSid(e),e),e=>(H.hide(),console.log("Request Error =========="),Promise.reject(e)));B.interceptors.response.use(e=>(H.hide(),e.data.code!==200&&se.warning(e.data.message||vt(e.data.code)),x.responseHandleSid(e),e.data),e=>(H.hide(),e instanceof Tt&&(e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?se.error("\u7F51\u7EDC\u9519\u8BEF"):e.code==="ERR_BAD_RESPONSE"&&se.error("\u670D\u52A1\u5668\u65E0\u54CD\u5E94")),console.log("Response Error =========="),Promise.reject(e)));var a={get(e,t,r){return B({method:"get",url:e,params:t,data:r})},post(e,t,r){return B({method:"post",url:e,params:t,data:r})},put(e,t,r){return B({method:"put",url:e,params:t,data:r})},delete(e,t,r){return B({method:"delete",url:e,params:t,data:r})}};var Ce={};he(Ce,{admin:()=>Rt,gateway:()=>St,message:()=>Dt,role:()=>kt,user:()=>Et});var Rt={registerAdmin:e=>a.post("/api/admin/registerAdmin",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode}).then(t=>t),registerUser:e=>a.post("/api/admin/registerUser",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),updateInfoByAdmin:e=>a.post("/api/admin/updateByAdmin",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),list:e=>a.get("/api/admin/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)},St={register:e=>a.post("/api/register",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),sendSms:e=>a.post("/api/sendSms",{phone:e.phone,imageCode:e.imageCode},null).then(t=>t),isLogin:()=>a.get("/api/isLogin",null,null).then(e=>e),login:e=>a.post("/api/login",null,{phone:e.phone,pwd:e.pwd,pwdSN:e.pwdSN,smsCode:e.smsCode}).then(t=>t),verifyPasswordHash:e=>a.post("/api/verifyPasswordHash",null,{passwordHash:e.passwordHash,passwordSalt:e.passwordSalt}).then(t=>t),logout:()=>a.get("/api/logout",null,null).then(e=>e),listPermissions:()=>a.get("/api/listPermissions",null,null).then(e=>e),listRolePermissions:e=>a.get("/api/listRolePermissions",{id:e.id},null).then(t=>t)},Dt={list:e=>a.get("/api/user/message/list",{pageNum:e.pageNum,pageSize:e.pageSize,unread_only:e.unread_only},null).then(t=>t),countUnread:()=>a.get("/api/user/message/unread/count",null,null).then(e=>e),markRead:e=>a.post("/api/user/message/read",null,{messageIds:e.messageIds}).then(t=>t),clearReaded:e=>a.delete("/api/user/message/clearReaded",null,{messageIds:e.messageIds}).then(t=>t)},kt={listRoles:()=>a.get("/api/role/listRoles",null,null).then(e=>e),createRole:e=>a.post("/api/role/createRole",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),updateRole:e=>a.post("/api/role/updateRole",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),assignPermissionsToRole:e=>a.post("/api/role/assignPermissionsToRole",null,{role_id:e.role_id,permissions:e.permissions}).then(t=>t),assignRoleToUserPermission:()=>a.post("/api/role/assignRoleToUserPermission",null,null).then(e=>e),assignRoleToUser:e=>a.post("/api/role/assignRoleToUser",null,{user_id:e.user_id,role_ids:e.role_ids}).then(t=>t),listUserRoles:e=>a.get("/api/role/listUserRoles",{user_id:e.user_id},null).then(t=>t),listUserPermissions:e=>a.get("/api/role/listUserPermissions",{user_id:e.user_id},null).then(t=>t),listCompanies:()=>a.get("/api/role/listCompanies",null,null).then(e=>e),createCompany:e=>a.post("/api/role/createCompany",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),updateCompany:e=>a.post("/api/role/updateCompany",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),listDepartments:()=>a.get("/api/role/listDepartments",null,null).then(e=>e),createDepartment:e=>a.post("/api/role/createDepartment",{name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),updateDepartment:e=>a.post("/api/role/updateDepartment",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),assignUserToDepartment:e=>a.post("/api/role/assignUserToDepartment",{user_id:e.user_id,department_id:e.department_id,position:e.position},null).then(t=>t),removeUserFromDepartment:e=>a.post("/api/role/removeUserFromDepartment",{user_id:e.user_id,department_id:e.department_id},null).then(t=>t),listCompanyDepartments:e=>a.get("/api/role/listCompanyDepartments",{company_id:e.company_id},null).then(t=>t),listUserDepartments:e=>a.get("/api/role/listUserDepartments",{user_id:e.user_id},null).then(t=>t),listDepartmentUsers:e=>a.get("/api/role/listDepartmentUsers",{department_id:e.department_id},null).then(t=>t)},Et={getInfoByUsername:e=>a.get("/api/user/infoByUsername",{username:e.username},null).then(t=>t),getInfo:e=>a.get("/api/user/info",{id:e.id},null).then(t=>t),getAvatar:e=>a.get("/api/user/avatar",{id:e.id,tick:e.tick},null).then(t=>t),getAvatarList:e=>a.get("/api/user/avatar_list",{ids:e.ids},null).then(t=>t),updateAvatar:e=>a.post("/api/user/updateAvatar",null,{id:e.id,avatar:e.avatar,avatar_small:e.avatar_small,tick_self:e.tick_self}).then(t=>t),updateManager:e=>a.post("/api/user/updateManager",{id:e.id,managerid:e.managerid},null).then(t=>t),updateInfo:e=>a.post("/api/user/update",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),updatePassword:e=>a.post("/api/user/updatePassword",null,{old_password:e.old_password,old_password_sn:e.old_password_sn,new_password:e.new_password}).then(t=>t),deleteUser:e=>a.post("/api/user/delete",{id:e.id},null).then(t=>t),list:e=>a.get("/api/user/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),listByIds:e=>a.get("/api/user/list_by_ids",{ids:e.ids},null).then(t=>t),search:e=>a.get("/api/user/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),forbid:e=>a.post("/api/user/forbid",{id:e.id,forbid:e.forbid},null).then(t=>t)};var Pe={};he(Pe,{contract:()=>Nt,file:()=>At,fileversion:()=>xt,project:()=>Mt,projectprogress:()=>jt});var Nt={createContract:e=>a.post("/api/project/contract/create",null,{projectId:e.projectId,name:e.name,tag:e.tag,code:e.code,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs}).then(t=>t),deleteContract:e=>a.delete("/api/project/contract/delete",{id:e.id},null).then(t=>t),updateContract:e=>a.post("/api/project/contract/update",null,{id:e.id,name:e.name,code:e.code,tag:e.tag,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs,markdown:e.markdown}).then(t=>t),getContractDetail:e=>a.get("/api/project/contract/detail",{id:e.id},null).then(t=>t),getContractList:e=>a.get("/api/project/contract/list",{projectId:e.projectId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),submitApproval:e=>a.post("/api/project/contract/submit",{id:e.id,sealType:e.sealType},null).then(t=>t),cancelApproval:e=>a.post("/api/project/contract/cancelApproval",{id:e.id},null).then(t=>t),uploadVersion:e=>a.post("/api/project/contract/version/upload",null,{contractId:e.contractId,fileName:e.fileName,fileType:e.fileType,fileSize:e.fileSize,changeLog:e.changeLog}).then(t=>t),getVersionList:e=>a.get("/api/project/contract/version/list",{contractId:e.contractId},null).then(t=>t),deleteVersion:e=>a.delete("/api/project/contract/version/delete",{id:e.id},null).then(t=>t),renameVersion:e=>a.post("/api/project/contract/version/rename",null,{id:e.id,fileName:e.fileName}).then(t=>t),getVersionDetail:e=>a.get("/api/project/contract/version/detail",{id:e.id},null).then(t=>t),setVersionLayerOpinion:e=>a.post("/api/project/contract/version/layerOpinion",null,{contractId:e.contractId,version:e.version,opinion:e.opinion}).then(t=>t),getNewContractCode:e=>a.get("/api/project/contract/newCode",{contractCode:e.contractCode,sequenceLength:e.sequenceLength},null).then(t=>t),getContractHistoryParties:()=>a.get("/api/project/contract/historyParties",null,null).then(e=>e)},At={getDetail:e=>a.get("/api/project/files/detail",{fileId:e.fileId},null).then(t=>t),listFiles:e=>a.get("/api/project/files/list",{projectId:e.projectId},null).then(t=>t),searchFiles:e=>a.get("/api/project/files/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),addFile:(e,t)=>a.post("/api/project/files/add",{projectId:e.projectId},{fileName:t.fileName,filePath:t.filePath,isSecure:t.isSecure,descs:t.descs,fileType:t.fileType,fileSize:t.fileSize,crc32:t.crc32,fileResourcePath:t.fileResourcePath}).then(r=>r),removeFile:e=>a.post("/api/project/files/remove",{fileId:e.fileId},null).then(t=>t),moveFile:(e,t)=>a.post("/api/project/files/move",{projectId:e.projectId},{oldFileName:t.oldFileName,oldFilePath:t.oldFilePath,newFileName:t.newFileName,newFilePath:t.newFilePath}).then(r=>r),updateFileDescs:e=>a.post("/api/project/files/updateDescs",null,{fileId:e.fileId,descs:e.descs}).then(t=>t),copyFileToProject:e=>a.post("/api/project/files/copyToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),moveFileToProject:e=>a.post("/api/project/files/moveToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),updateFileDelta:e=>a.post("/api/project/files/updateDelta",null,{fileId:e.fileId,deltaData:e.deltaData,deltaSize:e.deltaSize,newFileSize:e.newFileSize,crc32:e.crc32,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),updateFile:e=>a.post("/api/project/files/updateData",null,{fileId:e.fileId,fileSize:e.fileSize,crc32:e.crc32,fileName:e.fileName,fileResourcePath:e.fileResourcePath,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),generateTempAccessToken:e=>a.post("/api/project/files/generateTempAccessToken",{fileId:e.fileId,expireSeconds:e.expireSeconds},null).then(t=>t),folderDownload:(e,t)=>a.post("/api/project/files/folderDownload",{projectId:e.projectId},{folderPath:t.folderPath,folderName:t.folderName}).then(r=>r),folderDownloadStatus:e=>a.get("/api/project/files/folderDownloadStatus",{jobId:e.jobId},null).then(t=>t),listFilesByTempAccessToken:e=>a.get("/api/project/files/listByTempAccessToken",{tempToken:e.tempToken},null).then(t=>t)},xt={listVersions:e=>a.get("/api/project/files/version/list",{fileId:e.fileId},null).then(t=>t),getVersionDetail:e=>a.get("/api/project/files/version/detail",{versionId:e.versionId},null).then(t=>t)},Mt={enableUserPrivateProject:()=>a.post("/api/project/enablePrivateProject",null,null).then(e=>e),createProject:e=>a.post("/api/project/create",null,{name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate}).then(t=>t),updateProject:e=>a.post("/api/project/update",null,{id:e.id,name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,status:e.status,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate,createTime:e.createTime,updateTime:e.updateTime,createBy:e.createBy,updateBy:e.updateBy}).then(t=>t),updateUserdataOrder:e=>a.post("/api/project/updateUserdataOrder",null,{projectIds:e.projectIds}).then(t=>t),getUserdataOrder:()=>a.get("/api/project/userdataOrder",null,null).then(e=>e),getProjectDetail:e=>a.get("/api/project/detail",{id:e.id},null).then(t=>t),getProjectName:e=>a.get("/api/project/name",{projectId:e.projectId},null).then(t=>t),listProjects:e=>a.get("/api/project/list",{pageNum:e.pageNum,pageSize:e.pageSize,status:e.status,companyId:e.companyId,customerId:e.customerId,userId:e.userId},null).then(t=>t),listProjectsByManager:e=>a.get("/api/project/listByManager",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),changeStatus:e=>a.put("/api/project/status",{id:e.id,status:e.status},null).then(t=>t),getProjectMembers:e=>a.get("/api/project/members",{projectId:e.projectId},null).then(t=>t),getMemberRole:e=>a.get("/api/project/member/role",{projectId:e.projectId,userId:e.userId},null).then(t=>t),assignMember:e=>a.post("/api/project/members/assign",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t),removeMember:e=>a.post("/api/project/members/remove",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t)},jt={createProgress:e=>a.post("/api/project/progress/create",null,{projectId:e.projectId,descs:e.descs,commentCount:e.commentCount,progressTime:e.progressTime}).then(t=>t),updateProgress:e=>a.put("/api/project/progress/update",null,{id:e.id,descs:e.descs,progressTime:e.progressTime}).then(t=>t),deleteProgress:e=>a.delete("/api/project/progress/delete",{id:e.id},null).then(t=>t),getProgressList:e=>a.get("/api/project/progress/list",{projectId:e.projectId},null).then(t=>t),addComment:e=>a.post("/api/project/progress/comment/add",null,{progressId:e.progressId,comment:e.comment}).then(t=>t),deleteComment:e=>a.delete("/api/project/progress/comment/delete",{id:e.id},null).then(t=>t),updateComment:e=>a.put("/api/project/progress/comment/update",{id:e.id},{}).then(t=>t),getCommentList:e=>a.get("/api/project/progress/comment/list",{progressId:e.progressId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)};var y={base:we,user:Ce,project:Pe};import Ut from"dexie";var Bt=1440*60*1e3,Ie=class extends Ut{constructor(){super("DepartmentInfoDB");c(this,"departmentCache");this.version(1).stores({departmentCache:"id, timestamp"})}},G=new Ie,le=null,Lt=async()=>{try{let e=await G.departmentCache.get("DEPARTMENT_ALL");if(e){if(Date.now()-e.timestamp<Bt)return e.data;await G.departmentCache.delete("DEPARTMENT_ALL")}return null}catch(e){return console.error("\u8BFB\u53D6\u90E8\u95E8\u7F13\u5B58\u5931\u8D25:",e),null}},Ot=async e=>{try{await G.departmentCache.put({id:"DEPARTMENT_ALL",data:e,timestamp:Date.now()})}catch(t){console.error("\u5199\u5165\u90E8\u95E8\u7F13\u5B58\u5931\u8D25:",t)}},zt=async()=>{try{await G.departmentCache.clear()}catch(e){console.error("\u6E05\u9664\u90E8\u95E8\u7F13\u5B58\u5931\u8D25:",e)}},Fe=(e,t)=>e.map(r=>({...r,company_id:r.company_id||t.id,company:t,children:r.children?Fe(r.children,t):void 0})),Ft=async()=>{let e=await y.user.role.listCompanies();if(e.code!==200)return null;let t=(e.data||[]).map(n=>({id:n.id,name:n.name,descs:n.descs,parent_id:n.parent_id,admin_id:n.admin_id,is_spv_company:n.is_spv_company,created_at:n.created_at}));if(t.length===0)return[];let r=await Promise.all(t.map(async n=>{let i=await y.user.role.listCompanyDepartments({company_id:n.id});return i.code!==200?null:Fe(i.data||[],n)}));return r.some(n=>n===null)?null:r.flatMap(n=>n||[])},Ve=async({forceRefresh:e=!1})=>{if(!e){let r=await Lt();if(r)return r}le||(le=Ft().then(async r=>(r&&await Ot(r),r)).finally(()=>{le=null}));let t=await le;return t||null},We=async({forceRefresh:e=!1})=>{let t=await Ve({forceRefresh:e});if(!t)return null;let r=n=>{let i=[];for(let s of n){let{children:o,...l}=s;i.push(l),s.children&&s.children.length>0&&(i=i.concat(r(s.children)))}return i};return r(t)},He=async({deptId:e,forceRefresh:t=!1})=>{let r=await We({forceRefresh:t});return r&&r.find(n=>n.id===e)||null},Vt=async({deptId:e,forceRefresh:t=!1})=>(await He({deptId:e,forceRefresh:t}))?.name||"",Wt=async()=>{await zt()},Ht=async()=>{try{let e=await G.departmentCache.toArray();if(e.length===0)return{count:0,oldest:null,newest:null};let t=e.map(r=>r.timestamp);return{count:e.length,oldest:Math.min(...t),newest:Math.max(...t)}}catch(e){return console.error("\u83B7\u53D6\u7F13\u5B58\u7EDF\u8BA1\u5931\u8D25:",e),{count:0,oldest:null,newest:null}}},Hn={getDepartmentList:Ve,getFlatDepartmentList:We,getDepartmentById:He,getDepartmentNameById:Vt,clearDepartmentCache:Wt,getCacheStats:Ht};var qt="flyfish-file-viewer-cache",Gt=async e=>{let t=indexedDB;if(typeof t.databases!="function")return!0;try{return(await t.databases()).some(n=>n.name===e)}catch{return!0}},Jt=e=>new Promise(t=>{let r=indexedDB.open(e);r.onsuccess=()=>t(r.result),r.onerror=()=>t(null),r.onblocked=()=>t(null)}),$t=async e=>{if(!(typeof indexedDB>"u"))try{if(!await Gt(e))return;let t=await Jt(e);if(!t)return;let r=Array.from(t.objectStoreNames);r.length>0&&await new Promise((n,i)=>{let s=t.transaction(r,"readwrite");r.forEach(o=>{s.objectStore(o).clear()}),s.oncomplete=()=>n(),s.onerror=()=>i(s.error),s.onabort=()=>i(s.error)}),t.close()}catch(t){console.error(`\u6E05\u9664 IndexedDB \u7F13\u5B58\u5931\u8D25\uFF08${e}\uFF09:`,t)}},Jn=async()=>{await $t(qt)};import ir from"dexie";import*as Te from"febs-browser";import Ge from"dexie";var j=1440*60*1e3,ve=class extends Ge{constructor(){super("UserInfoDB");c(this,"userCache");this.version(1).stores({userCache:"id, timestamp"})}},Re=class extends Ge{constructor(){super("UserAvatarDB");c(this,"userCache");this.version(1).stores({userCache:"id, timestamp"})}},R=new ve,S=new Re,Je=async e=>{try{let t=await S.userCache.get(e);if(t){if(Date.now()-t.timestamp<j)return t.avatar;await S.userCache.delete(e)}return null}catch(t){return console.error("\u8BFB\u53D6\u7528\u6237\u5934\u50CF\u7F13\u5B58\u5931\u8D25:",t),null}},Se=async e=>{try{let t=await R.userCache.get(e);if(t){let r=Date.now(),n=await S.userCache.get(e);if(n?r-n.timestamp<j?t.data.avatar=n.avatar:(t.data.avatar=void 0,await S.userCache.delete(e)):t.data.avatar=void 0,r-t.timestamp<j)return t.data;await R.userCache.delete(e)}return null}catch(t){return console.error("\u8BFB\u53D6\u7528\u6237\u7F13\u5B58\u5931\u8D25:",t),null}},Kt=async(e,t)=>{try{t&&await S.userCache.put({id:e,avatar:t,timestamp:Date.now()})}catch(r){console.error("\u5199\u5165\u7528\u6237\u5934\u50CF\u7F13\u5B58\u5931\u8D25:",r)}},Xt=async(e,t)=>{try{t.avatar&&await S.userCache.put({id:e,avatar:t.avatar,timestamp:Date.now()});let r=t.avatar;t.avatar=void 0,await R.userCache.put({id:e,data:t,timestamp:Date.now()}),t.avatar=r}catch(r){console.error("\u5199\u5165\u7528\u6237\u7F13\u5B58\u5931\u8D25:",r)}},Yt=async e=>{let t=new Map;try{let r=await R.userCache.bulkGet(e),n=Date.now();for(let s=0;s<e.length;s++){let o=r[s];o&&n-o.timestamp<j&&t.set(e[s],o.data)}let i=await S.userCache.bulkGet(e);for(let s=0;s<e.length;s++){let o=i[s];if(!o)continue;let l=t.get(o.id);l&&n-o.timestamp<j&&(l.avatar=o.avatar)}}catch(r){console.error("\u6279\u91CF\u8BFB\u53D6\u7528\u6237\u7F13\u5B58\u5931\u8D25:",r)}return t},qe=async e=>{try{let t=e.map(n=>({id:n.id,data:n.data,timestamp:Date.now()})),r=e.map(n=>({id:n.id,avatar:n.data.avatar,timestamp:Date.now()}));r=r.filter(n=>n.avatar),await S.userCache.bulkPut(r),t.forEach(n=>{n.data.avatar=void 0}),await R.userCache.bulkPut(t)}catch(t){console.error("\u6279\u91CF\u5199\u5165\u7528\u6237\u7F13\u5B58\u5931\u8D25:",t)}},Zt=async()=>{let e=new Map;try{let t=Date.now(),r=await R.userCache.toArray();for(let n of r)if(t-n.timestamp<j){let i=await S.userCache.get(n.id);i&&t-i.timestamp<j&&(n.data.avatar=i.avatar),e.set(n.id,n.data)}else await R.userCache.delete(n.id)}catch(t){console.error("\u83B7\u53D6\u6240\u6709\u7F13\u5B58\u5931\u8D25:",t)}return e},Qt=async()=>{try{await R.userCache.clear(),await S.userCache.clear()}catch(e){console.error("\u6E05\u9664\u7528\u6237\u7F13\u5B58\u5931\u8D25:",e)}},$e=async({user_id:e,forceRefresh:t=!1,forceAvatar:r=!1})=>{let n={code:200,data:{user_id:e,isLogin:!0}},i=!1;if(!e)try{n=await y.user.gateway.isLogin()}catch{i=!0}if(i){let s;try{let l=_.namespace("bp.ss").get("user");l&&(s=JSON.parse(l)?.id)}catch{}let o=e??s;if(o){let l=await Se(o);if(l){let d=await M({user_id:o,forceRefresh:!1,serverTick:l.tick_avatar_self});return d&&(l.avatar=d),l}}try{let l=_.namespace("bp.ss").get("user");if(l)return JSON.parse(l)}catch{}return null}if(n?.code===200&&n.data?.isLogin){let s=n.data?.user_id,o=n.data?.isAdmin||!1,l=await Se(s);if(t||!l)try{let d=await y.user.user.getInfo({id:s});if(d?.code==200){e||_.namespace("bp.ss").set("user",JSON.stringify(d.data));let u={...d.data};s&&await Xt(s,u);try{let m=await M({user_id:s,forceRefresh:r,serverTick:d.data?.tick_avatar_self});m&&(u.avatar=m)}catch{}return u}else return l||null}catch{if(l)return l;try{let u=_.namespace("bp.ss").get("user");if(u)return JSON.parse(u)}catch{}return null}try{let d=await M({user_id:s,forceRefresh:r,serverTick:l.tick_avatar_self});d&&(l.avatar=d)}catch{}return l}else return x.clearStoreToken(),null},M=async({user_id:e,forceRefresh:t=!1,serverTick:r=Number.MAX_SAFE_INTEGER})=>{if(!e)return;let n=await Je(e);if(t||!n){let i=n?.avatar_tick||-1;if(i<r)try{let s=await y.user.user.getAvatar({id:e,tick:i});s?.code==200&&i!=s.data?.tick_self&&(n={avatar:Te.string.isEmpty(s.data?.avatar)?void 0:s.data?.avatar,avatar_small:Te.string.isEmpty(s.data?.avatar_small)?void 0:s.data?.avatar_small,avatar_tick:s.data?.tick_self||-1},await Kt(e,n))}catch{}}return n||void 0},er=async e=>(e=e||{forceRefresh:!1},await $e(e)),tr=()=>{let e=_.namespace("bp.ss").get("user");return e?JSON.parse(e):null},rr=async({userIds:e,keywords:t,forceRefresh:r=!1})=>{let n=new Map;if(!e){if(!r&&(!t||t.length===0)){let u=await Zt();if(u.size>=100){let m=new Map,P=0;for(let[I,F]of u){if(P>=100)break;let ye=await M({user_id:I,forceRefresh:!1,serverTick:F.tick_avatar_self});F.avatar=ye,m.set(I,F),P++}return m}return u}let o;if(t&&t.length>0){if(o=await y.user.user.search({pageNum:1,pageSize:100,keyword:t}),o?.code!==200)return n}else if(o=await y.user.user.list({pageNum:1,pageSize:100}),o?.code!==200)return n;let l=o.data?.list||[],d=[];for(let u of l){let m={...u};n.set(u.id,m),d.push({id:u.id,data:m})}d.length>0&&await qe(d);for(let u=0;u<d.length;u++){let m=await M({user_id:d[u].id,serverTick:d[u].data.tick_avatar_self});d[u].data.avatar=m}return n}if(e.length==0)return n;let i=[...new Set(e)];r||(await Yt(i)).forEach((l,d)=>{n.set(d,l)});let s=i.filter(o=>!n.has(o));if(s.length===0)return n;try{let o=await y.user.user.listByIds({ids:JSON.stringify(s)});if(o?.code!=200)return n;let l=o.data?.list||[];if(l.length>0){let u=[];for(let m of l){let P={...m};u.push({id:m.id,data:P})}await qe(u)}let d=[];if(l.length>0)for(let u of l){let m=await M({user_id:u.id,serverTick:u.tick_avatar_self||-1});d.push({id:u.id,avatar_small:m?.avatar_small||"",avatar_tick:u.tick_avatar_self||-1})}for(let u of l){let m=d.find(I=>I.id==u.id),P={...u,avatar:{avatar:"",avatar_small:m?.avatar_small||"",avatar_tick:m?.avatar_tick||-1}};n.set(u.id,P)}}catch(o){console.error("\u6279\u91CF\u83B7\u53D6\u7528\u6237\u4FE1\u606F\u5931\u8D25:",o)}return n},nr=async e=>{e?await R.userCache.delete(e):await Qt()},sr=async()=>{try{let e=await R.userCache.toArray();if(e.length===0)return{count:0,oldest:null,newest:null};let t=e.map(r=>r.timestamp);return{count:e.length,oldest:Math.min(...t),newest:Math.max(...t)}}catch(e){return console.error("\u83B7\u53D6\u7F13\u5B58\u7EDF\u8BA1\u5931\u8D25:",e),{count:0,oldest:null,newest:null}}},Ke={getFromCache:Se,getAvatarFromCache:Je,getUserInfo:$e,getUserAvatar:M,current:er,currentLocalUser:tr,getUserInfos:rr,clearUserCache:nr,getCacheStats:sr};var os="approver:approvalinvoice:getInvoiceList",as="project:projectfile:downloadFolderPermission",ls="crm:customer:createCustomer",cs="crm:customer:updateCustomer",ds="crm:customer:deleteCustomer",us="crm:customer:viewContact",ms="crm:customer:transferCustomer",ps="crm:file:viewFile",gs="crm:file:manageFile",or=600*1e3,De=class extends ir{constructor(){super("PermissionInfoDB");c(this,"permissionCache");this.version(1).stores({permissionCache:"id, timestamp"})}},L=new De,ar=async e=>{try{let t=await L.permissionCache.get(`PERMISSION_${e}`);if(t){if(Date.now()-t.timestamp<or)return t.data;await L.permissionCache.delete(`PERMISSION_${e}`)}return null}catch(t){return console.error("\u8BFB\u53D6\u6743\u9650\u7F13\u5B58\u5931\u8D25:",t),null}},lr=async(e,t)=>{try{await L.permissionCache.put({id:`PERMISSION_${e}`,data:t,timestamp:Date.now()})}catch(r){console.error("\u5199\u5165\u6743\u9650\u7F13\u5B58\u5931\u8D25:",r)}},cr=async e=>{try{e?await L.permissionCache.delete(`PERMISSION_${e}`):await L.permissionCache.clear()}catch(t){console.error("\u6E05\u9664\u6743\u9650\u7F13\u5B58\u5931\u8D25:",t)}},ce=async({userId:e,forceRefresh:t=!1})=>{let r=e?{id:e}:await Ke.getUserInfo({});if(!r)return null;let n=r.id;if(!t){let o=await ar(n);if(o)return o}let i=await y.user.role.listUserPermissions({user_id:n});if(i?.code!==200)return null;let s=i.data||[];return await lr(n,s),s},dr=async({permission:e,userId:t,forceRefresh:r=!1})=>{let n=await ce({userId:t,forceRefresh:r});return n?n.some(i=>i.permission===e):!1},ur=async({permissions:e,userId:t,forceRefresh:r=!1,allRequired:n=!0})=>{let i=await ce({userId:t,forceRefresh:r});if(!i)return!1;let s=new Set(i.map(o=>o.permission));return n?e.every(o=>s.has(o)):e.some(o=>s.has(o))},mr=async({permission:e,userId:t,forceRefresh:r=!1})=>{let n=await ce({userId:t,forceRefresh:r});return n&&n.find(s=>s.permission===e)?.descs||""},pr=async e=>{await cr(e)},gr=async()=>{try{let e=await L.permissionCache.toArray();if(e.length===0)return{count:0,oldest:null,newest:null};let t=e.map(r=>r.timestamp);return{count:e.length,oldest:Math.min(...t),newest:Math.max(...t)}}catch(e){return console.error("\u83B7\u53D6\u6743\u9650\u7F13\u5B58\u7EDF\u8BA1\u5931\u8D25:",e),{count:0,oldest:null,newest:null}}},fs={getUserPermissions:ce,hasPermission:dr,hasPermissions:ur,getPermissionDesc:mr,clearPermissionCache:pr,getCacheStats:gr};import fr from"dexie";var yr=3600*1e3,ke=class extends fr{constructor(){super("RoleInfoDB");c(this,"roleCache");this.version(1).stores({roleCache:"id, timestamp"})}},J=new ke,hr=async()=>{try{let e=await J.roleCache.get("ROLE_ALL");if(e){if(Date.now()-e.timestamp<yr)return e.data;await J.roleCache.delete("ROLE_ALL")}return null}catch(e){return console.error("\u8BFB\u53D6\u89D2\u8272\u7F13\u5B58\u5931\u8D25:",e),null}},br=async e=>{try{await J.roleCache.put({id:"ROLE_ALL",data:e,timestamp:Date.now()})}catch(t){console.error("\u5199\u5165\u89D2\u8272\u7F13\u5B58\u5931\u8D25:",t)}},_r=async()=>{try{await J.roleCache.clear()}catch(e){console.error("\u6E05\u9664\u89D2\u8272\u7F13\u5B58\u5931\u8D25:",e)}},Ne=async({forceRefresh:e=!1})=>{if(!e){let n=await hr();if(n)return n}let t=await y.user.role.listRoles();if(t?.code!==200)return null;let r=t.data||[];return await br(r),r},Xe=async({roleId:e,forceRefresh:t=!1})=>{let r=await Ne({forceRefresh:t});return r&&r.find(n=>n.id===e)||null},wr=async({roleId:e,forceRefresh:t=!1})=>(await Xe({roleId:e,forceRefresh:t}))?.name||"",Ee=async({forceRefresh:e=!1}={})=>{let t=await Ne({forceRefresh:e}),r={};return(t||[]).forEach(n=>{r[n.id]=n.name}),r},Cr=async({roleIds:e})=>{let t=await Ee();return(e||[]).filter(n=>!!n&&!t[n]).length>0&&(t=await Ee({forceRefresh:!0})),t},Pr=async()=>{await _r()},Ir=async()=>{try{let e=await J.roleCache.toArray();if(e.length===0)return{count:0,oldest:null,newest:null};let t=e.map(r=>r.timestamp);return{count:e.length,oldest:Math.min(...t),newest:Math.max(...t)}}catch(e){return console.error("\u83B7\u53D6\u7F13\u5B58\u7EDF\u8BA1\u5931\u8D25:",e),{count:0,oldest:null,newest:null}}},Cs={getRoleList:Ne,getRoleById:Xe,getRoleNameById:wr,getRoleNameMap:Ee,getRoleNameMapForIds:Cr,clearRoleCache:Pr,getCacheStats:Ir};import Tr from"dexie";var Ae=class extends Tr{constructor(){super("ViewToggleDB");c(this,"viewModeCache");this.version(1).stores({viewModeCache:"pageKey, timestamp"})}},$=new Ae,vr=async e=>{try{let t=await $.viewModeCache.get(e);return t?t.viewMode:null}catch(t){return console.error("\u8BFB\u53D6\u89C6\u56FE\u6A21\u5F0F\u7F13\u5B58\u5931\u8D25:",t),null}},Rr=async(e,t)=>{try{await $.viewModeCache.put({pageKey:e,viewMode:t,timestamp:Date.now()})}catch(r){console.error("\u5199\u5165\u89C6\u56FE\u6A21\u5F0F\u7F13\u5B58\u5931\u8D25:",r)}},Sr=async e=>{try{await $.viewModeCache.delete(e)}catch(t){console.error("\u6E05\u9664\u89C6\u56FE\u6A21\u5F0F\u7F13\u5B58\u5931\u8D25:",t)}},Dr=async()=>{try{await $.viewModeCache.clear()}catch(e){console.error("\u6E05\u9664\u6240\u6709\u89C6\u56FE\u6A21\u5F0F\u7F13\u5B58\u5931\u8D25:",e)}},kr=async e=>await vr(e),Er=async(e,t)=>{await Rr(e,t)},Nr=async e=>{await Sr(e)},Ar=async()=>{await Dr()},xr=async()=>{try{return await $.viewModeCache.toArray()}catch(e){return console.error("\u83B7\u53D6\u6240\u6709\u89C6\u56FE\u6A21\u5F0F\u7F13\u5B58\u5931\u8D25:",e),[]}},Rs={getViewMode:kr,setViewMode:Er,clearViewModeCache:Nr,clearAllViewModeCache:Ar,getAllCachedViewModes:xr};var Ye={project:"\u9879\u76EE\u52A8\u6001",approval:"\u5BA1\u6279\u52A8\u6001",knowledge:"\u77E5\u8BC6\u5E93",todo:"\u5F85\u529E\u4EFB\u52A1",crm:"\u5BA2\u6237\u7BA1\u7406"},Mr={file_add:"\u6587\u4EF6\u65B0\u589E",file_update:"\u6587\u4EF6\u66F4\u65B0",file_delete:"\u6587\u4EF6\u5220\u9664",contract_add:"\u5408\u540C\u65B0\u589E",contract_delete:"\u5408\u540C\u5220\u9664",contract_update:"\u5408\u540C\u66F4\u65B0",detail:"\u8BE6\u60C5\u66F4\u65B0",member_add:"\u6210\u5458\u52A0\u5165",member_remove:"\u6210\u5458\u79FB\u9664",member_role_change:"\u89D2\u8272\u53D8\u66F4",file_download:"\u6587\u4EF6\u4E0B\u8F7D"},jr={submit:"\u5BA1\u6279\u63D0\u4EA4",approve:"\u5BA1\u6279\u901A\u8FC7",reject:"\u5BA1\u6279\u9A73\u56DE",cancel:"\u5BA1\u6279\u64A4\u9500",deal:"\u4EA7\u7269\u66F4\u65B0"},Ur={kb_new:"\u65B0\u589E\u77E5\u8BC6"},Br={task_assign:"\u4EFB\u52A1\u6307\u6D3E",task_remind:"\u5230\u671F\u63D0\u9192"},Lr={customer_transfer_in:"\u5BA2\u6237\u79FB\u4EA4\uFF08\u63A5\u6536\uFF09",customer_transfer_out:"\u5BA2\u6237\u79FB\u4EA4\uFF08\u79FB\u4EA4\u51FA\uFF09"},Or={file_add:"files",file_update:"files",file_delete:"files",contract_add:"contracts",contract_update:"contracts",contract_delete:"contracts",detail:"detail",member_add:"members",member_remove:"members",member_role_change:"members"},Ze=class e{static buildContent(t,r,n,i){return JSON.stringify({type:t,bizType:r,id:n||"",text:i||""})}static parseContent(t){if(!t)return null;try{let r=JSON.parse(t);if(r&&typeof r.type=="string"&&typeof r.bizType=="string"&&typeof r.id=="string"){let n={type:r.type,bizType:r.bizType,id:r.id,text:typeof r.text=="string"?r.text:""};return typeof r.url=="string"&&(n.url=r.url),typeof r.fileName=="string"&&(n.fileName=r.fileName),typeof r.jobId=="string"&&(n.jobId=r.jobId),typeof r.expireAt=="number"&&(n.expireAt=r.expireAt),n}return null}catch{return null}}static isMessageType(t){return Object.prototype.hasOwnProperty.call(Ye,t)}static getTypeLabel(t){return Ye[t]||"\u7CFB\u7EDF\u6D88\u606F"}static getBizTypeLabel(t,r){switch(t){case"project":return Mr[r]||"";case"approval":return jr[r]||"";case"knowledge":return Ur[r]||"";case"todo":return Br[r]||"";case"crm":return Lr[r]||"";default:return""}}static getDisplayText(t){return t?t.text||e.getBizTypeLabel(t.type,t.bizType):""}static getJumpRoute(t){if(!t||!t.id)return null;let r=encodeURIComponent(t.id);switch(t.type){case"project":{if(t.bizType==="file_download")return null;let n=Or[t.bizType];return`/project?id=${r}${n?`&tab=${n}`:""}`}case"approval":return`/approval?instanceId=${r}`;case"knowledge":return`/knowledge?id=${r}`;case"todo":return`/todo?todoId=${r}`;case"crm":return`/crm?id=${r}`;default:return null}}};async function Es(e){if(navigator.clipboard&&typeof navigator.clipboard.writeText=="function")try{await navigator.clipboard.writeText(e);return}catch{}if(!zr(e))throw new Error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25")}function zr(e){let t=document.createElement("textarea");t.value=e,t.setAttribute("contenteditable","true"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="1px",t.style.height="1px",t.style.padding="0",t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.style.opacity="0",document.body.appendChild(t);let r=/ipad|iphone|ipod/i.test(navigator.userAgent),n=!1;try{if(r){let i=document.getSelection(),s=document.createRange();s.selectNodeContents(t),i?.removeAllRanges(),i?.addRange(s),t.setSelectionRange(0,e.length)}else t.focus(),t.select(),t.setSelectionRange(0,e.length);n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}var Qe=(import.meta.env.VITE_COMPANY_EMAIL_DOMAINS||"").split(",").map(e=>e.trim().toLowerCase().replace(/^@/,"")).filter(Boolean),Fr=e=>(e||"").trim().toLowerCase(),As=()=>Qe.join("\u3001"),xs=e=>{let t=Fr(e),r=t.split("@")[1];return Qe.some(n=>n.includes("@")?n===t:!!(r&&n===r))};function js(){let e=function(){function r(n){(""+n/n).length!==1||n%20===0?function(){}.constructor("debugger")():function(){}.constructor("debugger")(),r(++n)}try{r(0)}catch{}},t=function(){(window.outerWidth-window.innerWidth>160||window.outerHeight-window.innerHeight>360)&&(window.close(),window.location="about:blank")};setInterval(function(){__debug||(t(),e())},5e3),__debug||(t(),e(),window.onkeydown=window.onkeyup=window.onkeypress=function(r){r.keyCode===123&&(r.preventDefault(),window.event.returnValue=!1)})}var Bs=e=>!e||(typeof e=="string"&&(e=new Date(e)),e.getTime()==0)||isNaN(e.getTime())?"\u65E0":e.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"numeric"}),Ls=e=>!e||(typeof e=="string"&&(e=new Date(e)),e.getTime()==0)||isNaN(e.getTime())?"\u65E0":e.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"numeric",hour:"2-digit",minute:"2-digit"}),Os=e=>new Intl.NumberFormat("zh-CN",{style:"currency",currency:"CNY"}).format(e),zs=e=>e?(e=e/1024,e<1024?e.toFixed(1).endsWith(".0")?e.toFixed(2)+" KB":e.toFixed(1)+" KB":(e=e/1024,e<1024?e.toFixed(1).endsWith(".0")?e.toFixed(2)+" MB":e.toFixed(1)+" MB":(e=e/1024,e.toFixed(1).endsWith(".0")?e.toFixed(2)+" GB":e.toFixed(1)+" GB"))):"0 KB";import h from"keymaster";var Ws={on:function(e,t){return h(e,t),this},off:function(e){return h.unbind(e),this},isPressed(e){return h.isPressed(e)},get shift(){return h.shift},get"\u21E7"(){return h["\u21E7"]},get alt(){return h.alt},get option(){return h.option},get"\u2325"(){return h["\u2325"]},get ctrl(){return h.ctrl},get control(){return h.control},get"\u2303"(){return h["\u2303"]},get command(){return h.command},get"\u2318"(){return h["\u2318"]},get pressedKeyCodes(){return h.getPressedKeyCodes()}};(function(){if(typeof Promise>"u"||typeof Promise.allSettled=="function")return;let t=function(r){let n=Array.isArray(r)?r:Array.from(r);return n.length===0?Promise.resolve([]):new Promise(i=>{let s=new Array(n.length),o=n.length,l=()=>{o-=1,o===0&&i(s)};n.forEach((d,u)=>{Promise.resolve(d).then(m=>{s[u]={status:"fulfilled",value:m},l()},m=>{s[u]={status:"rejected",reason:m},l()})})})};try{Object.defineProperty(Promise,"allSettled",{configurable:!0,writable:!0,value:t})}catch{try{Promise.allSettled=t}catch{}}try{typeof Promise.allSettled!="function"&&(Promise.allSettled=t)}catch{}})();function qs(){try{if(typeof Promise>"u"||typeof Promise.allSettled=="function")return;let e=t=>{let r=Array.isArray(t)?t:Array.from(t);return r.length===0?Promise.resolve([]):new Promise(n=>{let i=new Array(r.length),s=r.length,o=()=>{--s===0&&n(i)};r.forEach((l,d)=>{Promise.resolve(l).then(u=>{i[d]={status:"fulfilled",value:u},o()},u=>{i[d]={status:"rejected",reason:u},o()})})})};try{Object.defineProperty(Promise,"allSettled",{configurable:!0,writable:!0,value:e})}catch{}if(typeof Promise.allSettled!="function")try{Promise.allSettled=e}catch{}}catch{}}function Gs(){try{et()}catch{}}var de=class{constructor({highWaterMark:t}){c(this,"highWaterMark");this.highWaterMark=t}size(t){return t?.byteLength??0}},ue=class{constructor({highWaterMark:t}){c(this,"highWaterMark");this.highWaterMark=t}size(){return 1}},K=class{constructor(t){c(this,"desiredSize",0);c(this,"byobRequest",null);c(this,"_stream");this._stream=t}enqueue(t){this._stream._push(t)}close(){this._stream._close()}error(t){this._stream._error(t??new Error("ReadableStream errored"))}get desiredSizeInternal(){return this._stream._chunks?1:0}},X=class{constructor(t){c(this,"byobRequest",null);c(this,"desiredSize",0);c(this,"_stream");this._stream=t}close(){this._stream._close()}enqueue(t){this._stream._push(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}error(t){this._stream._error(t??new Error("ReadableByteStream errored"))}},Y=class{constructor(t){c(this,"closed");c(this,"_stream");c(this,"_resolveClosed");this._stream=t,this._stream._reader=this,this.closed=new Promise(r=>{this._resolveClosed=r})}read(){return this._stream._read()}releaseLock(){this._stream._reader===this&&(this._stream._reader=null)}cancel(t){return this._stream.cancel(t)}_onClosed(){this._resolveClosed(void 0)}},Z=class{constructor(t){c(this,"closed");c(this,"_stream");c(this,"_resolveClosed");this._stream=t,this._stream._byobReader=this,this.closed=new Promise(r=>{this._resolveClosed=r})}read(t){return this._stream._readInto(t)}releaseLock(){this._stream._byobReader===this&&(this._stream._byobReader=null)}cancel(t){return this._stream.cancel(t)}_onClosed(){this._resolveClosed(void 0)}},E=class e{constructor(t,r){c(this,"locked",!1);c(this,"_chunks",[]);c(this,"_waiting",null);c(this,"_byobWaiting",null);c(this,"_reader",null);c(this,"_byobReader",null);c(this,"_state",{closed:!1,errored:!1,error:void 0});c(this,"_source",null);c(this,"_cancelCallback",null);c(this,"_controller",null);c(this,"_pulling",!1);c(this,"_pullScheduled",!1);c(this,"_type");c(this,"_autoAllocateChunkSize");this._source=t??null,this._cancelCallback=t?.cancel??null,t&&t.type==="bytes"?(this._type="bytes",this._autoAllocateChunkSize=t.autoAllocateChunkSize,this._controller=new X(this)):this._controller=new K(this);let n=t?.start;typeof n=="function"&&Promise.resolve(n.call(t,this._controller)).catch(i=>{this._error(i)})}getReader(){if(arguments[0]?.mode==="byob"){if(this._byobReader)throw new TypeError("ReadableStream is locked");return new Z(this)}if(this._reader)throw new TypeError("ReadableStream is locked");return new Y(this)}tee(){let t=this._branch(),r=this._branch();return[t,r]}pipeThrough(t,r){return this.pipeTo(t.writable,r),t.readable}async pipeTo(t,r){let n=!!r?.preventClose,i=!!r?.preventAbort,s=!!r?.preventCancel,o=t&&typeof t.getWriter=="function"?t.getWriter():null;try{let l=this.getReader();try{for(;;){let{done:d,value:u}=await l.read();if(d)break;o&&typeof o.ready<"u"&&await o.ready,o&&typeof o.write=="function"?await o.write(u):t&&typeof t.write=="function"&&t.write(u)}}finally{try{l.releaseLock()}catch{}}n||(o&&typeof o.close=="function"?await o.close():t&&typeof t.close=="function"&&t.close())}catch(l){if(!i)try{o&&typeof o.abort=="function"?await o.abort(l):t&&typeof t.abort=="function"&&t.abort(l)}catch{}if(!s)try{await this.cancel(l)}catch{}throw l}finally{if(o&&typeof o.releaseLock=="function")try{o.releaseLock()}catch{}}}async cancel(t){if(!(this._state.closed||this._state.errored)){this._state.closed=!0;try{this._cancelCallback&&await this._cancelCallback(t)}finally{this._finalizeClose()}}}_branch(){let t=this;return new e({start:async n=>{let i=t.getReader();try{for(;;){let{done:s,value:o}=await i.read();if(s)break;n.enqueue(o)}n.close()}catch(s){n.error(s)}finally{try{i.releaseLock()}catch{}}}})}_push(t){if(!(this._state.closed||this._state.errored)){if(this._waiting){let r=this._waiting;this._waiting=null,r({done:!1,value:t}),this._schedulePullIfNeeded();return}if(this._byobWaiting){let r=this._byobWaiting;this._byobWaiting=null,r(this._buildByobResult(t)),this._schedulePullIfNeeded();return}this._chunks.push({type:"chunk",value:t}),this._schedulePullIfNeeded()}}_close(){if(!(this._state.closed||this._state.errored)){if(this._state.closed=!0,this._chunks.push({type:"close"}),this._waiting){let t=this._waiting;this._waiting=null,t({done:!0,value:void 0})}this._finalizeClose()}}_error(t){if(!(this._state.closed||this._state.errored)){if(this._state.errored=!0,this._state.error=t,this._chunks.push({type:"error",error:t}),this._waiting){let r=this._waiting;this._waiting=null,r(Promise.reject(t))}this._finalizeClose()}}_finalizeClose(){this._reader&&this._reader._onClosed(),this._byobReader&&this._byobReader._onClosed()}_schedulePullIfNeeded(){if(this._pullScheduled)return;let t=this._source?.pull;typeof t=="function"&&(this._state.closed||this._state.errored||this._chunks.length>0||this._waiting||this._byobWaiting||(this._pullScheduled=!0,queueMicrotask(()=>{this._pullScheduled=!1,!this._pulling&&(this._state.closed||this._state.errored||(this._pulling=!0,Promise.resolve(t.call(this._source,this._controller)).catch(r=>this._error(r)).finally(()=>{this._pulling=!1})))})))}_read(){if(this._state.errored)return Promise.reject(this._state.error);if(this._state.closed)return Promise.resolve({done:!0,value:void 0});for(;this._chunks.length;){let t=this._chunks.shift();if(t.type==="chunk")return this._schedulePullIfNeeded(),Promise.resolve({done:!1,value:t.value});if(t.type==="close")return Promise.resolve({done:!0,value:void 0});if(t.type==="error")return Promise.reject(t.error)}return new Promise((t,r)=>{this._waiting=n=>{this._state.errored?r(this._state.error):t(n)},this._schedulePullIfNeeded()})}_readInto(t){if(this._state.errored)return Promise.reject(this._state.error);if(this._state.closed)return Promise.resolve({done:!0,value:t});let r=0,n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);for(;this._chunks.length&&r<n.byteLength;){let i=this._chunks[0];if(i.type==="chunk"){let s=this._toUint8(i.value),o=Math.min(s.length,n.byteLength-r);n.set(s.subarray(0,o),r),r+=o,o<s.length?this._chunks[0].value=s.subarray(o):this._chunks.shift()}else if(i.type==="close"){this._chunks.shift();let s=r===0?t:new DataView(t.buffer,t.byteOffset,r);return Promise.resolve({done:!0,value:r?s:t})}else if(i.type==="error")return this._chunks.shift(),Promise.reject(i.error)}if(r>0){let i=new DataView(t.buffer,t.byteOffset,r);return this._schedulePullIfNeeded(),Promise.resolve({done:!1,value:i})}return new Promise((i,s)=>{this._byobWaiting=o=>{this._state.errored?s(this._state.error):i(o)},this._schedulePullIfNeeded()})}_buildByobResult(t){let r=this._toUint8(t),n=new Uint8Array(r.length);return n.set(r),{done:!1,value:n}}_toUint8(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?new TextEncoder().encode(t):Array.isArray(t)?new Uint8Array(t):new Uint8Array(0)}},Q=class{constructor(t){c(this,"closed");c(this,"ready");c(this,"desiredSize",1);c(this,"_stream");c(this,"_resolveClosed");c(this,"_resolveReady");this._stream=t,this._stream._writer=this,this.closed=new Promise(r=>{this._resolveClosed=r}),this.ready=new Promise(r=>{this._resolveReady=r}),Promise.resolve().then(()=>this._resolveReady(void 0))}abort(t){return this._stream.abort(t)}close(){return this._stream.close()}releaseLock(){this._stream._writer===this&&(this._stream._writer=null)}write(t){return this._stream.write(t)}_onClosed(){this._resolveClosed(void 0)}},ee=class{constructor(t,r){c(this,"locked",!1);c(this,"_writer",null);c(this,"_state",{closed:!1,errored:!1,error:void 0});c(this,"_sink",{});c(this,"_controller",null);this._sink=t??{};let n=this._sink.start;this._controller={error:i=>this._error(i??new Error("WritableStream errored")),signal:{aborted:!1,reason:void 0}},typeof n=="function"&&Promise.resolve(n.call(this._sink,this._controller)).catch(i=>this._error(i))}getWriter(){if(this._writer)throw new TypeError("WritableStream is locked");return new Q(this)}async abort(t){if(this._state.closed||this._state.errored)return;this._controller.signal.aborted=!0,this._controller.signal.reason=t,this._state.errored=!0,this._state.error=t;let r=this._sink.abort;typeof r=="function"&&await r.call(this._sink,t),this._finalize()}async close(){if(this._state.closed||this._state.errored)return;this._state.closed=!0;let t=this._sink.close;typeof t=="function"&&await t.call(this._sink),this._finalize()}async write(t){if(this._state.errored)throw this._state.error;if(this._state.closed)throw new TypeError("WritableStream is closed");let r=this._sink.write;if(typeof r=="function"){let n=r.call(this._sink,t,this._controller);await Promise.resolve(n)}}_finalize(){this._writer&&this._writer._onClosed()}_error(t){this._state.closed||this._state.errored||(this._state.errored=!0,this._state.error=t,this._finalize())}},O=class{constructor(t,r,n){c(this,"readable");c(this,"writable");let i;this.readable=new E({start:s=>{i=s;let o=t?.start;typeof o=="function"&&Promise.resolve(o.call(t,i)).catch(l=>i.error(l))}}),this.writable=new ee({write:async(s,o)=>{let l=t?.transform;typeof l=="function"?await Promise.resolve(l.call(t,s,i)):i.enqueue(s)},close:async()=>{let s=t?.flush;typeof s=="function"&&await Promise.resolve(s.call(t,i)),i.close()},abort:async s=>{i.error(s);let o=t?.abort;typeof o=="function"&&await o.call(t,s)}})}},me=class{constructor(t,r){c(this,"readable");c(this,"writable");c(this,"encoding");c(this,"fatal");c(this,"ignoreBOM");let n=new TextDecoder(t,r);this.encoding=n.encoding,this.fatal=n.fatal,this.ignoreBOM=n.ignoreBOM;let i=new O({transform(s,o){o.enqueue(n.decode(s,{stream:!0}))},flush(s){let o=n.decode();o&&s.enqueue(o)}});this.readable=i.readable,this.writable=i.writable}},pe=class{constructor(){c(this,"readable");c(this,"writable");c(this,"encoding","utf-8");let t=new TextEncoder,r=new O({transform(n,i){i.enqueue(t.encode(n))}});this.readable=r.readable,this.writable=r.writable}};function b(e,t){let r=globalThis;try{Object.defineProperty(r,e,{configurable:!0,writable:!0,enumerable:!1,value:t})}catch{try{r[e]=t}catch{}}try{r[e]!==t&&(r[e]=t)}catch{}}function w(e,t){let r=globalThis;try{typeof r[e]>"u"&&b(e,t)}catch{}}function Vr(){try{let e=globalThis.ReadableStream,t=globalThis.ReadableByteStreamController,r=globalThis.WritableStream,n=globalThis.TransformStream;if(typeof e!="function")return!1;if(typeof t!="function")return!0;try{let s={type:"bytes",start(l){try{l.close()}catch{}}},o=new e(s);try{let l=o.getReader({mode:"byob"});if(!l)return!0;try{l.releaseLock()}catch{}}catch(l){let d=String(l?.message??"");if(/not implemented|ReadableByteStreamController|byob|not supported|invalid mode/i.test(d))return!0}try{o.cancel&&o.cancel()}catch{}}catch(s){let o=String(s?.message??"");if(/ReadableByteStreamController is not implemented|is not implemented|not supported|type bytes|invalid type/i.test(o))return!0}let i=e.prototype;return(!i||typeof i.pipeTo!="function"||typeof i.pipeThrough!="function"||typeof i.tee!="function")&&typeof r!="function"||typeof n<"u"&&typeof n!="function"}catch{return!1}}function et(){if(typeof globalThis>"u")return;Vr()?(b("ReadableStream",E),b("ReadableByteStreamController",X),b("ReadableStreamDefaultController",K),b("ReadableStreamDefaultReader",Y),b("ReadableStreamBYOBReader",Z),b("WritableStream",ee),b("WritableStreamDefaultWriter",Q),b("TransformStream",O),b("TextDecoderStream",me),b("TextEncoderStream",pe),b("ByteLengthQueuingStrategy",de),b("CountQueuingStrategy",ue)):(w("ByteLengthQueuingStrategy",de),w("CountQueuingStrategy",ue),w("ReadableStream",E),w("WritableStream",ee),w("TransformStream",O),w("ReadableByteStreamController",X),w("ReadableStreamDefaultController",K),w("ReadableStreamDefaultReader",Y),w("ReadableStreamBYOBReader",Z),w("WritableStreamDefaultWriter",Q),w("TextDecoderStream",me),w("TextEncoderStream",pe));try{let t=globalThis.ReadableStream;if(typeof t=="function"){let r=t.prototype;r&&typeof r.pipeTo!="function"&&(Object.defineProperty(r,"pipeTo",{configurable:!0,writable:!0,value:E.prototype.pipeTo}),Object.defineProperty(r,"pipeThrough",{configurable:!0,writable:!0,value:E.prototype.pipeThrough}),Object.defineProperty(r,"tee",{configurable:!0,writable:!0,value:E.prototype.tee}))}}catch{}}try{et()}catch(e){console.warn("[polyfills] \u5B89\u88C5 Web Streams polyfill \u5931\u8D25\uFF1A",e)}var Ks=/^(0|[1-9](\d+)?(\.\d\d?)?)$/;var nt=(typeof window<"u"?window.location.origin:"")+"/polyfills/polyfills.js",tt=new Map,rt=new Map;function st(e){if(/^https?:\/\//i.test(e)||e.startsWith("blob:"))return e;let t=typeof window<"u"?window.location.origin:"";return e.startsWith("/")?t+e:t+"/"+e}function Ys(e){let t=tt.get(e);if(t)return t;let r=st(e),n=`/* auto-generated bootstrap: polyfills first, then real worker (${r}) */
2
+ try { self.importScripts(${JSON.stringify(nt)}); } catch (e) { console.error('[worker-bootstrap] polyfills load failed:', e); }
3
+ self.importScripts(${JSON.stringify(r)});
4
+ `,i=new Blob([n],{type:"text/javascript"}),s=URL.createObjectURL(i);return tt.set(e,s),s}function Zs(e){let t=rt.get(e);if(t)return t;let r=st(e),n=`/* auto-generated module bootstrap: polyfills first, then real worker (${r}) */
5
+ import ${JSON.stringify(nt)};
6
+ import ${JSON.stringify(r)};
7
+ `,i=new Blob([n],{type:"text/javascript"}),s=URL.createObjectURL(i);return rt.set(e,s),s}import{useEffect as Wr,useRef as it}from"react";import{jsx as z,jsxs as ge}from"react/jsx-runtime";function ti(){return ge("div",{className:"ant-empty ant-empty-normal justify-self-center text-muted py-4",children:[z("div",{className:"ant-empty-image",children:ge("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:[z("title",{children:" \u65E0\u6570\u636E "}),ge("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[z("ellipse",{fill:"rgb(var(--color-muted) / 0.12)",cx:"32",cy:"33",rx:"32",ry:"7"}),ge("g",{fillRule:"nonzero",stroke:"rgb(var(--color-border))",children:[z("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),z("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"rgb(var(--color-surface))"})]})]})]})}),z("div",{className:"ant-empty-description justify-self-center text-sm font-thin text-muted",children:" \u65E0\u6570\u636E "})]})}function ri(e,t,r=768){let n=it(e),i=it(t);n.current=e,i.current=t,Wr(()=>{let s=window.innerWidth<=r,o=()=>{let l=window.innerWidth<=r;l!==s&&(s=l,l?n.current():i.current())};return s?n.current():i.current(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r])}var C=e=>{let t=(e||"").trim();return["undefined","null"].includes(t.toLowerCase())?"":t},Hr=e=>{try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}},qr=e=>{if(!e.toLowerCase().startsWith("mailto:"))return null;let t=e.slice(7),r=t.indexOf("?"),n=r>=0?t.slice(0,r):t,i=r>=0?t.slice(r+1):"",s=new URLSearchParams(i);return{to:[Hr(n),s.get("to")].map(C).filter(Boolean).join(", "),cc:C(s.get("cc")),bcc:C(s.get("bcc")),subject:C(s.get("subject")),bodyText:C(s.get("body"))}},Gr=e=>{let t=new URLSearchParams;return t.set("compose","1"),t.set("composeToken",e.token||String(Date.now())),e.to&&t.set("to",e.to),e.cc&&t.set("cc",e.cc),e.bcc&&t.set("bcc",e.bcc),e.subject&&t.set("subject",e.subject),e.bodyText&&t.set("body",e.bodyText),`/email?${t.toString()}`},ii=e=>{let t=qr(e);return t?Gr(t):null},oi=e=>{let t=e.get("compose")==="1",r={to:C(e.get("to")),cc:C(e.get("cc")),bcc:C(e.get("bcc")),subject:C(e.get("subject")),bodyText:C(e.get("body")),token:C(e.get("composeToken"))},n=!!(r.to||r.cc||r.bcc||r.subject||r.bodyText);return t||n?r:null};import{useCallback as N,useEffect as ot,useRef as xe}from"react";var Jr=1200,lt=0,fe=0,at=e=>{Date.now()>lt||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())},$r=()=>{lt=Date.now()+Jr};function ci(e,t={}){let{delay:r=500,smallView:n=!1,moveThreshold:i=10}=t,s=xe(new Map),o=xe(new Map),l=xe(new Map),d=N(p=>typeof p=="string"?p:typeof p=="object"&&p!==null&&"id"in p?String(p.id):String(p),[]);ot(()=>()=>{s.current.forEach(p=>clearTimeout(p)),s.current.clear(),o.current.clear(),l.current.clear()},[]),ot(()=>{if(n)return fe===0&&document.addEventListener("contextmenu",at,!0),fe+=1,()=>{fe-=1,fe===0&&document.removeEventListener("contextmenu",at,!0)}},[n]);let u=N(p=>{let f=s.current.get(p);f&&(clearTimeout(f),s.current.delete(p)),l.current.delete(p)},[]),m=N(p=>f=>{if(!n||f.touches.length!==1)return;let D=d(p);o.current.set(D,!1);let U=f.touches[0];l.current.set(D,{x:U.clientX,y:U.clientY});let te=setTimeout(()=>{$r(),o.current.set(D,!0),e(p,f)},r);s.current.set(D,te)},[n,r,e,d]),P=N(p=>f=>{if(!n)return;let D=d(p),U=l.current.get(D);if(!U||!f.touches[0]){u(D);return}let te=f.touches[0],dt=Math.abs(te.clientX-U.x),ut=Math.abs(te.clientY-U.y);(dt>i||ut>i)&&u(D)},[n,i,d,u]),I=N(p=>()=>{let f=d(p);u(f)},[d,u]),F=N(p=>()=>{I(p)()},[I]),ye=N(p=>{let f=d(p);return o.current.get(f)||!1},[d]),ct=N(p=>{let f=d(p);o.current.set(f,!1)},[d]);return{handleTouchStart:m,handleTouchMove:P,handleTouchEnd:I,handleTouchCancel:F,wasLongPressed:ye,resetLongPress:ct}}import{useEffect as Kr,useState as Xr}from"react";function mi(){let[e,t]=Xr(typeof navigator<"u"?navigator.onLine:!0);return Kr(()=>{let r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r),window.addEventListener("offline",n),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}},[]),e}var Yr=(l=>(l[l.PREPARATION=0]="PREPARATION",l[l.PROGRESS=1]="PROGRESS",l[l.COMPLETED=2]="COMPLETED",l[l.DELAYED=3]="DELAYED",l[l.TERMINATED=4]="TERMINATED",l[l.TEMP=5]="TEMP",l[l.COMPANY_PROJECT=6]="COMPANY_PROJECT",l))(Yr||{});var Zr=(i=>(i.DRAFT="DRAFT",i.APPROVALLING="APPROVALLING",i.PENDING="PENDING",i.SIGNED="SIGNED",i))(Zr||{});import Qr from"react";import{Tag as en}from"antd";var bi=(e,t)=>{let n={DRAFT:{color:"orange",text:"\u8349\u7A3F"},APPROVALLING:{color:"yellow",text:"\u5BA1\u6838\u4E2D"},PENDING:{color:"blue",text:"\u5F85\u7B7E\u7F72"},SIGNED:{color:"green",text:"\u5DF2\u7B7E\u7F72"}}[e];return Qr.createElement(en,{color:n?.color,className:t},n?.text)};var tn=(s=>(s.OWNER="owner",s.LAYER="layer",s.MANAGER="manager",s.MEMBER="member",s.VIEWER="viewer",s))(tn||{});export{y as API,jr as APPROVAL_BIZ_LABELS,x as AuthorizationHandler,pt as CORE_VERSION,Lr as CRM_BIZ_LABELS,Hn as CacheDepartmentInfo,fs as CachePermissionInfo,Cs as CacheRoleInfo,Ke as CacheUserInfo,Rs as CacheViewToggleInfo,Zr as ContractStatus,a as HttpRequest,Ur as KNOWLEDGE_BIZ_LABELS,Ye as MESSAGE_TYPE_LABELS,Ze as MessageContentUtils,ls as PERMISSION_CRM_CREATE,ds as PERMISSION_CRM_DELETE,gs as PERMISSION_CRM_MANAGE_FILE,ms as PERMISSION_CRM_TRANSFER,cs as PERMISSION_CRM_UPDATE,us as PERMISSION_CRM_VIEW_CONTACT,ps as PERMISSION_CRM_VIEW_FILE,as as PERMISSION_FOLDER_DOWNLOAD,os as PERMISSION_INVOICE_LIST,Mr as PROJECT_BIZ_LABELS,tn as ProjectRole,Yr as ProjectStatus,_e as ResponseCode,Br as TODO_BIZ_LABELS,Rt as admin,Gr as buildEmailComposePath,ii as buildEmailComposePathFromMailto,Ar as clearAllViewModeCache,Jn as clearFileViewerCache,$t as clearIndexedDBStores,Nr as clearViewModeCache,Nt as contract,Es as copyToClipboard,qs as ensurePromiseAllSettled,Gs as ensureWebStreamsPolyfill,At as file,xt as fileversion,js as forbidDebugger,Os as formatCurrency,Bs as formatDate,Ls as formatDatetime,zs as formatDisksize,St as gateway,As as getCompanyEmailRuleText,bi as getContractStatusTag,kr as getViewMode,ti as htmlNoData,et as installWebStreamsPolyfill,xs as isCompanyEmail,Ws as keyboard,Dt as message,qr as parseMailtoHref,Mt as project,jt as projectprogress,oi as readEmailComposeSearchParams,Ks as regexCurrency,kt as role,Er as setViewMode,_ as storage,ri as useEffectResize,ci as useLongPress,mi as useOnlineStatus,Et as user,Zs as withPolyfillModuleWorkerBootstrap,Ys as withPolyfillWorkerBootstrap};
@@ -8,6 +8,11 @@
8
8
  background-color: rgb(var(--color-table-hover) / var(--tw-bg-opacity)) !important;
9
9
  }
10
10
 
11
+ /* 多选勾选中的行:淡蓝色底,便于和拖拽高亮区分 */
12
+ .file-table-row-selected > .ant-table-cell {
13
+ background-color: rgba(59, 130, 246, 0.1) !important;
14
+ }
15
+
11
16
  .tagTable {
12
17
  margin-top: 0px !important;
13
18
  margin-left: 0px !important;
@@ -25,29 +30,3 @@
25
30
  .file-manager-table .ant-table-wrapper .ant-table-tbody > tr > td.ant-table-cell-with-append {
26
31
  padding-left: 12px !important;
27
32
  }
28
-
29
- /* 名称列表头拖拽调宽手柄 */
30
- .file-manager-table .file-table-col-resizer {
31
- position: absolute;
32
- right: -5px;
33
- top: 0;
34
- bottom: 0;
35
- width: 9px;
36
- cursor: col-resize;
37
- z-index: 2;
38
- }
39
-
40
- .file-manager-table .file-table-col-resizer::after {
41
- content: '';
42
- position: absolute;
43
- left: 4px;
44
- top: 25%;
45
- bottom: 25%;
46
- width: 1px;
47
- background: transparent;
48
- }
49
-
50
- .file-manager-table .file-table-col-resizer:hover::after,
51
- .file-manager-table .file-table-col-resizer:active::after {
52
- background: #1677ff;
53
- }
@@ -433,9 +433,9 @@ body {
433
433
 
434
434
  .dark .ant-btn-primary,
435
435
  [data-theme="dark"] .ant-btn-primary {
436
- color: rgb(var(--color-email-brand)) !important;
437
- background-color: rgb(var(--color-email-hover)) !important;
438
- border-color: rgb(var(--color-email-ring)) !important;
436
+ color: #ffffff !important;
437
+ background-color: rgb(var(--color-blue-300)) !important;
438
+ border-color: rgb(var(--color-blue-300)) !important;
439
439
  box-shadow: none !important;
440
440
  }
441
441
 
@@ -443,21 +443,21 @@ body {
443
443
  .dark .ant-btn-primary .anticon,
444
444
  [data-theme="dark"] .ant-btn-primary span,
445
445
  [data-theme="dark"] .ant-btn-primary .anticon {
446
- color: rgb(var(--color-email-brand)) !important;
446
+ color: #ffffff !important;
447
447
  }
448
448
 
449
449
  .dark .ant-btn-primary:hover,
450
450
  [data-theme="dark"] .ant-btn-primary:hover {
451
- color: rgb(var(--color-primary-700)) !important;
452
- background-color: rgb(var(--color-email-soft)) !important;
453
- border-color: rgb(var(--color-email-brand)) !important;
451
+ color: #ffffff !important;
452
+ background-color: rgb(var(--color-blue-400)) !important;
453
+ border-color: rgb(var(--color-blue-400)) !important;
454
454
  }
455
455
 
456
456
  .dark .ant-btn-primary:hover span,
457
457
  .dark .ant-btn-primary:hover .anticon,
458
458
  [data-theme="dark"] .ant-btn-primary:hover span,
459
459
  [data-theme="dark"] .ant-btn-primary:hover .anticon {
460
- color: rgb(var(--color-primary-700)) !important;
460
+ color: #ffffff !important;
461
461
  }
462
462
 
463
463
  .dark .ant-btn-dangerous:not(.ant-btn-primary),
@@ -0,0 +1 @@
1
+ var s=(e=>(e[e.PREPARATION=0]="PREPARATION",e[e.PROGRESS=1]="PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.DELAYED=3]="DELAYED",e[e.TERMINATED=4]="TERMINATED",e[e.TEMP=5]="TEMP",e[e.COMPANY_PROJECT=6]="COMPANY_PROJECT",e))(s||{});var m=(t=>(t.DRAFT="DRAFT",t.APPROVALLING="APPROVALLING",t.PENDING="PENDING",t.SIGNED="SIGNED",t))(m||{});import o from"react";import{Tag as g}from"antd";var T=(i,a)=>{let n={DRAFT:{color:"orange",text:"\u8349\u7A3F"},APPROVALLING:{color:"yellow",text:"\u5BA1\u6838\u4E2D"},PENDING:{color:"blue",text:"\u5F85\u7B7E\u7F72"},SIGNED:{color:"green",text:"\u5DF2\u7B7E\u7F72"}}[i];return o.createElement(g,{color:n?.color,className:a},n?.text)};var d=(r=>(r.OWNER="owner",r.LAYER="layer",r.MANAGER="manager",r.MEMBER="member",r.VIEWER="viewer",r))(d||{});export{m as ContractStatus,d as ProjectRole,s as ProjectStatus,T as getContractStatusTag};
@@ -0,0 +1 @@
1
+ var Zt=Object.defineProperty;var Br=(e,t,r)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var bt=(e,t)=>{for(var r in t)Zt(e,r,{get:t[r],enumerable:!0})};var F=(e,t,r)=>Br(e,typeof t!="symbol"?t+"":t,r);import{Modal as Lr,Button as st,Space as er,Typography as zr}from"antd";import{CheckCircleFilled as Hr,CloseCircleFilled as Wr,ExclamationCircleFilled as Vr,InfoCircleFilled as qr,QuestionCircleFilled as $r}from"@ant-design/icons";import{createRoot as Xr}from"react-dom/client";import{jsx as q,jsxs as tr}from"react/jsx-runtime";var{Text:Gr,Title:Jr}=zr,rr={type:"info",title:"\u63D0\u793A",content:"",width:420,centered:!0,closable:!0,maskClosable:!0,okText:"\u786E\u5B9A",okType:"primary",cancelText:"\u53D6\u6D88",autoClose:0,showIcon:!1},Z=null,Y=null,Be=null,ot=e=>{let{type:t="info",title:r,content:n,width:d,centered:s,closable:a,maskClosable:o,okText:i,okType:l,cancelText:m,buttons:C,onOk:b,onCancel:w,open:_,onClose:A,className:P,showIcon:O}=e,N={success:q(Hr,{style:{color:"#52c41a",fontSize:24,marginRight:8}}),error:q(Wr,{style:{color:"#ff4d4f",fontSize:24,marginRight:8}}),warning:q(Vr,{style:{color:"#faad14",fontSize:24,marginRight:8}}),info:q(qr,{style:{color:"#1677ff",fontSize:24,marginRight:8}}),confirm:q($r,{style:{color:"#1677ff",fontSize:24,marginRight:8}})},I=async()=>{b&&await b(),A()},R=()=>{w&&w(),A()},T=()=>C&&C.length>0?q(er,{style:{display:"flex",justifyContent:"flex-end"},children:C.map((j,x)=>q(st,{type:j.type||"default",onClick:()=>{j.onClick&&j.onClick(),A()},children:j.text},x))}):t==="confirm"?tr(er,{style:{display:"flex",justifyContent:"flex-end"},children:[q(st,{onClick:R,children:m}),q(st,{type:l,onClick:I,children:i})]}):q(st,{type:l,onClick:I,children:i});return q(Lr,{title:r?tr("div",{style:{display:"flex",alignItems:"center"},children:[O&&N[t],q(Jr,{level:4,style:{margin:0},children:r})]}):null,open:_,width:d,centered:s,closable:a,maskClosable:o,onCancel:R,footer:T(),className:P?P+" ant-modal-nofull":"ant-modal-nofull",children:q("div",{style:{marginLeft:O?32:0},children:typeof n=="string"?q(Gr,{children:n}):n})})},Ne=(e,t=!0)=>{Be&&(window.clearTimeout(Be),Be=null);let r={...rr,...e},n=()=>{Z&&Y&&Y.render(q(ot,{...r,open:!1,onClose:()=>{r.afterClose&&r.afterClose(),Z&&Y&&setTimeout(()=>{Y?.unmount(),document.body.removeChild(Z),Z=null,Y=null},300)}}))};return Z&&Y?Y.render(q(ot,{...r,open:t,onClose:n})):(Z=document.createElement("div"),document.body.appendChild(Z),Y=Xr(Z),Y.render(q(ot,{...r,open:t,onClose:n}))),r.autoClose&&r.autoClose>0&&(Be=window.setTimeout(()=>{n(),Be=null},r.autoClose)),n},Kr={success:e=>{let t=typeof e=="string"?{content:e}:e;return Ne({...t,type:"success",title:t.title||"\u6210\u529F"})},error:e=>{let t=typeof e=="string"?{content:e}:e;return Ne({...t,type:"error",title:t.title||"\u9519\u8BEF"})},warning:e=>{let t=typeof e=="string"?{content:e}:e;return Ne({...t,type:"warning",title:t.title||"\u8B66\u544A"})},info:e=>{let t=typeof e=="string"?{content:e}:e;return Ne({...t,type:"info",title:t.title||"\u63D0\u793A"})},confirm:e=>{let t=typeof e=="string"?{content:e}:e;return Ne({...t,type:"confirm",title:t.title||"\u786E\u8BA4"})},custom:e=>Ne(e),close:()=>{Z&&Y&&Y.render(q(ot,{...rr,open:!1,onClose:()=>{Z&&Y&&(Y.unmount(),document.body.removeChild(Z),Z=null,Y=null)}}))}},Qr=Kr;import{Modal as Yr,Button as nr,Space as Zr}from"antd";import{ExclamationCircleFilled as en,InfoCircleFilled as tn,QuestionCircleFilled as rn,WarningFilled as nn}from"@ant-design/icons";import{createRoot as sn}from"react-dom/client";import{jsx as re,jsxs as or}from"react/jsx-runtime";var on={type:"confirm",title:"\u786E\u8BA4",content:"",width:420,centered:!0,closable:!0,maskClosable:!1,okText:"\u786E\u5B9A",okType:"primary",cancelText:"\u53D6\u6D88",showIcon:!1,keyboard:!0,autoFocusButton:"ok",zIndex:2e4},ie=null,ae=null,sr=e=>{let{type:t="confirm",title:r,content:n,width:d,centered:s,closable:a,maskClosable:o,okText:i,okType:l,cancelText:m,okButtonProps:C,cancelButtonProps:b,onOk:w,onCancel:_,open:A,onClose:P,className:O,showIcon:N,zIndex:I,keyboard:R,autoFocusButton:T}=e,D={confirm:re(rn,{style:{color:"#1677ff",fontSize:22,marginRight:12}}),warning:re(en,{style:{color:"#faad14",fontSize:22,marginRight:12}}),info:re(tn,{style:{color:"#1677ff",fontSize:22,marginRight:12}}),error:re(nn,{style:{color:"#ff4d4f",fontSize:22,marginRight:12}})},j=async()=>{try{if(w){let W=w();W instanceof Promise&&await W}P(!0)}catch(W){console.error("Confirm onOk error:",W)}},x=()=>{_&&_(),P(!1)};return re(Yr,{title:r?or("div",{style:{display:"flex",alignItems:"center"},children:[N&&D[t],re("span",{children:r})]}):null,open:A,width:d,centered:s,closable:a,maskClosable:o,onCancel:x,className:O?O+" ant-modal-nofull":"ant-modal-nofull",zIndex:I,keyboard:R,footer:or(Zr,{children:[re(nr,{onClick:x,...b,autoFocus:T==="cancel",children:m}),re(nr,{type:l,onClick:j,...C,autoFocus:T==="ok",children:i})]}),children:re("div",{style:{marginLeft:N?34:0},children:n})})},Le=e=>{let t={...on,...e};return ie&&ae&&(ae.unmount(),document.body.removeChild(ie),ie=null,ae=null),new Promise(r=>{let n=d=>{ie&&ae&&ae.render(re(sr,{...t,open:!1,onClose:s=>{t.afterClose&&t.afterClose(),setTimeout(()=>{ie&&ae&&(ae.unmount(),document.body.removeChild(ie),ie=null,ae=null),r(s)},300)}})),r(d)};ie=document.createElement("div"),document.body.appendChild(ie),ae=sn(ie),ae.render(re(sr,{...t,open:!0,onClose:n}))})},an={confirm:e=>Le({...typeof e=="string"?{content:e,showIcon:!1,title:""}:e,type:"confirm"}),warning:e=>{let t=typeof e=="string"?{content:e}:e;return Le({...t,type:"warning",title:t.title||"\u8B66\u544A"})},info:e=>{let t=typeof e=="string"?{content:e}:e;return Le({...t,type:"info",title:t.title||"\u4FE1\u606F"})},error:e=>{let t=typeof e=="string"?{content:e}:e;return Le({...t,type:"error",title:t.title||"\u9519\u8BEF"})},custom:e=>Le(e)},ln=an;import{useState as cn,useRef as dn,useEffect as mn}from"react";import{Calendar as un,ChevronLeft as pn,ChevronRight as gn}from"lucide-react";import{Button as vt}from"antd";import{jsx as V,jsxs as ze}from"react/jsx-runtime";function Ct({value:e,onChange:t,type:r="date",placeholder:n="\u9009\u62E9\u65E5\u671F",className:d=""}){let[s,a]=cn(!1),o=dn(null),i=e?l(e,r):"";mn(()=>{function b(w){o.current&&!o.current.contains(w.target)&&a(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);function l(b,w){if(!b)return"";try{if(w==="month"){let[_,A]=b.split("-");return`${_}\u5E74${A}\u6708`}else return new Date(b).toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric"})}catch{return b}}let m=b=>{t(b.target.value)},C=()=>{a(!s)};return ze("div",{className:`relative ${d}`,ref:o,children:[ze("div",{className:"relative cursor-pointer",children:[V("input",{type:r,value:e,onChange:m,onClick:C,className:"w-full bg-white border border-ios-gray-200 rounded-ios py-2.5 pl-3 pr-10 text-sm text-ios-gray-700 shadow-ios focus:outline-none focus:ring-2 focus:ring-ios-blue-400 focus:border-transparent transition-all duration-200 hover:border-ios-blue-300 cursor-pointer",placeholder:n}),V("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:V(un,{className:"h-4 w-4 text-ios-gray-400"})})]}),s&&ze("div",{className:"absolute z-10 mt-1 bg-white rounded-ios shadow-ios-md p-4 ring-1 ring-ios-gray-200 ring-opacity-5",children:[ze("div",{className:"flex justify-between items-center mb-4",children:[V(vt,{type:"text",className:"p-1.5 hover:bg-ios-gray-100 rounded-full transition-colors duration-150",icon:V(pn,{className:"h-4 w-4 text-ios-gray-600"})}),V("span",{className:"text-sm font-medium text-ios-gray-700",children:"2024\u5E745\u6708"}),V(vt,{type:"text",className:"p-1.5 hover:bg-ios-gray-100 rounded-full transition-colors duration-150",icon:V(gn,{className:"h-4 w-4 text-ios-gray-600"})})]}),ze("div",{className:"grid grid-cols-7 gap-1 text-center text-xs",children:[V("div",{className:"text-ios-gray-500 font-medium",children:"\u65E5"}),V("div",{className:"text-ios-gray-500 font-medium",children:"\u4E00"}),V("div",{className:"text-ios-gray-500 font-medium",children:"\u4E8C"}),V("div",{className:"text-ios-gray-500 font-medium",children:"\u4E09"}),V("div",{className:"text-ios-gray-500 font-medium",children:"\u56DB"}),V("div",{className:"text-ios-gray-500 font-medium",children:"\u4E94"}),V("div",{className:"text-ios-gray-500 font-medium",children:"\u516D"}),V("div",{className:"text-ios-gray-300 py-1.5",children:"30"}),V("div",{className:"text-ios-gray-300 py-1.5",children:"31"}),Array.from({length:30}).map((b,w)=>V("div",{className:`py-1.5 hover:bg-ios-blue-50 rounded-full cursor-pointer transition-colors duration-150 ${w===14?"bg-ios-blue-500 text-white":"text-ios-gray-700"}`,onClick:()=>{let _=w+1,A=`2024-05-${_<10?"0"+_:_}`;t(A),a(!1)},children:w+1},w))]}),V("div",{className:"mt-4 flex justify-end",children:V(vt,{type:"text",className:"px-4 py-1.5 text-sm text-ios-blue-500 hover:bg-ios-blue-50 rounded-ios transition-colors duration-150",onClick:()=>a(!1),children:"\u786E\u5B9A"})})]})]})}import{jsx as It,jsxs as fn}from"react/jsx-runtime";function ei({startDate:e,endDate:t,onStartDateChange:r,onEndDateChange:n,type:d="date",className:s=""}){return fn("div",{className:`flex items-center space-x-2 ${s}`,children:[It(Ct,{value:e,onChange:r,type:d,placeholder:"\u5F00\u59CB\u65E5\u671F"}),It("span",{className:"text-gray-500",children:"\u81F3"}),It(Ct,{value:t,onChange:n,type:d,placeholder:"\u7ED3\u675F\u65E5\u671F"})]})}import{useState as He,useRef as yn}from"react";import{Button as wt,Modal as hn,message as Tt}from"antd";import{UploadOutlined as bn}from"@ant-design/icons";import vn from"react-image-crop";import"react-image-crop/dist/ReactCrop.css";function it(e,t){let r=new FileReader;r.readAsDataURL(e),r.onload=function(){t(r.result)},r.onerror=function(){t(null)},r.onabort=function(){t(null)}}function Rt(e,t,r,n){t=t>0?t:1024;let d=t,s=t,a=new Image;a.addEventListener("load",function(o){let i,l=!1;if(d<a.naturalWidth&&(l=!0,i=a.naturalWidth/d,s=a.naturalHeight/i),s<a.naturalHeight&&(l=!0,i=a.naturalHeight/s,d=a.naturalWidth/i),!l){d=a.naturalWidth,s=a.naturalHeight,n&&n(e,d,s);return}let m=document.createElement("canvas");m.width=d,m.height=s;let C=m.getContext("2d");C?.clearRect(0,0,d,s),C?.drawImage(a,0,0,d,s);let b=m.toDataURL(r||"image/png");m=null,n&&n(b,d,s)}),a.src=e}import{jsx as ue,jsxs as Cn}from"react/jsx-runtime";var ui=({onUpload:e,accept:t="image/*",maxSize:r=5,aspectRatio:n,className:d="",useBase64:s=!1,id:a})=>{let[o,i]=He(!1),[l,m]=He(""),[C,b]=He({unit:"%",width:90,height:90,x:5,y:5}),[w,_]=He(null),[A,P]=He(null),O=yn(null),N=R=>{let T=R.target.files?.[0];if(!T)return;if(T.size>r*1024*1024){Tt.error(`\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ${r}MB`);return}if(!T.type.startsWith("image/")){Tt.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6");return}P(T);let D=new FileReader;D.onload=j=>{m(j.target?.result),i(!0)},D.readAsDataURL(T)},I=async R=>{if(!w||!A)return;let T=w.width,D=w.height,j=w.naturalWidth/T,x=w.naturalHeight/D,B=R.unit=="%"?T/100:1,W=R.unit=="%"?D/100:1,v=R.x*j*B,S=R.y*x*W,G=R.width*j*B,Q=R.height*x*W;try{let X=document.createElement("canvas");X.width=G,X.height=Q;let fe=X.getContext("2d");if(!fe)return;fe.drawImage(w,v,S,G,Q,0,0,G,Q),X.toBlob(ye=>{if(!ye)return;let oe=new File([ye],A.name,{type:A.type});if(s){it(oe,he=>{Rt(he,0,"image/jpeg",me=>{i(!1),e(me)})});return}else i(!1),e(oe)},A.type),i(!1),m(""),P(null),O.current&&(O.current.value="")}catch{Tt.error("\u56FE\u7247\u5904\u7406\u5931\u8D25")}};return Cn("div",{className:d,children:[ue("input",{type:"file",ref:O,accept:t,onChange:N,style:{display:"none"}}),ue(wt,{id:a,icon:ue(bn,{}),onClick:()=>O.current?.click(),className:"btn-primary",children:"\u9009\u62E9\u56FE\u7247"}),ue(hn,{title:"\u88C1\u526A\u56FE\u7247",open:o,onCancel:()=>{i(!1),m(""),P(null),O.current&&(O.current.value="")},footer:[ue(wt,{onClick:()=>i(!1),className:"btn-outline",children:"\u53D6\u6D88"},"cancel"),ue(wt,{type:"primary",onClick:()=>I(C),className:"btn-primary",children:"\u786E\u8BA4"},"confirm")],width:500,children:ue("div",{className:"flex justify-center",children:l&&ue(vn,{crop:C,onChange:R=>b(R),aspect:n,className:"max-w-full",children:ue("img",{src:l,alt:"\u9884\u89C8",ref:R=>_(R),className:"max-w-full"})})})})]})};import{Spin as In}from"antd";import{LoadingOutlined as Rn}from"@ant-design/icons";import{createRoot as wn}from"react-dom/client";import{jsx as We}from"react/jsx-runtime";var ir=Symbol("loading");function ar(){let e=window[ir];return e||(e={count:0,timeoutId:0,inTimeout:!1},window[ir]=e),e}var cr={tip:"",fullscreen:!0,delay:0,mask:!0,iconSize:40,wrapperClassName:"ui-loading-wrapper"},Tn=e=>{let t={...cr,...e},{tip:r,fullscreen:n,mask:d,maskStyle:s,iconSize:a,iconStyle:o,containerStyle:i,wrapperClassName:l}=t,m=We(Rn,{style:{fontSize:a,color:"#1677ff",...o},spin:!0}),C=n?{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:d?"rgba(0, 0, 0, 0.45)":"transparent",...s}:{},b={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...i};return We("div",{style:C,className:l,children:We("div",{style:b,children:We(In,{indicator:m,children:r})})})},le=null,be=null,lr=(e={})=>(le&&be&&(be.unmount(),document.body.removeChild(le),le=null,be=null),le=document.createElement("div"),document.body.appendChild(le),be=wn(le),be.render(We(Tn,{...e})),le),at={show:(e={})=>{let t=ar();t.count++;let r={...cr,...e};if(r.delay&&r.delay>0){t.timeoutId!=0&&(window.clearTimeout(t.timeoutId),t.timeoutId=0),t.timeoutId=window.setTimeout(()=>{t.timeoutId=0,lr(r)},r.delay);return}else lr(r)},hide:()=>{let e=ar();if(e.count<=0){console.warn("Loading count is less than 0");return}e.count--,e.timeoutId!=0&&(window.clearTimeout(e.timeoutId),e.timeoutId=0),e.count==0&&le&&be&&(be.unmount(),document.body.removeChild(le),le=null,be=null)},service:(e,t={})=>(at.show(t),e.then(r=>(at.hide(),r)).catch(r=>{throw at.hide(),r}))},Ve=at;import{useState as Pn,useRef as xn,useEffect as Sn}from"react";import{ChevronDown as _n}from"lucide-react";import{Button as kn}from"antd";import{jsx as ve,jsxs as Pt}from"react/jsx-runtime";function Pi({options:e,value:t,onChange:r,placeholder:n="\u8BF7\u9009\u62E9",className:d=""}){let[s,a]=Pn(!1),o=xn(null),i=e.find(l=>l.value===t);return Sn(()=>{function l(m){o.current&&!o.current.contains(m.target)&&a(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),Pt("div",{className:`relative ${d}`,ref:o,children:[Pt(kn,{type:"text",onClick:()=>a(!s),className:"w-full bg-white border border-ios-gray-200 rounded-ios py-2.5 pl-3 pr-10 text-left shadow-ios focus:outline-none focus:ring-2 focus:ring-ios-blue-400 focus:border-transparent transition-all duration-200 hover:border-ios-blue-300",children:[ve("span",{className:"block truncate text-sm text-ios-gray-700",children:i?i.label:n}),ve("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none",children:ve(_n,{className:`h-4 w-4 text-ios-gray-400 transition-transform duration-200 ${s?"transform rotate-180":""}`})})]}),s&&ve("div",{className:"absolute z-10 mt-1 w-full bg-white shadow-ios-md max-h-60 rounded-ios py-1 text-base ring-1 ring-ios-gray-200 ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",children:e.map(l=>Pt("div",{className:`cursor-pointer select-none relative py-2.5 pl-3 pr-9 hover:bg-ios-blue-50 transition-colors duration-150 ${l.value===t?"bg-ios-blue-50 text-ios-blue-600 font-medium":"text-ios-gray-700"}`,onClick:()=>{r(l.value),a(!1)},children:[ve("span",{className:"block truncate text-sm",children:l.label}),l.value===t&&ve("span",{className:"absolute inset-y-0 right-0 flex items-center pr-4 text-ios-blue-500",children:ve("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:ve("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},l.value))})]})}import{useEffect as dr,useState as Nn,useRef as Un}from"react";import{notification as ee}from"antd";import{CheckCircleOutlined as Dn,CloseCircleOutlined as En,InfoCircleOutlined as An,WarningOutlined as On}from"@ant-design/icons";import{Fragment as mr,jsx as $e,jsxs as Fn}from"react/jsx-runtime";var St={success:$e(Dn,{style:{color:"#52c41a"}}),error:$e(En,{style:{color:"#ff4d4f"}}),info:$e(An,{style:{color:"#1677ff"}}),warning:$e(On,{style:{color:"#faad14"}})},Di=({type:e,message:t,descs:r="",duration:n=3,placement:d="topRight",onClose:s})=>{let[a,o]=ee.useNotification(),[i,l]=Nn(!0);return dr(()=>{let m={message:t,descs:r,placement:d,duration:n,icon:St[e],onClose:()=>{l(!1),s?.()}};if(i)switch(e){case"success":a.success(m);break;case"error":a.error(m);break;case"info":a.info(m);break;case"warning":a.warning(m);break;default:a.info(m)}},[e,t,r,n,d,i,a,s]),$e(mr,{children:o})};ee.config({placement:"topRight",duration:3,zIndex:1e4});var Te=class Te{constructor(){F(this,"currentToast",null);F(this,"api",null);F(this,"isInitialized",!1);F(this,"pendingToast",null)}static getInstance(){return Te.instance||(Te.instance=new Te),Te.instance}init(t){if(this.api=t,this.isInitialized=!0,this.pendingToast){let r=this.pendingToast;this.pendingToast=null,this.show(r)}}show(t){let{key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}=t;if(!this.isInitialized||!this.api){this.pendingToast=t;return}this.currentToast?.timer&&clearTimeout(this.currentToast.timer),this.currentToast&&this.currentToast.key===r?(ee.destroy(r),this.createNotification({key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i})):(this.currentToast&&ee.destroy(this.currentToast.key),this.createNotification({key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}))}createNotification(t){if(!this.api)return;let{key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}=t,l={success:this.api.success.bind(this.api),error:this.api.error.bind(this.api),info:this.api.info.bind(this.api),warning:this.api.warning.bind(this.api)}[n];l({key:r,message:d,description:s,duration:a,placement:o||"topRight",icon:St[n],onClose:()=>{this.currentToast?.key===r&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),this.currentToast=null),i?.()}}),this.currentToast={key:r,type:n,message:d,descs:s,duration:a,placement:o,timer:null}}close(){this.currentToast&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),ee.destroy(this.currentToast.key),this.currentToast=null)}destroy(){this.close(),ee.destroy()}};F(Te,"instance");var xt=Te,jn=xt.getInstance();function lt(e){return typeof e=="string"?{message:e,duration:3}:e}function qe(e){return St[e]}var Mn={success:e=>{if(!e)return;let t=lt(e);ee.success({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:qe("success"),onClose:t.onClose})},error:e=>{if(!e)return;let t=lt(e);ee.error({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:qe("error"),onClose:t.onClose})},info:e=>{if(!e)return;let t=lt(e);ee.info({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:qe("info"),onClose:t.onClose})},warning:e=>{if(!e)return;let t=lt(e);ee.warning({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:qe("warning"),onClose:t.onClose})},custom:(e,t)=>{let{message:r,descs:n,duration:d,placement:s,onClose:a}=t;ee[e]({message:r,description:n,duration:d,placement:s,icon:qe(e),onClose:a})}},Ei=({children:e})=>{let[t,r]=ee.useNotification(),n=Un(!1);return dr(()=>{n.current||(jn.init(t),n.current=!0)},[t]),Fn(mr,{children:[r,e]})},K=Mn;import{notification as Ce}from"antd";import{CheckCircleOutlined as Bn,CloseCircleOutlined as Ln,InfoCircleOutlined as zn,WarningOutlined as Hn}from"@ant-design/icons";import{Fragment as Vn,jsx as Ge}from"react/jsx-runtime";var Wn={success:Ge(Bn,{style:{color:"#52c41a"}}),error:Ge(Ln,{style:{color:"#ff4d4f"}}),info:Ge(zn,{style:{color:"#1890ff"}}),warning:Ge(Hn,{style:{color:"#faad14"}})},_t=class{constructor(){F(this,"currentToast",null);F(this,"suppressedCloseKeys",new Set)}destroySilently(t){this.suppressedCloseKeys.add(t),Ce.destroy(t)}show(t){let{key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}=t;this.currentToast&&this.currentToast.key===r?this.createNotification({key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}):(this.currentToast&&this.destroySilently(this.currentToast.key),this.createNotification({key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}))}createNotification(t){let{key:r,type:n,message:d,descs:s,duration:a,placement:o,onClose:i}=t;this.suppressedCloseKeys.delete(r);let l={success:Ce.success,error:Ce.error,info:Ce.info,warning:Ce.warning}[n];l({key:r,message:d,description:s,duration:a,placement:o||"topRight",icon:Wn[n],onClose:()=>{if(this.suppressedCloseKeys.has(r)){this.suppressedCloseKeys.delete(r),this.currentToast?.key===r&&(this.currentToast=null);return}this.currentToast?.key===r&&(this.currentToast=null),i?.()}}),this.currentToast={key:r,type:n,message:d,descs:s,duration:a,placement:o}}close(t){if(!this.currentToast){t&&Ce.destroy(t);return}let r=t||this.currentToast.key;if(r!==this.currentToast.key){Ce.destroy(t);return}this.destroySilently(r),this.currentToast=null}destroy(){this.currentToast&&(this.destroySilently(this.currentToast.key),this.currentToast=null),Ce.destroy()}},Pe=new _t,Bi={success:(e,t=3)=>{let r=Xe("success",e,t);Pe.show(r)},error:(e,t=3)=>{let r=Xe("error",e,t);Pe.show(r)},info:(e,t=3)=>{let r=Xe("info",e,t);Pe.show(r)},warning:(e,t=3)=>{let r=Xe("warning",e,t);Pe.show(r)},custom:(e,t,r=3)=>{let n=Xe(e,t,r);Pe.show(n)},close:e=>{Pe.close(e)},destroy:()=>{Pe.destroy()}};function Xe(e,t,r){let n=typeof t=="object"&&t!==null?t:{message:t};return{key:n.key||`singleton-${e}`,type:e,message:n.message,descs:n.descs,duration:n.duration??r,placement:n.placement,onClose:n.onClose}}var Li=({children:e})=>Ge(Vn,{children:e});import{Button as qn}from"antd";import{TableOutlined as $n,AppstoreOutlined as Xn}from"@ant-design/icons";import{jsx as Ue}from"react/jsx-runtime";function Gn({className:e="",viewMode:t,onToggle:r,options:n=[]}){return Ue("div",{className:`flex justify-end ${e}`,children:Ue("div",{className:"bg-gray-100 rounded-button p-1 flex",children:n.map((d,s)=>Ue(qn,{type:t===d.value?"primary":"text",icon:d.icon,onClick:()=>r(d.value),className:`${s<n.length-1?"mr-1":""} rounded-button`,size:"small",title:d.tooltip},d.value))})})}function $i({viewMode:e,onToggle:t,className:r=""}){return Ue(Gn,{viewMode:e,onToggle:t,className:r,options:[{value:"table",icon:Ue($n,{}),tooltip:"\u8868\u683C\u89C6\u56FE"},{value:"grid",icon:Ue(Xn,{}),tooltip:"\u7F51\u683C\u89C6\u56FE"}]})}import{useMemo as ur,useState as kt}from"react";import{Table as Jn}from"antd";import{jsx as Nt,jsxs as ts}from"react/jsx-runtime";var Kn=Jn,Qn=60,pr=9,Yn={position:"absolute",top:0,bottom:0,right:-(pr/2),width:pr,zIndex:2,cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none"},Zn={width:1,height:"60%",background:"transparent"},es=({onResizeStart:e,style:t,children:r,...n})=>{let[d,s]=kt(!1),[a,o]=kt(!1),i=l=>{if(!e)return;let m=l.currentTarget.closest("th"),C=m?m.getBoundingClientRect().width:0;o(!0);let b=()=>o(!1);document.addEventListener("mouseup",b,{once:!0}),e(l,C)};return ts("th",{style:{...t,position:"relative"},...n,children:[r,e&&Nt("span",{style:Yn,onMouseDown:i,onClick:l=>l.stopPropagation(),onDoubleClick:l=>l.stopPropagation(),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:Nt("span",{style:{...Zn,background:d||a?"#1677ff":"transparent"}})})]})},gr=(e,t)=>{let r=e.key;if(typeof r=="string"||typeof r=="number")return String(r);let n=e.dataIndex;return Array.isArray(n)?n.join("."):typeof n=="string"||typeof n=="number"?String(n):`col-${t}`};function Yi(e){let{columns:t,components:r,tableLayout:n,...d}=e,[s,a]=kt({}),o=(m,C)=>(b,w)=>{if(b.preventDefault(),b.stopPropagation(),Object.keys(s).length===0&&t){let O=b.currentTarget.closest("th"),N=O?.parentElement,I=N?Array.from(N.children):[],R=O&&I.length>0?I.indexOf(O)-m:0,T={};t.forEach((D,j)=>{let x=I[j+R];x&&(T[gr(D,j)]=Math.round(x.getBoundingClientRect().width))}),Object.keys(T).length>0&&a(D=>({...T,...D}))}let _=b.clientX,A=O=>{let N=Math.max(Qn,Math.round(w+O.clientX-_));a(I=>I[C]===N?I:{...I,[C]:N})},P=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",P),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",A),document.addEventListener("mouseup",P),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},i=ur(()=>t&&t.map((m,C)=>{if("children"in m&&m.children)return m;let b=gr(m,C),w=s[b]??m.width;return{...m,width:w,onHeaderCell:_=>({...m.onHeaderCell?.(_)??{},onResizeStart:o(C,b)})}}),[t,s]),l=ur(()=>({...r,header:{...r?.header??{},cell:es}}),[r]);return Nt(Kn,{...d,columns:i,components:l,tableLayout:Object.keys(s).length>0?"fixed":n})}import Ie from"react";import{Timeline as xs,Avatar as wr,Button as gt,Dropdown as Ss,DatePicker as _s}from"antd";var Je=e=>!e||(typeof e=="string"&&(e=new Date(e)),e.getTime()==0)||isNaN(e.getTime())?"\u65E0":e.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"numeric",hour:"2-digit",minute:"2-digit"});import{Modal as Tr,Form as _e,Input as Pr}from"antd";import{EllipsisOutlined as ks,EditOutlined as Ns,DeleteOutlined as Us,CommentOutlined as Ds}from"@ant-design/icons";import{useEffect as rs,useRef as fr}from"react";import{jsx as De,jsxs as ct}from"react/jsx-runtime";function yr(){return ct("div",{className:"ant-empty ant-empty-normal justify-self-center text-muted py-4",children:[De("div",{className:"ant-empty-image",children:ct("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:[De("title",{children:" \u65E0\u6570\u636E "}),ct("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[De("ellipse",{fill:"rgb(var(--color-muted) / 0.12)",cx:"32",cy:"33",rx:"32",ry:"7"}),ct("g",{fillRule:"nonzero",stroke:"rgb(var(--color-border))",children:[De("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),De("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"rgb(var(--color-surface))"})]})]})]})}),De("div",{className:"ant-empty-description justify-self-center text-sm font-thin text-muted",children:" \u65E0\u6570\u636E "})]})}function hr(e,t,r=768){let n=fr(e),d=fr(t);n.current=e,d.current=t,rs(()=>{let s=window.innerWidth<=r,a=()=>{let o=window.innerWidth<=r;o!==s&&(s=o,o?n.current():d.current())};return s?n.current():d.current(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[r])}import xr from"dayjs";import*as At from"febs-browser";import Cr from"dexie";var Ut={};bt(Ut,{AuthorizationHandler:()=>pe,HttpRequest:()=>c,ResponseCode:()=>ut});import ns,{AxiosError as ss}from"axios";import*as mt from"febs-browser";import*as Ke from"febs-browser";import br from"store2";var dt=class{constructor(t){F(this,"s");this.s=t}get length(){return this.s.size()}keys(){return this.s.keys()}set(t,r){return r?(r=JSON.stringify(r),r=Ke.crypt.base64_encode(r),this.s.set(t,r,!0),this):this.remove(t)}get(t,r=null){if(!this.s.has(t))return r;let n=this.s.get(t);if(n){n=Ke.crypt.base64_decode(n),n=Ke.string.bytesToUtf8(n||[]);try{return JSON.parse(n)}catch{return this.remove(t),null}}return n}remove(t){return this.s.remove(t),this}clear(){return this.s.clearAll(),this}},te={namespace:function(e){return new dt(br.namespace(e||"default"))},namespace_session:function(e){return new dt(br.session.namespace(e||"default"))}};var ut=(i=>(i[i.SUCCESS=200]="SUCCESS",i[i.OPERATOR_ERROR=400]="OPERATOR_ERROR",i[i.UNAUTHORIZED=401]="UNAUTHORIZED",i[i.UNPERMISSION=402]="UNPERMISSION",i[i.NOT_FOUND=404]="NOT_FOUND",i[i.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",i[i.PARAM_ERROR=601]="PARAM_ERROR",i[i.REQUEST_LIMIT=602]="REQUEST_LIMIT",i))(ut||{});function os(e){switch(e){case 404:return"\u8D44\u6E90\u4E0D\u5B58\u5728";case 400:return"\u7CFB\u7EDF\u64CD\u4F5C\u9519\u8BEF";case 601:return"\u53C2\u6570\u9519\u8BEF";case 602:return"\u8FBE\u5230\u8BBF\u95EE\u9650\u5236";case 503:return"\u670D\u52A1\u4E0D\u53EF\u7528";case 401:return"\u672A\u767B\u5F55";case 402:return"\u65E0\u6743\u9650";default:return"\u672A\u77E5\u9519\u8BEF"}}var Ee=ns.create({baseURL:import.meta.env.VITE_API_BASE,timeout:Number(import.meta.env.VITE_API_TIMEOUT)||5e3,headers:{"Content-Type":"application/json;charset=UTF-8"},withCredentials:!0}),$=class ${static clearStoreToken(){this.setStoreToken(null,0)}static getStoreToken(){let t=te.namespace("bp.ss").get("ss");if(t){let r=te.namespace("bp.ss").get("exp");return{token:JSON.parse(t),exp:r?JSON.parse(r):0}}return null}static getValidStoreToken(){let t=$.getStoreToken();return t&&t.exp>Date.now()-$.TOKEN_EXP?t.token:null}static setStoreToken(t,r){t?(te.namespace("bp.ss").set("ss",JSON.stringify(t)),te.namespace("bp.ss").set("exp",JSON.stringify(r))):te.namespace("bp.ss").clear()}static requestHandleSid(t){let r=$.getStoreToken();r&&r.exp>Date.now()-$.TOKEN_EXP&&t.headers.set($.HEADER_NAME,$.HEADER_PREFIX+r.token)}static responseHandleSid(t){let r=t.headers.get($.HEADER_NAME);if(r&&r.startsWith($.HEADER_PREFIX.trim())){r=r.replace($.HEADER_PREFIX,"");let n=r;if(r=r.split(".")[1],r&&(r=mt.string.bytesToUtf8(mt.crypt.base64_decode(r)),r)){let d=JSON.parse(r);return d.exp<Date.now()-$.TOKEN_EXP?($.clearStoreToken(),!1):($.setStoreToken(n,d.exp),!0)}$.clearStoreToken(),typeof navigator<"u"&&navigator.onLine&&(window.location.href="/")}return!1}};F($,"HEADER_NAME","Authorization"),F($,"HEADER_PREFIX","SPBearer "),F($,"TOKEN_EXP",20*1e3);var pe=$;Ee.interceptors.request.use(e=>(Ve.show({delay:5e3}),pe.requestHandleSid(e),e),e=>(Ve.hide(),console.log("Request Error =========="),Promise.reject(e)));Ee.interceptors.response.use(e=>(Ve.hide(),e.data.code!==200&&K.warning(e.data.message||os(e.data.code)),pe.responseHandleSid(e),e.data),e=>(Ve.hide(),e instanceof ss&&(e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?K.error("\u7F51\u7EDC\u9519\u8BEF"):e.code==="ERR_BAD_RESPONSE"&&K.error("\u670D\u52A1\u5668\u65E0\u54CD\u5E94")),console.log("Response Error =========="),Promise.reject(e)));var c={get(e,t,r){return Ee({method:"get",url:e,params:t,data:r})},post(e,t,r){return Ee({method:"post",url:e,params:t,data:r})},put(e,t,r){return Ee({method:"put",url:e,params:t,data:r})},delete(e,t,r){return Ee({method:"delete",url:e,params:t,data:r})}};var Dt={};bt(Dt,{admin:()=>is,gateway:()=>as,message:()=>ls,role:()=>cs,user:()=>ds});var is={registerAdmin:e=>c.post("/api/admin/registerAdmin",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode}).then(t=>t),registerUser:e=>c.post("/api/admin/registerUser",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),updateInfoByAdmin:e=>c.post("/api/admin/updateByAdmin",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),list:e=>c.get("/api/admin/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)},as={register:e=>c.post("/api/register",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),sendSms:e=>c.post("/api/sendSms",{phone:e.phone,imageCode:e.imageCode},null).then(t=>t),isLogin:()=>c.get("/api/isLogin",null,null).then(e=>e),login:e=>c.post("/api/login",null,{phone:e.phone,pwd:e.pwd,pwdSN:e.pwdSN,smsCode:e.smsCode}).then(t=>t),verifyPasswordHash:e=>c.post("/api/verifyPasswordHash",null,{passwordHash:e.passwordHash,passwordSalt:e.passwordSalt}).then(t=>t),logout:()=>c.get("/api/logout",null,null).then(e=>e),listPermissions:()=>c.get("/api/listPermissions",null,null).then(e=>e),listRolePermissions:e=>c.get("/api/listRolePermissions",{id:e.id},null).then(t=>t)},ls={list:e=>c.get("/api/user/message/list",{pageNum:e.pageNum,pageSize:e.pageSize,unread_only:e.unread_only},null).then(t=>t),countUnread:()=>c.get("/api/user/message/unread/count",null,null).then(e=>e),markRead:e=>c.post("/api/user/message/read",null,{messageIds:e.messageIds}).then(t=>t),clearReaded:e=>c.delete("/api/user/message/clearReaded",null,{messageIds:e.messageIds}).then(t=>t)},cs={listRoles:()=>c.get("/api/role/listRoles",null,null).then(e=>e),createRole:e=>c.post("/api/role/createRole",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),updateRole:e=>c.post("/api/role/updateRole",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),assignPermissionsToRole:e=>c.post("/api/role/assignPermissionsToRole",null,{role_id:e.role_id,permissions:e.permissions}).then(t=>t),assignRoleToUserPermission:()=>c.post("/api/role/assignRoleToUserPermission",null,null).then(e=>e),assignRoleToUser:e=>c.post("/api/role/assignRoleToUser",null,{user_id:e.user_id,role_ids:e.role_ids}).then(t=>t),listUserRoles:e=>c.get("/api/role/listUserRoles",{user_id:e.user_id},null).then(t=>t),listUserPermissions:e=>c.get("/api/role/listUserPermissions",{user_id:e.user_id},null).then(t=>t),listCompanies:()=>c.get("/api/role/listCompanies",null,null).then(e=>e),createCompany:e=>c.post("/api/role/createCompany",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),updateCompany:e=>c.post("/api/role/updateCompany",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),listDepartments:()=>c.get("/api/role/listDepartments",null,null).then(e=>e),createDepartment:e=>c.post("/api/role/createDepartment",{name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),updateDepartment:e=>c.post("/api/role/updateDepartment",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),assignUserToDepartment:e=>c.post("/api/role/assignUserToDepartment",{user_id:e.user_id,department_id:e.department_id,position:e.position},null).then(t=>t),removeUserFromDepartment:e=>c.post("/api/role/removeUserFromDepartment",{user_id:e.user_id,department_id:e.department_id},null).then(t=>t),listCompanyDepartments:e=>c.get("/api/role/listCompanyDepartments",{company_id:e.company_id},null).then(t=>t),listUserDepartments:e=>c.get("/api/role/listUserDepartments",{user_id:e.user_id},null).then(t=>t),listDepartmentUsers:e=>c.get("/api/role/listDepartmentUsers",{department_id:e.department_id},null).then(t=>t)},ds={getInfoByUsername:e=>c.get("/api/user/infoByUsername",{username:e.username},null).then(t=>t),getInfo:e=>c.get("/api/user/info",{id:e.id},null).then(t=>t),getAvatar:e=>c.get("/api/user/avatar",{id:e.id,tick:e.tick},null).then(t=>t),getAvatarList:e=>c.get("/api/user/avatar_list",{ids:e.ids},null).then(t=>t),updateAvatar:e=>c.post("/api/user/updateAvatar",null,{id:e.id,avatar:e.avatar,avatar_small:e.avatar_small,tick_self:e.tick_self}).then(t=>t),updateManager:e=>c.post("/api/user/updateManager",{id:e.id,managerid:e.managerid},null).then(t=>t),updateInfo:e=>c.post("/api/user/update",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),updatePassword:e=>c.post("/api/user/updatePassword",null,{old_password:e.old_password,old_password_sn:e.old_password_sn,new_password:e.new_password}).then(t=>t),deleteUser:e=>c.post("/api/user/delete",{id:e.id},null).then(t=>t),list:e=>c.get("/api/user/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),listByIds:e=>c.get("/api/user/list_by_ids",{ids:e.ids},null).then(t=>t),search:e=>c.get("/api/user/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),forbid:e=>c.post("/api/user/forbid",{id:e.id,forbid:e.forbid},null).then(t=>t)};var Et={};bt(Et,{contract:()=>ms,file:()=>us,fileversion:()=>ps,project:()=>gs,projectprogress:()=>fs});var ms={createContract:e=>c.post("/api/project/contract/create",null,{projectId:e.projectId,name:e.name,tag:e.tag,code:e.code,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs}).then(t=>t),deleteContract:e=>c.delete("/api/project/contract/delete",{id:e.id},null).then(t=>t),updateContract:e=>c.post("/api/project/contract/update",null,{id:e.id,name:e.name,code:e.code,tag:e.tag,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs,markdown:e.markdown}).then(t=>t),getContractDetail:e=>c.get("/api/project/contract/detail",{id:e.id},null).then(t=>t),getContractList:e=>c.get("/api/project/contract/list",{projectId:e.projectId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),submitApproval:e=>c.post("/api/project/contract/submit",{id:e.id,sealType:e.sealType},null).then(t=>t),cancelApproval:e=>c.post("/api/project/contract/cancelApproval",{id:e.id},null).then(t=>t),uploadVersion:e=>c.post("/api/project/contract/version/upload",null,{contractId:e.contractId,fileName:e.fileName,fileType:e.fileType,fileSize:e.fileSize,changeLog:e.changeLog}).then(t=>t),getVersionList:e=>c.get("/api/project/contract/version/list",{contractId:e.contractId},null).then(t=>t),deleteVersion:e=>c.delete("/api/project/contract/version/delete",{id:e.id},null).then(t=>t),renameVersion:e=>c.post("/api/project/contract/version/rename",null,{id:e.id,fileName:e.fileName}).then(t=>t),getVersionDetail:e=>c.get("/api/project/contract/version/detail",{id:e.id},null).then(t=>t),setVersionLayerOpinion:e=>c.post("/api/project/contract/version/layerOpinion",null,{contractId:e.contractId,version:e.version,opinion:e.opinion}).then(t=>t),getNewContractCode:e=>c.get("/api/project/contract/newCode",{contractCode:e.contractCode,sequenceLength:e.sequenceLength},null).then(t=>t),getContractHistoryParties:()=>c.get("/api/project/contract/historyParties",null,null).then(e=>e)},us={getDetail:e=>c.get("/api/project/files/detail",{fileId:e.fileId},null).then(t=>t),listFiles:e=>c.get("/api/project/files/list",{projectId:e.projectId},null).then(t=>t),searchFiles:e=>c.get("/api/project/files/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),addFile:(e,t)=>c.post("/api/project/files/add",{projectId:e.projectId},{fileName:t.fileName,filePath:t.filePath,isSecure:t.isSecure,descs:t.descs,fileType:t.fileType,fileSize:t.fileSize,crc32:t.crc32,fileResourcePath:t.fileResourcePath}).then(r=>r),removeFile:e=>c.post("/api/project/files/remove",{fileId:e.fileId},null).then(t=>t),moveFile:(e,t)=>c.post("/api/project/files/move",{projectId:e.projectId},{oldFileName:t.oldFileName,oldFilePath:t.oldFilePath,newFileName:t.newFileName,newFilePath:t.newFilePath}).then(r=>r),updateFileDescs:e=>c.post("/api/project/files/updateDescs",null,{fileId:e.fileId,descs:e.descs}).then(t=>t),copyFileToProject:e=>c.post("/api/project/files/copyToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),moveFileToProject:e=>c.post("/api/project/files/moveToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),updateFileDelta:e=>c.post("/api/project/files/updateDelta",null,{fileId:e.fileId,deltaData:e.deltaData,deltaSize:e.deltaSize,newFileSize:e.newFileSize,crc32:e.crc32,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),updateFile:e=>c.post("/api/project/files/updateData",null,{fileId:e.fileId,fileSize:e.fileSize,crc32:e.crc32,fileName:e.fileName,fileResourcePath:e.fileResourcePath,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),generateTempAccessToken:e=>c.post("/api/project/files/generateTempAccessToken",{fileId:e.fileId,expireSeconds:e.expireSeconds},null).then(t=>t),folderDownload:(e,t)=>c.post("/api/project/files/folderDownload",{projectId:e.projectId},{folderPath:t.folderPath,folderName:t.folderName}).then(r=>r),folderDownloadStatus:e=>c.get("/api/project/files/folderDownloadStatus",{jobId:e.jobId},null).then(t=>t),listFilesByTempAccessToken:e=>c.get("/api/project/files/listByTempAccessToken",{tempToken:e.tempToken},null).then(t=>t)},ps={listVersions:e=>c.get("/api/project/files/version/list",{fileId:e.fileId},null).then(t=>t),getVersionDetail:e=>c.get("/api/project/files/version/detail",{versionId:e.versionId},null).then(t=>t)},gs={enableUserPrivateProject:()=>c.post("/api/project/enablePrivateProject",null,null).then(e=>e),createProject:e=>c.post("/api/project/create",null,{name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate}).then(t=>t),updateProject:e=>c.post("/api/project/update",null,{id:e.id,name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,status:e.status,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate,createTime:e.createTime,updateTime:e.updateTime,createBy:e.createBy,updateBy:e.updateBy}).then(t=>t),updateUserdataOrder:e=>c.post("/api/project/updateUserdataOrder",null,{projectIds:e.projectIds}).then(t=>t),getUserdataOrder:()=>c.get("/api/project/userdataOrder",null,null).then(e=>e),getProjectDetail:e=>c.get("/api/project/detail",{id:e.id},null).then(t=>t),getProjectName:e=>c.get("/api/project/name",{projectId:e.projectId},null).then(t=>t),listProjects:e=>c.get("/api/project/list",{pageNum:e.pageNum,pageSize:e.pageSize,status:e.status,companyId:e.companyId,customerId:e.customerId,userId:e.userId},null).then(t=>t),listProjectsByManager:e=>c.get("/api/project/listByManager",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),changeStatus:e=>c.put("/api/project/status",{id:e.id,status:e.status},null).then(t=>t),getProjectMembers:e=>c.get("/api/project/members",{projectId:e.projectId},null).then(t=>t),getMemberRole:e=>c.get("/api/project/member/role",{projectId:e.projectId,userId:e.userId},null).then(t=>t),assignMember:e=>c.post("/api/project/members/assign",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t),removeMember:e=>c.post("/api/project/members/remove",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t)},fs={createProgress:e=>c.post("/api/project/progress/create",null,{projectId:e.projectId,descs:e.descs,commentCount:e.commentCount,progressTime:e.progressTime}).then(t=>t),updateProgress:e=>c.put("/api/project/progress/update",null,{id:e.id,descs:e.descs,progressTime:e.progressTime}).then(t=>t),deleteProgress:e=>c.delete("/api/project/progress/delete",{id:e.id},null).then(t=>t),getProgressList:e=>c.get("/api/project/progress/list",{projectId:e.projectId},null).then(t=>t),addComment:e=>c.post("/api/project/progress/comment/add",null,{progressId:e.progressId,comment:e.comment}).then(t=>t),deleteComment:e=>c.delete("/api/project/progress/comment/delete",{id:e.id},null).then(t=>t),updateComment:e=>c.put("/api/project/progress/comment/update",{id:e.id},{}).then(t=>t),getCommentList:e=>c.get("/api/project/progress/comment/list",{progressId:e.progressId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)};var ne={base:Ut,user:Dt,project:Et};var Se=1440*60*1e3,Ot=class extends Cr{constructor(){super("UserInfoDB");F(this,"userCache");this.version(1).stores({userCache:"id, timestamp"})}},jt=class extends Cr{constructor(){super("UserAvatarDB");F(this,"userCache");this.version(1).stores({userCache:"id, timestamp"})}},ce=new Ot,de=new jt,Ir=async e=>{try{let t=await de.userCache.get(e);if(t){if(Date.now()-t.timestamp<Se)return t.avatar;await de.userCache.delete(e)}return null}catch(t){return console.error("\u8BFB\u53D6\u7528\u6237\u5934\u50CF\u7F13\u5B58\u5931\u8D25:",t),null}},Mt=async e=>{try{let t=await ce.userCache.get(e);if(t){let r=Date.now(),n=await de.userCache.get(e);if(n?r-n.timestamp<Se?t.data.avatar=n.avatar:(t.data.avatar=void 0,await de.userCache.delete(e)):t.data.avatar=void 0,r-t.timestamp<Se)return t.data;await ce.userCache.delete(e)}return null}catch(t){return console.error("\u8BFB\u53D6\u7528\u6237\u7F13\u5B58\u5931\u8D25:",t),null}},ys=async(e,t)=>{try{t&&await de.userCache.put({id:e,avatar:t,timestamp:Date.now()})}catch(r){console.error("\u5199\u5165\u7528\u6237\u5934\u50CF\u7F13\u5B58\u5931\u8D25:",r)}},hs=async(e,t)=>{try{t.avatar&&await de.userCache.put({id:e,avatar:t.avatar,timestamp:Date.now()});let r=t.avatar;t.avatar=void 0,await ce.userCache.put({id:e,data:t,timestamp:Date.now()}),t.avatar=r}catch(r){console.error("\u5199\u5165\u7528\u6237\u7F13\u5B58\u5931\u8D25:",r)}},bs=async e=>{let t=new Map;try{let r=await ce.userCache.bulkGet(e),n=Date.now();for(let s=0;s<e.length;s++){let a=r[s];a&&n-a.timestamp<Se&&t.set(e[s],a.data)}let d=await de.userCache.bulkGet(e);for(let s=0;s<e.length;s++){let a=d[s];if(!a)continue;let o=t.get(a.id);o&&n-a.timestamp<Se&&(o.avatar=a.avatar)}}catch(r){console.error("\u6279\u91CF\u8BFB\u53D6\u7528\u6237\u7F13\u5B58\u5931\u8D25:",r)}return t},vr=async e=>{try{let t=e.map(n=>({id:n.id,data:n.data,timestamp:Date.now()})),r=e.map(n=>({id:n.id,avatar:n.data.avatar,timestamp:Date.now()}));r=r.filter(n=>n.avatar),await de.userCache.bulkPut(r),t.forEach(n=>{n.data.avatar=void 0}),await ce.userCache.bulkPut(t)}catch(t){console.error("\u6279\u91CF\u5199\u5165\u7528\u6237\u7F13\u5B58\u5931\u8D25:",t)}},vs=async()=>{let e=new Map;try{let t=Date.now(),r=await ce.userCache.toArray();for(let n of r)if(t-n.timestamp<Se){let d=await de.userCache.get(n.id);d&&t-d.timestamp<Se&&(n.data.avatar=d.avatar),e.set(n.id,n.data)}else await ce.userCache.delete(n.id)}catch(t){console.error("\u83B7\u53D6\u6240\u6709\u7F13\u5B58\u5931\u8D25:",t)}return e},Cs=async()=>{try{await ce.userCache.clear(),await de.userCache.clear()}catch(e){console.error("\u6E05\u9664\u7528\u6237\u7F13\u5B58\u5931\u8D25:",e)}},Rr=async({user_id:e,forceRefresh:t=!1,forceAvatar:r=!1})=>{let n={code:200,data:{user_id:e,isLogin:!0}},d=!1;if(!e)try{n=await ne.user.gateway.isLogin()}catch{d=!0}if(d){let s;try{let o=te.namespace("bp.ss").get("user");o&&(s=JSON.parse(o)?.id)}catch{}let a=e??s;if(a){let o=await Mt(a);if(o){let i=await xe({user_id:a,forceRefresh:!1,serverTick:o.tick_avatar_self});return i&&(o.avatar=i),o}}try{let o=te.namespace("bp.ss").get("user");if(o)return JSON.parse(o)}catch{}return null}if(n?.code===200&&n.data?.isLogin){let s=n.data?.user_id,a=n.data?.isAdmin||!1,o=await Mt(s);if(t||!o)try{let i=await ne.user.user.getInfo({id:s});if(i?.code==200){e||te.namespace("bp.ss").set("user",JSON.stringify(i.data));let l={...i.data};s&&await hs(s,l);try{let m=await xe({user_id:s,forceRefresh:r,serverTick:i.data?.tick_avatar_self});m&&(l.avatar=m)}catch{}return l}else return o||null}catch{if(o)return o;try{let l=te.namespace("bp.ss").get("user");if(l)return JSON.parse(l)}catch{}return null}try{let i=await xe({user_id:s,forceRefresh:r,serverTick:o.tick_avatar_self});i&&(o.avatar=i)}catch{}return o}else return pe.clearStoreToken(),null},xe=async({user_id:e,forceRefresh:t=!1,serverTick:r=Number.MAX_SAFE_INTEGER})=>{if(!e)return;let n=await Ir(e);if(t||!n){let d=n?.avatar_tick||-1;if(d<r)try{let s=await ne.user.user.getAvatar({id:e,tick:d});s?.code==200&&d!=s.data?.tick_self&&(n={avatar:At.string.isEmpty(s.data?.avatar)?void 0:s.data?.avatar,avatar_small:At.string.isEmpty(s.data?.avatar_small)?void 0:s.data?.avatar_small,avatar_tick:s.data?.tick_self||-1},await ys(e,n))}catch{}}return n||void 0},Is=async e=>(e=e||{forceRefresh:!1},await Rr(e)),Rs=()=>{let e=te.namespace("bp.ss").get("user");return e?JSON.parse(e):null},ws=async({userIds:e,keywords:t,forceRefresh:r=!1})=>{let n=new Map;if(!e){if(!r&&(!t||t.length===0)){let l=await vs();if(l.size>=100){let m=new Map,C=0;for(let[b,w]of l){if(C>=100)break;let _=await xe({user_id:b,forceRefresh:!1,serverTick:w.tick_avatar_self});w.avatar=_,m.set(b,w),C++}return m}return l}let a;if(t&&t.length>0){if(a=await ne.user.user.search({pageNum:1,pageSize:100,keyword:t}),a?.code!==200)return n}else if(a=await ne.user.user.list({pageNum:1,pageSize:100}),a?.code!==200)return n;let o=a.data?.list||[],i=[];for(let l of o){let m={...l};n.set(l.id,m),i.push({id:l.id,data:m})}i.length>0&&await vr(i);for(let l=0;l<i.length;l++){let m=await xe({user_id:i[l].id,serverTick:i[l].data.tick_avatar_self});i[l].data.avatar=m}return n}if(e.length==0)return n;let d=[...new Set(e)];r||(await bs(d)).forEach((o,i)=>{n.set(i,o)});let s=d.filter(a=>!n.has(a));if(s.length===0)return n;try{let a=await ne.user.user.listByIds({ids:JSON.stringify(s)});if(a?.code!=200)return n;let o=a.data?.list||[];if(o.length>0){let l=[];for(let m of o){let C={...m};l.push({id:m.id,data:C})}await vr(l)}let i=[];if(o.length>0)for(let l of o){let m=await xe({user_id:l.id,serverTick:l.tick_avatar_self||-1});i.push({id:l.id,avatar_small:m?.avatar_small||"",avatar_tick:l.tick_avatar_self||-1})}for(let l of o){let m=i.find(b=>b.id==l.id),C={...l,avatar:{avatar:"",avatar_small:m?.avatar_small||"",avatar_tick:m?.avatar_tick||-1}};n.set(l.id,C)}}catch(a){console.error("\u6279\u91CF\u83B7\u53D6\u7528\u6237\u4FE1\u606F\u5931\u8D25:",a)}return n},Ts=async e=>{e?await ce.userCache.delete(e):await Cs()},Ps=async()=>{try{let e=await ce.userCache.toArray();if(e.length===0)return{count:0,oldest:null,newest:null};let t=e.map(r=>r.timestamp);return{count:e.length,oldest:Math.min(...t),newest:Math.max(...t)}}catch(e){return console.error("\u83B7\u53D6\u7F13\u5B58\u7EDF\u8BA1\u5931\u8D25:",e),{count:0,oldest:null,newest:null}}},pt={getFromCache:Mt,getAvatarFromCache:Ir,getUserInfo:Rr,getUserAvatar:xe,current:Is,currentLocalUser:Rs,getUserInfos:ws,clearUserCache:Ts,getCacheStats:Ps};import{Fragment as Ft,jsx as U,jsxs as se}from"react/jsx-runtime";var Ba=({commentList:e,showTitle:t,showTimePicker:r,onDeleteComment:n,onLoadSubComments:d,commentListMap:s,onSaveComment:a,onSaveSubComment:o})=>{let[i,l]=Ie.useState(window.innerWidth<768),[m,C]=Ie.useState(new Map),[b,w]=Ie.useState(!1),[_,A]=Ie.useState(null),[P]=_e.useForm(),[O,N]=Ie.useState(!1),[I,R]=Ie.useState(null),[T]=_e.useForm(),D=Ie.useMemo(()=>{let v=new Set;return e.forEach(S=>{S.createBy&&v.add(S.createBy),s[S.id]?.comments.forEach(G=>{G.createBy&&v.add(G.createBy)})}),Array.from(v)},[e,s]);Ie.useEffect(()=>{if(D.length===0)return;let v=!0;return pt.getUserInfos({userIds:D}).then(S=>{v&&C(G=>new Map([...G,...S]))}).catch(S=>{console.error("\u52A0\u8F7D\u8BC4\u8BBA\u7528\u6237\u4FE1\u606F\u5931\u8D25:",S)}),()=>{v=!1}},[D]),hr(()=>{l(!0)},()=>{l(!1)},768);let j=async v=>{A(v),P.resetFields(),w(!0)},x=v=>{v?(R(v),T.setFieldsValue({descs:v.descs,progressTime2:xr(v.progressTime)})):(R(null),T.resetFields(),T.setFieldsValue({progressTime2:xr()})),N(!0)},B=async()=>{try{if(!_)return;let v=await P.validateFields();if(!v)return;await o?.({commentId:_.id,comment:v.comment})&&(K.success("\u56DE\u590D\u5DF2\u63D0\u4EA4"),w(!1),d?.(_.id))}catch(v){console.error(v),K.error("\u63D0\u4EA4\u56DE\u590D\u5931\u8D25")}},W=async()=>{try{let v=await T.validateFields();I?(await a?.({commentItem:I,comment:v.descs,time:v.progressTime2.toDate()}),K.success("\u66F4\u65B0\u6210\u529F")):(await a?.({commentItem:null,comment:v.descs,time:v.progressTime2.toDate()}),K.success("\u65B0\u589E\u6210\u529F")),N(!1),R(null)}catch(v){console.error(v),K.error("\u4FDD\u5B58\u5931\u8D25")}};return se(Ft,{children:[U("div",{className:"flex justify-end items-center mb-5 ml-4",children:U(gt,{type:"primary",onClick:()=>x(),className:"px-4 py-2 btn-primary flex items-center",children:"\u65B0\u589E"})}),e.length?U(xs,{mode:"left",className:"ml-5 md:pr-[200px]",items:e.map(v=>({key:v.id,color:"blue",label:i&&t?null:Je(new Date(v.progressTime)),style:{paddingBottom:"5px"},children:se(Ft,{children:[i&&t&&U("div",{className:"mt-2 mb-1 font-bold",children:Je(new Date(v.progressTime))}),se("div",{className:"rounded border border-gray-100 bg-gray-50 p-2",children:[se("div",{className:"flex justify-between items-start mb-2 ",children:[se("div",{className:"flex items-center space-x-2",children:[U(wr,{src:m.get(v.createBy)?.avatar?.avatar_small||null,size:40,children:m.get(v.createBy)?.nickname?.[0]}),se("div",{children:[U("div",{className:"",children:m.get(v.createBy)?.nickname}),U("div",{className:"text-xs font-thin",children:Je(new Date(v.updateTime))})]})]}),U("div",{className:"mt-4 flex justify-end absolute right-1 top-1",children:U(Ss,{menu:{items:[{key:"edit",icon:U(Ns,{}),label:"\u7F16\u8F91",onClick:S=>{x?.(v),S.domEvent.stopPropagation()}},{key:"delete",icon:U(Us,{}),label:"\u5220\u9664",danger:!0,onClick:S=>{n?.(v.id),S.domEvent.stopPropagation()}}]},trigger:["click"],children:U(gt,{type:"text",icon:U(ks,{}),onClick:S=>S.stopPropagation()})})})]}),U("div",{className:"whitespace-pre-wrap ml-2",style:{whiteSpace:"pre-wrap"},children:v.descs}),se("div",{className:"flex items-center space-x-1 mt-1",children:[U(gt,{type:"text",icon:U(Ds,{}),className:"font-thin text-xs",size:"small",style:{color:"#666"},onClick:()=>j(v),children:"\u56DE\u590D"}),se(gt,{type:"text",size:"small",style:{color:"#666"},className:"font-thin text-xs",onClick:()=>d?.(v.id),children:[s[v.id]&&s[v.id].expanded?"\u6536\u8D77":"\u5C55\u5F00"+v.commentCount+"\u6761","\u56DE\u590D"]})]})]}),U("div",{className:"border-l border-gray-200 pl-3",children:s[v.id]&&s[v.id].expanded&&s[v.id].comments.length>0?s[v.id].comments.map(S=>U("div",{className:"p-1 text-sm",children:U("div",{className:"flex items-center space-y-2 mb-1 mt-1",children:se("div",{className:"flex items-center space-x-2",children:[U(wr,{src:m.get(S.createBy)?.avatar?.avatar_small||null,size:40,className:"self-start",children:m.get(S.createBy)?.nickname?.[0]}),se("div",{children:[U("div",{className:"text-gray-600 text-xs",children:m.get(S.createBy)?.nickname}),U("div",{className:"text-gray-700",children:S.comment}),U("div",{className:"text-xs mt-1 font-thin",children:Je(new Date(S.createTime))})]})]})})},S.id)):U(Ft,{})})]})}))}):yr(),U(Tr,{open:b,onCancel:()=>{A(null),w(!1)},className:"ant-modal-nofull",onOk:B,okText:"\u63D0\u4EA4",cancelText:"\u53D6\u6D88",children:U(_e,{form:P,layout:"horizontal",className:"mt-6",children:U(_e.Item,{name:"comment",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56DE\u590D\u5185\u5BB9"}],children:U(Pr.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u590D"})})})}),U(Tr,{title:I?"\u7F16\u8F91":"\u65B0\u589E",open:O,className:"ant-modal-nofull",onCancel:()=>{N(!1),R(null)},onOk:W,okText:"\u4FDD\u5B58",cancelText:"\u53D6\u6D88",children:se(_e,{form:T,layout:"horizontal",children:[r&&U(_e.Item,{name:"progressTime2",label:"\u65F6\u95F4",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u65F6\u95F4"}],children:U(_s,{showTime:!0,style:{width:"100%"}})}),U(_e.Item,{name:"descs",label:"\u5185\u5BB9",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9"}],children:U(Pr.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"})})]})})]})};import{useEffect as Qe,useState as Ae,useCallback as Re,useRef as zt,useMemo as Sr}from"react";import{Select as Es,Spin as As,message as Os,Popover as Ht,Card as js,Typography as Ms,Space as Fs}from"antd";import{debounce as Bs}from"lodash-es";import Ls from"react-dom/client";var Bt=class{constructor(){F(this,"cache",new Map);F(this,"defaultExpireTime",300*1e3)}set(t,r,n=this.defaultExpireTime){this.cache.set(t,{data:r,timestamp:Date.now(),expireTime:n})}get(t){let r=this.cache.get(t);return r?Date.now()-r.timestamp>r.expireTime?(this.cache.delete(t),null):r.data:null}clear(){this.cache.clear()}},Lt=new Bt;import{jsx as z,jsxs as _r}from"react/jsx-runtime";var{Text:Za}=Ms,zs=({multiple:e=!1,allowClear:t=!0,timeout:r=1e4,retryCount:n=3,enableCache:d=!0,excludeProjectIds:s=[],cacheExpireTime:a,value:o,onChange:i,...l})=>{let[m,C]=Ae(!1),[b,w]=Ae([]),[_,A]=Ae(""),[P,O]=Ae(1),[N,I]=Ae(!0),[R,T]=Ae([]),D=zt(null),j=zt([]),x=zt([]);Qe(()=>{j.current=b},[b]),Qe(()=>{x.current=R},[R]);let B=Re(p=>p.map(y=>{let h=j.current.find(u=>u.id===y);return h||x.current.find(u=>u.id===y)}).filter(y=>y!==void 0),[]),W=Re(p=>{if(!p){T([]),i?.([],[]);return}let y=e?Array.isArray(p)?p:[p]:typeof p=="string"?[p]:[];if(y.length===0){T([]),i?.([],[]);return}let h=B(y);T(h),i?.(y,h)},[B,i,e]);Qe(()=>{if(!o||o.length==0){T([]);return}let p=e?Array.isArray(o)?o:[]:typeof o=="string"?[o]:[],y=B(p);T(y)},[o,B,e]);let v=Re(async(p,y=n)=>{try{D.current=new AbortController;let h=D.current.signal,u=new Promise((g,E)=>{setTimeout(()=>{E(new Error("\u8BF7\u6C42\u8D85\u65F6")),D.current?.abort()},r)});return await Promise.race([p(),u])}catch(h){if(y>0&&!(h instanceof Error&&h.name==="AbortError"))return await new Promise(u=>setTimeout(u,1e3)),v(p,y-1);throw h}},[r,n]),S=Re(async(p,y=!1)=>{try{C(!0);let h=`projects_${p}`;if(d&&!p){let f=Lt.get(h);if(f){w(g=>y?[...g,...f]:f),I(!1);return}}let u=await v(async()=>{let f=await ne.project.project.listProjects({pageNum:P,pageSize:1e3});return f.code===200&&f.data?{...f,data:f.data.list.map(g=>({id:g.id,name:g.name,descs:g.descs}))}:f});if(u.code===200&&u.data){let f=u.data.filter(g=>!s.includes(g.id));d&&!p&&Lt.set(h,f,a),w(g=>y?[...g,...f]:f),I(!1)}}catch(h){console.error("\u83B7\u53D6\u9879\u76EE\u5217\u8868\u5931\u8D25:",h),Os.error("\u83B7\u53D6\u9879\u76EE\u5217\u8868\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{C(!1)}},[s,v,P,d,a]);Qe(()=>()=>{D.current?.abort()},[]);let G=Sr(()=>Bs(p=>{A(p),O(1),S(p,!1)},300),[S]),Q=Re(p=>{let{target:y}=p;if(!y)return;let{scrollTop:h,scrollHeight:u,clientHeight:f}=y;if(u-h<=f*1.5&&!m&&N){let g=P+1;O(g),S(_,!0)}},[m,N,P,_,S]);Qe(()=>{S("",!1)},[S]);let X=p=>z(js,{size:"small",style:{width:280},children:z(Fs,{direction:"vertical",size:"small",style:{width:"100%"},children:z("div",{style:{display:"flex",alignItems:"center",gap:8},children:z("div",{children:z("div",{style:{fontWeight:"bold"},children:p.name})})})})}),fe=p=>{let y=[];return y.push(z("span",{style:{verticalAlign:"middle",lineHeight:"20px"},children:p.name},"name")),z("div",{style:{display:"flex",alignItems:"center",minHeight:"24px"},children:y})},ye=Sr(()=>b.map(p=>({key:p.id,label:fe(p),value:p.id,user:p})),[b]),oe=Re(p=>{let{value:y,closable:h,onClose:u}=p,f=b.find(g=>g.id===y)||R.find(g=>g.id===y);return f?z(Ht,{content:X(f),trigger:"click",placement:"right",children:_r("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"2px 8px",background:"rgb(var(--color-gray-100))",borderRadius:4,margin:"2px 4px",border:"1px solid rgb(var(--color-border))"},children:[z("span",{style:{marginRight:8},children:f.name}),h&&z("span",{onClick:u,style:{cursor:"pointer",color:"rgb(var(--color-gray-400))",fontSize:12,padding:"0 4px"},children:"\xD7"})]})}):z("div",{children:y})},[b,R]),he=Re(p=>{let y=b.find(h=>h.id===p)||R.find(h=>h.id===p);return y?z(Ht,{content:X(y),trigger:"click",placement:"right",children:z("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",height:"100%"},children:z("span",{children:y.name})})}):z("div",{children:p})},[b,R]),me=Re(p=>{if(!p)return null;let y=Array.isArray(p)?p[0]:p;return b.find(h=>h.id===y)||R.find(h=>h.id===y)},[b,R]);return z(Es,{...l,mode:e?"multiple":void 0,showSearch:!0,loading:m,filterOption:!1,onSearch:G,onPopupScroll:Q,notFoundContent:m?z(As,{size:"small"}):null,allowClear:t,value:e||typeof o=="string"?o:o?.toString(),onChange:W,options:ye,style:{...l.style,minHeight:"32px"},tagRender:e?oe:void 0,fieldNames:{label:"label",value:"value"},popupRender:e?void 0:p=>{let y=me(o);return y?_r("div",{children:[z("div",{style:{padding:"8px 12px",borderBottom:"1px solid rgb(var(--color-border))",cursor:"pointer"},children:he(y.id)}),p]}):p},suffixIcon:e?void 0:o?z("div",{onClick:p=>{p.stopPropagation();let y=me(o);if(y){let h=document.createElement("div");document.body.appendChild(h);let u=Ls.createRoot(h);u.render(z(Ht,{content:X(y),trigger:"click",placement:"right",open:!0,onOpenChange:f=>{f||(u.unmount(),document.body.removeChild(h))},children:z("div",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%"}})}))}},style:{cursor:"pointer",padding:"0 8px",height:"100%",display:"flex",alignItems:"center"},children:z("span",{className:"ant-select-arrow"})}):z("span",{className:"ant-select-arrow"})})},Hs=zs;import{useEffect as Ze,useState as Oe,useCallback as we,useRef as Xt,useMemo as Ur}from"react";import{Select as Zs,Spin as eo,message as to,Popover as Gt,Card as ro,Typography as no,Space as so}from"antd";import{debounce as oo}from"lodash-es";import io from"react-dom/client";import Ws from"dexie";var Vs=3600*1e3,Wt=class extends Ws{constructor(){super("RoleInfoDB");F(this,"roleCache");this.version(1).stores({roleCache:"id, timestamp"})}},Ye=new Wt,qs=async()=>{try{let e=await Ye.roleCache.get("ROLE_ALL");if(e){if(Date.now()-e.timestamp<Vs)return e.data;await Ye.roleCache.delete("ROLE_ALL")}return null}catch(e){return console.error("\u8BFB\u53D6\u89D2\u8272\u7F13\u5B58\u5931\u8D25:",e),null}},$s=async e=>{try{await Ye.roleCache.put({id:"ROLE_ALL",data:e,timestamp:Date.now()})}catch(t){console.error("\u5199\u5165\u89D2\u8272\u7F13\u5B58\u5931\u8D25:",t)}},Xs=async()=>{try{await Ye.roleCache.clear()}catch(e){console.error("\u6E05\u9664\u89D2\u8272\u7F13\u5B58\u5931\u8D25:",e)}},qt=async({forceRefresh:e=!1})=>{if(!e){let n=await qs();if(n)return n}let t=await ne.user.role.listRoles();if(t?.code!==200)return null;let r=t.data||[];return await $s(r),r},kr=async({roleId:e,forceRefresh:t=!1})=>{let r=await qt({forceRefresh:t});return r&&r.find(n=>n.id===e)||null},Gs=async({roleId:e,forceRefresh:t=!1})=>(await kr({roleId:e,forceRefresh:t}))?.name||"",Vt=async({forceRefresh:e=!1}={})=>{let t=await qt({forceRefresh:e}),r={};return(t||[]).forEach(n=>{r[n.id]=n.name}),r},Js=async({roleIds:e})=>{let t=await Vt();return(e||[]).filter(n=>!!n&&!t[n]).length>0&&(t=await Vt({forceRefresh:!0})),t},Ks=async()=>{await Xs()},Qs=async()=>{try{let e=await Ye.roleCache.toArray();if(e.length===0)return{count:0,oldest:null,newest:null};let t=e.map(r=>r.timestamp);return{count:e.length,oldest:Math.min(...t),newest:Math.max(...t)}}catch(e){return console.error("\u83B7\u53D6\u7F13\u5B58\u7EDF\u8BA1\u5931\u8D25:",e),{count:0,oldest:null,newest:null}}},Nr={getRoleList:qt,getRoleById:kr,getRoleNameById:Gs,getRoleNameMap:Vt,getRoleNameMapForIds:Js,clearRoleCache:Ks,getCacheStats:Qs};var $t=class{constructor(){F(this,"cache",new Map);F(this,"defaultExpireTime",300*1e3)}set(t,r,n=this.defaultExpireTime){this.cache.set(t,{data:r,timestamp:Date.now(),expireTime:n})}get(t){let r=this.cache.get(t);return r?Date.now()-r.timestamp>r.expireTime?(this.cache.delete(t),null):r.data:null}clear(){this.cache.clear()}},ft=new $t;function Ys(){ft.clear()}import{jsx as H,jsxs as Dr}from"react/jsx-runtime";var{Text:bl}=no,ao=({multiple:e=!1,allowClear:t=!0,timeout:r=1e4,retryCount:n=3,enableCache:d=!0,excludeRoleIds:s=[],cacheExpireTime:a,value:o,onChange:i,...l})=>{let[m,C]=Oe(!1),[b,w]=Oe([]),[_,A]=Oe(""),[P,O]=Oe(1),[N,I]=Oe(!0),[R,T]=Oe([]),D=Xt(null),j=Xt([]),x=Xt([]);Ze(()=>{j.current=b},[b]),Ze(()=>{x.current=R},[R]);let B=we(p=>p.map(y=>{let h=j.current.find(u=>u.id===y);return h||x.current.find(u=>u.id===y)}).filter(y=>y!==void 0),[]),W=we(p=>{if(!p){T([]),i?.([],[]);return}let y=e?Array.isArray(p)?p:[p]:typeof p=="string"?[p]:p;if(y.length===0){T([]),i?.([],[]);return}let h=B(y);T(h),i?.(y,h)},[B,i,e]);Ze(()=>{if(!o||o.length==0){T([]);return}let p=e?Array.isArray(o)?o:[]:typeof o=="string"?[o]:[],y=B(p);if(R.length==y.length){let h=0;for(h=0;h<y.length&&!R.find(u=>u.id==y[h].id?u:null);h++);if(h<y.length)return}T(y)},[o,B,e]);let v=we(async(p,y=n)=>{try{D.current=new AbortController;let h=D.current.signal,u=new Promise((g,E)=>{setTimeout(()=>{E(new Error("\u8BF7\u6C42\u8D85\u65F6")),D.current?.abort()},r)});return await Promise.race([p(),u])}catch(h){if(y>0&&!(h instanceof Error&&h.name==="AbortError"))return await new Promise(u=>setTimeout(u,1e3)),v(p,y-1);throw h}},[r,n]),S=we(async(p,y=!1)=>{try{C(!0);let h=`roles_${p}`;if(d&&!p){let g=ft.get(h);if(g){w(E=>y?[...E,...g]:g),I(!1);return}}let f=(await v(async()=>await Nr.getRoleList({forceRefresh:!0})||[])).filter(g=>!s.includes(g.id));d&&!p&&ft.set(h,f,a),w(g=>y?[...g,...f]:f),I(!1)}catch(h){console.error("\u83B7\u53D6\u89D2\u8272\u5217\u8868\u5931\u8D25:",h),to.error("\u83B7\u53D6\u89D2\u8272\u5217\u8868\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{C(!1)}},[s,v,d,a]);Ze(()=>()=>{D.current?.abort()},[]);let G=Ur(()=>oo(p=>{A(p),O(1),S(p,!1)},300),[S]),Q=we(p=>{let{target:y}=p;if(!y)return;let{scrollTop:h,scrollHeight:u,clientHeight:f}=y;if(u-h<=f*1.5&&!m&&N){let g=P+1;O(g),S(_,!0)}},[m,N,P,_,S]);Ze(()=>{S("",!1)},[S]);let X=p=>H(ro,{size:"small",style:{width:280},children:H(so,{direction:"vertical",size:"small",style:{width:"100%"},children:H("div",{style:{display:"flex",alignItems:"center",gap:8},children:H("div",{children:H("div",{style:{fontWeight:"bold"},children:p.name})})})})}),fe=p=>{let y=[];return y.push(H("span",{style:{verticalAlign:"middle",lineHeight:"20px"},children:p.name},"name")),H("div",{style:{display:"flex",alignItems:"center",minHeight:"24px"},children:y})},ye=Ur(()=>b.map(p=>({label:fe(p),value:p.id,user:p})),[b]),oe=we(p=>{let{value:y,closable:h,onClose:u}=p,f=b.find(g=>g.id===y)||R.find(g=>g.id===y);return f?H(Gt,{content:X(f),trigger:"click",placement:"right",children:Dr("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"2px 8px",background:"rgb(var(--color-gray-100))",borderRadius:4,margin:"2px 4px",border:"1px solid rgb(var(--color-border))"},children:[H("span",{style:{marginRight:8},children:f.name}),h&&H("span",{onClick:u,style:{cursor:"pointer",color:"rgb(var(--color-gray-400))",fontSize:12,padding:"0 4px"},children:"\xD7"})]})}):H("div",{children:y})},[b,R]),he=we(p=>{let y=b.find(h=>h.id===p)||R.find(h=>h.id===p);return y?H(Gt,{content:X(y),trigger:"click",placement:"right",children:H("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",height:"100%"},children:H("span",{children:y.name})})}):H("div",{children:p})},[b,R]),me=we(p=>{if(!p)return null;let y=Array.isArray(p)?p[0]:p;return b.find(h=>h.id===y)||R.find(h=>h.id===y)},[b,R]);return H(Zs,{...l,mode:e?"multiple":void 0,showSearch:!0,loading:m,filterOption:!1,onSearch:G,onPopupScroll:Q,notFoundContent:m?H(eo,{size:"small"}):null,allowClear:t,value:e||typeof o=="string"?o:o?.toString(),onChange:W,options:ye,style:{...l.style,minHeight:"32px"},tagRender:e?oe:void 0,fieldNames:{label:"label",value:"value"},popupRender:e?void 0:p=>{let y=me(o);return y?Dr("div",{children:[H("div",{style:{padding:"8px 12px",borderBottom:"1px solid rgb(var(--color-border))",cursor:"pointer"},children:he(y.id)}),p]}):p},suffixIcon:e?void 0:o?H("div",{onClick:p=>{p.stopPropagation();let y=me(o);if(y){let h=document.createElement("div");document.body.appendChild(h);let u=io.createRoot(h);u.render(H(Gt,{content:X(y),trigger:"click",placement:"right",open:!0,onOpenChange:f=>{f||(u.unmount(),document.body.removeChild(h))},children:H("div",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%"}})}))}},style:{cursor:"pointer",padding:"0 8px",height:"100%",display:"flex",alignItems:"center"},children:H("span",{className:"ant-select-arrow"})}):H("span",{className:"ant-select-arrow"})})},lo=ao;import{useEffect as je,useState as Me,useCallback as ke,useRef as Jt,useMemo as Kt}from"react";import{Select as co,Avatar as yt,Spin as mo,message as uo,Popover as Qt,Card as po,Typography as go,Space as fo}from"antd";import{debounce as yo}from"lodash-es";import ho from"react-dom/client";import{jsx as M,jsxs as ge}from"react/jsx-runtime";var{Text:et}=go,bo=({multiple:e=!1,userType:t="all",excludeUserIds:r=[],showAvatar:n=!0,showUsername:d=!0,showNickname:s=!0,showPhone:a=!0,searchFields:o=["username","nickname","phone"],pageSize:i=10,allowClear:l=!0,value:m,initialUsers:C,onChange:b,...w})=>{let[_,A]=Me(!1),[P,O]=Me([]),[N,I]=Me(""),[R,T]=Me(1),[D,j]=Me(!0),[x,B]=Me([]),W=Jt([]),v=Jt([]),S=Jt([]),G=ke(u=>W.current.find(f=>f.id===u)||v.current.find(f=>f.id===u)||(S.current||[]).find(f=>f.id===u),[]);je(()=>{S.current=C||[]},[C]);let Q=ke(async u=>{try{A(!0);let f=await pt.getUserInfos({keywords:u||"",forceRefresh:!1}),g=Array.from(f.values());g=g.filter(k=>k.username!=="admin"),t==="admin"?g=g.filter(k=>k.isAdmin):t==="user"&&(g=g.filter(k=>!k.isAdmin)),u&&(g=g.filter(k=>o.some(J=>{let Yt=k[J];return Yt&&Yt.toLowerCase().includes(u.toLowerCase())}))),r.length>0&&(g=g.filter(k=>!r.includes(k.id))),g.sort((k,J)=>(k.username||"").localeCompare(J.username||""));let E=g;O(k=>[...k,...E]),j(!1)}catch(f){console.error("\u83B7\u53D6\u4EBA\u5458\u5217\u8868\u5931\u8D25:",f),uo.error("\u83B7\u53D6\u4EBA\u5458\u5217\u8868\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{A(!1)}},[t,r,o]);je(()=>{Q(null)},[Q]),je(()=>{W.current=P},[P]),je(()=>{v.current=x},[x]);let X=ke(u=>{if(!u||u.length==0){B([]),b?.([],[]);return}let f=Array.isArray(u)?u:[u],g=[];for(let E=0;E<f.length;E++){let k=f[E],J=G(k);J?g.push(J):g.push({id:k,username:k,nickname:"",phone:"",avatar:{avatar_small:""}})}if(x.length==g.length){let E=0;for(E=0;E<g.length&&!x.find(k=>k.id==g[E].id?k:null);E++);if(E<g.length)return}B(g.slice()),b?.(f,g)},[b,x]);je(()=>{if(!m||m.length==0){if(!x||x.length==0)return;B([]);return}m.sort();let u=[];x&&(u=x.map(f=>f.id),u.sort()),m.join(",")!=u.join(",")&&X(m)},[m,e,X,x]),je(()=>{if(!m||m.length==0)return;let f=m.map(g=>{let E=G(g);return E||{id:g,username:g,nickname:"",phone:"",type:null}}).filter(g=>g!==void 0);B(g=>g.length!==f.length||g.some((E,k)=>E.id!==f[k]?.id||E.username!==f[k]?.username)?f:g)},[P,m,C,G]);let fe=Kt(()=>yo(u=>{I(u),T(1),Q(u)},300),[Q]),ye=ke(u=>{let{target:f}=u;if(!f)return;let{scrollTop:g,scrollHeight:E,clientHeight:k}=f;if(E-g<=k*1.5&&!_&&D){let J=R+1;T(J),Q(N)}},[_,D,R,N,Q]),oe=u=>M(po,{size:"small",style:{width:280},children:ge(fo,{direction:"vertical",size:"small",style:{width:"100%"},children:[ge("div",{style:{display:"flex",alignItems:"center",gap:8},children:[M(yt,{src:u?.avatar?.avatar_small,size:40,children:u.nickname?.[0]||u.username?.[0]}),ge("div",{children:[M("div",{style:{fontWeight:"bold"},children:u.nickname||u.username}),u.title&&M(et,{type:"secondary",style:{fontSize:12},children:u.title})]})]}),u.phone&&ge("div",{children:[M(et,{type:"secondary",style:{fontSize:12},children:"\u624B\u673A\u53F7\uFF1A"}),M(et,{style:{fontSize:12},children:u.phone})]}),u.departmentInfo?.department_names&&ge("div",{children:[M(et,{type:"secondary",style:{fontSize:12},children:"\u6240\u5C5E\u90E8\u95E8\uFF1A"}),M(et,{style:{fontSize:12},children:u.departmentInfo?.department_names.join("\u3001")})]})]})}),he=Kt(()=>u=>{let f=[];return n&&f.push(M(yt,{src:u?.avatar?.avatar_small,size:20,style:{marginRight:8,verticalAlign:"middle",flexShrink:0},children:u.nickname?.[0]||u.username?.[0]},"avatar")),s&&u.nickname&&f.push(M("span",{style:{verticalAlign:"middle",lineHeight:"20px"},children:u.nickname},"nickname")),d&&f.push(ge("span",{style:{marginLeft:8,color:"rgb(var(--color-gray-400))",verticalAlign:"middle",lineHeight:"20px"},children:["(",u.username,")"]},"username")),a&&u.phone&&f.push(M("span",{style:{marginLeft:8,color:"rgb(var(--color-gray-400))",verticalAlign:"middle",lineHeight:"20px"},children:u.phone},"phone")),M("div",{style:{display:"flex",alignItems:"center",minHeight:"24px"},children:f})},[n,d,s,a]),me=Kt(()=>[...P,...x].filter((g,E,k)=>k.findIndex(J=>J.id===g.id)===E).map(g=>({label:he(g),value:g.id,user:g})),[P,x,he]),p=ke(u=>{let{value:f,closable:g,onClose:E}=u,k=P.find(J=>J.id===f)||x.find(J=>J.id===f)||(C||[]).find(J=>J.id===f);return k?M(Qt,{content:oe(k),trigger:"click",placement:"right",children:ge("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"2px 8px",background:"rgb(var(--color-gray-100))",borderRadius:4,margin:"2px 4px",border:"1px solid rgb(var(--color-border))"},children:[M(yt,{src:k?.avatar?.avatar_small,size:20,style:{marginRight:8},children:k.nickname?.[0]||k.username?.[0]}),M("span",{style:{marginRight:8},children:k.nickname||k.username}),g&&M("span",{onClick:E,style:{cursor:"pointer",color:"rgb(var(--color-gray-400))",fontSize:12,padding:"0 4px"},children:"\xD7"})]})}):M("div",{children:f})},[P,x,C]),y=ke(u=>{let f=P.find(g=>g.id===u)||x.find(g=>g.id===u)||(C||[]).find(g=>g.id===u);return f?M(Qt,{content:oe(f),trigger:"click",placement:"right",children:ge("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",height:"100%"},children:[M(yt,{src:f?.avatar?.avatar_small,size:20,style:{marginRight:8},children:f.nickname?.[0]||f.username?.[0]}),M("span",{children:f.nickname||f.username})]})}):M("div",{children:u})},[P,x,C]),h=ke(u=>{if(!u||u.length==0)return null;let f=u[0];return P.find(g=>g.id===f)||x.find(g=>g.id===f)||(C||[]).find(g=>g.id===f)},[P,x,C]);return M(co,{...w,mode:e?"multiple":void 0,showSearch:!0,loading:_,filterOption:!1,onSearch:fe,onPopupScroll:ye,notFoundContent:_?M(mo,{size:"small"}):null,allowClear:l,value:m,onChange:X,options:me,style:{...w.style,minHeight:"32px"},tagRender:e?p:void 0,fieldNames:{label:"label",value:"value"},popupRender:e?void 0:u=>{let f=h(m);return f?ge("div",{children:[M("div",{style:{padding:"8px 12px",borderBottom:"1px solid rgb(var(--color-border))",cursor:"pointer"},children:y(f.id)}),u]}):u},suffixIcon:e?void 0:m?M("div",{onClick:u=>{u.stopPropagation();let f=h(m);if(f){let g=document.createElement("div");document.body.appendChild(g);let E=ho.createRoot(g);E.render(M(Qt,{content:oe(f),trigger:"click",placement:"right",open:!0,onOpenChange:k=>{k||(E.unmount(),document.body.removeChild(g))},children:M("div",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%"}})}))}},style:{cursor:"pointer",padding:"0 8px",height:"100%",display:"flex",alignItems:"center"},children:M("span",{className:"ant-select-arrow"})}):M("span",{className:"ant-select-arrow"})})},vo=bo;import{useEffect as Co,useRef as Io,useState as Or}from"react";import{Upload as Ar,Button as rt,Modal as Ro,Image as wo,Space as To,message as Po,Progress as xo}from"antd";import{UploadOutlined as So,DownloadOutlined as jr,EyeOutlined as _o,FilePdfFilled as ko,FileExcelFilled as No,FileWordFilled as Uo,FileTextFilled as Do,FileUnknownFilled as Eo}from"@ant-design/icons";import*as Fe from"febs-browser";function Er(e,t,r){r.method=r.method||"POST",r.headers=r.headers||{},r.timeout=r.timeout||5e3,r.withCredentials=r.withCredentials||!0,r.crossDomain=r.crossDomain||!0,r.sliceOffset=r.sliceOffset||0,r.sliceLength=r.sliceLength||-1;let n={success:r.success,method:r.method||"POST",url:r.url,mode:r.crossDomain!=!0?"same-origin":"cors",timeout:r.timeout||5e3};r=Fe.utils.mergeMap(n,r||{});let d=Fe.$(e);if(d.attr("enctype")&&d.attr("enctype").toLowerCase()==="multipart/form-data"){let a=new FormData,o=File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice,i=t.name,l=i.lastIndexOf("/");l>=0&&(i=i.substr(l+1)),l=i.lastIndexOf("\\"),l>=0&&(i=i.substr(l+1));let m=r.sliceLength||-1;m==-1&&(m=t.size-(r.sliceOffset||0));let C=o.call(t,r.sliceOffset,(r.sliceOffset||0)+m);a.append("file",C,i),r.data=a}else throw new Error("only support multipart/form-data");let s;return r.headers?s=r.headers:s={},s["Content-Type"]=!1,Fe.net.ajax({url:r.url,type:r.method,headers:s,processData:!1,data:r.data,timeout:r.timeout,withCredentials:r.withCredentials,success:function(a){r.success&&r.success(a)},error:function(a,o,i){r.error&&r.error(i)},complete:r.complete,progress:r.progress})}var ht=class ht{static uploadSingle(t,r,n,d,s){new FormData().append("file",t);let o=document.createElement("form");o.setAttribute("enctype","multipart/form-data");let i={headers:{}};return i.headers.set=(l,m)=>{i.headers[l]=m},pe.requestHandleSid(i),delete i.headers.set,Er(o,t,{url:ht.UPLOAD_SINGLE_URL+"?size="+t.size+"&crc32="+r,success:(l=>{l=JSON.parse(l),l.code===200?K.success("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F"):K.error(l.message||"\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"),s&&s(l)}),error:(l=>{console.error("File upload error:",l),K.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"),d&&d(l)}),progress:n||(l=>{console.log(`\u4E0A\u4F20\u8FDB\u5EA6: ${l}%`)}),complete:l=>{},data:"",method:"POST",headers:i.headers,timeout:Number(import.meta.env.VITE_API_UPLOAD_TIMEOUT)||5e3,withCredentials:!0,crossDomain:!0,sliceOffset:0,sliceLength:-1})}static copyFromServer(t){return c.post(import.meta.env.VITE_API_BASE+"/api/fs/copy",{sourcePath:t},null)}};F(ht,"UPLOAD_SINGLE_URL",import.meta.env.VITE_API_BASE+"/api/fs/upload");var tt=ht;import*as Mr from"febs-browser";import{jsx as L,jsxs as nt}from"react/jsx-runtime";var Wl=({fileList:e,onChange:t,onFinish:r,cancel:n,btnText:d="\u4E0A\u4F20\u6587\u4EF6",maxCount:s=5,disabled:a=!1,multiple:o=!0,accept:i=void 0})=>{let[l,m]=Or(void 0),C=Io(e);Co(()=>{C.current=e},[e]);let b=({fileList:N})=>{t?.(N)},w=N=>{t?.(C.current.filter(I=>I.uid!==N.uid))},_=N=>{let I=N.size/1024/1024<100;return I||Po.error("\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7100MB"),I||Ar.LIST_IGNORE},A=async N=>{let{file:I,onSuccess:R,onError:T,onProgress:D}=N;try{I.status="uploading",I.percent=0,D({percent:0}),m(0),Mr.crypt.crc32_file(I,j=>{if(j==0){I.status="error",T("calc crc32 error");return}let x=tt.uploadSingle(I,j,B=>{let W=Math.floor(B*100);D({percent:W}),I.percent=W,m(W)},B=>{m(void 0),T(B)},B=>{I.status="done",I.percent=100,m(void 0),R("ok"),r&&r([I],B).then(()=>{}).catch(()=>{})});I.cancel=()=>{x.abort(),I.status="error",I.percent=0,m(void 0),T(new Error("\u4E0A\u4F20\u5DF2\u53D6\u6D88")),w(I)}})}catch(j){I.status="error",m(void 0),T(j)}},P=l!==void 0&&l<100;return L(Ar,{fileList:e,onChange:b,beforeUpload:_,customRequest:A,multiple:o,maxCount:s,disabled:a,itemRender:(N,I,R,T)=>P?nt("div",{className:"flex items-center justify-between w-full mt-2 rounded border border-blue-100 bg-blue-50 px-3 py-2",children:[L("span",{className:"mr-3 min-w-0 max-w-[120px] flex-1 truncate text-sm text-gray-700",children:I.name}),L(xo,{className:"w-[60px]",percent:Math.round(I.percent||0),size:"small",status:"active",showInfo:!0}),L(rt,{className:"ml-3",size:"small",onClick:()=>{n?n(I):I.cancel?.(),w(I)},danger:!0,children:"\u53D6\u6D88"})]}):null,accept:i,showUploadList:!0,children:!P&&L(rt,{icon:L(So,{}),disabled:a||P,title:o?`\u4E0A\u4F20\u6587\u4EF6\uFF08\u6700\u591A\u652F\u6301${s}\u4E2A\u6587\u4EF6\uFF0C\u5355\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC7100MB\uFF09`:"\u4E0A\u4F20\u6587\u4EF6\uFF08\u5355\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC7100MB\uFF09",children:P?nt("span",{className:"inline-block w-[85px]",children:["\u4E0A\u4F20\u4E2D ",l,"%"]}):d})})},Vl=({files:e=[],onPreview:t,onDownload:r})=>e.length===0?null:L("div",{className:"p-4 bg-gray-50 rounded",children:e.map((n,d)=>nt("div",{className:"flex items-center mb-2",children:[Fr(n),L("span",{className:"mr-2",children:n.name}),nt(To,{children:[t&&L(rt,{type:"link",size:"small",icon:L(_o,{}),onClick:()=>t(n),children:"\u67E5\u770B"}),r&&L(rt,{type:"link",size:"small",icon:L(jr,{}),onClick:()=>r(n),children:"\u4E0B\u8F7D"})]})]},n.uid||d))}),Fr=e=>{let t=e.type||"";return t.includes("pdf")?L(ko,{className:"mr-2 text-red-500"}):t.includes("excel")||t.includes("spreadsheet")||e.name.endsWith(".xlsx")||e.name.endsWith(".xls")?L(No,{className:"mr-2 text-green-500"}):t.includes("word")||t.includes("document")||e.name.endsWith(".docx")||e.name.endsWith(".doc")?L(Uo,{className:"mr-2 text-blue-500"}):t.includes("image")?L(Do,{className:"mr-2 text-purple-500"}):L(Eo,{className:"mr-2 text-gray-500"})},ql=({visible:e,file:t,onClose:r,onDownload:n})=>{if(!t)return null;let[d,s]=Or(""),a=t.name||"",o=t.type?.startsWith("image/");return o&&it(t,i=>{s(i||"")}),L(Ro,{open:e,title:a,footer:null,onCancel:r,width:800,children:o?L(wo,{alt:a,style:{width:"100%"},src:d}):nt("div",{className:"text-center p-8",children:[L("div",{className:"text-6xl mb-4",children:Fr(t)}),L("p",{className:"mb-4",children:a}),L("p",{className:"text-gray-500 mb-4",children:"\u8BE5\u6587\u4EF6\u7C7B\u578B\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),n&&L(rt,{type:"primary",icon:L(jr,{}),onClick:()=>n(t),children:"\u4E0B\u8F7D\u6587\u4EF6\u67E5\u770B"})]})})};export{Ba as CommentTimeline,tt as FileUploadHandler,Hs as ProjectSelector,Yi as ResizableTable,lo as RoleSelector,Ei as SingletonToastProvider,Ct as UIDatePicker,ei as UIDateRangePicker,Vl as UIFileList,Wl as UIFileUpload,ql as UIFileUploadPreviewModal,ui as UIImageUpload,Tn as UILoading,Pi as UISelect,$i as UITableGridViewToggle,Di as UIToast,Bi as UIToastSingle,Li as UIToastSingleProvider,Gn as UIViewToggle,vo as UserSelector,Ys as clearRoleCache,Rt as compressImage,Qr as uiAlert,ln as uiConfirm,K as uiToast};