@abtnode/blocklet-services 1.16.52-beta-20250930-134044-9b691563 → 1.16.52-beta-20251002-030549-0f91dab2

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 (243) hide show
  1. package/api/routes/access-key.js +13 -1
  2. package/dist/assets/{AdapterDayjs-DJz1a4Qx.js → AdapterDayjs-CAaLcejt.js} +1 -1
  3. package/dist/assets/{Google-D6480ezX.js → Google-BMeng9mn.js} +1 -1
  4. package/dist/assets/{access-control-DBdY7ucY.js → access-control-Cw0_MVFj.js} +1 -1
  5. package/dist/assets/{actions-DiS46mya.js → actions-DbBJOD0d.js} +1 -1
  6. package/dist/assets/{add-component-core-Cev7hXWc.js → add-component-core-B4fftW3o.js} +7 -7
  7. package/dist/assets/add-resource-CZfTjlD0.js +1 -0
  8. package/dist/assets/{addon-EoDNqFad.js → addon-CBAld8jW.js} +2 -2
  9. package/dist/assets/{advanced-DKI68HjI.js → advanced-DPeAQM5T.js} +2 -2
  10. package/dist/assets/{aigne-CjC_i4GF.js → aigne-DD21HBlT.js} +1 -1
  11. package/dist/assets/api-BUbloWod.js +1 -0
  12. package/dist/assets/{appearance-O0nUhNEQ.js → appearance-CwcRjBdx.js} +1 -1
  13. package/dist/assets/{ar-DrftSIv3.js → ar-7nBHeQPa.js} +1 -1
  14. package/dist/assets/{ar-DWsJvQhm.js → ar-DDKSNNIB.js} +1 -1
  15. package/dist/assets/{arrow-down.svg-KTkEGh4D.js → arrow-down.svg-B1ffj_Bi.js} +1 -1
  16. package/dist/assets/{audit-logs-m94KXy26.js → audit-logs-CIL7B8dX.js} +2 -2
  17. package/dist/assets/authorize-DPXeAf_q.js +1 -0
  18. package/dist/assets/{base-chart-Be8WpaNd.js → base-chart-BbbiwJIa.js} +1 -1
  19. package/dist/assets/base32-CgLd9kUN.js +1 -0
  20. package/dist/assets/bind-account-Ci1GnBqL.js +1 -0
  21. package/dist/assets/{branding-BMzor1hN.js → branding-CGCnGFEE.js} +2 -2
  22. package/dist/assets/branding-IhXI5Wue.js +1 -0
  23. package/dist/assets/{branding-DZkv2-B6.js → branding-Y62inJ9A.js} +5 -5
  24. package/dist/assets/{bundle-avatar-ClP0s92u.js → bundle-avatar-BrBIjq4r.js} +1 -1
  25. package/dist/assets/button-BG8yGG9e.js +1 -0
  26. package/dist/assets/{click-to-copy-DBNEocQx.js → click-to-copy-CVHuu877.js} +1 -1
  27. package/dist/assets/{cloneDeep-DC1IBdzb.js → cloneDeep-E2Pxqpbv.js} +1 -1
  28. package/dist/assets/{collapse-C7KroRZD.js → collapse-DhGi244c.js} +1 -1
  29. package/dist/assets/{complete-CACnLOf-.js → complete-DNXvjWOj.js} +4 -4
  30. package/dist/assets/{component-CmQX5aKr.js → component-M75sOZuG.js} +3 -3
  31. package/dist/assets/{config-B7R4_aR5.js → config-BASOtMEK.js} +4 -4
  32. package/dist/assets/{config-BlfZIK3N.js → config-BOttfQk3.js} +1 -1
  33. package/dist/assets/{config-NAEGgfiM.js → config-Bshk_mlq.js} +2 -2
  34. package/dist/assets/{config-navigation-DcjynTKg.js → config-navigation-C_Stnyxb.js} +3 -3
  35. package/dist/assets/{config-space-CcdEKukD.js → config-space-Bh_yLAj-.js} +1 -1
  36. package/dist/assets/confirm-LpOyjg-M.js +7 -0
  37. package/dist/assets/{connect-Gm3BGJOG.js → connect-A31Nzurl.js} +1 -1
  38. package/dist/assets/{connect-D0Yxb636.js → connect-DEe_baYC.js} +1 -1
  39. package/dist/assets/connect-to-Cco6-qou.js +1 -0
  40. package/dist/assets/{content-layout-C5M6XN5d.js → content-layout-CaGd-JXO.js} +1 -1
  41. package/dist/assets/createClass-BuhPvJV8.js +1 -0
  42. package/dist/assets/{dashboard-CmUsG3tt.js → dashboard-B757yKbJ.js} +6 -6
  43. package/dist/assets/{de-rG0WLGYs.js → de-C5jW-Aco.js} +1 -1
  44. package/dist/assets/{de-CzR7Usym.js → de-Dn7PhTZq.js} +1 -1
  45. package/dist/assets/{delete-confirm-Dogr_ntZ.js → delete-confirm-V3_sRk8l.js} +1 -1
  46. package/dist/assets/{did-address-DtRDDQBD.js → did-address-CeTjTMC4.js} +1 -1
  47. package/dist/assets/domain-B9OATbrX.js +9 -0
  48. package/dist/assets/domain-action-card-D-_-tvd3.js +28 -0
  49. package/dist/assets/domains-CHjbOYj6.js +1 -0
  50. package/dist/assets/{email-fmVVdTOG.js → email-BpimKMdd.js} +3 -3
  51. package/dist/assets/{empty-spinner-CBrinxF5.js → empty-spinner-CkCqfxFX.js} +1 -1
  52. package/dist/assets/engine-DyhSNCpN.js +1 -0
  53. package/dist/assets/{es-BHI4ILsC.js → es-B_X5HHiA.js} +1 -1
  54. package/dist/assets/{es-6DKPq8Yn.js → es-DnE5Se03.js} +1 -1
  55. package/dist/assets/{exchange-passport-DlMqIBtT.js → exchange-passport-XYv5fxqy.js} +1 -1
  56. package/dist/assets/{form-Bii6E4NV.js → form-CHueGgAz.js} +2 -2
  57. package/dist/assets/{form-text-input-TeuIo9S2.js → form-text-input-CqoNK3mi.js} +1 -1
  58. package/dist/assets/{form-wrapper-DZhsWXpc.js → form-wrapper-DNqXvSru.js} +1 -1
  59. package/dist/assets/{fr-BqKCXdV2.js → fr-BIAMVkwl.js} +1 -1
  60. package/dist/assets/{fr-CT3g9qN-.js → fr-BpXortYf.js} +1 -1
  61. package/dist/assets/{fuel-BaMJ9704.js → fuel-CfnN-Pjf.js} +1 -1
  62. package/dist/assets/gen-access-key-ku3cDonU.js +1 -0
  63. package/dist/assets/gen-simple-access-key-EujuCaoZ.js +1 -0
  64. package/dist/assets/get-safe-url-CbJcsvAc.js +1 -0
  65. package/dist/assets/{hi-DlvVN0mm.js → hi-4-0lpKbp.js} +1 -1
  66. package/dist/assets/{home-C3u9ExRL.js → home-CSzo40aP.js} +1 -1
  67. package/dist/assets/{id-YNynvxGd.js → id-Dw1-p0GY.js} +1 -1
  68. package/dist/assets/iframe-eYdxV3eX.js +1 -0
  69. package/dist/assets/{index-VQg2UaAe.js → index-3xeMR-Qg.js} +1 -1
  70. package/dist/assets/{index-DhDY9QRj.js → index-6IwthDxj.js} +1 -1
  71. package/dist/assets/index-82gv-l2w.js +283 -0
  72. package/dist/assets/{index-BC-hI70z.js → index-B0JZLMkR.js} +4 -4
  73. package/dist/assets/{index-oMo0FAbH.js → index-BA8N8sek.js} +5 -5
  74. package/dist/assets/{index-BROakthZ.js → index-BC0KaiLK.js} +1 -1
  75. package/dist/assets/index-BFZ5LKID.js +62 -0
  76. package/dist/assets/{index-BhAogHJp.js → index-BVRSxJRS.js} +1 -1
  77. package/dist/assets/{index-5sEksRZE.js → index-BjcHj49D.js} +1 -1
  78. package/dist/assets/{index-dIy0_-0B.js → index-Br6A9_4o.js} +5 -5
  79. package/dist/assets/{index-cZALvweI.js → index-C-QPG4ba.js} +3 -3
  80. package/dist/assets/index-C0n4exuY.js +1 -0
  81. package/dist/assets/index-COFNyzYu.js +29 -0
  82. package/dist/assets/index-CX0nBp11.js +1 -0
  83. package/dist/assets/index-C_YGTMJ4.js +1 -0
  84. package/dist/assets/index-CjATIX5e.js +1039 -0
  85. package/dist/assets/{index-Cs2FIJbg.js → index-CmkQ05MW.js} +12 -12
  86. package/dist/assets/{index-BpIHv06W.js → index-Cs6DTc99.js} +5 -5
  87. package/dist/assets/index-Cza28Ou-.js +7 -0
  88. package/dist/assets/{index-DJWOH9gC.js → index-D04UESXe.js} +1 -1
  89. package/dist/assets/{index-40tvlREo.js → index-DOo8QRm-.js} +13 -13
  90. package/dist/assets/{index-CGUzaOG1.js → index-DRhj0EDS.js} +9 -9
  91. package/dist/assets/{index-26LcjK03.js → index-DZkt7K0r.js} +1 -1
  92. package/dist/assets/{index-CCNgWb6m.js → index-DbXxI_D0.js} +1 -1
  93. package/dist/assets/index-Dn2eai8S.js +113 -0
  94. package/dist/assets/{index-BLaILoF2.js → index-Dr9NaKfR.js} +1 -1
  95. package/dist/assets/{index-DIDKpIk_.js → index-DxuK3aPg.js} +1 -1
  96. package/dist/assets/{index-BVtCqyO7.js → index-IN8OKZ_V.js} +2 -2
  97. package/dist/assets/index-ZXxjnrfz.js +55 -0
  98. package/dist/assets/{index-DPbI7VX_.js → index-ZYd4RNU_.js} +1 -1
  99. package/dist/assets/{index-Di2bKYQ8.js → index-iIT2_Y_I.js} +1 -1
  100. package/dist/assets/{invitation-BEg6pBgL.js → invitation-Bud5mQS8.js} +3 -3
  101. package/dist/assets/{invite-PSJCbkuS.js → invite-BnTsj399.js} +1 -1
  102. package/dist/assets/{isURL-uDqs2WzZ.js → isURL-BkRG9xZw.js} +2 -2
  103. package/dist/assets/{issue-passport-DfPL_iUw.js → issue-passport-sL6P-Jy0.js} +1 -1
  104. package/dist/assets/{item-BT44fN4f.js → item-CZxO50cp.js} +1 -1
  105. package/dist/assets/{ja-DEmGhfzG.js → ja-C6gbn0J8.js} +1 -1
  106. package/dist/assets/{ko-Crmr1RC-.js → ko-DGXdpX64.js} +1 -1
  107. package/dist/assets/{ko-CfYoSPs0.js → ko-av2FKXII.js} +1 -1
  108. package/dist/assets/{landing-page-CiEaPNxq.js → landing-page-Co0EA4cx.js} +1 -1
  109. package/dist/assets/{launch-result-message-CxGW5bAC.js → launch-result-message-B0--4ubW.js} +1 -1
  110. package/dist/assets/{layout-C3Si15N2.js → layout-CiBZwE8j.js} +1 -1
  111. package/dist/assets/list-CgUqi7mZ.js +2 -0
  112. package/dist/assets/list-CoRNWpJL.js +103 -0
  113. package/dist/assets/{list-header-D3Jek4lG.js → list-header-DlrmpNef.js} +1 -1
  114. package/dist/assets/localization-DAfm9MKy.js +1 -0
  115. package/dist/assets/{log-J00kI7L6.js → log-BLtV-mr3.js} +19 -19
  116. package/dist/assets/logger-CsgnUk8i.js +1 -0
  117. package/dist/assets/login-0UJlN7iP.js +1 -0
  118. package/dist/assets/{login-oauth-callback-BAbCWNXl.js → login-oauth-callback-BhX1vXuH.js} +1 -1
  119. package/dist/assets/{logo-uploader-BMe29xQY.js → logo-uploader-x03Hv0sw.js} +2 -2
  120. package/dist/assets/{lost-passport-BrFPShnF.js → lost-passport-DuQjRy5y.js} +2 -2
  121. package/dist/assets/{observability-DpWIYJKx.js → observability-3BjnzXRV.js} +1 -1
  122. package/dist/assets/{omit-BpknVl5C.js → omit-r-0RLWOV.js} +1 -1
  123. package/dist/assets/{open-window-BWuQbNLw.js → open-window-C2521tBf.js} +1 -1
  124. package/dist/assets/{over-due-invoice-payment-DYA1LPYk.js → over-due-invoice-payment-CeMW933U.js} +1 -1
  125. package/dist/assets/{overview-BFfWkxz5.js → overview-C-11gh2u.js} +2 -2
  126. package/dist/assets/{page-header-hQvIh9SJ.js → page-header-DP0csqkR.js} +1 -1
  127. package/dist/assets/passport-item-CBQOM3AQ.js +1 -0
  128. package/dist/assets/{permission-mCHWpIY_.js → permission-BeuMG3nG.js} +1 -1
  129. package/dist/assets/{playground-D-q7ZMPl.js → playground-BEhnKrD-.js} +1 -1
  130. package/dist/assets/preferences-DvVN_OF0.js +1 -0
  131. package/dist/assets/profile-embed-BdpgwY58.js +1 -0
  132. package/dist/assets/{pt-DTd68aWZ.js → pt-C5SxM_jO.js} +1 -1
  133. package/dist/assets/{pt-DlPLN19J.js → pt-CIqefLTL.js} +1 -1
  134. package/dist/assets/publish-resource-CERp8nCz.js +1 -0
  135. package/dist/assets/{react-beautiful-dnd.esm-CjbGIjxA.js → react-beautiful-dnd.esm-9QLg1KOC.js} +1 -1
  136. package/dist/assets/{react-stripe.esm-UJXznrFM.js → react-stripe.esm-DWiCVD55.js} +1 -1
  137. package/dist/assets/{required-BukCSojp.js → required-BUAaYcMZ.js} +1 -1
  138. package/dist/assets/{ru-BNhuVXCB.js → ru-B4h3WudR.js} +1 -1
  139. package/dist/assets/{ru-BHPYrefb.js → ru-BWd-_jpY.js} +1 -1
  140. package/dist/assets/runtime-CC0b3IOS.js +1 -0
  141. package/dist/assets/{sanitize-yJUw5BK9.js → sanitize-mRppk1lK.js} +1 -1
  142. package/dist/assets/sdk-Dfotb8VE.js +1 -0
  143. package/dist/assets/{section-CGjbjaFj.js → section-CCfmWVdK.js} +1 -1
  144. package/dist/assets/{security-BJOY2ThQ.js → security-DAv6SG0v.js} +3 -3
  145. package/dist/assets/session-p360wpOR.js +1 -0
  146. package/dist/assets/{setup-Betrrcxk.js → setup-CWKcr-SA.js} +1 -1
  147. package/dist/assets/{shorten-label-BIRHi2FS.js → shorten-label-DAXPWCI6.js} +1 -1
  148. package/dist/assets/{simple-select-7X88QDSX.js → simple-select-BHPmFba3.js} +1 -1
  149. package/dist/assets/{spaces-MBu98S71.js → spaces-DdStEDKL.js} +1 -1
  150. package/dist/assets/{start-BvExYMOr.js → start-gQWc3jOT.js} +1 -1
  151. package/dist/assets/{starting-progress-DrUauyTC.js → starting-progress-CxdsmebW.js} +1 -1
  152. package/dist/assets/status-jCRFV0de.js +1 -0
  153. package/dist/assets/{step-actions-CpLfyTzR.js → step-actions-DV76BAlD.js} +1 -1
  154. package/dist/assets/{studio-CBJGdxxo.js → studio-D9ArZgZT.js} +1 -1
  155. package/dist/assets/{switch-control-DNlNJjsm.js → switch-control-Bs2D4JNi.js} +1 -1
  156. package/dist/assets/{table-tips-C_tKxS1_.js → table-tips-B1dFVdej.js} +1 -1
  157. package/dist/assets/team-CxJqHuEA.js +146 -0
  158. package/dist/assets/{th-CSbI3a1U.js → th-BjttL5p9.js} +1 -1
  159. package/dist/assets/{th-Bk3GO_e5.js → th-CRUlNqtq.js} +1 -1
  160. package/dist/assets/traffic-BuZd517Z.js +1 -0
  161. package/dist/assets/{transfer-CnRpT327.js → transfer-Dh7kcNdX.js} +1 -1
  162. package/dist/assets/{unsubscribe-SOswYB3-.js → unsubscribe-DzDiAt1Q.js} +1 -1
  163. package/dist/assets/{use-app-logo-Czrt0i-p.js → use-app-logo-BiGG8tCg.js} +1 -1
  164. package/dist/assets/{use-mobile-6sugw6dZ.js → use-mobile-BW9mTiYC.js} +1 -1
  165. package/dist/assets/{use-mobile-DdL6gIr_.js → use-mobile-B_fpUHD7.js} +1 -1
  166. package/dist/assets/{use-server-logo-Cb1mX_m3.js → use-server-logo-R848M-JH.js} +1 -1
  167. package/dist/assets/{use-window-close-DRT8NYsb.js → use-window-close-Dk0lXOqo.js} +1 -1
  168. package/dist/assets/{useAsync-CP1EfcG_.js → useAsync-DkQHu4t4.js} +1 -1
  169. package/dist/assets/{useAsync-BO3iirQz.js → useAsync-DoI7Qt9M.js} +1 -1
  170. package/dist/assets/{useAsyncRetry-b_Q7rsZ1.js → useAsyncRetry-DNTidBXG.js} +1 -1
  171. package/dist/assets/useLocalStorage-BzRs3x-K.js +1 -0
  172. package/dist/assets/user-center-Gvk90n3A.js +126 -0
  173. package/dist/assets/{user-follower-BzN1JToB.js → user-follower-D7rNbdJC.js} +1 -1
  174. package/dist/assets/user-sessions-BXusVv21.js +1 -0
  175. package/dist/assets/{util-Dr-F1wWu.js → util-BKRDkFNf.js} +1 -1
  176. package/dist/assets/{util-CFOWM3Un.js → util-DQbvJ9cJ.js} +1 -1
  177. package/dist/assets/{vendor-arcblock-DbQi15Va.js → vendor-arcblock-BhtOu00C.js} +138 -139
  178. package/dist/assets/{vendor-hooks-Bm2oaDgr.js → vendor-hooks-BtDnIwBH.js} +1 -1
  179. package/dist/assets/{vendor-mui-core-C_NjJRjl.js → vendor-mui-core-BIZOanxj.js} +1 -1
  180. package/dist/assets/{vendor-mui-x-B2kLzf_6.js → vendor-mui-x-DWX99wt-.js} +1 -1
  181. package/dist/assets/vendor-utils-CVwaKsP9.js +213 -0
  182. package/dist/assets/{vendor-ux-JmtAaYLa.js → vendor-ux-Cfhaj-oj.js} +12 -12
  183. package/dist/assets/{vi-xPRidQ_j.js → vi-5AzowaJ4.js} +1 -1
  184. package/dist/assets/{wait-connect-BJSNhW2P.js → wait-connect-CPHamZhf.js} +1 -1
  185. package/dist/assets/{wizard-CxdbMgRd.js → wizard-DXT-RVCl.js} +1 -1
  186. package/dist/assets/{wizard-components-BlDjNTl3.js → wizard-components-CkjeNOkS.js} +3 -3
  187. package/dist/assets/wrap-locale-DQUa7V1E.js +1 -0
  188. package/dist/assets/{zh-Blu7Gys0.js → zh-1ARDBzTp.js} +1 -1
  189. package/dist/assets/{zh-BCFTG394.js → zh-BQXiLbg6.js} +1 -1
  190. package/dist/assets/{zh-tw-BLENKI0o.js → zh-tw-DAvBOrfW.js} +1 -1
  191. package/dist/index.html +6 -6
  192. package/dist/service-worker.js +1 -1
  193. package/package.json +38 -38
  194. package/dist/assets/add-resource-A4bZ0dTp.js +0 -1
  195. package/dist/assets/api-eF9RCcCm.js +0 -1
  196. package/dist/assets/authorize-BHa1jxY6.js +0 -1
  197. package/dist/assets/base32-d0IrDPx_.js +0 -1
  198. package/dist/assets/bind-account-DQGyQsBg.js +0 -1
  199. package/dist/assets/branding-BJoo_ZXQ.js +0 -1
  200. package/dist/assets/button-iJgy0AQY.js +0 -1
  201. package/dist/assets/confirm-tusB0uUh.js +0 -7
  202. package/dist/assets/connect-to-D3EWn_NY.js +0 -1
  203. package/dist/assets/createClass-C0KDHIFs.js +0 -1
  204. package/dist/assets/domain-3OQTdQwA.js +0 -9
  205. package/dist/assets/domain-action-card-mesh-ZO1.js +0 -28
  206. package/dist/assets/domains-D3oaqtHD.js +0 -1
  207. package/dist/assets/engine-BGPujcMC.js +0 -1
  208. package/dist/assets/gen-access-key-B97ypTb-.js +0 -1
  209. package/dist/assets/gen-simple-access-key-US636G5K.js +0 -1
  210. package/dist/assets/get-safe-url-CpIY2Nr0.js +0 -1
  211. package/dist/assets/hdkey-TGNLUqEt.js +0 -62
  212. package/dist/assets/iframe-ByrkdYaj.js +0 -1
  213. package/dist/assets/index-BPPTaU3u.js +0 -55
  214. package/dist/assets/index-Basg4QeI.js +0 -1
  215. package/dist/assets/index-BsmMnQ_k.js +0 -283
  216. package/dist/assets/index-CUu0DjUL.js +0 -30
  217. package/dist/assets/index-Clgc5RbF.js +0 -7
  218. package/dist/assets/index-D5BfPJgd.js +0 -1
  219. package/dist/assets/index-DOCDPBXj.js +0 -113
  220. package/dist/assets/index-DgDvwRqt.js +0 -1041
  221. package/dist/assets/index-HOEytilv.js +0 -1
  222. package/dist/assets/list-DLK8qdTn.js +0 -103
  223. package/dist/assets/list-iYXxqPI6.js +0 -4
  224. package/dist/assets/localization-BY1kjw33.js +0 -1
  225. package/dist/assets/logger-Brrx9tV7.js +0 -1
  226. package/dist/assets/login-Wg20R9T3.js +0 -1
  227. package/dist/assets/passport-item-CF_y0rsT.js +0 -1
  228. package/dist/assets/preferences-BmlOlGxi.js +0 -1
  229. package/dist/assets/profile-embed-BIIlF2uQ.js +0 -1
  230. package/dist/assets/publish-resource-3lgLri0K.js +0 -1
  231. package/dist/assets/runtime-BS-wC6gn.js +0 -1
  232. package/dist/assets/sdk-BLd-VTrL.js +0 -1
  233. package/dist/assets/session-CfoR5Wvh.js +0 -1
  234. package/dist/assets/slugify-bzSZ5XYw.js +0 -1
  235. package/dist/assets/status-DRtLD-z9.js +0 -1
  236. package/dist/assets/team-Dd8yHElY.js +0 -146
  237. package/dist/assets/toLower-BqRfvn1N.js +0 -1
  238. package/dist/assets/traffic-lCSWEOva.js +0 -1
  239. package/dist/assets/useLocalStorage-D6j--D5r.js +0 -1
  240. package/dist/assets/user-center-CUpoxNlx.js +0 -126
  241. package/dist/assets/user-sessions-Cem_kfLj.js +0 -1
  242. package/dist/assets/vendor-utils-Gk-1qvTR.js +0 -213
  243. package/dist/assets/wrap-locale-DOt3Fsgq.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,y as Pt,bb as Re,M as ae,ak as x,Q as H,W as u,J as xe,c0 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Be,P as We,b6 as J,a5 as Oe,z as Ze,A as Je,ci as At,bf as Mt,U as Ce,d5 as zt,d6 as Et,at as te,d7 as Lt,a6 as Q,n as le,D as Bt,d8 as Wt,ar as Ne,b1 as Ie,d9 as Ot,aX as Nt,ai as Dt,am as X,bp as $t,bq as ve,a$ as Ut,cS as Ft}from"./vendor-mui-core-C_NjJRjl.js";import{r as b,a as _t,u as qt,j as Ht}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Gt,a6 as Kt,S as De,D as Vt,C as ce,n as Y,A as Yt}from"./vendor-utils-Gk-1qvTR.js";import{a as Qt,G as Zt,bx as Jt,c as Te,d as Xt,Y as er,by as tr,a_ as Ae,W as fe,bi as rr,bz as nr,a5 as or,b0 as sr,a6 as ir,bA as ar}from"./index-DgDvwRqt.js";import{a as R,h as et,k as re,g as G,b as z,j as lr}from"./vendor-hooks-Bm2oaDgr.js";import{l as tt}from"./arrow-down.svg-KTkEGh4D.js";import{G as Me,ab as O,T as W,aM as cr,O as rt,aN as dr,H as q,aO as ur,aP as pr,aQ as $e,J as xr,D as nt,I as ze,aR as fr,aS as M,a2 as hr,a1 as gr,$ as ot,aT as mr,aU as br,a0 as yr,C as de,a6 as Ue,ac as vr,aj as Fe}from"./vendor-ux-JmtAaYLa.js";import{N as wr}from"./list-DLK8qdTn.js";import{d as jr}from"./search-4YYphs0l.js";import{B as _e}from"./bundle-avatar-ClP0s92u.js";import{h as qe,T as Cr}from"./team-Dd8yHElY.js";import{b as Sr,d as kr,a as Pr,c as Rr,e as Ir,f as Tr,h as Ar,_ as Mr}from"./user-center-CUpoxNlx.js";import{N as st,U as it}from"./index-BpIHv06W.js";import{u as Z}from"./use-mobile-DdL6gIr_.js";import zr from"./index-Basg4QeI.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as Se}from"./index-5sEksRZE.js";import{U as we}from"./user-sessions-Cem_kfLj.js";import Er from"./index-oMo0FAbH.js";import{o as Lr}from"./vendor-arcblock-DbQi15Va.js";import{c as Br,b as ue,a as Wr,S as Or}from"./index-CUu0DjUL.js";import"./index-DhDY9QRj.js";import"./index-BojVbZw0.js";import{U as Nr}from"./user-follower-BzN1JToB.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BROakthZ.js";import"./util-Dr-F1wWu.js";import"./base32-d0IrDPx_.js";import"./session-CfoR5Wvh.js";import"./isURL-uDqs2WzZ.js";import"./use-app-logo-Czrt0i-p.js";import"./index-BC-hI70z.js";import"./api-eF9RCcCm.js";import"./table-tips-C_tKxS1_.js";import"./use-mobile-6sugw6dZ.js";import"./passport-item-CF_y0rsT.js";import"./did-address-DtRDDQBD.js";import"./index-DPbI7VX_.js";import"./vendor-mui-x-B2kLzf_6.js";import"./AdapterDayjs-DJz1a4Qx.js";import"./confirm-tusB0uUh.js";import"./click-to-copy-DBNEocQx.js";import"./delete-confirm-Dogr_ntZ.js";import"./permission-mCHWpIY_.js";import"./actions-DiS46mya.js";import"./index-DRYJ0xIl.js";function Dr(){let t=new Map;function o({root:s,rootMargin:n,threshold:a}){let i=t.get(s);i||(i=new Map,t.set(s,i));let l=JSON.stringify({rootMargin:n,threshold:a}),p=i.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(m=>{r.get(m.target)?.(m)})},{root:s,rootMargin:n,threshold:a}),entryCallbacks:r},i.set(l,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:o}}var $r="0px",Ur=[0],Fr=Dr();function _r(t){let o=t?.rootMargin??$r,s=t?.threshold??Ur,n=b.useRef(null),a=b.useRef(null),i=b.useRef(null),[l,p]=b.useState(),r=b.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:a.current,rootMargin:o,threshold:s});v.observe(C,c=>{p(c)}),i.current=v},[o,s]),f=b.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=b.useCallback(C=>{f(),n.current=C,r()},[r,f]),g=b.useCallback(C=>{f(),a.current=C,r()},[r,f]);return[m,{entry:l,rootRef:g}]}var qr=_r;function Hr(t){let[o,s]=qr(t),n=!!s.entry?.isIntersecting,[a,i]=b.useState(n);return n&&!a&&i(!0),[o,{...s,isVisible:n,wasEverVisible:a}]}var Gr=Hr,Kr=100;function Vr({loading:t,hasNextPage:o,onLoadMore:s,rootMargin:n,disabled:a,delayInMs:i=Kr}){let l=b.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:n});b.useEffect(()=>{l.current=s},[s]);let m=!a&&!t&&f&&o;return b.useEffect(()=>{if(m){let g=setTimeout(()=>{l.current()},i);return()=>{clearTimeout(g)}}},[m,i]),[p,{rootRef:r}]}var Yr=Vr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:o=8}){return je[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:o,height:o,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}at.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function at({theme:t="dark",type:o="button",onSelectType:s,extra:n=void 0,currentTab:a="",loading:i=!1,...l}){const{t:p}=b.useContext(Me),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=h=>{(h!==a||!i)&&s(h)},m=b.useMemo(()=>{const h={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:o==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return o==="line"?Object.assign(h,{}):h},[o,t]),g=(h,S,T)=>e.jsx(H,{disabled:i,onClick:()=>f(h.value),className:`profile-button ${S?"active":""}`,...l,children:h.label},h.value||T),C=(h,S,T)=>e.jsx(H,{variant:"text",disabled:i,onClick:()=>f(h.value),className:`profile-line-button ${S?"active":""}`,...l,children:h.label},h.value||T),v=()=>r?.map((h,S)=>{const T=a===h?.value;return o==="line"?e.jsx(b.Fragment,{children:C(h,T,S)},h.value||S):e.jsx(b.Fragment,{children:g(h,T,S)},h.value||S)}),c=h=>{const{value:S}=h.target;f(S==="all"?"":S)};return o==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Re,{value:a||"all",onChange:c,size:"small",label:"Severity",IconComponent:h=>e.jsx(tt,{...h,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((h,S)=>e.jsx(ae,{value:h.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:h.value}),h.label]})},h.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:m,children:[e.jsx(x,{sx:{...o==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:o,onChange:s}){const{t:n}=b.useContext(Me),a=xe(r=>r.breakpoints.down("md"));if(o.pageCount<=0||a)return null;const i=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=o.page-1<=0?0:o.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:o.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:m})=>`${r}–${f} / ${m!==-1?m:`${n()}more than ${f}`}`,rowsPerPage:o.pageSize,onPageChange:i,onRowsPerPageChange:l})})}const Qr=b.memo(lt),Zr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},He=6,Ge={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Jr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Jr,width:"calc(50% - 8px)"});ct.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function ct({onFilterChange:t=()=>{},loading:o=!1,type:s="service",blockletMap:n={},filterType:a="component",selectedId:i=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:m="all"}){const{t:g}=b.useContext(Me),[C,v]=b.useState(null),c=!!C,[h,S]=b.useState(i),[T,P]=b.useState(l),[y,E]=b.useState(!1),[L,F]=b.useState(""),[D,j]=b.useState([]);b.useEffect(()=>{S(i),P(l)},[i,l]);const k=[{label:g("notification.filterType.all"),value:"all"},{label:g("notification.filterType.unread"),value:"unread"}],N=d=>{(d!==m||!o)&&f(d)},K=[{label:g("notification.severityType.info"),value:"info"},{label:g("notification.severityType.success"),value:"success"},{label:g("notification.severityType.warning"),value:"warning"},{label:g("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),F(""),E(!1)},ge=()=>{v(null)},oe=d=>{const w=h.includes(d)?h.filter(A=>A!==d):[...h,d];S(w),t({id:w,severity:T})},se=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:h})},me=d=>{F(d.target.value)},be=()=>{E(!y)},V=_t.useMemo(()=>{if(!n.size)return[];const d=[];return a==="component"&&d.push({label:g("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(a==="component"&&_!==A||a==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,a,g]);b.useEffect(()=>{if(L.trim()==="")j(V);else{const d=L.toLowerCase(),w=V.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,V]);const ye=L.trim()!==""||y?D:D.slice(0,He);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:k.map(d=>e.jsxs(H,{disabled:o,onClick:()=>N(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...s==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx($,{size:"small",onClick:ne,disabled:o,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Zr,hFlip:!0})}),e.jsx(It,{open:c,anchorEl:C,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:g("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(h.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:g("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(We,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(J,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(Oe,{checked:T.includes(d.value),onChange:()=>se(d.value),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:g("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ze,{size:"small",placeholder:"search",value:L,onChange:me,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:jr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(d=>e.jsx(We,{elevation:0,sx:Ke(h.includes(d.id)),children:e.jsx(J,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(Oe,{checked:h.includes(d.id),onChange:()=>oe(d.id),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx(_e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),D.length>He&&L.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:y?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),h.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(Ce,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),w?w.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),h.map(d=>{const w=V.find(A=>A.id===d);return e.jsx(Ce,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(_e,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Xr=te(Lt)`
1
+ import{j as e,y as Pt,bb as Re,M as ae,ak as x,Q as H,W as u,J as xe,c0 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Be,P as We,b6 as X,a5 as Oe,z as Qe,A as Xe,ci as At,bf as Mt,U as Ce,d7 as zt,d8 as Et,at as te,d9 as Lt,a6 as Z,n as le,D as Bt,da as Wt,ar as De,b1 as Ie,db as Ot,aX as Dt,ai as Nt,am as J,bp as $t,bq as ve,a$ as Ft,cS as Ut}from"./vendor-mui-core-BIZOanxj.js";import{r as b,a as _t,u as qt,j as Ht}from"./vendor-react-Dvs43sk9.js";import{t as Je,Z as Gt,a8 as Kt,R as Ne,D as Vt,C as ce,n as Y,A as Yt}from"./vendor-utils-CVwaKsP9.js";import{a as Zt,G as Qt,bx as Xt,c as Te,d as Jt,X as er,by as tr,aX as Ae,V as fe,bd as rr,bz as nr,a4 as or,aZ as sr,a5 as ir,bA as ar}from"./index-CjATIX5e.js";import{a as R,h as et,k as re,g as G,b as z,j as lr}from"./vendor-hooks-BtDnIwBH.js";import{l as tt}from"./arrow-down.svg-B1ffj_Bi.js";import{c as Me,O,T as W,aw as cr,p as rt,ax as dr,H as q,ay as ur,az as pr,aA as $e,f as xr,n as nt,e as ze,aB as fr,aC as M,B as hr,A as gr,$ as ot,aD as mr,aE as br,x as yr,o as de,G as Fe,P as vr,a1 as Ue}from"./vendor-ux-Cfhaj-oj.js";import{N as wr}from"./list-CoRNWpJL.js";import{d as jr}from"./search-4YYphs0l.js";import{B as _e}from"./bundle-avatar-BrBIjq4r.js";import{h as qe,T as Cr}from"./team-CxJqHuEA.js";import{b as Sr,d as kr,a as Pr,c as Rr,e as Ir,f as Tr,h as Ar,_ as Mr}from"./user-center-Gvk90n3A.js";import{N as st,U as it}from"./index-Cs6DTc99.js";import{u as Q}from"./use-mobile-B_fpUHD7.js";import zr from"./index-CX0nBp11.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as Se}from"./index-BjcHj49D.js";import{U as we}from"./user-sessions-BXusVv21.js";import Er from"./index-BA8N8sek.js";import{o as Lr}from"./vendor-arcblock-BhtOu00C.js";import{c as Br,b as ue,a as Wr,S as Or}from"./index-COFNyzYu.js";import"./index-6IwthDxj.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-D7rNbdJC.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BC0KaiLK.js";import"./util-BKRDkFNf.js";import"./base32-CgLd9kUN.js";import"./session-p360wpOR.js";import"./isURL-BkRG9xZw.js";import"./use-app-logo-BiGG8tCg.js";import"./index-B0JZLMkR.js";import"./api-BUbloWod.js";import"./table-tips-B1dFVdej.js";import"./use-mobile-BW9mTiYC.js";import"./passport-item-CBQOM3AQ.js";import"./did-address-CeTjTMC4.js";import"./index-ZYd4RNU_.js";import"./vendor-mui-x-DWX99wt-.js";import"./AdapterDayjs-CAaLcejt.js";import"./confirm-LpOyjg-M.js";import"./click-to-copy-CVHuu877.js";import"./delete-confirm-V3_sRk8l.js";import"./permission-BeuMG3nG.js";import"./actions-DbBJOD0d.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function o({root:s,rootMargin:n,threshold:a}){let i=t.get(s);i||(i=new Map,t.set(s,i));let l=JSON.stringify({rootMargin:n,threshold:a}),p=i.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(m=>{r.get(m.target)?.(m)})},{root:s,rootMargin:n,threshold:a}),entryCallbacks:r},i.set(l,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:o}}var $r="0px",Fr=[0],Ur=Nr();function _r(t){let o=t?.rootMargin??$r,s=t?.threshold??Fr,n=b.useRef(null),a=b.useRef(null),i=b.useRef(null),[l,p]=b.useState(),r=b.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Ur.getObserver({root:a.current,rootMargin:o,threshold:s});v.observe(C,c=>{p(c)}),i.current=v},[o,s]),f=b.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=b.useCallback(C=>{f(),n.current=C,r()},[r,f]),g=b.useCallback(C=>{f(),a.current=C,r()},[r,f]);return[m,{entry:l,rootRef:g}]}var qr=_r;function Hr(t){let[o,s]=qr(t),n=!!s.entry?.isIntersecting,[a,i]=b.useState(n);return n&&!a&&i(!0),[o,{...s,isVisible:n,wasEverVisible:a}]}var Gr=Hr,Kr=100;function Vr({loading:t,hasNextPage:o,onLoadMore:s,rootMargin:n,disabled:a,delayInMs:i=Kr}){let l=b.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:n});b.useEffect(()=>{l.current=s},[s]);let m=!a&&!t&&f&&o;return b.useEffect(()=>{if(m){let g=setTimeout(()=>{l.current()},i);return()=>{clearTimeout(g)}}},[m,i]),[p,{rootRef:r}]}var Yr=Vr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:o=8}){return je[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:o,height:o,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}at.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function at({theme:t="dark",type:o="button",onSelectType:s,extra:n=void 0,currentTab:a="",loading:i=!1,...l}){const{t:p}=b.useContext(Me),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=h=>{(h!==a||!i)&&s(h)},m=b.useMemo(()=>{const h={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:o==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return o==="line"?Object.assign(h,{}):h},[o,t]),g=(h,S,T)=>e.jsx(H,{disabled:i,onClick:()=>f(h.value),className:`profile-button ${S?"active":""}`,...l,children:h.label},h.value||T),C=(h,S,T)=>e.jsx(H,{variant:"text",disabled:i,onClick:()=>f(h.value),className:`profile-line-button ${S?"active":""}`,...l,children:h.label},h.value||T),v=()=>r?.map((h,S)=>{const T=a===h?.value;return o==="line"?e.jsx(b.Fragment,{children:C(h,T,S)},h.value||S):e.jsx(b.Fragment,{children:g(h,T,S)},h.value||S)}),c=h=>{const{value:S}=h.target;f(S==="all"?"":S)};return o==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Re,{value:a||"all",onChange:c,size:"small",label:"Severity",IconComponent:h=>e.jsx(tt,{...h,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((h,S)=>e.jsx(ae,{value:h.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:h.value}),h.label]})},h.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:m,children:[e.jsx(x,{sx:{...o==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:o,onChange:s}){const{t:n}=b.useContext(Me),a=xe(r=>r.breakpoints.down("md"));if(o.pageCount<=0||a)return null;const i=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=o.page-1<=0?0:o.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:o.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:m})=>`${r}–${f} / ${m!==-1?m:`${n()}more than ${f}`}`,rowsPerPage:o.pageSize,onPageChange:i,onRowsPerPageChange:l})})}const Zr=b.memo(lt),Qr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},He=6,Ge={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Xr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Xr,width:"calc(50% - 8px)"});ct.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function ct({onFilterChange:t=()=>{},loading:o=!1,type:s="service",blockletMap:n={},filterType:a="component",selectedId:i=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:m="all"}){const{t:g}=b.useContext(Me),[C,v]=b.useState(null),c=!!C,[h,S]=b.useState(i),[T,P]=b.useState(l),[y,E]=b.useState(!1),[L,U]=b.useState(""),[N,j]=b.useState([]);b.useEffect(()=>{S(i),P(l)},[i,l]);const k=[{label:g("notification.filterType.all"),value:"all"},{label:g("notification.filterType.unread"),value:"unread"}],D=d=>{(d!==m||!o)&&f(d)},K=[{label:g("notification.severityType.info"),value:"info"},{label:g("notification.severityType.success"),value:"success"},{label:g("notification.severityType.warning"),value:"warning"},{label:g("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),U(""),E(!1)},ge=()=>{v(null)},oe=d=>{const w=h.includes(d)?h.filter(A=>A!==d):[...h,d];S(w),t({id:w,severity:T})},se=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:h})},me=d=>{U(d.target.value)},be=()=>{E(!y)},V=_t.useMemo(()=>{if(!n.size)return[];const d=[];return a==="component"&&d.push({label:g("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(a==="component"&&_!==A||a==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,a,g]);b.useEffect(()=>{if(L.trim()==="")j(V);else{const d=L.toLowerCase(),w=V.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,V]);const ye=L.trim()!==""||y?N:N.slice(0,He);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:k.map(d=>e.jsxs(H,{disabled:o,onClick:()=>D(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...s==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx($,{size:"small",onClick:ne,disabled:o,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,anchorEl:C,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:g("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(h.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:g("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(We,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(X,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(Oe,{checked:T.includes(d.value),onChange:()=>se(d.value),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:g("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:L,onChange:me,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Xe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:jr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(d=>e.jsx(We,{elevation:0,sx:Ke(h.includes(d.id)),children:e.jsx(X,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(Oe,{checked:h.includes(d.id),onChange:()=>oe(d.id),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx(_e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),N.length>He&&L.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:y?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),h.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(Ce,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),w?w.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),h.map(d=>{const w=V.find(A=>A.id===d);return e.jsx(Ce,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(_e,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Jr=te(Lt)`
2
2
  position: fixed;
3
3
  bottom: 20px;
4
4
  right: 20px;
@@ -8,7 +8,7 @@ import{j as e,y as Pt,bb as Re,M as ae,ak as x,Q as H,W as u,J as xe,c0 as Rt,I
8
8
  right: 16px;
9
9
  transform: scale(0.9);
10
10
  }
11
- `;function en(){const[t,o]=b.useState(!1);b.useEffect(()=>{const n=Xe(()=>{o(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(zt,{in:t,children:e.jsx(Xr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Et,{})})})}const tn=te.div`
11
+ `;function en(){const[t,o]=b.useState(!1);b.useEffect(()=>{const n=Je(()=>{o(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(zt,{in:t,children:e.jsx(Jr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Et,{})})})}const tn=te.div`
12
12
  display: flex;
13
13
  flex-direction: column;
14
14
  gap: ${t=>t.inDialog?0:"24px"};
@@ -73,7 +73,7 @@ import{j as e,y as Pt,bb as Re,M as ae,ak as x,Q as H,W as u,J as xe,c0 as Rt,I
73
73
  *::-webkit-scrollbar {
74
74
  display: none; /* Chrome, Safari and Opera */
75
75
  }
76
- `;dt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function dt({blocklets:t=[],context:o,pagination:s=!0,inDialog:n=!1,filterType:a="component",toViewAll:i=()=>{},type:l="service"}){const{data:p,paging:r,refresh:f,loading:m,params:g,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:h}=o,S=d=>{f({...g,severity:d&&typeof d=="string"?[d]:d||[],paging:{...g.paging,page:1}})},[T]=qt(),P=R(()=>T.get("id"),[T]),y=xe(d=>d.breakpoints.down("md")),[E,L]=b.useState(0),[F,D]=b.useState(!1),j=b.useMemo(()=>g.read===!1?"unread":"all",[g.read]),k=R(()=>Xe(d=>{if(m)return;const w=p.length,A=p.filter(_=>!qe(_)).length;let B={...g,append:!0,paging:{...g.paging,...d,currentPage:(r.currentPage||0)+1}};j==="unread"&&A<w&&d.page>g.paging.page&&(B={...g,append:!0,paging:{...g.paging,...d,page:g.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(B)},500),[p,g,j,r,m,f]);et(()=>{h&&typeof h=="function"&&h()}),b.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),b.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),D(!0)},100),setTimeout(()=>{D(!1)},3e3)},[P]);const N=R(()=>p?.length>0&&p.length<E,[p,E]),K=b.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(B=>B)];return v?.includes(d)||A.findIndex(B=>B===d)>-1},[v]),ne=b.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(B=>{d.has(B)||d.set(B,w)})),w?.children?.length>0&&w.children.forEach(B=>{const _=B?.did||B.meta?.did;_&&!d.has(_)&&K(_)&&(B.ancestors=[w],d.set(_,B))})}),d},[t,K]),ge=b.useCallback(()=>{m||k({page:r.page+1})},[r.page,m,k]),[oe]=Yr({loading:m,hasNextPage:N,onLoadMore:ge}),se=d=>{!d||qe(d)||C(d.id).then(()=>{n&&i()})},me=({severity:d,id:w})=>{if(m)return;let A={};a==="component"?A={entityId:[],componentDid:w}:a==="entity"&&(A={componentDid:[],entityId:w}),f({...g,severity:d,...A,paging:{...g.paging,page:1}})},be=d=>{if(m)return;let w={...g,paging:{...g.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=Gt(w,"read"),f(w)},V=R(()=>a==="component"?Array.isArray(g.componentDid)?g.componentDid:[]:a==="entity"?Array.isArray(g.entityId)?g.entityId:[]:[],[g,a]),ye=R(()=>(Array.isArray(g.severity)?g.severity:[])[0]||"",[g.severity]);return e.jsxs(tn,{inDialog:!!n,children:[n?e.jsx(at,{currentTab:ye,type:"line",theme:"light",onSelectType:S}):e.jsx(ct,{loading:m,blockletMap:ne,unReadCount:c,filterType:a,type:l,selectedId:V,onFilterChange:me,severity:g.severity,onReadFilterChange:be,currentReadFilter:j}),!y&&m?e.jsx(x,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Q,{})}):e.jsx(wr,{data:p,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&F,type:l}),s&&!y?e.jsx(Qr,{loading:m,paging:r,onChange:k}):null,s&&y&&(m||N)?e.jsx(x,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Q,{})}):null,!n&&y?e.jsx(en,{}):null]})}const rn=b.memo(dt),U=new Jt;function he(t){const{userDid:o=""}={},{session:s}=Qt(),n=R(()=>{if(o)return o;const r=window.location.href,f=Kt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,o]),a=R(()=>s.user,[s]),i=R(()=>a?n===a?.did:!1,[n,a?.did]),l=re(async()=>{if(await Zt(()=>s?.initialized),i)return s.user;if(n)return U.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,s?.initialized,a]}),p=R(()=>a.passports?.some(r=>r.role===Te.ROLES.OWNER),[a]);return{currentDid:n,session:s,isMyself:i,user:a,viewUser:l.data,isOwner:p}}function ut({user:t,...o}){const{t:s}=W(),n=Bt(),a=R(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===cr.REVOKED}));return p.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),De(p.filter(r=>!r.display),"role").concat(De(p.filter(r=>r.display),"display.content"))},[t?.passports]),i=R(()=>a?.find(p=>p.name===t.role),[a,t?.role]),l=n.palette.primary.main;return a.length===0?e.jsx(x,{children:e.jsx(rt,{children:s("userCenter.noPassport")})}):e.jsx(x,{...o,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...o.sx},children:a.map(p=>e.jsx(Sr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Xt,title:i&&i.role===p.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===p.role?`0px 2px 4px 0px ${l}, 0px 1px 2px -1px ${l}, 0px 0px 0px 1px ${l} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ut.propTypes={user:u.object.isRequired};function nn({visible:t,onClose:o,nft:s}){return!t||!s?null:e.jsx(on,{children:e.jsx(Wt,{open:t,onClose:o,children:e.jsx(sn,{onClick:o,children:e.jsx(st,{data:it(s),address:s.address,inset:!0})})})})}const on=te.div`
76
+ `;dt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function dt({blocklets:t=[],context:o,pagination:s=!0,inDialog:n=!1,filterType:a="component",toViewAll:i=()=>{},type:l="service"}){const{data:p,paging:r,refresh:f,loading:m,params:g,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:h}=o,S=d=>{f({...g,severity:d&&typeof d=="string"?[d]:d||[],paging:{...g.paging,page:1}})},[T]=qt(),P=R(()=>T.get("id"),[T]),y=xe(d=>d.breakpoints.down("md")),[E,L]=b.useState(0),[U,N]=b.useState(!1),j=b.useMemo(()=>g.read===!1?"unread":"all",[g.read]),k=R(()=>Je(d=>{if(m)return;const w=p.length,A=p.filter(_=>!qe(_)).length;let B={...g,append:!0,paging:{...g.paging,...d,currentPage:(r.currentPage||0)+1}};j==="unread"&&A<w&&d.page>g.paging.page&&(B={...g,append:!0,paging:{...g.paging,...d,page:g.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(B)},500),[p,g,j,r,m,f]);et(()=>{h&&typeof h=="function"&&h()}),b.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),b.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),N(!0)},100),setTimeout(()=>{N(!1)},3e3)},[P]);const D=R(()=>p?.length>0&&p.length<E,[p,E]),K=b.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(B=>B)];return v?.includes(d)||A.findIndex(B=>B===d)>-1},[v]),ne=b.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(B=>{d.has(B)||d.set(B,w)})),w?.children?.length>0&&w.children.forEach(B=>{const _=B?.did||B.meta?.did;_&&!d.has(_)&&K(_)&&(B.ancestors=[w],d.set(_,B))})}),d},[t,K]),ge=b.useCallback(()=>{m||k({page:r.page+1})},[r.page,m,k]),[oe]=Yr({loading:m,hasNextPage:D,onLoadMore:ge}),se=d=>{!d||qe(d)||C(d.id).then(()=>{n&&i()})},me=({severity:d,id:w})=>{if(m)return;let A={};a==="component"?A={entityId:[],componentDid:w}:a==="entity"&&(A={componentDid:[],entityId:w}),f({...g,severity:d,...A,paging:{...g.paging,page:1}})},be=d=>{if(m)return;let w={...g,paging:{...g.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=Gt(w,"read"),f(w)},V=R(()=>a==="component"?Array.isArray(g.componentDid)?g.componentDid:[]:a==="entity"?Array.isArray(g.entityId)?g.entityId:[]:[],[g,a]),ye=R(()=>(Array.isArray(g.severity)?g.severity:[])[0]||"",[g.severity]);return e.jsxs(tn,{inDialog:!!n,children:[n?e.jsx(at,{currentTab:ye,type:"line",theme:"light",onSelectType:S}):e.jsx(ct,{loading:m,blockletMap:ne,unReadCount:c,filterType:a,type:l,selectedId:V,onFilterChange:me,severity:g.severity,onReadFilterChange:be,currentReadFilter:j}),!y&&m?e.jsx(x,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):e.jsx(wr,{data:p,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:l}),s&&!y?e.jsx(Zr,{loading:m,paging:r,onChange:k}):null,s&&y&&(m||D)?e.jsx(x,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):null,!n&&y?e.jsx(en,{}):null]})}const rn=b.memo(dt),F=new Xt;function he(t){const{userDid:o=""}={},{session:s}=Zt(),n=R(()=>{if(o)return o;const r=window.location.href,f=Kt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,o]),a=R(()=>s.user,[s]),i=R(()=>a?n===a?.did:!1,[n,a?.did]),l=re(async()=>{if(await Qt(()=>s?.initialized),i)return s.user;if(n)return F.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,s?.initialized,a]}),p=R(()=>a.passports?.some(r=>r.role===Te.ROLES.OWNER),[a]);return{currentDid:n,session:s,isMyself:i,user:a,viewUser:l.data,isOwner:p}}function ut({user:t,...o}){const{t:s}=W(),n=Bt(),a=R(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===cr.REVOKED}));return p.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),Ne(p.filter(r=>!r.display),"role").concat(Ne(p.filter(r=>r.display),"display.content"))},[t?.passports]),i=R(()=>a?.find(p=>p.name===t.role),[a,t?.role]),l=n.palette.primary.main;return a.length===0?e.jsx(x,{children:e.jsx(rt,{children:s("userCenter.noPassport")})}):e.jsx(x,{...o,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...o.sx},children:a.map(p=>e.jsx(Sr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Jt,title:i&&i.role===p.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===p.role?`0px 2px 4px 0px ${l}, 0px 1px 2px -1px ${l}, 0px 0px 0px 1px ${l} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ut.propTypes={user:u.object.isRequired};function nn({visible:t,onClose:o,nft:s}){return!t||!s?null:e.jsx(on,{children:e.jsx(Wt,{open:t,onClose:o,children:e.jsx(sn,{onClick:o,children:e.jsx(st,{data:it(s),address:s.address,inset:!0})})})})}const on=te.div`
77
77
  position: relative;
78
78
  width: 100%;
79
79
  height: 100%;
@@ -118,7 +118,7 @@ import{j as e,y as Pt,bb as Re,M as ae,ak as x,Q as H,W as u,J as xe,c0 as Rt,I
118
118
  height: 75vmin;
119
119
  }
120
120
  }
121
- `,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:le(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:le(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ve="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:o}=W(),s=Z(),[n,a]=b.useState({visible:!1,nft:null}),[i,l]=b.useState({anchorEl:null,props:null}),p=P=>{const y=ce(Ve,"assets",P);window.open(y,"_blank")},r=(P,y)=>{let E="";typeof y.data?.value=="string"?E=JSON.parse(y.data?.value)?.domain:E=y.data?.value?.domain,l({anchorEl:P,props:{title:E?`Hey, I just won an NFT at the ${E} event!`:"Hey, I just won an NFT!",url:ce(Ve,"assets",y.address)}})},f=P=>{a({visible:!0,nft:P})},m=G({page:1,size:20}),g=re(async(P=m)=>(await Vt.get(`${Te.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&m,defaultParams:[m],refreshDeps:[t?.did,m]}),{loading:C,data:v}=g,c=v?.page??{cursor:0,next:!1,total:0},h=(P,y)=>{m.page=y,g.run(m)},S=z(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:y=>{y.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:y=>{y.stopPropagation(),r(y.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:y=>{y.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(y=>e.jsx(Ne,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},y));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ne,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:o("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:o("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Ie,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||m.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:h,count:Math.ceil(c.total/m.size),size:"small"}):null,e.jsx(nn,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{a({visible:!1,nft:null})}}),e.jsx(dr,{anchorEl:i.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,c,m.page,m.size,h,i,n]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:o,isMyself:s,viewUser:n}=he();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:o})]}):null,e.jsx(pt,{user:s?o:n})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:o}){const{t:s,changeLocale:n}=W(),a=G({locale:t.locale,loading:!1}),i=z(async l=>{try{const{value:p}=l.target;a.loading=!0,await U.user.saveProfile({locale:p}),await o("profile"),n(p),a.locale=p}catch(p){q.error(ee(p))}finally{a.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Re,{value:a.locale,onChange:i,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ae,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=Y,onDelete:o=Y,onSave:s=Y,onCancel:n=Y,type:a="slack",url:i="",edit:l=!1}){const{t:p}=W(),r=G({type:a||"slack",url:i||"",edit:l??!1,error:"",loading:!1}),f=z(()=>r.url?er(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),m=z(()=>{r.edit=!1,r.url=i||"",r.type=a||"slack",r.error="",r.loading=!1,n()}),g=z(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=z(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Q,{size:16}):e.jsx($,{size:"small",onClick:C(g),sx:{mr:-1},children:e.jsx(O,{icon:kr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Re,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ae,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ze,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Je,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:ur})}),e.jsx($,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:pr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Pr})}),e.jsx($,{color:"error",onClick:()=>{o({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Rr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function ie({title:t=void 0,description:o=void 0,value:s,onChange:n,isMobile:a}){const i=z(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:a?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:a?"normal":"nowrap"},children:[t,o]})]})}ie.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:o}){const{t:s}=W(),n=G({showAdd:!1}),a=re(async()=>await U.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...a?.data?.notifications||{}}),[a?.data?.notifications]),l=R(()=>a?.data?.webhooks||[],[a?.data?.webhooks]),p=z(async v=>{try{await U.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),a.run()}catch(c){q.error(ee(c))}}),r=z(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await U.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(ee(c))}},m=z(async v=>{await p({webhooks:l.filter((c,h)=>h!==v)})}),g=z(async(v,c)=>{await p({webhooks:l.map((h,S)=>S===v?c:h)})}),C=z(async v=>{await p({webhooks:[...l,v]}),n.showAdd=!1});return a.error?e.jsx(Nt,{severity:"error",children:a.error.message}):a.loading||!a.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Q,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(ie,{value:i.wallet,isMobile:o,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:$e(t)&&e.jsx(xr,{did:$e(t),showQrcode:!1,showAvatar:!o,copyable:!0,compact:!0,responsive:!0,startChars:o?2:6})}),e.jsx(ie,{value:i.email,isMobile:o,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:o,value:i.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Ie,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>m(c),onSave:(...h)=>g(c,...h),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Ir}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function Pe({children:t,...o}){const s=Z(),[n,a]=b.useState(!1),i=z(()=>{a(!n)});return b.useEffect(()=>{a(!1)},[s]),s?e.jsx(Dt,{onClickAway:()=>a(!1),children:e.jsx(X,{...o,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,slotProps:{popper:{disablePortal:!0}},open:n,onClose:i,children:b.cloneElement(t,{onClick:i})})}):e.jsx(X,{...o,children:t})}Pe.propTypes={children:u.node.isRequired};function ht({item:t}){const o=ze(),{blocklet:s}=tr(),{confirmApi:n,confirmHolder:a}=Ae(),i=G({loading:!1}),{t:l}=W(),{session:p}=b.use(fe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:m,baseUrl:g}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>fr[t?.provider]||"unknown",[t?.provider]),h=z(y=>y?._bind?y.provider===M.WALLET&&y.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):y.provider===M.PASSKEY&&o.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):y._mainProvider&&o.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=z(async()=>{if(t?.provider===M.PASSKEY){await new Promise((y,E)=>{n.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(y).catch(E),L()},onCancel:y})});return}try{i.loading=!0,await new Promise((y,E)=>{if(t?._bind)n.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(y).catch(E),L()},onCancel:y});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:y,onCancel:E});else{const L=g,F=window?.blocklet;let D="/";const j=hr(F),k=gr(F);j&&k?.appPid&&p?.user?.sourceAppPid&&(D=k.appUrl),m(D),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(y).catch(E).finally(()=>{m(L),v()})}})}catch(y){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,y)}finally{i.loading=!1}}),T=z(y=>y.provider===M.WALLET&&y.did?l("userCenter.thirdPartyLogin.walletAccount"):y._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):y?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=z(y=>y.provider===M.WALLET&&y.did||y.provider===M.PASSKEY&&(o.arcSphere||o.wallet)?!0:!!t._mainProvider,[o.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(rr,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(Pe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:nr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(Pe,{title:h(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:y=>{const E=y.palette.error.main,L=y.palette.primary.main;return{color:t?._bind?E:L,borderColor:t?._bind?E:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?E:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(O,{icon:Tr}),onClick:S,disabled:P(t),loading:i.loading,children:T(t)})})}),a]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:o}=b.use(fe),[s,n]=b.useState({}),{getOAuthConfigs:a}=o.useOAuth(),i=ze();lr(async()=>{const r=await a({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=mr(t);let f=!1,m="",g=br(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,m=M.GOOGLE,g===M.AUTH0&&(g=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,m=M.APPLE,g===M.AUTH0&&(g=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,m=M.GITHUB,g===M.AUTH0&&(g=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const h=f&&c.provider===m?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return h?{...c,provider:c.provider,did:h.did,pk:h.pk,userInfo:h.userInfo,_bind:!0,_rawProvider:h.provider,_mainProvider:c.provider===g}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===g}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,h)=>c._mainProvider?-1:c?.order!==void 0&&h?.order!==void 0?c.order-h.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(or,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:Y,onError:Y,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:o}){const[s,n]=b.useState(t),{t:a}=W(),i=z(async(l,p)=>{try{const r=await U.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(a("userCenter.saveSuccess")),o("privacy")}catch(r){q.error(ee(r))}});return b.useEffect(()=>{n(t)},[t]),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:a("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?i(l.key,f?"all":"private"):i(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:a("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;i(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:o}){const s=R(()=>(t?.passports||[])?.find(n=>n.name===o.role),[t?.passports,o?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:o.avatar,did:o.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(X,{title:o.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:o.fullName})}),e.jsx(Ce,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(X,{title:o.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ye=t=>new we(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we.BROWSER.NAME,we.BROWSER.VERSION]]}).getResult(),Qe={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new sr({concurrency:1}),Ee=b.memo(({userSession:t,isMobile:o=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:n}=W();b.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const a=R(()=>o?{display:"flex",justifyContent:"flex-end"}:{},[o]);return e.jsx(x,{...o&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Fe,{size:16,className:"ip-address",style:a,children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{size:16,className:"ip-address",style:a,children:t.lastLoginIp||n("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Q,{size:12,color:"inherit"})}):null]})})});Ee.propTypes={userSession:u.object.isRequired,isMobile:u.bool};Ee.defaultProps={isMobile:!1};function yt({user:t,showAction:o=!0,showUser:s=!0,getUserSessions:n,showOffline:a=!1}){const i=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=yr(),{t:r,locale:f}=W(),m=Z({key:"md"}),g=xe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Ae(),c=z(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),k=j?.paging?.total||0;return l[i.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const h=re(c,{refreshDeps:[i.status,i.page,i.pageSize]}),S=R(()=>h.data?.list||[],[h.data?.list]),T=R(()=>{const{status:j}=i;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>de({},m?Qe:{}),[m]),y=z(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=i,{list:N=[]}=h.data||{},K=N.length||0;k>1&&K===1&&(i.page=Math.max(k-1,1)),h.refresh(),C.close()}})}),E=z(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(i.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(i.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({status:i.status,visitorId:p,includeFederated:!0}),i.page=1,h.refresh(),C.close()}})}),L=[];o&&L.push(e.jsx(X,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:E,disabled:T,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const F=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:h.data?.total||0}),[h.data?.total,i.page,i.pageSize]),D=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],N=Ye(k?.ua);return e.jsx(x,{sx:P,children:[N.os?.name,N.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],N=Ye(k?.ua);return e.jsx(x,{sx:P,children:[N.browser?.name,N.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:de({minWidth:150,maxWidth:250},m?Qe:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx(Ue,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!a&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx(Ue,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(Ee,{userSession:k,isMobile:m})}}},o&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>y({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:m?"unset":g?"calc(100vw - 300px)":"100%",...m&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...m&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(vr,{count:h.data?.total||0,data:S,columns:D,customButtons:L,options:F,locale:f,loading:h.loading,className:"pc-user-sessions-table",title:e.jsxs($t,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(J,{value:"online",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(J,{value:"expired",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),a?e.jsx(J,{value:"offline",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:o}=Ae(),{t:s}=W(),{session:n}=b.use(fe),a=z(async()=>{if(!t||typeof t!="function")return;const i=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await i(),n.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:a,children:s("userCenter.dangerZone.delete")})]})}),o]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=Z({key:"md"}),o=xe(a=>a.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=R(()=>de({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":o?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:a=>`${a.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:n})})}function wt({onDestroySelf:t=void 0,userCenterTabs:o=[]}){const{t:s}=W(),{user:n,session:a,isMyself:i,isOwner:l}=he(),r=ze().arcSphere,f=Z({key:"md"}),m=re(async()=>n&&i?await U.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),g=R(()=>o.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[o]),C=z(async c=>c==="privacy"?(await m.runAsync(),m.data):(c==="profile"&&await a.refresh(),null));b.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:n,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:g,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:n,showUser:!1,getUserSessions:c=>U.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,g,f,l,t]);return i?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:de({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=b.createContext({}),{Provider:fn,Consumer:ho}=jt;function Ct({children:t}){const[o]=b.useState(!1),{session:s}=b.use(fe),{user:n}=s,[a,i]=b.useState(),l=b.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);b.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const p=async()=>{i(void 0)},r=g=>{},f=async g=>{i(g),await r(g.endpoint)},m=!!(l&&a);return e.jsx(fn,{value:{loading:o,spaceGateway:a,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function Le(){return b.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const o=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(o,"space",n)}function St({session:t,spaceGateway:o,spaceStatus:s,refresh:n}){return e.jsxs(Ie,{direction:"row",spacing:1,children:[s===Br.DISCONNECTED&&e.jsx(ue,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:a=>{console.error(a),q.error(ee(a))}}),e.jsx($,{size:"small",LinkComponent:Ut,href:hn(o.endpoint),target:"_blank",children:e.jsx(Ft,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:o}=W(),{updateSpaceGateway:s,session:n}=Le(),a=Z(),i=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:o("userCenter.storage.spaces.connected.title")}),!a&&e.jsx(ue,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:n,...l})},t.endpoint)}),a&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:o,session:s}=Le(),n=({spaceGateway:a})=>o(a);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(ue,{session:s,onSuccess:n})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:o,loading:s}=Le(),{isMyself:n}=he();return n?s?e.jsx(Lr,{relative:"parent",children:e.jsx(Q,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:o?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=te(x)`
121
+ `,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:le(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:le(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ve="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:o}=W(),s=Q(),[n,a]=b.useState({visible:!1,nft:null}),[i,l]=b.useState({anchorEl:null,props:null}),p=P=>{const y=ce(Ve,"assets",P);window.open(y,"_blank")},r=(P,y)=>{let E="";typeof y.data?.value=="string"?E=JSON.parse(y.data?.value)?.domain:E=y.data?.value?.domain,l({anchorEl:P,props:{title:E?`Hey, I just won an NFT at the ${E} event!`:"Hey, I just won an NFT!",url:ce(Ve,"assets",y.address)}})},f=P=>{a({visible:!0,nft:P})},m=G({page:1,size:20}),g=re(async(P=m)=>(await Vt.get(`${Te.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&m,defaultParams:[m],refreshDeps:[t?.did,m]}),{loading:C,data:v}=g,c=v?.page??{cursor:0,next:!1,total:0},h=(P,y)=>{m.page=y,g.run(m)},S=z(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:y=>{y.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:y=>{y.stopPropagation(),r(y.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:y=>{y.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(y=>e.jsx(De,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},y));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(De,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:o("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:o("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Ie,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||m.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:h,count:Math.ceil(c.total/m.size),size:"small"}):null,e.jsx(nn,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{a({visible:!1,nft:null})}}),e.jsx(dr,{anchorEl:i.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,c,m.page,m.size,h,i,n]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:o,isMyself:s,viewUser:n}=he();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:o})]}):null,e.jsx(pt,{user:s?o:n})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:o}){const{t:s,changeLocale:n}=W(),a=G({locale:t.locale,loading:!1}),i=z(async l=>{try{const{value:p}=l.target;a.loading=!0,await F.user.saveProfile({locale:p}),await o("profile"),n(p),a.locale=p}catch(p){q.error(ee(p))}finally{a.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Re,{value:a.locale,onChange:i,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ae,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=Y,onDelete:o=Y,onSave:s=Y,onCancel:n=Y,type:a="slack",url:i="",edit:l=!1}){const{t:p}=W(),r=G({type:a||"slack",url:i||"",edit:l??!1,error:"",loading:!1}),f=z(()=>r.url?er(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),m=z(()=>{r.edit=!1,r.url=i||"",r.type=a||"slack",r.error="",r.loading=!1,n()}),g=z(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=z(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Z,{size:16}):e.jsx($,{size:"small",onClick:C(g),sx:{mr:-1},children:e.jsx(O,{icon:kr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Re,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ae,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Xe,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:ur})}),e.jsx($,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:pr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Pr})}),e.jsx($,{color:"error",onClick:()=>{o({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Rr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function ie({title:t=void 0,description:o=void 0,value:s,onChange:n,isMobile:a}){const i=z(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:a?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:a?"normal":"nowrap"},children:[t,o]})]})}ie.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:o}){const{t:s}=W(),n=G({showAdd:!1}),a=re(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...a?.data?.notifications||{}}),[a?.data?.notifications]),l=R(()=>a?.data?.webhooks||[],[a?.data?.webhooks]),p=z(async v=>{try{await F.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),a.run()}catch(c){q.error(ee(c))}}),r=z(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await F.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(ee(c))}},m=z(async v=>{await p({webhooks:l.filter((c,h)=>h!==v)})}),g=z(async(v,c)=>{await p({webhooks:l.map((h,S)=>S===v?c:h)})}),C=z(async v=>{await p({webhooks:[...l,v]}),n.showAdd=!1});return a.error?e.jsx(Dt,{severity:"error",children:a.error.message}):a.loading||!a.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Z,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(ie,{value:i.wallet,isMobile:o,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:$e(t)&&e.jsx(xr,{did:$e(t),showQrcode:!1,showAvatar:!o,copyable:!0,compact:!0,responsive:!0,startChars:o?2:6})}),e.jsx(ie,{value:i.email,isMobile:o,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:o,value:i.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Ie,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>m(c),onSave:(...h)=>g(c,...h),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Ir}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function Pe({children:t,...o}){const s=Q(),[n,a]=b.useState(!1),i=z(()=>{a(!n)});return b.useEffect(()=>{a(!1)},[s]),s?e.jsx(Nt,{onClickAway:()=>a(!1),children:e.jsx(J,{...o,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,slotProps:{popper:{disablePortal:!0}},open:n,onClose:i,children:b.cloneElement(t,{onClick:i})})}):e.jsx(J,{...o,children:t})}Pe.propTypes={children:u.node.isRequired};function ht({item:t}){const o=ze(),{blocklet:s}=tr(),{confirmApi:n,confirmHolder:a}=Ae(),i=G({loading:!1}),{t:l}=W(),{session:p}=b.use(fe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:m,baseUrl:g}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>fr[t?.provider]||"unknown",[t?.provider]),h=z(y=>y?._bind?y.provider===M.WALLET&&y.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):y.provider===M.PASSKEY&&o.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):y._mainProvider&&o.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=z(async()=>{if(t?.provider===M.PASSKEY){await new Promise((y,E)=>{n.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(y).catch(E),L()},onCancel:y})});return}try{i.loading=!0,await new Promise((y,E)=>{if(t?._bind)n.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(y).catch(E),L()},onCancel:y});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:y,onCancel:E});else{const L=g,U=window?.blocklet;let N="/";const j=hr(U),k=gr(U);j&&k?.appPid&&p?.user?.sourceAppPid&&(N=k.appUrl),m(N),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(y).catch(E).finally(()=>{m(L),v()})}})}catch(y){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,y)}finally{i.loading=!1}}),T=z(y=>y.provider===M.WALLET&&y.did?l("userCenter.thirdPartyLogin.walletAccount"):y._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):y?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=z(y=>y.provider===M.WALLET&&y.did||y.provider===M.PASSKEY&&(o.arcSphere||o.wallet)?!0:!!t._mainProvider,[o.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(rr,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(Pe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:nr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(Pe,{title:h(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:y=>{const E=y.palette.error.main,L=y.palette.primary.main;return{color:t?._bind?E:L,borderColor:t?._bind?E:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?E:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(O,{icon:Tr}),onClick:S,disabled:P(t),loading:i.loading,children:T(t)})})}),a]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:o}=b.use(fe),[s,n]=b.useState({}),{getOAuthConfigs:a}=o.useOAuth(),i=ze();lr(async()=>{const r=await a({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=mr(t);let f=!1,m="",g=br(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,m=M.GOOGLE,g===M.AUTH0&&(g=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,m=M.APPLE,g===M.AUTH0&&(g=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,m=M.GITHUB,g===M.AUTH0&&(g=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const h=f&&c.provider===m?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return h?{...c,provider:c.provider,did:h.did,pk:h.pk,userInfo:h.userInfo,_bind:!0,_rawProvider:h.provider,_mainProvider:c.provider===g}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===g}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,h)=>c._mainProvider?-1:c?.order!==void 0&&h?.order!==void 0?c.order-h.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(or,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:Y,onError:Y,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:o}){const[s,n]=b.useState(t),{t:a}=W(),i=z(async(l,p)=>{try{const r=await F.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(a("userCenter.saveSuccess")),o("privacy")}catch(r){q.error(ee(r))}});return b.useEffect(()=>{n(t)},[t]),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:a("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?i(l.key,f?"all":"private"):i(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:a("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;i(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:o}){const s=R(()=>(t?.passports||[])?.find(n=>n.name===o.role),[t?.passports,o?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:o.avatar,did:o.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(J,{title:o.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:o.fullName})}),e.jsx(Ce,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(J,{title:o.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ye=t=>new we(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we.BROWSER.NAME,we.BROWSER.VERSION]]}).getResult(),Ze={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new sr({concurrency:1}),Ee=b.memo(({userSession:t,isMobile:o=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:n}=W();b.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const a=R(()=>o?{display:"flex",justifyContent:"flex-end"}:{},[o]);return e.jsx(x,{...o&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Ue,{size:16,className:"ip-address",style:a,children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{size:16,className:"ip-address",style:a,children:t.lastLoginIp||n("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Z,{size:12,color:"inherit"})}):null]})})});Ee.propTypes={userSession:u.object.isRequired,isMobile:u.bool};Ee.defaultProps={isMobile:!1};function yt({user:t,showAction:o=!0,showUser:s=!0,getUserSessions:n,showOffline:a=!1}){const i=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=yr(),{t:r,locale:f}=W(),m=Q({key:"md"}),g=xe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Ae(),c=z(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),k=j?.paging?.total||0;return l[i.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const h=re(c,{refreshDeps:[i.status,i.page,i.pageSize]}),S=R(()=>h.data?.list||[],[h.data?.list]),T=R(()=>{const{status:j}=i;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>de({},m?Ze:{}),[m]),y=z(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await F.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=i,{list:D=[]}=h.data||{},K=D.length||0;k>1&&K===1&&(i.page=Math.max(k-1,1)),h.refresh(),C.close()}})}),E=z(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(i.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(i.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await F.user.logout({status:i.status,visitorId:p,includeFederated:!0}),i.page=1,h.refresh(),C.close()}})}),L=[];o&&L.push(e.jsx(J,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:E,disabled:T,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const U=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:h.data?.total||0}),[h.data?.total,i.page,i.pageSize]),N=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],D=Ye(k?.ua);return e.jsx(x,{sx:P,children:[D.os?.name,D.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],D=Ye(k?.ua);return e.jsx(x,{sx:P,children:[D.browser?.name,D.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:de({minWidth:150,maxWidth:250},m?Ze:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx(Fe,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!a&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx(Fe,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(Ee,{userSession:k,isMobile:m})}}},o&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>y({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:m?"unset":g?"calc(100vw - 300px)":"100%",...m&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...m&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(vr,{count:h.data?.total||0,data:S,columns:N,customButtons:L,options:U,locale:f,loading:h.loading,className:"pc-user-sessions-table",title:e.jsxs($t,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(X,{value:"online",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(X,{value:"expired",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),a?e.jsx(X,{value:"offline",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:o}=Ae(),{t:s}=W(),{session:n}=b.use(fe),a=z(async()=>{if(!t||typeof t!="function")return;const i=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await i(),n.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:a,children:s("userCenter.dangerZone.delete")})]})}),o]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=Q({key:"md"}),o=xe(a=>a.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=R(()=>de({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":o?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:a=>`${a.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:n})})}function wt({onDestroySelf:t=void 0,userCenterTabs:o=[]}){const{t:s}=W(),{user:n,session:a,isMyself:i,isOwner:l}=he(),r=ze().arcSphere,f=Q({key:"md"}),m=re(async()=>n&&i?await F.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),g=R(()=>o.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[o]),C=z(async c=>c==="privacy"?(await m.runAsync(),m.data):(c==="profile"&&await a.refresh(),null));b.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:n,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:g,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:n,showUser:!1,getUserSessions:c=>F.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,g,f,l,t]);return i?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:de({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=b.createContext({}),{Provider:fn,Consumer:ho}=jt;function Ct({children:t}){const[o]=b.useState(!1),{session:s}=b.use(fe),{user:n}=s,[a,i]=b.useState(),l=b.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);b.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const p=async()=>{i(void 0)},r=g=>{},f=async g=>{i(g),await r(g.endpoint)},m=!!(l&&a);return e.jsx(fn,{value:{loading:o,spaceGateway:a,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function Le(){return b.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const o=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(o,"space",n)}function St({session:t,spaceGateway:o,spaceStatus:s,refresh:n}){return e.jsxs(Ie,{direction:"row",spacing:1,children:[s===Br.DISCONNECTED&&e.jsx(ue,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:a=>{console.error(a),q.error(ee(a))}}),e.jsx($,{size:"small",LinkComponent:Ft,href:hn(o.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:o}=W(),{updateSpaceGateway:s,session:n}=Le(),a=Q(),i=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:o("userCenter.storage.spaces.connected.title")}),!a&&e.jsx(ue,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:n,...l})},t.endpoint)}),a&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:o,session:s}=Le(),n=({spaceGateway:a})=>o(a);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(ue,{session:s,onSuccess:n})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:o,loading:s}=Le(),{isMyself:n}=he();return n?s?e.jsx(Lr,{relative:"parent",children:e.jsx(Z,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:o?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=te(x)`
122
122
  height: 100%;
123
123
  overflow-y: auto;
124
- `;function vn(){const{user:t,isMyself:o,viewUser:s}=he(),{followed:n}=Ar();return e.jsx(x,{children:e.jsx(Nr,{teamDid:window?.blocklet?.did||"",user:o?t:s,showInvitees:o,followed:n})})}function go(){const{api:t}=ir(),o=b.useRef(null),n=Ht().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),l=ar(),p=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(f=>({...f,meta:{...f,did:f.did,name:f.name||f.title||"",logo:"logo.png"}}))})),r=async f=>{const{input:m,sessionId:g}=f;try{await t.destroySelf({input:{...m,sessionId:g}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(Cr,{children:e.jsxs(Mr,{ref:o,embed:i==="1",currentTab:n?ce(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(rn,{blocklets:[p],context:l}):null,n==="nfts"?e.jsx(cn,{}):null,n==="settings"?e.jsx(wt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(bn,{}):null,n==="user-followers"?e.jsx(vn,{}):null]})})}export{go as default};
124
+ `;function vn(){const{user:t,isMyself:o,viewUser:s}=he(),{followed:n}=Ar();return e.jsx(x,{children:e.jsx(Dr,{teamDid:window?.blocklet?.did||"",user:o?t:s,showInvitees:o,followed:n})})}function go(){const{api:t}=ir(),o=b.useRef(null),n=Ht().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),l=ar(),p=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(f=>({...f,meta:{...f,did:f.did,name:f.name||f.title||"",logo:"logo.png"}}))})),r=async f=>{const{input:m,sessionId:g}=f;try{await t.destroySelf({input:{...m,sessionId:g}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(Cr,{children:e.jsxs(Mr,{ref:o,embed:i==="1",currentTab:n?ce(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(rn,{blocklets:[p],context:l}):null,n==="nfts"?e.jsx(cn,{}):null,n==="settings"?e.jsx(wt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(bn,{}):null,n==="user-followers"?e.jsx(vn,{}):null]})})}export{go as default};