@abtnode/webapp 1.16.29-beta-2eaf40bc → 1.16.29-beta-cbfd116d

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 (186) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-3VAJlzWu.js → Add-DiqSqlhj.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-DehQx6JH.js → ArrowDropDown-9DQuvaIf.js} +1 -1
  5. package/dist/assets/{Autocomplete-Dd8-Wnl0.js → Autocomplete-DAPdBU_C.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-B-3iNfJV.js → Breadcrumbs-JY-AOJsc.js} +1 -1
  7. package/dist/assets/{ButtonGroup-4dUIbekw.js → ButtonGroup-CnSZJdO-.js} +1 -1
  8. package/dist/assets/{CheckCircle-DQOA10VV.js → CheckCircle-BcIXmxwL.js} +1 -1
  9. package/dist/assets/{ChevronLeft-BovE6bSi.js → ChevronLeft-GdOz3FFz.js} +1 -1
  10. package/dist/assets/{ChevronRight-COT0_GJ0.js → ChevronRight-DTSbdiO9.js} +1 -1
  11. package/dist/assets/{Close-DSOnajKv.js → Close-DSPV3CNA.js} +1 -1
  12. package/dist/assets/Delete-C5xn6WBN.js +1 -0
  13. package/dist/assets/DeleteOutline-CvnGFYQc.js +1 -0
  14. package/dist/assets/{Done-C6j7V5dY.js → Done-Bj8_3suh.js} +1 -1
  15. package/dist/assets/{Edit-UiTtw7ED.js → Edit-eEaW9uQd.js} +1 -1
  16. package/dist/assets/{EditIcon-D-Dhs8bv.js → EditIcon-CwmNryz4.js} +1 -1
  17. package/dist/assets/{ExpandMore-CBwUEwtf.js → ExpandMore-B-eh--rZ.js} +1 -1
  18. package/dist/assets/{FilterList-BfkrQFl0.js → FilterList-BdSdHr3_.js} +4 -4
  19. package/dist/assets/{Google-U8HcYuII.js → Google-WY0BO4_p.js} +1 -1
  20. package/dist/assets/{Https-DJQ_Uk5c.js → Https-2PaIz1Mj.js} +1 -1
  21. package/dist/assets/{InputAdornment-xbC4GBmg.js → InputAdornment-DDTwW0WR.js} +1 -1
  22. package/dist/assets/{InputLabel-Dyg2n4KM.js → InputLabel-kl4d4Afd.js} +1 -1
  23. package/dist/assets/{LastPage-g6ViU_79.js → LastPage-erHk2ZH1.js} +1 -1
  24. package/dist/assets/{Launch-CstW8TMa.js → Launch-CAo1lLU6.js} +1 -1
  25. package/dist/assets/{Link-Bz3bTK5Z.js → Link-DXUHsj8a.js} +1 -1
  26. package/dist/assets/{LoadingButton-yzy8vaq4.js → LoadingButton-aHGLPfZ-.js} +1 -1
  27. package/dist/assets/{LockIcon-C86uaqg6.js → LockIcon-1DSaApOb.js} +1 -1
  28. package/dist/assets/{Loop-D_KRqy9W.js → Loop-CuMM_YqO.js} +1 -1
  29. package/dist/assets/{MoreVert-BB46cKFe.js → MoreVert-pFjb7TqH.js} +1 -1
  30. package/dist/assets/{Pagination-JhNJfD4t.js → Pagination-BHNfBA4C.js} +1 -1
  31. package/dist/assets/{Public-BjhCkcv9.js → Public-BmojyP-T.js} +1 -1
  32. package/dist/assets/{SchemaReference.es-HI-2_6NF.js → SchemaReference.es-ajHOOp8o.js} +1 -1
  33. package/dist/assets/{Search-rqHI-c1S.js → Search-raLlCMJk.js} +1 -1
  34. package/dist/assets/{Select-BioDM9Sd.js → Select-cp6_ZHE7.js} +2 -2
  35. package/dist/assets/{Skeleton-DZ26ugSB.js → Skeleton-D5UyHItu.js} +5 -5
  36. package/dist/assets/{Slider-CIc45JJ9.js → Slider-ecnPtLPj.js} +1 -1
  37. package/dist/assets/{Stepper-BXZWzSgf.js → Stepper-D7Rp4vlm.js} +1 -1
  38. package/dist/assets/TextField-De1OeNfZ.js +1 -0
  39. package/dist/assets/{ToggleButtonGroup-DRfzhnnx.js → ToggleButtonGroup-Bdg3Invr.js} +1 -1
  40. package/dist/assets/{ViewList-Cm-dAQhY.js → ViewList-C83zj7rF.js} +1 -1
  41. package/dist/assets/{actions-Bi_LOjPn.js → actions-7_FKWiUA.js} +1 -1
  42. package/dist/assets/actions-C-0J_ddu.js +11 -0
  43. package/dist/assets/{agreement-DPo8tjJ3.js → agreement-CnVZqe64.js} +8 -8
  44. package/dist/assets/api-Ds0tawHV.js +1 -0
  45. package/dist/assets/{app-avatar-CF6TIYj9.js → app-avatar-g5Pn3nvf.js} +1 -1
  46. package/dist/assets/{audit-logs-DK4wA_bl.js → audit-logs-if1tZvua.js} +1 -1
  47. package/dist/assets/blocklet-CAvqFbwn.js +1 -0
  48. package/dist/assets/{brace-fold.es-DwWLXH4V.js → brace-fold.es-DUo6FtkK.js} +1 -1
  49. package/dist/assets/bundle-avatar-CHZNUrui.js +1 -0
  50. package/dist/assets/{chart-DVdOH_wE.js → chart-BqdlHAIk.js} +1 -1
  51. package/dist/assets/{click-to-copy-BwGLfwQv.js → click-to-copy-Ci6mXYLS.js} +1 -1
  52. package/dist/assets/{closebrackets.es-piHSryNk.js → closebrackets.es-B_3eQLj6.js} +1 -1
  53. package/dist/assets/{codemirror.es-BX7gc_SI.js → codemirror.es-CxmI1MZI.js} +1 -1
  54. package/dist/assets/{comment.es-kfTcaTaN.js → comment.es-CzvTeML6.js} +1 -1
  55. package/dist/assets/{config-navigation-BjBcMzix.js → config-navigation-CVUMcunz.js} +2 -2
  56. package/dist/assets/{delete-confirm-B6Tu_cjp.js → delete-confirm-BvJrJyBD.js} +1 -1
  57. package/dist/assets/detail-CbKNMHOv.js +58 -0
  58. package/dist/assets/{dialog.es-qczXxs5i.js → dialog.es-BJ41s4Cl.js} +1 -1
  59. package/dist/assets/{download-hCU_NL5Y.js → download-9ooqNiDB.js} +1 -1
  60. package/dist/assets/{foldgutter.es-CNjZdGfG.js → foldgutter.es-D-hc2eHU.js} +1 -1
  61. package/dist/assets/getValidReactChildren-CSpxXCOO.js +1 -0
  62. package/dist/assets/{hint.es-BcTOFmVv.js → hint.es-CxW18Lnu.js} +1 -1
  63. package/dist/assets/{hint.es2-Po_QXCs2.js → hint.es2-CpBfqvnT.js} +1 -1
  64. package/dist/assets/{iframe-D60s0j4M.js → iframe-dtu0sSkn.js} +1 -1
  65. package/dist/assets/{index-CtJUE_Ce.js → index-1ouNgxgi.js} +1 -1
  66. package/dist/assets/{index-Dv0PfLaH.js → index-2GizaExc.js} +1 -1
  67. package/dist/assets/index-8Fg683El.js +1 -0
  68. package/dist/assets/{index-By48hREf.js → index-ApUKcTB6.js} +1 -1
  69. package/dist/assets/{index-DWoEF0Xz.js → index-B340bMPK.js} +1 -1
  70. package/dist/assets/{index-C2qpMC0j.js → index-B37qKP2B.js} +1 -1
  71. package/dist/assets/{index--pVRVvBB.js → index-B5t-vzvI.js} +1 -1
  72. package/dist/assets/{index-ClJrGzyV.js → index-B9bBENg5.js} +1 -1
  73. package/dist/assets/index-BBOgCzBo.js +268 -0
  74. package/dist/assets/{index-D79trrES.js → index-BCE3QRG4.js} +1 -1
  75. package/dist/assets/{index-CJQiOTRD.js → index-BK64HUrZ.js} +1 -1
  76. package/dist/assets/{index-D6BTN5bJ.js → index-BK9uVuLM.js} +10 -10
  77. package/dist/assets/index-BKS0pysx.js +21 -0
  78. package/dist/assets/{index-D5mvFHwK.js → index-BLWTCfoo.js} +1 -1
  79. package/dist/assets/index-BVm7HRmN.js +54 -0
  80. package/dist/assets/index-BWhWAS_S.js +11 -0
  81. package/dist/assets/{index-CS1WMiVI.js → index-B_svRTuF.js} +17 -17
  82. package/dist/assets/{index-DS0UcZlk.js → index-BeNQNQmg.js} +3 -3
  83. package/dist/assets/index-BsaVztdp.js +344 -0
  84. package/dist/assets/{index-BOVEdIid.js → index-C5ovAp04.js} +1 -1
  85. package/dist/assets/{index-CYa2z0tY.js → index-CPTaSMMt.js} +1 -1
  86. package/dist/assets/{index-CuSKWisM.js → index-CY_rOxjZ.js} +1 -1
  87. package/dist/assets/{index-D7CruCrK.js → index-C_RXntkM.js} +3 -3
  88. package/dist/assets/{index-B6BXxNti.js → index-Clb1BN1w.js} +8 -8
  89. package/dist/assets/{index-Q8ecyTb-.js → index-Col2kLJU.js} +3 -3
  90. package/dist/assets/{index-CLxOAjUq.js → index-Cvt_EuXc.js} +1 -1
  91. package/dist/assets/{index-CjoxtNQO.js → index-Cwul5-Ge.js} +1 -1
  92. package/dist/assets/{index-CfMrG-6m.js → index-Cy0-aW7U.js} +1 -1
  93. package/dist/assets/{index-BlJ5mRs4.js → index-D3BjUmxN.js} +9 -9
  94. package/dist/assets/{index-BqZEyDkY.js → index-D5PxJp2e.js} +1 -1
  95. package/dist/assets/{index-wtjGA_La.js → index-DJ0BZ1f0.js} +5 -5
  96. package/dist/assets/{index-Dpr1-GCJ.js → index-DQYRaCdB.js} +167 -167
  97. package/dist/assets/{index-CHD6Sawv.js → index-DU8rbzfp.js} +1 -1
  98. package/dist/assets/{index-G0ifYRE5.js → index-DX3JXbQb.js} +1 -1
  99. package/dist/assets/{index-p_USl--w.js → index-DeyjciFW.js} +1 -1
  100. package/dist/assets/{index-T3bFNwLt.js → index-DfnZyC-Q.js} +1 -1
  101. package/dist/assets/index-DkHucXVl.js +1 -0
  102. package/dist/assets/{index-FuyWc2kY.js → index-Dml7jmrq.js} +12 -14
  103. package/dist/assets/{index-CjpSyZA2.js → index-Dpb6wQjU.js} +1 -1
  104. package/dist/assets/{index-20iGb6mA.js → index-QHILeAPv.js} +1 -1
  105. package/dist/assets/{index-DZMLm25q.js → index-QOcfFwdi.js} +7 -7
  106. package/dist/assets/{index-CSHzjJLI.js → index-SA9KFCJd.js} +1 -1
  107. package/dist/assets/{index-rYvrv8TX.js → index-WfxCd25J.js} +1 -1
  108. package/dist/assets/{index-B_G8iSj9.js → index-aG_TZ2ao.js} +66 -35
  109. package/dist/assets/{index-pZ4wuW0n.js → index-dn7DkX5z.js} +1 -1
  110. package/dist/assets/{index.es-BQGldbXt.js → index.es-BDInjNfg.js} +1 -1
  111. package/dist/assets/{index.esm-DqRgonGB.js → index.esm-BU72PdQQ.js} +1 -1
  112. package/dist/assets/{info-addon.es-CYKOi7kz.js → info-addon.es-Xn3SUOrf.js} +1 -1
  113. package/dist/assets/{info.es-CKNL-yym.js → info.es-B1u_NGqd.js} +1 -1
  114. package/dist/assets/{install-from-url-DPfj2cnI.js → install-from-url-CH7lpg1m.js} +1 -1
  115. package/dist/assets/{invitation-BY43eo5D.js → invitation-BsnKeELU.js} +5 -5
  116. package/dist/assets/{is-path-prefix-equal-OAOH-qOd.js → is-path-prefix-equal-t1z6fh3o.js} +1 -1
  117. package/dist/assets/{isEqual-C32HztcX.js → isEqual-Da-RbHn4.js} +1 -1
  118. package/dist/assets/{item-CDyVRhvg.js → item-CV3h78Bc.js} +1 -1
  119. package/dist/assets/{javascript.es-BYVV5293.js → javascript.es-OqtW_UTL.js} +1 -1
  120. package/dist/assets/{jump-to-line.es-jsNifFMh.js → jump-to-line.es-zSveRTL4.js} +1 -1
  121. package/dist/assets/{jump.es-BzHWkDXH.js → jump.es-D9HErZw4.js} +1 -1
  122. package/dist/assets/{line-BZys0zer.js → line-3LuKyLyu.js} +4 -4
  123. package/dist/assets/{lint.es-BFWMqOv1.js → lint.es-BwS4nEkH.js} +1 -1
  124. package/dist/assets/{lint.es2-CUt2AauZ.js → lint.es2-kWn9droA.js} +1 -1
  125. package/dist/assets/{lint.es3-di_bUcOb.js → lint.es3-DqCXv9QX.js} +1 -1
  126. package/dist/assets/{list-header-d25I2byh.js → list-header-B7OR53lN.js} +1 -1
  127. package/dist/assets/{log-DTxt_dGq.js → log-B3I8TEBI.js} +1 -1
  128. package/dist/assets/{lottie-CVFkVbsZ.js → lottie-CpmMaK50.js} +1 -1
  129. package/dist/assets/{matchbrackets.es-DVkRqCgH.js → matchbrackets.es-CwQH4b4x.js} +1 -1
  130. package/dist/assets/{memory-Bv9qf5X_.js → memory-Dcz53oCr.js} +1 -1
  131. package/dist/assets/{mode.es-CifbNh02.js → mode.es-B9Ou3L_t.js} +1 -1
  132. package/dist/assets/{mode.es2-cIWGTWZh.js → mode.es2-Y9WZpOUZ.js} +1 -1
  133. package/dist/assets/{mode.es3-aQZkTGg6.js → mode.es3-BDsxnz5X.js} +1 -1
  134. package/dist/assets/{onlineParser.es-DLUHNAdN.js → onlineParser.es-CZYol-HK.js} +1 -1
  135. package/dist/assets/{overview-6t6Ij2OO.js → overview-CqH7N4Bl.js} +2 -2
  136. package/dist/assets/react-igFgRd_9.js +379 -0
  137. package/dist/assets/{redux-I4eB06Ek.js → redux-BffWKrDO.js} +1 -1
  138. package/dist/assets/{runtime-KPnZVG0c.js → runtime-CEr1Nvlj.js} +1 -1
  139. package/dist/assets/{search.es-BBE6mbEs.js → search.es-Dr95-rca.js} +1 -1
  140. package/dist/assets/{searchcursor.es-BijniVLl.js → searchcursor.es-BOckckbU.js} +1 -1
  141. package/dist/assets/service-uk6SebUo.js +1 -0
  142. package/dist/assets/{shorten-label-Io_PRP3C.js → shorten-label-Cwua8w8y.js} +1 -1
  143. package/dist/assets/{show-hint.es-DS-7hlNh.js → show-hint.es-DC1xY__9.js} +1 -1
  144. package/dist/assets/{slicedToArray-BXSVsBoG.js → slicedToArray-CS-bonDA.js} +2 -2
  145. package/dist/assets/{spaces-DxJMOXk2.js → spaces-Cy0WiDqw.js} +1 -1
  146. package/dist/assets/{sublime.es-7jzC1I8A.js → sublime.es-DpA2RzKn.js} +1 -1
  147. package/dist/assets/{switch-control-BemP3Qoi.js → switch-control-NaEEozhc.js} +1 -1
  148. package/dist/assets/{table-icons-D4d7sHXC.js → table-icons-B0kRJbTK.js} +9 -9
  149. package/dist/assets/{tag-DJbcwSVc.js → tag-Z7mPKVvq.js} +1 -1
  150. package/dist/assets/{team-FBszwXwa.js → team-BJ7ItRYP.js} +1 -1
  151. package/dist/assets/toUpper-BIRWGc_f.js +1 -0
  152. package/dist/assets/{traffic-IVSZlM0h.js → traffic-BUI5AcsC.js} +5 -5
  153. package/dist/assets/ua-parser-C8b57cGC.js +1 -0
  154. package/dist/assets/{url-evaluation-D7EkdGbI.js → url-evaluation-BmTdICYl.js} +4 -4
  155. package/dist/assets/{url-join-Bw5bTuVj.js → url-join-CzgNur4y.js} +1 -1
  156. package/dist/assets/use-blocklet-info-for-connect-did-spaces-DmO4dvo0.js +1 -0
  157. package/dist/assets/{useLocalStorage-HB6kerLO.js → useLocalStorage-BV7bkq7L.js} +1 -1
  158. package/dist/assets/{util-IfcYVLEi.js → util-ClcVo8u2.js} +1 -1
  159. package/dist/assets/{wait-container-c5_W7fTC.js → wait-container-Bo2u9r31.js} +1 -1
  160. package/dist/assets/withStyles-gQ2FYysM.js +1 -0
  161. package/dist/assets/{wrap-locale-CTfg_3mB.js → wrap-locale-DgOTHwBu.js} +1 -1
  162. package/dist/index.html +1 -1
  163. package/dist/service-worker.js +1 -1
  164. package/package.json +1 -1
  165. package/dist/assets/Delete-B0dIMgAO.js +0 -1
  166. package/dist/assets/DeleteOutline-BqV9pNFr.js +0 -1
  167. package/dist/assets/DeleteOutline-C3yNjgmc.js +0 -1
  168. package/dist/assets/TextField-BKw9m9nx.js +0 -1
  169. package/dist/assets/actions-DMSeOF_9.js +0 -11
  170. package/dist/assets/api-DQe-yphm.js +0 -1
  171. package/dist/assets/blocklet-BJt-raxF.js +0 -1
  172. package/dist/assets/bundle-avatar-B6arcSZZ.js +0 -1
  173. package/dist/assets/detail-DXun71hQ.js +0 -58
  174. package/dist/assets/getValidReactChildren-Bfzg_2yP.js +0 -1
  175. package/dist/assets/index--tmgIfny.js +0 -1
  176. package/dist/assets/index-5ep8c_KG.js +0 -54
  177. package/dist/assets/index-BpaAmbjH.js +0 -278
  178. package/dist/assets/index-C2D98lgI.js +0 -288
  179. package/dist/assets/index-CgFNSj9q.js +0 -1
  180. package/dist/assets/index-rBCOxvDw.js +0 -21
  181. package/dist/assets/react-Rgfin0TQ.js +0 -56
  182. package/dist/assets/resource-dialog-BqDlfetI.js +0 -57
  183. package/dist/assets/service-9ctjdI1h.js +0 -1
  184. package/dist/assets/toUpper-DcVgFeb6.js +0 -1
  185. package/dist/assets/use-blocklet-info-for-connect-did-spaces-D16GfTTc.js +0 -1
  186. package/dist/assets/withStyles-C51kZpfM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aK as S,aL as _,j as e,bm as D,r as p,f as O,m as u,aZ as U,a_ as E,U as F,cd as V,B as $,C as k,be as K,a7 as Z,a8 as R,N as G,ce as w,cf as A,cg as L,a9 as I,a6 as P,ax as T,a2 as M,O as H,at as J,n as Q,P as i,o as W,ch as X}from"./index-Dpr1-GCJ.js";import{f as Y}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-JhNJfD4t.js";import"./LastPage-g6ViU_79.js";var x={},te=_;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=D(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:J(t.createdAt,N),children:Y(new Date(t.createdAt),W(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(Z,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:G,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(H,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=Q.div`
