@abtnode/blocklet-services 1.16.52-beta-20250908-085420-224a58fa → 1.16.52-beta-20250909-073849-4e392ab1

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 (163) hide show
  1. package/api/state/message.js +9 -1
  2. package/dist/assets/{AdapterDayjs-ffU9bx7e.js → AdapterDayjs-CKA_54eZ.js} +1 -1
  3. package/dist/assets/{Google-GRs7AwNK.js → Google-DzJt8j2p.js} +1 -1
  4. package/dist/assets/{access-control-D02QLhEy.js → access-control-D09br-Cx.js} +1 -1
  5. package/dist/assets/{add-component-core-DmrTn-fB.js → add-component-core-BCbsNEyt.js} +1 -1
  6. package/dist/assets/{add-resource-BuXNw0by.js → add-resource-DBuTqFch.js} +1 -1
  7. package/dist/assets/{addon-CJVfVQdN.js → addon-2U31yyFl.js} +1 -1
  8. package/dist/assets/{advanced-BQI2sreZ.js → advanced-DVAtlRsh.js} +1 -1
  9. package/dist/assets/{aigne-CzGA8IUU.js → aigne-CmfV21Mm.js} +1 -1
  10. package/dist/assets/{appearance-BsyCLclh.js → appearance-EmfiaxOZ.js} +1 -1
  11. package/dist/assets/{ar-CPI6kJBB.js → ar-DGfbWcRb.js} +1 -1
  12. package/dist/assets/{arrow-down.svg-CeA5tsyp.js → arrow-down.svg-Gif3Qlbk.js} +1 -1
  13. package/dist/assets/{audit-logs-DE_zWK7V.js → audit-logs-C5x9wWcD.js} +1 -1
  14. package/dist/assets/{authorize-D07NMtq7.js → authorize-YaX9nvjo.js} +1 -1
  15. package/dist/assets/{base32-DUdjIQpj.js → base32-DyHKL8vT.js} +1 -1
  16. package/dist/assets/{bind-account-D809ACvG.js → bind-account-BnNXFevx.js} +1 -1
  17. package/dist/assets/{branding-IdArDAjP.js → branding-BNYDI8rS.js} +1 -1
  18. package/dist/assets/{branding-DLVsPMDM.js → branding-BlOjZ4LN.js} +2 -2
  19. package/dist/assets/{branding-DZQe1PsD.js → branding-Bv9eQfQk.js} +1 -1
  20. package/dist/assets/{bundle-avatar-bJGgXPJZ.js → bundle-avatar-D7OAJcb0.js} +1 -1
  21. package/dist/assets/{button-C0DX42gM.js → button-VDZIHEym.js} +1 -1
  22. package/dist/assets/{click-to-copy-r3y_3V-6.js → click-to-copy-CH3FJWJo.js} +1 -1
  23. package/dist/assets/{complete-C_LldbSL.js → complete-B0a8dWfz.js} +1 -1
  24. package/dist/assets/{component-EW2m-2Hq.js → component-6jLWJQG9.js} +3 -3
  25. package/dist/assets/{config-BppAex79.js → config-BEgT9FgV.js} +1 -1
  26. package/dist/assets/{config-CJ2tOrVe.js → config-CXDgD6Am.js} +1 -1
  27. package/dist/assets/{config-CeYMoY4R.js → config-MLIXNVND.js} +1 -1
  28. package/dist/assets/{config-navigation-QgsadD0w.js → config-navigation-DNtDnJ9O.js} +3 -3
  29. package/dist/assets/{config-space-v48mujCK.js → config-space-D-KJ_Zvk.js} +1 -1
  30. package/dist/assets/{confirm-CV_ukxE_.js → confirm-C969ZG_F.js} +1 -1
  31. package/dist/assets/{connect-DUM8FA7f.js → connect-BYQGcjsx.js} +1 -1
  32. package/dist/assets/{connect-DcYdVgbK.js → connect-DdSQXSfp.js} +1 -1
  33. package/dist/assets/{connect-to-B_ABoYFh.js → connect-to-CtmxY5oP.js} +1 -1
  34. package/dist/assets/{createClass-CpGAUQg2.js → createClass-DNqt7UI8.js} +1 -1
  35. package/dist/assets/{dashboard-CmGsGxlD.js → dashboard-BpRwSCeh.js} +3 -3
  36. package/dist/assets/{de-DXdF82Jr.js → de-DGZI-Bsh.js} +1 -1
  37. package/dist/assets/{delete-confirm-gyn7XAac.js → delete-confirm-CGjwwcqY.js} +1 -1
  38. package/dist/assets/{did-address-CPLUdwKY.js → did-address-4KKI5Z_V.js} +1 -1
  39. package/dist/assets/{domain-UrJgIaK0.js → domain-BV8HnqtN.js} +1 -1
  40. package/dist/assets/{domain-action-card-YXDKcuVT.js → domain-action-card-Bz_-Xazt.js} +1 -1
  41. package/dist/assets/{domains-4FokCnh1.js → domains-NDWqWGFH.js} +1 -1
  42. package/dist/assets/{email-YS4JhMeS.js → email-mSK2XoU_.js} +1 -1
  43. package/dist/assets/engine-c0Vv0qOe.js +1 -0
  44. package/dist/assets/{es-Cdb297yS.js → es-CMwFpp7C.js} +1 -1
  45. package/dist/assets/{exchange-passport-P_xK2-vf.js → exchange-passport-hHgDgdxw.js} +1 -1
  46. package/dist/assets/{form-DT1p2SWd.js → form-BV7lGmay.js} +1 -1
  47. package/dist/assets/{form-text-input-B8adEKSe.js → form-text-input-CyaKz-aW.js} +1 -1
  48. package/dist/assets/{fr-CQValz_y.js → fr-eKsI9Vcp.js} +1 -1
  49. package/dist/assets/{fuel-DP0Q8hTa.js → fuel-DjNr8IWY.js} +1 -1
  50. package/dist/assets/{gen-access-key-BG7JXR4u.js → gen-access-key-DLCb_M09.js} +1 -1
  51. package/dist/assets/{gen-simple-access-key-DaNnWhrp.js → gen-simple-access-key-Cg4jKiTS.js} +1 -1
  52. package/dist/assets/get-safe-url-DJ5I-iKX.js +1 -0
  53. package/dist/assets/{hdkey-BCusmuac.js → hdkey-BJATMZk2.js} +1 -1
  54. package/dist/assets/{hi-CAensap9.js → hi-C0JqybmN.js} +1 -1
  55. package/dist/assets/{home-Bhiyk77K.js → home-PQ364yRa.js} +1 -1
  56. package/dist/assets/{id-6AFgcYKj.js → id-DHF6PX-M.js} +1 -1
  57. package/dist/assets/{iframe-Ce3kroAM.js → iframe-CQuSp4d_.js} +1 -1
  58. package/dist/assets/{index-BrgPswzL.js → index-B6ucEBWQ.js} +1 -1
  59. package/dist/assets/{index-CDP_L1qy.js → index-B9b-a_Uj.js} +3 -3
  60. package/dist/assets/{index-BLonWJ__.js → index-BFMIW-KL.js} +1 -1
  61. package/dist/assets/{index-DPwiaPyc.js → index-BHQHhcdx.js} +1 -1
  62. package/dist/assets/{index-JrJd98Of.js → index-BI5OO07e.js} +1 -1
  63. package/dist/assets/{index-CcYh_TwI.js → index-BjLb1HBo.js} +1 -1
  64. package/dist/assets/{index-BWBlDFjU.js → index-C1b11Gor.js} +1 -1
  65. package/dist/assets/{index-C14bbQSS.js → index-C4j3gH0o.js} +1 -1
  66. package/dist/assets/{index-Cb8NmoOI.js → index-C61enzfv.js} +1 -1
  67. package/dist/assets/{index-DK4dVb7h.js → index-CXDyHIY4.js} +1 -1
  68. package/dist/assets/index-C_MKoY4B.js +124 -0
  69. package/dist/assets/{index-CcGgdXu3.js → index-CcuDh75j.js} +1 -1
  70. package/dist/assets/{index-CipehFwZ.js → index-CfB_bXYI.js} +1 -1
  71. package/dist/assets/{index-BC_z-zsl.js → index-Chtj9VuG.js} +1 -1
  72. package/dist/assets/{index-h9p2Gwwd.js → index-Cik3nAZb.js} +1 -1
  73. package/dist/assets/{index-ClwjZe6L.js → index-Cl62IadO.js} +1 -1
  74. package/dist/assets/{index-O6p0L2t4.js → index-DFGqK9ZQ.js} +1 -1
  75. package/dist/assets/{index-RVnyxqfr.js → index-DP3uANMf.js} +1 -1
  76. package/dist/assets/{index-DCsimtEZ.js → index-DSFB8WaL.js} +1 -1
  77. package/dist/assets/{index-B9WrGYJf.js → index-DSddfOC9.js} +1 -1
  78. package/dist/assets/{index-_sKq7vql.js → index-Dm-MhWfc.js} +1 -1
  79. package/dist/assets/{index-Ed1obN0N.js → index-DtI2e8-p.js} +1 -1
  80. package/dist/assets/{index-DffJvJ-f.js → index-VN_RpImI.js} +4 -4
  81. package/dist/assets/{index-ejiOKw1E.js → index-jhEes964.js} +1 -1
  82. package/dist/assets/{index-Br7RGSFv.js → index-lscqrS5Z.js} +10 -10
  83. package/dist/assets/{index-sflWxhj_.js → index-nwknV05O.js} +1 -1
  84. package/dist/assets/{index-DNgNPmIn.js → index-tt5ea0-c.js} +1 -1
  85. package/dist/assets/{invitation-BZnf93ev.js → invitation-DjO59W1C.js} +1 -1
  86. package/dist/assets/{invite-CBTmzhwp.js → invite-t79Nm2Zx.js} +1 -1
  87. package/dist/assets/{isURL-C56b9oXx.js → isURL-Bx60otHf.js} +1 -1
  88. package/dist/assets/{issue-passport-B0hsJjTB.js → issue-passport-CXTkBSWc.js} +1 -1
  89. package/dist/assets/{item-DFbQgetg.js → item-ZVdS__zd.js} +1 -1
  90. package/dist/assets/{ja-D59y1sZ9.js → ja-c-6MaUg1.js} +1 -1
  91. package/dist/assets/{ko-DlSyClni.js → ko-CTFi4Ndk.js} +1 -1
  92. package/dist/assets/{landing-page-hbXRmObM.js → landing-page-oOptuves.js} +1 -1
  93. package/dist/assets/{layout-n_wdIvvX.js → layout-i3qPT3h9.js} +1 -1
  94. package/dist/assets/{list-DkhTNTRK.js → list-BxMbz6k1.js} +3 -3
  95. package/dist/assets/{list-Dg6YcsMU.js → list-oKgOsN2z.js} +1 -1
  96. package/dist/assets/localization-COWn2xkt.js +1 -0
  97. package/dist/assets/{log-C_yeI_wV.js → log-Bi6PHqUs.js} +1 -1
  98. package/dist/assets/logger-DtNL0LIQ.js +1 -0
  99. package/dist/assets/{login-BUd7xYia.js → login-DDdmbVzv.js} +1 -1
  100. package/dist/assets/{login-oauth-callback-YoW0x_7a.js → login-oauth-callback-D39cBDZP.js} +1 -1
  101. package/dist/assets/{logo-uploader-BMMUJR7a.js → logo-uploader-DRWtRqku.js} +2 -2
  102. package/dist/assets/{lost-passport-DNLvYerq.js → lost-passport-B1R7WTbU.js} +1 -1
  103. package/dist/assets/{open-window-BbZDdsmg.js → open-window-DTzdbnUT.js} +1 -1
  104. package/dist/assets/{over-due-invoice-payment-BY3BR46r.js → over-due-invoice-payment-BkmmmYAi.js} +1 -1
  105. package/dist/assets/{overview-BFVzb-zB.js → overview-BxARj22l.js} +1 -1
  106. package/dist/assets/{passport-item-CRrICCXE.js → passport-item-DgPDBerJ.js} +1 -1
  107. package/dist/assets/{permission-UQGu_-Cf.js → permission-D42aYR9e.js} +1 -1
  108. package/dist/assets/{preferences-CyALDCap.js → preferences-BcDy0kQP.js} +1 -1
  109. package/dist/assets/profile-embed-DOdWPLKA.js +1 -0
  110. package/dist/assets/{pt-C_3CX1PR.js → pt-QkdDdQuw.js} +1 -1
  111. package/dist/assets/{publish-resource-Dp_w1Dsi.js → publish-resource-B0NiskVq.js} +1 -1
  112. package/dist/assets/{react-beautiful-dnd.esm-U2orHJvj.js → react-beautiful-dnd.esm-DFIGUIPG.js} +1 -1
  113. package/dist/assets/{ru-FBGLUlo5.js → ru-swMH4bvc.js} +1 -1
  114. package/dist/assets/{runtime--G1ujVXp.js → runtime-2fPExSHG.js} +1 -1
  115. package/dist/assets/sdk-BeAqfHTz.js +1 -0
  116. package/dist/assets/{security-B3L7qXQI.js → security-Bv7TZuHo.js} +1 -1
  117. package/dist/assets/{session-Ba0-LWgc.js → session-sOrWgMPW.js} +1 -1
  118. package/dist/assets/{setup-DnpqJaf3.js → setup-rvCY-r6K.js} +1 -1
  119. package/dist/assets/{spaces-BhyNdJUR.js → spaces-BCmMWVI9.js} +1 -1
  120. package/dist/assets/{start-C4D5Pzw8.js → start-B0m4kfc8.js} +1 -1
  121. package/dist/assets/{starting-progress-lkMq6cOR.js → starting-progress-BTBrLO78.js} +1 -1
  122. package/dist/assets/{status-eTkWlbrh.js → status-CUW3huRP.js} +1 -1
  123. package/dist/assets/{step-actions-vRB4cPjs.js → step-actions-DF1OO2xv.js} +1 -1
  124. package/dist/assets/{studio-1TB86ZrO.js → studio-Xl6uVEBK.js} +1 -1
  125. package/dist/assets/{switch-control-BSK_y5_P.js → switch-control-AvyGKeHh.js} +1 -1
  126. package/dist/assets/{table-tips-Da_IM0mp.js → table-tips-1QxzlCjR.js} +1 -1
  127. package/dist/assets/{team-cktMvdm0.js → team-DXp2kdu1.js} +1 -1
  128. package/dist/assets/{th-DmSMYMH5.js → th-DuqieD90.js} +1 -1
  129. package/dist/assets/{traffic-h0HcpbzT.js → traffic-5td870d8.js} +1 -1
  130. package/dist/assets/{transfer-B1a67F8a.js → transfer-BtDVmVUd.js} +1 -1
  131. package/dist/assets/{unsubscribe-CS5n7_0d.js → unsubscribe-BRrYNDWq.js} +1 -1
  132. package/dist/assets/{use-app-logo-CPHV51wY.js → use-app-logo-mu7QCMiy.js} +1 -1
  133. package/dist/assets/{use-window-close-WM1XwCg5.js → use-window-close-Dxp_DCzQ.js} +1 -1
  134. package/dist/assets/{useLocalStorage-CKq67DKE.js → useLocalStorage-DyyYsV_-.js} +1 -1
  135. package/dist/assets/{user-center-CNEk-tbg.js → user-center-CU9t4WoO.js} +4 -4
  136. package/dist/assets/user-follower-CZumNR6l.js +32 -0
  137. package/dist/assets/{user-sessions-vBiV3ZpR.js → user-sessions-BcCJ6YmQ.js} +1 -1
  138. package/dist/assets/{util-BhLlQ2DE.js → util-Dffdnd4E.js} +1 -1
  139. package/dist/assets/{util-DgyQXNeO.js → util-RS7QU94f.js} +1 -1
  140. package/dist/assets/{vendor-arcblock-DNHIum0y.js → vendor-arcblock-CzdgnaKl.js} +1 -1
  141. package/dist/assets/{vendor-ux-D0eHYGOw.js → vendor-ux-DnuP69h2.js} +1 -1
  142. package/dist/assets/{vi-CjDg6MoB.js → vi-42QzvOuM.js} +1 -1
  143. package/dist/assets/{wait-connect-a1iJrIWL.js → wait-connect-D_jGn7lY.js} +1 -1
  144. package/dist/assets/{wizard-DJ-ny10T.js → wizard-BZlSlN9j.js} +1 -1
  145. package/dist/assets/{wizard-components-BTwaxDI2.js → wizard-components-CI8Erh9Q.js} +2 -2
  146. package/dist/assets/wrap-locale-YgVg0_fN.js +1 -0
  147. package/dist/assets/{zh-DzdD_L9N.js → zh-BRHJ9MGq.js} +1 -1
  148. package/dist/assets/{zh-wVmF24jB.js → zh-Blu7Gys0.js} +1 -1
  149. package/dist/assets/{zh-DaR6QxjC.js → zh-C-k4DKK-.js} +1 -1
  150. package/dist/assets/{zh-tw-yfBxbyqP.js → zh-tw-BLENKI0o.js} +1 -1
  151. package/dist/assets/{zh-tw-DaxtX1HY.js → zh-tw-Dxa4oubT.js} +1 -1
  152. package/dist/index.html +3 -3
  153. package/dist/service-worker.js +1 -1
  154. package/package.json +31 -31
  155. package/dist/assets/engine-7LquCtMt.js +0 -1
  156. package/dist/assets/get-safe-url-DPk9Y1BS.js +0 -1
  157. package/dist/assets/index-CpGvMg-0.js +0 -124
  158. package/dist/assets/localization-BZqBkopy.js +0 -1
  159. package/dist/assets/logger-CjTCwj01.js +0 -1
  160. package/dist/assets/profile-embed-pDRs_z78.js +0 -1
  161. package/dist/assets/sdk-jN4-Pc0q.js +0 -1
  162. package/dist/assets/user-follower-CKUYyDFI.js +0 -32
  163. package/dist/assets/wrap-locale-DVJLDD-_.js +0 -1
