@abtnode/blocklet-services 1.16.43-beta-20250420-132156-d732158a → 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 (277) hide show
  1. package/api/routes/mcp.js +60 -26
  2. package/api/services/auth/connect/gen-access-key.js +9 -2
  3. package/api/services/auth/session.js +11 -5
  4. package/api/services/mcp/server.js +7 -6
  5. package/api/services/notification/queue.js +25 -4
  6. package/api/services/oauth/server.js +1 -1
  7. package/api/socket/channel/did.js +13 -7
  8. package/api/util/attach-shared-utils.js +6 -1
  9. package/dist/assets/{AdapterDayjs-Bq_2AanQ.js → AdapterDayjs-DT-SVlwP.js} +1 -1
  10. package/dist/assets/{ArrowDropDown-CnO3M65x.js → ArrowDropDown-D0s0w2rW.js} +1 -1
  11. package/dist/assets/{CheckCircle-vHBx3yBd.js → CheckCircle-BMPTHnwd.js} +1 -1
  12. package/dist/assets/{ChevronLeft-J2DjxamT.js → ChevronLeft-BV65HBup.js} +1 -1
  13. package/dist/assets/{ChevronRight-CbbryV_W.js → ChevronRight-CSrWhu1k.js} +1 -1
  14. package/dist/assets/{Community-eISlOOkV.js → Community-B6sqs6QK.js} +1 -1
  15. package/dist/assets/{DeleteOutline-D3rMfe5l.js → DeleteOutline-BwlJCwaD.js} +1 -1
  16. package/dist/assets/{Done-BKjm-wNl.js → Done-ClKUqna8.js} +1 -1
  17. package/dist/assets/{Download-dWBmoIIz.js → Download-DydXtD3g.js} +1 -1
  18. package/dist/assets/{Edit-BsIdXKZ9.js → Edit-Cydc64DB.js} +1 -1
  19. package/dist/assets/{EditIcon-CQgpOLLT.js → EditIcon-B3vzcBhw.js} +1 -1
  20. package/dist/assets/{Email-BWTg6iJI.js → Email-DscM5ZVr.js} +1 -1
  21. package/dist/assets/{Error-BhDI-TWw.js → Error-BUxloyCF.js} +1 -1
  22. package/dist/assets/{ExpandLess-ap4H2881.js → ExpandLess-D3psCjh2.js} +1 -1
  23. package/dist/assets/{Google-yY5m8tgo.js → Google-nw2S1BAe.js} +1 -1
  24. package/dist/assets/{Holiday-C3bRTVlx.js → Holiday-COvP72sQ.js} +1 -1
  25. package/dist/assets/{InfoOutlined-xdatqyfu.js → InfoOutlined-K2cm3ASV.js} +1 -1
  26. package/dist/assets/{Launch-C6_9RwNa.js → Launch-DSlNzUJo.js} +1 -1
  27. package/dist/assets/{LaunchOutlined-CG63jbPx.js → LaunchOutlined-DB41H1FZ.js} +1 -1
  28. package/dist/assets/{Location-C_mUMqZP.js → Location-DSdE-EW4.js} +1 -1
  29. package/dist/assets/{LockIcon-G8zLxYzV.js → LockIcon-Yic1ETPw.js} +1 -1
  30. package/dist/assets/{Meeting-vvmUKHs1.js → Meeting-DlfumstQ.js} +1 -1
  31. package/dist/assets/{MoreHoriz-ylsvAqcI.js → MoreHoriz-BWdkQIhx.js} +1 -1
  32. package/dist/assets/{OffSick-BTxtVws3.js → OffSick-CG2hJbSq.js} +1 -1
  33. package/dist/assets/{Phone-Cz_yY8ed.js → Phone-DkIl-1KJ.js} +1 -1
  34. package/dist/assets/{PlayArrow-B-b0Dvp8.js → PlayArrow-DfQEcw-G.js} +1 -1
  35. package/dist/assets/{QuestionMarkCircle-DeAbZuzW.js → QuestionMarkCircle-TVw9KuLr.js} +1 -1
  36. package/dist/assets/{ServerLogo-UZVUmHWK.js → ServerLogo-DQ3yw9lw.js} +1 -1
  37. package/dist/assets/{Timezone-5RxC7sK-.js → Timezone-B77bSXNW.js} +1 -1
  38. package/dist/assets/{TuneOutlined-DJ2Nw9gU.js → TuneOutlined-8KrrUCQF.js} +1 -1
  39. package/dist/assets/{ViewList-DYqpQSjn.js → ViewList-Bql1EC1c.js} +1 -1
  40. package/dist/assets/{WorkingRemotely-_QD8QN72.js → WorkingRemotely-DNUERtUR.js} +1 -1
  41. package/dist/assets/{access-control-DcIGjdcM.js → access-control-Bcd_n74E.js} +1 -1
  42. package/dist/assets/actions-f0wKxzR1.js +1 -0
  43. package/dist/assets/{add-component-core-BpT5fbHq.js → add-component-core-BUAlsG4_.js} +24 -24
  44. package/dist/assets/add-resource-Djfsmv61.js +1 -0
  45. package/dist/assets/{addon-DXuj5GtV.js → addon-BkBy38_b.js} +1 -1
  46. package/dist/assets/{advanced-CIJNFJAE.js → advanced-BPM38tnR.js} +1 -1
  47. package/dist/assets/api-BrU7j0QA.js +1 -0
  48. package/dist/assets/{appearance-CCLVRyLq.js → appearance-DUNDV_8X.js} +1 -1
  49. package/dist/assets/ar-BNaEJSr3.js +7 -0
  50. package/dist/assets/ar-wbCXBm9M.js +1 -0
  51. package/dist/assets/{audit-logs-brXiMrw_.js → audit-logs-ClIsZeWB.js} +3 -3
  52. package/dist/assets/authorize-Czqr5dx0.js +1 -0
  53. package/dist/assets/{base32-Dd6rPCV6.js → base32-CXHhcaAE.js} +1 -1
  54. package/dist/assets/{branding-31ZnkyoG.js → branding-CDVXldZI.js} +1 -1
  55. package/dist/assets/branding-Dr6iifVv.js +40 -0
  56. package/dist/assets/bundle-avatar-CXZCyfoQ.js +1 -0
  57. package/dist/assets/button-n0UOGLKx.js +1 -0
  58. package/dist/assets/click-to-copy-CYn1U-tf.js +1 -0
  59. package/dist/assets/cloneDeep-SfcdeqEN.js +1 -0
  60. package/dist/assets/{complete-Cpcoq6Ge.js → complete-C-F4GC22.js} +2 -2
  61. package/dist/assets/{component-Djsamap6.js → component-DsEe2qX3.js} +3 -3
  62. package/dist/assets/{config-BQ9p6EgE.js → config-A_My2cMO.js} +1 -1
  63. package/dist/assets/{config-BK2qWQnO.js → config-DYPbZpg_.js} +2 -2
  64. package/dist/assets/{config-navigation-D2PpiTzz.js → config-navigation-Bi-pxL5K.js} +6 -6
  65. package/dist/assets/{config-space-BFcXXNuJ.js → config-space-DVjhjgJC.js} +1 -1
  66. package/dist/assets/confirm-BshZuFnD.js +7 -0
  67. package/dist/assets/{connect-rWOVXBvz.js → connect-BPsVsyF2.js} +1 -1
  68. package/dist/assets/{connect-Bzett2rh.js → connect-DQxK32G8.js} +1 -1
  69. package/dist/assets/connect-to-DXXf0Nkb.js +1 -0
  70. package/dist/assets/{content-layout-Cg5RRv1R.js → content-layout-AHDEW7YQ.js} +1 -1
  71. package/dist/assets/dashboard-CCzZLCC4.js +280 -0
  72. package/dist/assets/de-8GAnQkrt.js +1 -0
  73. package/dist/assets/de-BsZVQmUM.js +7 -0
  74. package/dist/assets/delete-confirm-DuoSMgmG.js +1 -0
  75. package/dist/assets/{did-address-gmPYOGuy.js → did-address-Cg-ez88b.js} +1 -1
  76. package/dist/assets/domain-B57opALw.js +9 -0
  77. package/dist/assets/domain-action-card-DGNzWGpO.js +24 -0
  78. package/dist/assets/domains-DSFXU6AI.js +1 -0
  79. package/dist/assets/{dot-BBxUn__M.js → dot-tsWWWiOg.js} +2 -2
  80. package/dist/assets/{email-BAajjNQV.js → email-DWoydsl3.js} +3 -3
  81. package/dist/assets/{empty-spinner-yzHJfTIe.js → empty-spinner-D_1iEwTc.js} +1 -1
  82. package/dist/assets/es-DsjXdm2X.js +1 -0
  83. package/dist/assets/es-ntlJbt-a.js +7 -0
  84. package/dist/assets/{exchange-passport-EldPKAEU.js → exchange-passport-DysHnVpr.js} +1 -1
  85. package/dist/assets/{format-error-LAoTjvJe.js → format-error-BrmqJs5a.js} +1 -1
  86. package/dist/assets/fr-B-64BlVz.js +1 -0
  87. package/dist/assets/fr-Bv4B0MVB.js +7 -0
  88. package/dist/assets/{fuel-g6aTZdFA.js → fuel-TLPi2Hr-.js} +1 -1
  89. package/dist/assets/gen-access-key-D4caSeDS.js +2 -0
  90. package/dist/assets/{get-safe-url-BpQyWsMx.js → get-safe-url-Bz4L9R5-.js} +1 -1
  91. package/dist/assets/{get-safe-url-DGJYpGp-.js → get-safe-url-Dex6FTwp.js} +1 -1
  92. package/dist/assets/hi-CY-kyCxp.js +1 -0
  93. package/dist/assets/hi-DIf_hqVB.js +5 -0
  94. package/dist/assets/{home-DBeMBDeM.js → home-CBFACtB_.js} +1 -1
  95. package/dist/assets/id-BT_84X-S.js +1 -0
  96. package/dist/assets/id-DZBgOnwF.js +7 -0
  97. package/dist/assets/{iframe-DTWkOiY8.js → iframe-B4jzt2b3.js} +1 -1
  98. package/dist/assets/{index-B1r8E4TH.js → index-3r4UtN8A.js} +1 -1
  99. package/dist/assets/{index-C6wFIF6L.js → index-ARVZ7FJv.js} +2 -2
  100. package/dist/assets/index-B0-4M8vb.js +10 -0
  101. package/dist/assets/index-B1ljmpu4.css +1 -0
  102. package/dist/assets/{index-CgtY16Wm.js → index-BG5LYRZd.js} +1 -1
  103. package/dist/assets/index-BOEhBltr.js +113 -0
  104. package/dist/assets/{index-C8lvmI4i.js → index-BXkEM7e9.js} +1 -1
  105. package/dist/assets/{index-BjmnM2sd.js → index-Bdp7LpPc.js} +1 -1
  106. package/dist/assets/index-Birdle6P.js +224 -0
  107. package/dist/assets/{index-CEMXycV7.js → index-BowdADDJ.js} +1 -1
  108. package/dist/assets/{index-D7Oq5q89.js → index-BplAimRX.js} +4 -4
  109. package/dist/assets/{index-DhAVA9HZ.js → index-C3f1mXja.js} +3 -3
  110. package/dist/assets/{index-BkHi7e8i.js → index-CGe7n5Gc.js} +2 -2
  111. package/dist/assets/{index-pV_0wOyY.js → index-CPE8Apzb.js} +1 -1
  112. package/dist/assets/index-CSARD20E.js +346 -0
  113. package/dist/assets/index-CU8fxqsS.js +1 -0
  114. package/dist/assets/index-CVvs-hHV.js +708 -0
  115. package/dist/assets/{index-haYY8BAk.js → index-CYeIiQ6Q.js} +1 -1
  116. package/dist/assets/{index-B0Z8409R.js → index-Cks6t9cs.js} +1 -1
  117. package/dist/assets/index-DEAA6iri.js +92 -0
  118. package/dist/assets/index-DKq7-33g.js +55 -0
  119. package/dist/assets/{index-C9TPKuLt.js → index-DO1hKTlI.js} +1 -1
  120. package/dist/assets/{index-BfbxxLBr.js → index-DPpP2Hz6.js} +9 -9
  121. package/dist/assets/{index-tUQxVYYQ.js → index-DVQCgvFb.js} +1 -1
  122. package/dist/assets/{index-Xi3jaVFs.js → index-DomukIqT.js} +1 -1
  123. package/dist/assets/{index-Bh63LaOx.js → index-MbAvBCGD.js} +2 -2
  124. package/dist/assets/{index-KWGv7rf_.js → index-NRj7GpkA.js} +2 -2
  125. package/dist/assets/{index-kqlC8JFQ.js → index-YbJjfDTR.js} +1 -1
  126. package/dist/assets/{invitation-DnZ_Ex8p.js → invitation-7bE4cIXB.js} +5 -5
  127. package/dist/assets/invite-COQN-rNg.js +1 -0
  128. package/dist/assets/issue-passport-11S7tmQW.js +1 -0
  129. package/dist/assets/{item-VCJ7-Z3r.js → item-BeeQ2vgS.js} +2 -2
  130. package/dist/assets/ja-8jRYJGVw.js +7 -0
  131. package/dist/assets/ja-BMmtgJml.js +1 -0
  132. package/dist/assets/ko-C4pbuwv8.js +7 -0
  133. package/dist/assets/ko-ChmGYnnx.js +1 -0
  134. package/dist/assets/{landing-page-QhzHIr--.js → landing-page-DfhVYZ3b.js} +1 -1
  135. package/dist/assets/{launch-result-message-Ckk5lRW7.js → launch-result-message-CCo4xyOd.js} +1 -1
  136. package/dist/assets/{layout-0YBKzIlI.js → layout-DToDlHEw.js} +1 -1
  137. package/dist/assets/{list-Dw9DDKoC.js → list-ChvGKHw5.js} +9 -8
  138. package/dist/assets/{list-header-BYlc5SI1.js → list-header-C7I2nEkf.js} +1 -1
  139. package/dist/assets/localization-DfJCYesK.js +1 -0
  140. package/dist/assets/{log-BLTzXOlE.js → log-DwhNr5TA.js} +1 -1
  141. package/dist/assets/logger-DwVuCvCH.js +1 -0
  142. package/dist/assets/{login-tmff27IK.js → login-_FUfsuwA.js} +1 -1
  143. package/dist/assets/{login-oauth-callback-DnYvzeVx.js → login-oauth-callback-BfAWMSC0.js} +1 -1
  144. package/dist/assets/logo-uploader-CYJXgjdA.js +133 -0
  145. package/dist/assets/{lost-passport-DiKkPtUB.js → lost-passport-bl0QaFCp.js} +4 -4
  146. package/dist/assets/{lottie-react.esm-CPHH620R.js → lottie-react.esm-D2t-u0YU.js} +1 -1
  147. package/dist/assets/{lottie-web-B6s7dDoL.js → lottie-web-jYmAQWuC.js} +1 -1
  148. package/dist/assets/omit-bLid3PKQ.js +1 -0
  149. package/dist/assets/{open-window-DjL5TW3X.js → open-window-BTH_1q7i.js} +1 -1
  150. package/dist/assets/{overview-zOWtcWbm.js → overview-D4gQwSex.js} +2 -2
  151. package/dist/assets/{page-header-BhpaMk9g.js → page-header-DWEFpJCI.js} +1 -1
  152. package/dist/assets/{passport-item-Cxkhzo-W.js → passport-item-Z9x6DkU5.js} +1 -1
  153. package/dist/assets/{permission-_ttLx53e.js → permission-CDRSpazM.js} +1 -1
  154. package/dist/assets/preferences-Dck4NebC.js +1 -0
  155. package/dist/assets/profile-embed-CJdf2c_q.js +1 -0
  156. package/dist/assets/pt-CMeQ7KWn.js +5 -0
  157. package/dist/assets/pt-DjThuHre.js +1 -0
  158. package/dist/assets/publish-resource-CaRrvCS8.js +1 -0
  159. package/dist/assets/{raf-schd.esm-GV-XhwE0.js → raf-schd.esm-B3j6BePR.js} +1 -1
  160. package/dist/assets/{react-beautiful-dnd.esm-gUY08qHq.js → react-beautiful-dnd.esm-CP-WHcip.js} +1 -1
  161. package/dist/assets/{relative-time-DYjTOclf.js → relative-time-4f6xdgg-.js} +1 -1
  162. package/dist/assets/ru-8cWKcW3b.js +5 -0
  163. package/dist/assets/ru-CI1dkyMC.js +1 -0
  164. package/dist/assets/runtime-r0b7mSwp.js +1 -0
  165. package/dist/assets/sdk-fuEXLKzh.js +1 -0
  166. package/dist/assets/{security-BD2-azah.js → security-CLc8EI2b.js} +4 -4
  167. package/dist/assets/session-CmpGpqja.js +1 -0
  168. package/dist/assets/setup-C0tLi0hm.js +19 -0
  169. package/dist/assets/{shorten-label-8jfEkawx.js → shorten-label-CE57Fd6E.js} +1 -1
  170. package/dist/assets/{simple-select-CNZc1N7Q.js → simple-select-rdkVpCfB.js} +1 -1
  171. package/dist/assets/{slicedToArray-gyBkcGHe.js → slicedToArray-BBoi0da6.js} +1 -1
  172. package/dist/assets/{spaces-B_YG3iE7.js → spaces-Cf25Nw85.js} +1 -1
  173. package/dist/assets/{start-DIhK4VNY.js → start-CrRC75qe.js} +1 -1
  174. package/dist/assets/{status-CQCKGmiV.js → status-BSBLuo2u.js} +1 -1
  175. package/dist/assets/{step-actions-DGcZdY1e.js → step-actions-YXGJQMCB.js} +1 -1
  176. package/dist/assets/{studio-CC8lU96f.js → studio-wUJ0pUIv.js} +1 -1
  177. package/dist/assets/{switch-control-BWuo2NQH.js → switch-control-D0bd_WCg.js} +1 -1
  178. package/dist/assets/th-4Bnumejd.js +1 -0
  179. package/dist/assets/th-DYYGBboI.js +5 -0
  180. package/dist/assets/{traffic-BIz-TYy2.js → traffic-BhA3A82Z.js} +2 -2
  181. package/dist/assets/{transfer-OroSS_fF.js → transfer-BmP7JwN2.js} +1 -1
  182. package/dist/assets/{unsubscribe-cKpP6HeV.js → unsubscribe-zK0TSWH3.js} +1 -1
  183. package/dist/assets/{use-app-logo-C5KrAQp3.js → use-app-logo-DAnHvb1d.js} +1 -1
  184. package/dist/assets/{use-mobile-BbxjRR_q.js → use-mobile-CwehvZ0f.js} +1 -1
  185. package/dist/assets/{use-mobile-T-9_nK_m.js → use-mobile-KRs0Yv73.js} +1 -1
  186. package/dist/assets/{useAsync-B_98ShEr.js → useAsync-CGW40D2-.js} +1 -1
  187. package/dist/assets/{useLocalStorage-BTc2ONSy.js → useLocalStorage-CNdV3Qx_.js} +1 -1
  188. package/dist/assets/{useSetState-BL3ktMon.js → useSetState-CWq0AVWn.js} +1 -1
  189. package/dist/assets/user-center-CTXkd8hW.js +77 -0
  190. package/dist/assets/{util-DA84MxE0.js → util-C4Ha7L5d.js} +1 -1
  191. package/dist/assets/{util-Dvapjz4O.js → util-DrL3FFCf.js} +1 -1
  192. package/dist/assets/{vendor-arcblock-Dd-d3bxC.js → vendor-arcblock-JGYMkSwE.js} +300 -300
  193. package/dist/assets/{vendor-hooks-jg6xPUPF.js → vendor-hooks-DftG_2gV.js} +2 -2
  194. package/dist/assets/{vendor-mui-core-DiDsSLd-.js → vendor-mui-core-8zafwTFh.js} +24 -24
  195. package/dist/assets/{vendor-mui-x-mVhD3N7n.js → vendor-mui-x-Df6DxoLi.js} +1 -1
  196. package/dist/assets/{vendor-react-DoD83n6N.js → vendor-react-DEoibe3W.js} +1 -1
  197. package/dist/assets/vendor-utils-BNHJB5U7.js +208 -0
  198. package/dist/assets/vendor-ux-did-connect-D2f9rdKK.js +2265 -0
  199. package/dist/assets/vi-Bc6q0tph.js +1 -0
  200. package/dist/assets/vi-CfH0km8q.js +5 -0
  201. package/dist/assets/wrap-locale-5dMXj7tV.js +1 -0
  202. package/dist/assets/{zh-CY9wasmC.js → zh-DZlGQAU9.js} +1 -1
  203. package/dist/assets/zh-_GYrLCB8.js +1 -0
  204. package/dist/assets/zh-tw-Be5lgYGX.js +7 -0
  205. package/dist/assets/zh-tw-CLcDyLaC.js +1 -0
  206. package/dist/index.html +9 -8
  207. package/dist/service-worker.js +1 -1
  208. package/package.json +45 -44
  209. package/dist/assets/actions-54wIQrhQ.js +0 -1
  210. package/dist/assets/add-resource-BVgzn5lM.js +0 -1
  211. package/dist/assets/api-DwjKcjK8.js +0 -1
  212. package/dist/assets/ar-BUQWR0Zu.js +0 -1
  213. package/dist/assets/ar-DRtGxecv.js +0 -7
  214. package/dist/assets/authorize-DVVvHvmA.js +0 -1
  215. package/dist/assets/branding-CY0aknSo.js +0 -40
  216. package/dist/assets/bundle-avatar-BcZExfqu.js +0 -1
  217. package/dist/assets/button-Cfb46ee0.js +0 -1
  218. package/dist/assets/click-to-copy-D4Cmyemb.js +0 -1
  219. package/dist/assets/cloneDeep-DUYD8ZBI.js +0 -1
  220. package/dist/assets/confirm-Bi4_XwxH.js +0 -7
  221. package/dist/assets/connect-to-nP4HS-Z0.js +0 -1
  222. package/dist/assets/dashboard-27JnEnGY.js +0 -279
  223. package/dist/assets/de-BZDWXY3K.js +0 -7
  224. package/dist/assets/de-_X0eQXZu.js +0 -1
  225. package/dist/assets/delete-confirm-B2Ye1_SC.js +0 -1
  226. package/dist/assets/domain-5-nsJfDM.js +0 -9
  227. package/dist/assets/domain-action-card-DrjkSQwC.js +0 -25
  228. package/dist/assets/domains-CD91MGQk.js +0 -1
  229. package/dist/assets/es-kQ6jQG-H.js +0 -7
  230. package/dist/assets/es-yHIDSG5r.js +0 -1
  231. package/dist/assets/fr-Bf3jz4q5.js +0 -7
  232. package/dist/assets/fr-D6i3bCqR.js +0 -1
  233. package/dist/assets/gen-access-key-CXCl8SEM.js +0 -2
  234. package/dist/assets/hi-ChVLDWm_.js +0 -1
  235. package/dist/assets/hi-DPdbGXyy.js +0 -5
  236. package/dist/assets/id-BqmT-cL5.js +0 -7
  237. package/dist/assets/id-D6XXuY_a.js +0 -1
  238. package/dist/assets/index-B-h0rpyF.js +0 -10
  239. package/dist/assets/index-BGnWzg98.js +0 -92
  240. package/dist/assets/index-BY0gjHeR.js +0 -346
  241. package/dist/assets/index-BeXUaMlG.js +0 -55
  242. package/dist/assets/index-Ca99ESdg.js +0 -1
  243. package/dist/assets/index-Cg_v1vT_.js +0 -113
  244. package/dist/assets/index-lk2RMFv-.js +0 -224
  245. package/dist/assets/index-o53rWfYr.js +0 -113
  246. package/dist/assets/invite-BC0OYJxG.js +0 -1
  247. package/dist/assets/issue-passport-CD5ylk7Y.js +0 -1
  248. package/dist/assets/ja-CyUU4_H1.js +0 -7
  249. package/dist/assets/ja-DKZCt8Yp.js +0 -1
  250. package/dist/assets/ko-B0uE9AyQ.js +0 -1
  251. package/dist/assets/ko-DWTxutv1.js +0 -7
  252. package/dist/assets/localization-Bqeaav45.js +0 -1
  253. package/dist/assets/logger-DzZIANXq.js +0 -1
  254. package/dist/assets/logo-uploader-BKxncdN2.js +0 -133
  255. package/dist/assets/omit-B1LDXfkq.js +0 -1
  256. package/dist/assets/preferences-C0eu3vgg.js +0 -1
  257. package/dist/assets/profile-embed-DfDaKcjJ.js +0 -1
  258. package/dist/assets/pt-BcsDG9H6.js +0 -5
  259. package/dist/assets/pt-DCzE4kPq.js +0 -1
  260. package/dist/assets/publish-resource-BEIDgQwd.js +0 -1
  261. package/dist/assets/ru-B9yj9TuE.js +0 -1
  262. package/dist/assets/ru-BwH1q1F1.js +0 -5
  263. package/dist/assets/runtime-B8E7DTqn.js +0 -1
  264. package/dist/assets/sdk-K0wUtuBQ.js +0 -1
  265. package/dist/assets/session-BPop7wxF.js +0 -1
  266. package/dist/assets/setup-DW_rcwsG.js +0 -19
  267. package/dist/assets/th-CNztcQMJ.js +0 -5
  268. package/dist/assets/th-et0IV3ES.js +0 -1
  269. package/dist/assets/user-center-DGFt0-Nt.js +0 -77
  270. package/dist/assets/vendor-utils-DMClavLd.js +0 -11
  271. package/dist/assets/vendor-ux-did-connect-qEfzi7sf.js +0 -1832
  272. package/dist/assets/vi-Bpl5HEj4.js +0 -5
  273. package/dist/assets/vi-LBvVt_pj.js +0 -1
  274. package/dist/assets/wrap-locale-CyEJqSC4.js +0 -1
  275. package/dist/assets/zh-tw-D6qZTlL3.js +0 -7
  276. package/dist/assets/zh-tw-l3XXo5aT.js +0 -1
  277. package/dist/assets/zh-yJzqRkfw.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m as oe}from"./vendor-hooks-jg6xPUPF.js";import{j as e,aa as g,H as w,ag as H,E as pt,T as E,X as ut,ak as te,ab as K,a9 as M,aj as Me,a8 as mt,I as $,O as W,q as ie,N as ft,br as Oe,cc as qe,cd as ee,bR as We,bq as $e,bx as ht,bs as xt,bO as gt,v as yt,y as jt,bn as vt,s as bt}from"./vendor-mui-core-DiDsSLd-.js";import{u as L,al as U,ar as Ct,Y as F,a5 as xe,p as G,aL as St,B as _,r as Tt,_ as ge,bt as He,l as wt,b5 as Pt,bM as Fe,bf as It,bs as Rt}from"./vendor-ux-did-connect-qEfzi7sf.js";import{z as A,l as ne,t as Ue,M as J,C as Dt,a7 as kt,f as Ft,b as re,ar as At,K as Ge}from"./index-Cg_v1vT_.js";import{q as Nt,c as Lt,B as ye,T as X}from"./vendor-arcblock-Dd-d3bxC.js";import{W as je}from"./did-address-gmPYOGuy.js";import{u as O}from"./dashboard-27JnEnGY.js";import{r as ve,a as be,b as Ce,c as le,d as Bt,e as Ve,u as zt,f as _t}from"./passport-item-Cxkhzo-W.js";import{p as Ye}from"./util-Dvapjz4O.js";import{w as V,P as Ke}from"./permission-_ttLx53e.js";import{C as Et}from"./Google-yY5m8tgo.js";import{L as Z,au as Mt,J as Ot}from"./vendor-utils-DMClavLd.js";import{E as ce}from"./EditIcon-CQgpOLLT.js";import{C as Se}from"./confirm-Bi4_XwxH.js";import{L as Ze}from"./list-header-BYlc5SI1.js";import{f as se}from"./format-error-LAoTjvJe.js";import{_ as qt}from"./useSetState-BL3ktMon.js";import{L as Wt}from"./LockIcon-G8zLxYzV.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BTc2ONSy.js";import"./PlayArrow-B-b0Dvp8.js";import"./get-safe-url-DGJYpGp-.js";import"./session-BPop7wxF.js";import"./index-Xi3jaVFs.js";import"./InfoOutlined-xdatqyfu.js";import"./dot-BBxUn__M.js";import"./useAsync-B_98ShEr.js";import"./use-mobile-T-9_nK_m.js";import"./index-B-h0rpyF.js";import"./Location-C_mUMqZP.js";import"./Email-BWTg6iJI.js";import"./Timezone-5RxC7sK-.js";import"./base32-Dd6rPCV6.js";import"./cloneDeep-DUYD8ZBI.js";const Ae="info";function Te({createPassportSvg:f,passport:o,onCancel:c,onSwitchPassport:m}){const{t:p}=L(),l=dt({tab:Ae}),h={info:{label:p("common.basicInfo"),value:Ae,component:()=>e.jsx(Je,{passport:o,createPassportSvg:f})},logs:{label:p("common.logs"),value:"logs",component:()=>e.jsx(et,{passport:o})},related:{label:p("team.passport.related"),value:"related",component:()=>e.jsx(tt,{passport:o,onSwitchPassport:m})}},s=Object.values(h).map(({label:n,value:t})=>({label:n,value:t})).filter(n=>n.value==="related"?o.parentDid:!0),u=h[l.tab]||h.info,a=n=>{l.tab=n};return e.jsx(U,{title:p("common.passport"),onClose:c,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs($t,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Ct,{tabs:s,current:l.tab,onChange:a,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(u.component,{})})]})})}Te.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};Te.defaultProps={onSwitchPassport:()=>{}};const $t=H(g)`
1
+ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m as oe}from"./vendor-hooks-DftG_2gV.js";import{j as e,a9 as g,H as w,ag as H,E as pt,T as E,X as ut,ak as te,ac as K,aa as O,aj as Oe,a8 as mt,I as $,O as W,q as ie,N as ft,br as Me,cg as qe,ch as ee,bV as We,bq as $e,bx as ht,bs as xt,bS as gt,v as yt,y as jt,bn as vt,s as bt}from"./vendor-mui-core-8zafwTFh.js";import{u as L,al as U,ar as Ct,Y as F,a5 as xe,j as G,aN as St,B as _,r as Tt,_ as ge,bu as He,f as wt,b6 as Pt,bN as Fe,bg as It,bt as Rt}from"./vendor-ux-did-connect-D2f9rdKK.js";import{z as N,l as ne,t as Ue,U as J,C as Dt,ac as kt,f as Ft,b as re,aw as Nt,R as Ge}from"./index-CVvs-hHV.js";import{v as At,c as Lt,K as ye,Z as X}from"./vendor-arcblock-JGYMkSwE.js";import{W as je}from"./did-address-Cg-ez88b.js";import{u as M}from"./dashboard-CCzZLCC4.js";import{r as ve,a as be,b as Ce,c as le,d as Bt,e as Ve,u as zt,f as _t}from"./passport-item-Z9x6DkU5.js";import{p as Ye}from"./util-DrL3FFCf.js";import{w as V,P as Ke}from"./permission-CDRSpazM.js";import{C as Et}from"./Google-nw2S1BAe.js";import{L as Z,ay as Ot,J as Mt}from"./vendor-utils-BNHJB5U7.js";import{E as ce}from"./EditIcon-B3vzcBhw.js";import{C as Se}from"./confirm-BshZuFnD.js";import{L as Ze}from"./list-header-C7I2nEkf.js";import{f as se}from"./format-error-BrmqJs5a.js";import{_ as qt}from"./useSetState-CWq0AVWn.js";import{L as Wt}from"./LockIcon-Yic1ETPw.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CNdV3Qx_.js";import"./PlayArrow-DfQEcw-G.js";import"./get-safe-url-Bz4L9R5-.js";import"./session-CmpGpqja.js";import"./index-DomukIqT.js";import"./InfoOutlined-K2cm3ASV.js";import"./dot-tsWWWiOg.js";import"./useAsync-CGW40D2-.js";import"./use-mobile-KRs0Yv73.js";import"./index-B0-4M8vb.js";import"./Phone-DkIl-1KJ.js";import"./Location-DSdE-EW4.js";import"./Email-DscM5ZVr.js";import"./Timezone-B77bSXNW.js";import"./base32-CXHhcaAE.js";import"./cloneDeep-SfcdeqEN.js";const Ne="info";function Te({createPassportSvg:f,passport:o,onCancel:c,onSwitchPassport:m}){const{t:p}=L(),l=dt({tab:Ne}),h={info:{label:p("common.basicInfo"),value:Ne,component:()=>e.jsx(Je,{passport:o,createPassportSvg:f})},logs:{label:p("common.logs"),value:"logs",component:()=>e.jsx(et,{passport:o})},related:{label:p("team.passport.related"),value:"related",component:()=>e.jsx(tt,{passport:o,onSwitchPassport:m})}},s=Object.values(h).map(({label:n,value:t})=>({label:n,value:t})).filter(n=>n.value==="related"?o.parentDid:!0),u=h[l.tab]||h.info,a=n=>{l.tab=n};return e.jsx(U,{title:p("common.passport"),onClose:c,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs($t,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Ct,{tabs:s,current:l.tab,onChange:a,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(u.component,{})})]})})}Te.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};Te.defaultProps={onSwitchPassport:()=>{}};const $t=H(g)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -9,7 +9,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
9
9
  .body {
10
10
  margin-top: 24px;
11
11
  }
12
- `;function Je({createPassportSvg:f,passport:o}){var u,a,n,t;const{t:c,locale:m}=L(),{teamDid:p}=O(),{inService:l}=A(),h=[{items:[{label:c("common.role"),content:ve(o.role)},{label:c("common.did"),content:e.jsx(je,{did:o.id})},{label:c("team.passport.status"),content:be(o.status)},{label:c("common.type"),content:e.jsx(g,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(o.type||[]).map(r=>e.jsx(pt,{label:r,variant:"outlined",size:"small",sx:{borderRadius:1}},r))})}]}],s=[{title:c("team.passport.owner"),items:[{label:c("team.passport.owner"),content:e.jsx(g,{children:Ce(o.user,l)})}]},{title:c("common.timeInfo"),items:[{label:c("team.passport.issuanceTime"),content:o.issuanceDate?ne(o.issuanceDate,m):"-"},{label:c("team.member.lastLogin"),content:o.lastLoginAt?ne(o.lastLoginAt,m):"-"},{label:c("common.expires"),content:o.expirationDate?ne(o.expirationDate,m):"-"}]},{title:c("blocklet.overview.source"),items:[{label:c("blocklet.overview.source"),content:le(o.source)}]}];return e.jsxs(Ht,{gap:3,children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",overflow:"hidden",gap:5},children:[e.jsx(g,{sx:{display:"flex",p:1},className:"passport-image",dangerouslySetInnerHTML:{__html:f({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(u=o.user)==null?void 0:u.fullName,ownerDid:(a=o.user)==null?void 0:a.did,ownerAvatarUrl:(n=o.user)!=null&&n.avatar?Ye((t=o.user)==null?void 0:t.avatar,p,l):"",revoked:o.revoked,width:"200px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(g,{className:"info-area",children:h.map(r=>e.jsxs(g,{children:[r.title&&e.jsx(E,{variant:"h6",sx:{mb:2},children:r.title}),e.jsx(g,{className:"info-grid",sx:{gap:"12px !important"},children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",sx:{maxWidth:40},children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]}),e.jsx(ut,{}),e.jsx(g,{className:"info-area",children:s.map(r=>e.jsxs(g,{children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:r.title}),e.jsx(g,{className:"info-grid",children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]})}Je.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired};const Ht=H(te)`
12
+ `;function Je({createPassportSvg:f,passport:o}){var u,a,n,t;const{t:c,locale:m}=L(),{teamDid:p}=M(),{inService:l}=N(),h=[{items:[{label:c("common.role"),content:ve(o.role)},{label:c("common.did"),content:e.jsx(je,{did:o.id})},{label:c("team.passport.status"),content:be(o.status)},{label:c("common.type"),content:e.jsx(g,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(o.type||[]).map(r=>e.jsx(pt,{label:r,variant:"outlined",size:"small",sx:{borderRadius:1}},r))})}]}],s=[{title:c("team.passport.owner"),items:[{label:c("team.passport.owner"),content:e.jsx(g,{children:Ce(o.user,l)})}]},{title:c("common.timeInfo"),items:[{label:c("team.passport.issuanceTime"),content:o.issuanceDate?ne(o.issuanceDate,m):"-"},{label:c("team.member.lastLogin"),content:o.lastLoginAt?ne(o.lastLoginAt,m):"-"},{label:c("common.expires"),content:o.expirationDate?ne(o.expirationDate,m):"-"}]},{title:c("blocklet.overview.source"),items:[{label:c("blocklet.overview.source"),content:le(o.source)}]}];return e.jsxs(Ht,{gap:3,children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",overflow:"hidden",gap:5},children:[e.jsx(g,{sx:{display:"flex",p:1},className:"passport-image",dangerouslySetInnerHTML:{__html:f({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(u=o.user)==null?void 0:u.fullName,ownerDid:(a=o.user)==null?void 0:a.did,ownerAvatarUrl:(n=o.user)!=null&&n.avatar?Ye((t=o.user)==null?void 0:t.avatar,p,l):"",revoked:o.revoked,width:"200px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(g,{className:"info-area",children:h.map(r=>e.jsxs(g,{children:[r.title&&e.jsx(E,{variant:"h6",sx:{mb:2},children:r.title}),e.jsx(g,{className:"info-grid",sx:{gap:"12px !important"},children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",sx:{maxWidth:40},children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]}),e.jsx(ut,{}),e.jsx(g,{className:"info-area",children:s.map(r=>e.jsxs(g,{children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:r.title}),e.jsx(g,{className:"info-grid",children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]})}Je.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired};const Ht=H(te)`
13
13
  .info-card {
14
14
  margin-bottom: 24px;
15
15
  overflow: hidden;
@@ -83,7 +83,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
83
83
  margin: 0;
84
84
  }
85
85
  }
86
- `,Qe=10,Xe=1;function et({passport:f}){const{api:o}=A(),{teamDid:c}=O(),{t:m,locale:p}=L(),[l,h]=S.useState({pageSize:Qe,page:Xe}),{data:s,loading:u}=oe(async()=>{const y={teamDid:c,query:{passportId:f.id},paging:{page:l.page,pageSize:l.pageSize}},x=await o.getPassportLogs({input:y});return{logs:x.passportLogs||[],total:x.paging.total}},{refreshDeps:[l.page,l.pageSize],onError:y=>F.error(y.message)}),a=S.useMemo(()=>(s==null?void 0:s.logs)||[],[s==null?void 0:s.logs]),n=y=>{var x,d,v,j,T,C,I,D,N;return y.action===G.PASSPORT_LOG_ACTION.APPROVE||y.action===G.PASSPORT_LOG_ACTION.REVOKE?(d=(x=y==null?void 0:y.metadata)==null?void 0:x.operator)!=null&&d.fullName?`${m("common.operator")}: ${(j=(v=y==null?void 0:y.metadata)==null?void 0:v.operator)==null?void 0:j.fullName}`:null:y.action===G.PASSPORT_LOG_ACTION.ISSUE&&((T=y.metadata)==null?void 0:T.action)===G.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?(I=(C=y==null?void 0:y.metadata)==null?void 0:C.inviter)!=null&&I.fullName?`${m("common.inviter")}: ${(N=(D=y==null?void 0:y.metadata)==null?void 0:D.inviter)==null?void 0:N.fullName}`:null:`passportId: ${y.passportId}`},t=S.useMemo(()=>[{label:m("common.action"),name:"action",options:{customBodyRender:(y,{rowIndex:x})=>{var v;const d=a[x];return e.jsx(K,{title:n(d),children:`${y} ${(v=d.metadata)!=null&&v.action?`(${d.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:y=>e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:y||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(y,{rowIndex:x})=>{const d=a[x];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.operatorUa&&e.jsx(g,{children:Bt(d.operatorUa)}),d.operatorUa&&e.jsx(K,{title:d.operatorUa,children:e.jsx(Nt,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:m("common.createdAt"),name:"createdAt",options:{customBodyRender:y=>ne(y,p)}}],[m,p,a]),r=({page:y,rowsPerPage:x})=>{l.pageSize!==x?h(d=>({...d,pageSize:x,page:1})):l.page!==y+1&&h(d=>({...d,page:y+1}))},i={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:l.page-1,rowsPerPage:l.pageSize,count:(s==null?void 0:s.total)||0};return u?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsx(g,{children:e.jsx(xe,{className:"logs-table",verticalKeyWidth:100,locale:p,data:a,columns:t,options:i,loading:u,onChange:r})})}et.propTypes={passport:w.object.isRequired};function tt({passport:f,onSwitchPassport:o}){const{api:c}=A(),{teamDid:m}=O(),{t:p,locale:l}=L(),[h,s]=S.useState({pageSize:Qe,page:Xe}),{data:u,loading:a}=oe(async()=>{const x={teamDid:m,passportId:f.parentDid,paging:{page:h.page,pageSize:h.pageSize}},d=await c.getRelatedPassports({input:x});return{passports:d.passports||[],total:d.paging.total}},{refreshDeps:[h.page,h.pageSize],onError:x=>F.error(x.message)}),n=S.useMemo(()=>(u==null?void 0:u.passports)||[],[u==null?void 0:u.passports]),t=S.useMemo(()=>[{label:p("team.passport.role"),name:"role",options:{customBodyRender:ve}},{label:p("team.passport.owner"),name:"user",options:{customBodyRender:Ce}},{label:p("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:p("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:x=>Ve(x,l)}},{label:p("blocklet.overview.source"),name:"source",options:{customBodyRender:le}}],[p,l]),r=({page:x,rowsPerPage:d})=>{h.pageSize!==d?s(v=>({...v,pageSize:d,page:1})):h.page!==x+1&&s(v=>({...v,page:x+1}))},i=S.useRef(null),y={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:h.page-1,rowsPerPage:h.pageSize,count:(u==null?void 0:u.total)||0,onRowClick(x,{dataIndex:d},v){var j;if((j=i.current)!=null&&j.contains(v.target)){const T=n[d];o(T)}}};return a?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsxs(te,{spacing:1,children:[e.jsx(Me,{severity:"warning",children:p("team.passport.relatedDescription")}),e.jsx(g,{ref:i,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(xe,{className:"related-table",verticalKeyWidth:100,locale:l,data:n.filter(x=>x.id!==f.id),columns:t,options:y,loading:a,onChange:r})})]})}tt.propTypes={passport:w.object.isRequired,onSwitchPassport:w.func.isRequired};function de({onCancel:f,onSuccess:o}){const{api:c}=A(),{blocklet:m}=Dt(),{t:p}=L(),[l,h]=S.useState(!1),s=(m.environments.find(r=>r.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",u=s==="auto"?St.getPassportColorFromDid(m.appDid):s,[a,n]=S.useState(u),t=async()=>{const r=[{key:Lt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:a}];try{h(!0),await c.configBlocklet({input:{did:m.meta.did,configs:r}}),o()}catch(i){F.error(i.message)}finally{h(!1)}};return e.jsx(U,{title:p("team.passport.color"),onClose:f,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:p("common.cancel")}),e.jsxs(_,{onClick:t,color:"primary",disabled:l,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[l&&e.jsx(M,{size:16}),p("common.save")]})]}),children:e.jsxs(g,{display:"flex",justifyContent:"center",alignItems:"center",className:"dialog-content",children:[e.jsx(Et,{disableAlpha:!0,color:a,onChange:r=>n(r.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:kt({scope:"passport",role:"owner",title:"Owner",issuer:Ft.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:a})}})]})})}const Ut=V(de,"mutate_team"),Gt=V(de,"",J);function Vt(f){const{inService:o}=A();return o?e.jsx(Gt,{...f}):e.jsx(Ut,{...f})}de.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired};de.defaultProps={};var Q=function(f){return e.jsx("svg",{...f,children:e.jsx("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})})};Q.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};Q.displayName="delete";var we={},Yt=mt;Object.defineProperty(we,"__esModule",{value:!0});var Pe=we.default=void 0,Kt=Yt(Tt()),Zt=e;Pe=we.default=(0,Kt.default)((0,Zt.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var st=function(o){return e.jsx("svg",{...o,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};st.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Jt=(f,o)=>f?!o.some(c=>!c.from.passport||!c.to.role):!1;function Ie({onCancel:f,onSuccess:o,data:c,trustedPassports:m}){const{api:p}=A(),{roles:l,teamDid:h}=O(),{t:s}=L(),[u,a]=S.useState(!1),[n,t]=S.useState(c.issuerDid||""),[r,i]=S.useState(c.remark||""),[y,x]=S.useState(Z(c.mappings)||[]),d=m.findIndex(j=>j.issuerDid===c.issuerDid),v=async()=>{if(u)return;const j={issuerDid:n,remark:r,mappings:y.map(C=>({...C,to:{...C.to,ttl:C.to.ttl||0}}))},T=[...m];d===-1?T.unshift(j):T[d]=j;try{a(!0),await p.configTrustedPassports({input:{teamDid:h,trustedPassports:T}}),await re(800),a(!1),F.success(s("common.saveSuccess")),o()}catch(C){a(!1),F.error(se(C))}};return e.jsx(U,{title:s("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx($,{onClick:f,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>v(),color:"primary",disabled:!Jt(n,y)||!r||u,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[u&&e.jsx(M,{size:16}),s("common.save")]})]}),children:e.jsx(Qt,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:s("team.passport.issuerDid"),value:n,onChange:j=>{t(j.target.value)}}),e.jsx(W,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:s("common.remark"),value:r,onChange:j=>{i(j.target.value)}}),e.jsxs(g,{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(g,{className:"dialog-h1",children:s("team.passport.mappingRule")}),e.jsx(g,{children:e.jsx(_,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{x(j=>{const T=[...j];return T.unshift({from:{passport:""},to:{role:G.ROLES.GUEST}}),T})},children:s("team.add")})})]}),e.jsxs(g,{className:"list",mt:-.5,children:[y.map((j,T)=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",my:3,children:[e.jsxs(g,{display:"flex",alignItems:"center",flexGrow:1,children:[e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small","data-cy":`input-${T}-from`,placeholder:"Issuer’s Passport Name/ID",value:j.from.passport,onChange:C=>{const{value:I}=C.target;x(D=>{const N=[...D];return N[T].from.passport=I,N})}})}),e.jsx(g,{flexShrink:0,mx:4,children:e.jsx(st,{})}),e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:C=>{x(I=>{const D=[...I];return D[T].to.role=C.target.value,D})},variant:"outlined",children:l.filter(C=>C.name!=="owner").map(C=>e.jsx(ie,{value:C.name,"data-cy":`passport-mapping-select-option-${C.name}`,children:e.jsx("span",{children:C.title||C.name})},C.name))})})]}),e.jsx(g,{flexShrink:0,ml:4,children:e.jsx($,{onClick:()=>{x(C=>{const I=[...C];return I.splice(T,1),I})},size:"large",children:e.jsx(Q,{})})})]},`mapping-${T}`)),!y.length&&e.jsx(g,{my:2,color:"text.secondary",fontSize:"16px",children:e.jsx(ge,{children:s("common.empty")})})]})]})})})}Ie.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedPassports:w.array,data:w.object};Ie.defaultProps={data:{},trustedPassports:[]};const Qt=H.div`
86
+ `,Qe=10,Xe=1;function et({passport:f}){const{api:o}=N(),{teamDid:c}=M(),{t:m,locale:p}=L(),[l,h]=S.useState({pageSize:Qe,page:Xe}),{data:s,loading:u}=oe(async()=>{const y={teamDid:c,query:{passportId:f.id},paging:{page:l.page,pageSize:l.pageSize}},x=await o.getPassportLogs({input:y});return{logs:x.passportLogs||[],total:x.paging.total}},{refreshDeps:[l.page,l.pageSize],onError:y=>F.error(y.message)}),a=S.useMemo(()=>(s==null?void 0:s.logs)||[],[s==null?void 0:s.logs]),n=y=>{var x,d,v,j,T,C,I,D,A;return y.action===G.PASSPORT_LOG_ACTION.APPROVE||y.action===G.PASSPORT_LOG_ACTION.REVOKE?(d=(x=y==null?void 0:y.metadata)==null?void 0:x.operator)!=null&&d.fullName?`${m("common.operator")}: ${(j=(v=y==null?void 0:y.metadata)==null?void 0:v.operator)==null?void 0:j.fullName}`:null:y.action===G.PASSPORT_LOG_ACTION.ISSUE&&((T=y.metadata)==null?void 0:T.action)===G.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?(I=(C=y==null?void 0:y.metadata)==null?void 0:C.inviter)!=null&&I.fullName?`${m("common.inviter")}: ${(A=(D=y==null?void 0:y.metadata)==null?void 0:D.inviter)==null?void 0:A.fullName}`:null:`passportId: ${y.passportId}`},t=S.useMemo(()=>[{label:m("common.action"),name:"action",options:{customBodyRender:(y,{rowIndex:x})=>{var v;const d=a[x];return e.jsx(K,{title:n(d),children:`${y} ${(v=d.metadata)!=null&&v.action?`(${d.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:y=>e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:y||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(y,{rowIndex:x})=>{const d=a[x];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.operatorUa&&e.jsx(g,{children:Bt(d.operatorUa)}),d.operatorUa&&e.jsx(K,{title:d.operatorUa,children:e.jsx(At,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:m("common.createdAt"),name:"createdAt",options:{customBodyRender:y=>ne(y,p)}}],[m,p,a]),r=({page:y,rowsPerPage:x})=>{l.pageSize!==x?h(d=>({...d,pageSize:x,page:1})):l.page!==y+1&&h(d=>({...d,page:y+1}))},i={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:l.page-1,rowsPerPage:l.pageSize,count:(s==null?void 0:s.total)||0};return u?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(O,{})})}):e.jsx(g,{children:e.jsx(xe,{className:"logs-table",verticalKeyWidth:100,locale:p,data:a,columns:t,options:i,loading:u,onChange:r})})}et.propTypes={passport:w.object.isRequired};function tt({passport:f,onSwitchPassport:o}){const{api:c}=N(),{teamDid:m}=M(),{t:p,locale:l}=L(),[h,s]=S.useState({pageSize:Qe,page:Xe}),{data:u,loading:a}=oe(async()=>{const x={teamDid:m,passportId:f.parentDid,paging:{page:h.page,pageSize:h.pageSize}},d=await c.getRelatedPassports({input:x});return{passports:d.passports||[],total:d.paging.total}},{refreshDeps:[h.page,h.pageSize],onError:x=>F.error(x.message)}),n=S.useMemo(()=>(u==null?void 0:u.passports)||[],[u==null?void 0:u.passports]),t=S.useMemo(()=>[{label:p("team.passport.role"),name:"role",options:{customBodyRender:ve}},{label:p("team.passport.owner"),name:"user",options:{customBodyRender:Ce}},{label:p("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:p("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:x=>Ve(x,l)}},{label:p("blocklet.overview.source"),name:"source",options:{customBodyRender:le}}],[p,l]),r=({page:x,rowsPerPage:d})=>{h.pageSize!==d?s(v=>({...v,pageSize:d,page:1})):h.page!==x+1&&s(v=>({...v,page:x+1}))},i=S.useRef(null),y={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:h.page-1,rowsPerPage:h.pageSize,count:(u==null?void 0:u.total)||0,onRowClick(x,{dataIndex:d},v){var j;if((j=i.current)!=null&&j.contains(v.target)){const T=n[d];o(T)}}};return a?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(O,{})})}):e.jsxs(te,{spacing:1,children:[e.jsx(Oe,{severity:"warning",children:p("team.passport.relatedDescription")}),e.jsx(g,{ref:i,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(xe,{className:"related-table",verticalKeyWidth:100,locale:l,data:n.filter(x=>x.id!==f.id),columns:t,options:y,loading:a,onChange:r})})]})}tt.propTypes={passport:w.object.isRequired,onSwitchPassport:w.func.isRequired};function de({onCancel:f,onSuccess:o}){const{api:c}=N(),{blocklet:m}=Dt(),{t:p}=L(),[l,h]=S.useState(!1),s=(m.environments.find(r=>r.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",u=s==="auto"?St.getPassportColorFromDid(m.appDid):s,[a,n]=S.useState(u),t=async()=>{const r=[{key:Lt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:a}];try{h(!0),await c.configBlocklet({input:{did:m.meta.did,configs:r}}),o()}catch(i){F.error(i.message)}finally{h(!1)}};return e.jsx(U,{title:p("team.passport.color"),onClose:f,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:p("common.cancel")}),e.jsxs(_,{onClick:t,color:"primary",disabled:l,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[l&&e.jsx(O,{size:16}),p("common.save")]})]}),children:e.jsxs(g,{display:"flex",justifyContent:"center",alignItems:"center",className:"dialog-content",children:[e.jsx(Et,{disableAlpha:!0,color:a,onChange:r=>n(r.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:kt({scope:"passport",role:"owner",title:"Owner",issuer:Ft.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:a})}})]})})}const Ut=V(de,"mutate_team"),Gt=V(de,"",J);function Vt(f){const{inService:o}=N();return o?e.jsx(Gt,{...f}):e.jsx(Ut,{...f})}de.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired};de.defaultProps={};var Q=function(f){return e.jsx("svg",{...f,children:e.jsx("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})})};Q.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};Q.displayName="delete";var we={},Yt=mt;Object.defineProperty(we,"__esModule",{value:!0});var Pe=we.default=void 0,Kt=Yt(Tt()),Zt=e;Pe=we.default=(0,Kt.default)((0,Zt.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var st=function(o){return e.jsx("svg",{...o,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};st.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Jt=(f,o)=>f?!o.some(c=>!c.from.passport||!c.to.role):!1;function Ie({onCancel:f,onSuccess:o,data:c,trustedPassports:m}){const{api:p}=N(),{roles:l,teamDid:h}=M(),{t:s}=L(),[u,a]=S.useState(!1),[n,t]=S.useState(c.issuerDid||""),[r,i]=S.useState(c.remark||""),[y,x]=S.useState(Z(c.mappings)||[]),d=m.findIndex(j=>j.issuerDid===c.issuerDid),v=async()=>{if(u)return;const j={issuerDid:n,remark:r,mappings:y.map(C=>({...C,to:{...C.to,ttl:C.to.ttl||0}}))},T=[...m];d===-1?T.unshift(j):T[d]=j;try{a(!0),await p.configTrustedPassports({input:{teamDid:h,trustedPassports:T}}),await re(800),a(!1),F.success(s("common.saveSuccess")),o()}catch(C){a(!1),F.error(se(C))}};return e.jsx(U,{title:s("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx($,{onClick:f,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>v(),color:"primary",disabled:!Jt(n,y)||!r||u,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[u&&e.jsx(O,{size:16}),s("common.save")]})]}),children:e.jsx(Qt,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:s("team.passport.issuerDid"),value:n,onChange:j=>{t(j.target.value)}}),e.jsx(W,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:s("common.remark"),value:r,onChange:j=>{i(j.target.value)}}),e.jsxs(g,{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(g,{className:"dialog-h1",children:s("team.passport.mappingRule")}),e.jsx(g,{children:e.jsx(_,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{x(j=>{const T=[...j];return T.unshift({from:{passport:""},to:{role:G.ROLES.GUEST}}),T})},children:s("team.add")})})]}),e.jsxs(g,{className:"list",mt:-.5,children:[y.map((j,T)=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",my:3,children:[e.jsxs(g,{display:"flex",alignItems:"center",flexGrow:1,children:[e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small","data-cy":`input-${T}-from`,placeholder:"Issuer’s Passport Name/ID",value:j.from.passport,onChange:C=>{const{value:I}=C.target;x(D=>{const A=[...D];return A[T].from.passport=I,A})}})}),e.jsx(g,{flexShrink:0,mx:4,children:e.jsx(st,{})}),e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:C=>{x(I=>{const D=[...I];return D[T].to.role=C.target.value,D})},variant:"outlined",children:l.filter(C=>C.name!=="owner").map(C=>e.jsx(ie,{value:C.name,"data-cy":`passport-mapping-select-option-${C.name}`,children:e.jsx("span",{children:C.title||C.name})},C.name))})})]}),e.jsx(g,{flexShrink:0,ml:4,children:e.jsx($,{onClick:()=>{x(C=>{const I=[...C];return I.splice(T,1),I})},size:"large",children:e.jsx(Q,{})})})]},`mapping-${T}`)),!y.length&&e.jsx(g,{my:2,color:"text.secondary",fontSize:"16px",children:e.jsx(ge,{children:s("common.empty")})})]})]})})})}Ie.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedPassports:w.array,data:w.object};Ie.defaultProps={data:{},trustedPassports:[]};const Qt=H.div`
87
87
  .dialog-h1 {
88
88
  font-size: 18px;
89
89
  }
@@ -95,7 +95,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
95
95
  }
96
96
  }
97
97
  }
98
- `;function pe({onCancel:f,hasPermission:o}){const{api:c}=A(),{teamDid:m,trustedPassports:p}=O(),{t:l}=L(),[h,s]=S.useState(null),[u,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(""),y=async d=>{if(u)return;const v=p.findIndex(T=>T.issuerDid===d);v===-1&&F.error("Cannot find passports");const j=[...p];j.splice(v,1);try{a(!0),await c.configTrustedPassports({input:{teamDid:m,trustedPassports:j}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(!1)}catch(T){a(!1),F.error(T.message)}},x=p.filter(d=>!r||d.issuerDid.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedIssuers"),open:!0,onClose:f,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ss,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedPassportIssuers")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchIssuerDid"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(d=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexShrink:0,children:[e.jsx(je,{copyable:!1,size:16,did:d.issuerDid,showDidLogo:!1}),!!d.remark&&e.jsx(g,{pl:3.5,fontSize:12,maxWidth:"300px",children:d.remark})]}),e.jsx(g,{color:"gray",ml:"28px",flexGrow:1,children:d.mappings&&d.mappings.length?`${d.mappings.length} ${l("team.passport.mappingRule")}`:l("team.passport.defaultRule")}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx($,{onClick:()=>t({mode:"update",data:Z(d)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(ce,{})}),e.jsx($,{"data-cy":"delete-mapping-rule",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:d.issuerDid}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(d.issuerDid),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},d.issuerDid)),!p.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Ie,{mode:n.mode,data:n.data,trustedPassports:Z(p),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}pe.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};pe.defaultProps={hasPermission:!1};const Xt=V(pe,"mutate_team"),es=V(pe,"",J);function ts(f){const{inService:o}=A();return o?e.jsx(es,{...f}):e.jsx(Xt,{...f})}const ss=H.div`
98
+ `;function pe({onCancel:f,hasPermission:o}){const{api:c}=N(),{teamDid:m,trustedPassports:p}=M(),{t:l}=L(),[h,s]=S.useState(null),[u,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(""),y=async d=>{if(u)return;const v=p.findIndex(T=>T.issuerDid===d);v===-1&&F.error("Cannot find passports");const j=[...p];j.splice(v,1);try{a(!0),await c.configTrustedPassports({input:{teamDid:m,trustedPassports:j}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(!1)}catch(T){a(!1),F.error(T.message)}},x=p.filter(d=>!r||d.issuerDid.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedIssuers"),open:!0,onClose:f,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ss,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedPassportIssuers")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchIssuerDid"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(d=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexShrink:0,children:[e.jsx(je,{copyable:!1,size:16,did:d.issuerDid,showDidLogo:!1}),!!d.remark&&e.jsx(g,{pl:3.5,fontSize:12,maxWidth:"300px",children:d.remark})]}),e.jsx(g,{color:"gray",ml:"28px",flexGrow:1,children:d.mappings&&d.mappings.length?`${d.mappings.length} ${l("team.passport.mappingRule")}`:l("team.passport.defaultRule")}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx($,{onClick:()=>t({mode:"update",data:Z(d)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(ce,{})}),e.jsx($,{"data-cy":"delete-mapping-rule",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:d.issuerDid}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(d.issuerDid),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},d.issuerDid)),!p.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Ie,{mode:n.mode,data:n.data,trustedPassports:Z(p),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}pe.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};pe.defaultProps={hasPermission:!1};const Xt=V(pe,"mutate_team"),es=V(pe,"",J);function ts(f){const{inService:o}=N();return o?e.jsx(es,{...f}):e.jsx(Xt,{...f})}const ss=H.div`
99
99
  .list {
100
100
  .MuiIconButton-root {
101
101
  svg {
@@ -103,7 +103,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
103
103
  }
104
104
  }
105
105
  }
106
- `;var rs=Mt();const Ne=Ee(rs);function Re({onCancel:f,onSuccess:o,data:c,trustedFactories:m}){var x,d,v;const{api:p}=A(),{roles:l,teamDid:h}=O(),{t:s}=L(),[u,a]=qt({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:c.factoryAddress||"",remark:c.remark||"",role:((x=c.passport)==null?void 0:x.role)||"member",ttlPolicy:((d=c.passport)==null?void 0:d.ttlPolicy)||"never",ttl:Ne(+((v=c.passport)==null?void 0:v.ttl)||365*24*60*60*1e3),error:""}),n=m.findIndex(j=>j.factoryAddress===c.factoryAddress),t=async()=>{if(u.loading)return;const{factoryAddress:j,remark:T,role:C,ttlPolicy:I,ttl:D}=u,N={factoryAddress:j,remark:T,passport:{role:C,ttlPolicy:I,ttl:I==="never"?0:Ne(D)}},k=[...m];n===-1?k.unshift(N):k[n]=N;try{a({loading:!0}),await p.configTrustedFactories({input:{teamDid:h,trustedFactories:k}}),await re(800),F.success(s("common.saveSuccess")),o()}catch(B){console.error(B),F.error(se(B))}finally{a({loading:!1})}};S.useEffect(()=>{const j=u.fetched.find(C=>C.address===u.factoryAddress),T=u.errored.find(C=>C.address===u.factoryAddress);wt.isValid(u.factoryAddress)&&!u.fetching&&!j&&!T&&(a({fetching:!0}),At(G.MAIN_CHAIN_ENDPOINT).getFactoryState({address:u.factoryAddress}).then(I=>{I.state?a({fetching:!1,fetched:[...u.fetched.filter(D=>D.address!==u.factoryAddress),I.state],remark:I.state.name}):a({fetching:!1,errored:[...u.errored.filter(D=>D.address!==u.factoryAddress),{address:u.factoryAddress}],error:s("team.passport.factory404",u)})}).catch(I=>{console.error(I),a({fetching:!1,error:se(I)})}))},[u.factoryAddress,u.fetching]);let r=u.error;const i=u.factoryAddress?u.errored.find(j=>j.address===u.factoryAddress):null;!r&&i&&(r=s("team.passport.factory404",u));const y=u.factoryAddress?u.fetched.find(j=>j.address===u.factoryAddress):null;return!r&&y&&(r=y.description),r||(r=s("team.passport.factoryAddressTip")),e.jsx(U,{title:s("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx($,{onClick:f,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>t(),color:"primary",disabled:!u.factoryAddress||!u.remark||!u.role||u.loading||u.error||i,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[u.loading&&e.jsx(M,{size:16}),s("common.save")]})]}),children:e.jsx(as,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,error:!!u.error||!!i,"data-cy":"input-factory-address",label:s("team.passport.factoryAddress"),helperText:r,value:u.factoryAddress,InputProps:{endAdornment:u.fetching?e.jsx(ft,{position:"end",children:e.jsx(M,{size:16})}):null},onChange:j=>{a({factoryAddress:j.target.value,error:""})}}),e.jsx(W,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:s("common.remark"),value:u.remark,onChange:j=>{a({remark:j.target.value})}}),e.jsx(W,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:s("team.passport.role"),select:!0,value:u.role,onChange:j=>{a({role:j.target.value})},variant:"outlined",children:l.filter(j=>j.name!=="owner").map(j=>e.jsx(ie,{value:j.name,"data-cy":`passport-role-select-option-${j.name}`,children:e.jsx("span",{children:j.title||j.name})},j.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Oe,{children:s("team.passport.ttl")}),e.jsxs(qe,{color:"primary",size:"small",value:u.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(j,T)=>a({ttlPolicy:T}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(K,{title:s("team.passport.ttlNeverTip"),children:e.jsx(E,{children:s("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(K,{title:s("team.passport.ttlMintTip"),children:e.jsx(E,{children:s("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(K,{title:s("team.passport.ttlExchangeTip"),children:e.jsx(E,{children:s("team.passport.ttlExchange")})})})]}),u.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:u.ttl,onChange:j=>{a({ttl:j.target.value})}}),e.jsx($e,{children:s("team.passport.ttlTip")})]})]})]})})})}Re.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedFactories:w.array,data:w.object};Re.defaultProps={data:{},trustedFactories:[]};const as=H.div`
106
+ `;var rs=Ot();const Ae=Ee(rs);function Re({onCancel:f,onSuccess:o,data:c,trustedFactories:m}){var x,d,v;const{api:p}=N(),{roles:l,teamDid:h}=M(),{t:s}=L(),[u,a]=qt({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:c.factoryAddress||"",remark:c.remark||"",role:((x=c.passport)==null?void 0:x.role)||"member",ttlPolicy:((d=c.passport)==null?void 0:d.ttlPolicy)||"never",ttl:Ae(+((v=c.passport)==null?void 0:v.ttl)||365*24*60*60*1e3),error:""}),n=m.findIndex(j=>j.factoryAddress===c.factoryAddress),t=async()=>{if(u.loading)return;const{factoryAddress:j,remark:T,role:C,ttlPolicy:I,ttl:D}=u,A={factoryAddress:j,remark:T,passport:{role:C,ttlPolicy:I,ttl:I==="never"?0:Ae(D)}},k=[...m];n===-1?k.unshift(A):k[n]=A;try{a({loading:!0}),await p.configTrustedFactories({input:{teamDid:h,trustedFactories:k}}),await re(800),F.success(s("common.saveSuccess")),o()}catch(B){console.error(B),F.error(se(B))}finally{a({loading:!1})}};S.useEffect(()=>{const j=u.fetched.find(C=>C.address===u.factoryAddress),T=u.errored.find(C=>C.address===u.factoryAddress);wt.isValid(u.factoryAddress)&&!u.fetching&&!j&&!T&&(a({fetching:!0}),Nt(G.MAIN_CHAIN_ENDPOINT).getFactoryState({address:u.factoryAddress}).then(I=>{I.state?a({fetching:!1,fetched:[...u.fetched.filter(D=>D.address!==u.factoryAddress),I.state],remark:I.state.name}):a({fetching:!1,errored:[...u.errored.filter(D=>D.address!==u.factoryAddress),{address:u.factoryAddress}],error:s("team.passport.factory404",u)})}).catch(I=>{console.error(I),a({fetching:!1,error:se(I)})}))},[u.factoryAddress,u.fetching]);let r=u.error;const i=u.factoryAddress?u.errored.find(j=>j.address===u.factoryAddress):null;!r&&i&&(r=s("team.passport.factory404",u));const y=u.factoryAddress?u.fetched.find(j=>j.address===u.factoryAddress):null;return!r&&y&&(r=y.description),r||(r=s("team.passport.factoryAddressTip")),e.jsx(U,{title:s("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx($,{onClick:f,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>t(),color:"primary",disabled:!u.factoryAddress||!u.remark||!u.role||u.loading||u.error||i,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[u.loading&&e.jsx(O,{size:16}),s("common.save")]})]}),children:e.jsx(as,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,error:!!u.error||!!i,"data-cy":"input-factory-address",label:s("team.passport.factoryAddress"),helperText:r,value:u.factoryAddress,InputProps:{endAdornment:u.fetching?e.jsx(ft,{position:"end",children:e.jsx(O,{size:16})}):null},onChange:j=>{a({factoryAddress:j.target.value,error:""})}}),e.jsx(W,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:s("common.remark"),value:u.remark,onChange:j=>{a({remark:j.target.value})}}),e.jsx(W,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:s("team.passport.role"),select:!0,value:u.role,onChange:j=>{a({role:j.target.value})},variant:"outlined",children:l.filter(j=>j.name!=="owner").map(j=>e.jsx(ie,{value:j.name,"data-cy":`passport-role-select-option-${j.name}`,children:e.jsx("span",{children:j.title||j.name})},j.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Me,{children:s("team.passport.ttl")}),e.jsxs(qe,{color:"primary",size:"small",value:u.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(j,T)=>a({ttlPolicy:T}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(K,{title:s("team.passport.ttlNeverTip"),children:e.jsx(E,{children:s("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(K,{title:s("team.passport.ttlMintTip"),children:e.jsx(E,{children:s("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(K,{title:s("team.passport.ttlExchangeTip"),children:e.jsx(E,{children:s("team.passport.ttlExchange")})})})]}),u.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:u.ttl,onChange:j=>{a({ttl:j.target.value})}}),e.jsx($e,{children:s("team.passport.ttlTip")})]})]})]})})})}Re.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedFactories:w.array,data:w.object};Re.defaultProps={data:{},trustedFactories:[]};const as=H.div`
107
107
  .dialog-h1 {
108
108
  font-size: 18px;
109
109
  }
@@ -115,7 +115,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
115
115
  }
116
116
  }
117
117
  }
118
- `;function ue({onCancel:f,hasPermission:o}){const{api:c}=A(),{teamDid:m,trustedFactories:p}=O(),{t:l}=L(),[h,s]=S.useState(null),[u,a]=S.useState(!1),[n,t]=S.useState(null),[r,i]=S.useState(""),y=async d=>{if(!u)try{a(!0),await c.configTrustedFactories({input:{teamDid:m,trustedFactories:p.filter(v=>v.factoryAddress!==d)}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(null)}catch(v){a(!1),F.error(v.message)}},x=p.filter(d=>!r||d.factoryAddress.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedFactories"),open:!0,onClose:f,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedFactoriesTip")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(d=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexGrow:1,children:[e.jsx(je,{copyable:!1,did:d.factoryAddress,size:16,showDidLogo:!1}),!!d.remark&&e.jsx(g,{fontSize:12,maxWidth:"300px",children:d.remark})]}),e.jsx(g,{color:"gray",mr:"24px",children:e.jsx(Pt,{type:"success",children:d.passport.role})}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx($,{onClick:()=>t({mode:"update",data:Z(d)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(ce,{})}),e.jsx($,{"data-cy":"delete-trusted-factory",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:d.factoryAddress}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(d.factoryAddress),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},d.factoryAddress)),!p.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Re,{data:n.data,trustedFactories:Z(p),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}ue.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};ue.defaultProps={hasPermission:!1};const ns=V(ue,"mutate_team"),os=V(ue,"",J);function is(f){const{inService:o}=A();return o?e.jsx(os,{...f}):e.jsx(ns,{...f})}const ls=H.div`
118
+ `;function ue({onCancel:f,hasPermission:o}){const{api:c}=N(),{teamDid:m,trustedFactories:p}=M(),{t:l}=L(),[h,s]=S.useState(null),[u,a]=S.useState(!1),[n,t]=S.useState(null),[r,i]=S.useState(""),y=async d=>{if(!u)try{a(!0),await c.configTrustedFactories({input:{teamDid:m,trustedFactories:p.filter(v=>v.factoryAddress!==d)}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(null)}catch(v){a(!1),F.error(v.message)}},x=p.filter(d=>!r||d.factoryAddress.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedFactories"),open:!0,onClose:f,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedFactoriesTip")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(d=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexGrow:1,children:[e.jsx(je,{copyable:!1,did:d.factoryAddress,size:16,showDidLogo:!1}),!!d.remark&&e.jsx(g,{fontSize:12,maxWidth:"300px",children:d.remark})]}),e.jsx(g,{color:"gray",mr:"24px",children:e.jsx(Pt,{type:"success",children:d.passport.role})}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx($,{onClick:()=>t({mode:"update",data:Z(d)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(ce,{})}),e.jsx($,{"data-cy":"delete-trusted-factory",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:d.factoryAddress}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(d.factoryAddress),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},d.factoryAddress)),!p.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Re,{data:n.data,trustedFactories:Z(p),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}ue.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};ue.defaultProps={hasPermission:!1};const ns=V(ue,"mutate_team"),os=V(ue,"",J);function is(f){const{inService:o}=N();return o?e.jsx(os,{...f}):e.jsx(ns,{...f})}const ls=H.div`
119
119
  .list {
120
120
  .MuiIconButton-root {
121
121
  svg {
@@ -128,7 +128,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
128
128
  *
129
129
  * @author Feross Aboukhadijeh <https://feross.org>
130
130
  * @license MIT
131
- */var ds=function(f){return f!=null&&(nt(f)||ps(f)||!!f._isBuffer)};function nt(f){return!!f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function ps(f){return typeof f.readFloatLE=="function"&&typeof f.slice=="function"&&nt(f.slice(0,0))}(function(){var f=cs,o=Le.utf8,c=ds,m=Le.bin,p=function(l,h){l.constructor==String?h&&h.encoding==="binary"?l=m.stringToBytes(l):l=o.stringToBytes(l):c(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var s=f.bytesToWords(l),u=l.length*8,a=1732584193,n=-271733879,t=-1732584194,r=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[u>>>5]|=128<<u%32,s[(u+64>>>9<<4)+14]=u;for(var y=p._ff,x=p._gg,d=p._hh,v=p._ii,i=0;i<s.length;i+=16){var j=a,T=n,C=t,I=r;a=y(a,n,t,r,s[i+0],7,-680876936),r=y(r,a,n,t,s[i+1],12,-389564586),t=y(t,r,a,n,s[i+2],17,606105819),n=y(n,t,r,a,s[i+3],22,-1044525330),a=y(a,n,t,r,s[i+4],7,-176418897),r=y(r,a,n,t,s[i+5],12,1200080426),t=y(t,r,a,n,s[i+6],17,-1473231341),n=y(n,t,r,a,s[i+7],22,-45705983),a=y(a,n,t,r,s[i+8],7,1770035416),r=y(r,a,n,t,s[i+9],12,-1958414417),t=y(t,r,a,n,s[i+10],17,-42063),n=y(n,t,r,a,s[i+11],22,-1990404162),a=y(a,n,t,r,s[i+12],7,1804603682),r=y(r,a,n,t,s[i+13],12,-40341101),t=y(t,r,a,n,s[i+14],17,-1502002290),n=y(n,t,r,a,s[i+15],22,1236535329),a=x(a,n,t,r,s[i+1],5,-165796510),r=x(r,a,n,t,s[i+6],9,-1069501632),t=x(t,r,a,n,s[i+11],14,643717713),n=x(n,t,r,a,s[i+0],20,-373897302),a=x(a,n,t,r,s[i+5],5,-701558691),r=x(r,a,n,t,s[i+10],9,38016083),t=x(t,r,a,n,s[i+15],14,-660478335),n=x(n,t,r,a,s[i+4],20,-405537848),a=x(a,n,t,r,s[i+9],5,568446438),r=x(r,a,n,t,s[i+14],9,-1019803690),t=x(t,r,a,n,s[i+3],14,-187363961),n=x(n,t,r,a,s[i+8],20,1163531501),a=x(a,n,t,r,s[i+13],5,-1444681467),r=x(r,a,n,t,s[i+2],9,-51403784),t=x(t,r,a,n,s[i+7],14,1735328473),n=x(n,t,r,a,s[i+12],20,-1926607734),a=d(a,n,t,r,s[i+5],4,-378558),r=d(r,a,n,t,s[i+8],11,-2022574463),t=d(t,r,a,n,s[i+11],16,1839030562),n=d(n,t,r,a,s[i+14],23,-35309556),a=d(a,n,t,r,s[i+1],4,-1530992060),r=d(r,a,n,t,s[i+4],11,1272893353),t=d(t,r,a,n,s[i+7],16,-155497632),n=d(n,t,r,a,s[i+10],23,-1094730640),a=d(a,n,t,r,s[i+13],4,681279174),r=d(r,a,n,t,s[i+0],11,-358537222),t=d(t,r,a,n,s[i+3],16,-722521979),n=d(n,t,r,a,s[i+6],23,76029189),a=d(a,n,t,r,s[i+9],4,-640364487),r=d(r,a,n,t,s[i+12],11,-421815835),t=d(t,r,a,n,s[i+15],16,530742520),n=d(n,t,r,a,s[i+2],23,-995338651),a=v(a,n,t,r,s[i+0],6,-198630844),r=v(r,a,n,t,s[i+7],10,1126891415),t=v(t,r,a,n,s[i+14],15,-1416354905),n=v(n,t,r,a,s[i+5],21,-57434055),a=v(a,n,t,r,s[i+12],6,1700485571),r=v(r,a,n,t,s[i+3],10,-1894986606),t=v(t,r,a,n,s[i+10],15,-1051523),n=v(n,t,r,a,s[i+1],21,-2054922799),a=v(a,n,t,r,s[i+8],6,1873313359),r=v(r,a,n,t,s[i+15],10,-30611744),t=v(t,r,a,n,s[i+6],15,-1560198380),n=v(n,t,r,a,s[i+13],21,1309151649),a=v(a,n,t,r,s[i+4],6,-145523070),r=v(r,a,n,t,s[i+11],10,-1120210379),t=v(t,r,a,n,s[i+2],15,718787259),n=v(n,t,r,a,s[i+9],21,-343485551),a=a+j>>>0,n=n+T>>>0,t=t+C>>>0,r=r+I>>>0}return f.endian([a,n,t,r])};p._ff=function(l,h,s,u,a,n,t){var r=l+(h&s|~h&u)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._gg=function(l,h,s,u,a,n,t){var r=l+(h&u|s&~u)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._hh=function(l,h,s,u,a,n,t){var r=l+(h^s^u)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._ii=function(l,h,s,u,a,n,t){var r=l+(s^(h|~u))+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._blocksize=16,p._digestsize=16,rt.exports=function(l,h){if(l==null)throw new Error("Illegal argument "+l);var s=f.wordsToBytes(p(l,h));return h&&h.asBytes?s:h&&h.asString?m.bytesToString(s):f.bytesToHex(s)}})();var us=rt.exports;const ms=Ee(us);function me({teamDid:f,onCancel:o,onSuccess:c,onError:m,mode:p,item:l}){var D,N;const{api:h}=A(),[s,u]=S.useState(!1),[a,n]=S.useState(""),{t}=L(),[r,i]=S.useState(l.title||""),[y,x]=S.useState(l.description||""),[d,v]=S.useState(((D=l==null?void 0:l.extra)==null?void 0:D.display)||"builtin"),[j,T]=S.useState((N=l==null?void 0:l.extra)!=null&&N.types?l.extra.types.join(","):""),C=async()=>{const k=r.trim();if(!k){n(t("team.passport.error.titleEmpty"));return}if(k.length>64){n(t("team.passport.error.titleTooLong",{length:64}));return}const B=y.replace(/\n/g," ");if(!B){n(t("team.passport.error.descriptionEmpty"));return}const Y=p==="create"?ms(k):l.name;n(null),u(!0);try{if(p==="create"){const R={teamDid:f,name:Y,title:k,description:B};d==="custom"&&(R.extra=JSON.stringify({display:"custom",types:j.split(",")})),await h.createRole({input:R})}else{const R={teamDid:f,role:{name:Y,title:k,description:B}};await h.updateRole({input:R})}c()}catch(R){const b=se(R);n(b),m(R)}finally{u(!1)}},I=e.jsxs("div",{children:[p==="update"&&e.jsx(E,{component:"div",style:{paddingTop:16},children:e.jsx(W,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:l.name,disabled:!0})}),e.jsx(E,{component:"div",style:{marginTop:16},children:e.jsx(W,{label:t("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:r,onChange:k=>{n(null),i(k.target.value)},disabled:p==="update"||s,helperText:t("team.passport.create.titleTip")})}),e.jsx(E,{component:"div",style:{marginTop:16,marginBottom:16},children:e.jsx(W,{label:t("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:y,onChange:k=>{n(null),x(k.target.value)},disabled:s,multiline:!0,rows:3})}),p==="create"&&e.jsxs("div",{style:{marginBottom:16},children:[e.jsx(Oe,{children:t("common.display")}),e.jsxs(qe,{color:"primary",size:"small",value:d,exclusive:!0,style:{marginTop:16},disabled:s,onChange:(k,B)=>v(B),"data-cy":"input-role-display",children:[e.jsx(ee,{value:"builtin","data-cy":"input-role-display-builtin",children:e.jsx(E,{children:t("team.passport.displayBuiltin")})}),e.jsx(ee,{value:"custom","data-cy":"input-role-display-custom",children:e.jsx(E,{children:t("team.passport.displayCustom")})})]}),d==="custom"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:j,disabled:s,onChange:k=>{T(k.target.value)}}),e.jsx($e,{children:t("team.passport.typesTip")})]})]})]});return e.jsxs(U,{title:p==="create"?t("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:o,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:o,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{"data-cy":"mutate-role-confirm",onClick:C,color:"primary",disabled:s,variant:"contained",autoFocus:!0,children:[s&&e.jsx(M,{size:16}),t(p==="create"?"common.create":"common.update")]})]}),children:[e.jsx(ht,{component:"div",children:I}),!!a&&e.jsx(Me,{severity:"error",variant:"icon",style:{width:"100%",margin:0},children:a})]})}me.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,mode:w.oneOf(["create","update"]),item:w.object};me.defaultProps={onError:()=>{},mode:"create",item:{}};function fe({onCancel:f,onSuccess:o,onDelete:c,roleName:m,hasPermission:p}){const{api:l}=A(),{roles:h,permissions:s,teamDid:u,refresh:a,isNodeTeam:n}=O(),{t}=L(),[r,i]=S.useState([]),[y,x]=S.useState(!1),[d,v]=S.useState(null),[j,T]=S.useState(!1),C=Z(h.find(R=>R.name===m)),I=Ge(m),D=async R=>{if(!j)try{T(!0),await l.deleteRole({input:{teamDid:u,name:R}}),c()}catch(b){F.error(b.message)}finally{T(!1),v(null)}},N=async(R,b)=>{const z=(await l.getPermissionsByRole({input:{teamDid:R,role:{name:b}}})).permissions||[],q=s.map(ae=>({...ae,bind:z.some(lt=>lt.name===ae.name)}));i(q)},k=async()=>{T(!0);const R=r.filter(b=>b.bind).map(b=>b.name);try{await l.updatePermissionsForRole({input:{teamDid:u,roleName:C.name,grantNames:R}}),F.success(t("common.saveSuccess")),o()}catch(b){F.error(se(b))}finally{T(!1)}};S.useEffect(()=>{u&&m&&N(u,m)},[u,m]);const B=n||!p;let Y=null;return n&&(Y=e.jsxs("div",{className:"bind",children:[e.jsx("div",{className:"title",children:t("common.permission")}),e.jsx("div",{className:"list",children:r.filter(R=>B?R.bind:!0).map(R=>e.jsx("div",{className:"item",children:e.jsx(xt,{control:e.jsx(gt,{disabled:B,checked:R.bind,onChange:()=>{i(b=>b.map(P=>(P.name===R.name&&(P.bind=!P.bind),P)))},name:R.name}),label:R.description})}))})]})),e.jsxs(U,{title:t("common.passport"),onClose:f,open:!0,fullWidth:!0,toolbar:p&&!I&&e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>x(C),"data-cy":`edit-passport-${C.name}`,size:"large",children:e.jsx(ce,{fill:"#bfbfbf"})}),e.jsx($,{onClick:()=>v({title:t("team.passport.delete.title"),description:t("team.passport.delete.description",{name:C.title}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>{D(C.name)},onCancel:()=>{T(!1),v(null)}}),"data-cy":`delete-passport-${C.name}`,size:"large",children:e.jsx(Q,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:n&&!B&&e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{onClick:k,color:"primary",disabled:j||!C,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[j&&e.jsx(M,{size:16}),t("common.save")]})]}),children:[e.jsxs(gs,{children:[!C&&e.jsx(ys,{children:e.jsx(M,{})}),C&&e.jsxs("div",{className:"dialog-content",children:[e.jsxs("div",{className:"header",children:[e.jsx("div",{className:"title",children:C.title}),e.jsx("div",{className:"description",style:{marginTop:n?16:48},children:C.description})]}),Y]})]}),y&&e.jsx(me,{teamDid:u,onCancel:()=>x(null),onSuccess:()=>{x(null),a()},mode:"update",roleName:y.name,item:y}),d&&e.jsx(Se,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}const fs=V(fe,"mutate_team"),hs=V(fe,"",J);function xs(f){const{inService:o}=A();return o?e.jsx(hs,{...f}):e.jsx(fs,{...f})}fe.propTypes={roleName:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onDelete:w.func.isRequired,hasPermission:w.bool};fe.defaultProps={hasPermission:!1};const gs=H.div`
131
+ */var ds=function(f){return f!=null&&(nt(f)||ps(f)||!!f._isBuffer)};function nt(f){return!!f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function ps(f){return typeof f.readFloatLE=="function"&&typeof f.slice=="function"&&nt(f.slice(0,0))}(function(){var f=cs,o=Le.utf8,c=ds,m=Le.bin,p=function(l,h){l.constructor==String?h&&h.encoding==="binary"?l=m.stringToBytes(l):l=o.stringToBytes(l):c(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var s=f.bytesToWords(l),u=l.length*8,a=1732584193,n=-271733879,t=-1732584194,r=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[u>>>5]|=128<<u%32,s[(u+64>>>9<<4)+14]=u;for(var y=p._ff,x=p._gg,d=p._hh,v=p._ii,i=0;i<s.length;i+=16){var j=a,T=n,C=t,I=r;a=y(a,n,t,r,s[i+0],7,-680876936),r=y(r,a,n,t,s[i+1],12,-389564586),t=y(t,r,a,n,s[i+2],17,606105819),n=y(n,t,r,a,s[i+3],22,-1044525330),a=y(a,n,t,r,s[i+4],7,-176418897),r=y(r,a,n,t,s[i+5],12,1200080426),t=y(t,r,a,n,s[i+6],17,-1473231341),n=y(n,t,r,a,s[i+7],22,-45705983),a=y(a,n,t,r,s[i+8],7,1770035416),r=y(r,a,n,t,s[i+9],12,-1958414417),t=y(t,r,a,n,s[i+10],17,-42063),n=y(n,t,r,a,s[i+11],22,-1990404162),a=y(a,n,t,r,s[i+12],7,1804603682),r=y(r,a,n,t,s[i+13],12,-40341101),t=y(t,r,a,n,s[i+14],17,-1502002290),n=y(n,t,r,a,s[i+15],22,1236535329),a=x(a,n,t,r,s[i+1],5,-165796510),r=x(r,a,n,t,s[i+6],9,-1069501632),t=x(t,r,a,n,s[i+11],14,643717713),n=x(n,t,r,a,s[i+0],20,-373897302),a=x(a,n,t,r,s[i+5],5,-701558691),r=x(r,a,n,t,s[i+10],9,38016083),t=x(t,r,a,n,s[i+15],14,-660478335),n=x(n,t,r,a,s[i+4],20,-405537848),a=x(a,n,t,r,s[i+9],5,568446438),r=x(r,a,n,t,s[i+14],9,-1019803690),t=x(t,r,a,n,s[i+3],14,-187363961),n=x(n,t,r,a,s[i+8],20,1163531501),a=x(a,n,t,r,s[i+13],5,-1444681467),r=x(r,a,n,t,s[i+2],9,-51403784),t=x(t,r,a,n,s[i+7],14,1735328473),n=x(n,t,r,a,s[i+12],20,-1926607734),a=d(a,n,t,r,s[i+5],4,-378558),r=d(r,a,n,t,s[i+8],11,-2022574463),t=d(t,r,a,n,s[i+11],16,1839030562),n=d(n,t,r,a,s[i+14],23,-35309556),a=d(a,n,t,r,s[i+1],4,-1530992060),r=d(r,a,n,t,s[i+4],11,1272893353),t=d(t,r,a,n,s[i+7],16,-155497632),n=d(n,t,r,a,s[i+10],23,-1094730640),a=d(a,n,t,r,s[i+13],4,681279174),r=d(r,a,n,t,s[i+0],11,-358537222),t=d(t,r,a,n,s[i+3],16,-722521979),n=d(n,t,r,a,s[i+6],23,76029189),a=d(a,n,t,r,s[i+9],4,-640364487),r=d(r,a,n,t,s[i+12],11,-421815835),t=d(t,r,a,n,s[i+15],16,530742520),n=d(n,t,r,a,s[i+2],23,-995338651),a=v(a,n,t,r,s[i+0],6,-198630844),r=v(r,a,n,t,s[i+7],10,1126891415),t=v(t,r,a,n,s[i+14],15,-1416354905),n=v(n,t,r,a,s[i+5],21,-57434055),a=v(a,n,t,r,s[i+12],6,1700485571),r=v(r,a,n,t,s[i+3],10,-1894986606),t=v(t,r,a,n,s[i+10],15,-1051523),n=v(n,t,r,a,s[i+1],21,-2054922799),a=v(a,n,t,r,s[i+8],6,1873313359),r=v(r,a,n,t,s[i+15],10,-30611744),t=v(t,r,a,n,s[i+6],15,-1560198380),n=v(n,t,r,a,s[i+13],21,1309151649),a=v(a,n,t,r,s[i+4],6,-145523070),r=v(r,a,n,t,s[i+11],10,-1120210379),t=v(t,r,a,n,s[i+2],15,718787259),n=v(n,t,r,a,s[i+9],21,-343485551),a=a+j>>>0,n=n+T>>>0,t=t+C>>>0,r=r+I>>>0}return f.endian([a,n,t,r])};p._ff=function(l,h,s,u,a,n,t){var r=l+(h&s|~h&u)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._gg=function(l,h,s,u,a,n,t){var r=l+(h&u|s&~u)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._hh=function(l,h,s,u,a,n,t){var r=l+(h^s^u)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._ii=function(l,h,s,u,a,n,t){var r=l+(s^(h|~u))+(a>>>0)+t;return(r<<n|r>>>32-n)+h},p._blocksize=16,p._digestsize=16,rt.exports=function(l,h){if(l==null)throw new Error("Illegal argument "+l);var s=f.wordsToBytes(p(l,h));return h&&h.asBytes?s:h&&h.asString?m.bytesToString(s):f.bytesToHex(s)}})();var us=rt.exports;const ms=Ee(us);function me({teamDid:f,onCancel:o,onSuccess:c,onError:m,mode:p,item:l}){var D,A;const{api:h}=N(),[s,u]=S.useState(!1),[a,n]=S.useState(""),{t}=L(),[r,i]=S.useState(l.title||""),[y,x]=S.useState(l.description||""),[d,v]=S.useState(((D=l==null?void 0:l.extra)==null?void 0:D.display)||"builtin"),[j,T]=S.useState((A=l==null?void 0:l.extra)!=null&&A.types?l.extra.types.join(","):""),C=async()=>{const k=r.trim();if(!k){n(t("team.passport.error.titleEmpty"));return}if(k.length>64){n(t("team.passport.error.titleTooLong",{length:64}));return}const B=y.replace(/\n/g," ");if(!B){n(t("team.passport.error.descriptionEmpty"));return}const Y=p==="create"?ms(k):l.name;n(null),u(!0);try{if(p==="create"){const R={teamDid:f,name:Y,title:k,description:B};d==="custom"&&(R.extra=JSON.stringify({display:"custom",types:j.split(",")})),await h.createRole({input:R})}else{const R={teamDid:f,role:{name:Y,title:k,description:B}};await h.updateRole({input:R})}c()}catch(R){const b=se(R);n(b),m(R)}finally{u(!1)}},I=e.jsxs("div",{children:[p==="update"&&e.jsx(E,{component:"div",style:{paddingTop:16},children:e.jsx(W,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:l.name,disabled:!0})}),e.jsx(E,{component:"div",style:{marginTop:16},children:e.jsx(W,{label:t("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:r,onChange:k=>{n(null),i(k.target.value)},disabled:p==="update"||s,helperText:t("team.passport.create.titleTip")})}),e.jsx(E,{component:"div",style:{marginTop:16,marginBottom:16},children:e.jsx(W,{label:t("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:y,onChange:k=>{n(null),x(k.target.value)},disabled:s,multiline:!0,rows:3})}),p==="create"&&e.jsxs("div",{style:{marginBottom:16},children:[e.jsx(Me,{children:t("common.display")}),e.jsxs(qe,{color:"primary",size:"small",value:d,exclusive:!0,style:{marginTop:16},disabled:s,onChange:(k,B)=>v(B),"data-cy":"input-role-display",children:[e.jsx(ee,{value:"builtin","data-cy":"input-role-display-builtin",children:e.jsx(E,{children:t("team.passport.displayBuiltin")})}),e.jsx(ee,{value:"custom","data-cy":"input-role-display-custom",children:e.jsx(E,{children:t("team.passport.displayCustom")})})]}),d==="custom"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:j,disabled:s,onChange:k=>{T(k.target.value)}}),e.jsx($e,{children:t("team.passport.typesTip")})]})]})]});return e.jsxs(U,{title:p==="create"?t("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:o,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:o,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{"data-cy":"mutate-role-confirm",onClick:C,color:"primary",disabled:s,variant:"contained",autoFocus:!0,children:[s&&e.jsx(O,{size:16}),t(p==="create"?"common.create":"common.update")]})]}),children:[e.jsx(ht,{component:"div",children:I}),!!a&&e.jsx(Oe,{severity:"error",variant:"icon",style:{width:"100%",margin:0},children:a})]})}me.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,mode:w.oneOf(["create","update"]),item:w.object};me.defaultProps={onError:()=>{},mode:"create",item:{}};function fe({onCancel:f,onSuccess:o,onDelete:c,roleName:m,hasPermission:p}){const{api:l}=N(),{roles:h,permissions:s,teamDid:u,refresh:a,isNodeTeam:n}=M(),{t}=L(),[r,i]=S.useState([]),[y,x]=S.useState(!1),[d,v]=S.useState(null),[j,T]=S.useState(!1),C=Z(h.find(R=>R.name===m)),I=Ge(m),D=async R=>{if(!j)try{T(!0),await l.deleteRole({input:{teamDid:u,name:R}}),c()}catch(b){F.error(b.message)}finally{T(!1),v(null)}},A=async(R,b)=>{const z=(await l.getPermissionsByRole({input:{teamDid:R,role:{name:b}}})).permissions||[],q=s.map(ae=>({...ae,bind:z.some(lt=>lt.name===ae.name)}));i(q)},k=async()=>{T(!0);const R=r.filter(b=>b.bind).map(b=>b.name);try{await l.updatePermissionsForRole({input:{teamDid:u,roleName:C.name,grantNames:R}}),F.success(t("common.saveSuccess")),o()}catch(b){F.error(se(b))}finally{T(!1)}};S.useEffect(()=>{u&&m&&A(u,m)},[u,m]);const B=n||!p;let Y=null;return n&&(Y=e.jsxs("div",{className:"bind",children:[e.jsx("div",{className:"title",children:t("common.permission")}),e.jsx("div",{className:"list",children:r.filter(R=>B?R.bind:!0).map(R=>e.jsx("div",{className:"item",children:e.jsx(xt,{control:e.jsx(gt,{disabled:B,checked:R.bind,onChange:()=>{i(b=>b.map(P=>(P.name===R.name&&(P.bind=!P.bind),P)))},name:R.name}),label:R.description})}))})]})),e.jsxs(U,{title:t("common.passport"),onClose:f,open:!0,fullWidth:!0,toolbar:p&&!I&&e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>x(C),"data-cy":`edit-passport-${C.name}`,size:"large",children:e.jsx(ce,{fill:"#bfbfbf"})}),e.jsx($,{onClick:()=>v({title:t("team.passport.delete.title"),description:t("team.passport.delete.description",{name:C.title}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>{D(C.name)},onCancel:()=>{T(!1),v(null)}}),"data-cy":`delete-passport-${C.name}`,size:"large",children:e.jsx(Q,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:n&&!B&&e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:f,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{onClick:k,color:"primary",disabled:j||!C,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[j&&e.jsx(O,{size:16}),t("common.save")]})]}),children:[e.jsxs(gs,{children:[!C&&e.jsx(ys,{children:e.jsx(O,{})}),C&&e.jsxs("div",{className:"dialog-content",children:[e.jsxs("div",{className:"header",children:[e.jsx("div",{className:"title",children:C.title}),e.jsx("div",{className:"description",style:{marginTop:n?16:48},children:C.description})]}),Y]})]}),y&&e.jsx(me,{teamDid:u,onCancel:()=>x(null),onSuccess:()=>{x(null),a()},mode:"update",roleName:y.name,item:y}),d&&e.jsx(Se,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}const fs=V(fe,"mutate_team"),hs=V(fe,"",J);function xs(f){const{inService:o}=N();return o?e.jsx(hs,{...f}):e.jsx(fs,{...f})}fe.propTypes={roleName:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onDelete:w.func.isRequired,hasPermission:w.bool};fe.defaultProps={hasPermission:!1};const gs=H.div`
132
132
  .header {
133
133
  .title {
134
134
  font-weight: 400;
@@ -177,7 +177,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
177
177
  justify-content: center;
178
178
  align-items: center;
179
179
  height: 200px;
180
- `,Be=S.memo(({field:f,value:o,copyable:c})=>{const{local:m}=L();return o?e.jsxs(g,{display:"flex",alignItems:"center",gap:1,onClick:p=>p.stopPropagation(),children:[f?e.jsxs(Fe,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[f,":"]}):null,e.jsx(Fe,{variant:"body1",children:e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx(K,{title:o,children:e.jsx("span",{className:"value-ellipsis",children:o})}),c?e.jsx(It,{content:Ot(o),locale:m,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null});function De({createPassportSvg:f}){const{inService:o}=A(),{roles:c,teamIssuerDid:m,teamName:p,refresh:l,passportColor:h,teamDid:s,isNodeTeam:u}=O(),{t:a}=L(),[n,t]=S.useState(!1),[r,i]=S.useState(!1),y=yt(d=>d.breakpoints.down("md")),x=S.useCallback(d=>d&&!G.ROLES[d.toUpperCase()],[]);return e.jsxs(js,{sx:{mt:0},children:[e.jsx(g,{display:"flex",justifyContent:"flex-end",children:!u&&e.jsxs(jt,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),a("team.passport.create.title")]})}),e.jsx(g,{className:"list",children:c.map(d=>e.jsxs(g,{"data-cy":`passport-${d.name}`,sx:{display:"flex",justifyContent:"space-between"},className:"item",display:"flex",alignItems:"center",onClick:()=>i(d),children:[e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:f({title:d.title,issuer:p,issuerDid:m,ownerName:"Your Name",ownerDid:m,preferredColor:h,width:"150px"})}}),e.jsxs(g,{ml:3,className:"title",children:[e.jsx(Be,{value:d.title}),x(d.name)?e.jsx(Be,{value:d.name,copyable:!0}):null]})]}),!y&&e.jsx(g,{className:"description",children:d.description}),e.jsx(Ke,{permission:o?"":"mutate_team",role:o?J:[],children:e.jsx("div",{className:"action",children:Ge(d.name)?e.jsx(Wt,{}):e.jsx(ce,{})})})]},d.name))}),r&&e.jsx(xs,{onCancel:()=>i(!1),onSuccess:()=>{i(!1),l()},onDelete:()=>{i(!1),l()},mode:"update",roleName:r.name,item:r}),n&&e.jsx(me,{teamDid:s,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const js=H(g)`
180
+ `,Be=S.memo(({field:f,value:o,copyable:c})=>{const{local:m}=L();return o?e.jsxs(g,{display:"flex",alignItems:"center",gap:1,onClick:p=>p.stopPropagation(),children:[f?e.jsxs(Fe,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[f,":"]}):null,e.jsx(Fe,{variant:"body1",children:e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx(K,{title:o,children:e.jsx("span",{className:"value-ellipsis",children:o})}),c?e.jsx(It,{content:Mt(o),locale:m,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null});function De({createPassportSvg:f}){const{inService:o}=N(),{roles:c,teamIssuerDid:m,teamName:p,refresh:l,passportColor:h,teamDid:s,isNodeTeam:u}=M(),{t:a}=L(),[n,t]=S.useState(!1),[r,i]=S.useState(!1),y=yt(d=>d.breakpoints.down("md")),x=S.useCallback(d=>d&&!G.ROLES[d.toUpperCase()],[]);return e.jsxs(js,{sx:{mt:0},children:[e.jsx(g,{display:"flex",justifyContent:"flex-end",children:!u&&e.jsxs(jt,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),a("team.passport.create.title")]})}),e.jsx(g,{className:"list",children:c.map(d=>e.jsxs(g,{"data-cy":`passport-${d.name}`,sx:{display:"flex",justifyContent:"space-between"},className:"item",display:"flex",alignItems:"center",onClick:()=>i(d),children:[e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:f({title:d.title,issuer:p,issuerDid:m,ownerName:"Your Name",ownerDid:m,preferredColor:h,width:"150px"})}}),e.jsxs(g,{ml:3,className:"title",children:[e.jsx(Be,{value:d.title}),x(d.name)?e.jsx(Be,{value:d.name,copyable:!0}):null]})]}),!y&&e.jsx(g,{className:"description",children:d.description}),e.jsx(Ke,{permission:o?"":"mutate_team",role:o?J:[],children:e.jsx("div",{className:"action",children:Ge(d.name)?e.jsx(Wt,{}):e.jsx(ce,{})})})]},d.name))}),r&&e.jsx(xs,{onCancel:()=>i(!1),onSuccess:()=>{i(!1),l()},onDelete:()=>{i(!1),l()},mode:"update",roleName:r.name,item:r}),n&&e.jsx(me,{teamDid:s,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const js=H(g)`
181
181
  .list {
182
182
  .item {
183
183
  padding: 12px;
@@ -216,7 +216,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DoD83n6N.js";import{a as dt,m
216
216
  fill: #bfbfbf;
217
217
  }
218
218
  }
219
- `;De.propTypes={createPassportSvg:w.func.isRequired};De.defaultProps={};function ke({createPassportSvg:f}){const{t:o}=L(),{api:c,inService:m}=A(),{teamDid:p,refresh:l,enablePassportIssuance:h,isNodeTeam:s}=O(),[u,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(!1),[y,x]=S.useState(!1),[d,v]=S.useState(!1),j=async T=>{if(T.stopPropagation(),!y){x(!0);try{await c.configPassportIssuance({input:{teamDid:p,enable:!h}}),l(),await re(800),F.success(o("common.configSuccess"))}catch(C){F.error(C.message)}finally{x(!1)}}};return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,sx:{ml:1},children:[e.jsx(Ke,{permission:m?"":"mutate_team",role:m?J:[],children:e.jsx(X,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(X.Item,{onClick:()=>t(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(g,{children:[o("team.passport.trustedPassportIssuers"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(X.Item,{onClick:()=>i(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(g,{children:[o("team.passport.configFactories"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configFactoriesTip")})]})}),e.jsx(X.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(g,{display:"flex",alignItems:"center",children:[y&&e.jsx(M,{size:16,style:{marginRight:8}}),e.jsxs(g,{children:[o(h?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(g,{fontSize:12,color:"#888",children:o(h?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!s&&e.jsx(X.Item,{onClick:()=>a(!0),"data-cy":"config-passport-color",children:e.jsxs(g,{children:[o("team.passport.configColor"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(_,{variant:"outlined",onClick:()=>{v(!0)},children:o("team.passport.view")})})}),n&&e.jsx(ts,{onCancel:()=>t(!1)}),r&&e.jsx(is,{onCancel:()=>i(!1)}),u&&e.jsx(Vt,{onCancel:()=>a(!1),onSuccess:()=>a(!1)}),d&&e.jsx(U,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:o("team.passport.view"),children:e.jsx(De,{createPassportSvg:f,onCancel:()=>v(!1)})})]})}ke.propTypes={createPassportSvg:w.func.isRequired};ke.defaultProps={};const ze="$all",_e="",ot=ct.memo(({createPassportSvg:f,passport:o,teamDid:c,inService:m})=>{var p,l,h,s;return e.jsx(g,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:f({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(p=o.user)==null?void 0:p.fullName,ownerDid:(l=o.user)==null?void 0:l.did,ownerAvatarUrl:(h=o.user)!=null&&h.avatar?Ye((s=o.user)==null?void 0:s.avatar,c,m):"",revoked:o.revoked,width:"36px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}})});ot.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired,teamDid:w.string.isRequired,inService:w.bool.isRequired};function it({createPassportSvg:f}){const{api:o}=A(),{teamDid:c}=O(),{t:m,locale:p}=L(),{SYSTEM_ROLES:l}=zt(),{inService:h}=A(),[s,u]=S.useState(!1),a=`passports-${c}`,n=Rt(a),[t,r]=S.useState({role:ze,status:_e,searchText:n.searchText||"",pageSize:n.rowsPerPage||10,page:n.page?n.page+1:1}),{data:i,loading:y}=oe(async()=>(await o.getPassportRoleCounts({input:{teamDid:c}})).counts||[],{refreshDeps:[c]}),{data:x,loading:d}=oe(async()=>{const b={};t.role!==ze&&(b.role=t.role),t.status&&(b.status=t.status);const P=await o.getPassportsByRole({input:{teamDid:c,query:b,paging:{page:t.page,pageSize:t.pageSize}}});return{passports:P.passports||[],total:P.paging.total}},{refreshDeps:[t.role,t.status,t.page,t.pageSize],onError:b=>F.error(b.message)}),v=b=>{const P=i==null?void 0:i.find(z=>z.key===b);return(P==null?void 0:P.value)||0},j=S.useMemo(()=>Object.keys(l).map(b=>({name:b,title:l[b],num:v(b)})),[i,v]),T=S.useMemo(()=>[{label:m("team.passport.role"),name:"role",options:{customBodyRender:(b,{rowIndex:P})=>{const z=x==null?void 0:x.passports[P];return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ot,{createPassportSvg:f,passport:z,teamDid:c}),e.jsx(g,{children:ve(z.role)})]})}}},{label:m("team.passport.owner"),name:"user",options:{customBodyRender:b=>Ce(b,h)}},{label:m("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:m("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:b=>Ve(b,p)}},{label:m("common.address"),name:"id",options:{customBodyRender:_t}},{label:m("blocklet.overview.source"),name:"source",options:{customBodyRender:(b,{rowIndex:P})=>{const z=x==null?void 0:x.passports[P];return z.parentDid?le("recover"):le(z.source)}}}],[m,p,x==null?void 0:x.passports,c,f,h]),C=b=>{r(P=>({...P,role:b,page:1}))},I=({page:b,rowsPerPage:P,searchText:z})=>{t.pageSize!==P?r(q=>({...q,searchText:"",pageSize:P,page:1})):t.page!==b+1?r(q=>({...q,searchText:"",page:b+1})):t.searchText!==z&&r(q=>({...q,searchText:z,page:1}))},D=S.useRef(null),N=(x==null?void 0:x.passports)||[],k=t.searchText?N.filter(b=>{var P;return b.id.includes(t.searchText)||(((P=b==null?void 0:b.user)==null?void 0:P.fullName)||"").includes(t.searchText)}):N,B={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(b,{dataIndex:P},z){var q;if((q=D.current)!=null&&q.contains(z.target)){const ae=x==null?void 0:x.passports[P];u(ae)}},page:t.page-1,rowsPerPage:t.pageSize,count:(x==null?void 0:x.total)||0,searchDebounceTime:600},Y=b=>{r(P=>({...P,status:b.target.value,page:1}))},R=e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(g,{sx:{fontSize:16,fontWeight:400},children:[m("team.passport.status"),":"]}),e.jsxs(vt,{size:"small",value:t.status,onChange:Y,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(ie,{value:_e,children:m("common.all")}),Object.values(G.PASSPORT_STATUS).map(b=>e.jsx(ie,{value:b,sx:{py:1},children:m(`team.passport.statusMap.${b}`)},b))]})]});return y?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsxs(vs,{children:[e.jsxs(g,{className:"main",display:"flex",sx:{mt:0,gap:3},children:[e.jsx(g,{className:"left",children:e.jsx(g,{className:"tabs",children:j.map(b=>e.jsxs(g,{className:`tab ${t.role===b.name?"active":""}`,onClick:()=>C(b.name),children:[e.jsx("span",{className:"text",children:b.title}),e.jsx(g,{sx:{color:"text.secondary"},children:b.num})]},b.name))})}),e.jsx(g,{ref:D,className:"right",children:e.jsx(xe,{className:"main-table",verticalKeyWidth:100,locale:p,durable:a,durableKeys:["page","rowsPerPage"],data:k,columns:T,options:B,loading:d,onChange:I,customButtons:[e.jsx(ke,{createPassportSvg:f})],title:R})})]}),s&&e.jsx(Te,{createPassportSvg:f,onCancel:()=>u(null),passport:s,onSwitchPassport:u})]})}it.propTypes={createPassportSvg:w.func.isRequired};it.defaultProps={};const vs=bt(g)`
219
+ `;De.propTypes={createPassportSvg:w.func.isRequired};De.defaultProps={};function ke({createPassportSvg:f}){const{t:o}=L(),{api:c,inService:m}=N(),{teamDid:p,refresh:l,enablePassportIssuance:h,isNodeTeam:s}=M(),[u,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(!1),[y,x]=S.useState(!1),[d,v]=S.useState(!1),j=async T=>{if(T.stopPropagation(),!y){x(!0);try{await c.configPassportIssuance({input:{teamDid:p,enable:!h}}),l(),await re(800),F.success(o("common.configSuccess"))}catch(C){F.error(C.message)}finally{x(!1)}}};return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,sx:{ml:1},children:[e.jsx(Ke,{permission:m?"":"mutate_team",role:m?J:[],children:e.jsx(X,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(X.Item,{onClick:()=>t(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(g,{children:[o("team.passport.trustedPassportIssuers"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(X.Item,{onClick:()=>i(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(g,{children:[o("team.passport.configFactories"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configFactoriesTip")})]})}),e.jsx(X.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(g,{display:"flex",alignItems:"center",children:[y&&e.jsx(O,{size:16,style:{marginRight:8}}),e.jsxs(g,{children:[o(h?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(g,{fontSize:12,color:"#888",children:o(h?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!s&&e.jsx(X.Item,{onClick:()=>a(!0),"data-cy":"config-passport-color",children:e.jsxs(g,{children:[o("team.passport.configColor"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(_,{variant:"outlined",onClick:()=>{v(!0)},children:o("team.passport.view")})})}),n&&e.jsx(ts,{onCancel:()=>t(!1)}),r&&e.jsx(is,{onCancel:()=>i(!1)}),u&&e.jsx(Vt,{onCancel:()=>a(!1),onSuccess:()=>a(!1)}),d&&e.jsx(U,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:o("team.passport.view"),children:e.jsx(De,{createPassportSvg:f,onCancel:()=>v(!1)})})]})}ke.propTypes={createPassportSvg:w.func.isRequired};ke.defaultProps={};const ze="$all",_e="",ot=ct.memo(({createPassportSvg:f,passport:o,teamDid:c,inService:m})=>{var p,l,h,s;return e.jsx(g,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:f({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(p=o.user)==null?void 0:p.fullName,ownerDid:(l=o.user)==null?void 0:l.did,ownerAvatarUrl:(h=o.user)!=null&&h.avatar?Ye((s=o.user)==null?void 0:s.avatar,c,m):"",revoked:o.revoked,width:"36px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}})});ot.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired,teamDid:w.string.isRequired,inService:w.bool.isRequired};function it({createPassportSvg:f}){const{api:o}=N(),{teamDid:c}=M(),{t:m,locale:p}=L(),{SYSTEM_ROLES:l}=zt(),{inService:h}=N(),[s,u]=S.useState(!1),a=`passports-${c}`,n=Rt(a),[t,r]=S.useState({role:ze,status:_e,searchText:n.searchText||"",pageSize:n.rowsPerPage||10,page:n.page?n.page+1:1}),{data:i,loading:y}=oe(async()=>(await o.getPassportRoleCounts({input:{teamDid:c}})).counts||[],{refreshDeps:[c]}),{data:x,loading:d}=oe(async()=>{const b={};t.role!==ze&&(b.role=t.role),t.status&&(b.status=t.status);const P=await o.getPassportsByRole({input:{teamDid:c,query:b,paging:{page:t.page,pageSize:t.pageSize}}});return{passports:P.passports||[],total:P.paging.total}},{refreshDeps:[t.role,t.status,t.page,t.pageSize],onError:b=>F.error(b.message)}),v=b=>{const P=i==null?void 0:i.find(z=>z.key===b);return(P==null?void 0:P.value)||0},j=S.useMemo(()=>Object.keys(l).map(b=>({name:b,title:l[b],num:v(b)})),[i,v]),T=S.useMemo(()=>[{label:m("team.passport.role"),name:"role",options:{customBodyRender:(b,{rowIndex:P})=>{const z=x==null?void 0:x.passports[P];return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ot,{createPassportSvg:f,passport:z,teamDid:c}),e.jsx(g,{children:ve(z.role)})]})}}},{label:m("team.passport.owner"),name:"user",options:{customBodyRender:b=>Ce(b,h)}},{label:m("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:m("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:b=>Ve(b,p)}},{label:m("common.address"),name:"id",options:{customBodyRender:_t}},{label:m("blocklet.overview.source"),name:"source",options:{customBodyRender:(b,{rowIndex:P})=>{const z=x==null?void 0:x.passports[P];return z.parentDid?le("recover"):le(z.source)}}}],[m,p,x==null?void 0:x.passports,c,f,h]),C=b=>{r(P=>({...P,role:b,page:1}))},I=({page:b,rowsPerPage:P,searchText:z})=>{t.pageSize!==P?r(q=>({...q,searchText:"",pageSize:P,page:1})):t.page!==b+1?r(q=>({...q,searchText:"",page:b+1})):t.searchText!==z&&r(q=>({...q,searchText:z,page:1}))},D=S.useRef(null),A=(x==null?void 0:x.passports)||[],k=t.searchText?A.filter(b=>{var P;return b.id.includes(t.searchText)||(((P=b==null?void 0:b.user)==null?void 0:P.fullName)||"").includes(t.searchText)}):A,B={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(b,{dataIndex:P},z){var q;if((q=D.current)!=null&&q.contains(z.target)){const ae=x==null?void 0:x.passports[P];u(ae)}},page:t.page-1,rowsPerPage:t.pageSize,count:(x==null?void 0:x.total)||0,searchDebounceTime:600},Y=b=>{r(P=>({...P,status:b.target.value,page:1}))},R=e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(g,{sx:{fontSize:16,fontWeight:400},children:[m("team.passport.status"),":"]}),e.jsxs(vt,{size:"small",value:t.status,onChange:Y,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(ie,{value:_e,children:m("common.all")}),Object.values(G.PASSPORT_STATUS).map(b=>e.jsx(ie,{value:b,sx:{py:1},children:m(`team.passport.statusMap.${b}`)},b))]})]});return y?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(O,{})})}):e.jsxs(vs,{children:[e.jsxs(g,{className:"main",display:"flex",sx:{mt:0,gap:3},children:[e.jsx(g,{className:"left",children:e.jsx(g,{className:"tabs",children:j.map(b=>e.jsxs(g,{className:`tab ${t.role===b.name?"active":""}`,onClick:()=>C(b.name),children:[e.jsx("span",{className:"text",children:b.title}),e.jsx(g,{sx:{color:"text.secondary"},children:b.num})]},b.name))})}),e.jsx(g,{ref:D,className:"right",children:e.jsx(xe,{className:"main-table",verticalKeyWidth:100,locale:p,durable:a,durableKeys:["page","rowsPerPage"],data:k,columns:T,options:B,loading:d,onChange:I,customButtons:[e.jsx(ke,{createPassportSvg:f})],title:R})})]}),s&&e.jsx(Te,{createPassportSvg:f,onCancel:()=>u(null),passport:s,onSwitchPassport:u})]})}it.propTypes={createPassportSvg:w.func.isRequired};it.defaultProps={};const vs=bt(g)`
220
220
  .main {
221
221
  .left {
222
222
  width: 256px;
@@ -1,4 +1,4 @@
1
- import{g as c}from"./vendor-react-DoD83n6N.js";var i={exports:{}};/*!
1
+ import{g as c}from"./vendor-react-DEoibe3W.js";var i={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
@@ -1 +1 @@
1
- import{r as P,b as J,g as W}from"./vendor-react-DoD83n6N.js";import{H as x,j as i,ao as B,s as _,w as ee,aa as U,T as w,y as te}from"./vendor-mui-core-DiDsSLd-.js";import{f as E,u as H}from"./vendor-hooks-jg6xPUPF.js";import{p as ne,o as v,h as se}from"./vendor-ux-did-connect-qEfzi7sf.js";import{z as O,x as re,y as z}from"./vendor-utils-DMClavLd.js";const Be=e=>{if(!e||!e.length)return[];const t=[];let o=null,s=[];if(e.forEach(n=>{var y,f,p,h;if(!n.activity||!n.activity.type||!o){o&&(s.length===1?t.push(s[0]):(o.items=s,t.push(o))),n.activity&&n.activity.type?(o=n,s=[n]):(t.push(n),o=null,s=[]);return}const r=s[0].activity,a=r.type,c=(y=r.target)==null?void 0:y.type,l=(f=r.target)==null?void 0:f.id,u=n.activity.type,d=(p=n.activity.target)==null?void 0:p.type,g=(h=n.activity.target)==null?void 0:h.id;if(a&&u&&a===u&&(!r.target&&!n.activity.target||r.target&&n.activity.target&&c===d&&l===g))s.push(n);else{if(s.length===1)t.push(s[0]);else{const T=Object.assign({},o,{items:s});t.push(T)}o=n,s=[n]}}),o)if(s.length===1)t.push(s[0]);else{const n=Object.assign({},o,{items:s});t.push(n)}return t},oe=e=>!O(e.activity)&&!!e.activity.type&&!!e.activity.actor,ze=e=>oe(e)&&!!e.actorInfo&&!!e.actorInfo.did,ie=e=>{if(!e)return null;const{meta:t,target:o}=e;return{metaLink:t==null?void 0:t.id,targetLink:o==null?void 0:o.id}},S={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign"},ae={[S.COMMENT]:(e,t)=>t>1?i.jsxs(i.Fragment,{children:["left ",t," comments on your ",e]}):i.jsxs(i.Fragment,{children:["commented on your ",e]}),[S.LIKE]:e=>i.jsxs(i.Fragment,{children:["liked your ",e]}),[S.FOLLOW]:()=>i.jsx(i.Fragment,{children:"followed you"}),[S.TIPS]:e=>i.jsxs(i.Fragment,{children:["gave tips to your ",e]}),[S.MENTION]:e=>i.jsxs(i.Fragment,{children:["mentioned you in ",e]}),[S.ASSIGN]:()=>i.jsx(i.Fragment,{children:"assigned you a task"})},b=P.memo(function({user:t,color:o=v.textBase}){const s=re(z(ne.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return i.jsx(B,{href:s,color:o,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});b.propTypes={user:x.shape({did:x.string.isRequired,fullName:x.string.isRequired}).isRequired,color:x.string};b.displayName="UserLink";function $e({activity:e,users:t,actors:o,extra:s={},mountPoint:n=""}){const{type:r,target:a}=e||{},{type:c}=a||{},{linkColor:l=v.textBase}=s||{},u=E(()=>{if(!Array.isArray(t))return new Map;const p=new Map;return t.forEach(h=>{h!=null&&h.did&&!p.has(h.did)&&p.set(h.did,h)}),p},[t]),d=E(()=>Array.isArray(o)?o.map(p=>p?u.get(p)||{did:p,fullName:"System"}:null):[],[o,u]),g=H(()=>{if(!Array.isArray(d)||d.length===0)return null;if(d.length===1)return i.jsx(b,{user:d[0],color:l});const p=d.slice(0,-1),h=d[d.length-1];if(d.length===2)return i.jsxs(i.Fragment,{children:[i.jsx(b,{user:p[0],color:l})," and ",i.jsx(b,{user:h,color:l})]});const T=d.length>3,F=T?d.slice(0,2):p;return i.jsxs(i.Fragment,{children:[F.map((I,Z)=>i.jsxs(J.Fragment,{children:[i.jsx(b,{user:I,color:l}),Z<F.length-1?", ":""]},I.did)),T?`, and ${d.length-2} others`:i.jsxs(i.Fragment,{children:[", and ",i.jsx(b,{user:h,color:l})]})]})}),m=H(()=>{const p=ae[r];return p?p(c,t.length):null}),y=E(()=>{const p=g(),h=m();return!p||!h?null:i.jsxs(i.Fragment,{children:[p," ",h]})},[r,c,d,g,m]),f=E(()=>{if(!e)return null;const p=ie(e);return p!=null&&p.targetLink?z(n,p.targetLink):null},[e,n]);return!r||O(a)?null:i.jsxs(i.Fragment,{children:[y," ",i.jsx(B,{href:f,color:v.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:p=>{p.customPreventRedirect=!0},children:a.name})]})}const le={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};$.propTypes={meta:x.object.isRequired};const ce=_(ee)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${v.dividerColor}`,boxShadow:"none"})),de=_(U)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),pe=_(U)({display:"flex",justifyContent:"space-between",alignItems:"center"});function $({meta:e}){const{amount:t,symbol:o,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return i.jsxs(ce,{children:[i.jsxs(de,{children:[i.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),i.jsx(w,{variant:"h5",color:v.textBase,children:"ArcBlock"})]}),i.jsxs(pe,{children:[i.jsxs(U,{display:"flex",alignItems:"baseline",gap:1,children:[i.jsxs(w,{component:"span",variant:"h5",color:v.textBase,fontWeight:"bold",children:["+ ",t]}),i.jsx(w,{component:"span",variant:"subtitle2",color:v.textSubtitle,children:o})]}),i.jsx(te,{variant:"outlined",size:"small",color:"secondary",endIcon:i.jsx(se,{icon:le}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}q.propTypes={meta:x.object.isRequired,type:x.string.isRequired,hideTips:x.bool,sx:x.object};q.defaultProps={hideTips:!1,sx:{}};function q({meta:e,type:t,hideTips:o=!1,sx:s}){return O(e)?null:t==="tips"&&!o?i.jsx($,{meta:e}):i.jsx(w,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:v.textSubtitle,children:e.content})}var ue=P;function he(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var M=he(ue);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s])}return e},j.apply(this,arguments)}function fe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,C(e,t)}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},C(e,t)}function me(e,t){if(e==null)return{};var o={},s=Object.keys(e),n,r;for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}var A={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},ge=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function ye(e,t){if(!e||typeof e!="object")return e;var o={};return Object.keys(e).forEach(function(s){t.indexOf(s)>-1||(o[s]=e[s])}),o}var xe=["component","className","unsafeHTML"];function V(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var o=document.createDocumentFragment(),s;switch(t){case"words":s=e.textContent.split(/\b|(?=\W)/);break;case"letters":s=Array.from(e.textContent);break}s.forEach(function(c){o.appendChild(ve(c))}),e.parentNode.replaceChild(o,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),r=n.length,a=0;a<r;a++)V(n[a],t)}function ve(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function R(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function G(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);G(e.parentNode,t)}}function be(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function N(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var K={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Se=Object.keys(K),Y=function(e){fe(t,e);function t(s){var n;return n=e.call(this,s)||this,n.state={html:s.unsafeHTML,clamped:!1},n.canvas=null,n.maxLine=0,n.nlUnits=[],n}var o=t.prototype;return o.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},o.componentDidUpdate=function(n){n.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==n&&this.reflow(this.props)},o.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},o.setState=function(n,r){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,r)},o.initCanvas=function(){if(!this.canvas){var n=this.canvas=document.createElement("div");n.className="LinesEllipsis-canvas "+this.props.className,n.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(A).forEach(function(r){n.style[r]=A[r]}),document.body.appendChild(n)}},o.copyStyleToCanvas=function(){var n=this,r=window.getComputedStyle(this.target);ge.forEach(function(a){n.canvas.style[a]=r[a]})},o.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var r=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");V(this.canvas,r);var a=this.putEllipsis(this.calcIndexes()),c={clamped:a,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},o.calcIndexes=function(){var n=[0],r=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),a=r.length;if(!r.length)return n;var c=r.find(N);if(!c)return n;for(var l=1,u=c.offsetTop,d=1;d<a&&!(N(r[d])&&r[d].offsetTop-u>1&&(l++,n.push(d),u=r[d].offsetTop,l>this.maxLine));d++);return n},o.putEllipsis=function(n){if(n.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,n[this.maxLine]);var r=this.nlUnits.pop(),a=this.makeEllipsisSpan();do G(r,this.canvas),be(r).appendChild(a),r=this.nlUnits.pop();while(r&&(!N(r)||a.offsetHeight>r.offsetHeight||a.offsetTop>r.offsetTop));return r&&R(r),this.nlUnits.forEach(R),!0},o.makeEllipsisSpan=function(){var n=this.props,r=n.ellipsisHTML,a=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var l=document.createElement("span");return l.className="LinesEllipsis-ellipsis",r?l.innerHTML=r:l.textContent=a,c.appendChild(l),c},o.isClamped=function(){return this.clamped},o.render=function(){var n=this,r=this.state,a=r.html,c=r.clamped,l=this.props,u=l.component,d=l.className,g=l.unsafeHTML,m=me(l,xe);return M.default.createElement(u,j({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(f){return n.target=f}},ye(m,Se)),M.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?a:g}}))},t}(M.default.Component);Y.defaultProps=K;var Le=Y;const qe=W(Le),Te=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ee=e=>{try{return new URL(e).host}catch{return e}};var Ve={getChainHost:Te,getUrlHost:Ee},Ge={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},we={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},Me={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const k=new Map,Ne=(e,t)=>{k.set(e,t)},je=(e="en_US")=>k.get(e)||k.get("en_US");var X={registerLang:Ne,getLang:je},Ce=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const ke=Ce,{getLang:L}=X,_e=(e,t)=>t===1?e:`${e}s`,Ue=1e-7;var Oe=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const o=L(t.locale),s=[],n=(c,l)=>{const u=Math.floor(c*10**l+Ue);return(Math.round(u)/10**l).toFixed(l)},r=(c,l,u)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&l==="minute"))return;const{long:d}=o[l]||L("en_US")[l],{short:g}=o[l]||L("en_US")[l];let m=(u||c||"0").toString(),y,f;if(t.colonNotation){y=s.length>0?":":"",f="";const p=m.includes(".")?m.split(".")[0].length:m.length,h=s.length>0?2:1;m="0".repeat(Math.max(0,h-p))+m}else y="",t.locale==="zh_CN"?Object.values(a).filter(p=>p>0).length>1?!a.days&&!a.hours&&a.minutes&&t.compact?f=d:f=g:a.minutes?f=d:f=g:f=t.verbose?` ${_e(d,c)}`:g;s.push(y+m+f)},a=ke(e);if(r(Math.trunc(a.days/365),"year"),r(a.days%365,"day"),r(a.hours,"hour"),r(a.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(r(a.seconds,"second"),t.formatSubMilliseconds)r(a.milliseconds,"millisecond"),r(a.microseconds,"microsecond"),r(a.nanoseconds,"nanosecond");else{const c=a.milliseconds+a.microseconds/1e3+a.nanoseconds/1e6,l=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=l?c.toFixed(l):u;r(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,l=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=n(c,l),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");r(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(o.millisecond||L("en_US").millisecond).long,l=(o.millisecond||L("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:l}`:`0${t.verbose?` ${c}s`:l}`}if(t.compact)return s[0];if(typeof t.unitCount=="number"){const c=t.colonNotation?"":" ";return s.slice(0,Math.max(t.unitCount,1)).join(c)}return t.colonNotation?s.join(""):s.join(" ")};const De=we,Fe=Me,{registerLang:D}=X,Q=Oe;D("en_US",De);D("zh_CN",Fe);Q.registerLang=D;var Ie=Q;const Ke=W(Ie);export{qe as H,q as M,ze as a,Ve as c,le as d,ie as g,oe as i,Be as m,Ke as p,Ge as s,$e as u};
1
+ import{r as P,b as J,g as W}from"./vendor-react-DEoibe3W.js";import{H as x,j as i,ao as B,s as _,w as ee,a9 as U,T as w,y as te}from"./vendor-mui-core-8zafwTFh.js";import{f as E,u as H}from"./vendor-hooks-DftG_2gV.js";import{j as ne,i as v,I as se}from"./vendor-ux-did-connect-D2f9rdKK.js";import{z as O,x as re,y as z}from"./vendor-utils-BNHJB5U7.js";const Be=e=>{if(!e||!e.length)return[];const t=[];let o=null,s=[];if(e.forEach(n=>{var y,f,p,h;if(!n.activity||!n.activity.type||!o){o&&(s.length===1?t.push(s[0]):(o.items=s,t.push(o))),n.activity&&n.activity.type?(o=n,s=[n]):(t.push(n),o=null,s=[]);return}const r=s[0].activity,a=r.type,c=(y=r.target)==null?void 0:y.type,l=(f=r.target)==null?void 0:f.id,u=n.activity.type,d=(p=n.activity.target)==null?void 0:p.type,g=(h=n.activity.target)==null?void 0:h.id;if(a&&u&&a===u&&(!r.target&&!n.activity.target||r.target&&n.activity.target&&c===d&&l===g))s.push(n);else{if(s.length===1)t.push(s[0]);else{const T=Object.assign({},o,{items:s});t.push(T)}o=n,s=[n]}}),o)if(s.length===1)t.push(s[0]);else{const n=Object.assign({},o,{items:s});t.push(n)}return t},oe=e=>!O(e.activity)&&!!e.activity.type&&!!e.activity.actor,ze=e=>oe(e)&&!!e.actorInfo&&!!e.actorInfo.did,ie=e=>{if(!e)return null;const{meta:t,target:o}=e;return{metaLink:t==null?void 0:t.id,targetLink:o==null?void 0:o.id}},S={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign"},ae={[S.COMMENT]:(e,t)=>t>1?i.jsxs(i.Fragment,{children:["left ",t," comments on your ",e]}):i.jsxs(i.Fragment,{children:["commented on your ",e]}),[S.LIKE]:e=>i.jsxs(i.Fragment,{children:["liked your ",e]}),[S.FOLLOW]:()=>i.jsx(i.Fragment,{children:"followed you"}),[S.TIPS]:e=>i.jsxs(i.Fragment,{children:["gave tips to your ",e]}),[S.MENTION]:e=>i.jsxs(i.Fragment,{children:["mentioned you in ",e]}),[S.ASSIGN]:()=>i.jsx(i.Fragment,{children:"assigned you a task"})},b=P.memo(function({user:t,color:o=v.textBase}){const s=re(z(ne.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return i.jsx(B,{href:s,color:o,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});b.propTypes={user:x.shape({did:x.string.isRequired,fullName:x.string.isRequired}).isRequired,color:x.string};b.displayName="UserLink";function $e({activity:e,users:t,actors:o,extra:s={},mountPoint:n=""}){const{type:r,target:a}=e||{},{type:c}=a||{},{linkColor:l=v.textBase}=s||{},u=E(()=>{if(!Array.isArray(t))return new Map;const p=new Map;return t.forEach(h=>{h!=null&&h.did&&!p.has(h.did)&&p.set(h.did,h)}),p},[t]),d=E(()=>Array.isArray(o)?o.map(p=>p?u.get(p)||{did:p,fullName:"System"}:null):[],[o,u]),g=H(()=>{if(!Array.isArray(d)||d.length===0)return null;if(d.length===1)return i.jsx(b,{user:d[0],color:l});const p=d.slice(0,-1),h=d[d.length-1];if(d.length===2)return i.jsxs(i.Fragment,{children:[i.jsx(b,{user:p[0],color:l})," and ",i.jsx(b,{user:h,color:l})]});const T=d.length>3,F=T?d.slice(0,2):p;return i.jsxs(i.Fragment,{children:[F.map((I,Z)=>i.jsxs(J.Fragment,{children:[i.jsx(b,{user:I,color:l}),Z<F.length-1?", ":""]},I.did)),T?`, and ${d.length-2} others`:i.jsxs(i.Fragment,{children:[", and ",i.jsx(b,{user:h,color:l})]})]})}),m=H(()=>{const p=ae[r];return p?p(c,t.length):null}),y=E(()=>{const p=g(),h=m();return!p||!h?null:i.jsxs(i.Fragment,{children:[p," ",h]})},[r,c,d,g,m]),f=E(()=>{if(!e)return null;const p=ie(e);return p!=null&&p.targetLink?z(n,p.targetLink):null},[e,n]);return!r||O(a)?null:i.jsxs(i.Fragment,{children:[y," ",i.jsx(B,{href:f,color:v.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:p=>{p.customPreventRedirect=!0},children:a.name})]})}const le={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};$.propTypes={meta:x.object.isRequired};const ce=_(ee)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${v.dividerColor}`,boxShadow:"none"})),de=_(U)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),pe=_(U)({display:"flex",justifyContent:"space-between",alignItems:"center"});function $({meta:e}){const{amount:t,symbol:o,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return i.jsxs(ce,{children:[i.jsxs(de,{children:[i.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),i.jsx(w,{variant:"h5",color:v.textBase,children:"ArcBlock"})]}),i.jsxs(pe,{children:[i.jsxs(U,{display:"flex",alignItems:"baseline",gap:1,children:[i.jsxs(w,{component:"span",variant:"h5",color:v.textBase,fontWeight:"bold",children:["+ ",t]}),i.jsx(w,{component:"span",variant:"subtitle2",color:v.textSubtitle,children:o})]}),i.jsx(te,{variant:"outlined",size:"small",color:"secondary",endIcon:i.jsx(se,{icon:le}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}q.propTypes={meta:x.object.isRequired,type:x.string.isRequired,hideTips:x.bool,sx:x.object};q.defaultProps={hideTips:!1,sx:{}};function q({meta:e,type:t,hideTips:o=!1,sx:s}){return O(e)?null:t==="tips"&&!o?i.jsx($,{meta:e}):i.jsx(w,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:v.textSubtitle,children:e.content})}var ue=P;function he(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var M=he(ue);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s])}return e},j.apply(this,arguments)}function fe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,C(e,t)}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},C(e,t)}function me(e,t){if(e==null)return{};var o={},s=Object.keys(e),n,r;for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}var A={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},ge=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function ye(e,t){if(!e||typeof e!="object")return e;var o={};return Object.keys(e).forEach(function(s){t.indexOf(s)>-1||(o[s]=e[s])}),o}var xe=["component","className","unsafeHTML"];function V(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var o=document.createDocumentFragment(),s;switch(t){case"words":s=e.textContent.split(/\b|(?=\W)/);break;case"letters":s=Array.from(e.textContent);break}s.forEach(function(c){o.appendChild(ve(c))}),e.parentNode.replaceChild(o,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),r=n.length,a=0;a<r;a++)V(n[a],t)}function ve(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function R(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function G(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);G(e.parentNode,t)}}function be(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function N(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var K={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Se=Object.keys(K),Y=function(e){fe(t,e);function t(s){var n;return n=e.call(this,s)||this,n.state={html:s.unsafeHTML,clamped:!1},n.canvas=null,n.maxLine=0,n.nlUnits=[],n}var o=t.prototype;return o.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},o.componentDidUpdate=function(n){n.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==n&&this.reflow(this.props)},o.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},o.setState=function(n,r){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,r)},o.initCanvas=function(){if(!this.canvas){var n=this.canvas=document.createElement("div");n.className="LinesEllipsis-canvas "+this.props.className,n.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(A).forEach(function(r){n.style[r]=A[r]}),document.body.appendChild(n)}},o.copyStyleToCanvas=function(){var n=this,r=window.getComputedStyle(this.target);ge.forEach(function(a){n.canvas.style[a]=r[a]})},o.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var r=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");V(this.canvas,r);var a=this.putEllipsis(this.calcIndexes()),c={clamped:a,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},o.calcIndexes=function(){var n=[0],r=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),a=r.length;if(!r.length)return n;var c=r.find(N);if(!c)return n;for(var l=1,u=c.offsetTop,d=1;d<a&&!(N(r[d])&&r[d].offsetTop-u>1&&(l++,n.push(d),u=r[d].offsetTop,l>this.maxLine));d++);return n},o.putEllipsis=function(n){if(n.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,n[this.maxLine]);var r=this.nlUnits.pop(),a=this.makeEllipsisSpan();do G(r,this.canvas),be(r).appendChild(a),r=this.nlUnits.pop();while(r&&(!N(r)||a.offsetHeight>r.offsetHeight||a.offsetTop>r.offsetTop));return r&&R(r),this.nlUnits.forEach(R),!0},o.makeEllipsisSpan=function(){var n=this.props,r=n.ellipsisHTML,a=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var l=document.createElement("span");return l.className="LinesEllipsis-ellipsis",r?l.innerHTML=r:l.textContent=a,c.appendChild(l),c},o.isClamped=function(){return this.clamped},o.render=function(){var n=this,r=this.state,a=r.html,c=r.clamped,l=this.props,u=l.component,d=l.className,g=l.unsafeHTML,m=me(l,xe);return M.default.createElement(u,j({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(f){return n.target=f}},ye(m,Se)),M.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?a:g}}))},t}(M.default.Component);Y.defaultProps=K;var Le=Y;const qe=W(Le),Te=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ee=e=>{try{return new URL(e).host}catch{return e}};var Ve={getChainHost:Te,getUrlHost:Ee},Ge={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},we={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},Me={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const k=new Map,Ne=(e,t)=>{k.set(e,t)},je=(e="en_US")=>k.get(e)||k.get("en_US");var X={registerLang:Ne,getLang:je},Ce=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const ke=Ce,{getLang:L}=X,_e=(e,t)=>t===1?e:`${e}s`,Ue=1e-7;var Oe=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const o=L(t.locale),s=[],n=(c,l)=>{const u=Math.floor(c*10**l+Ue);return(Math.round(u)/10**l).toFixed(l)},r=(c,l,u)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&l==="minute"))return;const{long:d}=o[l]||L("en_US")[l],{short:g}=o[l]||L("en_US")[l];let m=(u||c||"0").toString(),y,f;if(t.colonNotation){y=s.length>0?":":"",f="";const p=m.includes(".")?m.split(".")[0].length:m.length,h=s.length>0?2:1;m="0".repeat(Math.max(0,h-p))+m}else y="",t.locale==="zh_CN"?Object.values(a).filter(p=>p>0).length>1?!a.days&&!a.hours&&a.minutes&&t.compact?f=d:f=g:a.minutes?f=d:f=g:f=t.verbose?` ${_e(d,c)}`:g;s.push(y+m+f)},a=ke(e);if(r(Math.trunc(a.days/365),"year"),r(a.days%365,"day"),r(a.hours,"hour"),r(a.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(r(a.seconds,"second"),t.formatSubMilliseconds)r(a.milliseconds,"millisecond"),r(a.microseconds,"microsecond"),r(a.nanoseconds,"nanosecond");else{const c=a.milliseconds+a.microseconds/1e3+a.nanoseconds/1e6,l=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=l?c.toFixed(l):u;r(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,l=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=n(c,l),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");r(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(o.millisecond||L("en_US").millisecond).long,l=(o.millisecond||L("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:l}`:`0${t.verbose?` ${c}s`:l}`}if(t.compact)return s[0];if(typeof t.unitCount=="number"){const c=t.colonNotation?"":" ";return s.slice(0,Math.max(t.unitCount,1)).join(c)}return t.colonNotation?s.join(""):s.join(" ")};const De=we,Fe=Me,{registerLang:D}=X,Q=Oe;D("en_US",De);D("zh_CN",Fe);Q.registerLang=D;var Ie=Q;const Ke=W(Ie);export{qe as H,q as M,ze as a,Ve as c,le as d,ie as g,oe as i,Be as m,Ke as p,Ge as s,$e as u};