@abtnode/webapp 1.16.43-beta-20250422-042711-c40bec75 → 1.16.43-beta-20250424-125523-08a65a5c

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 (239) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-Dd50umeM.js → AdapterDayjs-Bg7uGgbF.js} +7 -7
  4. package/dist/assets/{Add-CaztVzCy.js → Add-lby-WMVZ.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-DVC5NCF_.js → ArrowDropDown-DroHSHv1.js} +1 -1
  6. package/dist/assets/{Autocomplete-BvgGgwn-.js → Autocomplete-D4Jvroxg.js} +1 -1
  7. package/dist/assets/{Breadcrumbs--d8mi7-f.js → Breadcrumbs-Degq7-cg.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BwBRy_Vd.js → ButtonGroup-KbsqQYLp.js} +1 -1
  9. package/dist/assets/{CSSTransition-B2MHWQVG.js → CSSTransition-umLMVbSI.js} +1 -1
  10. package/dist/assets/{CallMerge-BKOZFJsL.js → CallMerge-D43L7gfn.js} +1 -1
  11. package/dist/assets/CardContent-BBNXKDLH.js +1 -0
  12. package/dist/assets/{ChevronLeft-BLMagiOR.js → ChevronLeft-CF_uwgT0.js} +1 -1
  13. package/dist/assets/{ChevronRight-CmLzNb37.js → ChevronRight-DbKKEEsR.js} +1 -1
  14. package/dist/assets/{Clear-DnKBhMMz.js → Clear-BYnHnNAI.js} +1 -1
  15. package/dist/assets/{Close-z9azgP87.js → Close-Dpq37qiZ.js} +1 -1
  16. package/dist/assets/{Community-CfAYk0rg.js → Community-D4w5taWL.js} +1 -1
  17. package/dist/assets/{Delete-lfXEd_sD.js → Delete-Ce85Ql3S.js} +1 -1
  18. package/dist/assets/Delete-ClxQ0y3-.js +1 -0
  19. package/dist/assets/{DeleteOutline-CpHx956r.js → DeleteOutline-C6TmcfH4.js} +1 -1
  20. package/dist/assets/{Done-B07f5HKr.js → Done-BjBoPP5g.js} +1 -1
  21. package/dist/assets/{Edit-DeW-Raa6.js → Edit-xi4J_eau.js} +1 -1
  22. package/dist/assets/{ErrorOutline-BamXOGix.js → ErrorOutline-CCSWIjK_.js} +1 -1
  23. package/dist/assets/{HelpOutline-PjbpgGnS.js → HelpOutline-D375iS8p.js} +1 -1
  24. package/dist/assets/{Holiday-os2if6d3.js → Holiday-CzE5h49l.js} +1 -1
  25. package/dist/assets/{Launch-VrwX5mL6.js → Launch-DePFcprE.js} +1 -1
  26. package/dist/assets/{Link-9GZNaOgm.js → Link-LyPYKPlx.js} +1 -1
  27. package/dist/assets/{ListItemButton-UrtScDNv.js → ListItemButton-CU1frsx_.js} +1 -1
  28. package/dist/assets/{ListSubheader-CXoRyaHI.js → ListSubheader-xl2l5mXh.js} +1 -1
  29. package/dist/assets/{LoadingButton-D_BY4Jqp.js → LoadingButton-CBSsH98L.js} +1 -1
  30. package/dist/assets/{LockIcon-BNPULy1Y.js → LockIcon-B45Spn4w.js} +1 -1
  31. package/dist/assets/{Meeting-DYJ-razI.js → Meeting-D5njBYzA.js} +1 -1
  32. package/dist/assets/{MoreHoriz-BGho5EZt.js → MoreHoriz-BBPO3lYM.js} +1 -1
  33. package/dist/assets/{MoreVert-Dsx1svGJ.js → MoreVert-CJEwAyrO.js} +1 -1
  34. package/dist/assets/{OffSick-DkD5M8d5.js → OffSick-DAPZSrTR.js} +1 -1
  35. package/dist/assets/{Public-DsP_rIVN.js → Public-DU9Zwfvz.js} +1 -1
  36. package/dist/assets/{Refresh-CY_XOdj5.js → Refresh-C8sRW4ey.js} +1 -1
  37. package/dist/assets/{SchemaReference.es-CHFc7aCW.js → SchemaReference.es-BmPkbXqa.js} +1 -1
  38. package/dist/assets/{Search-Cy1sS0Ys.js → Search-DNO2mA1t.js} +1 -1
  39. package/dist/assets/{Slider-DliZyLUu.js → Slider-D2j2o6C_.js} +1 -1
  40. package/dist/assets/{Stepper-D00G8whg.js → Stepper-ByBBXwpK.js} +1 -1
  41. package/dist/assets/{TableSearch-B7Ia4hYX.js → TableSearch-DEtaWkFM.js} +1 -1
  42. package/dist/assets/{ToggleButtonGroup-Dx7Cqen3.js → ToggleButtonGroup-ieIV-WGx.js} +1 -1
  43. package/dist/assets/{Verified-DEPnoVi2.js → Verified-QVVCTHQV.js} +1 -1
  44. package/dist/assets/{VerifiedUser-CtMfrkOq.js → VerifiedUser-DSfNrNs3.js} +1 -1
  45. package/dist/assets/{ViewColumn-1pLOayu5.js → ViewColumn-dIIJ-TaZ.js} +1 -1
  46. package/dist/assets/{ViewList-BAJgFctd.js → ViewList-BMlV2vpC.js} +1 -1
  47. package/dist/assets/{WorkingRemotely-CFsc5wBG.js → WorkingRemotely-CcpgKCrX.js} +1 -1
  48. package/dist/assets/{_createAggregator-BZiDTQ-1.js → _createAggregator-CTEoaHk3.js} +1 -1
  49. package/dist/assets/{actions-rKZA5Yl3.js → actions-DWXi51xP.js} +1 -1
  50. package/dist/assets/{actions-COYCVGfV.js → actions-D_w-E3e-.js} +2 -2
  51. package/dist/assets/{agreement-CvnU-wvl.js → agreement-CDVwTK7I.js} +4 -4
  52. package/dist/assets/api-DkiXYVLM.js +1 -0
  53. package/dist/assets/{appearance-BKSHEoHy.js → appearance-BNbra9Q0.js} +1 -1
  54. package/dist/assets/ar-BNaEJSr3.js +7 -0
  55. package/dist/assets/{audit-logs-C5PuRwaG.js → audit-logs-Bi1ieUq6.js} +2 -2
  56. package/dist/assets/blocklet-DidLj2Zo.js +1 -0
  57. package/dist/assets/{brace-fold.es-zOkKbJNK.js → brace-fold.es-hD6ePSd7.js} +1 -1
  58. package/dist/assets/{chain-nejdRVrr.js → chain-B1DYbRT2.js} +1 -1
  59. package/dist/assets/click-to-copy-D9mVJ-RV.js +1 -0
  60. package/dist/assets/cloneDeep-25ofqs0f.js +1 -0
  61. package/dist/assets/{closebrackets.es-D1eT-FTM.js → closebrackets.es-B0J2lA3U.js} +1 -1
  62. package/dist/assets/{codemirror.es-0rTHjVK9.js → codemirror.es-BaDyFG9Y.js} +1 -1
  63. package/dist/assets/{comment.es-BzTQxNrB.js → comment.es-DPh31JMD.js} +1 -1
  64. package/dist/assets/{config-navigation-DP1VP0AV.js → config-navigation-Czs5GZbX.js} +17 -17
  65. package/dist/assets/{connect-to-CLKjNArl.js → connect-to-P_JZVAGf.js} +1 -1
  66. package/dist/assets/de-BsZVQmUM.js +7 -0
  67. package/dist/assets/delete-confirm-CPbaWrD8.js +1 -0
  68. package/dist/assets/{detail-SkSHXUY6.js → detail-BkfZ-vLq.js} +3 -3
  69. package/dist/assets/{dialog.es-DTCttvK1.js → dialog.es-Cy5fQBet.js} +1 -1
  70. package/dist/assets/domains-BLRqSu-m.js +24 -0
  71. package/dist/assets/{download-hxkTe46m.js → download-gAaJAdD7.js} +1 -1
  72. package/dist/assets/emotion-react.browser.esm-BuYEJ5bP.js +1 -0
  73. package/dist/assets/es-ntlJbt-a.js +7 -0
  74. package/dist/assets/{foldgutter.es-D09BRatH.js → foldgutter.es-DpwInfY6.js} +1 -1
  75. package/dist/assets/fr-Bv4B0MVB.js +7 -0
  76. package/dist/assets/{get-safe-url-6iqduUH5.js → get-safe-url-CofQV3ai.js} +1 -1
  77. package/dist/assets/{get-safe-url-CVvG2J9I.js → get-safe-url-DzAjUQl5.js} +1 -1
  78. package/dist/assets/getValidReactChildren-BNMVx0A0.js +1 -0
  79. package/dist/assets/hi-DIf_hqVB.js +5 -0
  80. package/dist/assets/{hint.es-CElKEoBL.js → hint.es-zNpcbGGk.js} +1 -1
  81. package/dist/assets/{hint.es2-cm-ZWwEJ.js → hint.es2-5htyBXtO.js} +1 -1
  82. package/dist/assets/id-DZBgOnwF.js +7 -0
  83. package/dist/assets/{iframe-BtkIGcLr.js → iframe-DaFIiCmw.js} +1 -1
  84. package/dist/assets/{index-CrLu05HL.js → index-7G8x7Vl0.js} +24 -24
  85. package/dist/assets/{index-B8tVxEg2.js → index-B38OHLL1.js} +1 -1
  86. package/dist/assets/{index-BaNhzXWK.js → index-B5aj8g64.js} +25 -25
  87. package/dist/assets/{index-C1Ig2ZHh.js → index-B7k9dkSz.js} +1 -1
  88. package/dist/assets/{index-DFqgZ5xa.js → index-BH5HIFbb.js} +1 -1
  89. package/dist/assets/{index-Ca2ykS6T.js → index-BIAPYyhR.js} +1 -1
  90. package/dist/assets/{index-H4oRzuHX.js → index-BJV-jbRZ.js} +1 -1
  91. package/dist/assets/index-BcXeJXCR.js +1 -0
  92. package/dist/assets/{index-DU1prNlR.js → index-Bd8opEvI.js} +1 -1
  93. package/dist/assets/{index-iKNyCq23.js → index-BdtBG9co.js} +1 -1
  94. package/dist/assets/{index-C7M3KjDN.js → index-Bqki_NGY.js} +1 -1
  95. package/dist/assets/{index-BdcAx4jd.js → index-Bzt7VEv3.js} +1 -1
  96. package/dist/assets/{index-D5tFxfO4.js → index-C1TWTzPh.js} +3 -3
  97. package/dist/assets/index-C6d26-qR.js +1 -0
  98. package/dist/assets/{index-CwQRP9vW.js → index-CIOf_B3T.js} +1 -1
  99. package/dist/assets/{index-CkuW1m1M.js → index-CQ7uV-a-.js} +1 -1
  100. package/dist/assets/{index-dpcQFGC9.js → index-CTEKj5go.js} +1 -1
  101. package/dist/assets/{index-dPMBaXU5.js → index-CfWjDiL_.js} +1 -1
  102. package/dist/assets/{index-Db1NmfnY.js → index-CiCEonKE.js} +11 -11
  103. package/dist/assets/{index-D1AcZBxv.js → index-CkIbYyM0.js} +1 -1
  104. package/dist/assets/{index-CrdafeIA.js → index-Ct8zi4pq.js} +4 -4
  105. package/dist/assets/{index-B_8fIevk.js → index-CxfmUaF-.js} +1 -1
  106. package/dist/assets/index-Cy5Qtbob.js +1 -0
  107. package/dist/assets/{index-CmON_Ucm.js → index-D-8F2hnL.js} +3 -3
  108. package/dist/assets/{index-B-gpi2ba.js → index-D3aHzIo4.js} +1 -1
  109. package/dist/assets/{index-D5iXLg7U.js → index-D652L7CC.js} +1 -1
  110. package/dist/assets/{index-CH0ZtB03.js → index-DB-T1OVT.js} +1 -1
  111. package/dist/assets/{index-DacxPQzS.js → index-DEtsePs-.js} +9 -9
  112. package/dist/assets/{index-BG2kH0vO.js → index-DIt3-b0L.js} +1 -1
  113. package/dist/assets/index-DJipOB3r.js +327 -0
  114. package/dist/assets/{index-BYMuyFwb.js → index-DPbGXgqB.js} +2 -2
  115. package/dist/assets/{index-bYp_tt8z.js → index-DUWb27J9.js} +1 -1
  116. package/dist/assets/{index-Chf7gMD-.js → index-DX_pC0Y6.js} +5 -5
  117. package/dist/assets/{index-DMyuQ6gX.js → index-Di0aMImb.js} +1 -1
  118. package/dist/assets/{index-CdIzwolo.js → index-Dj8CUjVy.js} +1 -1
  119. package/dist/assets/{index-DwcH9Py2.js → index-DllLiKC-.js} +1 -1
  120. package/dist/assets/{index-BI57n5-1.js → index-Dmw-rWCR.js} +1 -1
  121. package/dist/assets/index-E6lSv66O.js +20 -0
  122. package/dist/assets/{index-PKxcb70p.js → index-QaZ1YHGi.js} +4 -4
  123. package/dist/assets/{index-BjeDI2iY.js → index-RxScS04A.js} +1 -1
  124. package/dist/assets/index-W1T8OGsQ.js +102 -0
  125. package/dist/assets/{index-BEKPz42W.js → index-ftNYfJO-.js} +2 -2
  126. package/dist/assets/{index-BCoMTShJ.js → index-kCV42hBz.js} +3 -3
  127. package/dist/assets/{index-BkTRcS0m.js → index-mzqVbRK8.js} +5 -5
  128. package/dist/assets/{index-DacB9LlP.js → index-peWL8owC.js} +1 -1
  129. package/dist/assets/{index-CoenHBJL.js → index-rRNsJfpm.js} +1 -1
  130. package/dist/assets/{index-C9UfyIb3.js → index-rZNPURo0.js} +1 -1
  131. package/dist/assets/index-uPaywPQ8.js +11 -0
  132. package/dist/assets/{index.esm-BiF80IE7.js → index.esm-C4Qz2Lyg.js} +1 -1
  133. package/dist/assets/{info-addon.es-LTLqCI-0.js → info-addon.es-BXYvd0W0.js} +1 -1
  134. package/dist/assets/{info.es-DGuZ8x_j.js → info.es-BqgAgM-L.js} +1 -1
  135. package/dist/assets/{install-from-url-CctlVaYm.js → install-from-url-xwgejqoQ.js} +1 -1
  136. package/dist/assets/{invitation-B5T1tiZS.js → invitation-DTsCoqpv.js} +5 -5
  137. package/dist/assets/is-path-prefix-equal-CH05cZsF.js +1 -0
  138. package/dist/assets/{item-C_feFNJE.js → item-CmVxSSOE.js} +5 -5
  139. package/dist/assets/ja-8jRYJGVw.js +7 -0
  140. package/dist/assets/{javascript.es-DXQm_49v.js → javascript.es-grXxHaUZ.js} +1 -1
  141. package/dist/assets/{jump-to-line.es-COQrSkxS.js → jump-to-line.es-B6hVDRl6.js} +1 -1
  142. package/dist/assets/{jump.es-Bt36pao4.js → jump.es-B_PWFf9O.js} +1 -1
  143. package/dist/assets/ko-C4pbuwv8.js +7 -0
  144. package/dist/assets/{lint.es-D7cZDq3q.js → lint.es-9mA5K-XH.js} +1 -1
  145. package/dist/assets/{lint.es2-DjlpYEUm.js → lint.es2-B8BrvpI1.js} +1 -1
  146. package/dist/assets/{lint.es3-DZfzAxs3.js → lint.es3-fLYIED-e.js} +1 -1
  147. package/dist/assets/{list-header-D6gN8uAe.js → list-header-DRRNzO0m.js} +1 -1
  148. package/dist/assets/{log-D0D7SXBT.js → log-CsCaVz2A.js} +1 -1
  149. package/dist/assets/{lottie-react.esm-Cq33pfIC.js → lottie-react.esm-BKXV9kCi.js} +1 -1
  150. package/dist/assets/{matchbrackets.es-3bFu-rM7.js → matchbrackets.es-CzWnE91z.js} +1 -1
  151. package/dist/assets/{memory-C4f-u36N.js → memory-gHhFfsR0.js} +1 -1
  152. package/dist/assets/{mode.es-fSwJIwcv.js → mode.es-C15J0aR6.js} +1 -1
  153. package/dist/assets/{mode.es2-DE0KN96r.js → mode.es2-DomABVUn.js} +1 -1
  154. package/dist/assets/{mode.es3-7lr44IEM.js → mode.es3-UeuTaWNm.js} +1 -1
  155. package/dist/assets/omit-CV0Lh9D4.js +1 -0
  156. package/dist/assets/{onlineParser.es-CgJfI2uz.js → onlineParser.es-BbMfA3YO.js} +1 -1
  157. package/dist/assets/{overview-BFj7mF3I.js → overview-Bu69g0aI.js} +2 -2
  158. package/dist/assets/{permission-CWRNDCfb.js → permission-KtOkmZK5.js} +1 -1
  159. package/dist/assets/{preference-Bu7eUUWY.js → preference-DioTxcDx.js} +4 -4
  160. package/dist/assets/pt-CMeQ7KWn.js +5 -0
  161. package/dist/assets/{raf-schd.esm-CHbi2ex4.js → raf-schd.esm-DqWgvWp8.js} +1 -1
  162. package/dist/assets/refType-M_fnNR8Y.js +1 -0
  163. package/dist/assets/{resource-dialog-Bkqsb65A.js → resource-dialog-CybAqKK7.js} +4 -4
  164. package/dist/assets/ru-8cWKcW3b.js +5 -0
  165. package/dist/assets/{runtime-BTj0lhIQ.js → runtime-C2qLnxoL.js} +1 -1
  166. package/dist/assets/{schema-v7IiGTwK.js → schema-B-wPSL-T.js} +1 -1
  167. package/dist/assets/{search.es-Dq3fEJn9.js → search.es-D-x2fK1z.js} +1 -1
  168. package/dist/assets/{searchcursor.es-4j5vi65s.js → searchcursor.es-DQ3R3tL0.js} +1 -1
  169. package/dist/assets/{service-lHsrm0NQ.js → service-1KS_Mvhf.js} +1 -1
  170. package/dist/assets/session-CDrB7OKD.js +1 -0
  171. package/dist/assets/shorten-label-3ndfcRTb.js +1 -0
  172. package/dist/assets/{show-hint.es-Ojy6T5sj.js → show-hint.es-kWFkQmfD.js} +1 -1
  173. package/dist/assets/{simple-select-F8H5fDWg.js → simple-select-CCb06xBs.js} +1 -1
  174. package/dist/assets/{spaces-BTXS6Yjp.js → spaces-Dlk0tiHl.js} +1 -1
  175. package/dist/assets/{status-IJGTdR69.js → status-D__Gu7bb.js} +1 -1
  176. package/dist/assets/{status-l9WKVdEe.js → status-qfhBp9Zz.js} +1 -1
  177. package/dist/assets/{sublime.es-B-15UZDa.js → sublime.es-D65uN2k1.js} +1 -1
  178. package/dist/assets/{switch-control-DonG73Yn.js → switch-control-Cpqmpl-t.js} +1 -1
  179. package/dist/assets/{table-icons-BHel_001.js → table-icons-Wfa_TiY1.js} +1 -1
  180. package/dist/assets/{team-B791iWfh.js → team-DLnveWtv.js} +1 -1
  181. package/dist/assets/th-DYYGBboI.js +5 -0
  182. package/dist/assets/{toLower-Na2C3nc2.js → toLower-Cc2jzGm2.js} +1 -1
  183. package/dist/assets/toUpper-B0N7bX3J.js +1 -0
  184. package/dist/assets/{traffic-C0ojZNhU.js → traffic-C9SC7OdE.js} +1 -1
  185. package/dist/assets/{url-evaluation-gByE9zMg.js → url-evaluation-C6gQAust.js} +1 -1
  186. package/dist/assets/{url-join-D1f7RCcb.js → url-join-BhaAJPg6.js} +1 -1
  187. package/dist/assets/{use-mobile-ccyNEJKq.js → use-mobile-BAkfxlsb.js} +1 -1
  188. package/dist/assets/{use-mobile-ate4xZwv.js → use-mobile-uaCblfH4.js} +1 -1
  189. package/dist/assets/{useAsync-VXf0m9o5.js → useAsync-UCL8EFNX.js} +1 -1
  190. package/dist/assets/{useLocalStorage-CM3CvKLy.js → useLocalStorage-CX0bausV.js} +1 -1
  191. package/dist/assets/{useThemeProps-BC8tRkwB.js → useThemeProps-ekXTUVYd.js} +1 -1
  192. package/dist/assets/{util-7WcGgtM2.js → util-CdmIFTbh.js} +1 -1
  193. package/dist/assets/vi-CfH0km8q.js +5 -0
  194. package/dist/assets/{wait-container-YMrkmjdy.js → wait-container-BqRh3coF.js} +3 -3
  195. package/dist/assets/withStyles-DQ3lkjuW.js +1 -0
  196. package/dist/assets/wrap-locale-DSOYhBxy.js +1 -0
  197. package/dist/assets/{zh-CY9wasmC.js → zh-DZlGQAU9.js} +1 -1
  198. package/dist/assets/zh-tw-Be5lgYGX.js +7 -0
  199. package/dist/index.html +1 -1
  200. package/dist/service-worker.js +1 -1
  201. package/package.json +1 -1
  202. package/dist/assets/CardContent-BtOX0LtZ.js +0 -1
  203. package/dist/assets/Delete-WcGTUKKB.js +0 -1
  204. package/dist/assets/api-DLD170qt.js +0 -1
  205. package/dist/assets/ar-DRtGxecv.js +0 -7
  206. package/dist/assets/blocklet-DJBGGeZX.js +0 -1
  207. package/dist/assets/click-to-copy-DMnzmGmb.js +0 -1
  208. package/dist/assets/cloneDeep-B9FR8YvV.js +0 -1
  209. package/dist/assets/de-BZDWXY3K.js +0 -7
  210. package/dist/assets/delete-confirm-BtLdya8P.js +0 -1
  211. package/dist/assets/domains-Ocd33WxK.js +0 -25
  212. package/dist/assets/emotion-react.browser.esm-BhrBe_SA.js +0 -1
  213. package/dist/assets/es-kQ6jQG-H.js +0 -7
  214. package/dist/assets/fr-Bf3jz4q5.js +0 -7
  215. package/dist/assets/getValidReactChildren-Cpt3JIPG.js +0 -1
  216. package/dist/assets/hi-DPdbGXyy.js +0 -5
  217. package/dist/assets/id-BqmT-cL5.js +0 -7
  218. package/dist/assets/index-BbQ_Eva9.js +0 -1
  219. package/dist/assets/index-CsRDH5PZ.js +0 -11
  220. package/dist/assets/index-DErkdWGS.js +0 -1
  221. package/dist/assets/index-Dk_ddRep.js +0 -20
  222. package/dist/assets/index-JQOci2IN.js +0 -1
  223. package/dist/assets/index-Smdhabbz.js +0 -102
  224. package/dist/assets/index-U3LqL5BU.js +0 -327
  225. package/dist/assets/is-path-prefix-equal-evPnCa54.js +0 -1
  226. package/dist/assets/ja-CyUU4_H1.js +0 -7
  227. package/dist/assets/ko-DWTxutv1.js +0 -7
  228. package/dist/assets/omit-CRVyfsPe.js +0 -1
  229. package/dist/assets/pt-BcsDG9H6.js +0 -5
  230. package/dist/assets/refType-DslaJ1jV.js +0 -1
  231. package/dist/assets/ru-BwH1q1F1.js +0 -5
  232. package/dist/assets/session-ZhuGZWu8.js +0 -1
  233. package/dist/assets/shorten-label-DOksnAtq.js +0 -1
  234. package/dist/assets/th-CNztcQMJ.js +0 -5
  235. package/dist/assets/toUpper-CxCsEo5T.js +0 -1
  236. package/dist/assets/vi-Bpl5HEj4.js +0 -5
  237. package/dist/assets/withStyles-oCXyS3DL.js +0 -1
  238. package/dist/assets/wrap-locale-C4NCfxhS.js +0 -1
  239. package/dist/assets/zh-tw-D6qZTlL3.js +0 -7