@@ -0,0 +1,124 @@
1
+ import{j as e,y as Pt,bb as Re,M as ae,ak as f,Q as q,W as u,J as xe,c0 as Rt,I as D,aN as It,T,aj as Tt,b5 as Be,P as We,b6 as J,a5 as Oe,z as Ze,A as Je,ci as At,bf as Mt,U as Ce,d5 as zt,d6 as Et,at as te,d7 as Lt,a6 as V,n as le,D as Bt,d8 as Wt,ar as Ne,b1 as Ie,d9 as Ot,aX as Nt,ai as Dt,am as X,bp as $t,bq as ve,a$ as Ut,cS as Ft}from"./vendor-mui-core-Bq_sfmbr.js";import{r as b,a as _t,u as qt,j as Ht}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Y as Gt,a6 as Kt,R as De,D as Yt,C as ce,n as Y,A as Vt}from"./vendor-utils-DQK0pEML.js";import{a as Qt,G as Zt,bw as Jt,c as Te,d as Xt,Y as er,bx as tr,aZ as Ae,W as fe,bh as rr,by as nr,a5 as or,a$ as sr,a6 as ir,bz as ar}from"./index-lscqrS5Z.js";import{a as I,h as et,k as re,g as H,b as E,j as lr}from"./vendor-hooks-DLNZ8kxG.js";import{l as tt}from"./arrow-down.svg-Gif3Qlbk.js";import{G as Me,ab as N,T as O,aM as cr,O as rt,aN as dr,H as _,aO as ur,aP as pr,aQ as $e,J as xr,D as nt,I as ze,aR as fr,aS as M,a2 as hr,a1 as gr,$ as ot,aT as mr,aU as br,a0 as yr,C as de,a6 as Ue,ac as vr,aj as Fe}from"./vendor-ux-DnuP69h2.js";import{N as wr}from"./list-oKgOsN2z.js";import{d as jr}from"./search-4YYphs0l.js";import{B as _e}from"./bundle-avatar-D7OAJcb0.js";import{h as qe,T as Cr}from"./team-DXp2kdu1.js";import{b as Sr,d as kr,a as Pr,c as Rr,e as Ir,f as Tr,_ as Ar}from"./user-center-CU9t4WoO.js";import{N as st,U as it}from"./index-jhEes964.js";import{u as Q}from"./use-mobile-C8UweHoJ.js";import Mr from"./index-nwknV05O.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as Se}from"./index-BjLb1HBo.js";import{U as we}from"./user-sessions-BcCJ6YmQ.js";import zr from"./index-DSFB8WaL.js";import{o as Er}from"./vendor-arcblock-CzdgnaKl.js";import{c as Lr,b as ue,a as Br,S as Wr}from"./index-DFGqK9ZQ.js";import"./index-C4j3gH0o.js";import"./index-BojVbZw0.js";import{U as Or}from"./user-follower-CZumNR6l.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BI5OO07e.js";import"./util-RS7QU94f.js";import"./base32-DyHKL8vT.js";import"./session-sOrWgMPW.js";import"./isURL-Bx60otHf.js";import"./use-app-logo-mu7QCMiy.js";import"./index-CfB_bXYI.js";import"./api-sewNv0AE.js";import"./table-tips-1QxzlCjR.js";import"./use-mobile-D2h0sedv.js";import"./passport-item-DgPDBerJ.js";import"./did-address-4KKI5Z_V.js";import"./index-CXDyHIY4.js";import"./vendor-mui-x-BbwECMfi.js";import"./AdapterDayjs-CKA_54eZ.js";import"./confirm-C969ZG_F.js";import"./click-to-copy-CH3FJWJo.js";import"./delete-confirm-CGjwwcqY.js";import"./permission-D42aYR9e.js";import"./actions-Cqn-jwqV.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function o({root:s,rootMargin:n,threshold:a}){let i=t.get(s);i||(i=new Map,t.set(s,i));let l=JSON.stringify({rootMargin:n,threshold:a}),p=i.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(m=>{r.get(m.target)?.(m)})},{root:s,rootMargin:n,threshold:a}),entryCallbacks:r},i.set(l,p)}return{observe:(r,x)=>{p.entryCallbacks.set(r,x),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:o}}var Dr="0px",$r=[0],Ur=Nr();function Fr(t){let o=t?.rootMargin??Dr,s=t?.threshold??$r,n=b.useRef(null),a=b.useRef(null),i=b.useRef(null),[l,p]=b.useState(),r=b.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Ur.getObserver({root:a.current,rootMargin:o,threshold:s});v.observe(C,c=>{p(c)}),i.current=v},[o,s]),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(),a.current=C,r()},[r,x]);return[m,{entry:l,rootRef:h}]}var _r=Fr;function qr(t){let[o,s]=_r(t),n=!!s.entry?.isIntersecting,[a,i]=b.useState(n);return n&&!a&&i(!0),[o,{...s,isVisible:n,wasEverVisible:a}]}var Hr=qr,Gr=100;function Kr({loading:t,hasNextPage:o,onLoadMore:s,rootMargin:n,disabled:a,delayInMs:i=Gr}){let l=b.useRef(s),[p,{rootRef:r,isVisible:x}]=Hr({rootMargin:n});b.useEffect(()=>{l.current=s},[s]);let m=!a&&!t&&x&&o;return b.useEffect(()=>{if(m){let h=setTimeout(()=>{l.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[p,{rootRef:r}]}var Yr=Kr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:o=8}){return je[t]?e.jsx(f,{component:"span",sx:{display:"inline-block",width:o,height:o,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}at.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function at({theme:t="dark",type:o="button",onSelectType:s,extra:n=void 0,currentTab:a="",loading:i=!1,...l}){const{t:p}=b.useContext(Me),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],x=g=>{(g!==a||!i)&&s(g)},m=b.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:o==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return o==="line"?Object.assign(g,{}):g},[o,t]),h=(g,k,R)=>e.jsx(q,{disabled:i,onClick:()=>x(g.value),className:`profile-button ${k?"active":""}`,...l,children:g.label},g.value||R),C=(g,k,R)=>e.jsx(q,{variant:"text",disabled:i,onClick:()=>x(g.value),className:`profile-line-button ${k?"active":""}`,...l,children:g.label},g.value||R),v=()=>r?.map((g,k)=>{const R=a===g?.value;return o==="line"?e.jsx(b.Fragment,{children:C(g,R,k)},g.value||k):e.jsx(b.Fragment,{children:h(g,R,k)},g.value||k)}),c=g=>{const{value:k}=g.target;x(k==="all"?"":k)};return o==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Re,{value:a||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(tt,{...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,k)=>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||k))})}):e.jsxs(f,{className:"severity-tabs",sx:m,children:[e.jsx(f,{sx:{...o==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:o,onChange:s}){const{t:n}=b.useContext(Me),a=xe(r=>r.breakpoints.down("md"));if(o.pageCount<=0||a)return null;const i=(r,x)=>{s({page:x+1})},l=r=>{const x=Number(r.target.value);s({page:1,pageSize:x})},p=o.page-1<=0?0:o.page-1;return e.jsx(f,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:o.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:x,count:m})=>`${r}–${x} / ${m!==-1?m:`${n()}more than ${x}`}`,rowsPerPage:o.pageSize,onPageChange:i,onRowsPerPageChange:l})})}const Vr=b.memo(lt),Qr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},He=6,Ge={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Zr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Zr,width:"calc(50% - 8px)"});ct.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function ct({onFilterChange:t=()=>{},loading:o=!1,type:s="service",blockletMap:n={},filterType:a="component",selectedId:i=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:x=()=>{},currentReadFilter:m="all"}){const{t:h}=b.useContext(Me),[C,v]=b.useState(null),c=!!C,[g,k]=b.useState(i),[R,P]=b.useState(l),[y,z]=b.useState(!1),[L,U]=b.useState(""),[j,S]=b.useState([]);b.useEffect(()=>{k(i),P(l)},[i,l]);const B=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=d=>{(d!==m||!o)&&x(d)},Z=[{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=d=>{v(d.currentTarget),U(""),z(!1)},ge=()=>{v(null)},oe=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];k(w),t({id:w,severity:R})},se=d=>{const w=R.includes(d)?R.filter(A=>A!==d):[...R,d];P(w),t({severity:w,id:g})},me=d=>{U(d.target.value)},be=()=>{z(!y)},K=_t.useMemo(()=>{if(!n.size)return[];const d=[];return a==="component"&&d.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;(a==="component"&&F!==A||a==="entity"&&F===A)&&d.push({label:W,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,a,h]);b.useEffect(()=>{if(L.trim()==="")S(K);else{const d=L.toLowerCase(),w=K.filter(A=>A.label.toLowerCase().includes(d));S(w)}},[L,K]);const ye=L.trim()!==""||y?j:j.slice(0,He);return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(f,{sx:{display:"flex",gap:1.5},children:B.map(d=>e.jsxs(q,{disabled:o,onClick:()=>G(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...s==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:ne,disabled:o,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(N,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,anchorEl:C,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(T,{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:()=>{k([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children: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:Z.map(d=>e.jsx(We,{elevation:0,sx:Ke(R.includes(d.value)),children:e.jsx(J,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(Oe,{checked:R.includes(d.value),onChange:()=>se(d.value),disabled:o,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.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(T,{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(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(N,{icon:jr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(d=>e.jsx(We,{elevation:0,sx:Ke(g.includes(d.id)),children:e.jsx(J,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(Oe,{checked:g.includes(d.id),onChange:()=>oe(d.id),disabled:o,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx(_e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(T,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),j.length>He&&L.trim()===""&&e.jsx(q,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:y?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),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(d=>{const w=Z.find(A=>A.value===d);return e.jsx(Ce,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),w?w.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=K.find(A=>A.id===d);return e.jsx(Ce,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(_e,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Jr=te(Lt)`
2
+ position: fixed;
3
+ bottom: 20px;
4
+ right: 20px;
5
+ z-index: 1000;
6
+ @media (max-width: 600px) {
7
+ bottom: 16px;
8
+ right: 16px;
9
+ transform: scale(0.9);
10
+ }
11
+ `;function Xr(){const[t,o]=b.useState(!1);b.useEffect(()=>{const n=Xe(()=>{o(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(zt,{in:t,children:e.jsx(Jr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Et,{})})})}const en=te.div`
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: ${t=>t.inDialog?0:"24px"};
15
+ .MuiContainer-root {
16
+ padding-right: 0;
17
+ }
18
+
19
+ .profile-button.MuiButtonBase-root {
20
+ border-radius: 9999px;
21
+ margin-right: 2px;
22
+ padding: 5px 12px;
23
+ line-height: 22px;
24
+ font-size: 13px;
25
+ border: 1px solid transparent;
26
+ background-color: ${({theme:t})=>t.palette.background.default};
27
+ color: ${({theme:t})=>t.palette.text.primary};
28
+ font-weight: 400;
29
+ border: 1px solid ${({theme:t})=>t.palette.divider} !important;
30
+ }
31
+ .profile-button.active.MuiButtonBase-root,
32
+ .profile-button.active.MuiButtonBase-root:hover {
33
+ color: ${({theme:t})=>t.palette.primary.main};
34
+ font-weight: 600;
35
+ background-color: ${({theme:t})=>le(t.palette.primary.main,.1)};
36
+ border: 1px solid ${({theme:t})=>le(t.palette.primary.main,.24)} !important;
37
+ }
38
+
39
+ .profile-button.MuiButtonBase-root:hover {
40
+ background-color: rgba(0, 0, 0, 0.04);
41
+ }
42
+
43
+ .profile-line-button.MuiButtonBase-root {
44
+ margin-right: 2px;
45
+ color: ${({theme:t})=>t.palette.text.secondary};
46
+ padding: 5px 12px;
47
+ line-height: 22px;
48
+ font-size: 13px;
49
+ border: none !important;
50
+ border-radius: 0;
51
+ }
52
+
53
+ .profile-line-button.active.MuiButtonBase-root {
54
+ color: ${({theme:t})=>t.palette.text.primary};
55
+ border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
56
+ }
57
+
58
+ .profile-button.MuiButtonBase-root:last-of-type,
59
+ .profile-line-button.MuiButtonBase-root {
60
+ margin-right: 0;
61
+ }
62
+
63
+ .profile-line-button.MuiButtonBase-root:hover {
64
+ color: ${({theme:t})=>t.palette.text.primary};
65
+ background-color: unset;
66
+ }
67
+
68
+ * {
69
+ scrollbar-width: none; /* Firefox */
70
+ -ms-overflow-style: none; /* IE and Edge */
71
+ }
72
+
73
+ *::-webkit-scrollbar {
74
+ display: none; /* Chrome, Safari and Opera */
75
+ }
76
+ `;dt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function dt({blocklets:t=[],context:o,pagination:s=!0,inDialog:n=!1,filterType:a="component",toViewAll:i=()=>{},type:l="service"}){const{data:p,paging:r,refresh:x,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:g}=o,k=d=>{x({...h,severity:d&&typeof d=="string"?[d]:d||[],paging:{...h.paging,page:1}})},[R]=qt(),P=I(()=>R.get("id"),[R]),y=xe(d=>d.breakpoints.down("md")),[z,L]=b.useState(0),[U,j]=b.useState(!1),S=b.useMemo(()=>h.read===!1?"unread":"all",[h.read]),B=I(()=>Xe(d=>{if(m)return;const w=p.length,A=p.filter(F=>!qe(F)).length;let W={...h,append:!0,paging:{...h.paging,...d,currentPage:(r.currentPage||0)+1}};S==="unread"&&A<w&&d.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...d,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),x(W)},500),[p,h,S,r,m,x]);et(()=>{g&&typeof g=="function"&&g()}),b.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),b.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=I(()=>p?.length>0&&p.length<z,[p,z]),Z=b.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(d)||A.findIndex(W=>W===d)>-1},[v]),ne=b.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{d.has(W)||d.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const F=W?.did||W.meta?.did;F&&!d.has(F)&&Z(F)&&(W.ancestors=[w],d.set(F,W))})}),d},[t,Z]),ge=b.useCallback(()=>{m||B({page:r.page+1})},[r.page,m,B]),[oe]=Yr({loading:m,hasNextPage:G,onLoadMore:ge}),se=d=>{!d||qe(d)||C(d.id).then(()=>{n&&i()})},me=({severity:d,id:w})=>{if(m)return;let A={};a==="component"?A={entityId:[],componentDid:w}:a==="entity"&&(A={componentDid:[],entityId:w}),x({...h,severity:d,...A,paging:{...h.paging,page:1}})},be=d=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=Gt(w,"read"),x(w)},K=I(()=>a==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:a==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,a]),ye=I(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(en,{inDialog:!!n,children:[n?e.jsx(at,{currentTab:ye,type:"line",theme:"light",onSelectType:k}):e.jsx(ct,{loading:m,blockletMap:ne,unReadCount:c,filterType:a,type:l,selectedId:K,onFilterChange:me,severity:h.severity,onReadFilterChange:be,currentReadFilter:S}),!y&&m?e.jsx(f,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(V,{})}):e.jsx(wr,{data:p,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:l}),s&&!y?e.jsx(Vr,{loading:m,paging:r,onChange:B}):null,s&&y&&(m||G)?e.jsx(f,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(V,{})}):null,!n&&y?e.jsx(Xr,{}):null]})}const tn=b.memo(dt),$=new Jt;function he(t){const{userDid:o=""}={},{session:s}=Qt(),n=I(()=>{if(o)return o;const r=window.location.href,x=Kt(r);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:s?.user?.did},[s?.user?.did,o]),a=I(()=>s.user,[s]),i=I(()=>a?n===a?.did:!1,[n,a?.did]),l=re(async()=>{if(await Zt(()=>s?.initialized),i)return s.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,s?.initialized,a]}),p=I(()=>a.passports?.some(r=>r.role===Te.ROLES.OWNER),[a]);return{currentDid:n,session:s,isMyself:i,user:a,viewUser:l.data,isOwner:p}}function ut({user:t,...o}){const{t:s}=O(),n=Bt(),a=I(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===cr.REVOKED}));return p.sort((r,x)=>r.revoked===x.revoked?0:r.revoked?1:-1),De(p.filter(r=>!r.display),"role").concat(De(p.filter(r=>r.display),"display.content"))},[t?.passports]),i=I(()=>a?.find(p=>p.name===t.role),[a,t?.role]),l=n.palette.primary.main;return a.length===0?e.jsx(f,{children:e.jsx(rt,{children:s("userCenter.noPassport")})}):e.jsx(f,{...o,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...o.sx},children:a.map(p=>e.jsx(Sr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Xt,title:i&&i.role===p.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===p.role?`0px 2px 4px 0px ${l}, 0px 1px 2px -1px ${l}, 0px 0px 0px 1px ${l} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ut.propTypes={user:u.object.isRequired};function rn({visible:t,onClose:o,nft:s}){return!t||!s?null:e.jsx(nn,{children:e.jsx(Wt,{open:t,onClose:o,children:e.jsx(on,{onClick:o,children:e.jsx(st,{data:it(s),address:s.address,inset:!0})})})})}const nn=te.div`
77
+ position: relative;
78
+ width: 100%;
79
+ height: 100%;
80
+ cursor: pointer;
81
+
82
+ &:hover {
83
+ .mask {
84
+ opacity: 1;
85
+ }
86
+ }
87
+
88
+ .mask {
89
+ position: absolute;
90
+ top: 0;
91
+ left: 0;
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ width: 100%;
96
+ height: 100%;
97
+ background: rgba(0, 0, 0, 0.6);
98
+ opacity: 0;
99
+ transition: opacity 0.2s;
100
+ }
101
+ `,on=te.div`
102
+ display: flex;
103
+ justify-content: center;
104
+ align-items: center;
105
+ height: 100vh;
106
+ width: 100vw;
107
+
108
+ img,
109
+ object {
110
+ max-width: 90vw;
111
+ max-height: 75vh;
112
+ }
113
+
114
+ .nft-display--inset {
115
+ > .MuiBox-root,
116
+ .nft-display__loading {
117
+ width: 75vmin;
118
+ height: 75vmin;
119
+ }
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"}},Ye="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:o}=O(),s=Q(),[n,a]=b.useState({visible:!1,nft:null}),[i,l]=b.useState({anchorEl:null,props:null}),p=P=>{const y=ce(Ye,"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,l({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(Ye,"assets",y.address)}})},x=P=>{a({visible:!0,nft:P})},m=H({page:1,size:20}),h=re(async(P=m)=>(await Yt.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)},k=E(P=>[e.jsx(D,{size:"small",className:"mask-item",onClick:y=>{y.stopPropagation(),p(P.address)},children:e.jsx(N,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(D,{size:"small",onClick:y=>{y.stopPropagation(),r(y.currentTarget,P)},className:"mask-item",children:e.jsx(N,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(D,{size:"small",onClick:y=>{y.stopPropagation(),x(P)},className:"mask-item",children:e.jsx(N,{icon:"tabler:eye",fontSize:18})},"view")]),R=I(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(y=>e.jsx(Ne,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},y));return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ne,{width:"20%"}),e.jsx(f,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(T,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:o("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(rt,{children:o("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",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(f,{className:"footer-mask",sx:an,children:k(P)}):e.jsx(f,{className:"mask",sx:sn,children:e.jsx(Ie,{direction:"row",spacing:1,children:k(P)})})]},P.address))}),c.next||m.page>1?e.jsx(Ot,{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:()=>{a({visible:!1,nft:null})}}),e.jsx(dr,{anchorEl:i.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,c,m.page,m.size,g,i,n]);return e.jsx(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}pt.propTypes={user:u.object.isRequired};function ln(){const{t}=O(),{user:o,isMyself:s,viewUser:n}=he();return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(T,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:o})]}):null,e.jsx(pt,{user:s?o:n})]})}const cn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:o}){const{t:s,changeLocale:n}=O(),a=H({locale:t.locale,loading:!1}),i=E(async l=>{try{const{value:p}=l.target;a.loading=!0,await $.user.saveProfile({locale:p}),await o("profile"),n(p),a.locale=p}catch(p){_.error(ee(p))}finally{a.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:s("userCenter.commonSetting.locale")}),e.jsx(f,{children:e.jsx(Re,{value:a.locale,onChange:i,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||cn).map(l=>e.jsx(ae,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=Y,onDelete:o=Y,onSave:s=Y,onCancel:n=Y,type:a="slack",url:i="",edit:l=!1}){const{t:p}=O(),r=H({type:a||"slack",url:i||"",edit:l??!1,error:"",loading:!1}),x=E(()=>r.url?er(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=a||"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=I(()=>r.error?e.jsx(T,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(V,{size:16}):e.jsx(D,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(N,{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:p("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:p("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(Je,{position:"end",children:v})}}}),e.jsx(f,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(D,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:ur})}),e.jsx(D,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:pr})})]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:Pr})}),e.jsx(D,{color:"error",onClick:()=>{o({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:Rr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function ie({title:t=void 0,description:o=void 0,value:s,onChange:n,isMobile:a}){const i=E(l=>{l.stopPropagation()});return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:n}),e.jsxs(T,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:a?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:a?"normal":"nowrap"},children:[t,o]})]})}ie.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:o}){const{t:s}=O(),n=H({showAdd:!1}),a=re(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=I(()=>({wallet:!0,email:!0,phone:!1,push:!0,...a?.data?.notifications||{}}),[a?.data?.notifications]),l=I(()=>a?.data?.webhooks||[],[a?.data?.webhooks]),p=E(async v=>{try{await $.user.saveUserNotificationConfig(v),_.success(s("userCenter.saveSuccess")),a.run()}catch(c){_.error(ee(c))}}),r=E(async(v,c)=>{await p({notifications:{[v]:c}})}),x=async v=>{try{await $.user.testNotificationWebhook(v),_.success(s("userCenter.webhookTested"))}catch(c){_.error(ee(c))}},m=E(async v=>{await p({webhooks:l.filter((c,g)=>g!==v)})}),h=E(async(v,c)=>{await p({webhooks:l.map((g,k)=>k===v?c:g)})}),C=E(async v=>{await p({webhooks:[...l,v]}),n.showAdd=!1});return a.error?e.jsx(Nt,{severity:"error",children:a.error.message}):a.loading||!a.data?e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(V,{})}):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:o,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:$e(t)&&e.jsx(xr,{did:$e(t),showQrcode:!1,showAvatar:!o,copyable:!0,compact:!0,responsive:!0,startChars:o?2:6})}),e.jsx(ie,{value:i.email,isMobile:o,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(T,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:o,value:i.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Ie,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:x,onDelete:()=>m(c),onSave:(...g)=>h(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(ke,{onTest:x,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(N,{icon:Ir}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function Pe({children:t,...o}){const s=Q(),[n,a]=b.useState(!1),i=E(()=>{a(!n)});return b.useEffect(()=>{a(!1)},[s]),s?e.jsx(Dt,{onClickAway:()=>a(!1),children:e.jsx(X,{...o,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,slotProps:{popper:{disablePortal:!0}},open:n,onClose:i,children:b.cloneElement(t,{onClick:i})})}):e.jsx(X,{...o,children:t})}Pe.propTypes={children:u.node.isRequired};function ht({item:t}){const o=ze(),{blocklet:s}=tr(),{confirmApi:n,confirmHolder:a}=Ae(),i=H({loading:!1}),{t:l}=O(),{session:p}=b.use(fe),{bindOAuth:r,unbindOAuth:x,setBaseUrl:m,baseUrl:h}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=I(()=>fr[t?.provider]||"unknown",[t?.provider]),g=E(y=>y?._bind?y.provider===M.WALLET&&y.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):y.provider===M.PASSKEY&&o.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):y._mainProvider&&o.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),k=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((y,z)=>{n.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(y).catch(z),L()},onCancel:y})});return}try{i.loading=!0,await new Promise((y,z)=>{if(t?._bind)n.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){x({session:p,connectedAccount:{...Vt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(y).catch(z),L()},onCancel:y});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:y,onCancel:z});else{const L=h,U=window?.blocklet;let j="/";const S=hr(U),B=gr(U);S&&B?.appPid&&p?.user?.sourceAppPid&&(j=B.appUrl),m(j),v(s?.appPid),r({session:p,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?l("userCenter.thirdPartyLogin.walletAccount"):y._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):y?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=E(y=>y.provider===M.WALLET&&y.did||y.provider===M.PASSKEY&&(o.arcSphere||o.wallet)?!0:!!t._mainProvider,[o.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(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(rr,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),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(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(f,{children:[e.jsx(T,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(T,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(f,{component:N,icon:nr,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(nt,{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(N,{icon:Tr}),onClick:k,disabled:P(t),loading:i.loading,children:R(t)})})}),a]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:o}=b.use(fe),[s,n]=b.useState({}),{getOAuthConfigs:a}=o.useOAuth(),i=ze();lr(async()=>{const r=await a({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const l=I(()=>{const r=Object.keys(s).map(x=>({...s[x],provider:x})).filter(x=>x.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=I(()=>{const r=mr(t);let x=!1,m="",h=br(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)))),l.map(c=>{if(c.provider===M.AUTH0&&x)return null;const g=x&&c.provider===m?r.find(k=>k.provider===M.AUTH0):r.find(k=>k.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,l]);return e.jsxs(f,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(or,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:Y,onError:Y,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:o}){const[s,n]=b.useState(t),{t:a}=O(),i=E(async(l,p)=>{try{const r=await $.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});n(s.map(x=>({...x,value:r?.[x.key]??x.value}))),_.success(a("userCenter.saveSuccess")),o("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:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(f,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(T,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:a("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:x}=r.target;l.followersOnly?i(l.key,x?"all":"private"):i(l.key,x)}},l.key),l.followersOnly&&p&&e.jsx(f,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(T,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:a("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:x}=r.target;i(l.key,x?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:o}){const s=I(()=>(t?.passports||[])?.find(n=>n.name===o.role),[t?.passports,o?.role]);return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:o.avatar,did:o.did,sx:{flexShrink:0}}),e.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(X,{title:o.fullName,children:e.jsx(T,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:o.fullName})}),e.jsx(Ce,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(X,{title:o.email,children:e.jsx(T,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const dn=()=>Promise.resolve(""),Ve=t=>new we(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we.BROWSER.NAME,we.BROWSER.VERSION]]}).getResult(),Qe={display:"flex",justifyContent:"flex-end",textAlign:"right"},un=new sr({concurrency:1}),Ee=b.memo(({userSession:t,isMobile:o=!1})=>{const s=H({loading:!0,ipRegion:""}),{t:n}=O();b.useEffect(()=>{un.add(async()=>{try{s.ipRegion=await dn(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const a=I(()=>o?{display:"flex",justifyContent:"flex-end"}:{},[o]);return e.jsx(f,{...o&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(T,{variant:"body2",children:s.ipRegion}),e.jsx(Fe,{size:16,className:"ip-address",style:a,children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{size:16,className:"ip-address",style:a,children:t.lastLoginIp||n("userCenter.unknown")}),s.loading?e.jsx(T,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(V,{size:12,color:"inherit"})}):null]})})});Ee.propTypes={userSession:u.object.isRequired,isMobile:u.bool};Ee.defaultProps={isMobile:!1};function yt({user:t,showAction:o=!0,showUser:s=!0,getUserSessions:n,showOffline:a=!1}){const i=H({status:"online",page:1,pageSize:10}),l=H({online:0,expired:0,offline:0}),p=yr(),{t:r}=O(),x=Q({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}),S=j?.paging?.total||0;return l[i.status]=S,{total:S,list:j?.list||[]}});et(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const S=await n({page:1,pageSize:1,status:"offline"});l.offline=S?.paging?.total||0});const c=re(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=I(()=>c.data?.list||[],[c.data?.list]),k=I(()=>{const{status:j}=i;return j==="online"?l[j]<=1:l[j]===0},[g,p]),R=I(()=>de({},x?Qe:{}),[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:S=0}=i,{list:B=[]}=c.data||{},G=B.length||0;S>1&&G===1&&(i.page=Math.max(S-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:p,includeFederated:!0}),i.page=1,c.refresh(),h.close()}})}),z=[];o&&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:k,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const L=I(()=>({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 S=g[j],B=Ve(S?.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 S=g[j],B=Ve(S?.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 S=g[j];return e.jsx(f,{sx:R,children:S.extra?.walletOS?S.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:de({minWidth:150,maxWidth:250},x?Qe:{}),children:e.jsx(bt,{sessionUser:S.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.createdAt?e.jsx(Ue,{value:S.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!a&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.status==="expired"?r("userCenter.expired"):e.jsx(Ue,{value:S.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(Ee,{userSession:S,isMobile:x})}}},o&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:e.jsx(q,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===S.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:S.visitorId}),children:S.status==="expired"?r("userCenter.remove"):p===S.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(vr,{count:c.data?.total||0,data:g,columns:U,customButtons:z,options:L,loading:c.loading,className:"pc-user-sessions-table",title:e.jsxs($t,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(J,{value:"online",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(T,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(T,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(J,{value:"expired",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(T,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(T,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),a?e.jsx(J,{value:"offline",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(T,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(T,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:o}=Ae(),{t:s}=O(),{session:n}=b.use(fe),a=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(l){_.error(l?.message||s("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(T,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(T,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(q,{variant:"contained",color:"error",size:"small",onClick:a,children:s("userCenter.dangerZone.delete")})]})}),o]})}vt.propTypes={onDestroySelf:u.func};function pn(){const t=Q({key:"md"}),o=xe(a=>a.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=I(()=>de({},t?s:{}),[t]);return e.jsx(f,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":o?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:a=>`${a.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(zr,{isSelf:!0,columnSx:n})})}function wt({onDestroySelf:t=void 0,userCenterTabs:o=[]}){const{t:s}=O(),{user:n,session:a,isMyself:i,isOwner:l}=he(),r=ze().arcSphere,x=Q({key:"md"}),m=re(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=I(()=>o.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[o]),C=E(async c=>c==="privacy"?(await m.runAsync(),m.data):(c==="profile"&&await a.refresh(),null));b.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=I(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:n,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:n,isMobile:x})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(pn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(Mr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:h,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:n,showUser:!1,getUserSessions:c=>$.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,x,l,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(T,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(f,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=b.createContext({}),{Provider:xn,Consumer:fo}=jt;function Ct({children:t}){const[o]=b.useState(!1),{session:s}=b.use(fe),{user:n}=s,[a,i]=b.useState(),l=b.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);b.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const p=async()=>{i(void 0)},r=h=>{},x=async h=>{i(h),await r(h.endpoint)},m=!!(l&&a);return e.jsx(xn,{value:{loading:o,spaceGateway:a,session:s,deleteSpaceGateway:p,updateSpaceGateway:x,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function Le(){return b.use(jt)}Ct.propTypes={children:u.node.isRequired};function fn(t){const o=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(o,"space",n)}function St({session:t,spaceGateway:o,spaceStatus:s,refresh:n}){return e.jsxs(Ie,{direction:"row",spacing:1,children:[s===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:a=>{console.error(a),_.error(ee(a))}}),e.jsx(D,{size:"small",LinkComponent:Ut,href:fn(o.endpoint),target:"_blank",children:e.jsx(Ft,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:o}=O(),{updateSpaceGateway:s,session:n}=Le(),a=Q(),i=({spaceGateway:l})=>s(l);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(T,{sx:{fontSize:"16px",fontWeight:"bold"},children:o("userCenter.storage.spaces.connected.title")}),!a&&e.jsx(ue,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(f,{children:t&&e.jsx(Br,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:n,...l})},t.endpoint)}),a&&e.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}kt.propTypes={spaceGateway:u.object};function hn(){const{t}=O(),{updateSpaceGateway:o,session:s}=Le(),n=({spaceGateway:a})=>o(a);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(T,{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:s,onSuccess:n})})]})}function gn(){const{spaceGateway:t,hasStorageEndpoint:o,loading:s}=Le(),{isMyself:n}=he();return n?s?e.jsx(Er,{relative:"parent",children:e.jsx(V,{})}):e.jsx(bn,{children:e.jsx(f,{sx:{maxWidth:"720px"},children:o?e.jsx(kt,{spaceGateway:t}):e.jsx(hn,{})})}):null}function mn(){return e.jsx(Ct,{children:e.jsx(gn,{})})}const bn=te(f)`
122
+ height: 100%;
123
+ overflow-y: auto;
124
+ `;function yn(){const{user:t,isMyself:o,viewUser:s}=he();return e.jsx(f,{children:e.jsx(Or,{teamDid:window?.blocklet?.did||"",user:o?t:s})})}function ho(){const{api:t}=ir(),o=b.useRef(null),n=Ht().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),l=ar(),p=I(()=>({...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(Cr,{children:e.jsxs(Ar,{ref:o,embed:i==="1",currentTab:n?ce(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(tn,{blocklets:[p],context:l}):null,n==="nfts"?e.jsx(ln,{}):null,n==="settings"?e.jsx(wt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(mn,{}):null,n==="user-followers"?e.jsx(yn,{}):null]})})}export{ho as default};
@@ -1,4 +1,4 @@
1
- import{j as e,T as i}from"./vendor-mui-core-Bq_sfmbr.js";import{K as p,L as c}from"./vendor-utils-DQK0pEML.js";import{l as x}from"./vendor-ux-D0eHYGOw.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-Bq_sfmbr.js";import{K as p,L as c}from"./vendor-utils-DQK0pEML.js";import{l as x}from"./vendor-ux-DnuP69h2.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{W as o,j as n,ak as f,f as y,bf as _,av as j,D as L}from"./vendor-mui-core-Bq_sfmbr.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,ak as W,T as A,y as B,a8 as Y}from"./vendor-ux-D0eHYGOw.js";import{aY as H,b0 as P,b1 as V,b2 as C,k as X,b3 as Z,b4 as G,b5 as J,ak as K,b6 as N,b7 as Q}from"./index-Br7RGSFv.js";import{X as U,I as ee,Y as ne}from"./vendor-utils-DQK0pEML.js";import{a as oe}from"./vendor-hooks-DLNZ8kxG.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
1
+ import{W as o,j as n,ak as f,f as y,bf as _,av as j,D as L}from"./vendor-mui-core-Bq_sfmbr.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,ak as W,T as A,y as B,a8 as Y}from"./vendor-ux-DnuP69h2.js";import{aY as H,b0 as P,b1 as V,b2 as C,k as X,b3 as Z,b4 as G,b5 as J,ak as K,b6 as N,b7 as Q}from"./index-lscqrS5Z.js";import{X as U,I as ee,Y as ne}from"./vendor-utils-DQK0pEML.js";import{a as oe}from"./vendor-hooks-DLNZ8kxG.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;
@@ -1,4 +1,4 @@
1
- import{j as a,D as M,T as _,cb as T,Q as W,cc as X,aV as q,ak as h,cd as Y,aU as Z,av as B,f as C,b_ as J,ce as K}from"./vendor-mui-core-Bq_sfmbr.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aX as te}from"./index-Br7RGSFv.js";import{e as ie}from"./vendor-hooks-DLNZ8kxG.js";import{M as re,l as m,ag as A,ah as S}from"./vendor-ux-D0eHYGOw.js";import{z as oe}from"./vendor-arcblock-DNHIum0y.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
1
+ import{j as a,D as M,T as _,cb as T,Q as W,cc as X,aV as q,ak as h,cd as Y,aU as Z,av as B,f as C,b_ as J,ce as K}from"./vendor-mui-core-Bq_sfmbr.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aX as te}from"./index-lscqrS5Z.js";import{e as ie}from"./vendor-hooks-DLNZ8kxG.js";import{M as re,l as m,ag as A,ah as S}from"./vendor-ux-DnuP69h2.js";import{z as oe}from"./vendor-arcblock-CzdgnaKl.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
2
2
  position: relative;
3
3
  .badge-point {
4
4
  position: absolute;
@@ -1,4 +1,4 @@
1
- import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cD as J,ao as V,cE as Ge,ak as h,b1 as G,a$ as Ke,s as fe,cF as be,cs as Fe,am as ge,co as Ye,M as F,aO as Y,bW as $e,aP as $,Q as qe,bh as He,aR as Qe,cG as Xe,cH as Je,cI as Ve,cJ as Ze,c1 as he}from"./vendor-mui-core-Bq_sfmbr.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-DLNZ8kxG.js";import{r as b,u as et}from"./vendor-react-Dvs43sk9.js";import{a8 as O,Z as L,ap as E,X as N,aM as tt,aN as st,aD as nt,c as I,v as ot}from"./index-Br7RGSFv.js";import{H as B,T as D,G as at,al as q,ac as rt,ad as it,D as le,L as ct}from"./vendor-ux-D0eHYGOw.js";import{u as lt}from"./use-mobile-D2h0sedv.js";import{a as H,d as Ce,a0 as dt,c as pt,D as we,C as me}from"./vendor-utils-DQK0pEML.js";import{o as Be}from"./vendor-arcblock-DNHIum0y.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-O6p0L2t4.js";import"./index-C14bbQSS.js";import"./index-BojVbZw0.js";import"./api-sewNv0AE.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-B_ABoYFh.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-BhyNdJUR.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-CcGgdXu3.js";import{E as Et}from"./index-DO9UDa6G.js";import{x as Tt}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-DPk9Y1BS.js";import{S as It}from"./switch-control-BSK_y5_P.js";import{C as Rt,u as Pt}from"./config-space-v48mujCK.js";import{L as ye}from"./list-header-DELs3iEf.js";import"./lottie-web-4koyQiv_.js";import"./index-CcYh_TwI.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Te=b.createContext({}),{Provider:Lt,Consumer:bs}=Te;function Ie({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),T=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},K=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),T?.enabled&&await K({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:K,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:T},children:t})}Ie.propTypes={children:u.any.isRequired};function U(){return b.useContext(Te)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
1
+ import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cD as J,ao as V,cE as Ge,ak as h,b1 as G,a$ as Ke,s as fe,cF as be,cs as Fe,am as ge,co as Ye,M as F,aO as Y,bW as $e,aP as $,Q as qe,bh as He,aR as Qe,cG as Xe,cH as Je,cI as Ve,cJ as Ze,c1 as he}from"./vendor-mui-core-Bq_sfmbr.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-DLNZ8kxG.js";import{r as b,u as et}from"./vendor-react-Dvs43sk9.js";import{a8 as O,Z as L,ap as E,X as N,aM as tt,aN as st,aD as nt,c as I,v as ot}from"./index-lscqrS5Z.js";import{H as B,T as D,G as at,al as q,ac as rt,ad as it,D as le,L as ct}from"./vendor-ux-DnuP69h2.js";import{u as lt}from"./use-mobile-D2h0sedv.js";import{a as H,d as Ce,a0 as dt,c as pt,D as we,C as me}from"./vendor-utils-DQK0pEML.js";import{o as Be}from"./vendor-arcblock-CzdgnaKl.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-DFGqK9ZQ.js";import"./index-C4j3gH0o.js";import"./index-BojVbZw0.js";import"./api-sewNv0AE.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-CtmxY5oP.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-BCmMWVI9.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-CcuDh75j.js";import{E as Et}from"./index-DO9UDa6G.js";import{x as Tt}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-DJ5I-iKX.js";import{S as It}from"./switch-control-AvyGKeHh.js";import{C as Rt,u as Pt}from"./config-space-D-KJ_Zvk.js";import{L as ye}from"./list-header-DELs3iEf.js";import"./lottie-web-4koyQiv_.js";import"./index-BjLb1HBo.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Te=b.createContext({}),{Provider:Lt,Consumer:bs}=Te;function Ie({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),T=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},K=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),T?.enabled&&await K({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:K,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:T},children:t})}Ie.propTypes={children:u.any.isRequired};function U(){return b.useContext(Te)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
2
2
  `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:J[600]},{min:-9,max:-6,color:J[500]},{min:-6,max:-3,color:J[400]},{min:-3,max:-1,color:J[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:V[300]},{min:3,max:6,color:V[400]},{min:6,max:9,color:V[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:V[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ge[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(h,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(h,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Et,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(h,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(G,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Nt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:n="",createdAt:o}){const{t:s}=D(),r=t===I.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=I.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===I.BACKUPS.STATUS.PROGRESS&&!r,i=t===I.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(q,{type:"success",children:s("common.succeeded")}):e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:s("common.failed")}),e.jsx(ge,{style:{display:"flex",alignItems:"center",flexShrink:0},title:n||a,children:e.jsx(be,{children:e.jsx(Ye,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:u.string.isRequired,message:u.string,createdAt:u.string.isRequired};function ze({metadata:t={}}){const{t:n}=D();if(H(t))return e.jsx(q,{type:"success",children:n("common.succeeded")});const o=t.count||0,s=t.size||0,r=Tt(s,{iec:!0}),a=e.jsxs(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[n("common.fileCount"),": ",o]}),e.jsxs(j,{variant:"body2",children:[n("common.fileSize"),": ",r]})]});return e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:n("common.succeeded")}),e.jsx(Nt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(be,{children:e.jsx(Fe,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ze.propTypes={metadata:u.object};function Oe(){const{t,locale:n}=D(),{spaceGateways:o,backups:s,backupsLoading:r}=U(),a=b.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:x,createdAt:g}=s[i],m=x===I.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=I.BACKUPS.TIMEOUT_HOURS,p=x===I.BACKUPS.STATUS.SUCCEEDED&&!m,k=l||o.find(w=>d?.includes(xe(w?.endpoint)))?.name||"Unknown DID Space";return p?e.jsx(Ke,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:x,createdAt:g,metadata:m}=d,p=l===I.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=I.BACKUPS.TIMEOUT_HOURS,k=l===I.BACKUPS.STATUS.PROGRESS&&!p,w=l===I.BACKUPS.STATUS.SUCCEEDED&&!p;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(ze,{metadata:m}):e.jsx(Ae,{status:l,message:x,createdAt:g})}}}],[s,o,t]),c=b.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",n),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function _t(){const{t}=D();return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(xt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(Re,{})]}),e.jsxs(h,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(ve,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Le({spaceGateway:t,onConfirm:n=()=>{},onCancel:o=()=>{}}){const{t:s}=D(),[r,a]=b.useState(!1),[c,i]=b.useState(!1),d=(g,m)=>{g?.preventDefault(),g?.stopPropagation(),a(m)},l=async g=>{try{g?.stopPropagation(),i(!0),await n?.(t),a(!1)}catch(m){console.error(m),B.error(`${s("storage.space.gateway.delete.failed")}: ${Q(m)}`)}finally{a(!1),i(!1)}},x=g=>{d(g,!1),o?.(g)};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{color:"red",onClick:g=>d(g,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx($e,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(it,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:x,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Le.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool}).isRequired,onConfirm:u.func,onCancel:u.func};function Ue({spaceGateway:t,selected:n,onDelete:o=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=U(),[d,l]=b.useState(null),{t:x}=D(),[g,m]=b.useState(!1),p=(S,y)=>{S.stopPropagation(),S.preventDefault(),l(y&&S.currentTarget)},k=async S=>{try{m(!0),p(S,!1),await s(t)}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}},w=async S=>{try{m(!0),p(S,!1),await i()}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[g||t?.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(qe,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>p(S,!0),...c,children:e.jsx(He,{})}),e.jsxs(Qe,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:S=>p(S,!1),children:[e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(t.endpoint?Ct(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Xe,{fontSize:"small"})}),e.jsx($,{children:x("common.open")})]}),e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(wt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Je,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!n&&r&&e.jsxs(F,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(F,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ze,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Le,{spaceGateway:t,onConfirm:async()=>{l(null),await o?.(t)},onCancel:()=>l(null)})]})]})}Ue.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool,endpoint:u.string.isRequired,loading:u.bool}).isRequired,selected:u.bool.isRequired,enableSwitchToSpace:u.bool,onDelete:u.func,onConnect:u.func,backupInProgress:u.bool};const Wt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Me({spaceGateway:t,spaceStatus:n,selected:o,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=O(),{api:l,info:{did:x}}=L(),{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S}=De({blocklet:d}),{backupProgress:y,updateSpaceGateway:Z,deleteSpaceGateway:ee,refreshBackupSummary:te,refreshBackups:se}=U(),[_,M]=b.useState(!1),[T,P]=b.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:m},i),scan:c("storage.spaces.authorize.scan",{appName:m},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{P(C=>({...C,open:!1}))}}),ne=o&&!_&&n===de.DISCONNECTED,oe=o&&!_&&!t.loading&&n===de.CONNECTED,K=o&&_&&n===de.CONNECTED&&y?.progress>=0,X=async()=>{try{if(await Bt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}P(C=>({...C,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:we.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S,nodeDid:x,spaceDid:t.did}}))},ae=async(C,f)=>{const A=f(C.endpoint),R=xe(A),v=C.space?f(C.space):{};if(t.did&&R!==t.did){P(Ne=>({...Ne,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const ce={...t,name:v.name??"DID Space",did:v.did??xe(A),endpoint:A};await Z(ce),P(W=>({...W,open:!1})),s?.(null,ce)},re=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},ie=async()=>{try{await ee(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return b.useEffect(()=>{y?.completed?(o&&(y?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):y.message&&a?.(new Error(y?.message),t),y.progress=0,y.message=""),M(!1),te(),se()):y.progress&&M(!0)},[y]),e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[oe&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:re,children:c("storage.spaces.strategy.backupNow")}),ne&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:X,children:c("storage.spaces.disconnected.reconnectNow")}),K&&e.jsx(Wt,{title:y?.message&&e.jsx(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:y.message})}),children:e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:y?.progress,size:14,sx:{mr:1}}),y?.progress,"%"]})}),e.jsx(ot,{forceConnected:!1,saveConnect:!1,prefix:T.prefix,open:T.open,popup:!0,action:T.action,baseUrl:T.baseUrl,checkFn:T.checkFn,onSuccess:ae,onClose:T.onClose,checkTimeout:T.checkTimeout,extraParams:T.extraParams,messages:T.messages,locale:i},"get-endpoint")]}),e.jsx(Ue,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:ie,onConnect:X,enableSwitchToSpace:y?.completed||H(y?.message),backupInProgress:K})]})}Me.propTypes={spaceGateway:u.shape({did:u.string.isRequired,name:u.string.isRequired,url:u.string.isRequired,endpoint:u.string.isRequired,protected:u.bool,loading:u.bool}).isRequired,spaceStatus:u.string.isRequired,selected:u.bool.isRequired,onConnected:u.func,onDeleted:u.func,onBackedUp:u.func};function Gt({...t}){const{t:n}=D();return e.jsxs(h,{...t,children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("storage.spaces.backup.records")})}),e.jsx(ve,{}),e.jsx(Oe,{})]})}function Kt({...t}){const{t:n}=D(),{autoBackup:o,updateAutoBackup:s}=U(),r=async()=>{try{const a=!o?.enabled;await s({enabled:a}),B.success(n(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(It,{checked:!!o?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:n("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function Ft(){const{t}=D(),{spaceGateways:n,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=U(),r=o&&!n?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(Me,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:x=>x&&l()});return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(Kt,{}),e.jsx(Re,{})]}),e.jsx(h,{sx:{mt:2},children:r?e.jsx(h,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(z,{})}):e.jsx(he,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:n.map(c=>e.jsx(he,{size:{xs:12,md:6},children:e.jsx(ft,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(Gt,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Yt(){const{spaceGatewaysFirstLoading:t,spaceGateways:n}=U();return t?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):H(n)?e.jsx(_t,{}):e.jsx(Ft,{})}function $t(){return e.jsx(Ie,{children:e.jsx(Yt,{})})}function qt(){const{spaceGateway:t,settingStorageEndpoint:n,updateSpaceGateway:o,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=Pt(),c=ue(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(h,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(gt,{spaceGateway:t,settingStorageEndpoint:n}):e.jsx(ht,{}),e.jsx(h,{sx:c,children:e.jsx(St,{onConnect:o,storageEndpoint:a})})]})}function Ht(){const{t}=D();return e.jsxs(Rt,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(qt,{})]})}function Qt({navOrientation:t="vertical",...n}){const{t:o,locale:s}=D(),{blocklet:r}=O(),a=lt({key:"md"}),[c,i]=et(),d=c.get("tab")||"backup",l=a?"horizontal":t,x=ue(()=>{const w=[{label:o("common.backup"),value:"backup"}],S=r?.capabilities?.didSpace;return(S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:o("common.storage"),value:"storage"}),w},[s,l]),m=ue(()=>({backup:e.jsx($t,{}),storage:e.jsx(Ht,{})}))[d],p=w=>{i(S=>(w==="backup"?S.delete("tab"):S.set("tab",w),S))};if(x.length<=1)return e.jsx(pe,{children:m});const k=e.jsx(ct,{tabs:x,current:d,orientation:l,onChange:p,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(h,{...n,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(h,{sx:{flexShrink:0},children:e.jsx(ye,{left:k})}),e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(pe,{sx:{mt:1},children:m})})]})});if(l==="horizontal")return e.jsxs(h,{...n,children:[e.jsx(ye,{left:k}),e.jsx(pe,{sx:{mt:2},children:m})]})}Qt.propTypes={navOrientation:u.oneOf(["vertical","horizontal"])};const pe=fe(h)`
3
3
  position: relative;
4
4
  min-height: 66vh;
@@ -1,4 +1,4 @@
1
- import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-Bq_sfmbr.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{G as S,D as p}from"./vendor-ux-D0eHYGOw.js";import{a as C}from"./page-header-CIjuv0WX.js";import{a8 as g}from"./index-Br7RGSFv.js";import{o as b}from"./vendor-arcblock-DNHIum0y.js";import{u as k}from"./config-space-v48mujCK.js";import{C as y,D as v,a as w}from"./connect-to-B_ABoYFh.js";import{S as c}from"./step-actions-vRB4cPjs.js";import{S as E}from"./layout-n_wdIvvX.js";import"./vendor-utils-DQK0pEML.js";import"./vendor-hooks-DLNZ8kxG.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BhyNdJUR.js";import"./api-sewNv0AE.js";import"./index-O6p0L2t4.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-C14bbQSS.js";import"./index-DBs9Ljax.js";import"./use-mobile-C8UweHoJ.js";import"./content-layout-CotAwqHA.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(D,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const D=j(E)`
1
+ import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-Bq_sfmbr.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{G as S,D as p}from"./vendor-ux-DnuP69h2.js";import{a as C}from"./page-header-CIjuv0WX.js";import{a8 as g}from"./index-lscqrS5Z.js";import{o as b}from"./vendor-arcblock-CzdgnaKl.js";import{u as k}from"./config-space-D-KJ_Zvk.js";import{C as y,D as v,a as w}from"./connect-to-CtmxY5oP.js";import{S as c}from"./step-actions-DF1OO2xv.js";import{S as E}from"./layout-i3qPT3h9.js";import"./vendor-utils-DQK0pEML.js";import"./vendor-hooks-DLNZ8kxG.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BCmMWVI9.js";import"./api-sewNv0AE.js";import"./index-DFGqK9ZQ.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-C4j3gH0o.js";import"./index-DBs9Ljax.js";import"./use-mobile-C8UweHoJ.js";import"./content-layout-CotAwqHA.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(D,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const D=j(E)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{T as default};
@@ -1,4 +1,4 @@
1
- import{D as A1,J as Et,j as d,Y as mt,$ as yt,I as gt,dR as At,ar as S1,ak as te,a$ as Ee,cS as B1,b1 as St,am as D1,T as me,bC as Bt,z as Dt,co as wt,a6 as bt,Q as It}from"./vendor-mui-core-Bq_sfmbr.js";import{C as N,a as Ht,ag as w1,J as fe,c as Tt,w as Ot,B as U,I as vt,F as xt}from"./vendor-utils-DQK0pEML.js";import{T as Ft,a5 as b1,J as Lt,a7 as se,l as Ut,r as kt,a as Rt,b as Nt,c as Pt,d as I1,e as Mt,f as jt,g as Vt,h as H1,i as Jt,j as Kt,k as _t,m as T1,n as Zt,o as Qt,p as Gt,q as Le,s as Xt,t as zt,u as Yt,v as qt,an as Wt,b9 as $t,F as e6,D as Pe,ba as Me}from"./vendor-ux-D0eHYGOw.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{k as O1,b as v1,a as Ie}from"./vendor-hooks-DLNZ8kxG.js";import{bl as Ue,Y as ke,cf as x1,cg as t6,v as r6,bu as n6,bw as i6}from"./index-Br7RGSFv.js";import{x as s6}from"./index-DRYJ0xIl.js";import{f as a6}from"./index-BojVbZw0.js";import{v as je}from"./index-C14bbQSS.js";const ye=Ue({});function o6({key:e}={key:"md"}){const r=A1();return Et(r.breakpoints.down(e))}var L=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(L||{}),F1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(F1||{}),K=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(K||{});function c6({endpoint:e,deps:r=[]}){return O1(async()=>{if(!ke(e))return;const{headers:n}=await ye.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,c,a,f,u,p,E,o,l,C]=[n["x-space-name"],n["x-subscription-id"],n["x-listable"]==="true",n["x-readable"]==="true",n["x-writeable"]==="true",n["x-space-version"],n["x-space-owner-did"],n["x-space-is-available"],n["x-error-code"],n["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(o===void 0||l===void 0){const g=a&&f&&u;return{version:p,name:h,subscriptionId:c,ownerDid:E||"",isAvailable:g,errorCode:g?0:L.UNAUTHORIZED,isSiteAdmin:C==="true"}}return{version:p,name:h,subscriptionId:c,ownerDid:E,isAvailable:o==="true",errorCode:parseInt(l,10),isSiteAdmin:C==="true"}},{refreshDeps:[e].concat(r),onError(n){console.error(n)}})}const u6=x1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
1
+ import{D as A1,J as Et,j as d,Y as mt,$ as yt,I as gt,dR as At,ar as S1,ak as te,a$ as Ee,cS as B1,b1 as St,am as D1,T as me,bC as Bt,z as Dt,co as wt,a6 as bt,Q as It}from"./vendor-mui-core-Bq_sfmbr.js";import{C as N,a as Ht,ag as w1,J as fe,c as Tt,w as Ot,B as U,I as vt,F as xt}from"./vendor-utils-DQK0pEML.js";import{T as Ft,a5 as b1,J as Lt,a7 as se,l as Ut,r as kt,a as Rt,b as Nt,c as Pt,d as I1,e as Mt,f as jt,g as Vt,h as H1,i as Jt,j as Kt,k as _t,m as T1,n as Zt,o as Qt,p as Gt,q as Le,s as Xt,t as zt,u as Yt,v as qt,an as Wt,b9 as $t,F as e6,D as Pe,ba as Me}from"./vendor-ux-DnuP69h2.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{k as O1,b as v1,a as Ie}from"./vendor-hooks-DLNZ8kxG.js";import{bl as Ue,Y as ke,cf as x1,cg as t6,v as r6,bu as n6,bw as i6}from"./index-lscqrS5Z.js";import{x as s6}from"./index-DRYJ0xIl.js";import{f as a6}from"./index-BojVbZw0.js";import{v as je}from"./index-C4j3gH0o.js";const ye=Ue({});function o6({key:e}={key:"md"}){const r=A1();return Et(r.breakpoints.down(e))}var L=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(L||{}),F1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(F1||{}),K=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(K||{});function c6({endpoint:e,deps:r=[]}){return O1(async()=>{if(!ke(e))return;const{headers:n}=await ye.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,c,a,f,u,p,E,o,l,C]=[n["x-space-name"],n["x-subscription-id"],n["x-listable"]==="true",n["x-readable"]==="true",n["x-writeable"]==="true",n["x-space-version"],n["x-space-owner-did"],n["x-space-is-available"],n["x-error-code"],n["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(o===void 0||l===void 0){const g=a&&f&&u;return{version:p,name:h,subscriptionId:c,ownerDid:E||"",isAvailable:g,errorCode:g?0:L.UNAUTHORIZED,isSiteAdmin:C==="true"}}return{version:p,name:h,subscriptionId:c,ownerDid:E,isAvailable:o==="true",errorCode:parseInt(l,10),isSiteAdmin:C==="true"}},{refreshDeps:[e].concat(r),onError(n){console.error(n)}})}const u6=x1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
2
2
  1. Please contact the DID Space administrator to verify the relevant configuration.
3
3
  2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"DID Space is currently unreachable due to potential server issues, network problems, or maintenance. Please click the link to visit the homepage and check its status.",incompatible:`The current connection of DID Spaces version ({spaceVersion}) is not compatible with the component version ({expectVersion}). Please contact the administrator for adjustments.
4
4
  If you are the administrator, you can click the link below to take action.`},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID Spaces NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to DID Spaces"}}},auditLog:{backup:{description:"A backup operation was completed {relativeTime}"},restore:{description:"A restore operation was completed {relativeTime}"},connected:{description:"A connection was established {relativeTime}"},disconnected:{description:"The connection was disconnected {relativeTime}"},objectsSync:{description:"{totalCount} objects ({size}) were synchronized {relativeTime}"}}}),l6=x1.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级",viewMore:"查看更多"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"连接至 DID Spaces",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",blockedByCors:"因 CORS 限制,访问被阻止",unreachable:"DID Space 无法访问",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",cors:`连接请求可能因 CORS 限制而失败: