@abtnode/webapp 1.17.8-beta-20260116-080047-9fdd00d3 → 1.17.8-beta-20260119-102944-6ba93a16

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 (208) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-CHVRCEwB.js → AdapterDayjs-QPUTgQRV.js} +6 -6
  4. package/dist/assets/{Add-IxR__ozX.js → Add-vvp5juzF.js} +1 -1
  5. package/dist/assets/ArrowDropDown-CZ9_k8VG.js +1 -0
  6. package/dist/assets/{Autocomplete-OhxbbTq9.js → Autocomplete-BqPV4fCq.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-CfkRwQNu.js → Breadcrumbs-DEV3jkdC.js} +1 -1
  8. package/dist/assets/{ButtonGroup--8rwLvQ8.js → ButtonGroup-BDg4XqiR.js} +1 -1
  9. package/dist/assets/{CSSTransition-D4fabzL2.js → CSSTransition-CoGzojVI.js} +1 -1
  10. package/dist/assets/{CallMerge-Di3dNXj5.js → CallMerge-C5DyJ6fm.js} +1 -1
  11. package/dist/assets/{CardContent-CPUlyd-R.js → CardContent-rjL6kB_r.js} +1 -1
  12. package/dist/assets/{ChevronLeft-lzYf4tao.js → ChevronLeft-DqSG9UHo.js} +1 -1
  13. package/dist/assets/{ChevronRight-CO-Fv8kP.js → ChevronRight-DxsEcvUg.js} +1 -1
  14. package/dist/assets/{Clear-DriUx9_Q.js → Clear-Bq2o3otF.js} +1 -1
  15. package/dist/assets/{Delete-DkHujAB7.js → Delete-RCnwfW1g.js} +1 -1
  16. package/dist/assets/{DeleteOutline-DUcJA7eO.js → DeleteOutline-BXoQnWFj.js} +1 -1
  17. package/dist/assets/{Done-B_L7rkHk.js → Done-DVQ_2sA2.js} +1 -1
  18. package/dist/assets/{Edit-DgzPfnB_.js → Edit-DVXYin_T.js} +1 -1
  19. package/dist/assets/{EditOutlined-yXcT-6A0.js → EditOutlined-CHgCULNs.js} +1 -1
  20. package/dist/assets/{ErrorOutline-B7jRfGmR.js → ErrorOutline-qdJUw5q6.js} +1 -1
  21. package/dist/assets/{FilterList-DMbHmf0X.js → FilterList-Dfj9GsZN.js} +1 -1
  22. package/dist/assets/{Google-DMfPhzx4.js → Google-BtG0IwAt.js} +1 -1
  23. package/dist/assets/{HelpOutline-Be59cdK1.js → HelpOutline-DaGemEcX.js} +1 -1
  24. package/dist/assets/{Launch-B8FfXmf_.js → Launch-BsxqWG7C.js} +1 -1
  25. package/dist/assets/{Link-wdDqdiCm.js → Link-BRsXeoEC.js} +1 -1
  26. package/dist/assets/{ListItemButton-BHNRxd8I.js → ListItemButton-kpGgMj08.js} +1 -1
  27. package/dist/assets/{ListSubheader-UFJcQfY_.js → ListSubheader-BTZwmxdp.js} +1 -1
  28. package/dist/assets/{LoadingButton-CUdpFc0p.js → LoadingButton-DZ6V6Qhe.js} +1 -1
  29. package/dist/assets/{LottiePlayer.modern-Jxnonfmi.js → LottiePlayer.modern-H3Pn2YNu.js} +1 -1
  30. package/dist/assets/{MoreVert-BVgcfW7V.js → MoreVert-DxM-B8xa.js} +1 -1
  31. package/dist/assets/{OpenInNew-CEBJXmxa.js → OpenInNew-BUUx7OSU.js} +1 -1
  32. package/dist/assets/{Refresh-DrflkqFW.js → Refresh-BV0ShuHj.js} +1 -1
  33. package/dist/assets/{Replay-qvum4SpI.js → Replay-DyvF6A5F.js} +1 -1
  34. package/dist/assets/{Search-CtujvL0H.js → Search-m3CMNGDm.js} +1 -1
  35. package/dist/assets/{Stepper-CJfsKFpi.js → Stepper-DR0cCC-q.js} +1 -1
  36. package/dist/assets/{TableSearch-CdKaHbVQ.js → TableSearch-okRl0dqT.js} +1 -1
  37. package/dist/assets/{ToggleButtonGroup-BP4C4KFu.js → ToggleButtonGroup-DxIvj50j.js} +1 -1
  38. package/dist/assets/{UnfoldMore-BvZuyACH.js → UnfoldMore-CZT-4-ZR.js} +1 -1
  39. package/dist/assets/Verified-C1aYOY3u.js +1 -0
  40. package/dist/assets/{VerifiedUser-D0ltmMtV.js → VerifiedUser-CS3FW2sd.js} +1 -1
  41. package/dist/assets/{ViewList--urcCqVt.js → ViewList-CXrUBR0t.js} +1 -1
  42. package/dist/assets/{_createAggregator-G6HCftPW.js → _createAggregator-BunO9xPF.js} +1 -1
  43. package/dist/assets/{actions-5RspfWE_.js → actions-CoszoXjw.js} +1 -1
  44. package/dist/assets/{actions-DjLoksgL.js → actions-DE2r6nPV.js} +1 -1
  45. package/dist/assets/{actions-CQAb6_Rz.js → actions-MiEliG9R.js} +1 -1
  46. package/dist/assets/{agreement-b4V3Z14P.js → agreement-CiVQRYD2.js} +1 -1
  47. package/dist/assets/api-CKaiYijO.js +1 -0
  48. package/dist/assets/{appearance-AiyB_V1W.js → appearance-DtyCmGdO.js} +1 -1
  49. package/dist/assets/{ar-BHqjWgUQ.js → ar-DOhYGTlW.js} +1 -1
  50. package/dist/assets/{audit-logs-C4Hps2ag.js → audit-logs-DQ3aFS2x.js} +2 -2
  51. package/dist/assets/{babel-sNEik07f.js → babel-yl1c6pTl.js} +1 -1
  52. package/dist/assets/{base-chart-BE2BHY3Y.js → base-chart-G_tNYsY8.js} +1 -1
  53. package/dist/assets/{blocklet-lDvdqhrX.js → blocklet-CzBGFesP.js} +1 -1
  54. package/dist/assets/{chain-BQMbjNUU.js → chain-z8CuvP-V.js} +1 -1
  55. package/dist/assets/{click-to-copy-C6h97nXy.js → click-to-copy-DXIfZNln.js} +1 -1
  56. package/dist/assets/cloneDeep-BDiWjxRu.js +1 -0
  57. package/dist/assets/config-navigation-BYqsSWyl.js +472 -0
  58. package/dist/assets/{connect-B1msLBDb.js → connect-64-QZQcE.js} +3 -3
  59. package/dist/assets/{connect-to-DeMt1m5c.js → connect-to-CeGdVeiX.js} +3 -3
  60. package/dist/assets/{de-QUGQFv2K.js → de-CtKPdGk6.js} +1 -1
  61. package/dist/assets/{delete-confirm-DyLbGAy5.js → delete-confirm-Dh3X0iXU.js} +1 -1
  62. package/dist/assets/{depsEqual-CM0PEscV.js → depsEqual-Bfsv3kHf.js} +1 -1
  63. package/dist/assets/{detail-C3fs8uRl.js → detail-C4nQbO7d.js} +2 -2
  64. package/dist/assets/{domains-CVE_fz_I.js → domains-7n5twKTf.js} +2 -2
  65. package/dist/assets/{download-f9_CnIWg.js → download-CFyTq_FK.js} +1 -1
  66. package/dist/assets/{edit.svg-Bdq-FCGM.js → edit.svg-DBlxe-2U.js} +1 -1
  67. package/dist/assets/emotion-cache.browser.esm-Cu824RS4.js +1 -0
  68. package/dist/assets/engine-Bbh7Mw-7.js +1 -0
  69. package/dist/assets/{es-C4w6cL07.js → es-BSYtSZPg.js} +1 -1
  70. package/dist/assets/{fr-Bq3UipEu.js → fr-C35fi7h9.js} +1 -1
  71. package/dist/assets/{get-safe-url-RPQVYlWr.js → get-safe-url-BTJDduf6.js} +1 -1
  72. package/dist/assets/getValidReactChildren-T3CvLHYr.js +1 -0
  73. package/dist/assets/{graphql-5mE8kB37.js → graphql-Cnx2YXBE.js} +1 -1
  74. package/dist/assets/{graphqlMode-BHMSwqwV.js → graphqlMode-7KCJGlgj.js} +2 -2
  75. package/dist/assets/{hi-DGZy0DLh.js → hi-5fpYJkiW.js} +1 -1
  76. package/dist/assets/{html-title-DE0TrRVC.js → html-title-CQe12Cut.js} +1 -1
  77. package/dist/assets/{id-DOzDilAf.js → id-DoVb0JYr.js} +1 -1
  78. package/dist/assets/{iframe-B7aYePTd.js → iframe-BWle7w_S.js} +1 -1
  79. package/dist/assets/{index-r58wskKh.js → index-AaVex2Te.js} +1 -1
  80. package/dist/assets/{index-B4azxfc8.js → index-B8JpxHJE.js} +1 -1
  81. package/dist/assets/{index-hG-7kift.js → index-BCrgfevn.js} +2 -2
  82. package/dist/assets/index-BHLEff7q.js +369 -0
  83. package/dist/assets/{index-DbRhfp5G.js → index-BMGgZI9D.js} +1 -1
  84. package/dist/assets/{index-CaLjm3Sr.js → index-BXpvvqAs.js} +1 -1
  85. package/dist/assets/{index-D7yowN9E.js → index-BcZYQGNY.js} +8 -8
  86. package/dist/assets/{index-CEn1Olzp.js → index-Bg6faJyI.js} +1 -1
  87. package/dist/assets/{index-B2xyyyAv.js → index-Bv6Ryg7V.js} +1 -1
  88. package/dist/assets/index-BzFgWQ5w.js +1 -0
  89. package/dist/assets/{index-DaEqVg3j.js → index-C73PGWD5.js} +1 -1
  90. package/dist/assets/{index-B29Pha71.js → index-C97bSDg2.js} +3 -3
  91. package/dist/assets/index-CBCPHvf_.js +102 -0
  92. package/dist/assets/{index-B1mmOd5b.js → index-CJ_aJ5dR.js} +1 -1
  93. package/dist/assets/{index-DmCKwIHx.js → index-CQob6fmR.js} +4 -4
  94. package/dist/assets/{index-BqqU8gwj.js → index-CTjBZAn9.js} +1 -1
  95. package/dist/assets/{index-2l_1Jppv.js → index-CUGajpSS.js} +3 -3
  96. package/dist/assets/{index-CWB_ryH-.js → index-CXEKSKL7.js} +1 -1
  97. package/dist/assets/{index-BgYMQ-SO.js → index-ChmYDkPv.js} +2 -2
  98. package/dist/assets/{index-QndNtIi-.js → index-CoHxWTi-.js} +1 -1
  99. package/dist/assets/{index-9co-KaYp.js → index-D42m9V9f.js} +9 -9
  100. package/dist/assets/{index-EzJJEvjR.js → index-D4yrNQ5O.js} +3 -3
  101. package/dist/assets/{index-CPZ5M8hw.js → index-DBtWMsht.js} +1 -1
  102. package/dist/assets/{index-DaVz8byr.js → index-DHLFobHl.js} +3 -3
  103. package/dist/assets/{index-nVFW1KOC.js → index-DJt6Q1WW.js} +1 -1
  104. package/dist/assets/{index-BtOLGXbe.js → index-DSG25x4F.js} +1 -1
  105. package/dist/assets/{index-BfetuCUm.js → index-DTVaw2Hc.js} +4 -4
  106. package/dist/assets/{index-BfQLSa8k.js → index-DUEj1V-j.js} +1 -1
  107. package/dist/assets/{index-Cmj8zxd_.js → index-DVR29wYi.js} +14 -14
  108. package/dist/assets/index-Denq1UAZ.js +20 -0
  109. package/dist/assets/{index-BcjR7La5.js → index-DfCxzzye.js} +1 -1
  110. package/dist/assets/{index-Beek8Qoq.js → index-DftYcsPB.js} +6 -6
  111. package/dist/assets/{index-B0oOTjeC.js → index-DqCVCPmC.js} +1 -1
  112. package/dist/assets/{index-BIgX2N1A.js → index-DrI_kbUr.js} +6 -6
  113. package/dist/assets/{index-ByymZrPq.js → index-DtIwM7gL.js} +2 -2
  114. package/dist/assets/{index-BBu-RTSN.js → index-DyNVa2Lx.js} +1 -1
  115. package/dist/assets/{index-DYd4YT_K.js → index-G-jrPGsm.js} +1 -1
  116. package/dist/assets/{index-BX6YpiBs.js → index-Ii4Xi_du.js} +2 -2
  117. package/dist/assets/{index-BZ5rC2Lk.js → index-P2FBSyZf.js} +1 -1
  118. package/dist/assets/{index-Ca61GFb8.js → index-dCiAdDNg.js} +1 -1
  119. package/dist/assets/{index-Bm8Rp86x.js → index-kSplQjj2.js} +1 -1
  120. package/dist/assets/{index-82LLl9rh.js → index-nmsk2vjw.js} +2 -2
  121. package/dist/assets/{index-CVpBdzTr.js → index-nsujgMc_.js} +1 -1
  122. package/dist/assets/{index-D3SOJZGy.js → index-u76kHZTc.js} +3 -3
  123. package/dist/assets/{index-gwhKA5OT.js → index-xtzr7R_I.js} +1 -1
  124. package/dist/assets/{index.esm-C5mhDUsD.js → index.esm-iaB2Jgy_.js} +1 -1
  125. package/dist/assets/{install-from-url-DPdbO0Jq.js → install-from-url-CzhDO2C0.js} +1 -1
  126. package/dist/assets/{invitation-3RtS1iUK.js → invitation-C3HrxXln.js} +2 -2
  127. package/dist/assets/is-path-prefix-equal-dPdZJpAg.js +1 -0
  128. package/dist/assets/{isEmail-apFH2MvD.js → isEmail-CmCW4Fgq.js} +1 -1
  129. package/dist/assets/item-C6yFM2Os.js +163 -0
  130. package/dist/assets/{ja-DMq-YXDX.js → ja-DZPUwZ9l.js} +1 -1
  131. package/dist/assets/{jsonMode-RjxYywbi.js → jsonMode-BRueWwe6.js} +1 -1
  132. package/dist/assets/{ko-BrYbXurh.js → ko-q4i4r9g6.js} +1 -1
  133. package/dist/assets/{list-header-BNS6BF2P.js → list-header-s21LDuvb.js} +1 -1
  134. package/dist/assets/{lite-C-Ikw2GQ.js → lite-BBz66z5Z.js} +2 -2
  135. package/dist/assets/{lock.svg-BFdqOrkF.js → lock.svg-DK1hXFWn.js} +1 -1
  136. package/dist/assets/{log-DZlkZyGX.js → log-DRaCmTGd.js} +1 -1
  137. package/dist/assets/{login-method-item-ZVrK6tB1.js → login-method-item-DwSmGt8t.js} +1 -1
  138. package/dist/assets/{lottie-react.esm-A7yQ3Nfv.js → lottie-react.esm-DqwAKW0L.js} +1 -1
  139. package/dist/assets/{memory-CoCFCBkX.js → memory-VAHG3fjG.js} +1 -1
  140. package/dist/assets/{metric-B3S53u3H.js → metric-B6TET6QI.js} +1 -1
  141. package/dist/assets/{monaco-editor-CQ6Pm7Hi.js → monaco-editor-BH4xSgKB.js} +3 -3
  142. package/dist/assets/{mouseTarget-DxlEpFaz.js → mouseTarget-txK7mk_L.js} +1 -1
  143. package/dist/assets/omit-B-qG4p98.js +1 -0
  144. package/dist/assets/{overview-z9AW_vcO.js → overview-D3hqR9Yg.js} +1 -1
  145. package/dist/assets/{permission-C_g43OOf.js → permission-DET008IY.js} +1 -1
  146. package/dist/assets/{preference-1qTmAvHN.js → preference-pxwdMSFg.js} +8 -8
  147. package/dist/assets/{provider-icon-CoJ5ERXe.js → provider-icon-CCZmjsDZ.js} +1 -1
  148. package/dist/assets/{pt-Dl6732JN.js → pt-BFCHl6F1.js} +1 -1
  149. package/dist/assets/{raf-schd.esm-CU1FaTjd.js → raf-schd.esm-BuSKwIfR.js} +1 -1
  150. package/dist/assets/{rotate-session-key-CQOBWeRr.js → rotate-session-key-DE58Q8ag.js} +1 -1
  151. package/dist/assets/{ru-CVUeN9AX.js → ru-CSTl62kK.js} +1 -1
  152. package/dist/assets/runtime-b4EXN3II.js +1 -0
  153. package/dist/assets/schema-DE6tzaXQ.js +1 -0
  154. package/dist/assets/sdk-CxXstbZm.js +1 -0
  155. package/dist/assets/{service-iJdsq1ul.js → service-BpzqSJv4.js} +1 -1
  156. package/dist/assets/{shorten-label-CCnq_MUQ.js → shorten-label-PYNmzpP_.js} +1 -1
  157. package/dist/assets/{simple-select-0S1qRvRS.js → simple-select-BiJQdJOQ.js} +1 -1
  158. package/dist/assets/{spaces-BbUa6G9F.js → spaces-MVFShLV4.js} +1 -1
  159. package/dist/assets/{status-g0Lvwqad.js → status-LmBdrnlB.js} +1 -1
  160. package/dist/assets/{status-B4gHBixJ.js → status-UZAIOWNB.js} +1 -1
  161. package/dist/assets/{switch-control-CwXplLu0.js → switch-control-CE57fLeM.js} +1 -1
  162. package/dist/assets/{table-icons-BwS2Y2wV.js → table-icons-BG66cxZv.js} +1 -1
  163. package/dist/assets/{team-DETQHkho.js → team-DgQYntrc.js} +1 -1
  164. package/dist/assets/{th-32eBNQes.js → th-D75Dlluo.js} +1 -1
  165. package/dist/assets/{toLower-oQZ3J7Wi.js → toLower-DBVF4v1M.js} +1 -1
  166. package/dist/assets/toUpper-RYfZ9dsZ.js +1 -0
  167. package/dist/assets/{traffic-Cqk5X-Ty.js → traffic-7oEMp-9f.js} +1 -1
  168. package/dist/assets/trim-Dm26Hw3f.js +1 -0
  169. package/dist/assets/{url-evaluation-DyzOKILN.js → url-evaluation-CTsNt3ve.js} +1 -1
  170. package/dist/assets/{url-join-BM9fQWnd.js → url-join-oxVMh_nl.js} +1 -1
  171. package/dist/assets/{use-mobile-23djKzeO.js → use-mobile-BS_f_Fn7.js} +1 -1
  172. package/dist/assets/{use-mobile-BmaqHxmL.js → use-mobile-Czu8FCYf.js} +1 -1
  173. package/dist/assets/{useAsync-DtsKmLYR.js → useAsync-sbHIoH6-.js} +1 -1
  174. package/dist/assets/{useAsyncRetry-bd8YRPLB.js → useAsyncRetry-CCLyjAGj.js} +1 -1
  175. package/dist/assets/{useLocalStorage-Cf0vlWCe.js → useLocalStorage-CnqCtMp_.js} +1 -1
  176. package/dist/assets/{useThemeProps-CSqQ3Rdj.js → useThemeProps-DrXM-hmA.js} +1 -1
  177. package/dist/assets/{util-w8OtW6iJ.js → util-odWrmhcv.js} +1 -1
  178. package/dist/assets/{vi-DF8IinAc.js → vi-D1mKYrmb.js} +1 -1
  179. package/dist/assets/{wait-container-CoMsFqPE.js → wait-container-D_OCwH7P.js} +1 -1
  180. package/dist/assets/{without-wallet-U-jwKDa8.js → without-wallet-suCG1vjR.js} +1 -1
  181. package/dist/assets/wrap-locale-C0daq2dx.js +1 -0
  182. package/dist/assets/{zh-ByJkLAV1.js → zh-G2I44gfs.js} +1 -1
  183. package/dist/assets/{zh-tw-34G9tsUP.js → zh-tw-C4Juvs-i.js} +1 -1
  184. package/dist/index.html +1 -1
  185. package/package.json +1 -1
  186. package/dist/assets/ArrowDropDown-BLLloj8o.js +0 -1
  187. package/dist/assets/KeyboardArrowDown-Dlq5aN05.js +0 -1
  188. package/dist/assets/Verified-BAR-FN7O.js +0 -1
  189. package/dist/assets/api-Bv3RStR2.js +0 -1
  190. package/dist/assets/cloneDeep-CheRvpcx.js +0 -1
  191. package/dist/assets/config-navigation-D55MBXAB.js +0 -472
  192. package/dist/assets/emotion-cache.browser.esm-DxLNiXj3.js +0 -1
  193. package/dist/assets/engine-DGEfu7n8.js +0 -1
  194. package/dist/assets/getValidReactChildren-CVyZy5bG.js +0 -1
  195. package/dist/assets/index-CckoDRE8.js +0 -1
  196. package/dist/assets/index-DciiOEW2.js +0 -20
  197. package/dist/assets/index-Duu5UY8_.js +0 -1
  198. package/dist/assets/index-DxkMGrHs.js +0 -358
  199. package/dist/assets/index-K5eCanEK.js +0 -102
  200. package/dist/assets/is-path-prefix-equal-Cc6vYZ8N.js +0 -1
  201. package/dist/assets/item-BinI3jhy.js +0 -163
  202. package/dist/assets/omit-Bk5eP-SH.js +0 -1
  203. package/dist/assets/runtime-CVva7EgW.js +0 -1
  204. package/dist/assets/schema-7NDYbay9.js +0 -1
  205. package/dist/assets/sdk-Dvt1785F.js +0 -1
  206. package/dist/assets/toUpper-lxerpjTR.js +0 -1
  207. package/dist/assets/trim-D7km596D.js +0 -1
  208. package/dist/assets/wrap-locale-DxhU5ODE.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Beek8Qoq.js","./index-BIgX2N1A.js","./index-BLDnEtdF.css","./index-CWrrTi4L.css"])))=>i.map(i=>d[i]);