1
+ import{aK as S,aL as _,j as e,bm as D,r as p,f as O,m as u,aZ as U,a_ as E,U as F,cc as V,B as $,C as k,be as K,a7 as Z,a8 as R,N as G,cd as w,ce as A,cf as L,a9 as I,a6 as P,ax as T,a2 as M,O as H,at as J,n as Q,P as i,o as W,cg as X}from"./index-DQYRaCdB.js";import{f as Y}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-BHNfBA4C.js";import"./LastPage-erHk2ZH1.js";var x={},te=_;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=D(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:J(t.createdAt,N),children:Y(new Date(t.createdAt),W(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(Z,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:G,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(H,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=Q.div`
2
2
  min-height: 60vh;
3
3
 
4
4
  .page-header {
@@ -1,4 +1,4 @@
1
- import{P as o,s as C,j as n,O as u,aK as x,aL as g,bc as j,q as T}from"./index-Dpr1-GCJ.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
1
+ import{P as o,s as C,j as n,O as u,aK as x,aL as g,bc as j,q as T}from"./index-DQYRaCdB.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
2
2
  box-sizing: border-box;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,$ as he,a0 as ye,a1 as j,a2 as ee,a3 as Ge,A as M,K as Y,h as He,H as te,a4 as qe,m as $,T as Ve,a5 as Ye,a6 as Qe,B as U,D as Ke,C as be,w as Je,J as ve,a7 as Xe,a8 as Ze,a9 as et,u as I,f as tt,aa as W,t as Z,E as st,ab as se,z as Se,v as oe,ac as ot,W as re,i as je,x as Ce,y as Q,ad as rt,ae as nt,af as Pe,ag as at,b as B,ah as it,N as lt,ai as ct,Q as dt,aj as pt,ak as Re,al as Te,am as Ee,an as De,ao as Be,ap as N,aq as Ue,ar as Oe,as as _e,at as mt}from"./index-Dpr1-GCJ.js";import{P as G,L as ht,A as ut,S as Ae,a as Fe}from"./index-B_G8iSj9.js";import{A as ft,D as ne,u as xt,W as gt,P as wt,L as Le,d as $e,a as Ne}from"./wait-container-c5_W7fTC.js";import{_ as ue}from"./useLocalStorage-HB6kerLO.js";import{d as kt}from"./Launch-CstW8TMa.js";import{D as yt}from"./DeleteOutline-C3yNjgmc.js";import{g as bt,i as vt}from"./spaces-DxJMOXk2.js";import{T as St}from"./TextField-BKw9m9nx.js";import{i as fe}from"./isEqual-C32HztcX.js";import{d as jt}from"./MoreVert-BB46cKFe.js";import{E as Ct}from"./index-D5mvFHwK.js";import"./url-join-Bw5bTuVj.js";import"./Skeleton-DZ26ugSB.js";import"./Close-DSOnajKv.js";import"./lottie-CVFkVbsZ.js";import"./DeleteOutline-BqV9pNFr.js";import"./api-DQe-yphm.js";import"./Select-BioDM9Sd.js";import"./InputLabel-Dyg2n4KM.js";var Pt=We;function Rt(t){return Pt(t).toLowerCase()}var Tt=Rt;const Et=ze(Tt);function ae({children:t,selected:r}){return e.jsxs(Dt,{children:[t,e.jsx(S,{className:`selected-container ${r?"selected":""}`,children:e.jsx(ke,{className:"selected-icon"})})]})}const Dt=P(S)`
1
+ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as $,$ as he,a0 as ye,a1 as j,a2 as ee,a3 as Ge,A as M,K as Y,h as He,H as te,a4 as qe,m as L,T as Ve,a5 as Ye,a6 as Qe,B as U,D as Ke,C as be,w as Je,J as ve,a7 as Xe,a8 as Ze,a9 as et,u as I,f as tt,aa as W,t as Z,E as st,ab as se,z as Se,v as oe,ac as ot,W as re,i as je,x as Ce,y as Q,ad as rt,ae as nt,af as Pe,ag as at,b as B,ah as it,N as lt,ai as ct,Q as dt,aj as pt,ak as Re,al as Te,am as Ee,an as De,ao as Be,ap as N,aq as Ue,ar as Oe,as as _e,at as mt}from"./index-DQYRaCdB.js";import{P as G,L as ht,A as ut,S as $e,a as Ae}from"./index-aG_TZ2ao.js";import{A as ft,D as ne,u as xt,W as gt,P as wt,L as Fe,d as Le,a as Ne}from"./wait-container-Bo2u9r31.js";import{_ as ue}from"./useLocalStorage-BV7bkq7L.js";import{d as kt}from"./Launch-CAo1lLU6.js";import{d as yt}from"./DeleteOutline-CvnGFYQc.js";import{g as bt,i as vt}from"./spaces-Cy0WiDqw.js";import{T as St}from"./TextField-De1OeNfZ.js";import{i as fe}from"./isEqual-Da-RbHn4.js";import{d as jt}from"./MoreVert-pFjb7TqH.js";import{E as Ct}from"./index-BLWTCfoo.js";import"./url-join-CzgNur4y.js";import"./Skeleton-D5UyHItu.js";import"./Close-DSPV3CNA.js";import"./lottie-CpmMaK50.js";import"./api-Ds0tawHV.js";import"./Select-cp6_ZHE7.js";import"./InputLabel-kl4d4Afd.js";var Pt=We;function Rt(t){return Pt(t).toLowerCase()}var Tt=Rt;const Et=ze(Tt);function ae({children:t,selected:r}){return e.jsxs(Dt,{children:[t,e.jsx(S,{className:`selected-container ${r?"selected":""}`,children:e.jsx(ke,{className:"selected-icon"})})]})}const Dt=P(S)`
2
2
  position: relative;
3
3
 
4
4
  .selected-container {
@@ -53,17 +53,17 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,
53
53
  visibility: visible;
54
54
  }
55
55
  }
56
- `;ae.propTypes={children:V.node.isRequired,selected:V.bool};ae.defaultProps={selected:!1};const Me=x.createContext({}),{Provider:Bt,Consumer:Rs}=Me;function ie({children:t}){const{t:r}=A(),[s,c]=ue("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[d,m]=ue("selectedSpaceGatewayForRestore",s.find(o=>o.url==="https://www.didspaces.com/app")),l=o=>{const i=s.find(g=>o.url===g.url);if(i)throw new Error(r("storage.spaces.gateway.add.duplicate",{name:i.name}));c(()=>[...s,he.cloneDeep(o)]),m(o)},h=o=>{if(o.url===d.url)throw new Error(r("storage.spaces.gateway.delete.failedForSelected"));c(()=>s.filter(i=>i.url!==o.url))},u=o=>{m(o)};return x.useEffect(()=>{async function o(){const i=await Promise.all(s.map(async g=>{const{data:n}=await ye.get(j(g.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch(O=>(console.error(O),{data:{}})),p=n.appName??g.name;return he.merge(g,{name:p})}));c(i)}o()},[]),e.jsx(Bt,{value:{spaceGateways:s,selectedSpaceGateway:d,addSpaceGateway:l,deleteSpaceGateway:h,handleSelectSpaceGateway:u},children:t})}ie.propTypes={children:T.any.isRequired};ie.defaultProps={};function Ut(){return x.useContext(Me)}function le({spaceGateway:t,onDeleteSpaceGateway:r}){const{t:s}=A(),[c,d]=x.useState(!1),[m,l]=x.useState(!1),h=(o,i)=>{o==null||o.stopPropagation(),d(i)},u=async o=>{try{o==null||o.stopPropagation(),l(!0),await r(t),d(!1)}catch(i){console.error(i),M.error(`${s("storage.spaces.gateway.delete.failed")}: ${Y(i)}`)}finally{l(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(ee,{size:"small",onClick:o=>h(o,!0),children:e.jsx(yt,{})}),e.jsx(Ge,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:c,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:m}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:o=>h(o,!1)})]})}le.propTypes={onDeleteSpaceGateway:T.func,spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired};le.defaultProps={onDeleteSpaceGateway:()=>{}};function Ot(){const t=He(),r=te(t.breakpoints.down("md"));return{minWidth:r?300:t.breakpoints.values.sm,isMobile:r}}const _t=qe(()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}));function ce({spaceGateway:t,selected:r,onDeleteSpaceGateway:s,onSelectGateway:c,...d}){const m=_t(),{t:l}=A(),{isMobile:h}=Ot(),u=i=>{i.stopPropagation(),window.open(t.url)},o=async()=>{await s(t)};return e.jsxs(At,{...d,children:[e.jsx(S,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:e.jsx("img",{alt:t.name,src:j(t.url,"favicon.ico"),width:"48px",height:"48px"})}),e.jsxs(S,{className:m.menuName,onClick:c,children:[e.jsxs($,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[t==null?void 0:t.name," ",r&&e.jsx(Ve,{color:"primary",style:{marginLeft:"8px"},children:l("common.selected")})]}),e.jsx($,{className:"url",component:"span",variant:"inherit",children:h?`${Ye(t==null?void 0:t.url,38)}`:`${t==null?void 0:t.url}`})]}),e.jsxs(Qe,{children:[e.jsx(ee,{onClick:u,size:"small",children:e.jsx(kt,{})}),(t==null?void 0:t.protected)!==!0&&e.jsx(le,{spaceGateway:t,onDeleteSpaceGateway:o})]})]})}const At=P(S)`
56
+ `;ae.propTypes={children:V.node.isRequired,selected:V.bool};ae.defaultProps={selected:!1};const Me=x.createContext({}),{Provider:Bt,Consumer:Ps}=Me;function ie({children:t}){const{t:r}=$(),[s,c]=ue("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[d,m]=ue("selectedSpaceGatewayForRestore",s.find(o=>o.url==="https://www.didspaces.com/app")),l=o=>{const i=s.find(g=>o.url===g.url);if(i)throw new Error(r("storage.spaces.gateway.add.duplicate",{name:i.name}));c(()=>[...s,he.cloneDeep(o)]),m(o)},h=o=>{if(o.url===d.url)throw new Error(r("storage.spaces.gateway.delete.failedForSelected"));c(()=>s.filter(i=>i.url!==o.url))},u=o=>{m(o)};return x.useEffect(()=>{async function o(){const i=await Promise.all(s.map(async g=>{const{data:n}=await ye.get(j(g.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch(O=>(console.error(O),{data:{}})),p=n.appName??g.name;return he.merge(g,{name:p})}));c(i)}o()},[]),e.jsx(Bt,{value:{spaceGateways:s,selectedSpaceGateway:d,addSpaceGateway:l,deleteSpaceGateway:h,handleSelectSpaceGateway:u},children:t})}ie.propTypes={children:T.any.isRequired};ie.defaultProps={};function Ut(){return x.useContext(Me)}function le({spaceGateway:t,onDeleteSpaceGateway:r}){const{t:s}=$(),[c,d]=x.useState(!1),[m,l]=x.useState(!1),h=(o,i)=>{o==null||o.stopPropagation(),d(i)},u=async o=>{try{o==null||o.stopPropagation(),l(!0),await r(t),d(!1)}catch(i){console.error(i),M.error(`${s("storage.spaces.gateway.delete.failed")}: ${Y(i)}`)}finally{l(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(ee,{size:"small",onClick:o=>h(o,!0),children:e.jsx(yt,{})}),e.jsx(Ge,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:c,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:m}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:o=>h(o,!1)})]})}le.propTypes={onDeleteSpaceGateway:T.func,spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired};le.defaultProps={onDeleteSpaceGateway:()=>{}};function Ot(){const t=He(),r=te(t.breakpoints.down("md"));return{minWidth:r?300:t.breakpoints.values.sm,isMobile:r}}const _t=qe(()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}));function ce({spaceGateway:t,selected:r,onDeleteSpaceGateway:s,onSelectGateway:c,...d}){const m=_t(),{t:l}=$(),{isMobile:h}=Ot(),u=i=>{i.stopPropagation(),window.open(t.url)},o=async()=>{await s(t)};return e.jsxs($t,{...d,children:[e.jsx(S,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:e.jsx("img",{alt:t.name,src:j(t.url,"favicon.ico"),width:"48px",height:"48px"})}),e.jsxs(S,{className:m.menuName,onClick:c,children:[e.jsxs(L,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[t==null?void 0:t.name," ",r&&e.jsx(Ve,{color:"primary",style:{marginLeft:"8px"},children:l("common.selected")})]}),e.jsx(L,{className:"url",component:"span",variant:"inherit",children:h?`${Ye(t==null?void 0:t.url,38)}`:`${t==null?void 0:t.url}`})]}),e.jsxs(Qe,{children:[e.jsx(ee,{onClick:u,size:"small",children:e.jsx(kt,{})}),(t==null?void 0:t.protected)!==!0&&e.jsx(le,{spaceGateway:t,onDeleteSpaceGateway:o})]})]})}const $t=P(S)`
57
57
  display: flex;
58
- `;ce.propTypes={spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired,selected:T.bool,onDeleteSpaceGateway:T.func,onSelectGateway:V.func};ce.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};function de({onAddGateway:t,...r}){const{t:s,locale:c}=A(),[d,m]=x.useState(""),[l,h]=x.useState(!1),[u,o]=x.useState(!1),[i,g]=x.useState(""),n=async()=>{try{h(!0);const p=await bt(d,{withSearchParams:!1});if(!await vt(p))throw new Error(s("storage.spaces.gateway.add.invalidUrl"));const{data:O}=await ye.get(j(new URL(p).origin,"/__blocklet__.js?type=json")),f={name:O.appName,url:p,protected:!1};await t(f),M.success(s("storage.spaces.addedWithName",{name:f.name})),o(!1)}catch(p){g(`${s("storage.spaces.gateway.add.failed",c)}: ${Y(p)}`)}finally{h(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(U,{size:"middle",color:"primary",variant:"outlined",onClick:()=>o(!0),...r,children:s("storage.spaces.gateway.add.title")}),e.jsxs(Ke,{title:s("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:u,onClose:()=>o(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(U,{onClick:p=>{p.stopPropagation(),o(!1)},color:"inherit",children:s("common.cancel")}),e.jsxs(U,{onClick:p=>{p.stopPropagation(),n()},color:"primary","data-cy":"install-blocklet-next-step",disabled:l||!d,variant:"contained",autoFocus:!0,children:[l&&e.jsx(be,{size:16}),s("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(Je,{component:"div",children:e.jsx($,{component:"div",children:e.jsx(St,{label:s("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:d,onChange:p=>{g(null),m(p.target.value)},disabled:l,onKeyPress:async p=>{p.key==="Enter"&&(p.preventDefault(),await n())},autoFocus:!0})})})}),!!i&&e.jsx(ve,{severity:"error",style:{width:"100%"},children:i})]})]})}de.propTypes={onAddGateway:T.func};de.defaultProps={onAddGateway:()=>{}};function pe({onConnect:t,...r}){const{spaceGateways:s,selectedSpaceGateway:c,handleSelectSpaceGateway:d,addSpaceGateway:m,deleteSpaceGateway:l}=Ut(),{t:h}=A(),u=n=>{d(n)},o=async n=>{await m(n)},i=()=>{t(c)},g=async n=>{await l(n)};return e.jsxs(S,{...r,children:[e.jsx(Xe,{children:s.map(n=>{const p=(n==null?void 0:n.url)===c.url;return e.jsx(ae,{selected:p,children:e.jsx(Ze,{button:!0,selected:p,"data-cy":"get-space-endpoint-for-restore",children:e.jsx(et,{children:e.jsx(ce,{spaceGateway:n,onDeleteSpaceGateway:g,selected:p,onSelectGateway:()=>u(n)})})},n.url)})})}),e.jsxs(S,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[e.jsx(de,{onAddGateway:o}),e.jsx(U,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:i,children:h("storage.spaces.connect.now")})]})]})}pe.propTypes={onConnect:V.func};pe.defaultProps={onConnect:()=>{}};const Ft=P("div")`
58
+ `;ce.propTypes={spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired,selected:T.bool,onDeleteSpaceGateway:T.func,onSelectGateway:V.func};ce.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};function de({onAddGateway:t,...r}){const{t:s,locale:c}=$(),[d,m]=x.useState(""),[l,h]=x.useState(!1),[u,o]=x.useState(!1),[i,g]=x.useState(""),n=async()=>{try{h(!0);const p=await bt(d,{withSearchParams:!1});if(!await vt(p))throw new Error(s("storage.spaces.gateway.add.invalidUrl"));const{data:O}=await ye.get(j(new URL(p).origin,"/__blocklet__.js?type=json")),f={name:O.appName,url:p,protected:!1};await t(f),M.success(s("storage.spaces.addedWithName",{name:f.name})),o(!1)}catch(p){g(`${s("storage.spaces.gateway.add.failed",c)}: ${Y(p)}`)}finally{h(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(U,{size:"middle",color:"primary",variant:"outlined",onClick:()=>o(!0),...r,children:s("storage.spaces.gateway.add.title")}),e.jsxs(Ke,{title:s("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:u,onClose:()=>o(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(U,{onClick:p=>{p.stopPropagation(),o(!1)},color:"inherit",children:s("common.cancel")}),e.jsxs(U,{onClick:p=>{p.stopPropagation(),n()},color:"primary","data-cy":"install-blocklet-next-step",disabled:l||!d,variant:"contained",autoFocus:!0,children:[l&&e.jsx(be,{size:16}),s("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(Je,{component:"div",children:e.jsx(L,{component:"div",children:e.jsx(St,{label:s("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:d,onChange:p=>{g(null),m(p.target.value)},disabled:l,onKeyPress:async p=>{p.key==="Enter"&&(p.preventDefault(),await n())},autoFocus:!0})})})}),!!i&&e.jsx(ve,{severity:"error",style:{width:"100%"},children:i})]})]})}de.propTypes={onAddGateway:T.func};de.defaultProps={onAddGateway:()=>{}};function pe({onConnect:t,...r}){const{spaceGateways:s,selectedSpaceGateway:c,handleSelectSpaceGateway:d,addSpaceGateway:m,deleteSpaceGateway:l}=Ut(),{t:h}=$(),u=n=>{d(n)},o=async n=>{await m(n)},i=()=>{t(c)},g=async n=>{await l(n)};return e.jsxs(S,{...r,children:[e.jsx(Xe,{children:s.map(n=>{const p=(n==null?void 0:n.url)===c.url;return e.jsx(ae,{selected:p,children:e.jsx(Ze,{button:!0,selected:p,"data-cy":"get-space-endpoint-for-restore",children:e.jsx(et,{children:e.jsx(ce,{spaceGateway:n,onDeleteSpaceGateway:g,selected:p,onSelectGateway:()=>u(n)})})},n.url)})})}),e.jsxs(S,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[e.jsx(de,{onAddGateway:o}),e.jsx(U,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:i,children:h("storage.spaces.connect.now")})]})]})}pe.propTypes={onConnect:V.func};pe.defaultProps={onConnect:()=>{}};const At=P("div")`
59
59
  width: 100%;
