@abtnode/blocklet-services 1.16.49-beta-20250829-075052-2563fcb3 → 1.16.49

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 (217) hide show
  1. package/api/index.js +4 -0
  2. package/api/services/auth/session.js +8 -0
  3. package/dist/assets/{AdapterDayjs-CsjxEemY.js → AdapterDayjs-DV5yorPZ.js} +1 -1
  4. package/dist/assets/{Google-a7LsY6gB.js → Google-Bggl6-zg.js} +1 -1
  5. package/dist/assets/{access-control-BflK_JY_.js → access-control-CuLkWtU3.js} +1 -1
  6. package/dist/assets/{actions-BEg2ZR9n.js → actions-DAS8NTxZ.js} +1 -1
  7. package/dist/assets/{add-component-core-Qw040b1L.js → add-component-core-B-Yi66_2.js} +7 -7
  8. package/dist/assets/add-resource-B6TOAf2c.js +1 -0
  9. package/dist/assets/{addon-LHky73fl.js → addon-CZc2Epcq.js} +2 -2
  10. package/dist/assets/{advanced-Cb7kjy9p.js → advanced-Cg5EOtB8.js} +2 -2
  11. package/dist/assets/{aigne-DyYvTUt7.js → aigne-2eII8VzR.js} +1 -1
  12. package/dist/assets/api-Cyp6JVXh.js +1 -0
  13. package/dist/assets/{appearance-DnSAzT5z.js → appearance-CyMAGa_G.js} +1 -1
  14. package/dist/assets/{arrow-down.svg-BiYMv82Y.js → arrow-down.svg-B5veoO0J.js} +1 -1
  15. package/dist/assets/{audit-logs-BT6QlPWw.js → audit-logs-K8OlQ5MR.js} +2 -2
  16. package/dist/assets/authorize-BD5WdYP4.js +1 -0
  17. package/dist/assets/{base-chart-BX5qTIVB.js → base-chart-OFUhpKS6.js} +1 -1
  18. package/dist/assets/base32-BJKRqMID.js +1 -0
  19. package/dist/assets/bind-account-BuyNwLS8.js +1 -0
  20. package/dist/assets/{branding-BlPEgtEP.js → branding-DHx48Ao4.js} +5 -5
  21. package/dist/assets/{branding-BFbTimgS.js → branding-DVFAqoqm.js} +2 -2
  22. package/dist/assets/branding-gAoM7Sxs.js +1 -0
  23. package/dist/assets/{bundle-avatar-BW3kxeeK.js → bundle-avatar-CnFjpDpd.js} +1 -1
  24. package/dist/assets/button-C06QLpHi.js +1 -0
  25. package/dist/assets/{click-to-copy-Dex2pQN3.js → click-to-copy-BoDdgn8d.js} +1 -1
  26. package/dist/assets/{cloneDeep-MYrdBNTW.js → cloneDeep-CaHOi9J1.js} +1 -1
  27. package/dist/assets/{collapse-BeOhBsBA.js → collapse-8NywKzkD.js} +1 -1
  28. package/dist/assets/{complete-pEetXGz2.js → complete-CoxxHtya.js} +2 -2
  29. package/dist/assets/{component-Bgo6eiyE.js → component-DFxWQ53_.js} +3 -3
  30. package/dist/assets/{config-DUgUooD7.js → config-9AzYOFjl.js} +1 -1
  31. package/dist/assets/{config-B_hp0NmN.js → config-FlWkcnSQ.js} +4 -4
  32. package/dist/assets/{config-_-EQ0Epw.js → config-Z0lZ_fIF.js} +2 -2
  33. package/dist/assets/{config-navigation-sV4EbIjT.js → config-navigation-BeyD50oL.js} +9 -9
  34. package/dist/assets/{config-space-XgrkTVb_.js → config-space-B5AcrZrr.js} +1 -1
  35. package/dist/assets/confirm-BCIsFO05.js +7 -0
  36. package/dist/assets/{connect-Bo7X4WRA.js → connect-BHVbShaf.js} +1 -1
  37. package/dist/assets/{connect-BcuVDRIg.js → connect-t0Kr-SCs.js} +1 -1
  38. package/dist/assets/connect-to-vpq5qHgA.js +1 -0
  39. package/dist/assets/{content-layout-D0HgAWIj.js → content-layout-C8_nylvn.js} +1 -1
  40. package/dist/assets/createClass-C3vKjEY6.js +1 -0
  41. package/dist/assets/{dashboard-DVufxMME.js → dashboard-BYloJNzh.js} +3 -3
  42. package/dist/assets/{delete-confirm-FEUxkG43.js → delete-confirm-DYLVkKGU.js} +1 -1
  43. package/dist/assets/{did-address-BsD0Ja6f.js → did-address-DIgY8RPi.js} +1 -1
  44. package/dist/assets/{domain-BI8RdK7S.js → domain-CG4Pvgwf.js} +1 -1
  45. package/dist/assets/{domain-action-card-CyD3YPhU.js → domain-action-card-tBq1nB0K.js} +2 -2
  46. package/dist/assets/domains-AuK4HL7x.js +1 -0
  47. package/dist/assets/{email-WV1LA3l2.js → email-BYwhwWfZ.js} +3 -3
  48. package/dist/assets/{empty-spinner-yPLwfnik.js → empty-spinner-8MrwYy6o.js} +1 -1
  49. package/dist/assets/engine-CBHSi_C7.js +1 -0
  50. package/dist/assets/{exchange-passport-DnShCQU6.js → exchange-passport-BbMcWacf.js} +1 -1
  51. package/dist/assets/{form-CCBOl2QK.js → form-BL7Qaoye.js} +2 -2
  52. package/dist/assets/{form-text-input-DiBXmKHH.js → form-text-input-D4FuGnj9.js} +1 -1
  53. package/dist/assets/{form-wrapper-O5HR5g9j.js → form-wrapper-CyRbKpkJ.js} +1 -1
  54. package/dist/assets/{fuel-3tynLMF6.js → fuel-DSiGvW6j.js} +1 -1
  55. package/dist/assets/gen-access-key-CAbKVCsh.js +1 -0
  56. package/dist/assets/gen-simple-access-key-C4I7qLvK.js +1 -0
  57. package/dist/assets/get-safe-url-BpKuBIOs.js +1 -0
  58. package/dist/assets/hdkey-xzNoWg19.js +62 -0
  59. package/dist/assets/{home-CVhKAX1W.js → home-BK07LbAB.js} +1 -1
  60. package/dist/assets/iframe-BfG-m6vp.js +1 -0
  61. package/dist/assets/index-76cnX1rM.js +1027 -0
  62. package/dist/assets/{index-BZl53MLv.js → index-B4GUFxTb.js} +1 -1
  63. package/dist/assets/index-B8uTHiK_.js +271 -0
  64. package/dist/assets/{index-BKGX_rib.js → index-BYrTg1nU.js} +1 -1
  65. package/dist/assets/{index-C9gLts8j.js → index-BafKBvSo.js} +1 -1
  66. package/dist/assets/{index-x4EbwKKT.js → index-BbwCb-a4.js} +1 -1
  67. package/dist/assets/{index-BaBstino.js → index-BhmjxLth.js} +8 -8
  68. package/dist/assets/{index-Dmx5B0nd.js → index-BklNyXhF.js} +1 -1
  69. package/dist/assets/index-CM7xlUUB.js +1 -0
  70. package/dist/assets/{index-Dn5r8b31.js → index-CQI6xU1T.js} +12 -12
  71. package/dist/assets/{index-B6yvt28b.js → index-CYtRCAE4.js} +1 -1
  72. package/dist/assets/{index-CEomSqzf.js → index-Ch35mI2K.js} +1 -1
  73. package/dist/assets/{index-CNDQB5ss.js → index-ClrTHIwE.js} +2 -2
  74. package/dist/assets/index-CmVBHGF4.js +1 -0
  75. package/dist/assets/index-CsQzavE6.js +113 -0
  76. package/dist/assets/{index-CnSSStmX.js → index-D5gmkKds.js} +1 -1
  77. package/dist/assets/{index-BFjzQ59j.js → index-DERRGpCu.js} +2 -2
  78. package/dist/assets/{index-GKGJR9QG.js → index-DTsM42Id.js} +1 -1
  79. package/dist/assets/{index-Dplza4RE.js → index-DiQSmD0V.js} +5 -5
  80. package/dist/assets/index-Dmo2B1Mi.js +1 -0
  81. package/dist/assets/{index-BJUlLPmz.js → index-DotBGgGh.js} +1 -1
  82. package/dist/assets/{index-nD2momWN.js → index-DwgQRVxq.js} +1 -1
  83. package/dist/assets/{index-Cgd5ilob.js → index-DydCTQwc.js} +5 -5
  84. package/dist/assets/{index-D5hnouQx.js → index-DytFyFyX.js} +1 -1
  85. package/dist/assets/index-FqNrJsto.js +30 -0
  86. package/dist/assets/{index-DK5WDEEB.js → index-bMqkP3o8.js} +5 -5
  87. package/dist/assets/index-fLIHlWYe.js +55 -0
  88. package/dist/assets/index-kOWuhDk_.js +7 -0
  89. package/dist/assets/{index-BcqwvXCM.js → index-v6G9beJi.js} +4 -4
  90. package/dist/assets/{index-DTtqYivl.js → index-xFc1EnVb.js} +14 -14
  91. package/dist/assets/{invitation-BiwN2VrD.js → invitation-BXIvpB2I.js} +3 -3
  92. package/dist/assets/{invite-sG9nrx1v.js → invite-DmiHASAp.js} +1 -1
  93. package/dist/assets/{isURL-CUg0M0vI.js → isURL-CoDhaDcU.js} +2 -2
  94. package/dist/assets/{issue-passport-B6dZ_6Cz.js → issue-passport-8aESSpdE.js} +1 -1
  95. package/dist/assets/{item-Ce1sOOzq.js → item-sXcqafa_.js} +1 -1
  96. package/dist/assets/{landing-page-B51Yq79L.js → landing-page-CNcFpjZt.js} +1 -1
  97. package/dist/assets/{launch-result-message-DsDtH4O2.js → launch-result-message-CYwb6iA9.js} +1 -1
  98. package/dist/assets/{layout-BqA0nwyI.js → layout-DVgi_qwH.js} +1 -1
  99. package/dist/assets/list-CWvTOTs_.js +4 -0
  100. package/dist/assets/list-CoQQ0tVM.js +103 -0
  101. package/dist/assets/{list-header-zq8j7UNX.js → list-header-DdgW2mjM.js} +1 -1
  102. package/dist/assets/localization-RDdOhnNh.js +1 -0
  103. package/dist/assets/{log-CZVtlyyy.js → log-DfGl115l.js} +1 -1
  104. package/dist/assets/logger-CS1-keNf.js +1 -0
  105. package/dist/assets/login-Bzjbm_QW.js +1 -0
  106. package/dist/assets/{login-oauth-callback-CZEaxrWW.js → login-oauth-callback-CoSDK-N4.js} +1 -1
  107. package/dist/assets/{logo-uploader-DRdS0jgO.js → logo-uploader-DBH_onEh.js} +2 -2
  108. package/dist/assets/{lost-passport-CYIc-KaX.js → lost-passport-m2bIMpzG.js} +2 -2
  109. package/dist/assets/{observability-DjWNOFAW.js → observability-4ZKd3ESd.js} +1 -1
  110. package/dist/assets/{omit-BtX_IVuT.js → omit-CDaIJZJa.js} +1 -1
  111. package/dist/assets/{open-window-CS9iPYFz.js → open-window-BgNjwEUp.js} +1 -1
  112. package/dist/assets/{over-due-invoice-payment-Ds6p85Jz.js → over-due-invoice-payment-BF34HWd6.js} +1 -1
  113. package/dist/assets/{overview-CHSartaV.js → overview-DP_xeRVf.js} +2 -2
  114. package/dist/assets/{page-header-BBG13dwv.js → page-header-CyNE6Ofr.js} +1 -1
  115. package/dist/assets/passport-item-DeYT6d6I.js +1 -0
  116. package/dist/assets/{permission-DUZq76k-.js → permission-CskIWHP7.js} +1 -1
  117. package/dist/assets/{playground-l0kCaheU.js → playground-DeasY3DH.js} +1 -1
  118. package/dist/assets/preferences-DqP95Qdx.js +1 -0
  119. package/dist/assets/profile-embed-BuHEG0_z.js +1 -0
  120. package/dist/assets/publish-resource-DTaaFKoM.js +1 -0
  121. package/dist/assets/{react-beautiful-dnd.esm-fd7f1edT.js → react-beautiful-dnd.esm-DlUpjMak.js} +1 -1
  122. package/dist/assets/{react-stripe.esm-dYmFOSpC.js → react-stripe.esm-CvJuW6o6.js} +1 -1
  123. package/dist/assets/{required-DVwsbGXM.js → required-McYgDRcp.js} +1 -1
  124. package/dist/assets/runtime-jctwJS3B.js +1 -0
  125. package/dist/assets/{sanitize-CQihkQWa.js → sanitize-DtiBKDHb.js} +1 -1
  126. package/dist/assets/sdk-BwLYswB1.js +1 -0
  127. package/dist/assets/{section-DLZZkYEF.js → section-DSgkHUgY.js} +1 -1
  128. package/dist/assets/{security-OOMvokDG.js → security-COkH04W0.js} +3 -3
  129. package/dist/assets/session-DjNgTb0E.js +1 -0
  130. package/dist/assets/{setup-FIguiM7u.js → setup-CvtgqqvX.js} +1 -1
  131. package/dist/assets/{shorten-label-DULtT2aw.js → shorten-label-CphpNRtN.js} +1 -1
  132. package/dist/assets/{simple-select-z4kANmJU.js → simple-select-B6PbGWwo.js} +1 -1
  133. package/dist/assets/{spaces-DS5mDb6g.js → spaces-C6y9gYOt.js} +1 -1
  134. package/dist/assets/{start-BPPbKY2q.js → start-FCzRbcEJ.js} +1 -1
  135. package/dist/assets/{starting-progress-D36m0Jur.js → starting-progress-BrATamLt.js} +1 -1
  136. package/dist/assets/status-0NE7x2VB.js +1 -0
  137. package/dist/assets/{step-actions-BCMkiBJt.js → step-actions-2WqCN3oE.js} +1 -1
  138. package/dist/assets/{studio-BaKQrp69.js → studio-Dmxj3k9Y.js} +1 -1
  139. package/dist/assets/{switch-control-Bg_4ck4-.js → switch-control-BBfIxRXQ.js} +1 -1
  140. package/dist/assets/{table-tips-OHHAUf8b.js → table-tips-l92NoidG.js} +1 -1
  141. package/dist/assets/team-BMcH79D_.js +146 -0
  142. package/dist/assets/traffic-BFbGUTqB.js +1 -0
  143. package/dist/assets/{transfer-BkpY83Tu.js → transfer-Qt1n41TU.js} +1 -1
  144. package/dist/assets/{unsubscribe-DqQrZxDL.js → unsubscribe-CYaiLf3M.js} +1 -1
  145. package/dist/assets/{use-app-logo-BZP6g7du.js → use-app-logo-BxJ8CI-y.js} +1 -1
  146. package/dist/assets/{use-mobile-BhjEPXJE.js → use-mobile-BTugf2DR.js} +1 -1
  147. package/dist/assets/{use-mobile-Cw5yCFNi.js → use-mobile-BjYFyM2N.js} +1 -1
  148. package/dist/assets/{use-server-logo-D9Pt2agw.js → use-server-logo-B7LbKzj5.js} +1 -1
  149. package/dist/assets/{use-window-close-pLTUeUwV.js → use-window-close-CEQ6W4g4.js} +1 -1
  150. package/dist/assets/{useAsync-CFjPtTuV.js → useAsync-Bsct3MrV.js} +1 -1
  151. package/dist/assets/{useAsync-BPJmKcmr.js → useAsync-DTyhj7ow.js} +1 -1
  152. package/dist/assets/{useAsyncRetry-CmiuEIXq.js → useAsyncRetry-CY5KxYnR.js} +1 -1
  153. package/dist/assets/useLocalStorage-BtwoYumV.js +1 -0
  154. package/dist/assets/user-center-ChZNFNDS.js +126 -0
  155. package/dist/assets/user-follower-BQByc9hD.js +32 -0
  156. package/dist/assets/user-sessions-DuzTtEb_.js +1 -0
  157. package/dist/assets/{util-DiR6CGkl.js → util-B4gLWAg3.js} +1 -1
  158. package/dist/assets/{util-BY4Jjo2q.js → util-CykZsp5v.js} +1 -1
  159. package/dist/assets/{vendor-arcblock-Basg90AF.js → vendor-arcblock-2wJSDChZ.js} +139 -138
  160. package/dist/assets/{vendor-hooks-XYaYmqUz.js → vendor-hooks-Clg_9bzt.js} +1 -1
  161. package/dist/assets/{vendor-mui-core-D1KE_LWA.js → vendor-mui-core-BkVXEDpj.js} +1 -1
  162. package/dist/assets/{vendor-mui-x-35VYXdLE.js → vendor-mui-x-DiiSwpci.js} +1 -1
  163. package/dist/assets/{vendor-utils-D9t34RpH.js → vendor-utils-RRCPRD-7.js} +1 -1
  164. package/dist/assets/{vendor-ux-JJc9HQAK.js → vendor-ux-Cm4oSE3n.js} +131 -131
  165. package/dist/assets/{wait-connect-BDvg0APV.js → wait-connect-iy3js_Il.js} +1 -1
  166. package/dist/assets/{wizard-C18vdEjN.js → wizard-CjrxVVuX.js} +1 -1
  167. package/dist/assets/{wizard-components-D34u1nDC.js → wizard-components-DMXOIlUu.js} +3 -3
  168. package/dist/assets/{wrap-locale-DHRmq-M6.js → wrap-locale-DOQKQj35.js} +1 -1
  169. package/dist/assets/{zh-CIBse7Eg.js → zh-DygCEiCy.js} +1 -1
  170. package/dist/index.html +6 -6
  171. package/dist/service-worker.js +1 -1
  172. package/package.json +32 -32
  173. package/dist/assets/add-resource-CeL9CGw6.js +0 -1
  174. package/dist/assets/api-D0WTSMt7.js +0 -1
  175. package/dist/assets/authorize-BpAEdQbB.js +0 -1
  176. package/dist/assets/base32-BM0EGG_G.js +0 -1
  177. package/dist/assets/bind-account-0FusXwpG.js +0 -1
  178. package/dist/assets/branding-BwLq7zvy.js +0 -1
  179. package/dist/assets/button-BXmlC7LN.js +0 -1
  180. package/dist/assets/confirm-CQUC-h9X.js +0 -7
  181. package/dist/assets/connect-to-BOwPSqv_.js +0 -1
  182. package/dist/assets/createClass-BM_-4dO_.js +0 -1
  183. package/dist/assets/domains-BaakWyOu.js +0 -1
  184. package/dist/assets/engine-DqjrYbXf.js +0 -1
  185. package/dist/assets/gen-access-key-CO4-WBwG.js +0 -1
  186. package/dist/assets/gen-simple-access-key-BLU1CQqE.js +0 -1
  187. package/dist/assets/get-safe-url-C1cM9KQQ.js +0 -1
  188. package/dist/assets/iframe-D4EArqkC.js +0 -1
  189. package/dist/assets/index-4AgxfqNl.js +0 -1
  190. package/dist/assets/index-BKgMC01o.js +0 -55
  191. package/dist/assets/index-BzBCYs57.js +0 -271
  192. package/dist/assets/index-BzSejp52.js +0 -113
  193. package/dist/assets/index-CH24MDrX.js +0 -1
  194. package/dist/assets/index-CQnNYj8j.js +0 -62
  195. package/dist/assets/index-DlGDk6f1.js +0 -1
  196. package/dist/assets/index-Dl_mo6VP.js +0 -7
  197. package/dist/assets/index-MzaNcHRo.js +0 -1025
  198. package/dist/assets/index-VC2a5OwI.js +0 -29
  199. package/dist/assets/list-DDPm3xxE.js +0 -2
  200. package/dist/assets/list-DrfXTBKV.js +0 -103
  201. package/dist/assets/localization-yFQNsuN6.js +0 -1
  202. package/dist/assets/logger-Bc_B4ezh.js +0 -1
  203. package/dist/assets/login-CEifKwb3.js +0 -1
  204. package/dist/assets/passport-item-DJbWiXVs.js +0 -1
  205. package/dist/assets/preferences-By_IlOup.js +0 -1
  206. package/dist/assets/profile-embed-CCG9G7wc.js +0 -1
  207. package/dist/assets/publish-resource-s02z2MdL.js +0 -1
  208. package/dist/assets/runtime-DbB-M2o6.js +0 -1
  209. package/dist/assets/sdk-Ol9MhIA2.js +0 -1
  210. package/dist/assets/session-DGSuFVuR.js +0 -1
  211. package/dist/assets/status-DXtPmlwi.js +0 -1
  212. package/dist/assets/team-BmLR1DD5.js +0 -146
  213. package/dist/assets/traffic-BM5HlXo3.js +0 -1
  214. package/dist/assets/useLocalStorage-Cgk_vZIQ.js +0 -1
  215. package/dist/assets/user-center-DsKLVInJ.js +0 -126
  216. package/dist/assets/user-follower-BBKilW4B.js +0 -32
  217. package/dist/assets/user-sessions-BiY051eM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,y as St,bb as Re,M as ae,ak as f,Q as q,W as p,J as xe,c0 as Pt,I as N,aN as Rt,T as I,aj as It,b5 as Be,P as We,b6 as X,a5 as Oe,z as Ze,A as Qe,cm as Tt,bf as At,U as Ce,da as Mt,db as zt,at as te,dc as Et,a6 as Y,n as le,D as Lt,dd as Bt,ar as De,b1 as Ie,de as Wt,aX as Ot,ai as Dt,am as J,bp as Nt,bq as ve,a$ as $t,cV as Ut}from"./vendor-mui-core-D1KE_LWA.js";import{r as b,a as Ft,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Ht,a9 as Gt,R as Ne,D as Kt,C as ce,n as V,A as Vt}from"./vendor-utils-D9t34RpH.js";import{a as Yt,G as Zt,bw as Qt,c as Te,d as Xt,X as Jt,bx as er,aW as Ae,V as fe,bc as tr,by as rr,a4 as nr,aY as or,a5 as sr,bz as ir}from"./index-MzaNcHRo.js";import{a as T,h as Je,k as re,g as H,b as E,j as ar}from"./vendor-hooks-XYaYmqUz.js";import{l as et}from"./arrow-down.svg-BiYMv82Y.js";import{c as Me,O as D,T as O,aw as lr,p as tt,ax as cr,H as _,ay as dr,az as ur,aA as $e,f as pr,n as rt,e as ze,aB as xr,aC as M,B as fr,A as hr,$ as nt,aD as gr,aE as mr,x as br,o as de,G as Ue,P as yr}from"./vendor-ux-JJc9HQAK.js";import{N as vr}from"./list-DrfXTBKV.js";import{d as wr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-BW3kxeeK.js";import{h as _e,T as jr}from"./team-BmLR1DD5.js";import{b as Cr,d as kr,a as Sr,c as Pr,e as Rr,f as Ir,h as Tr,_ as Ar}from"./user-center-DsKLVInJ.js";import{N as ot,U as st}from"./index-B6yvt28b.js";import{u as Z}from"./use-mobile-Cw5yCFNi.js";import Mr from"./index-4AgxfqNl.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as ke}from"./index-D5hnouQx.js";import{U as we}from"./user-sessions-BiY051eM.js";import zr from"./index-Cgd5ilob.js";import{o as Er}from"./vendor-arcblock-Basg90AF.js";import{c as Lr,b as ue,a as Br,S as Wr}from"./index-VC2a5OwI.js";import"./index-BJUlLPmz.js";import"./index-BojVbZw0.js";import{U as Or}from"./user-follower-BBKilW4B.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BZl53MLv.js";import"./util-BY4Jjo2q.js";import"./base32-BM0EGG_G.js";import"./session-DGSuFVuR.js";import"./isURL-CUg0M0vI.js";import"./use-app-logo-BZP6g7du.js";import"./index-BcqwvXCM.js";import"./api-D0WTSMt7.js";import"./table-tips-OHHAUf8b.js";import"./use-mobile-BhjEPXJE.js";import"./passport-item-DJbWiXVs.js";import"./did-address-BsD0Ja6f.js";import"./index-x4EbwKKT.js";import"./vendor-mui-x-35VYXdLE.js";import"./AdapterDayjs-CsjxEemY.js";import"./confirm-CQUC-h9X.js";import"./click-to-copy-Dex2pQN3.js";import"./delete-confirm-FEUxkG43.js";import"./permission-DUZq76k-.js";import"./actions-BEg2ZR9n.js";import"./index-DRYJ0xIl.js";function Dr(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let a=JSON.stringify({rootMargin:n,threshold:l}),d=i.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(x=>{x.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(a,d)}return{observe:(r,x)=>{d.entryCallbacks.set(r,x),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:s}}var Nr="0px",$r=[0],Ur=Dr();function Fr(t){let s=t?.rootMargin??Nr,o=t?.threshold??$r,n=b.useRef(null),l=b.useRef(null),i=b.useRef(null),[a,d]=b.useState(),r=b.useCallback(()=>{let C=n.current;if(!C){d(void 0);return}let v=Ur.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,c=>{d(c)}),i.current=v},[s,o]),x=b.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=b.useCallback(C=>{x(),n.current=C,r()},[r,x]),h=b.useCallback(C=>{x(),l.current=C,r()},[r,x]);return[m,{entry:a,rootRef:h}]}var _r=Fr;function qr(t){let[s,o]=_r(t),n=!!o.entry?.isIntersecting,[l,i]=b.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Hr=qr,Gr=100;function Kr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=Gr}){let a=b.useRef(o),[d,{rootRef:r,isVisible:x}]=Hr({rootMargin:n});b.useEffect(()=>{a.current=o},[o]);let m=!l&&!t&&x&&s;return b.useEffect(()=>{if(m){let h=setTimeout(()=>{a.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[d,{rootRef:r}]}var Vr=Kr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function pe({severity:t,size:s=8}){return je[t]?e.jsx(f,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}it.propTypes={theme:p.string,type:p.oneOf(["button","line","select"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function it({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...a}){const{t:d}=b.useContext(Me),r=[{label:d("notification.allSeverity"),value:""},{label:d("notification.severityType.info"),value:"info"},{label:d("notification.severityType.success"),value:"success"},{label:d("notification.severityType.warning"),value:"warning"},{label:d("notification.severityType.error"),value:"error"}],x=g=>{(g!==l||!i)&&o(g)},m=b.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,S,R)=>e.jsx(q,{disabled:i,onClick:()=>x(g.value),className:`profile-button ${S?"active":""}`,...a,children:g.label},g.value||R),C=(g,S,R)=>e.jsx(q,{variant:"text",disabled:i,onClick:()=>x(g.value),className:`profile-line-button ${S?"active":""}`,...a,children:g.label},g.value||R),v=()=>r?.map((g,S)=>{const R=l===g?.value;return s==="line"?e.jsx(b.Fragment,{children:C(g,R,S)},g.value||S):e.jsx(b.Fragment,{children:h(g,R,S)},g.value||S)}),c=g=>{const{value:S}=g.target;x(S==="all"?"":S)};return s==="select"?e.jsx(St,{sx:{maxWidth:300},children:e.jsx(Re,{value:l||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(et,{...g,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((g,S)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(f,{className:"severity-tabs",sx:m,children:[e.jsx(f,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}at.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function at({loading:t,paging:s,onChange:o}){const{t:n}=b.useContext(Me),l=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,x)=>{o({page:x+1})},a=r=>{const x=Number(r.target.value);o({page:1,pageSize:x})},d=s.page-1<=0?0:s.page-1;return e.jsx(f,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Pt,{component:"div",disabled:t,count:s.total,page:d,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:x,count:m})=>`${r}–${x} / ${m!==-1?m:`${n()}more than ${x}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:a})})}const Yr=b.memo(at),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"/>'},qe=6,He={"& .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}},Qr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ge=()=>({...Qr,width:"calc(50% - 8px)"});lt.propTypes={loading:p.bool,type:p.oneOf(["server","service"]),onFilterChange:p.func,blockletMap:p.object,filterType:p.oneOf(["component","entity"]),selectedId:p.array,severity:p.array,enableMarkAllAsRead:p.bool,unReadCount:p.number,onReadFilterChange:p.func,currentReadFilter:p.string};function lt({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:x=()=>{},currentReadFilter:m="all"}){const{t:h}=b.useContext(Me),[C,v]=b.useState(null),c=!!C,[g,S]=b.useState(i),[R,P]=b.useState(a),[y,z]=b.useState(!1),[L,U]=b.useState(""),[j,k]=b.useState([]);b.useEffect(()=>{S(i),P(a)},[i,a]);const B=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=u=>{(u!==m||!s)&&x(u)},Q=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=u=>{v(u.currentTarget),U(""),z(!1)},ge=()=>{v(null)},oe=u=>{const w=g.includes(u)?g.filter(A=>A!==u):[...g,u];S(w),t({id:w,severity:R})},se=u=>{const w=R.includes(u)?R.filter(A=>A!==u):[...R,u];P(w),t({severity:w,id:g})},me=u=>{U(u.target.value)},be=()=>{z(!y)},K=Ft.useMemo(()=>{if(!n.size)return[];const u=[];return l==="component"&&u.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,W=w.title||w.meta?.title||"",F=w.appPid||w.appDid;(l==="component"&&F!==A||l==="entity"&&F===A)&&u.push({label:W,id:A,blocklet:w,ancestors:w.ancestors})}),u},[n,l,h]);b.useEffect(()=>{if(L.trim()==="")k(K);else{const u=L.toLowerCase(),w=K.filter(A=>A.label.toLowerCase().includes(u));k(w)}},[L,K]);const ye=L.trim()!==""||y?j:j.slice(0,qe);return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(f,{sx:{display:"flex",gap:1.5},children:B.map(u=>e.jsxs(q,{disabled:s,onClick:()=>G(u.value),className:`profile-button ${m===u.value?"active":""}`,sx:{...o==="service"&&m===u.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===u.value?"bold":"normal"},children:[u.label,u.value==="unread"&&r>0&&` (${r})`]},u.value))}),e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(N,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(D,{icon:Zr,hFlip:!0})}),e.jsx(Rt,{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(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(f,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(q,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(It,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(f,{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:Q.map(u=>e.jsx(We,{elevation:0,sx:Ge(R.includes(u.value)),children:e.jsx(X,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...He},control:e.jsx(Oe,{checked:R.includes(u.value),onChange:()=>se(u.value),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:u.value}),u.label]})})},u.value))})}),e.jsxs(f,{sx:{mb:2},children:[e.jsxs(f,{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:h("notification.from")}),e.jsx(f,{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(Qe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(D,{icon:wr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(u=>e.jsx(We,{elevation:0,sx:Ge(g.includes(u.id)),children:e.jsx(X,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...He},control:e.jsx(Oe,{checked:g.includes(u.id),onChange:()=>oe(u.id),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[u.blocklet&&e.jsx(Fe,{size:20,blocklet:u.blocklet,ancestors:u.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:u.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:u.label})]})})},u.id))}),j.length>qe&&L.trim()===""&&e.jsx(q,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:y?e.jsx(Tt,{}):e.jsx(At,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(f,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(u=>{const w=Q.find(A=>A.value===u);return e.jsx(Ce,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:u}),w?w.label:u]}),onDelete:()=>se(u),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${u}`)}),g.map(u=>{const w=K.find(A=>A.id===u);return e.jsx(Ce,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Fe,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:u]}),variant:"outlined",onDelete:()=>oe(u),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${u}`)})]}):null]})}const Xr=te(Et)`
1
+ import{j as e,y as St,bb as Re,M as ae,ak as x,Q as q,W as p,J as fe,c0 as Pt,I as N,aN as Rt,T as I,aj as It,b5 as Be,P as We,b6 as J,a5 as Oe,z as Ze,A as Qe,cm as Tt,bf as At,U as Ce,d8 as Mt,d9 as zt,at as te,da as Et,a6 as Y,n as le,D as Lt,db as Bt,ar as De,b1 as Ie,dc as Wt,aX as Ot,ai as Dt,am as X,bp as Nt,bq as ve,a$ as $t,cV as Ut}from"./vendor-mui-core-BkVXEDpj.js";import{r as b,a as Ft,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Je,Z as Ht,a7 as Gt,R as Ne,D as Kt,C as ce,n as V,A as Vt}from"./vendor-utils-RRCPRD-7.js";import{a as Yt,G as Zt,bw as Qt,c as Te,d as Jt,Y as Xt,bx as er,aZ as Ae,W as xe,bh as tr,by as rr,a5 as nr,a$ as or,a6 as sr,bz as ir}from"./index-76cnX1rM.js";import{a as T,h as Xe,k as re,g as H,b as E,j as ar}from"./vendor-hooks-Clg_9bzt.js";import{l as et}from"./arrow-down.svg-B5veoO0J.js";import{G as Me,ab as D,T as O,aM as lr,O as tt,aN as cr,H as _,aO as dr,aP as ur,aQ as $e,J as pr,D as rt,I as ze,aR as fr,aS as M,a2 as xr,a1 as hr,$ as nt,aT as gr,aU as mr,a0 as br,C as de,a6 as Ue,ac as yr}from"./vendor-ux-Cm4oSE3n.js";import{N as vr}from"./list-CoQQ0tVM.js";import{d as wr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-CnFjpDpd.js";import{h as _e,T as jr}from"./team-BMcH79D_.js";import{b as Cr,d as kr,a as Sr,c as Pr,e as Rr,f as Ir,h as Tr,_ as Ar}from"./user-center-ChZNFNDS.js";import{N as ot,U as st}from"./index-CYtRCAE4.js";import{u as Z}from"./use-mobile-BjYFyM2N.js";import Mr from"./index-Dmo2B1Mi.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as ke}from"./index-DytFyFyX.js";import{U as we}from"./user-sessions-DuzTtEb_.js";import zr from"./index-DydCTQwc.js";import{o as Er}from"./vendor-arcblock-2wJSDChZ.js";import{c as Lr,b as ue,a as Br,S as Wr}from"./index-FqNrJsto.js";import"./index-DotBGgGh.js";import"./index-BojVbZw0.js";import{U as Or}from"./user-follower-BQByc9hD.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-B4GUFxTb.js";import"./util-CykZsp5v.js";import"./base32-BJKRqMID.js";import"./session-DjNgTb0E.js";import"./isURL-CoDhaDcU.js";import"./use-app-logo-BxJ8CI-y.js";import"./index-v6G9beJi.js";import"./api-Cyp6JVXh.js";import"./table-tips-l92NoidG.js";import"./use-mobile-BTugf2DR.js";import"./passport-item-DeYT6d6I.js";import"./did-address-DIgY8RPi.js";import"./index-BbwCb-a4.js";import"./vendor-mui-x-DiiSwpci.js";import"./AdapterDayjs-DV5yorPZ.js";import"./confirm-BCIsFO05.js";import"./click-to-copy-BoDdgn8d.js";import"./delete-confirm-DYLVkKGU.js";import"./permission-CskIWHP7.js";import"./actions-DAS8NTxZ.js";import"./index-DRYJ0xIl.js";function Dr(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let a=JSON.stringify({rootMargin:n,threshold:l}),d=i.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(f=>{f.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(a,d)}return{observe:(r,f)=>{d.entryCallbacks.set(r,f),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:s}}var Nr="0px",$r=[0],Ur=Dr();function Fr(t){let s=t?.rootMargin??Nr,o=t?.threshold??$r,n=b.useRef(null),l=b.useRef(null),i=b.useRef(null),[a,d]=b.useState(),r=b.useCallback(()=>{let C=n.current;if(!C){d(void 0);return}let v=Ur.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,c=>{d(c)}),i.current=v},[s,o]),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]),h=b.useCallback(C=>{f(),l.current=C,r()},[r,f]);return[m,{entry:a,rootRef:h}]}var _r=Fr;function qr(t){let[s,o]=_r(t),n=!!o.entry?.isIntersecting,[l,i]=b.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Hr=qr,Gr=100;function Kr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=Gr}){let a=b.useRef(o),[d,{rootRef:r,isVisible:f}]=Hr({rootMargin:n});b.useEffect(()=>{a.current=o},[o]);let m=!l&&!t&&f&&s;return b.useEffect(()=>{if(m){let h=setTimeout(()=>{a.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[d,{rootRef:r}]}var Vr=Kr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function pe({severity:t,size:s=8}){return je[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}it.propTypes={theme:p.string,type:p.oneOf(["button","line","select"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function it({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...a}){const{t:d}=b.useContext(Me),r=[{label:d("notification.allSeverity"),value:""},{label:d("notification.severityType.info"),value:"info"},{label:d("notification.severityType.success"),value:"success"},{label:d("notification.severityType.warning"),value:"warning"},{label:d("notification.severityType.error"),value:"error"}],f=g=>{(g!==l||!i)&&o(g)},m=b.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,S,R)=>e.jsx(q,{disabled:i,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...a,children:g.label},g.value||R),C=(g,S,R)=>e.jsx(q,{variant:"text",disabled:i,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...a,children:g.label},g.value||R),v=()=>r?.map((g,S)=>{const R=l===g?.value;return s==="line"?e.jsx(b.Fragment,{children:C(g,R,S)},g.value||S):e.jsx(b.Fragment,{children:h(g,R,S)},g.value||S)}),c=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return s==="select"?e.jsx(St,{sx:{maxWidth:300},children:e.jsx(Re,{value:l||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(et,{...g,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((g,S)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:m,children:[e.jsx(x,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}at.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function at({loading:t,paging:s,onChange:o}){const{t:n}=b.useContext(Me),l=fe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,f)=>{o({page:f+1})},a=r=>{const f=Number(r.target.value);o({page:1,pageSize:f})},d=s.page-1<=0?0:s.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Pt,{component:"div",disabled:t,count:s.total,page:d,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:s.pageSize,onPageChange:i,onRowsPerPageChange:a})})}const Yr=b.memo(at),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"/>'},qe=6,He={"& .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}},Qr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ge=()=>({...Qr,width:"calc(50% - 8px)"});lt.propTypes={loading:p.bool,type:p.oneOf(["server","service"]),onFilterChange:p.func,blockletMap:p.object,filterType:p.oneOf(["component","entity"]),selectedId:p.array,severity:p.array,enableMarkAllAsRead:p.bool,unReadCount:p.number,onReadFilterChange:p.func,currentReadFilter:p.string};function lt({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:m="all"}){const{t:h}=b.useContext(Me),[C,v]=b.useState(null),c=!!C,[g,S]=b.useState(i),[R,P]=b.useState(a),[y,z]=b.useState(!1),[L,U]=b.useState(""),[j,k]=b.useState([]);b.useEffect(()=>{S(i),P(a)},[i,a]);const B=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=u=>{(u!==m||!s)&&f(u)},Q=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=u=>{v(u.currentTarget),U(""),z(!1)},ge=()=>{v(null)},oe=u=>{const w=g.includes(u)?g.filter(A=>A!==u):[...g,u];S(w),t({id:w,severity:R})},se=u=>{const w=R.includes(u)?R.filter(A=>A!==u):[...R,u];P(w),t({severity:w,id:g})},me=u=>{U(u.target.value)},be=()=>{z(!y)},K=Ft.useMemo(()=>{if(!n.size)return[];const u=[];return l==="component"&&u.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,W=w.title||w.meta?.title||"",F=w.appPid||w.appDid;(l==="component"&&F!==A||l==="entity"&&F===A)&&u.push({label:W,id:A,blocklet:w,ancestors:w.ancestors})}),u},[n,l,h]);b.useEffect(()=>{if(L.trim()==="")k(K);else{const u=L.toLowerCase(),w=K.filter(A=>A.label.toLowerCase().includes(u));k(w)}},[L,K]);const ye=L.trim()!==""||y?j:j.slice(0,qe);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:B.map(u=>e.jsxs(q,{disabled:s,onClick:()=>G(u.value),className:`profile-button ${m===u.value?"active":""}`,sx:{...o==="service"&&m===u.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===u.value?"bold":"normal"},children:[u.label,u.value==="unread"&&r>0&&` (${r})`]},u.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(N,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(D,{icon:Zr,hFlip:!0})}),e.jsx(Rt,{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:h("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(q,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(It,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("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:Q.map(u=>e.jsx(We,{elevation:0,sx:Ge(R.includes(u.value)),children:e.jsx(J,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...He},control:e.jsx(Oe,{checked:R.includes(u.value),onChange:()=>se(u.value),disabled:s,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:u.value}),u.label]})})},u.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:h("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(Qe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(D,{icon:wr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(u=>e.jsx(We,{elevation:0,sx:Ge(g.includes(u.id)),children:e.jsx(J,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...He},control:e.jsx(Oe,{checked:g.includes(u.id),onChange:()=>oe(u.id),disabled:s,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[u.blocklet&&e.jsx(Fe,{size:20,blocklet:u.blocklet,ancestors:u.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:u.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:u.label})]})})},u.id))}),j.length>qe&&L.trim()===""&&e.jsx(q,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:y?e.jsx(Tt,{}):e.jsx(At,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(u=>{const w=Q.find(A=>A.value===u);return e.jsx(Ce,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:u}),w?w.label:u]}),onDelete:()=>se(u),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${u}`)}),g.map(u=>{const w=K.find(A=>A.id===u);return e.jsx(Ce,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Fe,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:u]}),variant:"outlined",onDelete:()=>oe(u),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${u}`)})]}):null]})}const Jr=te(Et)`
2
2
  position: fixed;
3
3
  bottom: 20px;
4
4
  right: 20px;
@@ -8,7 +8,7 @@ import{j as e,y as St,bb as Re,M as ae,ak as f,Q as q,W as p,J as xe,c0 as Pt,I
8
8
  right: 16px;
9
9
  transform: scale(0.9);
10
10
  }
11
- `;function Jr(){const[t,s]=b.useState(!1);b.useEffect(()=>{const n=Xe(()=>{s(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const o=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(Mt,{in:t,children:e.jsx(Xr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:o,children:e.jsx(zt,{})})})}const en=te.div`
11
+ `;function Xr(){const[t,s]=b.useState(!1);b.useEffect(()=>{const n=Je(()=>{s(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const o=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(Mt,{in:t,children:e.jsx(Jr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:o,children:e.jsx(zt,{})})})}const en=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 St,bb as Re,M as ae,ak as f,Q as q,W as p,J as xe,c0 as Pt,I
73
73
  *::-webkit-scrollbar {
74
74
  display: none; /* Chrome, Safari and Opera */
75
75
  }
76
- `;ct.propTypes={blocklets:p.array,context:p.object,pagination:p.bool,inDialog:p.bool,filterType:p.oneOf(["component","entity"]),toViewAll:p.func,type:p.oneOf(["server","service"])};function ct({blocklets:t=[],context:s,pagination:o=!0,inDialog:n=!1,filterType:l="component",toViewAll:i=()=>{},type:a="service"}){const{data:d,paging:r,refresh:x,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:g}=s,S=u=>{x({...h,severity:u&&typeof u=="string"?[u]:u||[],paging:{...h.paging,page:1}})},[R]=_t(),P=T(()=>R.get("id"),[R]),y=xe(u=>u.breakpoints.down("md")),[z,L]=b.useState(0),[U,j]=b.useState(!1),k=b.useMemo(()=>h.read===!1?"unread":"all",[h.read]),B=T(()=>Xe(u=>{if(m)return;const w=d.length,A=d.filter(F=>!_e(F)).length;let W={...h,append:!0,paging:{...h.paging,...u,currentPage:(r.currentPage||0)+1}};k==="unread"&&A<w&&u.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...u,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),x(W)},500),[d,h,k,r,m,x]);Je(()=>{g&&typeof g=="function"&&g()}),b.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),b.useEffect(()=>{setTimeout(()=>{const u=document.getElementById(P);u&&u.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=T(()=>d?.length>0&&d.length<z,[d,z]),Q=b.useCallback(u=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(u)||A.findIndex(W=>W===u)>-1},[v]),ne=b.useMemo(()=>{const u=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!u.has(A)&&(w.ancestors=[],u.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{u.has(W)||u.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const F=W?.did||W.meta?.did;F&&!u.has(F)&&Q(F)&&(W.ancestors=[w],u.set(F,W))})}),u},[t,Q]),ge=b.useCallback(()=>{m||B({page:r.page+1})},[r.page,m,B]),[oe]=Vr({loading:m,hasNextPage:G,onLoadMore:ge}),se=u=>{!u||_e(u)||C(u.id).then(()=>{n&&i()})},me=({severity:u,id:w})=>{if(m)return;let A={};l==="component"?A={entityId:[],componentDid:w}:l==="entity"&&(A={componentDid:[],entityId:w}),x({...h,severity:u,...A,paging:{...h.paging,page:1}})},be=u=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};u==="unread"?(w.read=!1,w.paging.currentPage=1):w=Ht(w,"read"),x(w)},K=T(()=>l==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:l==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,l]),ye=T(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(en,{inDialog:!!n,children:[n?e.jsx(it,{currentTab:ye,type:"line",theme:"light",onSelectType:S}):e.jsx(lt,{loading:m,blockletMap:ne,unReadCount:c,filterType:l,type:a,selectedId:K,onFilterChange:me,severity:h.severity,onReadFilterChange:be,currentReadFilter:k}),!y&&m?e.jsx(f,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(vr,{data:d,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:a}),o&&!y?e.jsx(Yr,{loading:m,paging:r,onChange:B}):null,o&&y&&(m||G)?e.jsx(f,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!n&&y?e.jsx(Jr,{}):null]})}const tn=b.memo(ct),$=new Qt;function he(t){const{userDid:s=""}={},{session:o}=Yt(),n=T(()=>{if(s)return s;const r=window.location.href,x=Gt(r);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:o?.user?.did},[o?.user?.did,s]),l=T(()=>o.user,[o]),i=T(()=>l?n===l?.did:!1,[n,l?.did]),a=re(async()=>{if(await Zt(()=>o?.initialized),i)return o.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,o?.initialized,l]}),d=T(()=>l.passports?.some(r=>r.role===Te.ROLES.OWNER),[l]);return{currentDid:n,session:o,isMyself:i,user:l,viewUser:a.data,isOwner:d}}function dt({user:t,...s}){const{t:o}=O(),n=Lt(),l=T(()=>{const d=(t?.passports||[]).map(r=>({...r,revoked:r.status===lr.REVOKED}));return d.sort((r,x)=>r.revoked===x.revoked?0:r.revoked?1:-1),Ne(d.filter(r=>!r.display),"role").concat(Ne(d.filter(r=>r.display),"display.content"))},[t?.passports]),i=T(()=>l?.find(d=>d.name===t.role),[l,t?.role]),a=n.palette.primary.main;return l.length===0?e.jsx(f,{children:e.jsx(tt,{children:o("userCenter.noPassport")})}):e.jsx(f,{...s,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,...s.sx},children:l.map(d=>e.jsx(Cr,{passport:d,user:t,color:window.blocklet.passportColor,createPassportSvg:Xt,title:i&&i.role===d.role?o("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===d.role?`0px 2px 4px 0px ${a}, 0px 1px 2px -1px ${a}, 0px 0px 0px 1px ${a} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},d.id))})}dt.propTypes={user:p.object.isRequired};function rn({visible:t,onClose:s,nft:o}){return!t||!o?null:e.jsx(nn,{children:e.jsx(Bt,{open:t,onClose:s,children:e.jsx(on,{onClick:s,children:e.jsx(ot,{data:st(o),address:o.address,inset:!0})})})})}const nn=te.div`
76
+ `;ct.propTypes={blocklets:p.array,context:p.object,pagination:p.bool,inDialog:p.bool,filterType:p.oneOf(["component","entity"]),toViewAll:p.func,type:p.oneOf(["server","service"])};function ct({blocklets:t=[],context:s,pagination:o=!0,inDialog:n=!1,filterType:l="component",toViewAll:i=()=>{},type:a="service"}){const{data:d,paging:r,refresh:f,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:g}=s,S=u=>{f({...h,severity:u&&typeof u=="string"?[u]:u||[],paging:{...h.paging,page:1}})},[R]=_t(),P=T(()=>R.get("id"),[R]),y=fe(u=>u.breakpoints.down("md")),[z,L]=b.useState(0),[U,j]=b.useState(!1),k=b.useMemo(()=>h.read===!1?"unread":"all",[h.read]),B=T(()=>Je(u=>{if(m)return;const w=d.length,A=d.filter(F=>!_e(F)).length;let W={...h,append:!0,paging:{...h.paging,...u,currentPage:(r.currentPage||0)+1}};k==="unread"&&A<w&&u.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...u,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(W)},500),[d,h,k,r,m,f]);Xe(()=>{g&&typeof g=="function"&&g()}),b.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),b.useEffect(()=>{setTimeout(()=>{const u=document.getElementById(P);u&&u.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=T(()=>d?.length>0&&d.length<z,[d,z]),Q=b.useCallback(u=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(u)||A.findIndex(W=>W===u)>-1},[v]),ne=b.useMemo(()=>{const u=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!u.has(A)&&(w.ancestors=[],u.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{u.has(W)||u.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const F=W?.did||W.meta?.did;F&&!u.has(F)&&Q(F)&&(W.ancestors=[w],u.set(F,W))})}),u},[t,Q]),ge=b.useCallback(()=>{m||B({page:r.page+1})},[r.page,m,B]),[oe]=Vr({loading:m,hasNextPage:G,onLoadMore:ge}),se=u=>{!u||_e(u)||C(u.id).then(()=>{n&&i()})},me=({severity:u,id:w})=>{if(m)return;let A={};l==="component"?A={entityId:[],componentDid:w}:l==="entity"&&(A={componentDid:[],entityId:w}),f({...h,severity:u,...A,paging:{...h.paging,page:1}})},be=u=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};u==="unread"?(w.read=!1,w.paging.currentPage=1):w=Ht(w,"read"),f(w)},K=T(()=>l==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:l==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,l]),ye=T(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(en,{inDialog:!!n,children:[n?e.jsx(it,{currentTab:ye,type:"line",theme:"light",onSelectType:S}):e.jsx(lt,{loading:m,blockletMap:ne,unReadCount:c,filterType:l,type:a,selectedId:K,onFilterChange:me,severity:h.severity,onReadFilterChange:be,currentReadFilter:k}),!y&&m?e.jsx(x,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(vr,{data:d,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:a}),o&&!y?e.jsx(Yr,{loading:m,paging:r,onChange:B}):null,o&&y&&(m||G)?e.jsx(x,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!n&&y?e.jsx(Xr,{}):null]})}const tn=b.memo(ct),$=new Qt;function he(t){const{userDid:s=""}={},{session:o}=Yt(),n=T(()=>{if(s)return s;const r=window.location.href,f=Gt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:o?.user?.did},[o?.user?.did,s]),l=T(()=>o.user,[o]),i=T(()=>l?n===l?.did:!1,[n,l?.did]),a=re(async()=>{if(await Zt(()=>o?.initialized),i)return o.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,o?.initialized,l]}),d=T(()=>l.passports?.some(r=>r.role===Te.ROLES.OWNER),[l]);return{currentDid:n,session:o,isMyself:i,user:l,viewUser:a.data,isOwner:d}}function dt({user:t,...s}){const{t:o}=O(),n=Lt(),l=T(()=>{const d=(t?.passports||[]).map(r=>({...r,revoked:r.status===lr.REVOKED}));return d.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),Ne(d.filter(r=>!r.display),"role").concat(Ne(d.filter(r=>r.display),"display.content"))},[t?.passports]),i=T(()=>l?.find(d=>d.name===t.role),[l,t?.role]),a=n.palette.primary.main;return l.length===0?e.jsx(x,{children:e.jsx(tt,{children:o("userCenter.noPassport")})}):e.jsx(x,{...s,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,...s.sx},children:l.map(d=>e.jsx(Cr,{passport:d,user:t,color:window.blocklet.passportColor,createPassportSvg:Jt,title:i&&i.role===d.role?o("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===d.role?`0px 2px 4px 0px ${a}, 0px 1px 2px -1px ${a}, 0px 0px 0px 1px ${a} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},d.id))})}dt.propTypes={user:p.object.isRequired};function rn({visible:t,onClose:s,nft:o}){return!t||!o?null:e.jsx(nn,{children:e.jsx(Bt,{open:t,onClose:s,children:e.jsx(on,{onClick:s,children:e.jsx(ot,{data:st(o),address:o.address,inset:!0})})})})}const nn=te.div`
77
77
  position: relative;
78
78
  width: 100%;
79
79
  height: 100%;
@@ -118,7 +118,7 @@ import{j as e,y as St,bb as Re,M as ae,ak as f,Q as q,W as p,J as xe,c0 as Pt,I
118
118
  height: 75vmin;
119
119
  }
120
120
  }
121
- `,sn=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)}}}),an={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"}},Ke="https://main.abtnetwork.io/explorer";function ut({user:t}){const{t:s}=O(),o=Z(),[n,l]=b.useState({visible:!1,nft:null}),[i,a]=b.useState({anchorEl:null,props:null}),d=P=>{const y=ce(Ke,"assets",P);window.open(y,"_blank")},r=(P,y)=>{let z="";typeof y.data?.value=="string"?z=JSON.parse(y.data?.value)?.domain:z=y.data?.value?.domain,a({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(Ke,"assets",y.address)}})},x=P=>{l({visible:!0,nft:P})},m=H({page:1,size:20}),h=re(async(P=m)=>(await Kt.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}=h,c=v?.page??{cursor:0,next:!1,total:0},g=(P,y)=>{m.page=y,h.run(m)},S=E(P=>[e.jsx(N,{size:"small",className:"mask-item",onClick:y=>{y.stopPropagation(),d(P.address)},children:e.jsx(D,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(N,{size:"small",onClick:y=>{y.stopPropagation(),r(y.currentTarget,P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(N,{size:"small",onClick:y=>{y.stopPropagation(),x(P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:eye",fontSize:18})},"view")]),R=T(()=>{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(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(De,{width:"20%"}),e.jsx(f,{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:s("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(tt,{children:s("userCenter.common.noNFT")})}),e.jsx(f,{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(f,{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",...o?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(ot,{data:st(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),o?e.jsx(f,{className:"footer-mask",sx:an,children:S(P)}):e.jsx(f,{className:"mask",sx:sn,children:e.jsx(Ie,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||m.page>1?e.jsx(Wt,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:g,count:Math.ceil(c.total/m.size),size:"small"}):null,e.jsx(rn,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{l({visible:!1,nft:null})}}),e.jsx(cr,{anchorEl:i.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,c,m.page,m.size,g,i,n]);return e.jsx(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}ut.propTypes={user:p.object.isRequired};function ln(){const{t}=O(),{user:s,isMyself:o,viewUser:n}=he();return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[o?e.jsxs(f,{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(dt,{user:s})]}):null,e.jsx(ut,{user:o?s:n})]})}const cn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function pt({user:t,onSave:s}){const{t:o,changeLocale:n}=O(),l=H({locale:t.locale,loading:!1}),i=E(async a=>{try{const{value:d}=a.target;l.loading=!0,await $.user.saveProfile({locale:d}),await s("profile"),n(d),l.locale=d}catch(d){_.error(ee(d))}finally{l.loading=!1}});return e.jsxs(f,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(f,{children:o("userCenter.commonSetting.locale")}),e.jsx(f,{children:e.jsx(Re,{value:l.locale,onChange:i,size:"small",IconComponent:a=>e.jsx(et,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||cn).map(a=>e.jsx(ae,{value:a.code,children:a.name},a.code))})})]})}pt.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function Se({onTest:t=V,onDelete:s=V,onSave:o=V,onCancel:n=V,type:l="slack",url:i="",edit:a=!1}){const{t:d}=O(),r=H({type:l||"slack",url:i||"",edit:a??!1,error:"",loading:!1}),x=E(()=>r.url?Jt(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=l||"slack",r.error="",r.loading=!1,n()}),h=E(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=E(c=>()=>{x()&&c({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Y,{size:16}):e.jsx(N,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(D,{icon:kr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(f,{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:d("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:d("userCenter.webhook.slack")})]}),e.jsxs(f,{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,x()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Qe,{position:"end",children:v})}}}),e.jsx(f,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(N,{color:"success",onClick:C((...c)=>{o(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:dr})}),e.jsx(N,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:ur})})]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Sr})}),e.jsx(N,{color:"error",onClick:()=>{s({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Pr})})]})})]})]})}Se.propTypes={onTest:p.func,onDelete:p.func,onSave:p.func,onCancel:p.func,type:p.oneOf(["api","slack"]),url:p.string,edit:p.bool};function ie({title:t=void 0,description:s=void 0,value:o,onChange:n,isMobile:l}){const i=E(a=>{a.stopPropagation()});return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ke,{checked:o,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:l?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:l?"normal":"nowrap"},children:[t,s]})]})}ie.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function xt({user:t,isMobile:s}){const{t:o}=O(),n=H({showAdd:!1}),l=re(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...l?.data?.notifications||{}}),[l?.data?.notifications]),a=T(()=>l?.data?.webhooks||[],[l?.data?.webhooks]),d=E(async v=>{try{await $.user.saveUserNotificationConfig(v),_.success(o("userCenter.saveSuccess")),l.run()}catch(c){_.error(ee(c))}}),r=E(async(v,c)=>{await d({notifications:{[v]:c}})}),x=async v=>{try{await $.user.testNotificationWebhook(v),_.success(o("userCenter.webhookTested"))}catch(c){_.error(ee(c))}},m=E(async v=>{await d({webhooks:a.filter((c,g)=>g!==v)})}),h=E(async(v,c)=>{await d({webhooks:a.map((g,S)=>S===v?c:g)})}),C=E(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return l.error?e.jsx(Ot,{severity:"error",children:l.error.message}):l.loading||!l.data?e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(f,{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:s,title:o("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:$e(t)&&e.jsx(pr,{did:$e(t),showQrcode:!1,showAvatar:!s,copyable:!0,compact:!0,responsive:!0,startChars:s?2:6})}),e.jsx(ie,{value:i.email,isMobile:s,onChange:v=>r("email",v.target.checked),title:o("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:s,value:i.push,title:o("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Ie,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,c)=>e.jsx(Se,{onTest:x,onDelete:()=>m(c),onSave:(...g)=>h(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(Se,{onTest:x,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(rt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(D,{icon:Rr}),onClick:()=>{n.showAdd=!0},children:o("userCenter.addWebhook")})]})]})}xt.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function Pe({children:t,...s}){const o=Z(),[n,l]=b.useState(!1),i=E(()=>{l(!n)});return b.useEffect(()=>{l(!1)},[o]),o?e.jsx(Dt,{onClickAway:()=>l(!1),children:e.jsx(J,{...s,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,slotProps:{popper:{disablePortal:!0}},open:n,onClose:i,children:b.cloneElement(t,{onClick:i})})}):e.jsx(J,{...s,children:t})}Pe.propTypes={children:p.node.isRequired};function ft({item:t}){const s=ze(),{blocklet:o}=er(),{confirmApi:n,confirmHolder:l}=Ae(),i=H({loading:!1}),{t:a}=O(),{session:d}=b.use(fe),{bindOAuth:r,unbindOAuth:x,setBaseUrl:m,baseUrl:h}=d.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=d.usePasskey(),c=T(()=>xr[t?.provider]||"unknown",[t?.provider]),g=E(y=>y?._bind?y.provider===M.WALLET&&y.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):y.provider===M.PASSKEY&&s.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):y._mainProvider&&s.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((y,z)=>{n.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(L){C({session:d,connectedAccount:t}).then(y).catch(z),L()},onCancel:y})});return}try{i.loading=!0,await new Promise((y,z)=>{if(t?._bind)n.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(L){x({session:d,connectedAccount:{...Vt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(y).catch(z),L()},onCancel:y});else if(t.provider===M.WALLET)d.bindWallet({onSuccess:y,onCancel:z});else{const L=h,U=window?.blocklet;let j="/";const k=fr(U),B=hr(U);k&&B?.appPid&&d?.user?.sourceAppPid&&(j=B.appUrl),m(j),v(o?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(y).catch(z).finally(()=>{m(L),v()})}})}catch(y){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,y)}finally{i.loading=!1}}),R=E(y=>y.provider===M.WALLET&&y.did?a("userCenter.thirdPartyLogin.walletAccount"):y._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):y?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),P=E(y=>y.provider===M.WALLET&&y.did||y.provider===M.PASSKEY&&(s.arcSphere||s.wallet)?!0:!!t._mainProvider,[s.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(f,{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(tr,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:y})=>t?.provider===M.GITHUB&&y.mode==="dark"?"invert(1)":"none"}}),e.jsx(f,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(f,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(Pe,{title:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(nt,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(f,{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(f,{component:D,icon:rr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(Pe,{title:g(t),placement:"auto",children:e.jsx(f,{children:e.jsx(rt,{variant:"outlined",size:"small",sx:y=>{const z=y.palette.error.main,L=y.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(D,{icon:Ir}),onClick:S,disabled:P(t),loading:i.loading,children:R(t)})})}),l]})}ft.propTypes={item:p.shape({provider:p.string,did:p.string,pk:p.string,userInfo:p.object,id:p.string,_bind:p.bool,_rawProvider:p.string,_mainProvider:p.bool}).isRequired};function ht({user:t}){const{session:s}=b.use(fe),[o,n]=b.useState({}),{getOAuthConfigs:l}=s.useOAuth(),i=ze();ar(async()=>{const r=await l({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(o).map(x=>({...o[x],provider:x})).filter(x=>x.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[o]),d=T(()=>{const r=gr(t);let x=!1,m="",h=mr(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(x=!0,m=M.GOOGLE,h===M.AUTH0&&(h=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(x=!0,m=M.APPLE,h===M.AUTH0&&(h=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(x=!0,m=M.GITHUB,h===M.AUTH0&&(h=M.GITHUB)))),a.map(c=>{if(c.provider===M.AUTH0&&x)return null;const g=x&&c.provider===m?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===h}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===h}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(f,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(ft,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(nr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ht.propTypes={user:p.object.isRequired};function gt({configList:t,onSave:s}){const[o,n]=b.useState(t),{t:l}=O(),i=E(async(a,d)=>{try{const r=await $.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(o.map(x=>({...x,value:r?.[x.key]??x.value}))),_.success(l("userCenter.saveSuccess")),s("privacy")}catch(r){_.error(ee(r))}});return b.useEffect(()=>{n(t)},[t]),e.jsx(f,{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:o.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(f,{children:[e.jsx(ke,{checked:d,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:x}=r.target;a.followersOnly?i(a.key,x?"all":"private"):i(a.key,x)}},a.key),a.followersOnly&&d&&e.jsx(f,{sx:{pl:3,pt:1},children:e.jsx(ke,{checked:a.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:x}=r.target;i(a.key,x?"follower-only":"all")}})})]})})})}gt.propTypes={configList:p.arrayOf(p.shape({key:p.string.isRequired,name:p.string.isRequired,value:p.bool.isRequired,isPrivate:p.bool})).isRequired,onSave:p.func.isRequired};function mt({user:t,sessionUser:s}){const o=T(()=>(t?.passports||[])?.find(n=>n.name===s.role),[t?.passports,s?.role]);return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(nt,{size:40,variant:"circle",shape:"circle",src:s.avatar,did:s.did,sx:{flexShrink:0}}),e.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(J,{title:s.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:s.fullName})}),e.jsx(Ce,{label:o?.title||o?.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:s.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.email})})]})]})}mt.propTypes={user:p.object.isRequired,sessionUser:p.shape({role:p.string,avatar:p.string,did:p.string,fullName:p.string,email:p.string}).isRequired};const dn=()=>Promise.resolve(""),Ve=t=>new we(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we.BROWSER.NAME,we.BROWSER.VERSION]]}).getResult(),Ye={display:"flex",justifyContent:"flex-end",textAlign:"right"},un=new or({concurrency:1}),Ee=b.memo(({userSession:t,isMobile:s=!1})=>{const o=H({loading:!0,ipRegion:""}),{t:n}=O();return b.useEffect(()=>{un.add(async()=>{try{o.ipRegion=await dn(t.lastLoginIp)}finally{o.loading=!1}})},[o,t.lastLoginIp]),e.jsx(f,{...s&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:o.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:o.ipRegion}),e.jsx(I,{variant:"body2",color:"grey",children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{children:t.lastLoginIp||n("userCenter.unknown")}),o.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Y,{size:12,color:"inherit"})}):null]})})});Ee.propTypes={userSession:p.object.isRequired,isMobile:p.bool};Ee.defaultProps={isMobile:!1};function bt({user:t,showAction:s=!0,showUser:o=!0,getUserSessions:n,showOffline:l=!1}){const i=H({status:"online",page:1,pageSize:10}),a=H({online:0,expired:0,offline:0}),d=br(),{t:r}=O(),x=Z({key:"md"}),m=xe(j=>j.breakpoints.down("lg")),{confirmApi:h,confirmHolder:C}=Ae(),v=E(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),k=j?.paging?.total||0;return a[i.status]=k,{total:k,list:j?.list||[]}});Je(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});a.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});a.offline=k?.paging?.total||0});const c=re(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=T(()=>c.data?.list||[],[c.data?.list]),S=T(()=>{const{status:j}=i;return j==="online"?a[j]<=1:a[j]===0},[g,d]),R=T(()=>de({},x?Ye:{}),[x]),P=E(({visitorId:j})=>{h.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=i,{list:B=[]}=c.data||{},G=B.length||0;k>1&&G===1&&(i.page=Math.max(k-1,1)),c.refresh(),h.close()}})}),y=E(()=>{h.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 $.user.logout({status:i.status,visitorId:d,includeFederated:!0}),i.page=1,c.refresh(),h.close()}})}),z=[];s&&z.push(e.jsx(J,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(q,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:y,disabled:S,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const L=T(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:c.data?.total||0}),[c.data?.total,i.page,i.pageSize]),U=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=g[j],B=Ve(k?.ua);return e.jsx(f,{sx:R,children:[B.os?.name,B.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=g[j],B=Ve(k?.ua);return e.jsx(f,{sx:R,children:[B.browser?.name,B.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.extra?.walletOS||r("userCenter.unknown")})}}},o&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:de({minWidth:150,maxWidth:250},x?Ye:{}),children:e.jsx(mt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.createdAt?e.jsx(Ue,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!l&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,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=g[j];return e.jsx(Ee,{userSession:k,isMobile:x})}}},s&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:e.jsx(q,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:d===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):d===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(f,{className:"pc-user-sessions",sx:{maxWidth:x?"unset":m?"calc(100vw - 300px)":"100%",...x&&{".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",...x&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[C,e.jsx(yr,{count:c.data?.total||0,data:g,columns:U,customButtons:z,options:L,loading:c.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{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:["(",a.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:["(",a.expired,")"]})]})}),l?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:["(",a.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}bt.propTypes={user:p.object.isRequired,showAction:p.bool,showUser:p.bool,showOffline:p.bool,getUserSessions:p.func.isRequired};function yt({onDestroySelf:t=void 0}){const{confirmHolder:s}=Ae(),{t:o}=O(),{session:n}=b.use(fe),l=E(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(a){_.error(a?.message||o("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(f,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:o("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:o("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(q,{variant:"contained",color:"error",size:"small",onClick:l,children:o("userCenter.dangerZone.delete")})]})}),s]})}yt.propTypes={onDestroySelf:p.func};function pn(){const t=Z({key:"md"}),s=xe(l=>l.breakpoints.down("lg")),o={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>de({},t?o:{}),[t]);return e.jsx(f,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":s?"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:l=>`${l.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(zr,{isSelf:!0,columnSx:n})})}function vt({onDestroySelf:t=void 0,userCenterTabs:s=[]}){const{t:o}=O(),{user:n,session:l,isMyself:i,isOwner:a}=he(),r=ze().arcSphere,x=Z({key:"md"}),m=re(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=T(()=>s.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[s]),C=E(async c=>c==="privacy"?(await m.runAsync(),m.data):(c==="profile"&&await l.refresh(),null));b.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:o("userCenter.commonSetting.title"),value:"common",content:e.jsx(pt,{user:n,onSave:C})},{label:o("userCenter.notificationManagement"),value:"notification",content:e.jsx(xt,{user:n,isMobile:x})},{label:o("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ht,{user:n})},{label:o("common.accessKeys"),value:"accessKeys",content:e.jsx(pn,{isSelf:!0})},{label:o("common.mcpServers"),value:"mcpServers",content:e.jsx(Mr,{})},{label:o("userCenter.privacyManagement"),value:"privacy",content:e.jsx(gt,{configList:h,onSave:C})},{label:o("userCenter.sessionManagement"),value:"session",content:e.jsx(bt,{user:n,showUser:!1,getUserSessions:c=>$.userSession.getMyLoginSessions({},c)})},!a&&t&&typeof t=="function"?{label:o("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(yt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,x,a,t]);return i?e.jsx(f,{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(f,{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(f,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}vt.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const wt=b.createContext({}),{Provider:xn,Consumer:fo}=wt;function jt({children:t}){const[s]=b.useState(!1),{session:o}=b.use(fe),{user:n}=o,[l,i]=b.useState(),a=b.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);b.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const d=async()=>{i(void 0)},r=h=>{},x=async h=>{i(h),await r(h.endpoint)},m=!!(a&&l);return e.jsx(xn,{value:{loading:s,spaceGateway:l,session:o,deleteSpaceGateway:d,updateSpaceGateway:x,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function Le(){return b.use(wt)}jt.propTypes={children:p.node.isRequired};function fn(t){const s=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(s,"space",n)}function Ct({session:t,spaceGateway:s,spaceStatus:o,refresh:n}){return e.jsxs(Ie,{direction:"row",spacing:1,children:[o===Lr.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:l=>{console.error(l),_.error(ee(l))}}),e.jsx(N,{size:"small",LinkComponent:$t,href:fn(s.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}Ct.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:s}=O(),{updateSpaceGateway:o,session:n}=Le(),l=Z(),i=({spaceGateway:a})=>o(a);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:s("userCenter.storage.spaces.connected.title")}),!l&&e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(f,{children:t&&e.jsx(Br,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(Ct,{session:n,...a})},t.endpoint)}),l&&e.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}kt.propTypes={spaceGateway:p.object};function hn(){const{t}=O(),{updateSpaceGateway:s,session:o}=Le(),n=({spaceGateway:l})=>s(l);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Wr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(f,{children:e.jsx(ue,{session:o,onSuccess:n})})]})}function gn(){const{spaceGateway:t,hasStorageEndpoint:s,loading:o}=Le(),{isMyself:n}=he();return n?o?e.jsx(Er,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(bn,{children:e.jsx(f,{sx:{maxWidth:"720px"},children:s?e.jsx(kt,{spaceGateway:t}):e.jsx(hn,{})})}):null}function mn(){return e.jsx(jt,{children:e.jsx(gn,{})})}const bn=te(f)`
121
+ `,sn=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)}}}),an={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"}},Ke="https://main.abtnetwork.io/explorer";function ut({user:t}){const{t:s}=O(),o=Z(),[n,l]=b.useState({visible:!1,nft:null}),[i,a]=b.useState({anchorEl:null,props:null}),d=P=>{const y=ce(Ke,"assets",P);window.open(y,"_blank")},r=(P,y)=>{let z="";typeof y.data?.value=="string"?z=JSON.parse(y.data?.value)?.domain:z=y.data?.value?.domain,a({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(Ke,"assets",y.address)}})},f=P=>{l({visible:!0,nft:P})},m=H({page:1,size:20}),h=re(async(P=m)=>(await Kt.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}=h,c=v?.page??{cursor:0,next:!1,total:0},g=(P,y)=>{m.page=y,h.run(m)},S=E(P=>[e.jsx(N,{size:"small",className:"mask-item",onClick:y=>{y.stopPropagation(),d(P.address)},children:e.jsx(D,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(N,{size:"small",onClick:y=>{y.stopPropagation(),r(y.currentTarget,P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(N,{size:"small",onClick:y=>{y.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:eye",fontSize:18})},"view")]),R=T(()=>{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:s("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(tt,{children:s("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",...o?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(ot,{data:st(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),o?e.jsx(x,{className:"footer-mask",sx:an,children:S(P)}):e.jsx(x,{className:"mask",sx:sn,children:e.jsx(Ie,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||m.page>1?e.jsx(Wt,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:g,count:Math.ceil(c.total/m.size),size:"small"}):null,e.jsx(rn,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{l({visible:!1,nft:null})}}),e.jsx(cr,{anchorEl:i.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,c,m.page,m.size,g,i,n]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}ut.propTypes={user:p.object.isRequired};function ln(){const{t}=O(),{user:s,isMyself:o,viewUser:n}=he();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[o?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(dt,{user:s})]}):null,e.jsx(ut,{user:o?s:n})]})}const cn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function pt({user:t,onSave:s}){const{t:o,changeLocale:n}=O(),l=H({locale:t.locale,loading:!1}),i=E(async a=>{try{const{value:d}=a.target;l.loading=!0,await $.user.saveProfile({locale:d}),await s("profile"),n(d),l.locale=d}catch(d){_.error(ee(d))}finally{l.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:o("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Re,{value:l.locale,onChange:i,size:"small",IconComponent:a=>e.jsx(et,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||cn).map(a=>e.jsx(ae,{value:a.code,children:a.name},a.code))})})]})}pt.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function Se({onTest:t=V,onDelete:s=V,onSave:o=V,onCancel:n=V,type:l="slack",url:i="",edit:a=!1}){const{t:d}=O(),r=H({type:l||"slack",url:i||"",edit:a??!1,error:"",loading:!1}),f=E(()=>r.url?Xt(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=l||"slack",r.error="",r.loading=!1,n()}),h=E(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=E(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Y,{size:16}):e.jsx(N,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(D,{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:d("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:d("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(Qe,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(N,{color:"success",onClick:C((...c)=>{o(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:dr})}),e.jsx(N,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:ur})})]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Sr})}),e.jsx(N,{color:"error",onClick:()=>{s({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Pr})})]})})]})]})}Se.propTypes={onTest:p.func,onDelete:p.func,onSave:p.func,onCancel:p.func,type:p.oneOf(["api","slack"]),url:p.string,edit:p.bool};function ie({title:t=void 0,description:s=void 0,value:o,onChange:n,isMobile:l}){const i=E(a=>{a.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ke,{checked:o,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:l?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:l?"normal":"nowrap"},children:[t,s]})]})}ie.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function ft({user:t,isMobile:s}){const{t:o}=O(),n=H({showAdd:!1}),l=re(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...l?.data?.notifications||{}}),[l?.data?.notifications]),a=T(()=>l?.data?.webhooks||[],[l?.data?.webhooks]),d=E(async v=>{try{await $.user.saveUserNotificationConfig(v),_.success(o("userCenter.saveSuccess")),l.run()}catch(c){_.error(ee(c))}}),r=E(async(v,c)=>{await d({notifications:{[v]:c}})}),f=async v=>{try{await $.user.testNotificationWebhook(v),_.success(o("userCenter.webhookTested"))}catch(c){_.error(ee(c))}},m=E(async v=>{await d({webhooks:a.filter((c,g)=>g!==v)})}),h=E(async(v,c)=>{await d({webhooks:a.map((g,S)=>S===v?c:g)})}),C=E(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return l.error?e.jsx(Ot,{severity:"error",children:l.error.message}):l.loading||!l.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):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:s,title:o("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:$e(t)&&e.jsx(pr,{did:$e(t),showQrcode:!1,showAvatar:!s,copyable:!0,compact:!0,responsive:!0,startChars:s?2:6})}),e.jsx(ie,{value:i.email,isMobile:s,onChange:v=>r("email",v.target.checked),title:o("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:s,value:i.push,title:o("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Ie,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,c)=>e.jsx(Se,{onTest:f,onDelete:()=>m(c),onSave:(...g)=>h(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(Se,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(rt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(D,{icon:Rr}),onClick:()=>{n.showAdd=!0},children:o("userCenter.addWebhook")})]})]})}ft.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function Pe({children:t,...s}){const o=Z(),[n,l]=b.useState(!1),i=E(()=>{l(!n)});return b.useEffect(()=>{l(!1)},[o]),o?e.jsx(Dt,{onClickAway:()=>l(!1),children:e.jsx(X,{...s,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,slotProps:{popper:{disablePortal:!0}},open:n,onClose:i,children:b.cloneElement(t,{onClick:i})})}):e.jsx(X,{...s,children:t})}Pe.propTypes={children:p.node.isRequired};function xt({item:t}){const s=ze(),{blocklet:o}=er(),{confirmApi:n,confirmHolder:l}=Ae(),i=H({loading:!1}),{t:a}=O(),{session:d}=b.use(xe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:m,baseUrl:h}=d.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=d.usePasskey(),c=T(()=>fr[t?.provider]||"unknown",[t?.provider]),g=E(y=>y?._bind?y.provider===M.WALLET&&y.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):y.provider===M.PASSKEY&&s.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):y._mainProvider&&s.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((y,z)=>{n.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(L){C({session:d,connectedAccount:t}).then(y).catch(z),L()},onCancel:y})});return}try{i.loading=!0,await new Promise((y,z)=>{if(t?._bind)n.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(L){f({session:d,connectedAccount:{...Vt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(y).catch(z),L()},onCancel:y});else if(t.provider===M.WALLET)d.bindWallet({onSuccess:y,onCancel:z});else{const L=h,U=window?.blocklet;let j="/";const k=xr(U),B=hr(U);k&&B?.appPid&&d?.user?.sourceAppPid&&(j=B.appUrl),m(j),v(o?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(y).catch(z).finally(()=>{m(L),v()})}})}catch(y){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,y)}finally{i.loading=!1}}),R=E(y=>y.provider===M.WALLET&&y.did?a("userCenter.thirdPartyLogin.walletAccount"):y._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):y?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),P=E(y=>y.provider===M.WALLET&&y.did||y.provider===M.PASSKEY&&(s.arcSphere||s.wallet)?!0:!!t._mainProvider,[s.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(tr,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:y})=>t?.provider===M.GITHUB&&y.mode==="dark"?"invert(1)":"none"}}),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(nt,{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:D,icon:rr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(Pe,{title:g(t),placement:"auto",children:e.jsx(x,{children:e.jsx(rt,{variant:"outlined",size:"small",sx:y=>{const z=y.palette.error.main,L=y.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(D,{icon:Ir}),onClick:S,disabled:P(t),loading:i.loading,children:R(t)})})}),l]})}xt.propTypes={item:p.shape({provider:p.string,did:p.string,pk:p.string,userInfo:p.object,id:p.string,_bind:p.bool,_rawProvider:p.string,_mainProvider:p.bool}).isRequired};function ht({user:t}){const{session:s}=b.use(xe),[o,n]=b.useState({}),{getOAuthConfigs:l}=s.useOAuth(),i=ze();ar(async()=>{const r=await l({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(o).map(f=>({...o[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[o]),d=T(()=>{const r=gr(t);let f=!1,m="",h=mr(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,h===M.AUTH0&&(h=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,m=M.APPLE,h===M.AUTH0&&(h=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,m=M.GITHUB,h===M.AUTH0&&(h=M.GITHUB)))),a.map(c=>{if(c.provider===M.AUTH0&&f)return null;const g=f&&c.provider===m?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===h}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===h}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(xt,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(nr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ht.propTypes={user:p.object.isRequired};function gt({configList:t,onSave:s}){const[o,n]=b.useState(t),{t:l}=O(),i=E(async(a,d)=>{try{const r=await $.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(o.map(f=>({...f,value:r?.[f.key]??f.value}))),_.success(l("userCenter.saveSuccess")),s("privacy")}catch(r){_.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:o.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(x,{children:[e.jsx(ke,{checked:d,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;a.followersOnly?i(a.key,f?"all":"private"):i(a.key,f)}},a.key),a.followersOnly&&d&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(ke,{checked:a.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;i(a.key,f?"follower-only":"all")}})})]})})})}gt.propTypes={configList:p.arrayOf(p.shape({key:p.string.isRequired,name:p.string.isRequired,value:p.bool.isRequired,isPrivate:p.bool})).isRequired,onSave:p.func.isRequired};function mt({user:t,sessionUser:s}){const o=T(()=>(t?.passports||[])?.find(n=>n.name===s.role),[t?.passports,s?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(nt,{size:40,variant:"circle",shape:"circle",src:s.avatar,did:s.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:s.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:s.fullName})}),e.jsx(Ce,{label:o?.title||o?.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:s.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.email})})]})]})}mt.propTypes={user:p.object.isRequired,sessionUser:p.shape({role:p.string,avatar:p.string,did:p.string,fullName:p.string,email:p.string}).isRequired};const dn=()=>Promise.resolve(""),Ve=t=>new we(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we.BROWSER.NAME,we.BROWSER.VERSION]]}).getResult(),Ye={display:"flex",justifyContent:"flex-end",textAlign:"right"},un=new or({concurrency:1}),Ee=b.memo(({userSession:t,isMobile:s=!1})=>{const o=H({loading:!0,ipRegion:""}),{t:n}=O();return b.useEffect(()=>{un.add(async()=>{try{o.ipRegion=await dn(t.lastLoginIp)}finally{o.loading=!1}})},[o,t.lastLoginIp]),e.jsx(x,{...s&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:o.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:o.ipRegion}),e.jsx(I,{variant:"body2",color:"grey",children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{children:t.lastLoginIp||n("userCenter.unknown")}),o.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Y,{size:12,color:"inherit"})}):null]})})});Ee.propTypes={userSession:p.object.isRequired,isMobile:p.bool};Ee.defaultProps={isMobile:!1};function bt({user:t,showAction:s=!0,showUser:o=!0,getUserSessions:n,showOffline:l=!1}){const i=H({status:"online",page:1,pageSize:10}),a=H({online:0,expired:0,offline:0}),d=br(),{t:r}=O(),f=Z({key:"md"}),m=fe(j=>j.breakpoints.down("lg")),{confirmApi:h,confirmHolder:C}=Ae(),v=E(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),k=j?.paging?.total||0;return a[i.status]=k,{total:k,list:j?.list||[]}});Xe(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});a.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});a.offline=k?.paging?.total||0});const c=re(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=T(()=>c.data?.list||[],[c.data?.list]),S=T(()=>{const{status:j}=i;return j==="online"?a[j]<=1:a[j]===0},[g,d]),R=T(()=>de({},f?Ye:{}),[f]),P=E(({visitorId:j})=>{h.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=i,{list:B=[]}=c.data||{},G=B.length||0;k>1&&G===1&&(i.page=Math.max(k-1,1)),c.refresh(),h.close()}})}),y=E(()=>{h.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 $.user.logout({status:i.status,visitorId:d,includeFederated:!0}),i.page=1,c.refresh(),h.close()}})}),z=[];s&&z.push(e.jsx(X,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(q,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:y,disabled:S,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const L=T(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:c.data?.total||0}),[c.data?.total,i.page,i.pageSize]),U=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=g[j],B=Ve(k?.ua);return e.jsx(x,{sx:R,children:[B.os?.name,B.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=g[j],B=Ve(k?.ua);return e.jsx(x,{sx:R,children:[B.browser?.name,B.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(x,{sx:R,children:k.extra?.walletOS||r("userCenter.unknown")})}}},o&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(x,{sx:de({minWidth:150,maxWidth:250},f?Ye:{}),children:e.jsx(mt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(x,{sx:R,children:k.createdAt?e.jsx(Ue,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!l&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(x,{sx:R,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=g[j];return e.jsx(Ee,{userSession:k,isMobile:f})}}},s&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(x,{sx:R,children:e.jsx(q,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:d===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):d===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:f?"unset":m?"calc(100vw - 300px)":"100%",...f&&{".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",...f&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[C,e.jsx(yr,{count:c.data?.total||0,data:g,columns:U,customButtons:z,options:L,loading:c.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{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:["(",a.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:["(",a.expired,")"]})]})}),l?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:["(",a.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}bt.propTypes={user:p.object.isRequired,showAction:p.bool,showUser:p.bool,showOffline:p.bool,getUserSessions:p.func.isRequired};function yt({onDestroySelf:t=void 0}){const{confirmHolder:s}=Ae(),{t:o}=O(),{session:n}=b.use(xe),l=E(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(a){_.error(a?.message||o("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:o("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:o("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(q,{variant:"contained",color:"error",size:"small",onClick:l,children:o("userCenter.dangerZone.delete")})]})}),s]})}yt.propTypes={onDestroySelf:p.func};function pn(){const t=Z({key:"md"}),s=fe(l=>l.breakpoints.down("lg")),o={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>de({},t?o:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":s?"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:l=>`${l.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(zr,{isSelf:!0,columnSx:n})})}function vt({onDestroySelf:t=void 0,userCenterTabs:s=[]}){const{t:o}=O(),{user:n,session:l,isMyself:i,isOwner:a}=he(),r=ze().arcSphere,f=Z({key:"md"}),m=re(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=T(()=>s.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[s]),C=E(async c=>c==="privacy"?(await m.runAsync(),m.data):(c==="profile"&&await l.refresh(),null));b.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:o("userCenter.commonSetting.title"),value:"common",content:e.jsx(pt,{user:n,onSave:C})},{label:o("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:n,isMobile:f})},{label:o("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ht,{user:n})},{label:o("common.accessKeys"),value:"accessKeys",content:e.jsx(pn,{isSelf:!0})},{label:o("common.mcpServers"),value:"mcpServers",content:e.jsx(Mr,{})},{label:o("userCenter.privacyManagement"),value:"privacy",content:e.jsx(gt,{configList:h,onSave:C})},{label:o("userCenter.sessionManagement"),value:"session",content:e.jsx(bt,{user:n,showUser:!1,getUserSessions:c=>$.userSession.getMyLoginSessions({},c)})},!a&&t&&typeof t=="function"?{label:o("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(yt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,f,a,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}vt.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const wt=b.createContext({}),{Provider:fn,Consumer:xo}=wt;function jt({children:t}){const[s]=b.useState(!1),{session:o}=b.use(xe),{user:n}=o,[l,i]=b.useState(),a=b.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);b.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const d=async()=>{i(void 0)},r=h=>{},f=async h=>{i(h),await r(h.endpoint)},m=!!(a&&l);return e.jsx(fn,{value:{loading:s,spaceGateway:l,session:o,deleteSpaceGateway:d,updateSpaceGateway:f,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function Le(){return b.use(wt)}jt.propTypes={children:p.node.isRequired};function xn(t){const s=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(s,"space",n)}function Ct({session:t,spaceGateway:s,spaceStatus:o,refresh:n}){return e.jsxs(Ie,{direction:"row",spacing:1,children:[o===Lr.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:l=>{console.error(l),_.error(ee(l))}}),e.jsx(N,{size:"small",LinkComponent:$t,href:xn(s.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}Ct.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:s}=O(),{updateSpaceGateway:o,session:n}=Le(),l=Z(),i=({spaceGateway:a})=>o(a);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:s("userCenter.storage.spaces.connected.title")}),!l&&e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(x,{children:t&&e.jsx(Br,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(Ct,{session:n,...a})},t.endpoint)}),l&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}kt.propTypes={spaceGateway:p.object};function hn(){const{t}=O(),{updateSpaceGateway:s,session:o}=Le(),n=({spaceGateway:l})=>s(l);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(Wr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(ue,{session:o,onSuccess:n})})]})}function gn(){const{spaceGateway:t,hasStorageEndpoint:s,loading:o}=Le(),{isMyself:n}=he();return n?o?e.jsx(Er,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(bn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:s?e.jsx(kt,{spaceGateway:t}):e.jsx(hn,{})})}):null}function mn(){return e.jsx(jt,{children:e.jsx(gn,{})})}const bn=te(x)`
122
122
  height: 100%;
123
123
  overflow-y: auto;
124
- `;function yn(){const{user:t,isMyself:s,viewUser:o}=he(),{followUser:n,unfollowUser:l,followed:i}=Tr(),a=async(d,r)=>{await(r?l:n)(d)};return e.jsx(f,{children:e.jsx(Or,{teamDid:window?.blocklet?.did||"",user:s?t:o,onToggleFollow:a,followed:i})})}function ho(){const{api:t}=sr(),s=b.useRef(null),n=qt().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),a=ir(),d=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(x=>({...x,meta:{...x,did:x.did,name:x.name||x.title||"",logo:"logo.png"}}))})),r=async x=>{const{input:m,sessionId:h}=x;try{await t.destroySelf({input:{...m,sessionId:h}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(jr,{children:e.jsxs(Ar,{ref:s,embed:i==="1",currentTab:n?ce(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(tn,{blocklets:[d],context:a}):null,n==="nfts"?e.jsx(ln,{}):null,n==="settings"?e.jsx(vt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(mn,{}):null,n==="user-followers"?e.jsx(yn,{}):null]})})}export{ho as default};
124
+ `;function yn(){const{user:t,isMyself:s,viewUser:o}=he(),{followUser:n,unfollowUser:l,followed:i}=Tr(),a=async(d,r)=>{await(r?l:n)(d)};return e.jsx(x,{children:e.jsx(Or,{teamDid:window?.blocklet?.did||"",user:s?t:o,onToggleFollow:a,followed:i})})}function ho(){const{api:t}=sr(),s=b.useRef(null),n=qt().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),a=ir(),d=T(()=>({...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:h}=f;try{await t.destroySelf({input:{...m,sessionId:h}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(jr,{children:e.jsxs(Ar,{ref:s,embed:i==="1",currentTab:n?ce(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(tn,{blocklets:[d],context:a}):null,n==="nfts"?e.jsx(ln,{}):null,n==="settings"?e.jsx(vt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(mn,{}):null,n==="user-followers"?e.jsx(yn,{}):null]})})}export{ho as default};
@@ -0,0 +1 @@
1
+ import{r as l}from"./vendor-react-Dvs43sk9.js";import{T as C,$ as E,L,N as M}from"./vendor-ux-Cm4oSE3n.js";import{k as y}from"./vendor-hooks-Clg_9bzt.js";import{j as e,ak as s,a6 as $,aX as w,b1 as P,y as W,x as _,bb as B,M as N,T as z,a$ as A,I as D,bc as K,Q as F,W as U}from"./vendor-mui-core-BkVXEDpj.js";import{c as S,Z as k}from"./index-76cnX1rM.js";import{a as q}from"./api-Cyp6JVXh.js";import{T as V}from"./table-tips-l92NoidG.js";import{u as G}from"./team-BMcH79D_.js";import{u as H}from"./session-DjNgTb0E.js";import"./vendor-utils-RRCPRD-7.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-2wJSDChZ.js";import"./use-mobile-BTugf2DR.js";import"./isURL-CoDhaDcU.js";import"./use-app-logo-BxJ8CI-y.js";function T({endpoint:i}){const[t,a]=l.useState("mcp-link"),x=k(),{api:h}=k(),{teamDid:m}=G(),{t:c,locale:p}=C(),{session:r}=H(),{data:u,run:o,loading:g}=y(()=>{const f={owner:S.SERVER_ROLES.ADMIN}[r?.user?.role]||r?.user?.role;return h.createAccessKey({input:{teamDid:m,passport:f,authType:"simple",remark:"Generated by MCP Servers"}})},{manual:!0}),{imgPrefix:n}=x,j=l.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[n]),v=j.find(d=>d.value===t),b=l.useMemo(()=>u?.data?.accessKeySecret,[u]),R=l.useMemo(()=>!b&&t!=="mcp-link",[b,t]),I=d=>{const f=`npx @blocklet/install-mcp@latest i ${i} --client ${d} --streamableHTTP --oauth2Bearer ${b}`;switch(d){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return f;case"mcp-link":default:return i}};return e.jsxs(s,{className:"mcp-servers-container",children:[e.jsx(L,{tabs:j,current:t,onChange:a,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(z,{component:"span",variant:"h6",sx:{fontWeight:"bold",my:2},children:t==="mcp-link"?v?.label:`${v?.label} ${c("installCommand")}`}),t!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${p}/mcp-${t}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(K,{fontSize:"small"})})})]}),e.jsxs(s,{className:"mcp-servers-codeblock",sx:{position:"relative","& pre":{borderRadius:1},"& .codeblock__inner":{overflow:"auto !important",borderRadius:1}},children:[e.jsx(M,{code:I(t),language:"shell",style:{margin:0}}),R&&e.jsx(s,{sx:{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:g?e.jsx($,{}):e.jsx(F,{variant:"contained",color:"primary",onClick:o,size:"small",children:`${c("common.generate")} ${c("command")}`})})]})]})]})}T.propTypes={endpoint:U.string.isRequired};function ce(){const[i,t]=l.useState(null),{t:a,locale:x}=C(),h=`${window?.blocklet?.appUrl}${S.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:m,loading:c,error:p}=y(()=>Promise.all([q.get(h)])),r=l.useMemo(()=>m?.[0]?.data?.servers||[],[m]);l.useEffect(()=>{r?.length&&t(r.find(o=>o.did===window?.blocklet?.did)||r[0])},[r]);const u=o=>{const g=o.target.value;t(r.find(n=>n.did===g))};return c?e.jsx(s,{children:e.jsx($,{})}):p?e.jsx(w,{color:"error",children:p?.message}):r?.length?e.jsxs(P,{sx:{gap:2,maxWidth:1200},children:[e.jsx(V,{title:a("mcp.listTitle"),tooltipTitle:a("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${x}/mcp-server`}),e.jsxs(W,{fullWidth:!0,children:[e.jsx(_,{id:"server-select-label",children:a("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:i?.did||"",label:a("mcp.available"),onChange:u,children:r.map(o=>e.jsx(N,{value:o.did,children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(E,{variant:"rounded",shape:"square",did:o.did,src:o.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:o.name})]})},o.did))})]}),i&&e.jsx(T,{endpoint:i.endpoint})]}):e.jsx(w,{color:"warning",children:a("mcp.noServer")})}export{ce as default};
@@ -1,4 +1,4 @@
1
- import{M as m,j as e,Q as c,bf as B,P as C,ai as E,o as I,bg as P,O as z}from"./vendor-mui-core-D1KE_LWA.js";import{r as o}from"./vendor-react-Dvs43sk9.js";import{n as A}from"./vendor-utils-D9t34RpH.js";import{l as p}from"./vendor-ux-JJc9HQAK.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[g,l]=o.useState(!1),n=o.useRef(null),j=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:g,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:j})})})})]})}L.Item=m;const v=p(P)`
1
+ import{M as m,j as e,Q as c,bf as B,P as C,ai as E,o as I,bg as P,O as z}from"./vendor-mui-core-BkVXEDpj.js";import{r as o}from"./vendor-react-Dvs43sk9.js";import{n as A}from"./vendor-utils-RRCPRD-7.js";import{l as p}from"./vendor-ux-Cm4oSE3n.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[g,l]=o.useState(!1),n=o.useRef(null),j=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:g,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:j})})})})]})}L.Item=m;const v=p(P)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1,4 +1,4 @@
1
- import{j as e,T as i}from"./vendor-mui-core-D1KE_LWA.js";import{K as p,L as c}from"./vendor-utils-D9t34RpH.js";import{l as x}from"./vendor-ux-JJc9HQAK.js";function y({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(d,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const d=x("div")`
1
+ import{j as e,T as i}from"./vendor-mui-core-BkVXEDpj.js";import{K as p,L as c}from"./vendor-utils-RRCPRD-7.js";import{l as x}from"./vendor-ux-Cm4oSE3n.js";function y({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(d,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const d=x("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1,4 +1,4 @@
1
- import{r as b}from"./vendor-react-Dvs43sk9.js";import{j as e,y as V,x as G,bb as X,M as Q,ak as d,W as u,a6 as ke,cf as ve,b1 as Y,z as U,b6 as we,a5 as Te,at as P,T as N,cg as Ae,c9 as Ke,aX as Re}from"./vendor-mui-core-D1KE_LWA.js";import{T as D,G as B,n as F,c as De,b as ie,k as H,H as Se,a0 as Ie,o as Be,a1 as $e,P as Ee,p as Ne}from"./vendor-ux-JJc9HQAK.js";import{f as _e}from"./index-DBs9Ljax.js";import{B as ae,o as re,l as ce}from"./index-BZl53MLv.js";import{a as le}from"./passport-item-DJbWiXVs.js";import{c as L,Y as I,p as Pe,aB as We,a7 as Le,f as ze}from"./index-MzaNcHRo.js";import{u as W}from"./team-BmLR1DD5.js";import{T as de}from"./index-x4EbwKKT.js";import{C as pe}from"./confirm-CQUC-h9X.js";import{R as qe,C as _}from"./vendor-utils-D9t34RpH.js";import{u as Me}from"./session-DGSuFVuR.js";import{C as O}from"./click-to-copy-Dex2pQN3.js";import{f as Ue}from"./index-BojVbZw0.js";import{D as Fe}from"./delete-confirm-FEUxkG43.js";import{P as He}from"./permission-DUZq76k-.js";import{l as z}from"./vendor-arcblock-Basg90AF.js";import{B as Oe}from"./bundle-avatar-BW3kxeeK.js";import{W as Ve}from"./did-address-BsD0Ja6f.js";import{A as Ge}from"./actions-BEg2ZR9n.js";import{u as Xe}from"./use-mobile-BhjEPXJE.js";import{T as oe}from"./table-tips-OHHAUf8b.js";import{t as Qe}from"./vendor-hooks-XYaYmqUz.js";import"./lottie-web-4koyQiv_.js";import"./util-BY4Jjo2q.js";import"./base32-BM0EGG_G.js";import"./isURL-CUg0M0vI.js";import"./use-app-logo-BZP6g7du.js";import"./arrow-down.svg-BiYMv82Y.js";import"./vendor-mui-x-35VYXdLE.js";import"./AdapterDayjs-CsjxEemY.js";function J({value:s}){const{t,locale:n}=D(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}J.propTypes={value:u.string.isRequired};function Z({value:s,onChange:t,...n}){const{t:i}=D(),o=b.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(V,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(X,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),children:o.map(c=>e.jsx(Q,{value:c.value,children:e.jsxs(d,{children:[e.jsx("span",{children:c.title}),e.jsx(d,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:c.description})]})},c.value))})]})}Z.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const ee=()=>{const s=L.RBAC_CONFIG.roles.filter(o=>o.passport),{inService:t}=I(),{roles:n}=W(),i=[...s,...t?n:[]];return qe(i,"name").filter(o=>o.name!==L.ROLES.OWNER)};function me(){const{session:s}=Me(),t=ee();return b.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(c=>c.name==="guest");return[...t.filter(c=>c.name!=="guest").filter(c=>s.user.passports.find(g=>g.role===c.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ue({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=W(),{t:o}=D(),[c,g]=b.useState(!1),[x,v]=b.useState(null),p=me(),K=()=>{g(!1),v(null)},h=async l=>{const{remark:C,passport:y,authType:a}=l;g(!0);const w=await n.createAccessKey({input:{teamDid:i,remark:C.trim(),passport:y,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:a}}),{data:R}=w;s(R),v(null),g(!1)},m={title:`${o("common.create")} ${o("accessKey")}`,description:(l,C,y)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(U,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:a=>{C({...l,remark:a.target.value,__disableConfirm:!l.passport||!a.target.value.trim()}),a.target.value.trim()?y(""):y(o("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:o("setting.accessKey.passport")}),e.jsx(X,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:a=>{const w=a.target.value;y(null),C({...l,passport:w,__disableConfirm:!l.remark||!w})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:c,children:p.map(a=>e.jsx(Q,{value:a.name,"data-cy":`create-access-key-passport-option-${a.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:a.title||a.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:a.description})]})},a.name))})]}),e.jsx(Z,{value:l.authType,onChange:a=>{C({...l,authType:a.target.value})}}),e.jsx(de,{placeholder:o("setting.accessKey.expireTime"),value:l.expireAt,onChange:a=>{C({...l,expireAt:a,__disableConfirm:!l.passport||!l.remark||!a})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:h,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(m),className:"rule-action",children:[c?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),o("common.create")]}),x&&e.jsx(pe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}ue.propTypes={remark:u.string,onCreate:u.func};function xe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:o}=b.useContext(De),[c,g]=b.useState(!1),[x,v]=b.useState(()=>i),p=I(),K=()=>{v(!x)},h=y=>{g(y.target.checked)},m=_(window.location.origin,p?.info?.routing?.adminPath),l=b.useMemo(()=>i?`const Client = require('@blocklet/server-js');
1
+ import{r as b}from"./vendor-react-Dvs43sk9.js";import{j as e,y as V,x as G,bb as X,M as Q,ak as d,W as u,a6 as ke,ck as ve,b1 as Z,z as U,b6 as we,a5 as Te,at as P,T as N,cl as Ae,c9 as Ke,aX as Re}from"./vendor-mui-core-BkVXEDpj.js";import{T as D,a6 as B,D as F,G as De,F as ie,N as H,H as Se,ai as Ie,C as Be,aj as $e,ac as Ee,O as Ne}from"./vendor-ux-Cm4oSE3n.js";import{f as _e}from"./index-DBs9Ljax.js";import{B as ae,o as re,l as ce}from"./index-B4GUFxTb.js";import{r as le}from"./passport-item-DeYT6d6I.js";import{c as L,Z as I,p as Pe,aE as We,a8 as Le,K as z,f as ze}from"./index-76cnX1rM.js";import{u as W}from"./team-BMcH79D_.js";import{T as de}from"./index-BbwCb-a4.js";import{C as pe}from"./confirm-BCIsFO05.js";import{R as qe,C as _}from"./vendor-utils-RRCPRD-7.js";import{u as Me}from"./session-DjNgTb0E.js";import{C as O}from"./click-to-copy-BoDdgn8d.js";import{f as Ue}from"./index-BojVbZw0.js";import{D as Fe}from"./delete-confirm-DYLVkKGU.js";import{P as He}from"./permission-CskIWHP7.js";import{B as Oe}from"./bundle-avatar-CnFjpDpd.js";import{W as Ve}from"./did-address-DIgY8RPi.js";import{A as Ge}from"./actions-DAS8NTxZ.js";import{u as Xe}from"./use-mobile-BTugf2DR.js";import{T as oe}from"./table-tips-l92NoidG.js";import{t as Qe}from"./vendor-hooks-Clg_9bzt.js";import"./lottie-web-4koyQiv_.js";import"./util-CykZsp5v.js";import"./base32-BJKRqMID.js";import"./vendor-arcblock-2wJSDChZ.js";import"./isURL-CoDhaDcU.js";import"./use-app-logo-BxJ8CI-y.js";import"./arrow-down.svg-B5veoO0J.js";import"./vendor-mui-x-DiiSwpci.js";import"./AdapterDayjs-DV5yorPZ.js";function J({value:s}){const{t,locale:n}=D(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}J.propTypes={value:u.string.isRequired};function Y({value:s,onChange:t,...n}){const{t:i}=D(),o=b.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(V,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(X,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),children:o.map(c=>e.jsx(Q,{value:c.value,children:e.jsxs(d,{children:[e.jsx("span",{children:c.title}),e.jsx(d,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:c.description})]})},c.value))})]})}Y.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const ee=()=>{const s=L.RBAC_CONFIG.roles.filter(o=>o.passport),{inService:t}=I(),{roles:n}=W(),i=[...s,...t?n:[]];return qe(i,"name").filter(o=>o.name!==L.ROLES.OWNER)};function me(){const{session:s}=Me(),t=ee();return b.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(c=>c.name==="guest");return[...t.filter(c=>c.name!=="guest").filter(c=>s.user.passports.find(g=>g.role===c.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ue({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=W(),{t:o}=D(),[c,g]=b.useState(!1),[x,v]=b.useState(null),p=me(),K=()=>{g(!1),v(null)},h=async l=>{const{remark:C,passport:y,authType:a}=l;g(!0);const w=await n.createAccessKey({input:{teamDid:i,remark:C.trim(),passport:y,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:a}}),{data:R}=w;s(R),v(null),g(!1)},m={title:`${o("common.create")} ${o("accessKey")}`,description:(l,C,y)=>e.jsxs(Z,{sx:{gap:3},children:[e.jsx(U,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:a=>{C({...l,remark:a.target.value,__disableConfirm:!l.passport||!a.target.value.trim()}),a.target.value.trim()?y(""):y(o("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:o("setting.accessKey.passport")}),e.jsx(X,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:a=>{const w=a.target.value;y(null),C({...l,passport:w,__disableConfirm:!l.remark||!w})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:c,children:p.map(a=>e.jsx(Q,{value:a.name,"data-cy":`create-access-key-passport-option-${a.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:a.title||a.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:a.description})]})},a.name))})]}),e.jsx(Y,{value:l.authType,onChange:a=>{C({...l,authType:a.target.value})}}),e.jsx(de,{placeholder:o("setting.accessKey.expireTime"),value:l.expireAt,onChange:a=>{C({...l,expireAt:a,__disableConfirm:!l.passport||!l.remark||!a})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:h,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(m),className:"rule-action",children:[c?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),o("common.create")]}),x&&e.jsx(pe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}ue.propTypes={remark:u.string,onCreate:u.func};function xe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:o}=b.useContext(De),[c,g]=b.useState(!1),[x,v]=b.useState(()=>i),p=I(),K=()=>{v(!x)},h=y=>{g(y.target.checked)},m=_(window.location.origin,p?.info?.routing?.adminPath),l=b.useMemo(()=>i?`const Client = require('@blocklet/server-js');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -16,7 +16,7 @@ const result = await client.getBlocklet(
16
16
  { input: { did: rootDid, attachRuntimeInfo: false } },
17
17
  { headers: { 'x-access-blocklet': rootDid } }
18
18
  );
19
- `:p.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,L.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(m,"/api/did/session")}"`,[i,t,n,p.inService,m]),C=b.useMemo(()=>i?`blocklet deploy --endpoint ${p.inService?window.blocklet?.appUrl:m} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[i,t,n,p.inService,m]);return e.jsxs(ie,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:i?!c:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ye,{children:o(i?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(O,{children:t})]}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),x?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:o("setting.accessKey.showSecret")}):e.jsx(O,{children:n})]}),!x&&e.jsxs(M,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(H,{code:l,language:"shell"}),C&&e.jsx(H,{code:C,language:"shell"})]}),i&&e.jsx("div",{children:e.jsx(we,{value:"end",disabled:x,control:e.jsx(Te,{checked:c,onChange:h}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}xe.propTypes={accessKeyId:u.string.isRequired,accessKeySecret:u.string.isRequired,onConfirm:u.func,hideSecret:u.bool};const q=P.div`
19
+ `:p.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,L.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(m,"/api/did/session")}"`,[i,t,n,p.inService,m]),C=b.useMemo(()=>i?`blocklet deploy --endpoint ${p.inService?window.blocklet?.appUrl:m} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[i,t,n,p.inService,m]);return e.jsxs(ie,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:i?!c:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ze,{children:o(i?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(O,{children:t})]}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),x?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:o("setting.accessKey.showSecret")}):e.jsx(O,{children:n})]}),!x&&e.jsxs(M,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(H,{code:l,language:"shell"}),C&&e.jsx(H,{code:C,language:"shell"})]}),i&&e.jsx("div",{children:e.jsx(we,{value:"end",disabled:x,control:e.jsx(Te,{checked:c,onChange:h}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}xe.propTypes={accessKeyId:u.string.isRequired,accessKeySecret:u.string.isRequired,onConfirm:u.func,hideSecret:u.bool};const q=P.div`
20
20
  display: flex;
21
21
  justify-content: space-between;
22
22
  align-items: center;
@@ -24,17 +24,17 @@ const result = await client.getBlocklet(
24
24
  margin-bottom: 8px;
25
25
  `,M=P.div`
26
26
  margin-bottom: 24px;
27
- `,Ye=P.div`
27
+ `,Ze=P.div`
28
28
  font-size: 16px;
29
29
  font-weight: bold;
30
- `;function fe({accessKeyId:s,time:t,remark:n,onDelete:i=()=>{},onClose:o=()=>{}}){const{t:c,locale:g}=D(),{api:x}=I(),{teamDid:v}=W(),p=()=>{o()},K=async()=>{try{await x.deleteAccessKey({input:{teamDid:v,accessKeyId:s}}),i()}catch(l){Se.error(l?.message)}finally{p()}},h=l=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Pe(l,g),timeAge:Ue(new Date(l),We(g))}),m={keyName:n,title:c("setting.accessKey.title"),description:t?`${c("setting.accessKey.description",h(t))}`:`${c("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:c("setting.accessKey.confirm_desc",{name:n}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:K,onCancel:p};return e.jsx(Fe,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})}fe.propTypes={accessKeyId:u.string.isRequired,time:u.string.isRequired,remark:u.string.isRequired,onDelete:u.func,onClose:u.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:i="",expireAt:o="",authType:c="signature",onClose:g=()=>{}}){const{api:x}=I(),{teamDid:v}=W(),{t:p}=D(),[K,h]=b.useState(!1),m=me(),l=()=>{h(!1),g()},C=async a=>{const{accessKeyId:w,remark:R="",passport:f,expireAt:j,authType:$}=a;h(!0),await x.updateAccessKey({input:{teamDid:v,accessKeyId:w,remark:R.trim(),passport:f,expireAt:j?new Date(j).getTime():null,authType:$}}),n(),l()},y={title:`${p("common.update")} ${p("accessKey")}`,description:(a,w,R)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(U,{label:p("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:a.accessKeyId,disabled:!0}),e.jsx(U,{label:p("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:a.remark,onChange:f=>{w({...a,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?R(""):R(p("setting.accessKey.remarkInvalid"))}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:p("setting.accessKey.passport")}),e.jsx(X,{"data-cy":"update-access-key-select-passport",value:a.passport,onChange:f=>{const j=f.target.value;R(null),w({...a,passport:j,__disableConfirm:!a.remark||!j})},fullWidth:!0,label:p("setting.accessKey.passport"),disabled:K,children:m.map(f=>e.jsx(Q,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(Z,{disabled:!0,value:a.authType,onChange:f=>{w({...a,authType:f.target.value})}}),e.jsx(de,{placeholder:p("setting.accessKey.expireTime"),value:a.expireAt,onChange:f=>{w({...a,expireAt:f,__disableConfirm:!a.passport||!a.remark||!f})}})]}),confirm:p("common.confirm"),cancel:p("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:i,expireAt:o,authType:c},onConfirm:C,onCancel:l};return e.jsx(pe,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}ge.propTypes={accessKeyId:u.string.isRequired,remark:u.string,passport:u.string,expireAt:u.string,authType:u.string,onUpdate:u.func,onClose:u.func};function he({accessKey:s,onCancel:t}){const{t:n}=D();return e.jsx(ie,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(Je,{children:e.jsx(ye,{accessKey:s})})})}he.propTypes={accessKey:u.object.isRequired,onCancel:u.func.isRequired};const Je=P(d)`
30
+ `;function fe({accessKeyId:s,time:t,remark:n,onDelete:i=()=>{},onClose:o=()=>{}}){const{t:c,locale:g}=D(),{api:x}=I(),{teamDid:v}=W(),p=()=>{o()},K=async()=>{try{await x.deleteAccessKey({input:{teamDid:v,accessKeyId:s}}),i()}catch(l){Se.error(l?.message)}finally{p()}},h=l=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Pe(l,g),timeAge:Ue(new Date(l),We(g))}),m={keyName:n,title:c("setting.accessKey.title"),description:t?`${c("setting.accessKey.description",h(t))}`:`${c("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:c("setting.accessKey.confirm_desc",{name:n}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:K,onCancel:p};return e.jsx(Fe,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})}fe.propTypes={accessKeyId:u.string.isRequired,time:u.string.isRequired,remark:u.string.isRequired,onDelete:u.func,onClose:u.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:i="",expireAt:o="",authType:c="signature",onClose:g=()=>{}}){const{api:x}=I(),{teamDid:v}=W(),{t:p}=D(),[K,h]=b.useState(!1),m=me(),l=()=>{h(!1),g()},C=async a=>{const{accessKeyId:w,remark:R="",passport:f,expireAt:j,authType:$}=a;h(!0),await x.updateAccessKey({input:{teamDid:v,accessKeyId:w,remark:R.trim(),passport:f,expireAt:j?new Date(j).getTime():null,authType:$}}),n(),l()},y={title:`${p("common.update")} ${p("accessKey")}`,description:(a,w,R)=>e.jsxs(Z,{sx:{gap:3},children:[e.jsx(U,{label:p("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:a.accessKeyId,disabled:!0}),e.jsx(U,{label:p("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:a.remark,onChange:f=>{w({...a,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?R(""):R(p("setting.accessKey.remarkInvalid"))}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:p("setting.accessKey.passport")}),e.jsx(X,{"data-cy":"update-access-key-select-passport",value:a.passport,onChange:f=>{const j=f.target.value;R(null),w({...a,passport:j,__disableConfirm:!a.remark||!j})},fullWidth:!0,label:p("setting.accessKey.passport"),disabled:K,children:m.map(f=>e.jsx(Q,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(Y,{disabled:!0,value:a.authType,onChange:f=>{w({...a,authType:f.target.value})}}),e.jsx(de,{placeholder:p("setting.accessKey.expireTime"),value:a.expireAt,onChange:f=>{w({...a,expireAt:f,__disableConfirm:!a.passport||!a.remark||!f})}})]}),confirm:p("common.confirm"),cancel:p("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:i,expireAt:o,authType:c},onConfirm:C,onCancel:l};return e.jsx(pe,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}ge.propTypes={accessKeyId:u.string.isRequired,remark:u.string,passport:u.string,expireAt:u.string,authType:u.string,onUpdate:u.func,onClose:u.func};function he({accessKey:s,onCancel:t}){const{t:n}=D();return e.jsx(ie,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(Je,{children:e.jsx(ye,{accessKey:s})})})}he.propTypes={accessKey:u.object.isRequired,onCancel:u.func.isRequired};const Je=P(d)`
31
31
  margin-top: -16px;
32
32
 
33
33
  .tabs {
34
34
  margin-left: 0;
35
35
  margin-right: 0;
36
36
  }
37
- `;function ye({accessKey:s}){const{t,locale:n}=D(),{blocklet:i}=Le(),o=I(),c=ee(),g=(i?.children||[]).find(h=>h?.meta?.did===s.componentDid),x=c.find(h=>h.name===s.passport),v=x?x.title:s.passport,p=b.useMemo(()=>o.inService?`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,L.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,o?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,o.inService,o?.info?.routing?.adminPath]),K=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ve,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(O,{children:`blocklet-${z.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(d,{children:le(v,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ae,{showDid:!0,did:s.createdBy,cardType:ce.Detailed,infoType:re.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(J,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...g?[{label:t("setting.accessKey.component"),content:e.jsxs(d,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Oe,{blocklet:g,ancestors:[i]}),e.jsx(d,{sx:{ml:"16px",minWidth:0},children:e.jsxs(d,{className:"component-header",children:[e.jsx(d,{className:"component-name",children:ze.getDisplayName(g,!0)}),e.jsx(d,{className:"component-version",children:g?.meta?.version})]})})]},g)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:p,language:"shell"})}:null].filter(Boolean)}];return e.jsx(Ze,{gap:3,children:e.jsx(d,{className:"info-area",children:K.map(h=>e.jsxs(d,{sx:{mb:3},children:[e.jsx(N,{variant:"h6",sx:{mb:1.5},children:h.title}),e.jsx(d,{className:"info-grid",children:h.items.map(m=>e.jsxs(d,{className:"info-item",children:[e.jsx(d,{className:"info-label",children:e.jsx(N,{variant:"subtitle2",color:"textSecondary",children:m.label})}),e.jsx(d,{sx:{flex:1,minWidth:0},children:m.content})]},m.label))})]},h.title))})})}ye.propTypes={accessKey:u.object.isRequired};const Ze=P(Y)`
37
+ `;function ye({accessKey:s}){const{t,locale:n}=D(),{blocklet:i}=Le(),o=I(),c=ee(),g=(i?.children||[]).find(h=>h?.meta?.did===s.componentDid),x=c.find(h=>h.name===s.passport),v=x?x.title:s.passport,p=b.useMemo(()=>o.inService?`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,L.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,o?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,o.inService,o?.info?.routing?.adminPath]),K=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ve,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(O,{children:`blocklet-${z.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(d,{children:le(v,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ae,{showDid:!0,did:s.createdBy,cardType:ce.Detailed,infoType:re.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(J,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...g?[{label:t("setting.accessKey.component"),content:e.jsxs(d,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Oe,{blocklet:g,ancestors:[i]}),e.jsx(d,{sx:{ml:"16px",minWidth:0},children:e.jsxs(d,{className:"component-header",children:[e.jsx(d,{className:"component-name",children:ze.getDisplayName(g,!0)}),e.jsx(d,{className:"component-version",children:g?.meta?.version})]})})]},g)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:p,language:"shell"})}:null].filter(Boolean)}];return e.jsx(Ye,{gap:3,children:e.jsx(d,{className:"info-area",children:K.map(h=>e.jsxs(d,{sx:{mb:3},children:[e.jsx(N,{variant:"h6",sx:{mb:1.5},children:h.title}),e.jsx(d,{className:"info-grid",children:h.items.map(m=>e.jsxs(d,{className:"info-item",children:[e.jsx(d,{className:"info-label",children:e.jsx(N,{variant:"subtitle2",color:"textSecondary",children:m.label})}),e.jsx(d,{sx:{flex:1,minWidth:0},children:m.content})]},m.label))})]},h.title))})})}ye.propTypes={accessKey:u.object.isRequired};const Ye=P(Z)`
38
38
  .info-card {
39
39
  margin-bottom: 24px;
40
40
  overflow: hidden;
@@ -1 +1 @@
1
- import{j as i,b6 as e,be as a,W as s}from"./vendor-mui-core-D1KE_LWA.js";import{l}from"./vendor-ux-JJc9HQAK.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
1
+ import{j as i,b6 as e,be as a,W as s}from"./vendor-mui-core-BkVXEDpj.js";import{l}from"./vendor-ux-Cm4oSE3n.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};