@abtnode/webapp 1.16.49-beta-20250821-102221-1b7283d6 → 1.16.49-beta-20250822-070545-6d3344cc

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 (205) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-BbT4EXkS.js → AdapterDayjs-D4Zkiick.js} +1 -1
  4. package/dist/assets/{Add-BjgJStpH.js → Add-CRYWmyuR.js} +1 -1
  5. package/dist/assets/ArrowDropDown-Bf4GVn4d.js +1 -0
  6. package/dist/assets/{Autocomplete-Dp402S6q.js → Autocomplete-rHUqzZCi.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-D25xvDwH.js → Breadcrumbs-LFDW-if0.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BJJMUa5C.js → ButtonGroup-Cm76cRE-.js} +1 -1
  9. package/dist/assets/{CSSTransition-DoP2sjA4.js → CSSTransition-DpizwGU-.js} +1 -1
  10. package/dist/assets/{CallMerge-BcMUWo1q.js → CallMerge-DzPrq_5n.js} +1 -1
  11. package/dist/assets/{CardContent-BM2KtzjC.js → CardContent-P0Sthx00.js} +1 -1
  12. package/dist/assets/{ChevronLeft-DwCtqinN.js → ChevronLeft-BlEgXNcG.js} +1 -1
  13. package/dist/assets/{ChevronRight-kbJt7gtd.js → ChevronRight-BgHVOCJf.js} +1 -1
  14. package/dist/assets/{Clear-fkSe1BQ5.js → Clear-Bd6lrR3r.js} +1 -1
  15. package/dist/assets/{DeleteOutline-QcWnkTtX.js → DeleteOutline-CPeLbfI7.js} +1 -1
  16. package/dist/assets/{Done-DUu43LDm.js → Done-Df9XwPFo.js} +1 -1
  17. package/dist/assets/{Edit-C-sJa5uj.js → Edit-CCuCWwa1.js} +1 -1
  18. package/dist/assets/{ErrorOutline-qyQE7Oa-.js → ErrorOutline-CTO0yYkX.js} +1 -1
  19. package/dist/assets/{FilterList-DB3vvbr3.js → FilterList-MQmC3xoC.js} +1 -1
  20. package/dist/assets/{Google-DcD1pJVK.js → Google-cOwyYdVa.js} +1 -1
  21. package/dist/assets/{HelpOutline-BgoG1GPn.js → HelpOutline-BoJ2fHVJ.js} +1 -1
  22. package/dist/assets/{Launch-D0Nm_drS.js → Launch-DXthpdPY.js} +1 -1
  23. package/dist/assets/{Link-F8ailKcW.js → Link-z_O1747L.js} +1 -1
  24. package/dist/assets/{ListItemButton-DpIRicPp.js → ListItemButton-eESx04MD.js} +1 -1
  25. package/dist/assets/{ListSubheader-C5PLmoys.js → ListSubheader-Bq38Ghps.js} +1 -1
  26. package/dist/assets/{LoadingButton-BMyjySY9.js → LoadingButton-CjHleU21.js} +1 -1
  27. package/dist/assets/{MoreVert-CcaizWju.js → MoreVert-DSc6xysS.js} +1 -1
  28. package/dist/assets/{OpenInNew-HJpnTd_H.js → OpenInNew-ymbf4EkY.js} +1 -1
  29. package/dist/assets/{Refresh-BN9bnQko.js → Refresh-0f0uuphQ.js} +1 -1
  30. package/dist/assets/{Search-7Pw1ev44.js → Search-DiToZzru.js} +1 -1
  31. package/dist/assets/{Slider-s-3T3O0E.js → Slider-m4FegYsq.js} +1 -1
  32. package/dist/assets/{Stepper-BdQdQL75.js → Stepper-DYyqqEBN.js} +1 -1
  33. package/dist/assets/{Switch-CIpFMcAY.js → Switch-DAXTqD-y.js} +1 -1
  34. package/dist/assets/{TableSearch-CbI3u7v4.js → TableSearch-CdSVywW7.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-nl8Fm0Rg.js → ToggleButtonGroup-D4daO9-j.js} +1 -1
  36. package/dist/assets/{Verified-D_qZdRw8.js → Verified-Cq7YQDPe.js} +1 -1
  37. package/dist/assets/{VerifiedUser-DzsFyb6A.js → VerifiedUser-Cs5fUx5X.js} +1 -1
  38. package/dist/assets/{ViewList-parLhgb2.js → ViewList-CkvKU3wV.js} +1 -1
  39. package/dist/assets/{_createAggregator-BpRJXgnh.js → _createAggregator-_cO9HeDJ.js} +1 -1
  40. package/dist/assets/{actions-DAdg3TCf.js → actions-CPb9Moks.js} +1 -1
  41. package/dist/assets/{actions-BAuWri3w.js → actions-lE2MOCrv.js} +1 -1
  42. package/dist/assets/{agreement-Dxora922.js → agreement-CD-r8Zz7.js} +1 -1
  43. package/dist/assets/api-Tp2L7lqP.js +1 -0
  44. package/dist/assets/{appearance-CrNHhAdU.js → appearance-BdV9Dxo0.js} +1 -1
  45. package/dist/assets/{ar-BvKie2ZN.js → ar-fE5SSTrt.js} +1 -1
  46. package/dist/assets/{audit-logs-Cs_QrGev.js → audit-logs-BBiK6SmO.js} +1 -1
  47. package/dist/assets/{base-chart-C6THBW-k.js → base-chart-De6hlB0Y.js} +1 -1
  48. package/dist/assets/{blocklet-ECxXqY9c.js → blocklet-DNoyp9Cs.js} +1 -1
  49. package/dist/assets/{chain-nfqKLrKB.js → chain-7n5dbbhy.js} +1 -1
  50. package/dist/assets/{click-to-copy-CksDRdqm.js → click-to-copy-BZtVQnJA.js} +1 -1
  51. package/dist/assets/client-B-c7ei8g.js +1 -0
  52. package/dist/assets/cloneDeep-DFvfgOvy.js +1 -0
  53. package/dist/assets/{collapse-D6diB4if.js → collapse-cDBjiwvh.js} +1 -1
  54. package/dist/assets/{config-navigation-_Qoe7f9z.js → config-navigation-DSbad9ei.js} +3 -3
  55. package/dist/assets/{connect-to-AnYJDZYw.js → connect-to-BBSjaMuR.js} +1 -1
  56. package/dist/assets/{cssMode-CZvkTEmI.js → cssMode-CFxmr_Wl.js} +1 -1
  57. package/dist/assets/{de-C9BQPFcm.js → de-Byq6SyWJ.js} +1 -1
  58. package/dist/assets/{delete-confirm-gaBotr9j.js → delete-confirm-C7gXjzI-.js} +1 -1
  59. package/dist/assets/{depsEqual-BOxgPVK8.js → depsEqual-zH57QwJk.js} +1 -1
  60. package/dist/assets/{detail-Dm0IjCvu.js → detail-DlGbaDAE.js} +3 -3
  61. package/dist/assets/{domains-BKA4UlWI.js → domains-CF_ymNdp.js} +1 -1
  62. package/dist/assets/{download-DBFUazOD.js → download-DOTVZfH3.js} +1 -1
  63. package/dist/assets/{edit.svg-lJCEFAKX.js → edit.svg-B0rqqdvq.js} +1 -1
  64. package/dist/assets/emotion-cache.browser.esm-C83OYG6J.js +1 -0
  65. package/dist/assets/engine-CWXUBgNq.js +1 -0
  66. package/dist/assets/{es-DPjcV6cX.js → es-Q8J1CCMS.js} +1 -1
  67. package/dist/assets/{fr-ButkVdgL.js → fr-8njRrvuV.js} +1 -1
  68. package/dist/assets/{freemarker2-OjtvTZOr.js → freemarker2-CmWfeNQb.js} +1 -1
  69. package/dist/assets/{get-safe-url-CN3kjswr.js → get-safe-url-ThSpI0WV.js} +1 -1
  70. package/dist/assets/getValidReactChildren-Mx_dW0Jp.js +1 -0
  71. package/dist/assets/{graphqlMode-yd41msMl.js → graphqlMode-DZBAKrNb.js} +2 -2
  72. package/dist/assets/{handlebars-DIJ9ll1i.js → handlebars-CaDDAGYz.js} +1 -1
  73. package/dist/assets/hi-JUTdfcRr.js +5 -0
  74. package/dist/assets/{html-Cc_eopVD.js → html-CnYhr4F7.js} +1 -1
  75. package/dist/assets/{html-title-B9VJeaWm.js → html-title-BNM7JHcp.js} +1 -1
  76. package/dist/assets/{htmlMode-C9ASD6J_.js → htmlMode-DN9pAdbL.js} +1 -1
  77. package/dist/assets/{id-B6zyYCjr.js → id-CrtgRPeX.js} +1 -1
  78. package/dist/assets/{iframe-BhSnRMb2.js → iframe-BjZQ3xw0.js} +1 -1
  79. package/dist/assets/{index-DtqtNQh5.js → index-0T824Y_m.js} +1 -1
  80. package/dist/assets/{index-S6oDtsha.js → index-2lfF1_vy.js} +1 -1
  81. package/dist/assets/{index-CChjegNJ.js → index-B1zHcUns.js} +1 -1
  82. package/dist/assets/{index-Dt7-HgvT.js → index-B2HXHaZp.js} +1 -1
  83. package/dist/assets/{index-D53MOjsR.js → index-B3nJR0LO.js} +1 -1
  84. package/dist/assets/{index-ni6XzXTR.js → index-B9CVFjty.js} +9 -9
  85. package/dist/assets/{index-B0H_teX6.js → index-BB9R63jV.js} +3 -3
  86. package/dist/assets/{index-CTv3dBB5.js → index-BNv8Vk1K.js} +1 -1
  87. package/dist/assets/{index-A7t6Ar7N.js → index-BTnwgSA6.js} +1 -1
  88. package/dist/assets/{index-BLE0wW-0.js → index-BUflWebx.js} +1 -1
  89. package/dist/assets/{index-Cr0waWqb.js → index-BYXYXF21.js} +1 -1
  90. package/dist/assets/{index-B9hcAjzi.js → index-Bc94kn7m.js} +3 -3
  91. package/dist/assets/{index-DziGV7ua.js → index-BdZ3IIC6.js} +1 -1
  92. package/dist/assets/index-Bm4Wq3Si.js +1 -0
  93. package/dist/assets/{index-D4tTSReI.js → index-CIpmAacN.js} +1 -1
  94. package/dist/assets/{index-DfzH1L9d.js → index-CMCeJwNm.js} +1 -1
  95. package/dist/assets/{index-Cz-Xni8c.js → index-CQ9izUxP.js} +3 -3
  96. package/dist/assets/{index-IE5VnziX.js → index-CYwTzx0H.js} +1 -1
  97. package/dist/assets/{index-DYxhCwxK.js → index-CkUT0tY9.js} +1 -1
  98. package/dist/assets/{index-DV0IpWWT.js → index-CpAdTU05.js} +1 -1
  99. package/dist/assets/{index-DU58_n0q.js → index-D6TVGB8K.js} +5 -5
  100. package/dist/assets/{index-CSmPm4GR.js → index-D9t-_Twy.js} +1 -1
  101. package/dist/assets/{index-DF3KCemQ.js → index-DB7cJZbU.js} +1 -1
  102. package/dist/assets/{index-BK_pSLOh.js → index-DMOKZCkM.js} +1 -1
  103. package/dist/assets/{index-DEqQ_b5f.js → index-DQwdG3oO.js} +1 -1
  104. package/dist/assets/{index-CUCKsvuD.js → index-DSfy4neW.js} +1 -1
  105. package/dist/assets/{index-D4EPuf0c.js → index-DUKKDXQq.js} +1 -1
  106. package/dist/assets/{index-BHQ-NTNj.js → index-DVPoJS1G.js} +2 -2
  107. package/dist/assets/{index-CApssJTK.js → index-DWhariBK.js} +1 -1
  108. package/dist/assets/{index-CAsP5aCR.js → index-DfUsFF1_.js} +1 -1
  109. package/dist/assets/{index-00gMunRh.js → index-DfekUnAk.js} +1 -1
  110. package/dist/assets/{index-BSk9eZ35.js → index-Dfp0R-Ky.js} +1 -1
  111. package/dist/assets/{index-B9EPDC5-.js → index-DkBn0v10.js} +1 -1
  112. package/dist/assets/{index-9bJz035T.js → index-Dm59bhPu.js} +1 -1
  113. package/dist/assets/{index-eV5Q22QE.js → index-DoSIheoR.js} +2 -2
  114. package/dist/assets/{index-B8PyckES.js → index-DszaD3QS.js} +1 -1
  115. package/dist/assets/{index-DDz3khqK.js → index-DzJtB1Hs.js} +1 -1
  116. package/dist/assets/{index-Dr_RpAGu.js → index-IvHm5pI4.js} +1 -1
  117. package/dist/assets/{index-BZS48BpA.js → index-KV2818dS.js} +1 -1
  118. package/dist/assets/{index-Cyg_4FtP.js → index-KcFXaE_y.js} +1 -1
  119. package/dist/assets/{index-CII2rGJ6.js → index-_DBrBjMY.js} +1 -1
  120. package/dist/assets/{index-CP7SijRY.js → index-p3WfcM9p.js} +2 -2
  121. package/dist/assets/{index-6QFglTOV.js → index-sNtfOlhf.js} +3 -3
  122. package/dist/assets/{index-lYJg82-4.js → index-t6oECrat.js} +1 -1
  123. package/dist/assets/{index-CoBuyDcc.js → index-vrkbtdco.js} +1 -1
  124. package/dist/assets/{index.esm-B1-cOF6G.js → index.esm-CsSY5qzM.js} +1 -1
  125. package/dist/assets/{install-from-url-CcmuAjty.js → install-from-url-lDtbkPTH.js} +1 -1
  126. package/dist/assets/{invitation-DU4VJuCh.js → invitation-BsKjnkj4.js} +1 -1
  127. package/dist/assets/{is-path-prefix-equal-B-f1Tg_r.js → is-path-prefix-equal-_qy5EOwg.js} +1 -1
  128. package/dist/assets/{item-DhQ4ERmI.js → item-Cacivb9M.js} +1 -1
  129. package/dist/assets/{ja-5mnOXG6B.js → ja-BDFhRccP.js} +1 -1
  130. package/dist/assets/{javascript-9OIFwvkf.js → javascript-CGczjOCo.js} +1 -1
  131. package/dist/assets/{jsonMode-MZC8ttna.js → jsonMode-Dj_IjHJD.js} +1 -1
  132. package/dist/assets/{ko-Msmkvh9O.js → ko-Dde62QRb.js} +1 -1
  133. package/dist/assets/{liquid-BjebiC6O.js → liquid-BMdfgWaq.js} +1 -1
  134. package/dist/assets/{list-header-DFfMMiM1.js → list-header-DdDAZWs8.js} +1 -1
  135. package/dist/assets/{log-BsZ71pB3.js → log-Cmjxi549.js} +1 -1
  136. package/dist/assets/{lottie-react.esm-DDtPAwHJ.js → lottie-react.esm-Cuu7Q2Nq.js} +1 -1
  137. package/dist/assets/{mdx-Lxu1Olls.js → mdx-CAYUlt0e.js} +1 -1
  138. package/dist/assets/{memory-Cvf0dzL1.js → memory-BaZWYpPK.js} +1 -1
  139. package/dist/assets/{metric-B_Yupykk.js → metric-yHhkpFYW.js} +1 -1
  140. package/dist/assets/omit-BHMysKix.js +1 -0
  141. package/dist/assets/{overview-CP9DVl5f.js → overview-qQhFkXyB.js} +1 -1
  142. package/dist/assets/{permission-DzQpyYyx.js → permission-CEx3Xzzt.js} +1 -1
  143. package/dist/assets/{preference-CgZC5eP4.js → preference-DUaF4047.js} +3 -3
  144. package/dist/assets/pt-C4nfuExm.js +5 -0
  145. package/dist/assets/{python-BkO1QhWv.js → python-COayavk2.js} +1 -1
  146. package/dist/assets/{raf-schd.esm-DmGrfQsp.js → raf-schd.esm-BwlUX7rt.js} +1 -1
  147. package/dist/assets/{razor-DfbfeHRh.js → razor-DMRuUzHX.js} +1 -1
  148. package/dist/assets/{rotate-session-key-Bg2FnobO.js → rotate-session-key-D1vlWJy-.js} +1 -1
  149. package/dist/assets/ru-B4GtNlEa.js +5 -0
  150. package/dist/assets/{runtime-B6mb0wO8.js → runtime-BKkXAf75.js} +1 -1
  151. package/dist/assets/schema-j0c6tNfS.js +1 -0
  152. package/dist/assets/sdk-AP0IBqOB.js +1 -0
  153. package/dist/assets/{service-3dDFZP8G.js → service-JXeyvHsB.js} +1 -1
  154. package/dist/assets/{shorten-label-DdaucB0K.js → shorten-label-BhRK0ln2.js} +1 -1
  155. package/dist/assets/{simple-select-b8L44RRe.js → simple-select-JFizrUkd.js} +1 -1
  156. package/dist/assets/{spaces-OAtRfRDP.js → spaces-gIxhAIXe.js} +1 -1
  157. package/dist/assets/{status-CIoNpyLM.js → status-DQsEKGqd.js} +1 -1
  158. package/dist/assets/{status-Dk6csEdZ.js → status-Td6c-fVL.js} +1 -1
  159. package/dist/assets/{switch-control-CQ98tRq5.js → switch-control-D1xFgmoW.js} +1 -1
  160. package/dist/assets/{table-icons-DnJxVsFE.js → table-icons-DVzZMDdJ.js} +1 -1
  161. package/dist/assets/{team-CzOAxou8.js → team--wmU0D2h.js} +1 -1
  162. package/dist/assets/th-BkShd6jD.js +5 -0
  163. package/dist/assets/{toLower-IbZ9fE08.js → toLower-CfdqUhXL.js} +1 -1
  164. package/dist/assets/toUpper-Xpet2xRI.js +1 -0
  165. package/dist/assets/{traffic-BvXRbpMG.js → traffic-BudoYa72.js} +1 -1
  166. package/dist/assets/{tsMode-TMPhs2gM.js → tsMode-Du_Iu74e.js} +1 -1
  167. package/dist/assets/{typescript-DT4mrAfA.js → typescript-Blmv3Gec.js} +1 -1
  168. package/dist/assets/{url-evaluation-N368hPz7.js → url-evaluation-CV1iSx1K.js} +1 -1
  169. package/dist/assets/{url-join-DzCvUteF.js → url-join-CIv0Ugfk.js} +1 -1
  170. package/dist/assets/{use-mobile-Df5zHg-M.js → use-mobile-B7rT08bE.js} +1 -1
  171. package/dist/assets/{use-mobile-D4cCp5_8.js → use-mobile-stNEoGvd.js} +1 -1
  172. package/dist/assets/{useAsync-BU2GUig9.js → useAsync-JYbrRLHg.js} +1 -1
  173. package/dist/assets/{useAsyncRetry-CiQxcLEo.js → useAsyncRetry-D70iwIIs.js} +1 -1
  174. package/dist/assets/{useLocalStorage-BLqETmqX.js → useLocalStorage-CYX8Yp0i.js} +1 -1
  175. package/dist/assets/{useThemeProps-Cxn8wS-a.js → useThemeProps-CQgN1y2i.js} +1 -1
  176. package/dist/assets/{util-CJspyU9f.js → util-Hp87_yWp.js} +1 -1
  177. package/dist/assets/vi-C1PSP5SP.js +5 -0
  178. package/dist/assets/{wait-container-CbghAGzH.js → wait-container-CQYMEZ7E.js} +1 -1
  179. package/dist/assets/{without-wallet-BUTNsL-e.js → without-wallet-BNcgQZGe.js} +1 -1
  180. package/dist/assets/wrap-locale-BeNl69zP.js +1 -0
  181. package/dist/assets/{xml-_ytZ3Jeu.js → xml-QJ4Ikn7B.js} +1 -1
  182. package/dist/assets/{yaml-AP48dB15.js → yaml-_SExdWZn.js} +1 -1
  183. package/dist/assets/{zh-BG6k4eXG.js → zh-gAK37O_Y.js} +1 -1
  184. package/dist/assets/{zh-tw-6SDy5fyY.js → zh-tw-BGfyObps.js} +1 -1
  185. package/dist/index.html +1 -1
  186. package/dist/service-worker.js +1 -1
  187. package/package.json +1 -1
  188. package/dist/assets/ArrowDropDown-BTUv7vHV.js +0 -1
  189. package/dist/assets/api-C1oEeGCK.js +0 -1
  190. package/dist/assets/client-B_AxtLSc.js +0 -1
  191. package/dist/assets/cloneDeep-CvBzQgiy.js +0 -1
  192. package/dist/assets/emotion-cache.browser.esm-CQTZWHgn.js +0 -1
  193. package/dist/assets/engine-DaFht3OX.js +0 -1
  194. package/dist/assets/getValidReactChildren-UKe-U4T8.js +0 -1
  195. package/dist/assets/hi-CLqQ4LHH.js +0 -5
  196. package/dist/assets/index-k9wee-6_.js +0 -1
  197. package/dist/assets/omit-BIlN3Dgy.js +0 -1
  198. package/dist/assets/pt-D1bjCfHu.js +0 -5
  199. package/dist/assets/ru-DcnfcUY4.js +0 -5
  200. package/dist/assets/schema-FvrjdNj0.js +0 -1
  201. package/dist/assets/sdk-CJ1iR7xK.js +0 -1
  202. package/dist/assets/th-C2mNGstJ.js +0 -5
  203. package/dist/assets/toUpper-BtQ3lZvX.js +0 -1
  204. package/dist/assets/vi-C4AydA45.js +0 -5
  205. package/dist/assets/wrap-locale-2rMKAFFZ.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as O,u as W,r as i,a as R,b as D,j as e,o as y,d as H,e as Q,g as Y,f as F,W as U,L as X,p as j,h as J,i as k,T as h,G as v,k as K,l as z,s as q,C as Z}from"./index-DU58_n0q.js";import{f as ee}from"./index-BojVbZw0.js";import{v as $}from"./index-Cyg_4FtP.js";import{M as V}from"./metric-B_Yupykk.js";import{C as M}from"./click-to-copy-CksDRdqm.js";var ne=O(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const B=i.createContext({}),{Provider:se,Consumer:xe}=B;function ae({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R(D.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R(D.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R(D.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(se,{value:{users:b},children:a})}function te(){const{users:a}=i.useContext(B);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},re=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const oe=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function ie(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=H(),{users:c}=te(),t=Q(()=>oe(d)),{t:s,locale:p}=i.useContext(Y),_=F(),f=re(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:z(p)};return K(o,m)});let b=null;if(r)b=e.jsx(Z,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(U,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(U,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(U,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(X,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(J(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const L=c.length,A=c.filter(n=>n.approved).length;let P=L;A&&(P+=`<small><strong>${ne(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>n.status==="running").length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>n.status==="running").length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const G=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ee(new Date(a.createdAt).getTime(),z(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:G.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx($,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx($,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx($,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(le,{children:b})}const le=q.main`
1
+ import{c as O,u as W,r as i,a as R,b as D,j as e,o as y,d as H,e as Q,g as Y,f as F,W as U,L as X,p as j,h as J,i as k,T as h,G as v,k as K,l as z,s as q,C as Z}from"./index-D6TVGB8K.js";import{f as ee}from"./index-BojVbZw0.js";import{v as $}from"./index-KcFXaE_y.js";import{M as V}from"./metric-yHhkpFYW.js";import{C as M}from"./click-to-copy-BZtVQnJA.js";var ne=O(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const B=i.createContext({}),{Provider:se,Consumer:xe}=B;function ae({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R(D.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R(D.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R(D.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(se,{value:{users:b},children:a})}function te(){const{users:a}=i.useContext(B);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},re=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const oe=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function ie(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=H(),{users:c}=te(),t=Q(()=>oe(d)),{t:s,locale:p}=i.useContext(Y),_=F(),f=re(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:z(p)};return K(o,m)});let b=null;if(r)b=e.jsx(Z,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(U,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(U,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(U,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(X,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(J(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const L=c.length,A=c.filter(n=>n.approved).length;let P=L;A&&(P+=`<small><strong>${ne(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>n.status==="running").length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>n.status==="running").length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const G=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ee(new Date(a.createdAt).getTime(),z(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:G.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx($,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx($,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx($,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(le,{children:b})}const le=q.main`
2
2
  .page-header {
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -1,4 +1,4 @@
1
- import{u as k,j as o,C as y,ay as W,cT as b,A as U,m as E,cI as _,r,aW as D,h as d,y as x,al as P,af as R,w as O,E as A,x as $,ax as K,bw as z,s as H}from"./index-DU58_n0q.js";import{I as M}from"./invitation-DU4VJuCh.js";import"./index-BK_pSLOh.js";import"./index-BZS48BpA.js";import"./emotion-cache.browser.esm-CQTZWHgn.js";import"./sdk-CJ1iR7xK.js";import"./wrap-locale-2rMKAFFZ.js";function V(p){const{api:i,session:f}=W(),{info:n}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:N,decrypt:C}=_(),[I,g]=r.useState(!1),h=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),t=D(async()=>{if(!h)return null;let e;const{data:s}=await i.get("/api/invitation",{params:{inviteId:h}}),a=!!d(n,"ownerNft.did")&&s.role.name==="owner";if(a){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",N),u.searchParams.set("inviteId",h);const{data:F}=await i.get(u.href);e=F}return{invitation:s,nextWorkflow:e,needReceiveNFT:a}}),T=r.useCallback(()=>{g(!0)},[]),L=r.useCallback(()=>{if(t.error)throw t.error;return t.value.invitation},[t]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const s=new URLSearchParams(c.search);s.delete("inviteId");const a=s.toString();await f.refresh(),v(`/${a&&`?${a}`}`,{replace:!0})},[c,v,f]);if(t.loading)return o.jsx(y,{});const S=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",t.value.nextWorkflow.token),e.searchParams.set("locale",m);const s=setInterval(async()=>{const{data:a}=await i.get(e.href);a.status==="succeed"&&(clearInterval(s),f.updateConnectedInfo(a),w(a))},2e3)},j=()=>{g(!1)};return o.jsxs(X,{className:"page-invite",children:[d(t,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:n.launcher.url,checkFn:K.create({baseURL:n.launcher.url}).get,onSuccess:S,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(n),extraParams:{nw:d(t,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:n.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(M,{...p,getDataFn:L,createPassportSvg:e=>z(e,n),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(t,"value.needReceiveNFT")?T:null})]})}const X=H.div`
1
+ import{u as k,j as o,C as y,ay as W,cT as b,A as U,m as E,cI as _,r,aW as D,h as d,y as x,al as P,af as R,w as O,E as A,x as $,ax as K,bw as z,s as H}from"./index-D6TVGB8K.js";import{I as M}from"./invitation-BsKjnkj4.js";import"./index-DMOKZCkM.js";import"./index-KV2818dS.js";import"./emotion-cache.browser.esm-C83OYG6J.js";import"./sdk-AP0IBqOB.js";import"./wrap-locale-BeNl69zP.js";function V(p){const{api:i,session:f}=W(),{info:n}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:N,decrypt:C}=_(),[I,g]=r.useState(!1),h=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),t=D(async()=>{if(!h)return null;let e;const{data:s}=await i.get("/api/invitation",{params:{inviteId:h}}),a=!!d(n,"ownerNft.did")&&s.role.name==="owner";if(a){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",N),u.searchParams.set("inviteId",h);const{data:F}=await i.get(u.href);e=F}return{invitation:s,nextWorkflow:e,needReceiveNFT:a}}),T=r.useCallback(()=>{g(!0)},[]),L=r.useCallback(()=>{if(t.error)throw t.error;return t.value.invitation},[t]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const s=new URLSearchParams(c.search);s.delete("inviteId");const a=s.toString();await f.refresh(),v(`/${a&&`?${a}`}`,{replace:!0})},[c,v,f]);if(t.loading)return o.jsx(y,{});const S=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",t.value.nextWorkflow.token),e.searchParams.set("locale",m);const s=setInterval(async()=>{const{data:a}=await i.get(e.href);a.status==="succeed"&&(clearInterval(s),f.updateConnectedInfo(a),w(a))},2e3)},j=()=>{g(!1)};return o.jsxs(X,{className:"page-invite",children:[d(t,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:n.launcher.url,checkFn:K.create({baseURL:n.launcher.url}).get,onSuccess:S,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(n),extraParams:{nw:d(t,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:n.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(M,{...p,getDataFn:L,createPassportSvg:e=>z(e,n),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(t,"value.needReceiveNFT")?T:null})]})}const X=H.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;
@@ -1 +1 @@
1
- import{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index-DU58_n0q.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{cn as g,r as o,g as x,co as r,B as u,j as s,N as m,cp as d}from"./index-D6TVGB8K.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,4 +1,4 @@
1
- import{aG as je,j as e,u as Q,r as h,e as Fe,aH as $r,E as k,aI as Ur,aJ as an,aK as Hn,aL as sn,aM as et,m as z,ad as le,s as ne,aN as ln,o as p,aO as zr,aP as cn,aQ as Br,H as re,O as dn,T as A,t as q,az as fe,aR as _e,C as K,X as be,v as V,aS as Gn,Y as pe,N as W,g as Mt,P as tt,aT as Mr,d as Wt,aU as Ie,aV as me,aa as Wr,aW as qr,aX as Hr,y as Gr,A as Kn,W as un,p as mn,h as te,aY as qt,a as Et,U as X,b as ct,aZ as Yn,a_ as Vn,V as Xn,a4 as Pt,a$ as Kr,b0 as Yr,b1 as Vr,b2 as Xr,b3 as nt,J as Qr,b4 as Zr,aF as Ge,b5 as Jr,a9 as jt,a6 as wt,b6 as ei,a7 as _t,L as Ht,K as ti,b7 as ni,b8 as Qn,a8 as ri,b9 as Zn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as Jn,D as At,f as er,bf as ai,bg as fn,ak as si,bh as li,bi as ee,bj as ci,S as pn,k as gn,l as hn,bk as di,bl as ui,bm as mi}from"./index-DU58_n0q.js";import{u as fi,T as pi}from"./html-title-B9VJeaWm.js";import{A as gi}from"./ArrowDropDown-BTUv7vHV.js";import{u as Kt,C as B,a as xn}from"./index.esm-B1-cOF6G.js";import{S as ae}from"./switch-control-CQ98tRq5.js";import{P as ie}from"./permission-DzQpyYyx.js";import{H as tr,g as hi}from"./index-CAsP5aCR.js";import{A as nr}from"./Link-F8ailKcW.js";import{D as ve,R as rr,a as It,b as xi,W as Ke}from"./url-evaluation-N368hPz7.js";import{D as dt}from"./delete-confirm-gaBotr9j.js";import{v as rt}from"./index-Cyg_4FtP.js";import{s as yi}from"./logo-BKA11TRi.js";import{u as bi}from"./useLocalStorage-BLqETmqX.js";import{R as vi}from"./Refresh-BN9bnQko.js";import{L as ji}from"./LoadingButton-BMyjySY9.js";import{C as wi,R as Ci,P as ir}from"./rotate-session-key-Bg2FnobO.js";import{A as Le}from"./Add-BjgJStpH.js";import{B as or,D as yn}from"./status-CIoNpyLM.js";import{i as Si}from"./is-path-prefix-equal-B-f1Tg_r.js";import{N as Di}from"./ChevronRight-kbJt7gtd.js";import{I as ki}from"./MoreVert-CcaizWju.js";import{E as ar}from"./Edit-C-sJa5uj.js";import{A as Ri}from"./CallMerge-BcMUWo1q.js";import{C as Ti}from"./CardContent-BM2KtzjC.js";import{S as Ei}from"./Slider-s-3T3O0E.js";import"./Switch-CIpFMcAY.js";import"./FilterList-DB3vvbr3.js";import"./CSSTransition-DoP2sjA4.js";import"./emotion-cache.browser.esm-CQTZWHgn.js";import"./index-DtqtNQh5.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BOxgPVK8.js";import"./index-DEqQ_b5f.js";import"./TableSearch-CbI3u7v4.js";import"./Search-7Pw1ev44.js";import"./Clear-fkSe1BQ5.js";import"./click-to-copy-CksDRdqm.js";import"./visuallyHidden-Dan1xhjv.js";const Pi=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),_i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ai=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),sr=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Ii=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Li=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Oi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",lr=h.createContext({}),{Provider:Fi,Consumer:ss}=lr,bn=[ye,k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP],Ni=(t,r)=>{if(t.name===k.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===k.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=bn.includes(t.name),i=bn.includes(r.name);return n&&i?sn(t.name,r.name):n?-1:i?1:sn(t.name,r.name)},$i=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:u=[],corsAllowedOrigins:m=[]}=o;let{domain:d,domainAliases:c}=o;c=c||[],[k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ye,c.find(y=>y.value===n)||c.unshift({protected:!1,value:n}));const w={id:s,name:d,type:"domain",items:[],domainAliases:c,isProtected:o.isProtected,corsAllowedOrigins:m};return(u||[]).forEach(y=>{const{id:C,isProtected:E,from:{pathPrefix:j},to:D}=y;if(D.type===k.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(D.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",D.type=k.ROUTING_RULE_TYPES.DAEMON):S=D.did,w.items.push({id:C,name:an(j||"/"),title:S,type:"rule",isProtected:E,pathPrefix:j,to:D})}else w.items.push({id:C,pathPrefix:j,name:an(j||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:E,to:D})}),w.items=Hn(w.items,y=>y.name),w}).sort(Ni),l=a.reduce((o,s)=>{let{name:u}=s;return u.endsWith(k.BLOCKLET_SITE_GROUP_SUFFIX)&&([u]=u.split(".")),o[u]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Ui=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const u=l.rules.filter(m=>!m.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];s=u?u.name:"/"}return et(o.value,s,a)},zi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(u=>!u.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>et(s.value,o,i))},Bi=t=>{const r=t.map(i=>i.domain).filter(i=>![k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function vn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,u]=h.useState([]),m=Fe(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),v=P||[];await Promise.all(v.map(async g=>(g.domainAliases=await $r(g.domainAliases,{getIP:Ur}),g)));const f=Bi(v);a(v),o(f.domains),u([window.location.hostname,...f.domains,...f.domainsAliases.map(g=>g.value)])},[n]),d=(P,v)=>{a(f=>f.map(g=>g.id===P?v.domain?v:{...v,domain:g.domain}:g))},c=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),w=async P=>{const v=await r.addRoutingSite({input:P});a(i.concat(v.site))},y=async(P,v)=>{const f=await r.updateRoutingSite({input:{id:P,...v}});if(f.site&&f.site.id){const g=i.findIndex(R=>R.id===f.site.id);g!==-1&&(i.splice(g,1,f.site),a([].concat(i)))}},C=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(v=>v.id!==P))},E=async(P,v,f)=>{const g=await r.addDomainAlias({input:{id:P,domainAlias:v,force:f}});d(P,g.site)},j=async(P,v)=>{const f=await r.deleteDomainAlias({input:{id:P,domainAlias:v}});d(P,f.site)},D=async(P,v)=>{const{site:f}=await r.addRoutingRule({input:{id:P,rule:v}});d(P,f)},S=async(P,v)=>{const{site:f}=await r.updateRoutingRule({input:{id:P,rule:v}});d(P,f)},b=async(P,v)=>{const{site:f}=await r.deleteRoutingRule({input:{id:P,ruleId:v}});d(P,f)},x={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:w,updateSite:y,deleteSite:C,addDomainAlias:E,deleteDomainAlias:j,takeSnapshot:c,addRule:D,updateRule:S,deleteRule:b}},{sites:L,siteMap:F}=$i({sites:i,nodePort:n.port});return x.sites=L,x.siteMap=F,x.domains=l,x.allDomains=s,x.getBlockletUrl=({did:P,domain:v,mountPoint:f,params:g})=>Ui({did:P,domain:v,mountPoint:f,siteMap:x.siteMap,params:g}),x.getBlockletUrls=({did:P,mountPoint:v,params:f})=>zi({did:P,mountPoint:v,siteMap:x.siteMap,params:f}),e.jsx(Fi,{value:{routing:x},children:t})}function de(){const{routing:t}=h.useContext(lr);return t}function Yt(t){const r=[k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE,k.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Mi(){return null}function cr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=z(),a=()=>{n(null)},l=async s=>{if(s){let u=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";u==="/"?ln.push(`${s.pathname}`):(u.endsWith("/")&&(u=u.substring(0,u.length-1)),ln.push(`${u}${s.pathname}`)),window.location.reload()}},o=(s,...u)=>{let m=typeof t=="function"?t(s,...u):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Wi,{children:[e.jsx(Mi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}cr.propTypes={confirm:p.oneOfType([p.object,p.string,p.func])};const Wi=ne.div`
1
+ import{aG as je,j as e,u as Q,r as h,e as Fe,aH as $r,E as k,aI as Ur,aJ as an,aK as Hn,aL as sn,aM as et,m as z,ad as le,s as ne,aN as ln,o as p,aO as zr,aP as cn,aQ as Br,H as re,O as dn,T as A,t as q,az as fe,aR as _e,C as K,X as be,v as V,aS as Gn,Y as pe,N as W,g as Mt,P as tt,aT as Mr,d as Wt,aU as Ie,aV as me,aa as Wr,aW as qr,aX as Hr,y as Gr,A as Kn,W as un,p as mn,h as te,aY as qt,a as Et,U as X,b as ct,aZ as Yn,a_ as Vn,V as Xn,a4 as Pt,a$ as Kr,b0 as Yr,b1 as Vr,b2 as Xr,b3 as nt,J as Qr,b4 as Zr,aF as Ge,b5 as Jr,a9 as jt,a6 as wt,b6 as ei,a7 as _t,L as Ht,K as ti,b7 as ni,b8 as Qn,a8 as ri,b9 as Zn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as Jn,D as At,f as er,bf as ai,bg as fn,ak as si,bh as li,bi as ee,bj as ci,S as pn,k as gn,l as hn,bk as di,bl as ui,bm as mi}from"./index-D6TVGB8K.js";import{u as fi,T as pi}from"./html-title-BNM7JHcp.js";import{A as gi}from"./ArrowDropDown-Bf4GVn4d.js";import{u as Kt,C as B,a as xn}from"./index.esm-CsSY5qzM.js";import{S as ae}from"./switch-control-D1xFgmoW.js";import{P as ie}from"./permission-CEx3Xzzt.js";import{H as tr,g as hi}from"./index-DfUsFF1_.js";import{A as nr}from"./Link-z_O1747L.js";import{D as ve,R as rr,a as It,b as xi,W as Ke}from"./url-evaluation-CV1iSx1K.js";import{D as dt}from"./delete-confirm-C7gXjzI-.js";import{v as rt}from"./index-KcFXaE_y.js";import{s as yi}from"./logo-BKA11TRi.js";import{u as bi}from"./useLocalStorage-CYX8Yp0i.js";import{R as vi}from"./Refresh-0f0uuphQ.js";import{L as ji}from"./LoadingButton-CjHleU21.js";import{C as wi,R as Ci,P as ir}from"./rotate-session-key-D1vlWJy-.js";import{A as Le}from"./Add-CRYWmyuR.js";import{B as or,D as yn}from"./status-DQsEKGqd.js";import{i as Si}from"./is-path-prefix-equal-_qy5EOwg.js";import{N as Di}from"./ChevronRight-BgHVOCJf.js";import{I as ki}from"./MoreVert-DSc6xysS.js";import{E as ar}from"./Edit-CCuCWwa1.js";import{A as Ri}from"./CallMerge-DzPrq_5n.js";import{C as Ti}from"./CardContent-P0Sthx00.js";import{S as Ei}from"./Slider-m4FegYsq.js";import"./Switch-DAXTqD-y.js";import"./FilterList-MQmC3xoC.js";import"./CSSTransition-DpizwGU-.js";import"./emotion-cache.browser.esm-C83OYG6J.js";import"./index-0T824Y_m.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-zH57QwJk.js";import"./index-DQwdG3oO.js";import"./TableSearch-CdSVywW7.js";import"./Search-DiToZzru.js";import"./Clear-Bd6lrR3r.js";import"./click-to-copy-BZtVQnJA.js";import"./visuallyHidden-Dan1xhjv.js";const Pi=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),_i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ai=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),sr=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Ii=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Li=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Oi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",lr=h.createContext({}),{Provider:Fi,Consumer:ss}=lr,bn=[ye,k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP],Ni=(t,r)=>{if(t.name===k.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===k.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=bn.includes(t.name),i=bn.includes(r.name);return n&&i?sn(t.name,r.name):n?-1:i?1:sn(t.name,r.name)},$i=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:u=[],corsAllowedOrigins:m=[]}=o;let{domain:d,domainAliases:c}=o;c=c||[],[k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ye,c.find(y=>y.value===n)||c.unshift({protected:!1,value:n}));const w={id:s,name:d,type:"domain",items:[],domainAliases:c,isProtected:o.isProtected,corsAllowedOrigins:m};return(u||[]).forEach(y=>{const{id:C,isProtected:E,from:{pathPrefix:j},to:D}=y;if(D.type===k.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(D.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",D.type=k.ROUTING_RULE_TYPES.DAEMON):S=D.did,w.items.push({id:C,name:an(j||"/"),title:S,type:"rule",isProtected:E,pathPrefix:j,to:D})}else w.items.push({id:C,pathPrefix:j,name:an(j||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:E,to:D})}),w.items=Hn(w.items,y=>y.name),w}).sort(Ni),l=a.reduce((o,s)=>{let{name:u}=s;return u.endsWith(k.BLOCKLET_SITE_GROUP_SUFFIX)&&([u]=u.split(".")),o[u]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Ui=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const u=l.rules.filter(m=>!m.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];s=u?u.name:"/"}return et(o.value,s,a)},zi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(u=>!u.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>et(s.value,o,i))},Bi=t=>{const r=t.map(i=>i.domain).filter(i=>![k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function vn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,u]=h.useState([]),m=Fe(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),v=P||[];await Promise.all(v.map(async g=>(g.domainAliases=await $r(g.domainAliases,{getIP:Ur}),g)));const f=Bi(v);a(v),o(f.domains),u([window.location.hostname,...f.domains,...f.domainsAliases.map(g=>g.value)])},[n]),d=(P,v)=>{a(f=>f.map(g=>g.id===P?v.domain?v:{...v,domain:g.domain}:g))},c=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),w=async P=>{const v=await r.addRoutingSite({input:P});a(i.concat(v.site))},y=async(P,v)=>{const f=await r.updateRoutingSite({input:{id:P,...v}});if(f.site&&f.site.id){const g=i.findIndex(R=>R.id===f.site.id);g!==-1&&(i.splice(g,1,f.site),a([].concat(i)))}},C=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(v=>v.id!==P))},E=async(P,v,f)=>{const g=await r.addDomainAlias({input:{id:P,domainAlias:v,force:f}});d(P,g.site)},j=async(P,v)=>{const f=await r.deleteDomainAlias({input:{id:P,domainAlias:v}});d(P,f.site)},D=async(P,v)=>{const{site:f}=await r.addRoutingRule({input:{id:P,rule:v}});d(P,f)},S=async(P,v)=>{const{site:f}=await r.updateRoutingRule({input:{id:P,rule:v}});d(P,f)},b=async(P,v)=>{const{site:f}=await r.deleteRoutingRule({input:{id:P,ruleId:v}});d(P,f)},x={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:w,updateSite:y,deleteSite:C,addDomainAlias:E,deleteDomainAlias:j,takeSnapshot:c,addRule:D,updateRule:S,deleteRule:b}},{sites:L,siteMap:F}=$i({sites:i,nodePort:n.port});return x.sites=L,x.siteMap=F,x.domains=l,x.allDomains=s,x.getBlockletUrl=({did:P,domain:v,mountPoint:f,params:g})=>Ui({did:P,domain:v,mountPoint:f,siteMap:x.siteMap,params:g}),x.getBlockletUrls=({did:P,mountPoint:v,params:f})=>zi({did:P,mountPoint:v,siteMap:x.siteMap,params:f}),e.jsx(Fi,{value:{routing:x},children:t})}function de(){const{routing:t}=h.useContext(lr);return t}function Yt(t){const r=[k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE,k.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Mi(){return null}function cr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=z(),a=()=>{n(null)},l=async s=>{if(s){let u=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";u==="/"?ln.push(`${s.pathname}`):(u.endsWith("/")&&(u=u.substring(0,u.length-1)),ln.push(`${u}${s.pathname}`)),window.location.reload()}},o=(s,...u)=>{let m=typeof t=="function"?t(s,...u):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Wi,{children:[e.jsx(Mi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}cr.propTypes={confirm:p.oneOfType([p.object,p.string,p.func])};const Wi=ne.div`
2
2
  margin-bottom: 24px;
3
3
  .top-btns-alert {
4
4
  @media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
@@ -49,7 +49,7 @@ import{aG as je,j as e,u as Q,r as h,e as Fe,aH as $r,E as k,aI as Ur,aJ as an,a
49
49
  align-items: flex-start;
50
50
  width: 100%;
51
51
  max-width: 720px;
52
- `;function Yi(){const{refresh:t,info:r}=Q(),{t:n}=z(),[i,a]=h.useState(!1);h.useEffect(()=>{t({silent:!0})},[]);const l=()=>{t({silent:!0}),re.success(n("setting.saveSuccess"))};return e.jsx(Vi,{children:e.jsxs(W,{sx:{mb:4},children:[e.jsx(dr,{onSaved:l,submit:n("common.saveChanges"),title:""}),e.jsx(W,{style:{marginLeft:-8},sx:{mt:6},children:e.jsxs(V,{onClick:()=>a(o=>!o),children:[n("common.readMore"),i?e.jsx(Pi,{}):e.jsx(gi,{})]})}),i&&e.jsxs(W,{sx:{fontSize:12,color:"text.secondary"},children:[e.jsxs(W,{children:[n("dashboard.runtimeConfig.blockletMaxMemoryLimit"),": ",r.runtimeConfig.blockletMaxMemoryLimit," MB"]}),e.jsxs(W,{children:[n("dashboard.runtimeConfig.daemonMaxMemoryLimit"),": ",r.runtimeConfig.daemonMaxMemoryLimit," MB"]}),e.jsxs(W,{children:[n("dashboard.runtimeConfig.proxyMaxMemoryLimit"),": ",r.runtimeConfig.proxyMaxMemoryLimit," MB"]})]})]})})}const Vi=ne.div`
52
+ `;function Yi(){const{refresh:t,info:r}=Q(),{t:n}=z(),[i,a]=h.useState(!1);h.useEffect(()=>{t({silent:!0})},[]);const l=()=>{t({silent:!0}),re.success(n("setting.saveSuccess"))};return e.jsx(Vi,{children:e.jsxs(W,{sx:{mb:4},children:[e.jsx(dr,{onSaved:l,submit:n("common.saveChanges"),title:""}),e.jsx(W,{style:{marginLeft:-8},sx:{mt:6},children:e.jsxs(V,{onClick:()=>a(o=>!o),children:[n("common.readMore"),i?e.jsx(Pi,{}):e.jsx(gi,{})]})}),i&&e.jsxs(W,{sx:{fontSize:12,color:"text.secondary"},children:[e.jsxs(W,{children:[n("dashboard.runtimeConfig.blockletMaxMemoryLimit"),": ",r.runtimeConfig.blockletMaxMemoryLimit," MB"]}),e.jsxs(W,{children:[n("dashboard.runtimeConfig.daemonMaxMemoryLimit"),": ",r.runtimeConfig.daemonMaxMemoryLimit," MB"]})]})]})})}const Vi=ne.div`
53
53
  .eula-btn {
54
54
  text-decoration-line: underline;
55
55
  margin-top: 32px;
@@ -1,4 +1,4 @@
1
- import{aG as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dn as Skeleton,cP as M$1,_ as CheckIcon,az as Tooltip,dH as Button,T as Typography,N as Box,C as CircularProgress,f as useTheme,dB as isObject,e$ as mergeThemeOptions,f0 as StyledEngineProvider,f1 as ThemeProvider,f2 as ThemeProvider$1,f3 as s,Z as o$1,b8 as styled$1,f4 as CloseIcon,cE as Buffer,be as U,bE as __vitePreload,dG as noop,dd as l$2}from"./index-DU58_n0q.js";import{j as joinUrl}from"./url-join-DzCvUteF.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,F,V=window.location.pathname.replace(/\/$/,"/"))=>C?F?C===V:new RegExp(C).test(V):!1;function P({children:C,steps:F,mode:V="history"}){const[D,B]=reactExports$1.useState("");!D&&F.length&&B(F[0].key);const O=F.map(X=>X.children?[{key:X.key,hasChild:!0},X.children.map(at=>({parentKey:X.key,key:at.key}))]:{key:X.key}).flat(1/0),j=O.filter(X=>!X.hasChild),H=X=>{let at;const rt=O.findIndex(ft=>ft.key===D?(at=ft.parentKey,!0):!1);if(at===X)return"current";const tt=O.findIndex(ft=>ft.key===X);if(tt!==-1){if(tt===rt)return"current";if(tt<rt)return"before"}return"after"};function G(X){B(X)}function K(X){if(typeof X=="function"){const at=X(j.findIndex(rt=>rt.key===D));B(j[at].key)}else B(j[X].key)}const it=j.findIndex(X=>X.key===D);reactExports$1.useEffect(()=>{if(V==="history"){let X="";F.some(at=>at.children&&at.children.length?at.children.some(rt=>d$1(rt.path,rt.exact)?(X=rt.key,!0):!1):d$1(at.path,at.exact)?(X=at.key,!0):!1),X&&B(X)}return()=>{}},[F,V]);const ot={steps:F,totalStepsCount:j.length,getStepStatus:H,setActiveStepByKey:G,setActiveStepByIndex:K,activeStep:it,canBackToStep:X=>V==="memory"&&it!==0&&X<it};return jsxRuntimeExports.jsx(w$3,{value:ot,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,F=Object.prototype.toString;function V(D){if(D==null)return!0;if(typeof D=="boolean")return!1;if(typeof D=="number")return D===0;if(typeof D=="string"||typeof D=="function"||Array.isArray(D))return D.length===0;if(D instanceof Error)return D.message==="";if(D.toString==F)switch(D.toString()){case"[object File]":case"[object Map]":case"[object Set]":return D.size===0;case"[object Object]":{for(var B in D)if(C.call(D,B))return!1;return!0}}return!1}return lib=V,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:F="",logoUrl:V="",locale:D="",navLogo:B="",loading:O=!1}){const j=useMediaQuery(ot=>ot.breakpoints.down("md")),H=j?18:48,G=reactExports$1.useRef(null),[K,it]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{G.current&&G.current.offsetHeight>34&&(K===""?it("middle"):K==="middle"&&it("small"))},[K]),jsxRuntimeExports.jsxs(R,{className:K==="small"?"center-mode":"",children:[j?jsxRuntimeExports.jsx("div",{className:"app-icon",children:B}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[O&&jsxRuntimeExports.jsx(I,{blockletSize:H,isMobile:j}),!O&&jsxRuntimeExports.jsx(u$1,{blockletSize:H,logoUrl:V})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[j&&F&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:F}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!j&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:F||i(D)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${K==="middle"||K==="small"?"middle-size":""}`,ref:G,children:jsxRuntimeExports.jsx(w$2,{logoUrl:V,isMobile:j,blockletMeta:C,blockletSize:H,loading:O})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:F}){return F?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:F}){return jsxRuntimeExports.jsx(M$1,{width:F,height:F,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:F,blockletMeta:V={},blockletSize:D,loading:B}){const O=g$2(V);return B?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(V)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:D,logoUrl:F}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(V)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(V?.registryUrl||"",`/blocklets/${V?.did}`),title:O,children:O})}const L$1=styled.div`
1
+ import{aG as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dn as Skeleton,cP as M$1,_ as CheckIcon,az as Tooltip,dH as Button,T as Typography,N as Box,C as CircularProgress,f as useTheme,dB as isObject,e$ as mergeThemeOptions,f0 as StyledEngineProvider,f1 as ThemeProvider,f2 as ThemeProvider$1,f3 as s,Z as o$1,b8 as styled$1,f4 as CloseIcon,cE as Buffer,be as U,bE as __vitePreload,dG as noop,dd as l$2}from"./index-D6TVGB8K.js";import{j as joinUrl}from"./url-join-CIv0Ugfk.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,F,V=window.location.pathname.replace(/\/$/,"/"))=>C?F?C===V:new RegExp(C).test(V):!1;function P({children:C,steps:F,mode:V="history"}){const[D,B]=reactExports$1.useState("");!D&&F.length&&B(F[0].key);const O=F.map(X=>X.children?[{key:X.key,hasChild:!0},X.children.map(at=>({parentKey:X.key,key:at.key}))]:{key:X.key}).flat(1/0),j=O.filter(X=>!X.hasChild),H=X=>{let at;const rt=O.findIndex(ft=>ft.key===D?(at=ft.parentKey,!0):!1);if(at===X)return"current";const tt=O.findIndex(ft=>ft.key===X);if(tt!==-1){if(tt===rt)return"current";if(tt<rt)return"before"}return"after"};function G(X){B(X)}function K(X){if(typeof X=="function"){const at=X(j.findIndex(rt=>rt.key===D));B(j[at].key)}else B(j[X].key)}const it=j.findIndex(X=>X.key===D);reactExports$1.useEffect(()=>{if(V==="history"){let X="";F.some(at=>at.children&&at.children.length?at.children.some(rt=>d$1(rt.path,rt.exact)?(X=rt.key,!0):!1):d$1(at.path,at.exact)?(X=at.key,!0):!1),X&&B(X)}return()=>{}},[F,V]);const ot={steps:F,totalStepsCount:j.length,getStepStatus:H,setActiveStepByKey:G,setActiveStepByIndex:K,activeStep:it,canBackToStep:X=>V==="memory"&&it!==0&&X<it};return jsxRuntimeExports.jsx(w$3,{value:ot,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,F=Object.prototype.toString;function V(D){if(D==null)return!0;if(typeof D=="boolean")return!1;if(typeof D=="number")return D===0;if(typeof D=="string"||typeof D=="function"||Array.isArray(D))return D.length===0;if(D instanceof Error)return D.message==="";if(D.toString==F)switch(D.toString()){case"[object File]":case"[object Map]":case"[object Set]":return D.size===0;case"[object Object]":{for(var B in D)if(C.call(D,B))return!1;return!0}}return!1}return lib=V,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:F="",logoUrl:V="",locale:D="",navLogo:B="",loading:O=!1}){const j=useMediaQuery(ot=>ot.breakpoints.down("md")),H=j?18:48,G=reactExports$1.useRef(null),[K,it]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{G.current&&G.current.offsetHeight>34&&(K===""?it("middle"):K==="middle"&&it("small"))},[K]),jsxRuntimeExports.jsxs(R,{className:K==="small"?"center-mode":"",children:[j?jsxRuntimeExports.jsx("div",{className:"app-icon",children:B}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[O&&jsxRuntimeExports.jsx(I,{blockletSize:H,isMobile:j}),!O&&jsxRuntimeExports.jsx(u$1,{blockletSize:H,logoUrl:V})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[j&&F&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:F}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!j&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:F||i(D)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${K==="middle"||K==="small"?"middle-size":""}`,ref:G,children:jsxRuntimeExports.jsx(w$2,{logoUrl:V,isMobile:j,blockletMeta:C,blockletSize:H,loading:O})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:F}){return F?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:F}){return jsxRuntimeExports.jsx(M$1,{width:F,height:F,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:F,blockletMeta:V={},blockletSize:D,loading:B}){const O=g$2(V);return B?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(V)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:D,logoUrl:F}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(V)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(V?.registryUrl||"",`/blocklets/${V?.did}`),title:O,children:O})}const L$1=styled.div`
2
2
  .ellipsis-title {
3
3
  flex: 1;
4
4
  position: absolute;
@@ -1 +1 @@
1
- import{r as P,m as E,A as C,j as e,Z as W,C as j,cB as I,N as T,w as k,H as u,E as N,u as S,x as U,ar as v,af as R}from"./index-DU58_n0q.js";import{w as b}from"./wrap-locale-2rMKAFFZ.js";import{g as L}from"./get-safe-url-CN3kjswr.js";function B({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const _=b(B);function K(){const{info:n}=S(),a=U(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(_,{SessionContext:v,webWalletUrl:a,onSuccess:r})}export{K as default};
1
+ import{r as P,m as E,A as C,j as e,Z as W,C as j,cB as I,N as T,w as k,H as u,E as N,u as S,x as U,ar as v,af as R}from"./index-D6TVGB8K.js";import{w as b}from"./wrap-locale-BeNl69zP.js";import{g as L}from"./get-safe-url-ThSpI0WV.js";function B({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const _=b(B);function K(){const{info:n}=S(),a=U(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(_,{SessionContext:v,webWalletUrl:a,onSuccess:r})}export{K as default};
@@ -1,4 +1,4 @@
1
- import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as $e,cb as J,b$ as Ye,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,iZ as Ve,m as D,gw as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,i_ as X,hT as Z,i$ as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as $,a9 as Y,a5 as rt,dH as it,gm as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-DU58_n0q.js";import{T as ut}from"./html-title-B9VJeaWm.js";import{u as L}from"./blocklet-ECxXqY9c.js";import{u as mt}from"./use-mobile-Df5zHg-M.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-AnYJDZYw.js";import"./index-Dt7-HgvT.js";import"./index-BojVbZw0.js";import"./api-C1oEeGCK.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-OAtRfRDP.js";import{v as Rt}from"./index-Cyg_4FtP.js";import{E as zt}from"./index-BLE0wW-0.js";import{H as vt}from"./HelpOutline-BgoG1GPn.js";import{H as Pt}from"./index-CAsP5aCR.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-DAdg3TCf.js";import{D as Lt}from"./DeleteOutline-QcWnkTtX.js";import{g as ke}from"./get-safe-url-CN3kjswr.js";import{S as Ot}from"./switch-control-CQ98tRq5.js";import{L as je}from"./list-header-DFfMMiM1.js";import"./OpenInNew-HJpnTd_H.js";import"./ButtonGroup-BJJMUa5C.js";import"./getValidReactChildren-UKe-U4T8.js";import"./FilterList-DB3vvbr3.js";import"./CSSTransition-DoP2sjA4.js";import"./emotion-cache.browser.esm-CQTZWHgn.js";import"./index-DtqtNQh5.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BOxgPVK8.js";import"./index-DEqQ_b5f.js";import"./TableSearch-CbI3u7v4.js";import"./Search-7Pw1ev44.js";import"./Clear-fkSe1BQ5.js";import"./MoreVert-CcaizWju.js";import"./useLocalStorage-BLqETmqX.js";import"./url-evaluation-N368hPz7.js";import"./permission-DzQpyYyx.js";import"./Switch-CIpFMcAY.js";function Mt(t){return Ge("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 Ye(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=Ke({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},f=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",f.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"})),Gt=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 Kt({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 Ct(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 $t({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({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}=L(),[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 Yt({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}=L(),[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()}});r(Array.isArray(l)?l:[])}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:Ys}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),f=Qe(d),x=Yt({appDid:o?.appDid}),u=h.useMemo(()=>wt(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===u)),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}}),u!==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===u&&(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}}),u!==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===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{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:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}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}=L(),{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(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):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"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.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(`
1
+ import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as $e,cb as J,b$ as Ye,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,iZ as Ve,m as D,gw as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,i_ as X,hT as Z,i$ as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as $,a9 as Y,a5 as rt,dH as it,gm as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-D6TVGB8K.js";import{T as ut}from"./html-title-BNM7JHcp.js";import{u as L}from"./blocklet-DNoyp9Cs.js";import{u as mt}from"./use-mobile-B7rT08bE.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-BBSjaMuR.js";import"./index-B2HXHaZp.js";import"./index-BojVbZw0.js";import"./api-Tp2L7lqP.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-gIxhAIXe.js";import{v as Rt}from"./index-KcFXaE_y.js";import{E as zt}from"./index-BUflWebx.js";import{H as vt}from"./HelpOutline-BoJ2fHVJ.js";import{H as Pt}from"./index-DfUsFF1_.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-CPb9Moks.js";import{D as Lt}from"./DeleteOutline-CPeLbfI7.js";import{g as ke}from"./get-safe-url-ThSpI0WV.js";import{S as Ot}from"./switch-control-D1xFgmoW.js";import{L as je}from"./list-header-DdDAZWs8.js";import"./OpenInNew-ymbf4EkY.js";import"./ButtonGroup-Cm76cRE-.js";import"./getValidReactChildren-Mx_dW0Jp.js";import"./FilterList-MQmC3xoC.js";import"./CSSTransition-DpizwGU-.js";import"./emotion-cache.browser.esm-C83OYG6J.js";import"./index-0T824Y_m.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-zH57QwJk.js";import"./index-DQwdG3oO.js";import"./TableSearch-CdSVywW7.js";import"./Search-DiToZzru.js";import"./Clear-Bd6lrR3r.js";import"./MoreVert-DSc6xysS.js";import"./useLocalStorage-CYX8Yp0i.js";import"./url-evaluation-CV1iSx1K.js";import"./permission-CEx3Xzzt.js";import"./Switch-DAXTqD-y.js";function Mt(t){return Ge("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 Ye(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=Ke({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},f=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",f.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"})),Gt=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 Kt({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 Ct(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 $t({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({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}=L(),[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 Yt({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}=L(),[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()}});r(Array.isArray(l)?l:[])}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:Ys}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),f=Qe(d),x=Yt({appDid:o?.appDid}),u=h.useMemo(()=>wt(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===u)),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}}),u!==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===u&&(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}}),u!==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===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{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:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}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}=L(),{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(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):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"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.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
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(zt,{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(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{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(G,{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(G,{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 Ue({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(U,{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(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({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=At(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"})})})]})}Le.propTypes={metadata:m.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:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?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:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[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(Pt,{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=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.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=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(Y,{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:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.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(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{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=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(Y,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(Y,{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:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.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}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,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 Tt(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:f,appName:x,appDescription:u,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(U,{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:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.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(U,{})}):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(ht,{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(U,{})}):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}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{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(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),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],u=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:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{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:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
3
3
  position: relative;
4
4
  min-height: 66vh;