60
60
  height: 100%;
61
61
  overflow-y: auto;
62
- `;function Lt(){const{info:t}=I(),{t:r,locale:s}=x.useContext(tt),c=x.useMemo(()=>t?W(t):"",[t]),d=m=>{const l=new URL(j(m.url,"restore")),h=j(c,"blocklets/restore/verify-ownership");l.searchParams.set("redirectUrl",h),l.searchParams.set("locale",s),window.location.href=l.toString()};return e.jsx(ie,{children:e.jsxs(Ft,{children:[e.jsx(G,{title:r("blocklet.restoreFromSpaces.connect.title"),subTitle:r("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),e.jsx(S,{display:"flex",justifyContent:"center",children:e.jsx(pe,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:d})})]})})}const $t=P("div")`
62
+ `;function Ft(){const{info:t}=I(),{t:r,locale:s}=x.useContext(tt),c=x.useMemo(()=>t?W(t):"",[t]),d=m=>{const l=new URL(j(m.url,"restore")),h=j(c,"blocklets/restore/verify-ownership");l.searchParams.set("redirectUrl",h),l.searchParams.set("locale",s),window.location.href=l.toString()};return e.jsx(ie,{children:e.jsxs(At,{children:[e.jsx(G,{title:r("blocklet.restoreFromSpaces.connect.title"),subTitle:r("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),e.jsx(S,{display:"flex",justifyContent:"center",children:e.jsx(pe,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:d})})]})})}const Lt=P("div")`
63
63
  width: 100%;
64
64
  height: 100%;
65
65
  overflow-y: auto;