2
- import{r as t,p as n,j as r,I as a,J as i}from"./index-BIgX2N1A.js";const s=t.lazy(()=>a(()=>import("./index-Beek8Qoq.js").then(o=>o.bG),__vite__mapDeps([0,1,2,3]),import.meta.url)),d=`{
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DftYcsPB.js","./index-DrI_kbUr.js","./index-BLDnEtdF.css","./index-CWrrTi4L.css"])))=>i.map(i=>d[i]);
2
+ import{r as t,p as n,j as r,I as a,J as i}from"./index-DrI_kbUr.js";const s=t.lazy(()=>a(()=>import("./index-DftYcsPB.js").then(o=>o.bG),__vite__mapDeps([0,1,2,3]),import.meta.url)),d=`{
3
3
  getNodeInfo {
4
4
  code
5
5
  info {
@@ -1 +1 @@
1
- import{j as e,b3 as b,B as j,u as v,r as a,p as P,h as S,b as k,E as w,ab as E,b5 as K,b6 as W,k as i,b7 as _,D as U,b2 as B,C as D,b8 as N,b9 as R}from"./index-BIgX2N1A.js";import{p as c}from"./index-BqqU8gwj.js";function o({children:r,...s}){return e.jsx(b,{...s,did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(j,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function T(){const r=v(),{t:s,locale:d}=a.useContext(P),{api:l}=S(),{info:u}=k(),p=w(u),h=E(),n=K({ready:!1,success:!1,error:null,invalidSession:!1}),f=W(),m=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=N(g);if(!R(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};a.useLayoutEffect(()=>m(),[]);const x=i(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=i(()=>{n.success=!0});if(n.invalidSession)return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(_,{style:{color:h.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(o,{children:e.jsx(U,{className:"connect",action:"gen-key-pair",checkFn:l.get,checkTimeout:600*1e3,extraParams:{sourceAppPid:f?.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:p,onSuccess:C,onError:x,locale:d,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(B,{children:e.jsx(D,{})})}export{T as default};
1
+ import{j as e,b3 as b,B as j,u as v,r as a,p as P,h as S,b as k,E as w,ab as E,b5 as K,b6 as W,k as i,b7 as _,D as U,b2 as B,C as D,b8 as N,b9 as R}from"./index-DrI_kbUr.js";import{p as c}from"./index-CTjBZAn9.js";function o({children:r,...s}){return e.jsx(b,{...s,did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(j,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function T(){const r=v(),{t:s,locale:d}=a.useContext(P),{api:l}=S(),{info:u}=k(),p=w(u),h=E(),n=K({ready:!1,success:!1,error:null,invalidSession:!1}),f=W(),m=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=N(g);if(!R(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};a.useLayoutEffect(()=>m(),[]);const x=i(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=i(()=>{n.success=!0});if(n.invalidSession)return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(_,{style:{color:h.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(o,{children:e.jsx(U,{className:"connect",action:"gen-key-pair",checkFn:l.get,checkTimeout:600*1e3,extraParams:{sourceAppPid:f?.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:p,onSuccess:C,onError:x,locale:d,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(B,{children:e.jsx(D,{})})}export{T as default};
@@ -1,4 +1,4 @@
1
- import{b as k,j as o,C as N,h as b,v as U,u as W,V as E,z as _,r,w as D,x as d,y as x,A as P,s as R,D as O,l as A,E as $,G as K,m as V,t as z}from"./index-BIgX2N1A.js";import{I as G}from"./invitation-3RtS1iUK.js";import"./index-BqqU8gwj.js";import"./index-K5eCanEK.js";import"./emotion-cache.browser.esm-DxLNiXj3.js";import"./sdk-Dvt1785F.js";import"./wrap-locale-DxhU5ODE.js";import"./index-Duu5UY8_.js";function H(h){const{api:i,session:p}=b(),{info:s}=k(),c=U(),v=W(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),f=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!f)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:f}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",f);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await p.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,p]);if(a.loading)return o.jsx(N,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),p.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(M,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:K.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:300*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(G,{...h,getDataFn:S,createPassportSvg:e=>V(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const M=z.div`
1
+ import{b as k,j as o,C as N,h as b,v as U,u as W,V as E,z as _,r,w as D,x as d,y as x,A as P,s as R,D as O,l as A,E as $,G as K,m as V,t as z}from"./index-DrI_kbUr.js";import{I as G}from"./invitation-C3HrxXln.js";import"./index-CTjBZAn9.js";import"./index-CBCPHvf_.js";import"./emotion-cache.browser.esm-Cu824RS4.js";import"./sdk-CxXstbZm.js";import"./wrap-locale-C0daq2dx.js";import"./index-BzFgWQ5w.js";function H(h){const{api:i,session:p}=b(),{info:s}=k(),c=U(),v=W(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),f=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!f)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:f}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",f);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await p.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,p]);if(a.loading)return o.jsx(N,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),p.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(M,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:K.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:300*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(G,{...h,getDataFn:S,createPassportSvg:e=>V(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const M=z.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;
@@ -1,5 +1,5 @@
1
- import{aZ as Ke,aY as Fe,r as h,$ as Ge,j as e,a3 as ee,a4 as Ye,b0 as J,a5 as $e,a9 as He,b1 as qe,c as he,by as q,aS as A,i as Ce,H as B,bF as V,da as E,cY as we,f8 as Be,am as N,f9 as Ve,V as D,fa as Qe,o as f,E as Xe,G as De,y as fe,A as Ze,p as Je,C as L,K as j,bx as et,t as tt,ab as st,fb as X,fc as Z,fd as ot,B as S,aD as K,l as T,R as nt,bP as H,cE as at,ad as Se,M as G,az as Y,aA as $,ew as rt,aB as it,aw as ct,ax as lt,bD as pe,D as dt,bz as be,b2 as Ee,bH as xe,g as pt}from"./index-BIgX2N1A.js";import{T as ut}from"./html-title-DE0TrRVC.js";import{u as U}from"./blocklet-lDvdqhrX.js";import{u as mt}from"./use-mobile-23djKzeO.js";import{u as Ie,D as ft,a as xt,b as gt,S as ht,c as ue,d as St,C as yt,e as bt,f as kt,g as jt,h as Ct}from"./connect-to-DeMt1m5c.js";import"./index-BojVbZw0.js";import"./api-Bv3RStR2.js";import{b as wt,g as Bt,a as Dt,i as Et,c as ge,d as It,e as Tt,h as Rt}from"./spaces-BbUa6G9F.js";import{v as zt}from"./index-CaLjm3Sr.js";import{E as vt}from"./index-gwhKA5OT.js";import{H as Pt}from"./HelpOutline-Be59cdK1.js";import{H as At}from"./index-Ca61GFb8.js";import{x as Lt}from"./index-D29L5UKE.js";import{D as Ut}from"./DeleteOutline-DUcJA7eO.js";import{g as ke}from"./get-safe-url-RPQVYlWr.js";import{S as Ot}from"./switch-control-CwXplLu0.js";import{L as je}from"./list-header-BNS6BF2P.js";import"./OpenInNew-CEBJXmxa.js";import"./index-B0oOTjeC.js";import"./ButtonGroup--8rwLvQ8.js";import"./getValidReactChildren-CVyZy5bG.js";import"./FilterList-DMbHmf0X.js";import"./CSSTransition-D4fabzL2.js";import"./emotion-cache.browser.esm-DxLNiXj3.js";import"./index-Bm8Rp86x.js";import"./redux-Ab4buSXY.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CM0PEscV.js";import"./index-BfQLSa8k.js";import"./TableSearch-CdKaHbVQ.js";import"./Search-CtujvL0H.js";import"./Clear-DriUx9_Q.js";import"./MoreVert-BVgcfW7V.js";function Mt(t){return Ke("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ge({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},u=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",u.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Kt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await wt(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=U(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=U(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=U(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),p=Array.isArray(l)?l.map(u=>({...u,successCount:+u.successCount,errorCount:+u.errorCount})):[];r(p)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:Ws}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=U(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),u=Qe(d),x=$t({appDid:o?.appDid}),m=h.useMemo(()=>Bt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===m)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),m!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===m&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),m!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===m;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:m,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:f.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=U(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:u,name:x,did:m})=>{const k=await Dt(u);if(!await Et(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===u)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:m,url:k,endpoint:u},u)},p=async({spaceGateway:u})=>{try{await l(u)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=U(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(zt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(L,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),x=[];for(let m=p.clone();E(m).isBefore(l);m=m.add(1,"day")){const k=m.format("YYYY-MM-DD");x.push(u.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
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:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[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:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(vt,{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(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(K,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{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(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{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(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{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 Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(Pt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Le.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};function Ue({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=Lt(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Ue.propTypes={metadata:f.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:u}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,m=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return m?e.jsx(nt,{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(H,{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=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:u,metadata:x}=d,m=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!m,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!m;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Ue,{metadata:x}):e.jsx(Le,{status:l,message:p,createdAt:u})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(At,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{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(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{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(Ae,{})]})]}),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 Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(u,x)=>{u?.preventDefault(),u?.stopPropagation(),a(x)},l=async u=>{try{u?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=u=>{d(u,!1),n?.(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{color:"red",onClick:u=>d(u,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[u,x]=h.useState(!1),m=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),m(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),m(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[u||t?.loading?e.jsx(L,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>m(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>m(y,!1),children:[e.jsxs(G,{onClick:y=>{m(y,!1),window.open(ke(t.endpoint?It(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(G,{onClick:y=>{m(y,!1),window.open(ke(Tt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(G,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Kt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(G,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(ht,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=U(),{api:l,info:{did:p}}=A(),{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Rt(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})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=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)}},le=async()=>{try{await se(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 h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(L,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{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(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(L,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(St,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):q(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=bt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(kt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(jt,{}),e.jsx(S,{sx:c,children:e.jsx(Ct,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(yt,{children:[e.jsxs(K,{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(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=U(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],m=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:m,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(K,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};const me=ee(S)`
1
+ import{aZ as Ke,aY as Ge,r as h,$ as Fe,j as e,a3 as ee,a4 as Ye,b0 as Z,a5 as $e,a9 as He,b1 as qe,c as he,bs as q,aS as A,i as Ce,H as B,bz as V,da as E,cY as we,f8 as Be,am as N,f9 as Ve,V as D,fa as Qe,o as f,E as Xe,G as De,y as fe,A as Je,p as Ze,C as L,K as j,br as et,t as tt,ab as st,fb as X,fc as J,fd as ot,B as S,aD as K,l as T,R as nt,bJ as H,cE as at,ad as Se,M as F,az as Y,aA as $,ew as rt,aB as it,aw as ct,ax as lt,bx as pe,D as dt,bt as be,b2 as Ee,bB as xe,g as pt}from"./index-DrI_kbUr.js";import{T as ut}from"./html-title-CQe12Cut.js";import{u as U}from"./blocklet-CzBGFesP.js";import{u as mt}from"./use-mobile-BS_f_Fn7.js";import{u as Ie,D as ft,a as xt,b as gt,S as ht,c as ue,d as St,C as yt,e as bt,f as kt,g as jt,h as Ct}from"./connect-to-CeGdVeiX.js";import"./index-BojVbZw0.js";import"./api-CKaiYijO.js";import{b as wt,g as Bt,a as Dt,i as Et,c as ge,d as It,e as Tt,h as Rt}from"./spaces-MVFShLV4.js";import{v as zt}from"./index-BXpvvqAs.js";import{E as vt}from"./index-xtzr7R_I.js";import{H as Pt}from"./HelpOutline-DaGemEcX.js";import{H as At}from"./index-dCiAdDNg.js";import{x as Lt}from"./index-D29L5UKE.js";import{D as Ut}from"./DeleteOutline-BXoQnWFj.js";import{g as ke}from"./get-safe-url-BTJDduf6.js";import{S as Ot}from"./switch-control-CE57fLeM.js";import{L as je}from"./list-header-s21LDuvb.js";import"./OpenInNew-BUUx7OSU.js";import"./index-DqCVCPmC.js";import"./ButtonGroup-BDg4XqiR.js";import"./getValidReactChildren-T3CvLHYr.js";import"./FilterList-Dfj9GsZN.js";import"./CSSTransition-CoGzojVI.js";import"./emotion-cache.browser.esm-Cu824RS4.js";import"./index-kSplQjj2.js";import"./redux-Ab4buSXY.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Bfsv3kHf.js";import"./index-DUEj1V-j.js";import"./TableSearch-okRl0dqT.js";import"./Search-m3CMNGDm.js";import"./Clear-Bq2o3otF.js";import"./MoreVert-DxM-B8xa.js";function Mt(t){return Ke("MuiIcon",t)}Ge("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${Z(s)}`,`fontSize${Z(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${Z(n.color)}`],s[`fontSize${Z(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Fe({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},u=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",u.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Kt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Gt=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Ft({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await wt(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=U(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Ft({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=U(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=U(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),p=Array.isArray(l)?l.map(u=>({...u,successCount:+u.successCount,errorCount:+u.errorCount})):[];r(p)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:Ws}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=U(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),u=Qe(d),x=$t({appDid:o?.appDid}),m=h.useMemo(()=>Bt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===m)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},G=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),m!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===m&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await G({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),m!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===m;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:G,abortBlockletBackup:Q,backupEndpoint:m,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:f.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=U(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Je())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:u,name:x,did:m})=>{const k=await Dt(u);if(!await Et(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===u)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:m,url:k,endpoint:u},u)},p=async({spaceGateway:u})=>{try{await l(u)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=U(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Ze),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(zt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(L,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),x=[];for(let m=p.clone();E(m).isBefore(l);m=m.add(1,"day")){const k=m.format("YYYY-MM-DD");x.push(u.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
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:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:J[300]},{min:3,max:6,color:J[400]},{min:6,max:9,color:J[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:J[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:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(vt,{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(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(K,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{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(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{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(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{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 Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(Pt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Le.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};function Ue({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=Lt(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Ue.propTypes={metadata:f.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:u}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,m=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return m?e.jsx(nt,{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(H,{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=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:u,metadata:x}=d,m=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!m,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!m;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Ue,{metadata:x}):e.jsx(Le,{status:l,message:p,createdAt:u})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(At,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Jt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{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(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{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(Ae,{})]})]}),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 Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(u,x)=>{u?.preventDefault(),u?.stopPropagation(),a(x)},l=async u=>{try{u?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=u=>{d(u,!1),n?.(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{color:"red",onClick:u=>d(u,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[u,x]=h.useState(!1),m=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),m(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),m(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[u||t?.loading?e.jsx(L,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>m(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>m(y,!1),children:[e.jsxs(F,{onClick:y=>{m(y,!1),window.open(ke(t.endpoint?It(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(F,{onClick:y=>{m(y,!1),window.open(ke(Tt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(F,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Kt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(F,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(ht,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};const Zt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=U(),{api:l,info:{did:p}}=A(),{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,G=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Rt(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})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=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)}},le=async()=>{try{await se(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 h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),G&&e.jsx(Zt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(L,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:G})]})}_e.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{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(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(L,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(St,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):q(s)?e.jsx(Jt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=bt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(kt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(jt,{}),e.jsx(S,{sx:c,children:e.jsx(Ct,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(yt,{children:[e.jsxs(K,{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(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=U(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],m=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:m,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(K,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};const me=ee(S)`
3
3
  position: relative;
4
4
  min-height: 66vh;
5
5
  overflow: hidden;
@@ -1 +1 @@
1
- import{e as g,r as o,p as x,f as r,g as u,j as s,B as m,N as d}from"./index-BIgX2N1A.js";function P(){const i=g(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
1
+ import{e as g,r as o,p as x,f as r,g as u,j as s,B as m,N as d}from"./index-DrI_kbUr.js";function P(){const i=g(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};