@@ -1,4 +1,4 @@
1
- import{bB as xt,r as b,bN as ee,bs as V,y as X,A as k,j as e,P as d,T as bt,aP as Xe,aQ as Je,fG as yt,ax as jt,h as ie,aB as vt,k as J,M as C,m as te,eg as ke,O as Pe,kz as Ze,cn as Te,aY as Re,V as Ie,b0 as Se,bi as Ve,bg as Ee,C as et,n as ce,aT as De,W as St,aw as tt,gi as Fe,B as Ae,dQ as st,bE as nt,aj as ue,fc as Ct,G as Ge,kA as Nt,kB as wt,D as Tt,kC as Rt,kD as It,kE as Et,kF as Dt,bI as at,Q as At,S as Ot,U as Ye,K as Lt,kG as kt}from"./index-Db1NmfnY.js";import{k as Pt,D as it,g as Ft}from"./index-C1Ig2ZHh.js";import{S as he}from"./shorten-label-DOksnAtq.js";import{I as ot}from"./index-CwQRP9vW.js";import{T as _t}from"./index-C7M3KjDN.js";import{a as _e}from"./actions-COYCVGfV.js";import{d as Bt}from"./Refresh-CY_XOdj5.js";import{D as zt,g as Wt}from"./traffic-C0ojZNhU.js";import"./useThemeProps-BC8tRkwB.js";import"./emotion-react.browser.esm-BhrBe_SA.js";import"./ViewColumn-1pLOayu5.js";import"./Search-Cy1sS0Ys.js";import"./Clear-DnKBhMMz.js";import"./Delete-lfXEd_sD.js";import"./index-bYp_tt8z.js";import"./MoreVert-Dsx1svGJ.js";import"./TableSearch-B7Ia4hYX.js";import"./useLocalStorage-CM3CvKLy.js";import"./get-safe-url-CVvG2J9I.js";import"./ButtonGroup-BwBRy_Vd.js";import"./getValidReactChildren-Cpt3JIPG.js";import"./url-evaluation-gByE9zMg.js";import"./permission-CWRNDCfb.js";import"./session-ZhuGZWu8.js";import"./iframe-BtkIGcLr.js";import"./ChevronLeft-BLMagiOR.js";import"./ChevronRight-CmLzNb37.js";import"./index-DMyuQ6gX.js";import"./CardContent-BtOX0LtZ.js";import"./AdapterDayjs-Dd50umeM.js";import"./CSSTransition-B2MHWQVG.js";import"./refType-DslaJ1jV.js";const rt=b.createContext({}),{Provider:Mt,Consumer:Ys}=rt;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=xt(),[a,x]=b.useState([]),[u,T]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[v,S]=b.useState([]),[I,M]=b.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const P={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=P;let Z="";B&&B.includes("system")&&(Z="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Z,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),T(se.paging),se.list}catch(P){return X.error(P.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=b.useCallback(h=>{const O=s.children.find(A=>{var P;return((P=A.meta)==null?void 0:P.did)===h});if(O)return O.ancestors=[s],O},[s]),U=async({notificationId:h,receivers:O,channels:A,...P})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?k.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?k.NOTIFICATION_SEND_CHANNEL.PUSH:B),...P}})},H=b.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=b.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const P={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:P})}catch(P){throw X.error(P.message),P}},[n,m]);b.useEffect(()=>{m&&D()},[m]),o(k.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(k.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const _={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:U,getUser:H,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(Mt,{value:{notificationRecords:_},children:t})}function Be(){const{notificationRecords:t}=b.useContext(rt);return t}const ye={common:{black:"#000",white:"#fff"},primary:{main:"#3773F2",contrastText:"#fff"},secondary:{main:"#16CED1",contrastText:"#fff"},error:{main:"#F16E6E",contrastText:"#fff"},warning:{main:"#DE9E37",contrastText:"#fff"},info:{main:"#0775F8",contrastText:"#fff"},success:{main:"#34BE74",contrastText:"#fff"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{default:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}};ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Kt={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(bt,{type:Kt[t],children:t})}var ze={},Ut=Je;Object.defineProperty(ze,"__esModule",{value:!0});var lt=ze.default=void 0,Ht=Ut(Xe()),$t=e;lt=ze.default=(0,Ht.default)((0,$t.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var We={},Vt=Je;Object.defineProperty(We,"__esModule",{value:!0});var ct=We.default=void 0,Gt=Vt(Xe()),Yt=e;ct=We.default=(0,Gt.default)((0,Yt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case k.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function dt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:jt(o,s)}):"",T=Qt(t,x,a);return r===k.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===k.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Qe=["info","success","error","warning"],ut=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},pt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},Xt=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ut(t),enabled:n}},Jt=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:pt(t),enabled:n}},Zt=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),T=be(u);o[a]=T}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case k.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case k.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case k.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case k.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ft=()=>yt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,T=[a,u].filter(Boolean).join(", ");return e.jsx(vt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(J,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(J,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(a=>{const x=dt(r,o,{status:a});return e.jsx(ke,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}Me.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Me({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ze,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const m=[...t];T.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(v=>v!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(Me,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=dt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}qe.propTypes={value:d.array.isRequired,onChange:d.func};function qe({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=b.useState(null),x=b.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,T=b.useCallback(m=>{if(!m.startDate||!m.endDate){X.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){X.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(J,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ve(t[0],n)," - ",Ve(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Wt(r),onChange:T})})]})}Ke.propTypes={itemComponent:d.elementType.isRequired};function Ke({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const as=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ue.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ue.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ue({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=b.useState(as),[x,u]=b.useState(!0),T=(v,S)=>{S.checked=v.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=v=>{v.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(J,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ze,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(v=>e.jsx(Re,{control:e.jsx(Ie,{checked:v.checked,onChange:S=>T(S,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(et,{size:16}),r("common.confirm")]})]})]})}mt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function mt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:T,blocklet:m}=Be(),[v,S]=b.useState(!1),[I,M]=b.useState([]),E=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[D,G]=b.useState(null),[U,H]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,_]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=b.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],P=async()=>{if(!v&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:nt(c.receiverUser.avatar,u,x)}}));M(l),H(i.paging),S(!1)}catch(i){X.error(i.message),S(!1)}};b.useEffect(()=>{P()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Z={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:U.page-1,rowsPerPage:U.pageSize,count:U.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:j})=>{const[,F=[],$=[],K=[]]=j;N.pageSize!==l?_(W=>({...W,pageSize:l,page:1})):N.page!==i+1?_(W=>({...W,page:i+1})):N.searchText!==c?_(W=>({...W,searchText:c,page:1})):ue(F,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||_(W=>({...W,emailSendStatus:K,page:1})):_(W=>({...W,pushKitSendStatus:$,page:1})):_(W=>({...W,walletSendStatus:F,page:1}))},oe=b.useCallback(async(i,l)=>{if(!l)return!1;const c=await T(l);return c?i==="wallet"?Zt(c):i==="email"?Xt(m,c):i==="pushKit"?Jt(m,c):i==="webhook"?es(c):!0:!1},[T,m]),se=b.useCallback(i=>ts(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,j="")=>{if(!(!l.length||!i.length))try{s(i,l,c,j),L.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},y=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(j=>I[j].receiver);await g(i,c,l),await xe(.5),p(),O([])},R=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(j){X.error(j.response?j.response.statusText:j.message)}},w=async(i,l,c,j=[],F=!0)=>{if(i.stopPropagation(),ss(l,c)>=4){X.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await R(l,j,F);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],F),L.anchorEl||(await xe(.5),f()))}catch(K){X.error(K.message)}},Y=i=>{_(l=>({...l,dateRange:i,page:1}))},Q=(i,l,c,j)=>{i.stopPropagation();const F=c.filter($=>$!==l);_($=>({...$,[j]:F,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(tt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(St,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),Q(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:j,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"wallet",onResend:F=>w(F,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"pushkit",onResend:F=>w(F,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),Q(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:j,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"email",onResend:F=>w(F,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),Q(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:j,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[j,F]=c,$=F[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:j},j),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Fe,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),$e=[e.jsx(qe,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(Bt,{}),onClick:()=>P(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(st,{theme:ft(),children:[e.jsx(it,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Z,customButtons:$e,components:{TableFilterList:i=>e.jsx(Ke,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var F,$;const{type:l,pass:c,fail:j}=i;return!(D!=null&&D.result)||(F=D==null?void 0:D.result)!=null&&F[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=D==null?void 0:D.result)!=null&&$[l]?ye.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(lt,{}):e.jsx(et,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(J,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:ye.error.main},children:[e.jsx(ct,{}),e.jsx("span",{children:j})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ue,{loading:n,onCancel:p,onConfirm:y})})]})})})}const is=b.memo(mt),os=ce.div`
1
+ import{bq as xt,r as y,bD as ee,bh as V,y as X,A as k,j as e,P as d,T as bt,aP as Xe,aQ as Je,fF as yt,ax as jt,h as ie,aB as vt,k as J,M as C,m as te,ef as ke,O as Pe,kz as Ze,cl as Te,aY as Re,V as Ie,el as Se,b7 as Ve,b5 as Ee,C as et,n as ce,aT as De,W as St,aw as tt,gi as Fe,B as Ae,dP as st,bt as nt,aj as ue,fc as Ct,G as Ge,kA as Nt,kB as wt,D as Tt,kC as Rt,kD as It,kE as Et,kF as Dt,by as at,Q as At,S as Ot,U as Ye,K as Lt,kG as kt}from"./index-CiCEonKE.js";import{k as Pt,D as it,g as Ft}from"./index-B7k9dkSz.js";import{S as he}from"./shorten-label-3ndfcRTb.js";import{I as ot}from"./index-CIOf_B3T.js";import{T as _t}from"./index-Bqki_NGY.js";import{a as _e}from"./actions-D_w-E3e-.js";import{d as Bt}from"./Refresh-C8sRW4ey.js";import{D as zt,g as Wt}from"./traffic-C9SC7OdE.js";import"./useThemeProps-ekXTUVYd.js";import"./emotion-react.browser.esm-BuYEJ5bP.js";import"./ViewColumn-dIIJ-TaZ.js";import"./Search-DNO2mA1t.js";import"./Clear-BYnHnNAI.js";import"./Delete-Ce85Ql3S.js";import"./index-DUWb27J9.js";import"./MoreVert-CJEwAyrO.js";import"./TableSearch-DEtaWkFM.js";import"./useLocalStorage-CX0bausV.js";import"./get-safe-url-CofQV3ai.js";import"./ButtonGroup-KbsqQYLp.js";import"./getValidReactChildren-BNMVx0A0.js";import"./url-evaluation-C6gQAust.js";import"./permission-KtOkmZK5.js";import"./session-CDrB7OKD.js";import"./iframe-DaFIiCmw.js";import"./ChevronLeft-CF_uwgT0.js";import"./ChevronRight-DbKKEEsR.js";import"./index-Di0aMImb.js";import"./CardContent-BBNXKDLH.js";import"./AdapterDayjs-Bg7uGgbF.js";import"./CSSTransition-umLMVbSI.js";import"./refType-M_fnNR8Y.js";const rt=y.createContext({}),{Provider:Mt,Consumer:Ys}=rt;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=xt(),[a,x]=y.useState([]),[u,R]=y.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[v,S]=y.useState([]),[I,M]=y.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const P={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=P;let Z="";B&&B.includes("system")&&(Z="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Z,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),R(se.paging),se.list}catch(P){return X.error(P.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=y.useCallback(h=>{const O=s.children.find(A=>{var P;return((P=A.meta)==null?void 0:P.did)===h});if(O)return O.ancestors=[s],O},[s]),U=async({notificationId:h,receivers:O,channels:A,...P})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?k.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?k.NOTIFICATION_SEND_CHANNEL.PUSH:B),...P}})},H=y.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=y.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const P={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:P})}catch(P){throw X.error(P.message),P}},[n,m]);y.useEffect(()=>{m&&D()},[m]),o(k.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(k.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const _={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:U,getUser:H,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(Mt,{value:{notificationRecords:_},children:t})}function Be(){const{notificationRecords:t}=y.useContext(rt);return t}const ye={common:{black:"#000",white:"#fff"},primary:{main:"#3773F2",contrastText:"#fff"},secondary:{main:"#16CED1",contrastText:"#fff"},error:{main:"#F16E6E",contrastText:"#fff"},warning:{main:"#DE9E37",contrastText:"#fff"},info:{main:"#0775F8",contrastText:"#fff"},success:{main:"#34BE74",contrastText:"#fff"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{default:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}};ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Kt={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(bt,{type:Kt[t],children:t})}var ze={},Ut=Je;Object.defineProperty(ze,"__esModule",{value:!0});var lt=ze.default=void 0,Ht=Ut(Xe()),$t=e;lt=ze.default=(0,Ht.default)((0,$t.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var We={},Vt=Je;Object.defineProperty(We,"__esModule",{value:!0});var ct=We.default=void 0,Gt=Vt(Xe()),Yt=e;ct=We.default=(0,Gt.default)((0,Yt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case k.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function dt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:jt(o,s)}):"",R=Qt(t,x,a);return r===k.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:R}:r===k.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:R,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Qe=["info","success","error","warning"],ut=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},pt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},Xt=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ut(t),enabled:n}},Jt=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:pt(t),enabled:n}},Zt=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case k.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case k.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case k.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case k.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ft=()=>yt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(vt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(J,{color:"inherit",sx:{fontSize:12},children:R}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(J,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(a=>{const x=dt(r,o,{status:a});return e.jsx(ke,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}Me.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Me({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ze,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:R=>{const m=[...t];R.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(v=>v!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(Me,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=dt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}qe.propTypes={value:d.array.isRequired,onChange:d.func};function qe({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=y.useState(null),x=y.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=y.useCallback(m=>{if(!m.startDate||!m.endDate){X.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){X.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(J,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ve(t[0],n)," - ",Ve(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Wt(r),onChange:R})})]})}Ke.propTypes={itemComponent:d.elementType.isRequired};function Ke({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const as=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ue.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ue.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ue({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=y.useState(as),[x,u]=y.useState(!0),R=(v,S)=>{S.checked=v.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=v=>{v.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(J,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ze,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(v=>e.jsx(Re,{control:e.jsx(Ie,{checked:v.checked,onChange:S=>R(S,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(et,{size:16}),r("common.confirm")]})]})]})}mt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function mt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:R,blocklet:m}=Be(),[v,S]=y.useState(!1),[I,M]=y.useState([]),E=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[D,G]=y.useState(null),[U,H]=y.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,_]=y.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=y.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],P=async()=>{if(!v&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:nt(c.receiverUser.avatar,u,x)}}));M(l),H(i.paging),S(!1)}catch(i){X.error(i.message),S(!1)}};y.useEffect(()=>{P()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Z={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:U.page-1,rowsPerPage:U.pageSize,count:U.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:j})=>{const[,F=[],$=[],K=[]]=j;N.pageSize!==l?_(W=>({...W,pageSize:l,page:1})):N.page!==i+1?_(W=>({...W,page:i+1})):N.searchText!==c?_(W=>({...W,searchText:c,page:1})):ue(F,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||_(W=>({...W,emailSendStatus:K,page:1})):_(W=>({...W,pushKitSendStatus:$,page:1})):_(W=>({...W,walletSendStatus:F,page:1}))},oe=y.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?Zt(c):i==="email"?Xt(m,c):i==="pushKit"?Jt(m,c):i==="webhook"?es(c):!0:!1},[R,m]),se=y.useCallback(i=>ts(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,j="")=>{if(!(!l.length||!i.length))try{s(i,l,c,j),L.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(j=>I[j].receiver);await g(i,c,l),await xe(.5),p(),O([])},T=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(j){X.error(j.response?j.response.statusText:j.message)}},w=async(i,l,c,j=[],F=!0)=>{if(i.stopPropagation(),ss(l,c)>=4){X.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,j,F);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],F),L.anchorEl||(await xe(.5),f()))}catch(K){X.error(K.message)}},Y=i=>{_(l=>({...l,dateRange:i,page:1}))},Q=(i,l,c,j)=>{i.stopPropagation();const F=c.filter($=>$!==l);_($=>({...$,[j]:F,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(tt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(St,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),Q(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:j,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"wallet",onResend:F=>w(F,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"pushkit",onResend:F=>w(F,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),Q(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:j,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"email",onResend:F=>w(F,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),Q(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:j,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[j,F]=c,$=F[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:j},j),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Fe,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),$e=[e.jsx(qe,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(Bt,{}),onClick:()=>P(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(st,{theme:ft(),children:[e.jsx(it,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Z,customButtons:$e,components:{TableFilterList:i=>e.jsx(Ke,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var F,$;const{type:l,pass:c,fail:j}=i;return!(D!=null&&D.result)||(F=D==null?void 0:D.result)!=null&&F[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=D==null?void 0:D.result)!=null&&$[l]?ye.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(lt,{}):e.jsx(et,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(J,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:ye.error.main},children:[e.jsx(ct,{}),e.jsx("span",{children:j})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ue,{loading:n,onCancel:p,onConfirm:b})})]})})})}const is=y.memo(mt),os=ce.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{bB as xt,r as b,bN as ee,bs as V,y as X,A as k,j as e,P as d,T as bt,aP a
27
27
  }
28
28
  font-size: 12px;
29
29
  }
30
- `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ls(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(re,{item:s})},{name:"Push",value:e.jsx(re,{item:n})},{name:"Email",value:e.jsx(re,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(re,{item:o,isWebhook:!0})}]:[]]}function cs(t,s,n){const{wallet:r,push:o,email:a,webhook:x}=t;return[{name:"Wallet",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.EMAIL,item:a,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};re.propTypes={item:d.object.isRequired,isWebhook:d.bool};re.defaultProps={isWebhook:!1};function re({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,a=r===o?"success":"failed";return e.jsx(C,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(C,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ne,{config:{status:a},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}le.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};le.defaultProps={isWebhook:!1,channel:k.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function le({channel:t,item:s,isWebhook:n=!1,onResend:r,loading:o}){const{t:a}=te(),{success:x,failed:u,pending:T}=s,m=ns(t),v=n?x.length:x,S=n?u.length:u,I=n?T.length:T,M=async G=>{G.stopPropagation();const U=n?[...new Set([...x,...u].map(H=>H))]:[];await r([t],[],!0,U)},E=v+S,L=E>0?v/E*100:0,D=E>0?S/E*100:0;return e.jsxs(ds,{successRatio:L,failedRatio:D,children:[e.jsxs(J,{variant:"h6",children:[m," (",s.total,")"]}),e.jsxs(J,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:a("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(ne,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",a("notification.sendStatus.failed")]}),e.jsxs(ne,{config:{status:"pending"},enableTooltip:!1,children:[fe(I)," ",a("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:M,children:a("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:r}){const o=ee(()=>s==="simple"?ls(t):cs(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(a=>e.jsx(ot,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:a.name,children:a.value},a.name))}):e.jsx(Ge,{container:!0,spacing:2,children:o.map(a=>e.jsx(Ge,{item:!0,md:4,sm:6,xs:12,children:a.value},a.name))})}const ds=ce(C)`
30
+ `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ls(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(re,{item:s})},{name:"Push",value:e.jsx(re,{item:n})},{name:"Email",value:e.jsx(re,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(re,{item:o,isWebhook:!0})}]:[]]}function cs(t,s,n){const{wallet:r,push:o,email:a,webhook:x}=t;return[{name:"Wallet",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.EMAIL,item:a,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(le,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};re.propTypes={item:d.object.isRequired,isWebhook:d.bool};re.defaultProps={isWebhook:!1};function re({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,a=r===o?"success":"failed";return e.jsx(C,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(C,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ne,{config:{status:a},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}le.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};le.defaultProps={isWebhook:!1,channel:k.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function le({channel:t,item:s,isWebhook:n=!1,onResend:r,loading:o}){const{t:a}=te(),{success:x,failed:u,pending:R}=s,m=ns(t),v=n?x.length:x,S=n?u.length:u,I=n?R.length:R,M=async G=>{G.stopPropagation();const U=n?[...new Set([...x,...u].map(H=>H))]:[];await r([t],[],!0,U)},E=v+S,L=E>0?v/E*100:0,D=E>0?S/E*100:0;return e.jsxs(ds,{successRatio:L,failedRatio:D,children:[e.jsxs(J,{variant:"h6",children:[m," (",s.total,")"]}),e.jsxs(J,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:a("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(ne,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",a("notification.sendStatus.failed")]}),e.jsxs(ne,{config:{status:"pending"},enableTooltip:!1,children:[fe(I)," ",a("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:M,children:a("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:r}){const o=ee(()=>s==="simple"?ls(t):cs(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(a=>e.jsx(ot,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:a.name,children:a.value},a.name))}):e.jsx(Ge,{container:!0,spacing:2,children:o.map(a=>e.jsx(Ge,{item:!0,md:4,sm:6,xs:12,children:a.value},a.name))})}const ds=ce(C)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{bB as xt,r as b,bN as ee,bs as V,y as X,A as k,j as e,P as d,T as bt,aP a
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;ht.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ht({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:a}=te(),{getComponent:x,resendNotification:u}=Be(),[T,m]=b.useState(!1),v=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),S=De({tab:r||"info"}),I=b.useCallback(async(h,O,A=!0,P=[])=>{var Z;if(!h.length||!t.id)return;const B=O.length>0?O:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(z=>z.receiver);if(!B.length)return;let q=[...h];if(q.includes(k.NOTIFICATION_SEND_CHANNEL.PUSH)&&!pt(n)&&(X.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),q=q.filter(z=>z!==k.NOTIFICATION_SEND_CHANNEL.PUSH)),q.includes(k.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ut(n)&&(X.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),q=q.filter(z=>z!==k.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!q.length)try{m(!0),await u({notificationId:t.id,receivers:B,channels:q,resendFailedOnly:A,...q.includes("webhook")&&P.length?{webhookUrls:P}:{}}),X.success("Message has been sent!")}catch(z){console.error("handleResend error",{error:z}),X.error(z.response?z.response.statusText:z.message)}finally{m(!1)}},[n,t.id,t==null?void 0:t.receivers,u,o]),M=ee(()=>Nt(t),[t]),E=ee(()=>wt(t),[t]),L=ee(()=>M?t==null?void 0:t.actorInfo:[],[t]),D=ee(()=>{var h;return(n==null?void 0:n.did)||((h=n==null?void 0:n.meta)==null?void 0:h.did)||""},[n]);function G(){return[{name:o("notification.from"),value:M&&E?e.jsx(Rt,{actors:L,teamDid:D,size:32,showName:!0}):e.jsx(It,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(he,{maxLength:50,children:t.title})},{name:o("notification.body"),value:M?e.jsx(Et,{notification:t,blocklet:n}):e.jsx(Dt,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(ge,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Fe,{value:t.createdAt,locale:a,shouldUpdate:!0})}].map(O=>e.jsx(ot,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:O.name,children:O.value},O.name))}const U={info:{label:o("common.basicInfo"),value:"info",component:G},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},H=Object.values(U).map(({label:h,value:O})=>({label:h,value:O})),N=U[S.tab]||U.info,_=h=>{S.tab=h};return e.jsx(Tt,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ps,{children:[e.jsx(C,{mx:3,className:"tabs",children:e.jsx(_t,{tabs:H,current:S.tab,onChange:_,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(is,{notificationId:t.id,resending:T,handleResend:I}),S.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:T,onResend:I}),S.tab==="info"&&e.jsx(N.component,{})]})]})})}const us=b.memo(ht),ps=ce.div`
48
+ `;ht.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ht({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:a}=te(),{getComponent:x,resendNotification:u}=Be(),[R,m]=y.useState(!1),v=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),S=De({tab:r||"info"}),I=y.useCallback(async(h,O,A=!0,P=[])=>{var Z;if(!h.length||!t.id)return;const B=O.length>0?O:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(z=>z.receiver);if(!B.length)return;let q=[...h];if(q.includes(k.NOTIFICATION_SEND_CHANNEL.PUSH)&&!pt(n)&&(X.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),q=q.filter(z=>z!==k.NOTIFICATION_SEND_CHANNEL.PUSH)),q.includes(k.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ut(n)&&(X.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),q=q.filter(z=>z!==k.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!q.length)try{m(!0),await u({notificationId:t.id,receivers:B,channels:q,resendFailedOnly:A,...q.includes("webhook")&&P.length?{webhookUrls:P}:{}}),X.success("Message has been sent!")}catch(z){console.error("handleResend error",{error:z}),X.error(z.response?z.response.statusText:z.message)}finally{m(!1)}},[n,t.id,t==null?void 0:t.receivers,u,o]),M=ee(()=>Nt(t),[t]),E=ee(()=>wt(t),[t]),L=ee(()=>M?t==null?void 0:t.actorInfo:[],[t]),D=ee(()=>{var h;return(n==null?void 0:n.did)||((h=n==null?void 0:n.meta)==null?void 0:h.did)||""},[n]);function G(){return[{name:o("notification.from"),value:M&&E?e.jsx(Rt,{actors:L,teamDid:D,size:32,showName:!0}):e.jsx(It,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(he,{maxLength:50,children:t.title})},{name:o("notification.body"),value:M?e.jsx(Et,{notification:t,blocklet:n}):e.jsx(Dt,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(ge,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Fe,{value:t.createdAt,locale:a,shouldUpdate:!0})}].map(O=>e.jsx(ot,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:O.name,children:O.value},O.name))}const U={info:{label:o("common.basicInfo"),value:"info",component:G},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},H=Object.values(U).map(({label:h,value:O})=>({label:h,value:O})),N=U[S.tab]||U.info,_=h=>{S.tab=h};return e.jsx(Tt,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ps,{children:[e.jsx(C,{mx:3,className:"tabs",children:e.jsx(_t,{tabs:H,current:S.tab,onChange:_,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(is,{notificationId:t.id,resending:R,handleResend:I}),S.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:R,onResend:I}),S.tab==="info"&&e.jsx(N.component,{})]})]})})}const us=y.memo(ht),ps=ce.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{bB as xt,r as b,bN as ee,bs as V,y as X,A as k,j as e,P as d,T as bt,aP a
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function me({blocklet:t,label:s}){var n;return e.jsx(fs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(at,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}He.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};He.defaultProps={onDelete:()=>{}};function He({list:t,label:s,onDelete:n}){return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ge,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function ms(t){return e.jsx(Me,{...t,renderLabel:s=>e.jsx(ge,{severity:s})})}function hs({customTableButtons:t}){var se;const{t:s,locale:n}=te(),[r,o]=b.useState(!1),{data:a,paging:x,blocklet:u,fetch:T,getComponent:m,componentDids:v,inService:S,teamDid:I}=Be(),M=b.useRef(null),[E,L]=b.useState(null),[D,G]=b.useState("info"),U=`notification-records-${(se=u.meta)==null?void 0:se.did}`,H=Ft(U),[N,_]=b.useState({pageSize:H.rowsPerPage||10,page:H.page?H.page+1:1,dids:H.dids||[],dateRange:H.dateRange||[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),h=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var y;const g=p.did||((y=p.meta)==null?void 0:y.did);v.includes(g)&&(p.ancestors=[u],f.push(p))}),f},[v,u]),O=b.useCallback(async()=>{try{o(!0),await T(N),o(!1)}finally{o(!1)}},[T,N]);b.useEffect(()=>{O()},[]),b.useEffect(()=>{const f=a.find(p=>p.id===(E==null?void 0:E.id));E&&f&&L({...f})},[a,E]);const A=(f,p,g,y)=>{f.stopPropagation();const R=g.filter(w=>w!==p);_(w=>({...w,[y]:R,page:1}))},P=({page:f,rowsPerPage:p,filterList:g})=>{const[y=[],,,,R=[]]=g;N.pageSize!==p?_(w=>({...w,pageSize:p,page:1})):N.page!==f+1?_(w=>({...w,page:f+1})):ue(N.dids,y)?ue(N.severities,R)||_(w=>({...w,severities:R,page:1})):_(w=>({...w,dids:y,page:1}))},B=b.useCallback(()=>{L(null),G("info")},[]),q=b.useCallback(()=>{T(N)},[T,N]),Z=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,g)=>{var R;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const y=h.find(w=>{var Q;return(w.did||((Q=w.meta)==null?void 0:Q.did))===p});return e.jsx(me,{blocklet:y,label:(y==null?void 0:y.title)||((R=y==null?void 0:y.meta)==null?void 0:R.title)},p)}),update:(f,p,g)=>(f[g].splice(p,1),f)},filterOptions:{names:h,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,g,y)=>e.jsxs(Pe,{style:{width:"380px"},children:[e.jsx(At,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ot,{multiple:!0,value:f[g],renderValue:R=>e.jsx(C,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:R.map(w=>{var Q;if(w==="system")return e.jsx("span",{children:s("notification.system")},w);const Y=h.find(ae=>{var i;return(ae.did||((i=ae.meta)==null?void 0:i.did))===w});return e.jsx(me,{blocklet:Y,label:(Y==null?void 0:Y.title)||((Q=Y==null?void 0:Y.meta)==null?void 0:Q.title)},w)})}),onChange:R=>{f[g]=R.target.value,p(f[g],g,y)},children:[e.jsx(Ye,{value:"system",children:s("notification.system")}),h.map(R=>{var Y,Q;const w=R.did||((Y=R.meta)==null?void 0:Y.did);return e.jsx(Ye,{value:w,children:e.jsx(me,{blocklet:R,label:R.title||((Q=R.meta)==null?void 0:Q.title)})},w)})]})]})},customBodyRenderLite:f=>{var y,R;const p=a[f],g=m(p.componentDid);return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(at,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(Lt,{blocklet:u,size:32}),e.jsx(he,{maxLength:50,children:((y=g==null?void 0:g.meta)==null?void 0:y.title)||((R=u==null?void 0:u.meta)==null?void 0:R.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f],{receivers:g}=p;return e.jsx(kt,{total:g.length,renderSurplus:y=>y<100?e.jsxs("span",{children:["+",y]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:y=>{y.stopPropagation(),L(p),G("receivers")},children:g.map(y=>{const{receiverUser:R}=y,w=nt(R.avatar,I,S);return e.jsx(tt,{alt:R.fullName,src:`${w}?imageFilter=resize&w=48&h=48`,size:32,did:y.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},y.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(C,{onClick:g=>{g.stopPropagation(),L(p),G("statistics")},children:e.jsx(Ne,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(he,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=a[f];return e.jsx(ge,{severity:p.severity})},filter:!0,filterType:"custom",filterList:N.severities??[],customFilterListOptions:{render:f=>e.jsx(He,{list:f,label:s("notification.severity"),onDelete:(p,g)=>{p.stopPropagation(),A(p,g,Z[4].options.filterList,"severities")}}),update:je},filterOptions:{names:Qe,fullWidth:!0,logic:ve,display:(f,p,g,y)=>e.jsx(ms,{label:s("notification.severity"),filterList:f,onChange:p,index:g,column:y,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=a[f];return e.jsx(Fe,{value:p,locale:n,shouldUpdate:!0})}}}],z=f=>{_(p=>({...p,dateRange:f,page:1}))},oe=[...t||[]];return e.jsxs(C,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(gs,{children:e.jsx(st,{theme:ft(),children:e.jsx(it,{className:"main-table",verticalKeyWidth:100,loading:r,locale:n,columns:Z,data:a,durable:U,onChange:P,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...H,onRowClick:(f,{dataIndex:p})=>{L(a[p])}},customPreButtons:[e.jsx(qe,{value:N.dateRange,onChange:z})],customButtons:oe,components:{TableFilterList:f=>e.jsx(Ke,{...f,itemComponent:p=>e.jsx(Ce,{...p,canDelete:g=>{var R;const y=(R=g==null?void 0:g.columnNames)==null?void 0:R[(g==null?void 0:g.index)||0];return(y==null?void 0:y.name)==="sender"}})})}})})}),E&&e.jsx(us,{refresh:q,onCancel:B,notification:E,blocklet:u,tab:D})]})}const gs=ce.div`
95
+ `;function me({blocklet:t,label:s}){var n;return e.jsx(fs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(at,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}He.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};He.defaultProps={onDelete:()=>{}};function He({list:t,label:s,onDelete:n}){return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ge,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function ms(t){return e.jsx(Me,{...t,renderLabel:s=>e.jsx(ge,{severity:s})})}function hs({customTableButtons:t}){var se;const{t:s,locale:n}=te(),[r,o]=y.useState(!1),{data:a,paging:x,blocklet:u,fetch:R,getComponent:m,componentDids:v,inService:S,teamDid:I}=Be(),M=y.useRef(null),[E,L]=y.useState(null),[D,G]=y.useState("info"),U=`notification-records-${(se=u.meta)==null?void 0:se.did}`,H=Ft(U),[N,_]=y.useState({pageSize:H.rowsPerPage||10,page:H.page?H.page+1:1,dids:H.dids||[],dateRange:H.dateRange||[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),h=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var b;const g=p.did||((b=p.meta)==null?void 0:b.did);v.includes(g)&&(p.ancestors=[u],f.push(p))}),f},[v,u]),O=async f=>{try{o(!0),await R(f),o(!1)}finally{o(!1)}};y.useEffect(()=>{O(N)},[N]),y.useEffect(()=>{const f=a.find(p=>p.id===(E==null?void 0:E.id));E&&f&&L({...f})},[a,E]);const A=(f,p,g,b)=>{f.stopPropagation();const T=g.filter(w=>w!==p);_(w=>({...w,[b]:T,page:1}))},P=({page:f,rowsPerPage:p,filterList:g})=>{const[b=[],,,,T=[]]=g;N.pageSize!==p?_(w=>({...w,pageSize:p,page:1})):N.page!==f+1?_(w=>({...w,page:f+1})):ue(N.dids,b)?ue(N.severities,T)||_(w=>({...w,severities:T,page:1})):_(w=>({...w,dids:b,page:1}))},B=y.useCallback(()=>{L(null),G("info")},[]),q=y.useCallback(()=>{R(N)},[R,N]),Z=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,g)=>{var T;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const b=h.find(w=>{var Q;return(w.did||((Q=w.meta)==null?void 0:Q.did))===p});return e.jsx(me,{blocklet:b,label:(b==null?void 0:b.title)||((T=b==null?void 0:b.meta)==null?void 0:T.title)},p)}),update:(f,p,g)=>(f[g].splice(p,1),f)},filterOptions:{names:h,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,g,b)=>e.jsxs(Pe,{style:{width:"380px"},children:[e.jsx(At,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ot,{multiple:!0,value:f[g],renderValue:T=>e.jsx(C,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(w=>{var Q;if(w==="system")return e.jsx("span",{children:s("notification.system")},w);const Y=h.find(ae=>{var i;return(ae.did||((i=ae.meta)==null?void 0:i.did))===w});return e.jsx(me,{blocklet:Y,label:(Y==null?void 0:Y.title)||((Q=Y==null?void 0:Y.meta)==null?void 0:Q.title)},w)})}),onChange:T=>{f[g]=T.target.value,p(f[g],g,b)},children:[e.jsx(Ye,{value:"system",children:s("notification.system")}),h.map(T=>{var Y,Q;const w=T.did||((Y=T.meta)==null?void 0:Y.did);return e.jsx(Ye,{value:w,children:e.jsx(me,{blocklet:T,label:T.title||((Q=T.meta)==null?void 0:Q.title)})},w)})]})]})},customBodyRenderLite:f=>{var b,T;const p=a[f],g=m(p.componentDid);return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(at,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(Lt,{blocklet:u,size:32}),e.jsx(he,{maxLength:50,children:((b=g==null?void 0:g.meta)==null?void 0:b.title)||((T=u==null?void 0:u.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f],{receivers:g}=p;return e.jsx(kt,{total:g.length,renderSurplus:b=>b<100?e.jsxs("span",{children:["+",b]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:b=>{b.stopPropagation(),L(p),G("receivers")},children:g.map(b=>{const{receiverUser:T}=b,w=nt(T.avatar,I,S);return e.jsx(tt,{alt:T.fullName,src:`${w}?imageFilter=resize&w=48&h=48`,size:32,did:b.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},b.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(C,{onClick:g=>{g.stopPropagation(),L(p),G("statistics")},children:e.jsx(Ne,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(he,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=a[f];return e.jsx(ge,{severity:p.severity})},filter:!0,filterType:"custom",filterList:N.severities??[],customFilterListOptions:{render:f=>e.jsx(He,{list:f,label:s("notification.severity"),onDelete:(p,g)=>{p.stopPropagation(),A(p,g,Z[4].options.filterList,"severities")}}),update:je},filterOptions:{names:Qe,fullWidth:!0,logic:ve,display:(f,p,g,b)=>e.jsx(ms,{label:s("notification.severity"),filterList:f,onChange:p,index:g,column:b,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=a[f];return e.jsx(Fe,{value:p,locale:n,shouldUpdate:!0})}}}],z=f=>{_(p=>({...p,dateRange:f,page:1}))},oe=[...t||[]];return e.jsxs(C,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(gs,{children:e.jsx(st,{theme:ft(),children:e.jsx(it,{className:"main-table",verticalKeyWidth:100,loading:r,locale:n,columns:Z,data:a,durable:U,onChange:P,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...H,onRowClick:(f,{dataIndex:p})=>{L(a[p])}},customPreButtons:[e.jsx(qe,{value:N.dateRange,onChange:z})],customButtons:oe,components:{TableFilterList:f=>e.jsx(Ke,{...f,itemComponent:p=>e.jsx(Ce,{...p,canDelete:g=>{var T;const b=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(b==null?void 0:b.name)==="sender"}})})}})})}),E&&e.jsx(us,{refresh:q,onCancel:B,notification:E,blocklet:u,tab:D})]})}const gs=ce.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }
@@ -1 +1 @@
1
- import{j as e,cH as j,M as v,x as P,r as l,f as w,aA as S,u as k,w as b,am as E,aT as K,dn as U,cw as u,bm as W,v as _,Z as R,C as L,dp as T,dq as D}from"./index-Db1NmfnY.js";import{R as d}from"./index-CdIzwolo.js";function a({children:r,...s}){var o,c;return e.jsx(j,{...s,did:((o=window==null?void 0:window.blocklet)==null?void 0:o.appPid)||((c=window==null?void 0:window.env)==null?void 0:c.appPid),children:e.jsx(v,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function z(){const r=P(),{t:s,locale:o}=l.useContext(w),{api:c}=S(),{info:p}=k(),f=b(p),m=E(),n=K({ready:!1,success:!1,error:null,invalidSession:!1}),i=U(),x=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=T(g);if(!D(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};l.useLayoutEffect(()=>x(),[]);const h=u(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=u(()=>{n.success=!0});if(n.invalidSession)return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(W,{style:{color:m.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(a,{children:e.jsx(_,{className:"connect",action:"gen-key-pair",checkFn:c.get,checkTimeout:10*60*1e3,extraParams:{sourceAppPid:i==null?void 0:i.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:f,onSuccess:C,onError:h,locale:o,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(R,{children:e.jsx(L,{})})}export{z as default};
1
+ import{j as e,cG as v,M as j,x as P,r as l,f as S,aA as w,u as k,w as b,am as E,aT as K,dm as U,cv as u,bb as W,v as _,Z as R,C as L,dn as T,dp as D}from"./index-CiCEonKE.js";import{R as d}from"./index-Dj8CUjVy.js";function a({children:r,...s}){var o,c;return e.jsx(v,{...s,did:((o=window==null?void 0:window.blocklet)==null?void 0:o.appPid)||((c=window==null?void 0:window.env)==null?void 0:c.appPid),children:e.jsx(j,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function z(){const r=P(),{t:s,locale:o}=l.useContext(S),{api:c}=w(),{info:p}=k(),f=b(p),m=E(),n=K({ready:!1,success:!1,error:null,invalidSession:!1}),i=U(),x=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=T(g);if(!D(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};l.useLayoutEffect(()=>x(),[]);const h=u(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=u(()=>{n.success=!0});if(n.invalidSession)return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(W,{style:{color:m.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(a,{children:e.jsx(_,{className:"connect",action:"gen-key-pair",checkFn:c.get,checkTimeout:10*60*1e3,extraParams:{sourceAppPid:i==null?void 0:i.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:f,onSuccess:C,onError:h,locale:o,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(R,{children:e.jsx(L,{})})}export{z as default};
@@ -0,0 +1,102 @@
1
+ import{r as h,bo as se,bp as ne,m as D,j as e,R as F,ax as B,P as C,O as E,Q as O,S as V,U as W,A as oe,bq as _,br as fe,aZ as Q,t as U,M as j,B as z,C as G,af as le,f as ge,D as me,aY as he,V as ye,n as N,l as be,bs as je,bt as Ce,W as ae,bu as ve,bv as ke,bw as Te,bx as Ae,by as Se,H as Ke,k as P,bz as we,aB as re,X as De,Y as Re,x as Ie,u as Pe,bn as Be,e as _e,bA as Ne}from"./index-CiCEonKE.js";import{T as Le}from"./index-Bqki_NGY.js";import ze from"./audit-logs-Bi1ieUq6.js";import{T as de,M as $e}from"./index-7G8x7Vl0.js";import{r as pe,P as We}from"./index-DEtsePs-.js";import{u as L,T as qe}from"./team-DLnveWtv.js";import{g as Fe,D as Ue}from"./index-B7k9dkSz.js";import{d as Me}from"./Add-lby-WMVZ.js";import{C as M}from"./click-to-copy-D9mVJ-RV.js";import{f as Ee}from"./index-BojVbZw0.js";import{d as Oe}from"./Delete-Ce85Ql3S.js";import{D as Ve}from"./delete-confirm-CPbaWrD8.js";import{d as Qe}from"./Edit-xi4J_eau.js";import{P as Ge}from"./permission-KtOkmZK5.js";import{u as He}from"./blocklet-DidLj2Zo.js";import{u as Ye}from"./useAsync-UCL8EFNX.js";import"./index-DUWb27J9.js";import"./TableSearch-DEtaWkFM.js";import"./Search-DNO2mA1t.js";import"./Clear-BYnHnNAI.js";import"./useLocalStorage-CX0bausV.js";import"./index-rRNsJfpm.js";import"./shorten-label-3ndfcRTb.js";import"./ViewList-BMlV2vpC.js";import"./resource-dialog-CybAqKK7.js";import"./use-mobile-uaCblfH4.js";import"./index-Dj8CUjVy.js";import"./ListItemButton-CU1frsx_.js";import"./index-DllLiKC-.js";import"./emotion-react.browser.esm-BuYEJ5bP.js";import"./index-BJV-jbRZ.js";import"./url-evaluation-C6gQAust.js";import"./index-C1TWTzPh.js";import"./index-BJHGOv7L.js";import"./HelpOutline-D375iS8p.js";import"./index-BIAPYyhR.js";import"./ButtonGroup-KbsqQYLp.js";import"./getValidReactChildren-BNMVx0A0.js";import"./AdapterDayjs-Bg7uGgbF.js";import"./useThemeProps-ekXTUVYd.js";import"./CSSTransition-umLMVbSI.js";import"./refType-M_fnNR8Y.js";import"./index-CIOf_B3T.js";import"./Verified-QVVCTHQV.js";import"./DeleteOutline-C6TmcfH4.js";import"./ErrorOutline-CCSWIjK_.js";import"./session-CDrB7OKD.js";import"./actions-DWXi51xP.js";import"./MoreHoriz-BBPO3lYM.js";import"./LockIcon-B45Spn4w.js";import"./cloneDeep-25ofqs0f.js";import"./chain-B1DYbRT2.js";import"./list-header-DRRNzO0m.js";import"./ToggleButtonGroup-ieIV-WGx.js";import"./ViewColumn-dIIJ-TaZ.js";import"./MoreVert-CJEwAyrO.js";var Xe=function(s,t){t===void 0&&(t=[]);var u=h.useState(0),f=u[0],d=u[1],i=Ye(s,se(t,[f])),v=i.loading,l=h.useCallback(function(){v||d(function(o){return o+1})},se(t,[v]));return ne(ne({},i),{retry:l})};function H({value:s}){const{t,locale:u}=D(),f=new Date;return new Date(s)<f?e.jsxs("span",{style:{color:"red"},children:[e.jsx(F,{value:s,locale:u}),`${t("setting.accessKey.expired",{time:""})}`]}):B(s,u)}H.propTypes={value:C.string.isRequired};function Y({value:s,onChange:t,...u}){const{t:f}=D();return e.jsxs(E,{style:{width:"100%"},variant:"outlined",...u,children:[e.jsx(O,{children:f("setting.accessKey.authType")}),e.jsxs(V,{value:s,onChange:t,fullWidth:!0,label:f("setting.accessKey.authType"),children:[e.jsx(W,{value:"signature",children:f("common.signature")}),e.jsx(W,{value:"simple",children:f("common.simple")})]})]})}Y.propTypes={value:C.string.isRequired,onChange:C.func.isRequired};const q=()=>{const s=oe.RBAC_CONFIG.roles.filter(d=>d.passport),{inService:t}=_(),{roles:u}=L(),f=[...s,...t?u:[]];return fe(f,"name").filter(d=>d.name!==oe.ROLES.OWNER)};function X(s){const{remark:t,onCreate:u}=s,{api:f}=_(),{teamDid:d}=L(),{t:i}=D(),[v,l]=h.useState(!1),[o,r]=h.useState(null),T=q(),k=()=>{l(!1),r(null)},y=async p=>{const{remark:m,passport:c,authType:n}=p;l(!0);const x=await f.createAccessKey({input:{teamDid:d,remark:m.trim(),passport:c,expireAt:p.expireAt?new Date(p.expireAt).getTime():null,authType:n}}),{data:K}=x;u(K),r(null),l(!1)},g={title:`${i("common.create")} ${i("accessKey")}`,description:(p,m,c)=>e.jsxs(Q,{gap:3,children:[e.jsx(U,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:p.remark,onChange:n=>{m({...p,remark:n.target.value,__disableConfirm:!p.passport||!n.target.value.trim()}),n.target.value.trim()?c(""):c(i("setting.accessKey.remarkInvalid"))}}),e.jsxs(E,{style:{width:"100%"},variant:"outlined",children:[e.jsx(O,{children:i("setting.accessKey.passport")}),e.jsx(V,{"data-cy":"create-access-key-select-passport",value:p.passport,onChange:n=>{const x=n.target.value;c(null),m({...p,passport:x,__disableConfirm:!p.remark||!x})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:v,children:T.map(n=>e.jsx(W,{value:n.name,"data-cy":`create-access-key-passport-option-${n.name}`,children:e.jsxs(j,{children:[e.jsx("span",{children:n.title||n.name}),e.jsx(j,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:n.description})]})},n.name))})]}),e.jsx(Y,{value:p.authType,onChange:n=>{m({...p,authType:n.target.value})}}),e.jsx(de,{placeholder:i("setting.accessKey.expireTime"),value:p.expireAt,onChange:n=>{m({...p,expireAt:n,__disableConfirm:!p.passport||!p.remark||!n})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:y,onCancel:k};return e.jsxs(e.Fragment,{children:[e.jsxs(z,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>r(g),className:"rule-action",children:[v?e.jsx(G,{size:16}):e.jsx(Me,{style:{fontSize:16}}),i("common.create")]}),o&&e.jsx(le,{title:o.title,description:o.description,confirm:o.confirm,color:o.color,cancel:o.cancel,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}X.propTypes={remark:C.string,onCreate:C.func};X.defaultProps={onCreate:()=>{},remark:""};function Z(s){const{onConfirm:t,accessKeyId:u,accessKeySecret:f}=s,{t:d}=h.useContext(ge),[i,v]=h.useState(!1),[l,o]=h.useState(!0),r=()=>{o(!l)},T=k=>{v(k.target.checked)};return e.jsxs(me,{title:d("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:t,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(z,{disabled:!i,onClick:t,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:d("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ze,{children:d("setting.accessKey.saveSecretTip")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(ce,{children:[e.jsx(ie,{children:"Access Key"}),e.jsx(M,{children:u})]}),e.jsxs(ce,{children:[e.jsx(ie,{children:"Access Secret"}),l?e.jsx(z,{"data-cy":"show-secret-btn",color:"primary",onClick:r,children:d("setting.accessKey.showSecret")}):e.jsx(M,{children:f})]}),e.jsx("div",{children:e.jsx(he,{value:"end",disabled:l,control:e.jsx(ye,{checked:i,onChange:T}),label:d("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}Z.propTypes={accessKeyId:C.string.isRequired,accessKeySecret:C.string.isRequired,onConfirm:C.func};Z.defaultProps={onConfirm:()=>{}};const ie=N.div`
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ font-size: 16px;
6
+ margin-bottom: 8px;
7
+ `,ce=N.div`
8
+ margin-bottom: 24px;
9
+ `,Ze=N.div`
10
+ font-size: 16px;
11
+ font-weight: bold;
12
+ `;function J(s){const{t,locale:u}=D(),{api:f}=_(),{teamDid:d}=L(),[i,v]=h.useState(!1),[l,o]=h.useState(null),{accessKeyId:r,time:T,remark:k,onDelete:y=()=>{}}=s,g=()=>{v(!1),o(null)},p=async()=>{v(!0);try{await f.deleteAccessKey({input:{teamDid:d,accessKeyId:r}}),y()}catch(n){console.error(n)}finally{v(!1),o(null)}},m=n=>({key:`<b>${r}</b>`,name:`<b>${k}</b>`,time:B(n,u),timeAge:Ee(new Date(n),be(u))}),c={keyName:k,title:t("setting.accessKey.title"),description:T?`${t("setting.accessKey.description",m(T))}`:`${t("setting.accessKey.descriptionNoTime",{key:`<b>${r}</b>`,name:`<b>${k}</b>`})}`,confirmPlaceholder:t("setting.accessKey.confirm_desc",{name:k}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:p,onCancel:g};return e.jsxs(e.Fragment,{children:[e.jsxs(z,{edge:"end",onClick:n=>{n.stopPropagation(),o(c)},size:"small",className:"rule-action",color:"error",children:[i?e.jsx(G,{size:16}):e.jsx(Oe,{style:{fontSize:16}}),t("common.delete")]}),l&&e.jsx(Ve,{keyName:l.keyName,title:l.title,description:l.description,confirmPlaceholder:l.confirmPlaceholder,confirm:l.confirm,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}J.propTypes={accessKeyId:C.string.isRequired,time:C.string.isRequired,remark:C.string.isRequired,onDelete:C.func};J.defaultProps={onDelete:()=>{}};function ee(s){const{accessKeyId:t,remark:u,onUpdate:f,passport:d,expireAt:i,authType:v}=s,{api:l}=_(),{teamDid:o}=L(),{t:r}=D(),[T,k]=h.useState(!1),[y,g]=h.useState(null),p=q(),m=()=>{k(!1),g(null)},c=async x=>{const{accessKeyId:K,remark:I="",passport:b,expireAt:R,authType:$}=x;k(!0),await l.updateAccessKey({input:{teamDid:o,accessKeyId:K,remark:I.trim(),passport:b,expireAt:R?new Date(R).getTime():null,authType:$}}),f(),g(null),k(!1)},n={title:`${r("common.update")} ${r("accessKey")}`,description:(x,K,I)=>e.jsxs(Q,{gap:3,children:[e.jsx(U,{label:r("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:x.accessKeyId,disabled:!0}),e.jsx(U,{label:r("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:x.remark,onChange:b=>{K({...x,remark:b.target.value,__disableConfirm:!b.target.value.trim()}),b.target.value.trim()?I(""):I(r("setting.accessKey.remarkInvalid"))}}),e.jsxs(E,{style:{width:"100%"},variant:"outlined",children:[e.jsx(O,{children:r("setting.accessKey.passport")}),e.jsx(V,{"data-cy":"update-access-key-select-passport",value:x.passport,onChange:b=>{const R=b.target.value;I(null),K({...x,passport:R,__disableConfirm:!x.remark||!R})},fullWidth:!0,label:r("setting.accessKey.passport"),disabled:T,children:p.map(b=>e.jsx(W,{value:b.name,"data-cy":`update-access-key-passport-option-${b.name}`,children:e.jsxs(j,{children:[e.jsx("span",{children:b.title||b.name}),e.jsx(j,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:b.description})]})},b.name))})]}),e.jsx(Y,{disabled:!0,value:x.authType,onChange:b=>{K({...x,authType:b.target.value})}}),e.jsx(de,{placeholder:r("setting.accessKey.expireTime"),value:x.expireAt,onChange:b=>{K({...x,expireAt:b,__disableConfirm:!x.passport||!x.remark||!b})}})]}),confirm:r("common.confirm"),cancel:r("common.cancel"),color:"primary",params:{accessKeyId:t,remark:u,passport:d,expireAt:i,authType:v},onConfirm:c,onCancel:m};return e.jsxs(e.Fragment,{children:[e.jsxs(z,{edge:"end",onClick:x=>{x.stopPropagation(),g(n)},size:"small",className:"rule-action",color:"primary",children:[T?e.jsx(G,{size:16}):e.jsx(Qe,{style:{fontSize:16}}),r("common.update")]}),y&&e.jsx(le,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}ee.propTypes={accessKeyId:C.string.isRequired,remark:C.string,passport:C.string,expireAt:C.string,authType:C.string,onUpdate:C.func};ee.defaultProps={onUpdate:()=>{},remark:"",passport:"",expireAt:"",authType:"signature"};function te({accessKey:s,onCancel:t}){const{t:u}=D();return e.jsx(me,{title:u("accessKey"),onClose:t,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(Je,{children:e.jsx(ue,{accessKey:s})})})}te.propTypes={accessKey:C.object.isRequired,onCancel:C.func.isRequired};te.defaultProps={};const Je=N(j)`
13
+ margin-top: -16px;
14
+
15
+ .tabs {
16
+ margin-left: 0;
17
+ margin-right: 0;
18
+ }
19
+ `;function ue({accessKey:s}){var p,m;const{t,locale:u}=D(),{api:f}=_(),{teamDid:d}=L(),{blocklet:i}=He(),v=q(),l=h.useCallback(async c=>c?(await f.getUser({input:{teamDid:d,user:{did:c}}})).user:null,[f,d]),o=je(()=>l(s.createdBy),{}),r=((i==null?void 0:i.children)||[]).find(c=>{var n;return((n=c==null?void 0:c.meta)==null?void 0:n.did)===s.componentDid}),T=h.useMemo(()=>{var c;return Ce((c=o==null?void 0:o.data)==null?void 0:c.avatar,d,!0)},[(p=o==null?void 0:o.data)==null?void 0:p.avatar,d]),k=v.find(c=>c.name===s.passport),y=k?k.title:s.passport,g=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(ae,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(M,{children:`blocklet-${ve.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(j,{children:pe(y,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:o!=null&&o.data?e.jsx(j,{sx:{display:"flex",alignItems:"center",".MuiAvatar-root":{width:32,height:32}},children:e.jsx(ke,{user:{...o.data,avatar:T},showDid:!0,cardType:Te.Detailed,infoType:Ae.Minimal,sx:{border:0,padding:0}})}):s.createdBy?e.jsx(ae,{did:s.createdBy,showQrcode:!0}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?B(s.createdAt,u):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?B(s.lastUsedAt,u):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(H,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...r?[{label:t("setting.accessKey.component"),content:e.jsxs(j,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Se,{blocklet:r,ancestors:[i]}),e.jsx(j,{ml:"16px",sx:{minWidth:0},children:e.jsxs(j,{className:"component-header",children:[e.jsx(j,{className:"component-name",children:Ke.getDisplayName(r,!0)}),e.jsx(j,{className:"component-version",children:(m=r==null?void 0:r.meta)==null?void 0:m.version})]})})]},r)}]:[]]}];return e.jsx(et,{gap:3,children:e.jsx(j,{className:"info-area",children:g.map(c=>e.jsxs(j,{mb:3,children:[e.jsx(P,{variant:"h6",sx:{mb:1.5},children:c.title}),e.jsx(j,{className:"info-grid",children:c.items.map(n=>e.jsxs(j,{className:"info-item",children:[e.jsx(j,{className:"info-label",children:e.jsx(P,{variant:"subtitle2",color:"textSecondary",children:n.label})}),e.jsx(j,{children:n.content})]},n.label))})]},c.title))})})}ue.propTypes={accessKey:C.object.isRequired};const et=N(Q)`
20
+ .info-card {
21
+ margin-bottom: 24px;
22
+ overflow: hidden;
23
+ }
24
+
25
+ .card-content {
26
+ display: flex;
27
+ gap: 32px;
28
+ padding: 24px;
29
+ }
30
+
31
+ .passport-image {
32
+ width: 150px;
33
+ flex-shrink: 0;
34
+ transition: transform 0.2s ease-in-out;
35
+ cursor: pointer;
36
+
37
+ &:hover {
38
+ transform: scale(1.05);
39
+ }
40
+ }
41
+
42
+ .info-area {
43
+ flex: 1;
44
+ display: flex;
45
+ flex-direction: column;
46
+ }
47
+
48
+ .info-header {
49
+ padding-bottom: 16px;
50
+ border-bottom: 1px solid #eee;
51
+ }
52
+
53
+ .info-grid {
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: 12px;
57
+ }
58
+
59
+ .info-item {
60
+ display: flex;
61
+ gap: 8px;
62
+ }
63
+
64
+ .info-label {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 8px;
68
+ width: 100px;
69
+ }
70
+
71
+ .logs-card {
72
+ .card-header {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 8px;
76
+ padding: 16px 24px;
77
+ border-bottom: 1px solid #eee;
78
+ }
79
+
80
+ .MuiTimeline-root {
81
+ padding: 24px;
82
+ }
83
+
84
+ .MuiTimelineContent-root {
85
+ padding: 0px 16px;
86
+ }
87
+
88
+ .MuiTimelineDot-root {
89
+ margin: 0;
90
+ }
91
+ }
92
+ `;function tt(){var R,$;const{t:s,locale:t}=D(),{api:u,inService:f}=_(),{teamDid:d}=L(),[i,v]=h.useState({}),[l,o]=h.useState(null),r=q(),T=h.useRef(null),k=`access-keys-${d}`,y=Fe(k),[g,p]=h.useState({searchText:y.searchText||"",pageSize:y.rowsPerPage||10,page:1}),m=Xe(async()=>await u.getAccessKeys({input:{teamDid:d,paging:{page:g.page,pageSize:g.pageSize}}}),[g.page,g.pageSize]),{loading:c,error:n}=m,x=h.useMemo(()=>{var a;return((a=m.value)==null?void 0:a.list)||[]},[(R=m.value)==null?void 0:R.list]),K=h.useMemo(()=>[{label:s("common.name"),name:"remark",options:{customBodyRender:(a,{rowIndex:S})=>{const A=x[S];return e.jsx(j,{display:"flex",alignItems:"center",gap:2,children:e.jsx(P,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:a=>e.jsx(we,{showDidLogo:!1,children:a})}},{label:s("common.role"),name:"passport",options:{customBodyRender:a=>{const S=r.find(w=>w.name===a),A=S?S.title:a;return e.jsx(j,{children:pe(A,a)})}}},{label:s("common.createdVia"),name:"createdVia",options:{customBodyRender:a=>e.jsx(P,{children:a})}},{label:s("setting.accessKey.authType"),name:"authType",options:{customBodyRender:a=>e.jsx(P,{children:a})}},{label:s("common.createdAt"),name:"createdAt",options:{customBodyRender:a=>e.jsx(re,{title:B(a,t),children:a?e.jsx(F,{value:a,locale:t}):"-"})}},{label:s("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:a=>e.jsx(re,{title:B(a,t),children:a?e.jsx(F,{value:a,locale:t}):"-"})}},{label:s("common.expiredAt"),name:"expireAt",options:{customBodyRender:a=>a?e.jsx(H,{value:a}):s("common.neverExpired")}},{label:s("common.actions"),name:"actions",width:100,options:{customBodyRender:(a,{rowIndex:S})=>{const A=x[S];return e.jsxs(j,{display:"flex",gap:1,children:[e.jsx(ee,{...A,onUpdate:m.retry}),e.jsx(J,{accessKeyId:A.accessKeyId,time:A.lastUsedAt,remark:A.remark||"N/A",onDelete:m.retry})]})}}}],[x,t,s,m.retry,r]),I=({page:a,rowsPerPage:S,searchText:A})=>{g.pageSize!==S?p(w=>({...w,searchText:"",pageSize:S,page:1})):g.page!==a+1?p(w=>({...w,searchText:"",page:a+1})):g.searchText!==A&&p(w=>({...w,searchText:A,page:1}))},b=g.searchText?x.filter(a=>a.accessKeyId.toLowerCase().includes(g.searchText.toLowerCase())||(a.remark||"").toLowerCase().includes(g.searchText.toLowerCase())):x;return n?e.jsx(De,{severity:"error",children:Re(n)}):e.jsxs(j,{ref:T,sx:{".custom-toobar-btns":{gap:"8px"}},children:[e.jsx(Ue,{durable:k,durableKeys:["page","rowsPerPage"],data:b,columns:K,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:g.page-1,rowsPerPage:g.pageSize,count:(($=m.value)==null?void 0:$.count)||0,searchDebounceTime:600,onRowClick(a,{dataIndex:S},A){var w;if((w=T.current)!=null&&w.contains(A.target)){const xe=b[S];o(xe)}}},loading:c,onChange:I,customButtons:[e.jsx(Ge,{permission:f?"":"mutate_accessKey",children:e.jsx(X,{onCreate:a=>{const{accessKeyId:S,accessKeySecret:A}=a;v({show:!0,accessKeyId:S,accessKeySecret:A})}})})]}),i.show&&e.jsx(Z,{onConfirm:()=>{m.retry(),v({show:!1})},...i}),l&&e.jsx(te,{onCancel:()=>o(null),accessKey:l})]})}function st(){return e.jsx(tt,{})}function rs(){const s=Ie(),{t}=D(),{info:u}=Pe(),{tab:f="members"}=Be(),d=m=>Ne(m,u),{data:i}=_e(),v=h.useCallback(m=>{const c=i.find(n=>[n.meta.did,n.appDid,n.appPid].includes(m));return c?c.meta.title:"Server"},[i]),l=h.useRef(null);l.current=v;const o=h.useCallback(()=>e.jsx(ze,{showScope:!0,scopeFormatter:l.current}),[]),r=h.useCallback(()=>e.jsx($e,{type:"server",createPassportSvg:d}),[]),T=u.did,k=m=>{s(`/team/${m}`)},y={members:{label:t("common.members"),value:"members",component:r},passports:{label:t("team.member.passports"),value:"passports",component:We},"access-keys":{label:t("common.accessKey"),value:"access-keys",component:st},"audit-logs":{label:t("common.auditLogs"),value:"audit-logs",component:o}},g=Object.values(y).map(({label:m,value:c})=>({label:m,value:c})),p=y[f]||y.member;return e.jsx(qe,{teamDid:T,children:e.jsxs(nt,{children:[e.jsx(P,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("common.team")}),e.jsx(Le,{tabs:g,current:f,onChange:k,scrollButtons:"auto"}),e.jsx("div",{className:"page-content",children:e.jsx(p.component,{createPassportSvg:d})})]})})}const nt=N.main`
93
+ .page-header {
94
+ display: flex;
95
+ justify-content: space-between;
96
+ align-items: center;
97
+ }
98
+
99
+ .page-content {
100
+ margin-top: 24px;
101
+ }
102
+ `;export{rs as default};