66
- `,q="verify-app-ownership-spaces",Nt=t=>{const r=t.split("/").filter(Boolean);return r[r.length-2]};function Mt(){const{session:t}=Z(),[r]=st(),{t:s}=A(),{api:c,info:d}=I(),{api:m}=Z(),{meta:l}=se(),h=Se(),u=x.useMemo(()=>d?W(d):"",[d]),[o,i]=oe({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),g=r.get("launchType"),n=r.get("nftId"),p=r.get("chainHost"),O=r.get("from"),f=r.get("blocklet_meta_url"),y=r.get("launcherSessionId")||"",a=r.get("launcherUrl")||"",b=Nt(l.spaceEndpoint),E=ot.getServerAuthMethod(d,g,y,t.user),F=async(_,D)=>{const w=Array.isArray(_)?_.find(v=>!!v.sessionToken):_;w!=null&&w.sessionToken&&(nt(D(w.sessionToken)),await t.refresh()),i({isConnectOpen:!1}),setTimeout(()=>{const v=new URLSearchParams({appDid:b});[{name:"launchType",value:g},{name:"nftId",value:n},{name:"from",value:O},{name:"blocklet_meta_url",value:f},{name:"chainHost",value:p}].forEach(({name:C,value:k})=>{k&&v.set(C,k)}),h(`/blocklets/restore/restore-blocklet?${v.toString()}`)},0)},L=async(_=!1)=>{var v,C;if(!_){if(o.shouldReconnect){window.location.href=j(u,"blocklets/restore/connect-space");return}if(t.user){const k=await c.getBlocklet({input:{did:b,attachRuntimeInfo:!0}});if(k.blocklet){const R=await Pe(k.blocklet);if(R){const z=new URL(R);k.blocklet.status!=="running"&&z.searchParams.set("__start__","1"),i({shouldReconnect:!0,exists:!0,accessUrl:z.href})}return}}}if(E==="nft"){const k=new URL(window.location.href);k.pathname=j(((v=window==null?void 0:window.env)==null?void 0:v.apiPrefix)??"/",`/api/did/${q}/token`),k.searchParams.set("appDid",b),k.searchParams.set("endpoint",l.spaceEndpoint),k.searchParams.set("referrer",window.location.href),k.searchParams.set("nftId",n),k.searchParams.set("appPid",l.did);const R={autoConnect:!1,launchType:g,nftId:n};p&&(k.searchParams.set("chainHost",p),R.chainHost=p),_&&k.searchParams.set("overwrite","1");const{data:z}=await m.get(k.href);if(z.error){M.error(z.error);return}R.nw=z.url,i({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:R},connectMessages:{title:s("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:s("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:s("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:s("blocklet.restoreFromSpaces.nftAuthDialog.success")}});return}if(E==="launcher"){const{launcherSession:k,error:R}=await c.getLauncherSession({input:{launcherUrl:a,launcherSessionId:y}});k?i({isConnectOpen:!0,connectData:{action:q,extraParams:{appDid:b,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:_?"1":void 0,launcherUrl:a,launcherSessionId:y,chainHost:p}},connectMessages:{title:s("blocklet.restoreBlocklet.verify.title"),scan:s("blocklet.restoreBlocklet.verify.scan"),confirm:s("blocklet.restoreBlocklet.verify.confirm"),success:s("blocklet.restoreBlocklet.verify.success")}}):M.error(`Launch session invalid: ${R}`);return}if(E==="session"){i({isConnectOpen:!0,connectData:{action:q,extraParams:{appDid:b,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,overwrite:_?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:s("blocklet.restoreBlocklet.verify.title"),scan:s("blocklet.restoreBlocklet.verify.scan"),confirm:s("blocklet.restoreBlocklet.verify.confirm"),success:s("blocklet.restoreBlocklet.verify.success")}});return}const D=new URL(window.location.href);D.pathname=j(((C=window==null?void 0:window.env)==null?void 0:C.apiPrefix)??"/",`/api/did/${q}/token`),D.searchParams.set("appDid",b),D.searchParams.set("appPid",l.did),D.searchParams.set("endpoint",l.spaceEndpoint),D.searchParams.set("referrer",window.location.href),D.searchParams.set("restoreFrom","spaces");const{data:w}=await m.get(D.href);t.login(F,{nw:w.url,openMode:"popup"})},K=()=>{i({isConnectOpen:!1})},J=()=>{i({isConfirmOpen:!0})},X=()=>{i({isConfirmOpen:!1,isOverwrite:!0}),L(!0)},H=()=>{i({isConfirmOpen:!1})};return x.useEffect(()=>{L()},[]),e.jsxs($t,{children:[e.jsx(G,{title:s("blocklet.restoreBlocklet.verify.title"),subTitle:s("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),e.jsxs(S,{textAlign:"center",mt:6,children:[e.jsx(ft,{blocklet:{meta:l},blockletMetaUrl:f}),e.jsxs(S,{mt:2,mb:2,children:[e.jsx($,{variant:"body2",children:l.title}),e.jsx(re,{did:b})]}),o.exists&&o.accessUrl&&e.jsxs(e.Fragment,{children:[e.jsx($,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:s("blocklet.restoreBlocklet.verify.exists")}),e.jsxs($,{component:"div",sx:{marginTop:"32px"},children:[o.accessUrl&&e.jsx(U,{variant:"contained",component:je,href:o.accessUrl,sx:{width:"160px",height:"100%"},children:s("blocklet.restoreBlocklet.verify.open")}),e.jsx(U,{variant:"contained",color:"error",onClick:J,sx:{width:"160px",height:"100%",marginLeft:"32px"},children:s("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!o.exists&&e.jsx(U,{variant:"contained",disabled:o.isConnectOpen,onClick:L,sx:{width:"180px",height:"100%"},children:s(`blocklet.restoreBlocklet.verify.${o.shouldReconnect?"reconnect":"verify"}`)})]}),o.connectData.isConnectOpen&&e.jsx(ne,{appDid:b,visible:!1}),e.jsx(Ce,{popup:!0,open:o.isConnectOpen,forceConnected:!1,saveConnect:!1,action:o.connectData.action,checkFn:m.get,checkTimeout:5*60*1e3,webWalletUrl:Q(d),onSuccess:F,extraParams:o.connectData.extraParams,messages:o.connectMessages,onClose:K}),o.isConfirmOpen&&e.jsx(rt,{color:"error",title:s("blocklet.restoreBlocklet.overwrite.title"),description:s("blocklet.restoreBlocklet.overwrite.description"),confirm:s("common.confirm"),onCancel:H,onConfirm:X})]})}const xe=P(ht)`
66
+ `,q="verify-app-ownership-spaces",Nt=t=>{const r=t.split("/").filter(Boolean);return r[r.length-2]};function Mt(){const{session:t}=Z(),[r]=st(),{t:s}=$(),{api:c,info:d}=I(),{api:m}=Z(),{meta:l}=se(),h=Se(),u=x.useMemo(()=>d?W(d):"",[d]),[o,i]=oe({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),g=r.get("launchType"),n=r.get("nftId"),p=r.get("chainHost"),O=r.get("from"),f=r.get("blocklet_meta_url"),y=r.get("launcherSessionId")||"",a=r.get("launcherUrl")||"",b=Nt(l.spaceEndpoint),E=ot.getServerAuthMethod(d,g,y,t.user),A=async(_,D)=>{const w=Array.isArray(_)?_.find(v=>!!v.sessionToken):_;w!=null&&w.sessionToken&&(nt(D(w.sessionToken)),await t.refresh()),i({isConnectOpen:!1}),setTimeout(()=>{const v=new URLSearchParams({appDid:b});[{name:"launchType",value:g},{name:"nftId",value:n},{name:"from",value:O},{name:"blocklet_meta_url",value:f},{name:"chainHost",value:p}].forEach(({name:C,value:k})=>{k&&v.set(C,k)}),h(`/blocklets/restore/restore-blocklet?${v.toString()}`)},0)},F=async(_=!1)=>{var v,C;if(!_){if(o.shouldReconnect){window.location.href=j(u,"blocklets/restore/connect-space");return}if(t.user){const k=await c.getBlocklet({input:{did:b,attachRuntimeInfo:!0}});if(k.blocklet){const R=await Pe(k.blocklet);if(R){const z=new URL(R);k.blocklet.status!=="running"&&z.searchParams.set("__start__","1"),i({shouldReconnect:!0,exists:!0,accessUrl:z.href})}return}}}if(E==="nft"){const k=new URL(window.location.href);k.pathname=j(((v=window==null?void 0:window.env)==null?void 0:v.apiPrefix)??"/",`/api/did/${q}/token`),k.searchParams.set("appDid",b),k.searchParams.set("endpoint",l.spaceEndpoint),k.searchParams.set("referrer",window.location.href),k.searchParams.set("nftId",n),k.searchParams.set("appPid",l.did);const R={autoConnect:!1,launchType:g,nftId:n};p&&(k.searchParams.set("chainHost",p),R.chainHost=p),_&&k.searchParams.set("overwrite","1");const{data:z}=await m.get(k.href);if(z.error){M.error(z.error);return}R.nw=z.url,i({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:R},connectMessages:{title:s("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:s("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:s("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:s("blocklet.restoreFromSpaces.nftAuthDialog.success")}});return}if(E==="launcher"){const{launcherSession:k,error:R}=await c.getLauncherSession({input:{launcherUrl:a,launcherSessionId:y}});k?i({isConnectOpen:!0,connectData:{action:q,extraParams:{appDid:b,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:_?"1":void 0,launcherUrl:a,launcherSessionId:y,chainHost:p}},connectMessages:{title:s("blocklet.restoreBlocklet.verify.title"),scan:s("blocklet.restoreBlocklet.verify.scan"),confirm:s("blocklet.restoreBlocklet.verify.confirm"),success:s("blocklet.restoreBlocklet.verify.success")}}):M.error(`Launch session invalid: ${R}`);return}if(E==="session"){i({isConnectOpen:!0,connectData:{action:q,extraParams:{appDid:b,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,overwrite:_?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:s("blocklet.restoreBlocklet.verify.title"),scan:s("blocklet.restoreBlocklet.verify.scan"),confirm:s("blocklet.restoreBlocklet.verify.confirm"),success:s("blocklet.restoreBlocklet.verify.success")}});return}const D=new URL(window.location.href);D.pathname=j(((C=window==null?void 0:window.env)==null?void 0:C.apiPrefix)??"/",`/api/did/${q}/token`),D.searchParams.set("appDid",b),D.searchParams.set("appPid",l.did),D.searchParams.set("endpoint",l.spaceEndpoint),D.searchParams.set("referrer",window.location.href),D.searchParams.set("restoreFrom","spaces");const{data:w}=await m.get(D.href);t.login(A,{nw:w.url,openMode:"popup"})},K=()=>{i({isConnectOpen:!1})},J=()=>{i({isConfirmOpen:!0})},X=()=>{i({isConfirmOpen:!1,isOverwrite:!0}),F(!0)},H=()=>{i({isConfirmOpen:!1})};return x.useEffect(()=>{F()},[]),e.jsxs(Lt,{children:[e.jsx(G,{title:s("blocklet.restoreBlocklet.verify.title"),subTitle:s("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),e.jsxs(S,{textAlign:"center",mt:6,children:[e.jsx(ft,{blocklet:{meta:l},blockletMetaUrl:f}),e.jsxs(S,{mt:2,mb:2,children:[e.jsx(L,{variant:"body2",children:l.title}),e.jsx(re,{did:b})]}),o.exists&&o.accessUrl&&e.jsxs(e.Fragment,{children:[e.jsx(L,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:s("blocklet.restoreBlocklet.verify.exists")}),e.jsxs(L,{component:"div",sx:{marginTop:"32px"},children:[o.accessUrl&&e.jsx(U,{variant:"contained",component:je,href:o.accessUrl,sx:{width:"160px",height:"100%"},children:s("blocklet.restoreBlocklet.verify.open")}),e.jsx(U,{variant:"contained",color:"error",onClick:J,sx:{width:"160px",height:"100%",marginLeft:"32px"},children:s("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!o.exists&&e.jsx(U,{variant:"contained",disabled:o.isConnectOpen,onClick:F,sx:{width:"180px",height:"100%"},children:s(`blocklet.restoreBlocklet.verify.${o.shouldReconnect?"reconnect":"verify"}`)})]}),o.connectData.isConnectOpen&&e.jsx(ne,{appDid:b,visible:!1}),e.jsx(Ce,{popup:!0,open:o.isConnectOpen,forceConnected:!1,saveConnect:!1,action:o.connectData.action,checkFn:m.get,checkTimeout:5*60*1e3,webWalletUrl:Q(d),onSuccess:A,extraParams:o.connectData.extraParams,messages:o.connectMessages,onClose:K}),o.isConfirmOpen&&e.jsx(rt,{color:"error",title:s("blocklet.restoreBlocklet.overwrite.title"),description:s("blocklet.restoreBlocklet.overwrite.description"),confirm:s("common.confirm"),onCancel:H,onConfirm:X})]})}const xe=P(ht)`
67
67
  && .result-footer {
68
68
  height: 120px;
69
69
  > div {
@@ -85,9 +85,9 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,
85
85
  word-wrap: break-word;
86
86
  color: ${t=>t.theme.palette.grey[500]};
87
87
  }
88
- `,Gt={[B.RESTORE_PROGRESS_STATUS.waiting]:0,[B.RESTORE_PROGRESS_STATUS.start]:1,[B.RESTORE_PROGRESS_STATUS.importData]:2,[B.RESTORE_PROGRESS_STATUS.downloading]:3,[B.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[B.RESTORE_PROGRESS_STATUS.installing]:5,[B.RESTORE_PROGRESS_STATUS.completed]:10},Ht="https://community.arcblock.io/",qt="launcher@arcblock.io";function Vt({appDid:t}){const[r,s]=x.useState(B.RESTORE_PROGRESS_STATUS.waiting),c=ct();return c.connect(),x.useEffect(()=>(c.on(B.BlockletEvents.restoreProgress,d=>{t===(d==null?void 0:d.appDid)&&s(d)}),()=>{c.off(B.BlockletEvents.restoreProgress)}),[t,c]),r}function Yt(){var _,D;const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("launchType"),c=t.searchParams.get("nftId"),d=t.searchParams.get("fromLauncher"),m=t.searchParams.get("from"),l=t.searchParams.get("chainHost"),h=Vt({appDid:r}),[u,o]=x.useState(0),i=x.useRef(null),{meta:g}=se(),{t:n}=A(),{api:p,info:O}=I(),[f,y]=oe({nextAccessUrl:"",installError:null}),a=xt(r),{status:b,eventName:E}=a,F=()=>{o(12),i.current&&(clearTimeout(i.current),i.current=null),i.current=setTimeout(()=>{p.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then(w=>{w.blocklet&&J(w.blocklet)})},500)},L=()=>{var w,v;if((v=(w=a==null?void 0:a.runtimeBlocklet)==null?void 0:w.settings)!=null&&v.initialized){o(11);return}F()},K=[n("blocklet.restoreFromSpaces.progress.waiting"),n("blocklet.restoreFromSpaces.progress.restoring"),n("blocklet.restoreFromSpaces.progress.importData"),n("blocklet.restoreFromSpaces.progress.downloading",{progress:`${((_=h==null?void 0:h.data)==null?void 0:_.completed)??100}/${((D=h==null?void 0:h.data)==null?void 0:D.total)??100}`}),n("blocklet.restoreFromSpaces.progress.importSuccess"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.verifying"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.extracting"),n(b==="upgrading"?"common.upgrading":"launchBlocklet.waiting.installing"),n("launchBlocklet.waiting.installed"),n("launchBlocklet.waiting.starting"),n("launchBlocklet.waiting.done")];x.useEffect(()=>{if(h.status===B.RESTORE_PROGRESS_STATUS.error){const w={message:h.message,name:"restoreFailed",action:"retryRestore"};fe(w,f.installError)||M.error(Y(w)),y({installError:w});return}o(Gt[h.status]||0)},[h.status]),x.useEffect(()=>{var w;if(s==="serverless"&&E===B.BlockletEvents.nftConsumed){L();return}switch(b){case"waiting":o(6);break;case"downloading":o(7);break;case"installing":case"upgrading":o(8);break;case"installed":if(s==="serverless"&&!it(a))break;L();break;case"starting":o(11);break;case"running":o(12),F();break;case"stopped":F();break;case"corrupted":case"error":{a==null||a.stopPolling();const v={message:(w=a==null?void 0:a.error)==null?void 0:w.message,name:a==null?void 0:a.eventName,action:"retryRestore"},C=(k={})=>{var R;!fe(v,f.installError)&&((R=a==null?void 0:a.error)!=null&&R.message)&&M.error(Y(a.error)),y({installError:v,...k})};p.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then(({blocklet:k})=>{var R;(R=k==null?void 0:k.settings)!=null&&R.initialized&&(v.action="retryStart"),C()}).catch(()=>{C()})}break}},[b,E,a]);const J=async w=>{const v=await Pe(w);if(dt(v))return;const C=new URL(v);C.searchParams.set("serverUrl",W(O)),w.status!=="running"&&C.searchParams.set("__start__","1"),d&&C.searchParams.set("fromLauncher",d),m&&C.searchParams.set("from",m),s&&C.searchParams.set("launchType",s),c&&C.searchParams.set("nftId",c),l&&C.searchParams.set("chainHost",l),a==null||a.stopPolling(),y({nextAccessUrl:C.href,status:w.status,resultMessage:w.status==="running"?{variant:"success",title:n("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:n("common.open")}:{variant:"info",title:n("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:n("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:n("common.configuration")}})},X=async()=>{y({installError:null,nextAccessUrl:""}),await p.startBlocklet({input:{did:r}}),a==null||a.startPolling()};if(f.installError){const w={retryRestore:e.jsx(U,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:lt,to:`/blocklets/restore/verify-ownership${window.location.search}`,children:n("common.retry")}),retryStart:e.jsx(U,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>X(),children:n("common.retry")})},v=f.installError.name?f.installError.name.replace("blocklet.",""):"installFailed";return e.jsx(xe,{variant:"error",title:g==null?void 0:g.title,subTitle:e.jsxs(Wt,{children:[e.jsx("div",{children:n(`launchBlocklet.error.${v}`)}),f.installError.message&&e.jsx("div",{className:"error-desc",children:n("common.errorMessage")+f.installError.message})]}),footer:e.jsxs(ge,{children:[w[f.installError.action],s==="serverless"&&e.jsx("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:n("blocklet.restoreFromSpaces.restore.support",{communityLink:Ht,supportEmail:qt})}})]})})}const H=!!f.nextAccessUrl;return It("render",{status:b,eventName:E,launchType:s,runtimeBlockletState:a,state:f}),e.jsxs(zt,{children:[!H&&e.jsxs(e.Fragment,{children:[e.jsx(G,{title:n("blocklet.restoreBlocklet.restore.title"),subTitle:n("blocklet.restoreFromSpaces.restore.subTitle")}),e.jsxs(gt,{children:[e.jsx(ut,{increaseSpeed:.3,messageLoop:!1,message:e.jsx(wt,{steps:K,stepIndex:u,autoGrowth:u===10?1e3:4e3})}),[5,7,8].includes(u)&&e.jsx(ne,{appDid:r})]})]}),H&&e.jsx(xe,{variant:f.resultMessage.variant,title:f.resultMessage.title,subTitle:f.resultMessage.subTitle,footer:e.jsx(ge,{children:e.jsx(U,{variant:"contained",style:{width:"200px"},component:je,href:f.nextAccessUrl,children:f.resultMessage.footer})})})]})}const ge=P(S)`
88
+ `,Gt={[B.RESTORE_PROGRESS_STATUS.waiting]:0,[B.RESTORE_PROGRESS_STATUS.start]:1,[B.RESTORE_PROGRESS_STATUS.importData]:2,[B.RESTORE_PROGRESS_STATUS.downloading]:3,[B.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[B.RESTORE_PROGRESS_STATUS.installing]:5,[B.RESTORE_PROGRESS_STATUS.completed]:10},Ht="https://community.arcblock.io/",qt="launcher@arcblock.io";function Vt({appDid:t}){const[r,s]=x.useState(B.RESTORE_PROGRESS_STATUS.waiting),c=ct();return c.connect(),x.useEffect(()=>(c.on(B.BlockletEvents.restoreProgress,d=>{t===(d==null?void 0:d.appDid)&&s(d)}),()=>{c.off(B.BlockletEvents.restoreProgress)}),[t,c]),r}function Yt(){var _,D;const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("launchType"),c=t.searchParams.get("nftId"),d=t.searchParams.get("fromLauncher"),m=t.searchParams.get("from"),l=t.searchParams.get("chainHost"),h=Vt({appDid:r}),[u,o]=x.useState(0),i=x.useRef(null),{meta:g}=se(),{t:n}=$(),{api:p,info:O}=I(),[f,y]=oe({nextAccessUrl:"",installError:null}),a=xt(r),{status:b,eventName:E}=a,A=()=>{o(12),i.current&&(clearTimeout(i.current),i.current=null),i.current=setTimeout(()=>{p.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then(w=>{w.blocklet&&J(w.blocklet)})},500)},F=()=>{var w,v;if((v=(w=a==null?void 0:a.runtimeBlocklet)==null?void 0:w.settings)!=null&&v.initialized){o(11);return}A()},K=[n("blocklet.restoreFromSpaces.progress.waiting"),n("blocklet.restoreFromSpaces.progress.restoring"),n("blocklet.restoreFromSpaces.progress.importData"),n("blocklet.restoreFromSpaces.progress.downloading",{progress:`${((_=h==null?void 0:h.data)==null?void 0:_.completed)??100}/${((D=h==null?void 0:h.data)==null?void 0:D.total)??100}`}),n("blocklet.restoreFromSpaces.progress.importSuccess"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.verifying"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.extracting"),n(b==="upgrading"?"common.upgrading":"launchBlocklet.waiting.installing"),n("launchBlocklet.waiting.installed"),n("launchBlocklet.waiting.starting"),n("launchBlocklet.waiting.done")];x.useEffect(()=>{if(h.status===B.RESTORE_PROGRESS_STATUS.error){const w={message:h.message,name:"restoreFailed",action:"retryRestore"};fe(w,f.installError)||M.error(Y(w)),y({installError:w});return}o(Gt[h.status]||0)},[h.status]),x.useEffect(()=>{var w;if(s==="serverless"&&E===B.BlockletEvents.nftConsumed){F();return}switch(b){case"waiting":o(6);break;case"downloading":o(7);break;case"installing":case"upgrading":o(8);break;case"installed":if(s==="serverless"&&!it(a))break;F();break;case"starting":o(11);break;case"running":o(12),A();break;case"stopped":A();break;case"corrupted":case"error":{a==null||a.stopPolling();const v={message:(w=a==null?void 0:a.error)==null?void 0:w.message,name:a==null?void 0:a.eventName,action:"retryRestore"},C=(k={})=>{var R;!fe(v,f.installError)&&((R=a==null?void 0:a.error)!=null&&R.message)&&M.error(Y(a.error)),y({installError:v,...k})};p.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then(({blocklet:k})=>{var R;(R=k==null?void 0:k.settings)!=null&&R.initialized&&(v.action="retryStart"),C()}).catch(()=>{C()})}break}},[b,E,a]);const J=async w=>{const v=await Pe(w);if(dt(v))return;const C=new URL(v);C.searchParams.set("serverUrl",W(O)),w.status!=="running"&&C.searchParams.set("__start__","1"),d&&C.searchParams.set("fromLauncher",d),m&&C.searchParams.set("from",m),s&&C.searchParams.set("launchType",s),c&&C.searchParams.set("nftId",c),l&&C.searchParams.set("chainHost",l),a==null||a.stopPolling(),y({nextAccessUrl:C.href,status:w.status,resultMessage:w.status==="running"?{variant:"success",title:n("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:n("common.open")}:{variant:"info",title:n("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:n("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:n("common.configuration")}})},X=async()=>{y({installError:null,nextAccessUrl:""}),await p.startBlocklet({input:{did:r}}),a==null||a.startPolling()};if(f.installError){const w={retryRestore:e.jsx(U,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:lt,to:`/blocklets/restore/verify-ownership${window.location.search}`,children:n("common.retry")}),retryStart:e.jsx(U,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>X(),children:n("common.retry")})},v=f.installError.name?f.installError.name.replace("blocklet.",""):"installFailed";return e.jsx(xe,{variant:"error",title:g==null?void 0:g.title,subTitle:e.jsxs(Wt,{children:[e.jsx("div",{children:n(`launchBlocklet.error.${v}`)}),f.installError.message&&e.jsx("div",{className:"error-desc",children:n("common.errorMessage")+f.installError.message})]}),footer:e.jsxs(ge,{children:[w[f.installError.action],s==="serverless"&&e.jsx("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:n("blocklet.restoreFromSpaces.restore.support",{communityLink:Ht,supportEmail:qt})}})]})})}const H=!!f.nextAccessUrl;return It("render",{status:b,eventName:E,launchType:s,runtimeBlockletState:a,state:f}),e.jsxs(zt,{children:[!H&&e.jsxs(e.Fragment,{children:[e.jsx(G,{title:n("blocklet.restoreBlocklet.restore.title"),subTitle:n("blocklet.restoreFromSpaces.restore.subTitle")}),e.jsxs(gt,{children:[e.jsx(ut,{increaseSpeed:.3,messageLoop:!1,message:e.jsx(wt,{steps:K,stepIndex:u,autoGrowth:u===10?1e3:4e3})}),[5,7,8].includes(u)&&e.jsx(ne,{appDid:r})]})]}),H&&e.jsx(xe,{variant:f.resultMessage.variant,title:f.resultMessage.title,subTitle:f.resultMessage.subTitle,footer:e.jsx(ge,{children:e.jsx(U,{variant:"contained",style:{width:"200px"},component:je,href:f.nextAccessUrl,children:f.resultMessage.footer})})})]})}const ge=P(S)`
89
89
  padding-top: 24px;
90
- `;function Ie(){return e.jsx(Yt,{})}function Qt(){const t=te(p=>p.breakpoints.down("md")),{t:r,locale:s}=A(),{info:c}=I(),d=pt(),{meta:m}=se(),l=x.useMemo(()=>c?W(c):"",[c]),h=Q(c),u=j(Re(),"/blocklets/restore"),o=[{key:"verify-ownership",name:r("blocklet.restoreBlocklet.verify.title"),path:j(u,"verify-ownership")},{key:"restore-blocklet",name:r("blocklet.restoreFromSpaces.restore.title"),path:j(u,"restore-blocklet")}];let i=[];Et(d.get("from"))==="launcher"?i=[{key:"purchase-space",name:r("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:r("launchBlocklet.steps.prepareSpace")},...o]:i=[{key:"connect-space",name:r("blocklet.restoreFromSpaces.connect.title"),path:j(u,"connect-space")},{key:"select-blocklet",name:r("blocklet.restoreFromSpaces.selectBlocklet.title")},...o];const g=()=>{l&&window.open(l)},n=e.jsx(Xt,{className:`${l?"logo-can-click":""}`,children:e.jsx(Le,{onClick:g,logo:t?e.jsx(Ne,{width:"32",height:"32"}):e.jsx($e,{width:"128",height:"48"})})});return e.jsx(Ae,{steps:i,children:e.jsx(Fe,{blockletMeta:m,locale:s,useOfSkeleton:!1,navLogo:n,navSubTitle:r("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:e.jsx(Te,{webWalletUrl:h,SessionContext:Ee}),pcWidth:"80%",style:{height:"100%"},logoUrl:m==null?void 0:m.logo,children:e.jsxs(Jt,{children:[e.jsx(De,{styles:Kt}),e.jsxs(Be,{children:[e.jsx(N,{path:"connect-space",element:e.jsx(Lt,{})}),e.jsx(N,{path:"verify-ownership",element:e.jsx(Mt,{})}),e.jsx(N,{path:"restore-blocklet",element:e.jsx(Ie,{})}),e.jsx(N,{path:"*",element:e.jsx(Ue,{to:"connect-space",replace:!0})})]})]})})})}const Kt=Oe`
90
+ `;function Ie(){return e.jsx(Yt,{})}function Qt(){const t=te(p=>p.breakpoints.down("md")),{t:r,locale:s}=$(),{info:c}=I(),d=pt(),{meta:m}=se(),l=x.useMemo(()=>c?W(c):"",[c]),h=Q(c),u=j(Re(),"/blocklets/restore"),o=[{key:"verify-ownership",name:r("blocklet.restoreBlocklet.verify.title"),path:j(u,"verify-ownership")},{key:"restore-blocklet",name:r("blocklet.restoreFromSpaces.restore.title"),path:j(u,"restore-blocklet")}];let i=[];Et(d.get("from"))==="launcher"?i=[{key:"purchase-space",name:r("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:r("launchBlocklet.steps.prepareSpace")},...o]:i=[{key:"connect-space",name:r("blocklet.restoreFromSpaces.connect.title"),path:j(u,"connect-space")},{key:"select-blocklet",name:r("blocklet.restoreFromSpaces.selectBlocklet.title")},...o];const g=()=>{l&&window.open(l)},n=e.jsx(Xt,{className:`${l?"logo-can-click":""}`,children:e.jsx(Fe,{onClick:g,logo:t?e.jsx(Ne,{width:"32",height:"32"}):e.jsx(Le,{width:"128",height:"48"})})});return e.jsx($e,{steps:i,children:e.jsx(Ae,{blockletMeta:m,locale:s,useOfSkeleton:!1,navLogo:n,navSubTitle:r("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:e.jsx(Te,{webWalletUrl:h,SessionContext:Ee}),pcWidth:"80%",style:{height:"100%"},logoUrl:m==null?void 0:m.logo,children:e.jsxs(Jt,{children:[e.jsx(De,{styles:Kt}),e.jsxs(Be,{children:[e.jsx(N,{path:"connect-space",element:e.jsx(Ft,{})}),e.jsx(N,{path:"verify-ownership",element:e.jsx(Mt,{})}),e.jsx(N,{path:"restore-blocklet",element:e.jsx(Ie,{})}),e.jsx(N,{path:"*",element:e.jsx(Ue,{to:"connect-space",replace:!0})})]})]})})})}const Kt=Oe`
91
91
  html,
92
92
  body,
93
93
  #root,
@@ -113,7 +113,7 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,
113
113
  &.logo-can-click {
114
114
  cursor: pointer;
115
115
  }
116
- `;function me({onSelect:t}){const{api:r}=I(),{t:s,locale:c}=A(),[d,m]=x.useState(!1),[l,h]=x.useState([]),[u,o]=x.useState(""),[i,g]=x.useState(null),n=Se(),p=async()=>{try{m(!0),g(!1);const{getBlocklets:{blocklets:a},getBlockletsFromBackup:{backups:b}}=await r.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});h((b||[]).filter(E=>!(a||[]).some(F=>{var L;return E.appPid===((L=F.meta)==null?void 0:L.did)})).sort((E,F)=>F.createdAt-E.createdAt).slice(0,200)),m(!1)}catch(a){m(!1),g(a.message)}};x.useEffect(()=>{p()},[]);const O=()=>{const a=l.find(E=>E.appDid===u);t({did:a.appDid,name:a.appDid,title:a.name});const b=new URL(window.location.href);b.searchParams.set("appDid",a.appDid),b.searchParams.set("appName",a.name),n(`/blocklets/restore/verify-ownership${b.search}`)},f=a=>{o(a.appDid)};let y=null;return i?y=e.jsx(ve,{severity:"error",style:{width:"100%",marginTop:8},children:i}):d?y=e.jsx(be,{size:16}):l.length?y=e.jsx(es,{children:l.map(a=>e.jsxs(ts,{className:`middle-font-size space ${u===a.appDid?"selected":""}`,onClick:()=>f(a),children:[e.jsxs("div",{className:"left",children:[e.jsx("div",{className:"header",children:e.jsx(S,{sx:{width:40,height:40},children:e.jsx(_e,{did:a.appDid,size:40})})}),e.jsxs("div",{className:"body",children:[e.jsx($,{className:"text",children:a.name}),e.jsx($,{className:"text middle-font-size",children:e.jsx(re,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:a.appDid})})]}),e.jsxs(S,{color:"text.secondary",className:"footer small-font-size",children:[s("blocklet.restoreFromServer.backupIn")," ",mt(a.createdAt,c)]})]}),e.jsx("div",{className:"right",children:e.jsx("div",{className:"more",children:e.jsx(ee,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:e.jsx(jt,{color:"disabled"})})})}),e.jsx("div",{className:"selected-container",children:e.jsx(ke,{className:"selected-icon"})})]},a.appDid))}):y=e.jsx(Ct,{children:s("common.empty")}),e.jsxs(Zt,{style:{width:"100%"},children:[e.jsx(G,{title:s("blocklet.restoreFromServer.selectTitle"),subTitle:s("blocklet.restoreFromServer.description")}),e.jsx(S,{mt:4,mx:3,className:"main-body",children:y}),e.jsx(S,{className:"main-footer",display:"flex",justifyContent:"center",children:e.jsx(U,{sx:{width:"180px",height:"100%"},onClick:a=>{a.stopPropagation(),O()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:d||i||!u,children:s("common.restore")})})]})}me.propTypes={onSelect:T.func};me.defaultProps={onSelect:()=>{}};const Zt=P(S)`
116
+ `;function me({onSelect:t}){const{api:r}=I(),{t:s,locale:c}=$(),[d,m]=x.useState(!1),[l,h]=x.useState([]),[u,o]=x.useState(""),[i,g]=x.useState(null),n=Se(),p=async()=>{try{m(!0),g(!1);const{getBlocklets:{blocklets:a},getBlockletsFromBackup:{backups:b}}=await r.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});h((b||[]).filter(E=>!(a||[]).some(A=>{var F;return E.appPid===((F=A.meta)==null?void 0:F.did)})).sort((E,A)=>A.createdAt-E.createdAt).slice(0,200)),m(!1)}catch(a){m(!1),g(a.message)}};x.useEffect(()=>{p()},[]);const O=()=>{const a=l.find(E=>E.appDid===u);t({did:a.appDid,name:a.appDid,title:a.name});const b=new URL(window.location.href);b.searchParams.set("appDid",a.appDid),b.searchParams.set("appName",a.name),n(`/blocklets/restore/verify-ownership${b.search}`)},f=a=>{o(a.appDid)};let y=null;return i?y=e.jsx(ve,{severity:"error",style:{width:"100%",marginTop:8},children:i}):d?y=e.jsx(be,{size:16}):l.length?y=e.jsx(es,{children:l.map(a=>e.jsxs(ts,{className:`middle-font-size space ${u===a.appDid?"selected":""}`,onClick:()=>f(a),children:[e.jsxs("div",{className:"left",children:[e.jsx("div",{className:"header",children:e.jsx(S,{sx:{width:40,height:40},children:e.jsx(_e,{did:a.appDid,size:40})})}),e.jsxs("div",{className:"body",children:[e.jsx(L,{className:"text",children:a.name}),e.jsx(L,{className:"text middle-font-size",children:e.jsx(re,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:a.appDid})})]}),e.jsxs(S,{color:"text.secondary",className:"footer small-font-size",children:[s("blocklet.restoreFromServer.backupIn")," ",mt(a.createdAt,c)]})]}),e.jsx("div",{className:"right",children:e.jsx("div",{className:"more",children:e.jsx(ee,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:e.jsx(jt,{color:"disabled"})})})}),e.jsx("div",{className:"selected-container",children:e.jsx(ke,{className:"selected-icon"})})]},a.appDid))}):y=e.jsx(Ct,{children:s("common.empty")}),e.jsxs(Zt,{style:{width:"100%"},children:[e.jsx(G,{title:s("blocklet.restoreFromServer.selectTitle"),subTitle:s("blocklet.restoreFromServer.description")}),e.jsx(S,{mt:4,mx:3,className:"main-body",children:y}),e.jsx(S,{className:"main-footer",display:"flex",justifyContent:"center",children:e.jsx(U,{sx:{width:"180px",height:"100%"},onClick:a=>{a.stopPropagation(),O()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:d||i||!u,children:s("common.restore")})})]})}me.propTypes={onSelect:T.func};me.defaultProps={onSelect:()=>{}};const Zt=P(S)`
117
117
  .main-body {
118
118
  height: 50vh;
119
119
  ${t=>t.theme.breakpoints.down("md")} {
@@ -281,7 +281,7 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,
281
281
  width: 100%;
282
282
  height: 100%;
283
283
  overflow-y: auto;
284
- `,we="verify-app-ownership-disk";function os(){const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("appName"),{t:c}=A(),{api:d,info:m}=I(),{session:l,api:h}=Z(),u=x.useMemo(()=>m?W(m):"",[m]),[o,i]=oe({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),g=async()=>{if((await d.getBlocklet({input:{did:r}})).blocklet){M.error(`Blocklet ${s}(${r}) already exists`),i({shouldReconnect:!0});return}i({connectData:{isConnectOpen:!0,action:we,extraParams:{appDid:r,restoreFrom:"disk"}}})},n=()=>{i({connectData:{isConnectOpen:!1}}),setTimeout(()=>{const f=new URL(j(u,`blocklets/restore/restore-blocklet${window.location.search}`));window.location.href=f.href},0)},p=async()=>{var f;if(!l.user){const y=new URL(window.location.href);y.pathname=j(((f=window==null?void 0:window.env)==null?void 0:f.apiPrefix)??"/",`/api/did/${we}/token`),y.searchParams.set("appDid",r),y.searchParams.set("restoreFrom","disk");const{data:a}=await h.get(y.href);l.login(n,{nw:a.url,openMode:"popup"});return}await g()},O=()=>{i({connectData:{isConnectOpen:!1}})};return x.useEffect(()=>{p()},[]),e.jsxs(ss,{children:[e.jsx(G,{title:c("blocklet.restoreBlocklet.verify.title"),subTitle:c("blocklet.restoreBlocklet.verify.subTitle")}),e.jsxs(S,{textAlign:"center",mt:6,children:[e.jsx(_e,{did:r,size:128}),e.jsxs(S,{mt:2,mb:2,children:[e.jsx($,{variant:"body2",children:s}),e.jsx(re,{did:r})]}),e.jsx(U,{variant:"contained",disabled:o.connectData.isConnectOpen,onClick:p,sx:{width:"180px",height:"100%"},children:c(`blocklet.restoreBlocklet.verify.${o.shouldReconnect?"reconnect":"verify"}`)})]}),o.connectData.isConnectOpen&&e.jsx(ne,{appDid:r,visible:!1}),e.jsx(Ce,{popup:!0,open:o.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:o.connectData.action,checkFn:h.get,checkTimeout:5*60*1e3,webWalletUrl:Q(m),onSuccess:n,extraParams:o.connectData.extraParams,messages:{title:c("blocklet.restoreBlocklet.verify.title"),scan:c("blocklet.restoreBlocklet.verify.scan"),confirm:c("blocklet.restoreBlocklet.verify.confirm"),success:c("blocklet.restoreBlocklet.verify.success")},onClose:O})]})}function rs(){const t=te(n=>n.breakpoints.down("md")),{t:r,locale:s}=A(),{info:c}=I(),{meta:d,setMeta:m}=x.useState({}),l=x.useMemo(()=>c?W(c):"",[c]),h=Q(c),u=j(Re(),"/blocklets/restore"),o=[{key:"select",name:r("blocklet.restoreFromServer.selectTitle"),path:j(u,"select")},{key:"verify-ownership",name:r("blocklet.restoreBlocklet.verify.title"),path:j(u,"verify-ownership")},{key:"restore-blocklet",name:r("blocklet.restoreBlocklet.restore.title"),path:j(u,"restore-blocklet")}],i=()=>{l&&window.open(l)},g=e.jsx(is,{className:`${l?"logo-can-click":""}`,children:e.jsx(Le,{onClick:i,logo:t?e.jsx(Ne,{width:"32",height:"32"}):e.jsx($e,{width:"128",height:"48"})})});return e.jsx(Ae,{steps:o,children:e.jsx(Fe,{blockletMeta:{...d,registryUrl:""},locale:s,useOfSkeleton:!1,navLogo:g,headerEndAddons:e.jsx(Te,{webWalletUrl:h,SessionContext:Ee}),pcWidth:"80%",style:{height:"100%"},logoUrl:d==null?void 0:d.logo,children:e.jsxs(as,{children:[e.jsx(De,{styles:ns}),e.jsxs(Be,{children:[e.jsx(N,{path:"select",element:e.jsx(me,{onSelect:m})}),e.jsx(N,{path:"verify-ownership",element:e.jsx(os,{})}),e.jsx(N,{path:"restore-blocklet",element:e.jsx(Ie,{})}),e.jsx(N,{path:"*",element:e.jsx(Ue,{to:`select${window.location.search}`,replace:!0})})]})]})})})}const ns=Oe`
284
+ `,we="verify-app-ownership-disk";function os(){const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("appName"),{t:c}=$(),{api:d,info:m}=I(),{session:l,api:h}=Z(),u=x.useMemo(()=>m?W(m):"",[m]),[o,i]=oe({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),g=async()=>{if((await d.getBlocklet({input:{did:r}})).blocklet){M.error(`Blocklet ${s}(${r}) already exists`),i({shouldReconnect:!0});return}i({connectData:{isConnectOpen:!0,action:we,extraParams:{appDid:r,restoreFrom:"disk"}}})},n=()=>{i({connectData:{isConnectOpen:!1}}),setTimeout(()=>{const f=new URL(j(u,`blocklets/restore/restore-blocklet${window.location.search}`));window.location.href=f.href},0)},p=async()=>{var f;if(!l.user){const y=new URL(window.location.href);y.pathname=j(((f=window==null?void 0:window.env)==null?void 0:f.apiPrefix)??"/",`/api/did/${we}/token`),y.searchParams.set("appDid",r),y.searchParams.set("restoreFrom","disk");const{data:a}=await h.get(y.href);l.login(n,{nw:a.url,openMode:"popup"});return}await g()},O=()=>{i({connectData:{isConnectOpen:!1}})};return x.useEffect(()=>{p()},[]),e.jsxs(ss,{children:[e.jsx(G,{title:c("blocklet.restoreBlocklet.verify.title"),subTitle:c("blocklet.restoreBlocklet.verify.subTitle")}),e.jsxs(S,{textAlign:"center",mt:6,children:[e.jsx(_e,{did:r,size:128}),e.jsxs(S,{mt:2,mb:2,children:[e.jsx(L,{variant:"body2",children:s}),e.jsx(re,{did:r})]}),e.jsx(U,{variant:"contained",disabled:o.connectData.isConnectOpen,onClick:p,sx:{width:"180px",height:"100%"},children:c(`blocklet.restoreBlocklet.verify.${o.shouldReconnect?"reconnect":"verify"}`)})]}),o.connectData.isConnectOpen&&e.jsx(ne,{appDid:r,visible:!1}),e.jsx(Ce,{popup:!0,open:o.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:o.connectData.action,checkFn:h.get,checkTimeout:5*60*1e3,webWalletUrl:Q(m),onSuccess:n,extraParams:o.connectData.extraParams,messages:{title:c("blocklet.restoreBlocklet.verify.title"),scan:c("blocklet.restoreBlocklet.verify.scan"),confirm:c("blocklet.restoreBlocklet.verify.confirm"),success:c("blocklet.restoreBlocklet.verify.success")},onClose:O})]})}function rs(){const t=te(n=>n.breakpoints.down("md")),{t:r,locale:s}=$(),{info:c}=I(),{meta:d,setMeta:m}=x.useState({}),l=x.useMemo(()=>c?W(c):"",[c]),h=Q(c),u=j(Re(),"/blocklets/restore"),o=[{key:"select",name:r("blocklet.restoreFromServer.selectTitle"),path:j(u,"select")},{key:"verify-ownership",name:r("blocklet.restoreBlocklet.verify.title"),path:j(u,"verify-ownership")},{key:"restore-blocklet",name:r("blocklet.restoreBlocklet.restore.title"),path:j(u,"restore-blocklet")}],i=()=>{l&&window.open(l)},g=e.jsx(is,{className:`${l?"logo-can-click":""}`,children:e.jsx(Fe,{onClick:i,logo:t?e.jsx(Ne,{width:"32",height:"32"}):e.jsx(Le,{width:"128",height:"48"})})});return e.jsx($e,{steps:o,children:e.jsx(Ae,{blockletMeta:{...d,registryUrl:""},locale:s,useOfSkeleton:!1,navLogo:g,headerEndAddons:e.jsx(Te,{webWalletUrl:h,SessionContext:Ee}),pcWidth:"80%",style:{height:"100%"},logoUrl:d==null?void 0:d.logo,children:e.jsxs(as,{children:[e.jsx(De,{styles:ns}),e.jsxs(Be,{children:[e.jsx(N,{path:"select",element:e.jsx(me,{onSelect:m})}),e.jsx(N,{path:"verify-ownership",element:e.jsx(os,{})}),e.jsx(N,{path:"restore-blocklet",element:e.jsx(Ie,{})}),e.jsx(N,{path:"*",element:e.jsx(Ue,{to:`select${window.location.search}`,replace:!0})})]})]})})})}const ns=Oe`
285
285
  html,
286
286
  body,
287
287
  #root,
@@ -306,4 +306,4 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,
306
306
  &.logo-can-click {
307
307
  cursor: pointer;
308
308
  }
309
- `;function Ts(){const{search:t}=window.location;return t.includes("restoreFrom=server")?e.jsx(rs,{}):e.jsx(Qt,{})}export{Ts as default};
309
+ `;function Rs(){const{search:t}=window.location;return t.includes("restoreFrom=server")?e.jsx(rs,{}):e.jsx(Qt,{})}export{Rs as default};
@@ -0,0 +1,21 @@
1
+ import{aj as X,z as $,r as p,a as Z,b as ee,P as x,q as j,u as P,y as te,au as N,M as _,j as t,x as q,av as se,a1 as S,m as v,D as M,aw as oe,U as O,ax as re,B as W,C as z,ay as ne,A as K,K as V,az as ae,aA as ie,aB as le,F as ce,aC as B,i as ue,n as G,aa as de,a4 as pe,a7 as he,a8 as fe,aD as me,a9 as ge,O as xe}from"./index-DQYRaCdB.js";import{_ as D}from"./useLocalStorage-BV7bkq7L.js";import{c as be,C as ke,A as ye,D as Se,B as je,S as H,a as Pe,b as we}from"./item-CV3h78Bc.js";import{d as Re}from"./ArrowDropDown-9DQuvaIf.js";import{B as ve}from"./Breadcrumbs-JY-AOJsc.js";import"./index-Dpb6wQjU.js";import"./index-ZG7jWpak.js";import"./index-BLWTCfoo.js";import"./Search-raLlCMJk.js";import"./index-DkHucXVl.js";import"./Select-cp6_ZHE7.js";import"./InputAdornment-DDTwW0WR.js";import"./preact.module-B1z5cdvs.js";import"./Add-DiqSqlhj.js";import"./TextField-De1OeNfZ.js";import"./InputLabel-kl4d4Afd.js";import"./Launch-CAo1lLU6.js";import"./Done-Bj8_3suh.js";import"./DeleteOutline-CvnGFYQc.js";import"./delete-confirm-BvJrJyBD.js";import"./click-to-copy-Ci6mXYLS.js";import"./shorten-label-Cwua8w8y.js";import"./blocklet-CAvqFbwn.js";import"./MoreVert-pFjb7TqH.js";import"./ButtonGroup-CnSZJdO-.js";import"./getValidReactChildren-CSpxXCOO.js";function Ce(e){const n=X(),c=$(),[s,o]=D(`sid:blocklet:purchase:${e}`),[l,u]=p.useState(!1),[h,a]=p.useState(null),d=()=>{const{pathname:r,searchParams:m}=new URL(window.location.href),b=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";m.get("sid")&&(o(""),c(r.replace(b,"/"),{replace:!0}))},i=!!(n.get("assetDid")&&s&&n.get("sid")===s);return Z(ee.BlockletEvents.purchaseChange,r=>{r.did===e&&(a(r.session),["declined","confirmed","error"].includes(r.session.status)&&(u(!0),setTimeout(d,2e3)))}),p.useEffect(()=>{h&&h.id!==s&&o(h.id)},[h]),{hasCompleted:l,hasPurchased:i,session:h,setSession:a,doRedirect:d}}function E({meta:e,onCancel:n,handlePaySuccess:c,storeUrl:s}){const{t:o}=j(),{info:l}=P(),[u,h]=p.useState("both"),[a,d]=p.useState(1),i=te(l),r=N(e,l,s),m=R=>{R!==u&&h(R)},b=()=>{u&&(d(2),u==="verify"&&(window.location.href=r))},k=(R,L)=>{L!=="backdropClick"&&n()},w=()=>{c(r)},f=_.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:se.create({baseURL:S(s,"/store")}).get,onSuccess:w,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:f}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(v,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(v,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:f})]})]})}});const g=M;return t.jsx(g,{title:o("store.purchase.title",{name:f}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:k,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:u,onNext:b,onSelect:m})})})}E.propTypes={...be,storeUrl:x.string.isRequired,handlePaySuccess:x.func};E.defaultProps={handlePaySuccess:e=>{setTimeout(()=>{window.location.href=e},1e3)}};function U({meta:e,buttonText:n,storeUrl:c,isResource:s}){const{t:o}=j(),l=$(),{info:u}=P(),{api:h}=oe(),a=_.isFreeBlocklet(e)===!1,[d,i]=p.useState(!1),{hasPurchased:r}=Ce(e.did),[m,b]=p.useState(!1),[k]=D("instant-blocklet-install",!1),[w,f]=p.useState(!1),g=p.useMemo(()=>d?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,o,a]),R=p.useMemo(()=>s?o("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),L=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){b(!0);return}if(k){f(!0);return}if(!a){const C=N(e,u,c);window.location.href=C}}catch(C){K.error(V(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{i(!1)}},Q=()=>{i(!1),b(!1)},Y=y=>{i(!1),f(!1),l(`/blocklets/${y.appDid}/components`)},J=()=>{i(!1),f(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(O,{permission:"mutate_blocklets",children:y=>t.jsx(re,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(W,{onClick:L,size:"small",sx:{cursor:s?"not-allowed":"pointer"},disabled:!!(g||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:g?t.jsxs(t.Fragment,{children:[t.jsx(z,{size:16,style:{marginRight:3}}),g]}):R},e.did)})})}),(r||m)&&t.jsx(E,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:c}),w&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:Y,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ne(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:J})]})}U.propTypes={isResource:x.bool,meta:x.object.isRequired,buttonText:x.shape({purchase:x.string.isRequired,launch:x.string.isRequired}).isRequired,storeUrl:x.string.isRequired};U.defaultProps={isResource:!1};const De=(e,n,c)=>{const s=de(n);return S(c,`/blocklets/${e.did}/?server-url=${s}`)},A=({meta:e,attribute:n,value:c})=>e._formatted?e._formatted[n]:c;function T({blocklet:e,endpoint:n}){const{t:c}=j(),s=P();let o=S(s.imgPrefix,"blocklet.png");const l=n;if(l.startsWith("http")&&e.logo)o=S(l,le(e.did,e.logo,e.version));else{let r=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");r&&(r=`/${r}`),o=S(r,`/blocklet/logo/${e.did}`)}try{const i=new URL(o);i.searchParams.set("v",e.version||+new Date),o=i.href}catch{}const u=(s==null?void 0:s.info.mode)!==ce.NODE_MODES.SERVERLESS,h=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:c("common.purchase"),launch:c("common.launch")},storeUrl:l};let d=null;return u&&(d=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(U,{isResource:!(B.hasStartEngine(e)||B.isGatewayBlocklet(e)||B.isPackBlocklet(e)),...a})})),t.jsx(ue,{href:De(e,s.info,n),style:{color:"initial",textDecoration:"none"},onClick:h,target:"_blank",children:t.jsx(Le,{title:A({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:A({meta:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,button:d})})}T.propTypes={blocklet:x.object.isRequired,endpoint:x.string};T.defaultProps={endpoint:""};function I({storeUrl:e,handleSearchSelect:n,extraFilter:c,...s}){var r;const{locale:o}=j(),l=P(),[u,h]=p.useState({}),a=m=>{h(m)},d=e,i=(r=l==null?void 0:l.info)==null?void 0:r.version;return p.useEffect(()=>{h({})},[d]),t.jsx(ae,{FallbackComponent:ie,resetKeys:[d],children:t.jsx("div",{...s,children:t.jsx(Se,{blockletRender:m=>{const b={...m,endpoint:d};return t.jsx(T,{...b})},baseSearch:!0,endpoint:d,locale:o,onFilterChange:a,onSearchSelect:n,filters:u,extraFilter:c,serverVersion:i})})})}I.propTypes={storeUrl:x.string.isRequired,handleSearchSelect:x.func,extraFilter:x.func};I.defaultProps={handleSearchSelect:null,extraFilter:void 0};const Le=G(je)`
2
+ .ms-highlight {
3
+ color: ${e=>e.theme.palette.primary.main};
4
+ }
5
+ `,Be=pe(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})),F=p.forwardRef(({onChange:e,onDelete:n},c)=>{const{info:s}=P(),{t:o}=j(),[l,u]=p.useState(!1),[h,a]=p.useState(!1),[d,i]=p.useState(-1),r=Be(),[m,b]=D(H),k=Math.max(s.blockletRegistryList.findIndex(f=>f.url===m),0),w=f=>{try{u(!0),i(f);const g=s.blockletRegistryList[f];b(g.url),e(g.url),a(!1)}catch(g){console.error(g),K.error(`${o("store.blockletRegistry.changeFailed")} ${V(g)}`)}finally{u(!1)}};return p.useImperativeHandle(c,()=>({setOpen:a})),t.jsxs(t.Fragment,{children:[t.jsx(O,{permission:"mutate_node",children:f=>t.jsx(W,{disabled:!f,classes:{text:r.buttonText},color:"secondary","data-cy":"store-toggle",onClick:()=>{a(!0)},endIcon:t.jsx(Re,{}),children:t.jsx(v,{color:"secondary",children:s.blockletRegistryList[k].name})})}),t.jsx(M,{title:o("store.blockletRegistry.switchRegistry"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:h,onClose:()=>a(!1),children:t.jsxs(he,{className:r.tabPanel,children:[s.blockletRegistryList.map((f,g)=>t.jsxs(fe,{button:!0,disabled:l,selected:k===g,"data-cy":"store-switch",onClick:()=>{if(!l){if(g===k){a(!1);return}w(g)}},children:[d===g&&l&&t.jsx(me,{className:r.iconRoot,children:t.jsx(z,{size:16})}),t.jsx(ge,{children:t.jsx(Pe,{teamDid:s.did,store:f,onDelete:()=>n(f.url)})})]},f.url)),t.jsx(we,{disabled:l,onAdd:e,teamDid:s.did,blockletRegistryList:s.blockletRegistryList})]})})]})});F.propTypes={onChange:x.func,onDelete:x.func};F.defaultProps={onChange:()=>{},onDelete:()=>{}};const Ee=F;function nt(){const{t:e}=j(),{info:n}=P(),[c]=D(H),{blockletRegistryList:s}=n,o=s.find(r=>c===r.url)||s[0],[l,u]=p.useState(o.url),h=n.routing.adminPath,a=S(window.location.origin,h),d=({detailUrl:r})=>{const m=new URL(r);m.searchParams.set("server-url",a);const b=document.createElement("a");b.setAttribute("target","_blank"),b.setAttribute("href",m.href),b.click()},i=p.useRef(null);return t.jsxs(Ue,{children:[t.jsxs(ve,{separator:"›","aria-label":"breadcrumb",className:"page-breadcrumb",children:[t.jsx(v,{color:"textPrimary",children:e("common.store")}),t.jsx(Ee,{ref:i,onChange:r=>u(r),onDelete:r=>{var m;l===r&&u((m=n.blockletRegistryList[0])==null?void 0:m.url)}})]}),t.jsx(xe,{className:"store-header",display:"flex",justifyContent:"space-between",p:0,m:0,children:t.jsx(v,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:e("store.headerDescription")})}),t.jsx(I,{className:"blocklet-list",handleSearchSelect:d,storeUrl:l})]})}const Ue=G.main`
6
+ @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
7
+ .store-header {
8
+ flex-direction: column;
9
+ margin-bottom: 32px !important;
10
+ }
11
+
12
+ .page-header {
13
+ margin-bottom: 16px !important;
14
+ }
15
+ }
16
+ .blocklet-list {
17
+ aside:hover {
18
+ height: calc(100vh - 235px);
19
+ }
20
+ }
21
+ `;export{nt as default};
@@ -1,4 +1,4 @@
1
- import{r as y,j as i,s as h,O as p,P as o}from"./index-Dpr1-GCJ.js";var a={};Object.defineProperty(a,"__esModule",{value:!0});var f=a.default=void 0;v(y);var s=i;function v(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(d){return Object.getOwnPropertyDescriptor(e,d).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(n){g(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g(e,t,r){return t=b(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){var t=O(e,"string");return typeof t=="symbol"?t:String(t)}function O(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l=function(t){return(0,s.jsx)("svg",c(c({},t),{},{children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};l.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};l.displayName="empty";f=a.default=l;const j=h(p)`
1
+ import{r as y,j as i,s as h,O as p,P as o}from"./index-DQYRaCdB.js";var a={};Object.defineProperty(a,"__esModule",{value:!0});var f=a.default=void 0;v(y);var s=i;function v(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(d){return Object.getOwnPropertyDescriptor(e,d).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(n){g(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g(e,t,r){return t=b(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){var t=O(e,"string");return typeof t=="symbol"?t:String(t)}function O(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l=function(t){return(0,s.jsx)("svg",c(c({},t),{},{children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};l.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};l.displayName="empty";f=a.default=l;const j=h(p)`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
@@ -0,0 +1,54 @@
1
+ import{bm as ce,q as E,r as v,y as Pe,av as ie,a1 as P,ak as Ze,j as e,m as x,O as u,x as re,D as Qe,B as G,C as Z,w as He,J as Ve,$ as de,A as B,K as le,P as p,n as ve,f as Ke,i as Be,l as Xe,aK as q,aL as _,S as K,aD as X,a9 as W,a3 as We,a2 as Ge,a$ as Ye,H as qe,ch as _e,eA as je,W as $e,L as es,Z as ss,b as ts,F as L,bd as V,T as ae,ax as ns,hs as os,V as as,Q as is}from"./index-DQYRaCdB.js";import{u as $}from"./blocklet-CAvqFbwn.js";import{S as ye}from"./index-1ouNgxgi.js";import"./api-Ds0tawHV.js";import{a as Ie,u as J,P as rs,B as ls}from"./use-blocklet-info-for-connect-did-spaces-DmO4dvo0.js";import{e as Y,g as Ae,f as cs,i as Se,j as ds,k as ps,l as Ce,d as hs}from"./spaces-Cy0WiDqw.js";import{T as ms}from"./TextField-De1OeNfZ.js";import{I as us}from"./index-SA9KFCJd.js";import{S as ke}from"./switch-control-NaEEozhc.js";import{d as fs}from"./MoreVert-pFjb7TqH.js";import{d as xs}from"./DeleteOutline-CvnGFYQc.js";import{e as gs}from"./mode-B2dWMeTO.js";import{D as js}from"./index-DX3JXbQb.js";import"./ExpandMore-B-eh--rZ.js";import"./ButtonGroup-CnSZJdO-.js";import"./getValidReactChildren-CSpxXCOO.js";import"./index-dn7DkX5z.js";import"./Select-cp6_ZHE7.js";import"./InputLabel-kl4d4Afd.js";import"./index-DkHucXVl.js";import"./FilterList-BdSdHr3_.js";import"./Delete-C5xn6WBN.js";import"./LastPage-erHk2ZH1.js";import"./index-Clb1BN1w.js";import"./redux-BffWKrDO.js";import"./Search-raLlCMJk.js";import"./index-BLWTCfoo.js";function ee({...s}){const{blocklet:t}=$(),{info:d}=ce(),{t:a,locale:i}=E(),[m,n]=v.useState(""),[r,j]=v.useState(!1),[c,h]=v.useState(!1),[k,y]=v.useState(""),f=Ie({blocklet:t}),g=Pe(d),{spaceGateways:I,addSpaceGateway:te}=J(),[D,M]=v.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,checkFn:ie.create({baseURL:P(window.location.origin,Ze())}).get,messages:{title:a("storage.spaces.provideNFT.title",{appName:f.appName},i),scan:a("storage.spaces.provideNFT.scan",{appName:f.appName},i),confirm:"",success:e.jsx(x,{gutterBottom:!0,children:a("storage.spaces.provideNFT.success")})},onClose:()=>{M(l=>({...l,open:!1}))}}),[o,z]=v.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:a("storage.spaces.authorize.title",{appName:f.appName},i),scan:a("storage.spaces.authorize.scan",{appName:f.appName},i),confirm:"",success:e.jsx(x,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{z(l=>({...l,open:!1}))}}),R=async({endpoint:l,name:A,did:S})=>{const b=await Ae(l);if(!await Se(b)){B.error(a("storage.spaces.gateway.add.invalidUrl"));return}if(I.some(Q=>Q.endpoint===l)){B.error(a("storage.spaces.gateway.add.duplicate",{name:A}));return}const O={name:A,did:S,url:b,endpoint:l};await te(O,l),B.success(a("storage.spaces.connectedWithName",{name:(O==null?void 0:O.name)??"DID Spaces"}))},T=async(l,A)=>{try{if(!de.isEmpty(l.spaceGateway))await R(A(l.spaceGateway));else{const S=A(l.endpoint),b=l.space?A(l.space):{};await R({endpoint:S,did:Y(S),name:"DID Space",...b})}z(S=>({...S,open:!1})),n(null),M(S=>({...S,open:!1}))}catch(S){console.error(S),B.error(le(S))}},C=()=>{M(l=>({...l,open:!0,extraParams:{appPid:t.appPid,appName:f.appName,appDescription:f.appDescription,scopes:f.scopes,appUrl:f.appUrl,referrer:f.referrer,nodeDid:d.did}}))},w=async()=>{try{j(!0);const l=await Ae(m),A=cs(l),S=new URL(l).searchParams.get("spaceDid");if(!await Se(A))throw new Error(a("storage.spaces.gateway.add.invalidUrl"));z(b=>({...b,open:!0,prefix:P(A,"space/api/did"),baseUrl:new URL(A).origin,checkFn:ie.create({baseURL:P(A,"space")}).get,extraParams:{appDid:f.appDid,appName:f.appName,appDescription:f.appDescription,scopes:f.scopes,appUrl:f.appUrl,referrer:f.referrer,nodeDid:d.did,spaceDid:S}})),h(!1)}catch(l){const A=`${a("storage.spaces.gateway.add.failed",i)}: ${le(l)}`;y(A)}finally{j(!1)}};return e.jsxs(u,{children:[e.jsx(ye,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:C,menu:[e.jsx(ye.Item,{sx:{textTransform:"none"},onClick:()=>h(!0),size:"small",...s,children:a("storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(x,{sx:{fontWeight:"bold",textTransform:"none"},children:a("storage.spaces.connect.useWallet")})}),e.jsx(re,{forceConnected:!1,saveConnect:!1,prefix:D.prefix,open:D.open,popup:!0,action:D.action,webWalletUrl:g,baseUrl:D.baseUrl,checkFn:D.checkFn,onSuccess:T,onClose:D.onClose,checkTimeout:D.checkTimeout,extraParams:D.extraParams,messages:D.messages,locale:i}),e.jsx(re,{forceConnected:!1,saveConnect:!1,prefix:o.prefix,open:o.open,popup:!0,action:o.action,baseUrl:o.baseUrl,checkFn:o.checkFn,onSuccess:T,onClose:o.onClose,checkTimeout:o.checkTimeout,extraParams:o.extraParams,messages:o.messages,locale:i}),e.jsxs(Qe,{title:a("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:c,onClose:()=>h(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(G,{onClick:l=>{l.stopPropagation(),h(!1)},color:"inherit",children:a("common.cancel")}),e.jsxs(G,{onClick:w,color:"primary",disabled:r||!m,variant:"contained",autoFocus:!0,children:[r&&e.jsx(Z,{size:16}),a("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(He,{component:"div",children:e.jsx(x,{component:"div",children:e.jsx(ms,{label:a("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:m,onChange:l=>{y(null),n(l.target.value)},disabled:r,onKeyPress:async l=>{l.key==="Enter"&&await w()},autoFocus:!0})})})}),!!k&&e.jsx(Ve,{severity:"error",style:{width:"100%"},children:k})]})]})}ee.propTypes={};ee.defaultProps={};function se({blocklet:s,...t}){const{t:d}=v.useContext(Ke);if(!s.diskInfo)return e.jsx(x,{children:d("blocklet.diskInfo.empty")});const a=(n,r,j)=>e.jsxs(x,{children:[j?e.jsx(Be,{style:{cursor:"pointer"},onClick:j,underline:"hover",children:n}):n," ",e.jsx("strong",{children:r?Xe(r):"empty"})]}),i=s.environments.reduce((n,r)=>(n[r.key]=r.value,n),{}),m=[{key:"appDir",name:d("blocklet.diskInfo.appDir"),value:a(i.BLOCKLET_APP_DIR,s.diskInfo.app)},{key:"dataDir",name:d("blocklet.diskInfo.dataDir"),value:a(i.BLOCKLET_DATA_DIR,s.diskInfo.data)},{key:"logDir",name:d("blocklet.diskInfo.logDir"),value:a(i.BLOCKLET_LOG_DIR,s.diskInfo.log)},{key:"cacheDir",name:d("blocklet.diskInfo.cacheDir"),value:a(i.BLOCKLET_CACHE_DIR,s.diskInfo.cache)}];return e.jsx(ys,{component:"div",...t,children:m.map(n=>e.jsx(us,{valueComponent:"div",nameWidth:120,name:n.name,children:n.value},n.key))})}se.propTypes={blocklet:p.object.isRequired};se.defaultProps={};const ys=ve(x)``;var De=function(t){return e.jsxs("svg",{...t,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs1gCtSC4YsjwnY9l1MJYRz1NMk5NAC3MffnLwiHnNH7IoyER5VEI6S4Um++uKyho0BwmD+1rA90yarpO4ZpjLgs8+BTUfU9w+gkwEi6ftxqyB9Wt6IBstE0E8kxJLeKaVhNA/uEwIslv1JmRwcSzAo+URPCF5M8AGzEF8yG+QVBFl53FqhfYqd7/PM6AmJouW4cVge9pZuMJga2NQH918Sp4VIXddVCKizUTFu3CbUMxyxgOUoSpidf+JEuRy/g3EyyCTz0yw2KRGtDs4fE8btEktCKZzL3J6mFoLZdlcJKLW33guKRC44aAhkhSWKMOT5uF2kd283asHcBt5C15MVUJUPpX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rKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};De.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Ue(){const{t:s}=E(),{blocklet:t}=$();return e.jsxs(u,{children:[e.jsxs(u,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(De,{style:{width:250,height:250}}),e.jsx(x,{marginTop:"24px",marginBottom:"24px",children:s("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsx(x,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:s("common.dataStorage")}),e.jsx(se,{blocklet:t})]})}Ue.propTypes={};var pe={},As=_;Object.defineProperty(pe,"__esModule",{value:!0});var Re=pe.default=void 0,Ss=As(q()),Cs=e;Re=pe.default=(0,Ss.default)((0,Cs.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var he={},vs=_;Object.defineProperty(he,"__esModule",{value:!0});var be=he.default=void 0,Bs=vs(q()),Is=e;be=he.default=(0,Bs.default)((0,Is.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"}),"ElectricBoltOutlined");var me={},ks=_;Object.defineProperty(me,"__esModule",{value:!0});var Ee=me.default=void 0,Ds=ks(q()),Us=e;Ee=me.default=(0,Ds.default)((0,Us.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"}),"FolderOutlined");function ue({spaceGateway:s,onDelete:t}){const{t:d}=E(),[a,i]=v.useState(!1),[m,n]=v.useState(!1),r=(c,h)=>{c==null||c.preventDefault(),c==null||c.stopPropagation(),i(h)},j=async c=>{try{c==null||c.stopPropagation(),n(!0),await t(s),i(!1)}catch(h){console.error(h),B.error(`${d("storage.space.gateway.delete.failed")}: ${le(h)}`)}finally{n(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:c=>r(c,!0),children:[e.jsx(X,{style:{minWidth:24,color:"red"},children:e.jsx(xs,{fontSize:"small"})}),e.jsx(W,{style:{color:"red"},children:d("common.delete")})]}),e.jsx(We,{title:e.jsx(x,{variant:"h6",children:d("common.delConfirmDescription",{data:`${s==null?void 0:s.name}`})}),open:a,confirmButton:{text:d("common.confirm"),props:{variant:"contained",color:"error",loading:m}},cancelButton:{text:d("common.cancel"),props:{variant:"contained",color:"primary"},loading:m},onConfirm:j,onCancel:c=>r(c,!1)})]})}ue.propTypes={onDelete:p.func,spaceGateway:p.shape({name:p.string.isRequired,url:p.string.isRequired,protected:p.bool}).isRequired};ue.defaultProps={onDelete:()=>{}};function fe({spaceGateway:s,connected:t,onDelete:d,onConnect:a,enableSwitchToSpace:i,backupInProgress:m,...n}){const[r,j]=v.useState(null),{t:c}=E(),[h,k]=v.useState(!1),y=(g,I)=>{g.stopPropagation(),g.preventDefault(),j(I&&g.currentTarget)},f=async g=>{try{k(!0),y(g,!1),await a(s)}catch(I){console.error(I),B.error(I.message)}finally{k(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Ge,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:g=>y(g,!0),size:"small",...n,children:h||s!=null&&s.loading?e.jsx(Z,{size:"24px"}):e.jsx(fs,{})}),e.jsxs(Ye,{id:"simple-menu",anchorEl:r,keepMounted:!0,open:!!r,onClose:g=>y(g,!1),children:[e.jsxs(K,{onClick:g=>{y(g,!1),window.open(s.endpoint?ds(s.endpoint):s.url)},children:[e.jsx(X,{style:{minWidth:24},children:e.jsx(Re,{fontSize:"small"})}),e.jsx(W,{children:c("common.open")})]}),e.jsxs(K,{onClick:g=>{y(g,!1),window.open(ps(s.endpoint))},children:[e.jsx(X,{style:{minWidth:24},children:e.jsx(Ee,{fontSize:"small"})}),e.jsx(W,{children:c("storage.spaces.strategy.viewBackupFiles")})]}),!t&&i&&e.jsxs(K,{onClick:f,children:[e.jsx(X,{style:{minWidth:24},children:e.jsx(be,{fontSize:"small"})}),e.jsx(W,{children:c("storage.spaces.connect.switchToSpace")})]}),!m&&e.jsx(ue,{spaceGateway:s,onDelete:d})]})]})}fe.propTypes={spaceGateway:p.shape({name:p.string.isRequired,url:p.string.isRequired,protected:p.bool,endpoint:p.string.isRequired,loading:p.bool}).isRequired,connected:p.bool.isRequired,enableSwitchToSpace:p.bool,onDelete:p.func,onConnect:p.func,backupInProgress:p.bool};fe.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};var Te=function(t){return e.jsx("svg",{...t,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Te.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var we=function(t){return e.jsx("svg",{...t,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})})};we.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xe({spaceGateway:s,connected:t,onDelete:d,onBackupNow:a,...i}){const m=qe(U=>U.breakpoints.down("md")),{t:n,locale:r}=E(),{blocklet:j}=$(),{api:c,info:{did:h}}=ce(),{appDid:k,appName:y,appDescription:f,scopes:g,appUrl:I,referrer:te}=Ie({blocklet:j}),{updateSpaceGateway:D,backupEndpoint:M,backupProgress:o,refreshBackupEndpoint:z}=J(),[R,T]=v.useState(!1),[C,w]=v.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:y},r),scan:n("storage.spaces.authorize.scan",{appName:y},r),confirm:"",success:e.jsx(x,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{w(U=>({...U,open:!1}))}}),{data:l,loading:A}=_e(async()=>t?Ce(M):!0,{refreshDeps:[t,M,C==null?void 0:C.open,R]}),S=t&&l,b=t&&!R&&l&&!(s!=null&&s.loading),F=t&&R&&l,O=t&&!l&&!A&&!R,Q=async()=>{if(await Ce(s==null?void 0:s.endpoint)){await c.configBlocklet({input:{did:[j.meta.did],configs:[{key:ts.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:s.endpoint}]}}),z(),B.success(n("storage.spaces.connect.switchToSpaceSucceeded",{name:s.name?`(${s.name})`:""}));return}w(H=>({...H,open:!0,prefix:P(s.url,"space/api/did"),baseUrl:new URL(s.url).origin,checkFn:ie.create({baseURL:P(s.url,"space")}).get,extraParams:{appDid:k,appName:y,appDescription:f,scopes:g,appUrl:I,referrer:te,nodeDid:h,spaceDid:s.did}}))},Me=async(U,H)=>{const ne=H(U.endpoint),Je=Y(ne),N=U.space?H(U.space):{};if(s.did&&Je!==s.did){w(oe=>({...oe,open:!1})),B.error(n("storage.spaces.gateway.switch.failedForMismatchSpace",{name:N!=null&&N.name?N.name:""}));return}const ze={...s,name:N.name??"DID Space",did:N.did??Y(ne),endpoint:ne};await D(ze),w(oe=>({...oe,open:!1}))},Ne=async()=>{try{if(R)return;T(!0),await a()}catch(U){console.error(U),B.error(U.message)}finally{T(!0)}};return v.useEffect(()=>{o!=null&&o.completed?((o==null?void 0:o.progress)===100?B.success(n("storage.spaces.backupSuccessfully")):(o==null?void 0:o.progress)===-1&&B.error(o==null?void 0:o.message),T(!1),o.progress=0,o.message=""):o.progress&&T(!0)},[o]),e.jsxs(Rs,{style:{position:"relative"},children:[e.jsxs(u,{sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...i,children:[e.jsx(u,{display:"flex",children:e.jsx(rs,{alt:s.did,src:hs(s.endpoint)})}),e.jsxs(u,{className:"spaces-info",display:"flex",flexGrow:(!m||!F)&&1,minWidth:"180px",flexDirection:F?"row":"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[e.jsxs(u,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[e.jsx(x,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:s.name}),S&&e.jsx(je,{label:e.jsxs(e.Fragment,{children:[e.jsx(Te,{style:{marginRight:"4px"}}),n("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}}),O&&e.jsx(je,{label:e.jsxs(e.Fragment,{children:[e.jsx(we,{style:{marginRight:"4px"}}),n("storage.spaces.disconnected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}})]}),e.jsx(u,{className:"spaces-address",display:F?"none":"flex",color:"#9397A1",marginTop:"8px",children:e.jsx(x,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:s.did&&e.jsx($e,{copyable:!1,size:14,compact:!0,responsive:!1,did:s.did})})})]}),e.jsxs(u,{className:"spaces-backup",display:"flex",alignItems:"center",flex:m&&F&&1,children:[b&&e.jsxs(u,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:[e.jsx(G,{variant:"contained",size:"small",onClick:Ne,children:n("storage.spaces.strategy.backupNow")}),gs&&e.jsx(ke,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:e.jsx(x,{sx:{marginRight:"8px",fontSize:"16px"},children:e.jsx("span",{children:n("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),F&&e.jsxs(u,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",minWidth:!m&&"640px",marginLeft:m&&"16px",width:m&&"360px",marginRight:"auto",alignSelf:"flex-end",children:[e.jsx(x,{color:"primary",children:o==null?void 0:o.message}),e.jsxs(u,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[e.jsx(u,{sx:{width:"100%",mr:1},children:e.jsx(es,{color:"primary",variant:"determinate",value:o==null?void 0:o.progress})}),e.jsx(u,{sx:{maxWidth:"100%"},children:e.jsxs(x,{variant:"body2",color:"text.secondary",children:[o==null?void 0:o.progress,"%"]})})]})]}),O&&e.jsx(u,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:e.jsx(G,{color:"error",variant:"contained",size:"small",onClick:Q,children:n("storage.spaces.disconnected.reconnectNow")})}),e.jsx(fe,{sx:{marginLeft:"16px",marginRight:"16px",alignItems:"flex-end",justifyItems:"flex-end"},spaceGateway:s,connected:t,onDelete:d,onConnect:Q,enableSwitchToSpace:(o==null?void 0:o.completed)||de.isEmpty(o==null?void 0:o.message),backupInProgress:F})]})]}),e.jsx(re,{forceConnected:!1,saveConnect:!1,prefix:C.prefix,open:C.open,popup:!0,action:C.action,baseUrl:C.baseUrl,checkFn:C.checkFn,onSuccess:Me,onClose:C.onClose,checkTimeout:C.checkTimeout,extraParams:C.extraParams,messages:C.messages,locale:r},"get-endpoint"),e.jsx(u,{className:`selected-container ${t?"selected":""}`,children:e.jsx(ss,{className:"selected-icon"})})]})}xe.propTypes={spaceGateway:p.shape({did:p.string.isRequired,name:p.string.isRequired,url:p.string.isRequired,endpoint:p.string.isRequired,protected:p.bool,loading:p.bool}).isRequired,connected:p.bool.isRequired,progress:p.any.isRequired,onDelete:p.func,onBackupNow:p.func};xe.defaultProps={onDelete:()=>{},onBackupNow:()=>{}};const Rs=ve(u)`
2
+ .selected-container {
3
+ position: absolute;
4
+ right: 0px;
5
+ bottom: 0px;
6
+ display: flex;
7
+ -webkit-box-pack: end;
8
+ justify-content: flex-end;
9
+ align-items: flex-end;
10
+ width: 32px;
11
+ height: 32px;
12
+ border-radius: 0px 0px 8px;
13
+ color: rgb(255, 255, 255);
14
+ overflow: hidden;
15
+ transition: all 0.4s ease 0s;
16
+
17
+ &::after {
18
+ position: absolute;
19
+ z-index: 0;
20
+ left: 60px;
21
+ top: 60px;
22
+ display: block;
23
+ width: 0px;
24
+ height: 0px;
25
+ border-width: 16px;
26
+ border-style: solid;
27
+ border-color: transparent #1dc1c7 #1dc1c7 transparent;
28
+ transition: all 0.1s ease 0s;
29
+ content: '';
30
+ }
31
+
32
+ .selected-icon {
33
+ visibility: hidden;
34
+ width: 60%;
35
+ height: 60%;
36
+ position: relative;
37
+ z-index: 2;
38
+ margin: 0px 1px 1px 0px;
39
+ font-size: 16px;
40
+ transition: all 0.2s ease 0s;
41
+ }
42
+ }
43
+
44
+ .selected-container.selected {
45
+ &::after {
46
+ left: 0px;
47
+ top: 0px;
48
+ }
49
+
50
+ .selected-icon {
51
+ visibility: visible;
52
+ }
53
+ }
54
+ `;var ge={},bs=_;Object.defineProperty(ge,"__esModule",{value:!0});var Fe=ge.default=void 0,Es=bs(q()),Ts=e;Fe=ge.default=(0,Es.default)((0,Ts.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline");function Oe({...s}){const{t,locale:d}=E(),{spaceGateways:a,backups:i}=J(),m=[{label:"DID Spaces",name:"target",options:{customBodyRenderLite:n=>{var g;const{targetUrl:r,targetName:j,status:c,createdAt:h}=i[n],k=c===L.BACKUPS.STATUS.PROGRESS&&V().diff(h,"hours")>=L.BACKUPS.TIMEOUT_HOURS,y=c===L.BACKUPS.STATUS.SUCCEEDED&&!k,f=j||((g=a.find(I=>r==null?void 0:r.includes(Y(I==null?void 0:I.endpoint))))==null?void 0:g.name)||"Unknown DID Space";return y?e.jsx(Be,{fontSize:"16px",href:r,target:"_blank",children:f}):e.jsx(x,{variant:"body1",fontSize:"16px",children:f})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:n=>{const r=t(n===0?"common.auto":"common.manual");return e.jsx(ae,{children:r})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:n=>V(n).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:n=>de.isEmpty(n)?"":V(n).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:n=>{const{status:r,message:j,createdAt:c}=(i==null?void 0:i[n])??{},h=r===L.BACKUPS.STATUS.PROGRESS&&V().diff(c,"hours")>=L.BACKUPS.TIMEOUT_HOURS,k=h&&t("common.timeoutError"),y=r===L.BACKUPS.STATUS.PROGRESS&&!h,f=r===L.BACKUPS.STATUS.SUCCEEDED&&!h;return y?e.jsxs(x,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(Z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):f?e.jsx(ae,{type:"success",children:t("common.succeeded")}):e.jsxs(u,{display:"inline-flex",alignItems:"center",children:[e.jsx(ae,{type:"error",children:t("common.failed")}),"  ",e.jsx(ns,{style:{display:"flex",alignItems:"center",flexShrink:0},title:j||k,children:e.jsx(os,{children:e.jsx(Fe,{style:{width:"24px",height:"24px"},color:"error"})})})]})}}}];return e.jsx(u,{...s,children:i!=null&&i.length?e.jsx(js,{title:e.jsx(x,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")}),data:i,columns:m,emptyNode:t("storage.spaces.record.emptyData",d),options:{download:!1,filter:!1,print:!1}}):e.jsxs(e.Fragment,{children:[e.jsx(u,{display:"flex",height:"56px",lineHeight:"56px",alignItems:"center",children:e.jsx(x,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(u,{color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")})]})})}Oe.propTypes={};function Le({...s}){const{t}=E(),{autoBackup:d,updateAutoBackup:a}=J(),i=async()=>{try{const m=!d.enabled;await a({enabled:m}),B.success(t(m?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(m){B.error(m.message)}};return e.jsx(ke,{checked:!!(d!=null&&d.enabled),onChange:i,name:"enableWelcomePage",labelProps:{label:e.jsx(x,{marginRight:"8px",children:e.jsx("span",{children:t("storage.spaces.autoBackup.title")})})},style:{...s.style}})}Le.propTypes={};function ws(){const{t:s}=E(),{blocklet:t}=$(),{api:d}=ce(),{spaceGateways:a,spaceGatewaysLoading:i,deleteSpaceGateway:m,spaceGatewayIsSelected:n}=J(),r=i&&!(a!=null&&a.length),j=async h=>{await m(h),B.success(s("storage.spaces.gateway.delete.succeeded",{name:`(${h.name})`}))},c=async()=>{await d.backupBlocklet({input:{appDid:t.appDid,to:"spaces"}})};return e.jsxs(u,{display:"flex",flexDirection:"column",children:[e.jsxs(u,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:[e.jsx(x,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:s("storage.spaces.connected.title")}),e.jsx(Le,{style:{marginRight:"32px"}}),e.jsx(ee,{})]}),e.jsx(u,{children:r?e.jsx(u,{display:"flex",justifyContent:"center",children:e.jsx(Z,{})}):a.map(h=>e.jsx(xe,{style:{marginTop:"12px"},spaceGateway:h,connected:n(h),onDelete:j,onBackupNow:c},h.endpoint))}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(x,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:s("common.dataStorage")}),e.jsx(se,{blocklet:t})]})}function Fs(){const{spaceGatewaysLoading:s,spaceGateways:t}=J();return s?e.jsx(as,{relative:"parent",children:e.jsx(Z,{})}):is(t)?e.jsx(Ue,{}):e.jsx(ws,{})}function lt(){return e.jsx(ls,{children:e.jsx(Fs,{})})}export{lt as default};
@@ -0,0 +1,11 @@
1
+ var Yt=Object.defineProperty;var te=(t,n,e)=>n in t?Yt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var R=(t,n,e)=>(te(t,typeof n!="symbol"?n+"":n,e),e);import{P as Z,r as ee,aO as ne,ci as oe,j as p,a2 as re,fB as ft,dR as ie,dP as se,fF as ce,dO as ae,d7 as I,a7 as le,a8 as ue,gc as fe,O as de,gd as he,m as pe,ge,fE as me,B as ye,gf as be}from"./index-DQYRaCdB.js";/**
2
+ * (c) Iconify
3
+ *
4
+ * For the full copyright and license information, please view the license.txt
5
+ * files at https://github.com/iconify/iconify
6
+ *
7
+ * Licensed under MIT.
8
+ *
9
+ * @license MIT
10
+ * @version 1.0.8
11
+ */const Pt=Object.freeze({left:0,top:0,width:16,height:16}),B=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),E=Object.freeze({...Pt,...B}),X=Object.freeze({...E,body:"",hidden:!1}),xe=Object.freeze({width:null,height:null}),Mt=Object.freeze({...xe,...B});function we(t,n=0){const e=t.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(e===""){const o=parseInt(t);return isNaN(o)?0:r(o)}else if(e!==t){let o=0;switch(e){case"%":o=25;break;case"deg":o=90}if(o){let i=parseFloat(t.slice(0,t.length-e.length));return isNaN(i)?0:(i=i/o,i%1===0?r(i):0)}}return n}const Ie=/[\s,]+/;function Se(t,n){n.split(Ie).forEach(e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}const qt={...Mt,preserveAspectRatio:""};function dt(t){const n={...qt},e=(r,o)=>t.getAttribute(r)||o;return n.width=e("width",null),n.height=e("height",null),n.rotate=we(e("rotate","")),Se(n,e("flip","")),n.preserveAspectRatio=e("preserveAspectRatio",e("preserveaspectratio","")),n}function ve(t,n){for(const e in qt)if(t[e]!==n[e])return!0;return!1}const k=/^[a-z0-9]+(-[a-z0-9]+)*$/,_=(t,n,e,r="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),s=o.pop(),l={provider:o.length>0?o[0]:r,prefix:s,name:a};return n&&!N(l)?null:l}const i=o[0],c=i.split("-");if(c.length>1){const a={provider:r,prefix:c.shift(),name:c.join("-")};return n&&!N(a)?null:a}if(e&&r===""){const a={provider:r,prefix:"",name:i};return n&&!N(a,e)?null:a}return null},N=(t,n)=>t?!!((t.provider===""||t.provider.match(k))&&(n&&t.prefix===""||t.prefix.match(k))&&t.name.match(k)):!1;function Ce(t,n){const e={};!t.hFlip!=!n.hFlip&&(e.hFlip=!0),!t.vFlip!=!n.vFlip&&(e.vFlip=!0);const r=((t.rotate||0)+(n.rotate||0))%4;return r&&(e.rotate=r),e}function ht(t,n){const e=Ce(t,n);for(const r in X)r in B?r in t&&!(r in e)&&(e[r]=B[r]):r in n?e[r]=n[r]:r in t&&(e[r]=t[r]);return e}function Te(t,n){const e=t.icons,r=t.aliases||Object.create(null),o=Object.create(null);function i(c){if(e[c])return o[c]=[];if(!(c in o)){o[c]=null;const a=r[c]&&r[c].parent,s=a&&i(a);s&&(o[c]=[a].concat(s))}return o[c]}return(n||Object.keys(e).concat(Object.keys(r))).forEach(i),o}function Ae(t,n,e){const r=t.icons,o=t.aliases||Object.create(null);let i={};function c(a){i=ht(r[a]||o[a],i)}return c(n),e.forEach(c),ht(t,i)}function Et(t,n){const e=[];if(typeof t!="object"||typeof t.icons!="object")return e;t.not_found instanceof Array&&t.not_found.forEach(o=>{n(o,null),e.push(o)});const r=Te(t);for(const o in r){const i=r[o];i&&(n(o,Ae(t,o,i)),e.push(o))}return e}const ke={provider:"",aliases:{},not_found:{},...Pt};function G(t,n){for(const e in n)if(e in t&&typeof t[e]!=typeof n[e])return!1;return!0}function _t(t){if(typeof t!="object"||t===null)return null;const n=t;if(typeof n.prefix!="string"||!t.icons||typeof t.icons!="object"||!G(t,ke))return null;const e=n.icons;for(const o in e){const i=e[o];if(!o.match(k)||typeof i.body!="string"||!G(i,X))return null}const r=n.aliases||Object.create(null);for(const o in r){const i=r[o],c=i.parent;if(!o.match(k)||typeof c!="string"||!e[c]&&!r[c]||!G(i,X))return null}return n}const z=Object.create(null);function je(t,n){return{provider:t,prefix:n,icons:Object.create(null),missing:new Set}}function S(t,n){const e=z[t]||(z[t]=Object.create(null));return e[n]||(e[n]=je(t,n))}function st(t,n){return _t(n)?Et(n,(e,r)=>{r?t.icons[e]=r:t.missing.add(e)}):[]}function Pe(t,n,e){try{if(typeof e.body=="string")return t.icons[n]={...e},!0}catch{}return!1}function Me(t,n){let e=[];return(typeof t=="string"?[t]:Object.keys(z)).forEach(o=>{(typeof o=="string"&&typeof n=="string"?[n]:Object.keys(z[o]||{})).forEach(c=>{const a=S(o,c);e=e.concat(Object.keys(a.icons).map(s=>(o!==""?"@"+o+":":"")+c+":"+s))})}),e}let P=!1;function Ot(t){return typeof t=="boolean"&&(P=t),P}function M(t){const n=typeof t=="string"?_(t,!0,P):t;if(n){const e=S(n.provider,n.prefix),r=n.name;return e.icons[r]||(e.missing.has(r)?null:void 0)}}function Lt(t,n){const e=_(t,!0,P);if(!e)return!1;const r=S(e.provider,e.prefix);return Pe(r,e.name,n)}function pt(t,n){if(typeof t!="object")return!1;if(typeof n!="string"&&(n=t.provider||""),P&&!n&&!t.prefix){let o=!1;return _t(t)&&(t.prefix="",Et(t,(i,c)=>{c&&Lt(i,c)&&(o=!0)})),o}const e=t.prefix;if(!N({provider:n,prefix:e,name:"a"}))return!1;const r=S(n,e);return!!st(r,t)}function qe(t){return!!M(t)}function Ee(t){const n=M(t);return n?{...E,...n}:null}function _e(t){const n={loaded:[],missing:[],pending:[]},e=Object.create(null);t.sort((o,i)=>o.provider!==i.provider?o.provider.localeCompare(i.provider):o.prefix!==i.prefix?o.prefix.localeCompare(i.prefix):o.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return t.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const i=o.provider,c=o.prefix,a=o.name,s=e[i]||(e[i]=Object.create(null)),l=s[c]||(s[c]=S(i,c));let u;a in l.icons?u=n.loaded:c===""||l.missing.has(a)?u=n.missing:u=n.pending;const f={provider:i,prefix:c,name:a};u.push(f)}),n}function Rt(t,n){t.forEach(e=>{const r=e.loaderCallbacks;r&&(e.loaderCallbacks=r.filter(o=>o.id!==n))})}function Oe(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const n=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!n.length)return;let e=!1;const r=t.provider,o=t.prefix;n.forEach(i=>{const c=i.icons,a=c.pending.length;c.pending=c.pending.filter(s=>{if(s.prefix!==o)return!0;const l=s.name;if(t.icons[l])c.loaded.push({provider:r,prefix:o,name:l});else if(t.missing.has(l))c.missing.push({provider:r,prefix:o,name:l});else return e=!0,!0;return!1}),c.pending.length!==a&&(e||Rt([t],i.id),i.callback(c.loaded.slice(0),c.missing.slice(0),c.pending.slice(0),i.abort))})}))}let Le=0;function Re(t,n,e){const r=Le++,o=Rt.bind(null,e,r);if(!n.pending.length)return o;const i={id:r,icons:n,callback:t,abort:o};return e.forEach(c=>{(c.loaderCallbacks||(c.loaderCallbacks=[])).push(i)}),o}const Y=Object.create(null);function gt(t,n){Y[t]=n}function tt(t){return Y[t]||Y[""]}function Fe(t,n=!0,e=!1){const r=[];return t.forEach(o=>{const i=typeof o=="string"?_(o,n,e):o;i&&r.push(i)}),r}var Ne={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function He(t,n,e,r){const o=t.resources.length,i=t.random?Math.floor(Math.random()*o):t.index;let c;if(t.random){let d=t.resources.slice(0);for(c=[];d.length>1;){const w=Math.floor(Math.random()*d.length);c.push(d[w]),d=d.slice(0,w).concat(d.slice(w+1))}c=c.concat(d)}else c=t.resources.slice(i).concat(t.resources.slice(0,i));const a=Date.now();let s="pending",l=0,u,f=null,h=[],g=[];typeof r=="function"&&g.push(r);function m(){f&&(clearTimeout(f),f=null)}function y(){s==="pending"&&(s="aborted"),m(),h.forEach(d=>{d.status==="pending"&&(d.status="aborted")}),h=[]}function V(d,w){w&&(g=[]),typeof d=="function"&&g.push(d)}function O(){return{startTime:a,payload:n,status:s,queriesSent:l,queriesPending:h.length,subscribe:V,abort:y}}function b(){s="failed",g.forEach(d=>{d(void 0,u)})}function x(){h.forEach(d=>{d.status==="pending"&&(d.status="aborted")}),h=[]}function Xt(d,w,T){const L=w!=="success";switch(h=h.filter(v=>v!==d),s){case"pending":break;case"failed":if(L||!t.dataAfterTimeout)return;break;default:return}if(w==="abort"){u=T,b();return}if(L){u=T,h.length||(c.length?U():b());return}if(m(),x(),!t.random){const v=t.resources.indexOf(d.resource);v!==-1&&v!==t.index&&(t.index=v)}s="completed",g.forEach(v=>{v(T)})}function U(){if(s!=="pending")return;m();const d=c.shift();if(d===void 0){if(h.length){f=setTimeout(()=>{m(),s==="pending"&&(x(),b())},t.timeout);return}b();return}const w={status:"pending",resource:d,callback:(T,L)=>{Xt(w,T,L)}};h.push(w),l++,f=setTimeout(U,t.rotate),e(d,n,w.callback)}return setTimeout(U),O}function Ft(t){const n={...Ne,...t};let e=[];function r(){e=e.filter(a=>a().status==="pending")}function o(a,s,l){const u=He(n,a,s,(f,h)=>{r(),l&&l(f,h)});return e.push(u),u}function i(a){return e.find(s=>a(s))||null}return{query:o,find:i,setIndex:a=>{n.index=a},getIndex:()=>n.index,cleanup:r}}function ct(t){let n;if(typeof t.resources=="string")n=[t.resources];else if(n=t.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const D=Object.create(null),A=["https://api.simplesvg.com","https://api.unisvg.com"],H=[];for(;A.length>0;)A.length===1||Math.random()>.5?H.push(A.shift()):H.push(A.pop());D[""]=ct({resources:["https://api.iconify.design"].concat(H)});function mt(t,n){const e=ct(n);return e===null?!1:(D[t]=e,!0)}function Q(t){return D[t]}function Be(){return Object.keys(D)}function yt(){}const J=Object.create(null);function ze(t){if(!J[t]){const n=Q(t);if(!n)return;const e=Ft(n),r={config:n,redundancy:e};J[t]=r}return J[t]}function Nt(t,n,e){let r,o;if(typeof t=="string"){const i=tt(t);if(!i)return e(void 0,424),yt;o=i.send;const c=ze(t);c&&(r=c.redundancy)}else{const i=ct(t);if(i){r=Ft(i);const c=t.resources?t.resources[0]:"",a=tt(c);a&&(o=a.send)}}return!r||!o?(e(void 0,424),yt):r.query(n,o,e)().abort}const bt="iconify2",q="iconify",Ht=q+"-count",xt=q+"-version",Bt=36e5,$e=168;function et(t,n){try{return t.getItem(n)}catch{}}function at(t,n,e){try{return t.setItem(n,e),!0}catch{}}function wt(t,n){try{t.removeItem(n)}catch{}}function nt(t,n){return at(t,Ht,n.toString())}function ot(t){return parseInt(et(t,Ht))||0}const C={local:!0,session:!0},zt={local:new Set,session:new Set};let lt=!1;function De(t){lt=t}let F=typeof window>"u"?{}:window;function $t(t){const n=t+"Storage";try{if(F&&F[n]&&typeof F[n].length=="number")return F[n]}catch{}C[t]=!1}function Dt(t,n){const e=$t(t);if(!e)return;const r=et(e,xt);if(r!==bt){if(r){const a=ot(e);for(let s=0;s<a;s++)wt(e,q+s.toString())}at(e,xt,bt),nt(e,0);return}const o=Math.floor(Date.now()/Bt)-$e,i=a=>{const s=q+a.toString(),l=et(e,s);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&n(u,a))return!0}catch{}wt(e,s)}};let c=ot(e);for(let a=c-1;a>=0;a--)i(a)||(a===c-1?(c--,nt(e,c)):zt[t].add(a))}function Qt(){if(!lt){De(!0);for(const t in C)Dt(t,n=>{const e=n.data,r=n.provider,o=e.prefix,i=S(r,o);if(!st(i,e).length)return!1;const c=e.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,c):c,!0})}}function Qe(t,n){const e=t.lastModifiedCached;if(e&&e>=n)return e===n;if(t.lastModifiedCached=n,e)for(const r in C)Dt(r,o=>{const i=o.data;return o.provider!==t.provider||i.prefix!==t.prefix||i.lastModified===n});return!0}function Ve(t,n){lt||Qt();function e(r){let o;if(!C[r]||!(o=$t(r)))return;const i=zt[r];let c;if(i.size)i.delete(c=Array.from(i).shift());else if(c=ot(o),!nt(o,c+1))return;const a={cached:Math.floor(Date.now()/Bt),provider:t.provider,data:n};return at(o,q+c.toString(),JSON.stringify(a))}n.lastModified&&!Qe(t,n.lastModified)||Object.keys(n.icons).length&&(n.not_found&&(n=Object.assign({},n),delete n.not_found),e("local")||e("session"))}function It(){}function Ue(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Oe(t)}))}function Ze(t,n){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(n).sort():t.iconsToLoad=n,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:e,prefix:r}=t,o=t.iconsToLoad;delete t.iconsToLoad;let i;if(!o||!(i=tt(e)))return;i.prepare(e,r,o).forEach(a=>{Nt(e,a,s=>{if(typeof s!="object")a.icons.forEach(l=>{t.missing.add(l)});else try{const l=st(t,s);if(!l.length)return;const u=t.pendingIcons;u&&l.forEach(f=>{u.delete(f)}),Ve(t,s)}catch(l){console.error(l)}Ue(t)})})}))}const ut=(t,n)=>{const e=Fe(t,!0,Ot()),r=_e(e);if(!r.pending.length){let s=!0;return n&&setTimeout(()=>{s&&n(r.loaded,r.missing,r.pending,It)}),()=>{s=!1}}const o=Object.create(null),i=[];let c,a;return r.pending.forEach(s=>{const{provider:l,prefix:u}=s;if(u===a&&l===c)return;c=l,a=u,i.push(S(l,u));const f=o[l]||(o[l]=Object.create(null));f[u]||(f[u]=[])}),r.pending.forEach(s=>{const{provider:l,prefix:u,name:f}=s,h=S(l,u),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(f)||(g.add(f),o[l][u].push(f))}),i.forEach(s=>{const{provider:l,prefix:u}=s;o[l][u].length&&Ze(s,o[l][u])}),n?Re(n,r,i):It},Ge=t=>new Promise((n,e)=>{const r=typeof t=="string"?_(t,!0):t;if(!r){e(t);return}ut([r||t],o=>{if(o.length&&r){const i=M(r);if(i){n({...E,...i});return}}e(t)})});function Je(t){try{const n=typeof t=="string"?JSON.parse(t):t;if(typeof n.body=="string")return{...n}}catch{}}function Ke(t,n){const e=typeof t=="string"?_(t,!0,!0):null;if(!e){const i=Je(t);return{value:t,data:i}}const r=M(e);if(r!==void 0||!e.prefix)return{value:t,name:e,data:r};const o=ut([e],()=>n(t,e,M(e)));return{value:t,name:e,loading:o}}function K(t){return t.hasAttribute("inline")}let Vt=!1;try{Vt=navigator.vendor.indexOf("Apple")===0}catch{}function We(t,n){switch(n){case"svg":case"bg":case"mask":return n}return n!=="style"&&(Vt||t.indexOf("<a")===-1)?"svg":t.indexOf("currentColor")===-1?"bg":"mask"}const Xe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ye=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function rt(t,n,e){if(n===1)return t;if(e=e||100,typeof t=="number")return Math.ceil(t*n*e)/e;if(typeof t!="string")return t;const r=t.split(Xe);if(r===null||!r.length)return t;const o=[];let i=r.shift(),c=Ye.test(i);for(;;){if(c){const a=parseFloat(i);isNaN(a)?o.push(i):o.push(Math.ceil(a*n*e)/e)}else o.push(i);if(i=r.shift(),i===void 0)return o.join("");c=!c}}const tn=t=>t==="unset"||t==="undefined"||t==="none";function Ut(t,n){const e={...E,...t},r={...Mt,...n},o={left:e.left,top:e.top,width:e.width,height:e.height};let i=e.body;[e,r].forEach(m=>{const y=[],V=m.hFlip,O=m.vFlip;let b=m.rotate;V?O?b+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):O&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let x;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:x=o.height/2+o.top,y.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:x=o.width/2+o.left,y.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}b%2===1&&(o.left!==o.top&&(x=o.left,o.left=o.top,o.top=x),o.width!==o.height&&(x=o.width,o.width=o.height,o.height=x)),y.length&&(i='<g transform="'+y.join(" ")+'">'+i+"</g>")});const c=r.width,a=r.height,s=o.width,l=o.height;let u,f;c===null?(f=a===null?"1em":a==="auto"?l:a,u=rt(f,s/l)):(u=c==="auto"?s:c,f=a===null?rt(u,l/s):a==="auto"?l:a);const h={},g=(m,y)=>{tn(y)||(h[m]=y.toString())};return g("width",u),g("height",f),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+s.toString()+" "+l.toString(),{attributes:h,body:i}}const en=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let $=en();function nn(t){$=t}function on(){return $}function rn(t,n){const e=Q(t);if(!e)return 0;let r;if(!e.maxURL)r=0;else{let o=0;e.resources.forEach(c=>{o=Math.max(o,c.length)});const i=n+".json?icons=";r=e.maxURL-o-e.path.length-i.length}return r}function sn(t){return t===404}const cn=(t,n,e)=>{const r=[],o=rn(t,n),i="icons";let c={type:i,provider:t,prefix:n,icons:[]},a=0;return e.forEach((s,l)=>{a+=s.length+1,a>=o&&l>0&&(r.push(c),c={type:i,provider:t,prefix:n,icons:[]},a=s.length),c.icons.push(s)}),r.push(c),r};function an(t){if(typeof t=="string"){const n=Q(t);if(n)return n.path}return"/"}const ln=(t,n,e)=>{if(!$){e("abort",424);return}let r=an(n.provider);switch(n.type){case"icons":{const i=n.prefix,a=n.icons.join(","),s=new URLSearchParams({icons:a});r+=i+".json?"+s.toString();break}case"custom":{const i=n.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:e("abort",400);return}let o=503;$(t+r).then(i=>{const c=i.status;if(c!==200){setTimeout(()=>{e(sn(c)?"abort":"next",c)});return}return o=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?e("abort",i):e("next",o)});return}setTimeout(()=>{e("success",i)})}).catch(()=>{e("next",o)})},un={prepare:cn,send:ln};function St(t,n){switch(t){case"local":case"session":C[t]=n;break;case"all":for(const e in C)C[e]=n;break}}const W="data-style";let Zt="";function fn(t){Zt=t}function vt(t,n){let e=Array.from(t.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(W));e||(e=document.createElement("style"),e.setAttribute(W,W),t.appendChild(e)),e.textContent=":host{display:inline-block;vertical-align:"+(n?"-0.125em":"0")+"}span,svg{display:block}"+Zt}function Gt(){gt("",un),Ot(!0);let t;try{t=window}catch{}if(t){if(Qt(),t.IconifyPreload!==void 0){const e=t.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!pt(o))&&console.error(r)}catch{console.error(r)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(const r in e){const o="IconifyProviders["+r+"] is invalid.";try{const i=e[r];if(typeof i!="object"||!i||i.resources===void 0)continue;mt(r,i)||console.error(o)}catch{console.error(o)}}}}return{enableCache:e=>St(e,!0),disableCache:e=>St(e,!1),iconExists:qe,getIcon:Ee,listIcons:Me,addIcon:Lt,addCollection:pt,calculateSize:rt,buildIcon:Ut,loadIcons:ut,loadIcon:Ge,addAPIProvider:mt,appendCustomStyle:fn,_api:{getAPIConfig:Q,setAPIModule:gt,sendAPIQuery:Nt,setFetch:nn,getFetch:on,listAPIProviders:Be}}}function Jt(t,n){let e=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in n)e+=" "+r+'="'+n[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+e+">"+t+"</svg>"}function dn(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function hn(t){return"data:image/svg+xml,"+dn(t)}function pn(t){return'url("'+hn(t)+'")'}const it={"background-color":"currentColor"},Kt={"background-color":"transparent"},Ct={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Tt={"-webkit-mask":it,mask:it,background:Kt};for(const t in Tt){const n=Tt[t];for(const e in Ct)n[t+"-"+e]=Ct[e]}function At(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}function gn(t,n,e){const r=document.createElement("span");let o=t.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const i=t.attributes,c=Jt(o,{...i,width:n.width+"",height:n.height+""}),a=pn(c),s=r.style,l={"--svg":a,width:At(i.width),height:At(i.height),...e?it:Kt};for(const u in l)s.setProperty(u,l[u]);return r}let j;function mn(){try{j=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{j=null}}function yn(t){return j===void 0&&mn(),j?j.createHTML(t):t}function bn(t){const n=document.createElement("span"),e=t.attributes;let r="";e.width||(r="width: inherit;"),e.height||(r+="height: inherit;"),r&&(e.style=r);const o=Jt(t.body,e);return n.innerHTML=yn(o),n.firstChild}function kt(t,n){const e=n.icon.data,r=n.customisations,o=Ut(e,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const i=n.renderedMode;let c;switch(i){case"svg":c=bn(o);break;default:c=gn(o,{...E,...e},i==="mask")}const a=Array.from(t.childNodes).find(s=>{const l=s.tagName&&s.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?c.tagName==="SPAN"&&a.tagName===c.tagName?a.setAttribute("style",c.getAttribute("style")):t.replaceChild(c,a):t.appendChild(c)}function jt(t,n,e){const r=e&&(e.rendered?e:e.lastRender);return{rendered:!1,inline:n,icon:t,lastRender:r}}function xn(t="iconify-icon"){let n,e;try{n=window.customElements,e=window.HTMLElement}catch{return}if(!n||!e)return;const r=n.get(t);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],i=class extends e{constructor(){super();R(this,"_shadowRoot");R(this,"_state");R(this,"_checkQueued",!1);const s=this._shadowRoot=this.attachShadow({mode:"open"}),l=K(this);vt(s,l),this._state=jt({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(s){if(s==="inline"){const l=K(this),u=this._state;l!==u.inline&&(u.inline=l,vt(this._shadowRoot,l))}else this._queueCheck()}get icon(){const s=this.getAttribute("icon");if(s&&s.slice(0,1)==="{")try{return JSON.parse(s)}catch{}return s}set icon(s){typeof s=="object"&&(s=JSON.stringify(s)),this.setAttribute("icon",s)}get inline(){return K(this)}set inline(s){s?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const s=this._state;if(s.rendered){const l=this._shadowRoot;if(s.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}kt(l,s)}}get status(){const s=this._state;return s.rendered?"rendered":s.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const s=this._state,l=this.getAttribute("icon");if(l!==s.icon.value){this._iconChanged(l);return}if(!s.rendered)return;const u=this.getAttribute("mode"),f=dt(this);(s.attrMode!==u||ve(s.customisations,f))&&this._renderIcon(s.icon,f,u)}_iconChanged(s){const l=Ke(s,(u,f,h)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==u)return;const m={value:u,name:f,data:h};m.data?this._gotIconData(m):g.icon=m});l.data?this._gotIconData(l):this._state=jt(l,this._state.inline,this._state)}_gotIconData(s){this._checkQueued=!1,this._renderIcon(s,dt(this),this.getAttribute("mode"))}_renderIcon(s,l,u){const f=We(s.data.body,u),h=this._state.inline;kt(this._shadowRoot,this._state={rendered:!0,icon:s,inline:h,customisations:l,attrMode:u,renderedMode:f})}};o.forEach(a=>{a in i.prototype||Object.defineProperty(i.prototype,a,{get:function(){return this.getAttribute(a)},set:function(s){s!==null?this.setAttribute(a,s):this.removeAttribute(a)}})});const c=Gt();for(const a in c)i[a]=i.prototype[a]=c[a];return n.define(t,i),i}xn()||Gt();const wn={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},In={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Wt({session:t,locale:n,size:e}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(s=>s.section==="sessionManager"&&!["/sessionManager"].includes(s.id)).filter(s=>{var l;return!!((s==null?void 0:s.role)||[]).includes(((l=t==null?void 0:t.user)==null?void 0:l.role)||"guest")}).map(s=>{const l=((r==null?void 0:r.componentMountPoints)||[]).find(u=>s.component===u.name);return{...s,component:l}}),i=ee.useRef(null),c=ne({open:!1}),a=oe((s=!c.open)=>{c.open=s});return o.length===0||!(t!=null&&t.user)?null:p.jsxs(p.Fragment,{children:[p.jsx(re,{size:"medium",ref:i,onClick:()=>a(),children:p.jsx(ft,{icon:wn,fontSize:e,style:{transform:"scale(1.08)"}})}),p.jsx(ie,{open:c.open,onClose:()=>a(!1),anchorEl:i.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:s})=>p.jsx(se,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:p.jsx(ce,{...s,timeout:350,children:p.jsxs(ae,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:I.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${I.gray6}, 0px 0px 0px 1px ${I.gray6}`},children:[p.jsx(le,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u;return p.jsx(ue,{disablePadding:!0,children:p.jsxs(fe,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:I.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?p.jsx(de,{component:"img",src:`${he}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):p.jsx(ft,{fontSize:50,icon:l.icon||In,color:I.textSubtitle}),p.jsx(pe,{sx:{fontSize:"12px",color:I.textBase,textAlign:"center",lineHeight:"normal"},children:ge(l.title,n)})]})},l.id)})}),p.jsx(me,{session:t,children:p.jsx(ye,{variant:"outlined",fullWidth:!0,href:be,sx:{mt:1,borderRadius:2,color:I.textBase,borderColor:I.lineBorderStrong,"&:hover":{color:I.primaryBase,borderColor:I.primaryBase}},children:n==="zh"?"管理":"Manage"})})]})})})})]})}Wt.propTypes={session:Z.object.isRequired,locale:Z.string,size:Z.number};Wt.defaultProps={locale:"en",size:24};export{Wt as S};