@abtnode/blocklet-services 1.17.8-beta-20260119-034126-467341b7 → 1.17.8-beta-20260121-102603-f9d0176f

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 (264) hide show
  1. package/dist/assets/{AdapterDayjs-CYW0YvmK.js → AdapterDayjs-QqQc9YbA.js} +1 -1
  2. package/dist/assets/{Google-DKRt92nm.js → Google-PffSpBc2.js} +1 -1
  3. package/dist/assets/{LottiePlayer.modern-CeQuigIa.js → LottiePlayer.modern-CE8erevJ.js} +1 -1
  4. package/dist/assets/access-control-B6JglGtO.js +14 -0
  5. package/dist/assets/actions-Do5Z9cxZ.js +64 -0
  6. package/dist/assets/{add-component-core-nc1ps0ni.js → add-component-core-CLOpD7CB.js} +21 -21
  7. package/dist/assets/add-resource-ipDE-D6W.js +1 -0
  8. package/dist/assets/{addon-DfWedLEC.js → addon-CrVdMlFe.js} +1 -1
  9. package/dist/assets/advanced-C3qjZMWH.js +14 -0
  10. package/dist/assets/{aigne-6nMSoyeQ.js → aigne-CeD5Xo7t.js} +1 -1
  11. package/dist/assets/api-BMcHDEnt.js +1 -0
  12. package/dist/assets/appearance-BJuIABu8.js +1 -0
  13. package/dist/assets/{ar-DOhYGTlW.js → ar-xXK-6slW.js} +1 -1
  14. package/dist/assets/audit-logs-DxVzMUJK.js +35 -0
  15. package/dist/assets/authorize-BxQgoA5F.js +1 -0
  16. package/dist/assets/{base-chart-DcZV4ZCI.js → base-chart-CQOyckBN.js} +1 -1
  17. package/dist/assets/{base32-7iZvvdX8.js → base32-CyUpiYTu.js} +1 -1
  18. package/dist/assets/bind-account-D5gBazop.js +1 -0
  19. package/dist/assets/branding-CDPvtKJm.js +40 -0
  20. package/dist/assets/{branding-CwSyd5WC.js → branding-CtbvPvdK.js} +3 -3
  21. package/dist/assets/branding-Dv3-0Q39.js +1 -0
  22. package/dist/assets/bundle-avatar-2ugE80w1.js +1 -0
  23. package/dist/assets/button-d8gvZuHP.js +1 -0
  24. package/dist/assets/{click-to-copy-BgIYUMoo.js → click-to-copy-CgakrWoh.js} +1 -1
  25. package/dist/assets/{cloneDeep-YxES7wNt.js → cloneDeep-q2Jbqwkh.js} +1 -1
  26. package/dist/assets/complete-B_lyTPVv.js +39 -0
  27. package/dist/assets/{component-CuKviNC8.js → component-pjnMydek.js} +37 -37
  28. package/dist/assets/config-BcCR6bUQ.js +1 -0
  29. package/dist/assets/config-BsWCoWa6.js +32 -0
  30. package/dist/assets/{config-D1OcHGlN.js → config-CyDF6KG9.js} +6 -6
  31. package/dist/assets/{config-navigation-hDihVsjx.js → config-navigation-B36NPLt0.js} +11 -11
  32. package/dist/assets/{config-space-DfstlHnF.js → config-space-DUkjNtdL.js} +1 -1
  33. package/dist/assets/{confirm-CdVn5WdC.js → confirm-CoDiNrSj.js} +1 -1
  34. package/dist/assets/{connect-CT2vMz6l.js → connect--GxmDNr3.js} +3 -3
  35. package/dist/assets/{connect-Dy0Y8HRB.js → connect-SOuN9k8I.js} +1 -1
  36. package/dist/assets/connect-ULEL84iL.js +1 -0
  37. package/dist/assets/connect-to-DnBUF-KE.js +1 -0
  38. package/dist/assets/{create-passport-svg-hldNORaB.js → create-passport-svg-BSRyjG0k.js} +1 -1
  39. package/dist/assets/{createClass-CgfWUrk8.js → createClass-DKvdNmc_.js} +1 -1
  40. package/dist/assets/dashboard-CkDdshHQ.js +93 -0
  41. package/dist/assets/{de-CtKPdGk6.js → de-CzlQlDUl.js} +1 -1
  42. package/dist/assets/{delete-confirm-CkiUXocp.js → delete-confirm-Cq9MJasT.js} +1 -1
  43. package/dist/assets/{did-address-CG36eCOx.js → did-address-CtvTDc_I.js} +1 -1
  44. package/dist/assets/{domain-CDTeLbkZ.js → domain-BOIdkJ_V.js} +1 -1
  45. package/dist/assets/domain-action-card-DuiLZ6sE.js +28 -0
  46. package/dist/assets/domains-C5GLc_A-.js +1 -0
  47. package/dist/assets/email-DN8lH7fV.js +17 -0
  48. package/dist/assets/engine-Crd5Z3lP.js +1 -0
  49. package/dist/assets/{es-BSYtSZPg.js → es-BpsyeJfJ.js} +1 -1
  50. package/dist/assets/exchange-passport-BvS_8Ud6.js +1 -0
  51. package/dist/assets/{fallback-D-IHOW-7.js → fallback-CuXkR699.js} +1 -1
  52. package/dist/assets/{form-Co-tgocU.js → form-CZjONW3r.js} +3 -3
  53. package/dist/assets/{form-text-input-CPLafaTk.js → form-text-input-BT3t62-a.js} +1 -1
  54. package/dist/assets/{fr-C35fi7h9.js → fr-BawgvFA1.js} +1 -1
  55. package/dist/assets/{fuel-BFx1ShM2.js → fuel-dijAR437.js} +1 -1
  56. package/dist/assets/gen-access-key-DaJCt-T5.js +1 -0
  57. package/dist/assets/gen-simple-access-key-DLZy8UKi.js +1 -0
  58. package/dist/assets/get-safe-url-czY77v8f.js +1 -0
  59. package/dist/assets/hi-ClGNxnSL.js +5 -0
  60. package/dist/assets/home-ChU7yi5l.js +1 -0
  61. package/dist/assets/{id-DoVb0JYr.js → id-_HQ0of3E.js} +1 -1
  62. package/dist/assets/{iframe-DUzp97tk.js → iframe-CYVXxx1r.js} +1 -1
  63. package/dist/assets/index-5RRpshJe.js +200 -0
  64. package/dist/assets/index-5Sys1Zsb.js +6 -0
  65. package/dist/assets/{index-Di2nSesc.js → index-B4A3W4qJ.js} +1 -1
  66. package/dist/assets/index-B4EOqUNT.js +1 -0
  67. package/dist/assets/{index-D1Fa760B.js → index-B5VPb4FA.js} +1 -1
  68. package/dist/assets/{index-C_kNXHsF.js → index-B9YNNXOw.js} +1 -1
  69. package/dist/assets/index-BDSBuO5S.js +7 -0
  70. package/dist/assets/{index-2M4w6J9r.js → index-BOoRVhLj.js} +3 -3
  71. package/dist/assets/{index-Bo9KtpTY.js → index-BVTsYhIX.js} +1 -1
  72. package/dist/assets/index-Boc2cNQ7.js +150 -0
  73. package/dist/assets/{index-D6pCyJv8.js → index-C2O2gJSR.js} +1 -1
  74. package/dist/assets/{index-8RHrVCC6.js → index-C3UXSk-k.js} +1 -1
  75. package/dist/assets/index-C6vJzTmT.js +81 -0
  76. package/dist/assets/index-CD7hq5dy.js +124 -0
  77. package/dist/assets/{index-3H6a5edM.js → index-CNlJloMN.js} +1 -1
  78. package/dist/assets/{index-D3BuekEe.js → index-CVuESID5.js} +5 -5
  79. package/dist/assets/{index-CEJb82tA.js → index-CZ-qZTKi.js} +1 -1
  80. package/dist/assets/{index-VKjWmvRV.js → index-Ci7zZ36D.js} +1 -1
  81. package/dist/assets/{index-CfvGuvbD.js → index-D7Er4cge.js} +1 -1
  82. package/dist/assets/{index-C1fKsLzf.js → index-D8oCzSQW.js} +1 -1
  83. package/dist/assets/{index-BUhEyicQ.js → index-DF1j89BT.js} +1 -1
  84. package/dist/assets/{index-DH4rC-7M.js → index-DGZbt7_m.js} +1 -1
  85. package/dist/assets/index-DKeuwD_Y.js +242 -0
  86. package/dist/assets/{index-DFUM0Pvk.js → index-Dn9eNAe6.js} +1 -1
  87. package/dist/assets/index-DswHt4-F.js +88 -0
  88. package/dist/assets/{index-DqcciDRh.js → index-Dvc-Bpkc.js} +2 -2
  89. package/dist/assets/index-NHiSMvgy.js +120 -0
  90. package/dist/assets/{index-Cx0E03Bs.js → index-WzGP4BGm.js} +1 -1
  91. package/dist/assets/{index-CqCXPf7W.js → index-Zxy2t-7f.js} +1 -1
  92. package/dist/assets/index-iOa1BVMr.js +280 -0
  93. package/dist/assets/index-s8xAfo-W.js +1 -0
  94. package/dist/assets/index-tRQj1y79.js +6 -0
  95. package/dist/assets/{index-ZzcJ7eKO.js → index-uUS1eXYF.js} +1 -1
  96. package/dist/assets/index-yoaLEniz.js +832 -0
  97. package/dist/assets/info-outline-rounded-DovRYvXo.js +1 -0
  98. package/dist/assets/{invitation-BP8hOEFv.js → invitation-DAWt0g1f.js} +3 -3
  99. package/dist/assets/{invitations-C8aZLxdl.js → invitations-B18y415k.js} +2 -2
  100. package/dist/assets/invite-DNSyQ-zG.js +1 -0
  101. package/dist/assets/issue-passport-Dd43b9Se.js +1 -0
  102. package/dist/assets/item-Cr70mAvV.js +1 -0
  103. package/dist/assets/{ja-DZPUwZ9l.js → ja-LErFaY57.js} +1 -1
  104. package/dist/assets/{ko-q4i4r9g6.js → ko-D4ub28je.js} +1 -1
  105. package/dist/assets/{landing-page-JLA-ZD1t.js → landing-page-CZoTtLnc.js} +1 -1
  106. package/dist/assets/layout-U4Obhm5w.js +29 -0
  107. package/dist/assets/list-BD3g0v2E.js +2 -0
  108. package/dist/assets/{list-3MUy-8Ol.js → list-D-9AeBju.js} +3 -3
  109. package/dist/assets/localization-ByZI4mSj.js +1 -0
  110. package/dist/assets/{log-Bq445Z1e.js → log-BWxaKOTA.js} +1 -1
  111. package/dist/assets/logger-B962sOsB.js +1 -0
  112. package/dist/assets/login-BWZaWrBW.js +1 -0
  113. package/dist/assets/login-method-item-aEisznLn.js +1 -0
  114. package/dist/assets/{login-oauth-callback-Bext19kc.js → login-oauth-callback-CB-osgdG.js} +1 -1
  115. package/dist/assets/{logo-uploader-CyZuvhwV.js → logo-uploader-DOPycN59.js} +1 -1
  116. package/dist/assets/{lost-passport-BiYg3QQI.js → lost-passport-H1fCptmJ.js} +2 -2
  117. package/dist/assets/metadata-DftwYKum.js +55 -0
  118. package/dist/assets/{nav-menu-DSdXRbfg.js → nav-menu-D7Sf6VZj.js} +1 -1
  119. package/dist/assets/{omit-Dq0FLBY8.js → omit-vVhnMpHQ.js} +1 -1
  120. package/dist/assets/{open-window-Dyu79ome.js → open-window-By98Pw1o.js} +1 -1
  121. package/dist/assets/{over-due-invoice-payment-DzUsy6q0.js → over-due-invoice-payment-DeFNS-Us.js} +1 -1
  122. package/dist/assets/overview-DEkktSML.js +116 -0
  123. package/dist/assets/passport-BxMVp3TG.js +1 -0
  124. package/dist/assets/passport-item-CIv8Q8Ng.js +1 -0
  125. package/dist/assets/{permission-CvrrGfG6.js → permission-B22pCnUb.js} +1 -1
  126. package/dist/assets/preferences-BY_s4EkY.js +1 -0
  127. package/dist/assets/profile-embed-DUKyv_oX.js +1 -0
  128. package/dist/assets/provider-icon-DbnLu_85.js +1 -0
  129. package/dist/assets/pt-BU7pvSz6.js +5 -0
  130. package/dist/assets/{publish-resource-CMuHIOUf.js → publish-resource-Be5Gs98x.js} +1 -1
  131. package/dist/assets/{react-beautiful-dnd.esm-CWJ5I9Zv.js → react-beautiful-dnd.esm-D7zp9L4b.js} +1 -1
  132. package/dist/assets/ru-CtjyU-qF.js +5 -0
  133. package/dist/assets/{runtime-B_ZLP4FF.js → runtime-MjoLSEeg.js} +1 -1
  134. package/dist/assets/{sanitize-Bzl4lTuH.js → sanitize-BHeUjEo7.js} +1 -1
  135. package/dist/assets/sdk-Dy-R7tw7.js +1 -0
  136. package/dist/assets/security-BtD9TnGk.js +22 -0
  137. package/dist/assets/session-UEzmH-IS.js +1 -0
  138. package/dist/assets/setup-Bts0WUxD.js +24 -0
  139. package/dist/assets/simple-select-C6gRUbia.js +1 -0
  140. package/dist/assets/{spaces-ix8u0ZiI.js → spaces-DtMVp8Fn.js} +1 -1
  141. package/dist/assets/start-Dabk9waT.js +187 -0
  142. package/dist/assets/{starting-progress-CWp5fTY0.js → starting-progress-Ds2lnMge.js} +1 -1
  143. package/dist/assets/{status-Dn_LKaNp.js → status-CicPnfGJ.js} +1 -1
  144. package/dist/assets/{step-actions-DIZRcnXf.js → step-actions-CnJCnymc.js} +1 -1
  145. package/dist/assets/{studio-CVIa8-XY.js → studio-D7qZJqJ7.js} +1 -1
  146. package/dist/assets/{switch-control-BRjXGc1d.js → switch-control-C5gj6NIz.js} +1 -1
  147. package/dist/assets/{switch-BbyTGEOo.js → switch-qh9YpwMi.js} +1 -1
  148. package/dist/assets/{table-tips-Dvmdodc5.js → table-tips-BSl1oNMX.js} +1 -1
  149. package/dist/assets/team-Djzt5BWc.js +146 -0
  150. package/dist/assets/th-C0DkNnMF.js +5 -0
  151. package/dist/assets/theme-mode-toggle-Jvn37gNg.js +1 -0
  152. package/dist/assets/traffic-BtuX1qMz.js +1 -0
  153. package/dist/assets/transfer-UdrQjD9F.js +16 -0
  154. package/dist/assets/unsubscribe-Bj2S8OkH.js +1 -0
  155. package/dist/assets/{use-app-logo-IRizt64R.js → use-app-logo-DyU2iSXF.js} +1 -1
  156. package/dist/assets/{use-blocklet-logo-Cf1j7pQz.js → use-blocklet-logo-ys-h-CV_.js} +1 -1
  157. package/dist/assets/{use-window-close-Dpj5UcYT.js → use-window-close-CT9brY7I.js} +1 -1
  158. package/dist/assets/{useAsync-CkKfnulP.js → useAsync-DbIyJl2v.js} +1 -1
  159. package/dist/assets/{useAsync-DfiOQMQ_.js → useAsync-WuOY1bFS.js} +1 -1
  160. package/dist/assets/{useAsyncRetry-C4R9ufi-.js → useAsyncRetry-cAGDIsw4.js} +1 -1
  161. package/dist/assets/{useLocalStorage-BQfIniHX.js → useLocalStorage-D8kgfBAn.js} +1 -1
  162. package/dist/assets/{user-center-6K47tx8j.js → user-center-DLgnUI1s.js} +5 -5
  163. package/dist/assets/{user-follower-BwzTutxU.js → user-follower-BbQfOSyh.js} +4 -4
  164. package/dist/assets/util-BCpVIbwL.js +1 -0
  165. package/dist/assets/util-tg9hB6_c.js +1 -0
  166. package/dist/assets/{vendor-arcblock-Dll6qxMT.js → vendor-arcblock-Xw2zMy0D.js} +1 -1
  167. package/dist/assets/{vendor-hooks-DAZ1H6Va.js → vendor-hooks-164oA5kM.js} +1 -1
  168. package/dist/assets/vendor-utils-BbcnEeJI.js +23 -0
  169. package/dist/assets/{vendor-ux-CLT2i3Pv.js → vendor-ux-BGqHwkOM.js} +10 -10
  170. package/dist/assets/vi-nXB9zTif.js +5 -0
  171. package/dist/assets/wait-connect-BED_xYYA.js +1 -0
  172. package/dist/assets/wallet-hidden-topbar-dnCLvPpW.js +68 -0
  173. package/dist/assets/wizard-C6DvqdjM.js +8 -0
  174. package/dist/assets/wizard-components-1u7l8zuE.js +52 -0
  175. package/dist/assets/wrap-locale-C2lxMNe7.js +1 -0
  176. package/dist/assets/{zh-G2I44gfs.js → zh-DK-_Edsp.js} +1 -1
  177. package/dist/assets/zh-QEwKQjt8.js +1 -0
  178. package/dist/assets/{zh-tw-C4Juvs-i.js → zh-tw-Us2SjBNr.js} +1 -1
  179. package/dist/index.html +1 -1
  180. package/package.json +24 -24
  181. package/dist/assets/access-control-RI6LQbSm.js +0 -14
  182. package/dist/assets/actions-BlWED76c.js +0 -64
  183. package/dist/assets/add-resource-BVOdOQSW.js +0 -1
  184. package/dist/assets/advanced-CuKHqbLO.js +0 -14
  185. package/dist/assets/api-B8JXuhVp.js +0 -1
  186. package/dist/assets/appearance-C9TkbSjV.js +0 -1
  187. package/dist/assets/audit-logs-DKGke9hI.js +0 -35
  188. package/dist/assets/authorize-DkSqywe8.js +0 -1
  189. package/dist/assets/bind-account-DOwM9Nhe.js +0 -1
  190. package/dist/assets/branding-Cak2s8bn.js +0 -1
  191. package/dist/assets/branding-lcfxmmPp.js +0 -40
  192. package/dist/assets/bundle-avatar-DwiOyeMO.js +0 -1
  193. package/dist/assets/button-uUU4Wycr.js +0 -1
  194. package/dist/assets/complete-Udiv_yFp.js +0 -39
  195. package/dist/assets/config-6IwEgT3b.js +0 -32
  196. package/dist/assets/config-CJwxv2uK.js +0 -1
  197. package/dist/assets/connect-DA7RO2yv.js +0 -1
  198. package/dist/assets/connect-to-CQMUbQkH.js +0 -1
  199. package/dist/assets/dashboard-BvI3ii8Z.js +0 -93
  200. package/dist/assets/domain-action-card-kMPYS2Nj.js +0 -28
  201. package/dist/assets/domains-TI6o1CvX.js +0 -1
  202. package/dist/assets/email-DHRHueET.js +0 -17
  203. package/dist/assets/engine-D_fEFx9_.js +0 -1
  204. package/dist/assets/exchange-passport-Cc872mjQ.js +0 -1
  205. package/dist/assets/gen-access-key-DrgLVRbm.js +0 -1
  206. package/dist/assets/gen-simple-access-key-B24d6k7g.js +0 -1
  207. package/dist/assets/get-safe-url-beob4f2C.js +0 -1
  208. package/dist/assets/hi-5fpYJkiW.js +0 -5
  209. package/dist/assets/home-Dw18IODa.js +0 -1
  210. package/dist/assets/index--WQuhwJL.js +0 -6
  211. package/dist/assets/index-B-8044Gs.js +0 -280
  212. package/dist/assets/index-B6l4xGy5.js +0 -7
  213. package/dist/assets/index-BOPR4Iyc.js +0 -88
  214. package/dist/assets/index-BeunkI-Z.js +0 -242
  215. package/dist/assets/index-Bpic07NM.js +0 -200
  216. package/dist/assets/index-C4ZzROeE.js +0 -120
  217. package/dist/assets/index-CXp5SI_f.js +0 -832
  218. package/dist/assets/index-DKzBOJCu.js +0 -81
  219. package/dist/assets/index-DL0wTcgx.js +0 -1
  220. package/dist/assets/index-DWHFecw2.js +0 -150
  221. package/dist/assets/index-DcW3jqfL.js +0 -6
  222. package/dist/assets/index-Vf51dp11.js +0 -124
  223. package/dist/assets/index-bEFOmVth.js +0 -1
  224. package/dist/assets/info-outline-rounded-DlgANjBB.js +0 -1
  225. package/dist/assets/invite-Cd5zEHFb.js +0 -1
  226. package/dist/assets/issue-passport-D7zqv3Al.js +0 -1
  227. package/dist/assets/item-DNj7ORqk.js +0 -1
  228. package/dist/assets/layout-Cwvm7lmD.js +0 -29
  229. package/dist/assets/list-BSXHuqLM.js +0 -2
  230. package/dist/assets/localization-Dond4H78.js +0 -1
  231. package/dist/assets/logger-CCAAJ2Xo.js +0 -1
  232. package/dist/assets/login-dc2t9Qyo.js +0 -1
  233. package/dist/assets/login-method-item-CyTsqz88.js +0 -1
  234. package/dist/assets/metadata-B2-Ltdko.js +0 -55
  235. package/dist/assets/overview-0TBmi-_i.js +0 -116
  236. package/dist/assets/passport-BhEaZ-sr.js +0 -1
  237. package/dist/assets/passport-item-DHwif94N.js +0 -1
  238. package/dist/assets/preferences-BBSWzZiT.js +0 -1
  239. package/dist/assets/profile-embed-shcOdRUI.js +0 -1
  240. package/dist/assets/provider-icon-DO2PqSth.js +0 -1
  241. package/dist/assets/pt-BFCHl6F1.js +0 -5
  242. package/dist/assets/ru-CSTl62kK.js +0 -5
  243. package/dist/assets/sdk-CktKu_IW.js +0 -1
  244. package/dist/assets/security-DHRU8k0u.js +0 -22
  245. package/dist/assets/session-Bp3LV7zJ.js +0 -1
  246. package/dist/assets/setup-B6-Ei_3X.js +0 -24
  247. package/dist/assets/simple-select-nI-W90c_.js +0 -1
  248. package/dist/assets/start-oRp78RMQ.js +0 -187
  249. package/dist/assets/team-BTz28XqK.js +0 -146
  250. package/dist/assets/th-D75Dlluo.js +0 -5
  251. package/dist/assets/theme-mode-toggle-D3bcd10D.js +0 -1
  252. package/dist/assets/traffic-Cea69sMW.js +0 -1
  253. package/dist/assets/transfer-BydXCVCg.js +0 -16
  254. package/dist/assets/unsubscribe-BjAjx-Fl.js +0 -1
  255. package/dist/assets/util-DkTwHdRu.js +0 -1
  256. package/dist/assets/util-DySzCymV.js +0 -1
  257. package/dist/assets/vendor-utils-BzQg432x.js +0 -23
  258. package/dist/assets/vi-D1mKYrmb.js +0 -5
  259. package/dist/assets/wait-connect-q0_7mz_u.js +0 -1
  260. package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +0 -68
  261. package/dist/assets/wizard-C5Kl-g70.js +0 -8
  262. package/dist/assets/wizard-components-DQrlaeeW.js +0 -52
  263. package/dist/assets/wrap-locale-5DJTJTXP.js +0 -1
  264. package/dist/assets/zh-CJ9vCpmv.js +0 -1
@@ -1,64 +0,0 @@
1
- import{j as n,b4 as G,A as Z,b3 as J,al as K,aT as w,Z as N,b1 as ee,a0 as te,R as z,a7 as H,S as ne,X as i}from"./vendor-mui-core-CV-FnYH_.js";import{r as T}from"./vendor-react-DX7tU9aY.js";import{n as L,ad as P}from"./vendor-utils-BzQg432x.js";import{aT as Q,aU as q,aV as O,aW as re}from"./index-CXp5SI_f.js";import{Q as _,$ as U,bB as ie,Y as W,b6 as A,a1 as ae}from"./vendor-ux-CLT2i3Pv.js";import{b as u}from"./vendor-hooks-DAZ1H6Va.js";import{d as X}from"./passkey-rounded-_WDHIZVd.js";import{R as oe}from"./login-method-item-CyTsqz88.js";import{C}from"./isEmail-BwGDo3Ws.js";const se={width:24,height:24,body:'<path fill="currentColor" d="M18 11h-2q-.425 0-.713-.288T15 10q0-.425.288-.713T16 9h2V7q0-.425.288-.713T19 6q.425 0 .713.288T20 7v2h2q.425 0 .713.288T23 10q0 .425-.288.713T22 11h-2v2q0 .425-.288.713T19 14q-.425 0-.713-.288T18 13v-2Zm-9 1q-1.65 0-2.825-1.175T5 8q0-1.65 1.175-2.825T9 4q1.65 0 2.825 1.175T13 8q0 1.65-1.175 2.825T9 12Zm-8 6v-.8q0-.85.438-1.563T2.6 14.55q1.55-.775 3.15-1.163T9 13q1.65 0 3.25.388t3.15 1.162q.725.375 1.163 1.088T17 17.2v.8q0 .825-.588 1.413T15 20H3q-.825 0-1.413-.588T1 18Z"/>'},F=6;function Y({ref:g,extraParams:m={},createMode:p="connect",action:y,onSuccess:x=L,onError:j=L}){const{api:v,locale:E,t:a,loginPasskey:D,logoutPasskey:I,passkeyState:e,connectPasskey:$}=Q(),c=p==="register",[h,l]=T.useState(!1),d=window.innerWidth<600,B=u(()=>{e.openDialog=!0,e.error="",e.creatingStatus="",e.verifyingStatus="";const t=e.email;l(t&&c?!C(t):!1)}),S=u(()=>{e.openDialog=!1,e.error="",e.creatingStatus="",e.verifyingStatus="";const t=e.email;l(t&&c?!C(t):!1)}),o=u(async t=>{if(t.preventDefault(),c&&!C(e.email)){l(!0);return}l(!1),e.loading=!0;try{await v.post(`../kyc/email/send?locale=${E}`,{email:e.email}),e.sent=!0,_.success(a("codeSentSuccess"))}catch(r){_.error(r.message),document.getElementById("email-input")?.focus()}finally{e.loading=!1}}),R=u(async(t="")=>{try{e.verifying=!0,e.error="",t||(e.verifyingStatus="");const r=await D({...m,action:y,credentialId:t}),s=U({expireInDays:7});q.remove("connected_did",s),q.remove("connected_pk",s),q.remove("connected_wallet_os",s),e.verifying=!1,r?.sessionToken&&(e.verifyingStatus="succeed",x({...r,encrypted:!1},M=>M))}catch(r){console.error("Failed to verify passkey",r);const s=O(r,a("verifyPasskeyFailed"));e.verifying=!1,e.error=s,e.verifyingStatus="error",await I(),j(new Error(s))}}),k=u(async()=>{if(c&&!C(e.email)){l(!0);return}l(!1),e.creating=!0,e.error="",e.creatingStatus="";try{const t=await $({...m,action:y,purpose:c?"register":"connect",email:c?ie.encode(e.email):""});if(!t){e.error=a("cancelAuth"),e.creatingStatus="error",e.creating=!1,e.verifying=!1,e.verifyingStatus="";return}e.creating=!1,e.openDialog=!1,e.creatingStatus="succeed",p==="connect"?x({...t,encrypted:!1},r=>r):t?.credentialId&&R(t.credentialId)}catch(t){console.error("Failed to create passkey",t),e.creating=!1,e.error=O(t,a("createPasskeyFailed")),e.creatingStatus="error"}}),b=u(async t=>{t&&t.preventDefault(),e.loading=!0;try{await v.post(`../kyc/email/verify?locale=${E}`,{code:e.code}),e.verified=!0,k()}catch(r){_.error(r.message),e.verified=!1,document.getElementById(`code-input-${P(e.code).length-1}`)?.focus()}finally{e.loading=!1}});T.useImperativeHandle(g,()=>({open:B,close:S,handleVerifyCode:b}),[B,S,b]);const f=()=>n.jsxs(n.Fragment,{children:[n.jsx(z,{onClick:S,sx:{color:"text.secondary"},children:a("cancel")}),c&&n.jsxs(z,{variant:"contained",onClick:e.verified?k:e.sent?b:o,disabled:e.verifying||e.creating||!e.email||e.sent&&P(e.code).length!==F,children:[(e.loading||e.creating)&&n.jsx(H,{size:16,sx:{mr:1}}),e.verified?a("createPasskey"):e.sent?a("verifyButton"):a("sendCodeButton")]}),!c&&n.jsx(z,{variant:"contained",color:"primary",onClick:k,disabled:e.loading||e.creating||c&&(!e.email||!e.verified),startIcon:(e.loading||e.creating)&&n.jsx(H,{size:16,sx:{mr:1},color:"inherit"}),children:e.loading||e.creating?a("creatingPasskey"):a("createPasskey")})]});return n.jsxs(ce,{open:e.openDialog,onClose:S,fullWidth:!0,maxWidth:"sm",fullScreen:d,children:[n.jsxs(le,{children:[n.jsx(pe,{children:n.jsx(W,{icon:X,fontSize:24,color:"initial"})}),a("createPasskey")]}),n.jsxs(de,{children:[n.jsx(A,{variant:"body1",children:a("createPasskeyDesc1")}),n.jsx(A,{variant:"body1",children:a("createPasskeyDesc2")}),e.error&&n.jsx(G,{severity:"error",children:e.error}),c&&n.jsxs(fe,{children:[!e.sent&&n.jsx(Z,{type:"email",id:"email-input",size:"medium",placeholder:a("emailPlaceholder"),sx:{width:"100%",".MuiFormHelperText-root":{ml:0}},value:e.email,onChange:t=>{e.email=t.target.value,l(!C(e.email))},disabled:e.loading||e.creating,required:!0,error:h,helperText:h?a("emailInvalid"):""}),e.sent&&!e.verified&&n.jsxs(J,{direction:"column",sx:{justifyContent:"center",alignItems:"center",mb:2},children:[n.jsx(A,{variant:"body2",children:a("codeSentMessage",{email:e.email})}),n.jsx(K,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:2,mt:0},children:Array(F).fill("").map((t,r)=>n.jsx(Z,{value:P(e.code[r])||"",type:"number",margin:"none",onChange:s=>{const M=e.code.split("");M[r]=s.target.value,e.code=M.join(""),s.target.value&&r<5&&document.getElementById(`code-input-${r+1}`)?.focus()},onKeyDown:s=>{s.key==="Backspace"&&!P(e.code[r])&&r>0&&document.getElementById(`code-input-${r-1}`)?.focus()},disabled:e.loading,required:!0,id:`code-input-${r}`,autoComplete:"off",slotProps:{htmlInput:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"}}},`code-input-${r}`))})]})]}),d&&n.jsx(K,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",mt:2},children:f()})]}),!d&&n.jsx(ue,{children:f()})]})}Y.propTypes={extraParams:i.object,createMode:i.string,action:i.string.isRequired,onSuccess:i.func,onError:i.func,ref:i.any.isRequired};const ce=w(N)`
2
- .MuiDialog-paper {
3
- border-radius: 12px;
4
- max-width: 440px;
5
- }
6
- `,le=w(ee)`
7
- text-align: center;
8
- padding: 24px 24px 16px;
9
- font-size: 20px;
10
- font-weight: 600;
11
- `,de=w(te)`
12
- padding: 0 24px;
13
-
14
- .MuiTypography-body1 {
15
- font-size: 14px;
16
- line-height: 1.5;
17
- margin-bottom: 16px;
18
- }
19
-
20
- .MuiTextField-root {
21
- margin-top: 16px;
22
- width: 100%;
23
- }
24
- `,ue=w(ne)`
25
- text-align: center;
26
- padding: 16px 24px 24px;
27
-
28
- .MuiButton-root {
29
- text-transform: none;
30
- font-size: 14px;
31
- border-radius: 6px;
32
- padding: 6px 16px;
33
- }
34
- `,pe=w("div")`
35
- width: 48px;
36
- height: 48px;
37
- margin: 0 auto 16px;
38
- background-color: #f6f8fa;
39
- border-radius: 50%;
40
- display: flex;
41
- align-items: center;
42
- justify-content: center;
43
-
44
- svg {
45
- width: 32px;
46
- height: 32px;
47
- }
48
- `,fe=w.div`
49
- display: flex;
50
- flex-direction: column;
51
- align-items: center;
52
- justify-content: center;
53
- width: 100%;
54
- gap: 24px;
55
-
56
- input[type='number']::-webkit-inner-spin-button,
57
- input[type='number']::-webkit-outer-spin-button {
58
- -webkit-appearance: none;
59
- margin: 0;
60
- }
61
- div.Mui-focused input {
62
- caret-color: ${g=>g.theme.palette.primary.main};
63
- }
64
- `;function V({action:g,onClick:m,title:p,state:y,dense:x=!1,icon:j,...v}){return n.jsx(oe,{...v,icon:y[g]?n.jsx(H,{size:"1em",sx:{color:"inherit","& svg":{transform:"scale(0.75)"}}}):j,iconScale:1,title:p,onClick:m,sx:ae(x?{p:1,backgroundColor:"transparent"}:{},v?.sx)})}V.propTypes={action:i.string.isRequired,onClick:i.func.isRequired,title:i.string.isRequired,state:i.object.isRequired,dense:i.bool,icon:i.any.isRequired};function ge({ref:g=null,action:m,behavior:p="none",onSuccess:y,onError:x,extraParams:j={},createButtonText:v="",createMode:E="register",dense:a=!1,slotProps:D={},sx:I={},mode:e="normal",onClick:$=L,isLatest:c=!1}){const h=T.useRef(""),l=T.useRef(null),{t:d,loginPasskey:B,logoutPasskey:S,passkeyState:o}=Q(),R=u(async(f="")=>{try{o.verifying=!0,o.error="",f||(o.verifyingStatus="");const t=await B({...j,action:m,credentialId:f}),r=U({expireInDays:7});q.remove("connected_did",r),q.remove("connected_pk",r),q.remove("connected_wallet_os",r),o.verifying=!1,t?.sessionToken&&(await y({...t,encrypted:!1},s=>s),o.verifyingStatus="succeed")}catch(t){re.error("Failed to verify passkey",t);const r=O(t,d("verifyPasskeyFailed"),d);o.verifying=!1,o.error=r,o.verifyingStatus="error",await S(),x(new Error(r))}}),k=u(f=>{if(!o.sent)return;f.preventDefault();const t=P(f.clipboardData.getData("text/plain").slice(0,F));if(!/^\d+$/.test(t))return;o.code=t.padEnd(F," ");const r=document.getElementById(`code-input-${t.length}`);r&&r.focus()});T.useEffect(()=>(document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}),[k]);const b=u(()=>{h.current==="verifying"?R():h.current==="creating"&&l.current.open()});return T.useImperativeHandle(g,()=>({click:b})),p==="none"?null:n.jsxs(n.Fragment,{children:[["both","only-existing"].includes(p)?n.jsx(V,{isLatest:c,t:d,action:"verifying",state:o,title:d("usePasskey"),onClick:()=>{h.current="verifying",b(),$()},dense:a,slotProps:D,sx:I,mode:e,icon:n.jsx(W,{icon:X,fontSize:"1em"})}):null,["both","only-new"].includes(p)?n.jsxs(n.Fragment,{children:[n.jsx(V,{t:d,action:"creating",state:o,title:v||d("createPasskey"),onClick:()=>{h.current="creating",b(),$()},dense:a,slotProps:D,sx:I,mode:e,icon:n.jsx(W,{icon:se,fontSize:"1em"})}),n.jsx(Y,{ref:l,action:m,createMode:E,extraParams:j,onSuccess:y,onError:x})]}):null]})}ge.propTypes={action:i.string.isRequired,onSuccess:i.func.isRequired,onError:i.func.isRequired,behavior:i.oneOf(["none","both","only-existing","only-new"]),createButtonText:i.string,createMode:i.string,extraParams:i.object,dense:i.bool,slotProps:i.object,sx:i.oneOfType([i.object,i.array]),mode:i.oneOf(["simple","normal"]),onClick:i.func,ref:i.any,isLatest:i.bool};export{ge as U};
@@ -1 +0,0 @@
1
- import{L as W,j as l}from"./vendor-mui-core-CV-FnYH_.js";import{m as v,r}from"./vendor-react-DX7tU9aY.js";import{z as B,D as L}from"./vendor-utils-BzQg432x.js";import{W as O,aO as A}from"./vendor-ux-CLT2i3Pv.js";import{A as T,S as _}from"./add-component-core-nc1ps0ni.js";import{j as d,b as $,x as F}from"./vendor-hooks-DAZ1H6Va.js";import{x as K,a8 as z}from"./index-CXp5SI_f.js";import"./item-DNj7ORqk.js";import"./index-DBs9Ljax.js";import"./delete-confirm-CkiUXocp.js";import"./click-to-copy-BgIYUMoo.js";import"./confirm-CdVn5WdC.js";import"./session-Bp3LV7zJ.js";import"./get-safe-url-beob4f2C.js";import"./did-address-CG36eCOx.js";import"./wait-connect-q0_7mz_u.js";import"./vendor-arcblock-Dll6qxMT.js";import"./launch-result-message-DJqF-slD.js";import"./page-header-qdK3sAJh.js";import"./engine-D_fEFx9_.js";import"./config-space-DfstlHnF.js";import"./spaces-ix8u0ZiI.js";import"./api-B8JXuhVp.js";import"./required-DnQpCGsD.js";import"./index-C1fKsLzf.js";import"./Google-DKRt92nm.js";import"./cloneDeep-YxES7wNt.js";import"./create-passport-svg-hldNORaB.js";import"./form-wrapper-kWYD3nZz.js";import"./logo-uploader-CyZuvhwV.js";import"./collapse-RMuUWnK3.js";import"./index-Cax1AxL9.js";import"./config-D1OcHGlN.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./section-CZylgxjz.js";import"./form-text-input-CPLafaTk.js";import"./edit.svg-BGhTyO6h.js";import"./index-jIvFgWDS.js";import"./joi-browser.min-CUdv8seQ.js";import"./index-CEJb82tA.js";import"./useLocalStorage-BQfIniHX.js";import"./index-Di2nSesc.js";import"./login-method-item-CyTsqz88.js";import"./passkey-rounded-_WDHIZVd.js";import"./util-DySzCymV.js";import"./use-mobile-DwGMuJlg.js";import"./content-layout-Dlmn5DW6.js";import"./connect-to-CQMUbQkH.js";import"./index-2M4w6J9r.js";import"./index-D29L5UKE.js";import"./index-BojVbZw0.js";import"./index-Bo9KtpTY.js";import"./fallback-D-IHOW-7.js";import"./search-4YYphs0l.js";function Ht(){const{t:u}=O(),{blocklet:h}=K(),{componentDid:s}=v(),w=W(t=>t.breakpoints.down("md")),e=new URL(window.location.href),f=e.searchParams.get("mode")==="dialog",n=e.searchParams.get("resourceType")||"",m=e.searchParams.get("resourceDid")||s,g=e.searchParams.get("store")||"",R=e.searchParams.get("showFromUrl")!=="false",C=e.searchParams.get("showResourcesSwitch")!=="false",S=e.searchParams.get("enableRunBackground")!=="false",b=e.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[y,E]=r.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),[P,D]=r.useState(null),[x,U]=r.useState("");r.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const k=B(o,"/api/store.json"),{data:M}=await L.get(k);return{url:o,name:M.name}}));E(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const j=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const t=z();return a&&t.connect(),()=>{a&&t.isConnected()&&t.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const p=$(t=>{t.data?.event==="resourceDialog.select"&&t.data?.componentDid===s&&(D(t.data.data),U(t.data.storeUrl))});d(()=>{window.addEventListener("message",p)}),F(()=>{window.removeEventListener("message",p)});const c=({inDialog:t=!0}={})=>l.jsx(T,{stores:y,selectedMeta:P,storeUrl:x,resourceType:n,resourceDid:m,mode:"embed",inDialog:t,storageKey:_(`${n}+${m}`),showResourcesSwitch:C,showFromUrl:R,enableRunBackground:S,showCategory:b});return f?l.jsx(A,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&j()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:c()}):c({inDialog:!1})}export{Ht as default};
@@ -1,14 +0,0 @@
1
- import{r as h}from"./vendor-react-DX7tU9aY.js";import{j as e,a7 as Q,al as m,R as Ne,dK as Re,T as F,X as y,bK as Ke,a6 as Me,cn as ze,b4 as Fe,aT as ge,V as $e,b3 as U,A as He,C as Ue,dL as xe,b8 as M,a4 as S,dM as We,an as ce,b6 as de}from"./vendor-mui-core-CV-FnYH_.js";import{W as $,V as Ve,w as he,o as Ye,$ as Ge,c0 as Je,B as Ze,c1 as Qe,c as Xe,O as me,F as be,a5 as ye,G as B,c2 as et}from"./index-CXp5SI_f.js";import{w as X,P as tt}from"./permission-CvrrGfG6.js";import{W as Y,b5 as A,Q as O,aO as je,d4 as N,d5 as nt,bX as W,o as rt,d6 as re,n as Z,p as te,d7 as st,d8 as at,d9 as ot,Z as fe,b4 as it}from"./vendor-ux-CLT2i3Pv.js";import{t as ke}from"./vendor-hooks-DAZ1H6Va.js";import{C as ae}from"./confirm-CdVn5WdC.js";import{f as V}from"./index-DBs9Ljax.js";import{u as lt}from"./useSetState-CUbypYGT.js";import{u as ve}from"./session-Bp3LV7zJ.js";import{S as v}from"./section-CZylgxjz.js";import{C as ct}from"./click-to-copy-BgIYUMoo.js";import{b as Se}from"./team-BTz28XqK.js";import{w as ne,ae as dt}from"./vendor-utils-BzQg432x.js";import{v as mt}from"./index-Di2nSesc.js";import{B as ft}from"./joi-browser.min-eEVeW7LC.js";import{W as ut}from"./did-address-CG36eCOx.js";import{V as pt}from"./status-Dn_LKaNp.js";import{F as ue}from"./form-text-input-CPLafaTk.js";import"./vendor-arcblock-Dll6qxMT.js";import"./required-DnQpCGsD.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-joIVZ1nl.js";import"./theme-mode-toggle-D3bcd10D.js";import"./use-mobile-CyUZDIaX.js";import"./index-CEJb82tA.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./use-app-logo-IRizt64R.js";import"./joi-browser.min-CUdv8seQ.js";import"./omit-Dq0FLBY8.js";import"./index-CqCXPf7W.js";import"./form-wrapper-kWYD3nZz.js";import"./edit.svg-BGhTyO6h.js";const gt=localStorage.getItem("enableDebug")==="true";function xt({teamDid:i,size:n="small",...l}){const{t:r}=Y(),{api:a}=$(),[o,s]=h.useState(!1),[u,g]=h.useState(null),p=()=>{s(!1),g(null)},f=async()=>{try{s(!0);const j=await a.clearCache({input:{teamDid:i}});O.success(r("blocklet.config.clearCache.success",{count:j.removed?.length||0}))}catch(j){O.error(V(j))}finally{s(!1),g(null)}},x={title:r("blocklet.config.clearCache.title"),description:r("blocklet.config.clearCache.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:f,onCancel:p};return e.jsxs("div",{...l,children:[e.jsxs(A,{onClick:()=>g(x),color:"error",variant:"outlined",size:n,children:[o?e.jsx(Q,{size:16,style:{marginRight:5}}):null,r("blocklet.config.clearCache.action")]}),u&&e.jsx(ae,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}function Ce({onChange:i=()=>{},disabled:n=!1,loading:l=!1,inService:r=!1}){const{t:a}=Y(),{api:o,session:s}=ve(),{blocklet:u}=Ve(),[g,p]=lt({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>p({isConnectOpen:!1}),x=()=>{if(Ye.isInProgress(u.status)){O.error(a("blocklet.error.isInProgress"));return}p({confirmDialogOpen:!0})};return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:a("blocklet.config.migrate.button"),desc:a("blocklet.config.migrate.description"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(Ne,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:n||l,onClick:x,children:[e.jsx(Re,{style:{fontSize:"1.3em",marginRight:4}}),a("blocklet.config.migrate.button")]})})}),e.jsxs(e.Fragment,{children:[g.isConnectOpen&&e.jsx(he,{popup:!0,open:g.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:o.get,checkTimeout:300*1e3,onSuccess:()=>{i(),r&&s.logout(),f()},extraParams:{appDid:u.appDid},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:f}),g.confirmDialogOpen&&e.jsx(ae,{title:e.jsx(F,{sx:{fontSize:"20px",fontWeight:"500"},children:a("blocklet.config.migrate.title")}),description:e.jsx(F,{sx:{fontSize:"14px",color:"#9397A1"},children:a("blocklet.config.migrate.confirm")}),confirm:a("common.confirm"),cancel:a("common.cancel"),onConfirm:()=>p({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>p({confirmDialogOpen:!1})})]})]})}Ce.propTypes={onChange:y.func,disabled:y.bool,loading:y.bool,inService:y.bool};function we({onCancel:i,onSuccess:n,onError:l=()=>{}}){const{api:r}=h.useContext(Ge),[a,o]=h.useState(!1),{t:s,locale:u}=Y(),[g,p]=h.useState(""),[f,x]=h.useState(!1),[j,C]=h.useState(0),[w,k]=h.useState(""),{endpoint:c}=Se(),[I,b]=h.useState(!1),D=K=>{p(null),o(!0);try{k(K.result),C(R.length-1)}catch(_){const ee=V(_);p(ee),l(_)}finally{o(!1)}},T=()=>{x(!0),C(1)},q=()=>{x(!1),C(0)},R=[{body:e.jsxs(m,{children:[e.jsx(F,{children:s("team.transferApp.transferDialog.tips.progress")}),e.jsx(F,{sx:{mt:3,mb:2},children:s("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:s("common.cancel"),confirm:s("team.transferApp.transferDialog.createTransferLink"),onCancel:i,onConfirm:T},{cancel:s("common.cancel"),confirm:s("team.transferApp.transferDialog.createTransferLink"),body:()=>e.jsx(he,{action:"transfer-app-owner",open:f,locale:u,checkFn:r.get,onClose:q,onSuccess:D,checkTimeout:300*1e3,extraParams:{},messages:{title:s("team.transferApp.connectDialog.title"),scan:s("team.transferApp.connectDialog.scan"),confirm:s("team.transferApp.connectDialog.confirm"),success:s("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const K=Je({transferId:w.transferId,endpoint:c});return e.jsxs(e.Fragment,{children:[e.jsx(m,{component:z,dangerouslySetInnerHTML:{__html:s("team.transferApp.transferDialog.createSuccessTip1")}}),e.jsx(m,{component:z,sx:{mt:2},children:e.jsx(z,{children:s("team.transferApp.transferDialog.createSuccessTip3")})}),e.jsxs(m,{children:[e.jsx(m,{component:z,sx:{mt:2},children:e.jsx(z,{children:s("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Ze(w.expireDate,u)})})}),e.jsx(m,{sx:{my:1},children:e.jsx(ct,{children:K})})]}),e.jsx("div",{children:e.jsx(Ke,{value:"end",control:e.jsx(Me,{checked:I,onChange:_=>b(_.target.checked)}),label:s("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:s("common.confirm"),onConfirm:n}],E=R[j];return e.jsxs(je,{title:e.jsx(z,{className:"title",children:s("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx(A,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs(A,{onClick:E.onConfirm,color:"error",disabled:a||j===R.length-1&&!I,variant:"contained",autoFocus:!0,children:[a&&e.jsx(Q,{size:16}),E.confirm]})]}),children:[e.jsx(ze,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!g&&e.jsx(Fe,{severity:"error",variant:"icon",children:g})]})}we.propTypes={onCancel:y.func.isRequired,onSuccess:y.func.isRequired,onError:y.func};const z=ge.div`
2
- font-size: 16px;
3
- font-weight: bold;
4
- &.title {
5
- font-size: 20px;
6
- }
7
- `;function ht(i){return{type:"BN",base:i.any(),messages:{"bn.nan":"{{#label}} is not a big number","bn.max":'{{#label}} needs to be less than or equal to "{{#threshold}}"',"bn.min":'{{#label}} needs to be greater than or equal to "{{#threshold}}"',"bn.less":'{{#label}} needs to be less than "{{#threshold}}"',"bn.greater":'{{#label}} needs to be greater than "{{#threshold}}"',"bn.positive":"{{#label}} needs to be positive","bn.negative":"{{#label}} needs to be negative"},prepare(n,l){try{return{value:new N(n)}}catch{return{errors:l.error("bn.nan")}}},coerce(n){return{value:n.toString(10)}},validate(n){return{value:n}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:n=>N.isBN(n),message:"must be a big number",normalize:n=>new N(n)},{name:"equal",assert:n=>typeof n=="boolean",message:"must be a boolean"}],validate(n,l,r){const a=new N(n);return r.equal&&a.lt(r.threshold)?l.error("bn.min",r):!r.equal&&a.lte(r.threshold)?l.error("bn.greater",r):n}},lt:{args:[{name:"threshold",ref:!0,assert:n=>N.isBN(n),message:"must be a big number",normalize:n=>new N(n)},{name:"equal",assert:n=>typeof n=="boolean",message:"must be a boolean"}],validate(n,l,r){const a=new N(n);return r.equal&&a.gt(r.threshold)?l.error("bn.max",r):!r.equal&&a.gte(r.threshold)?l.error("bn.less",r):n}},min:{alias:"gte",method(n){return this.$_addRule({name:"gt",args:{threshold:n,equal:!0}})}},max:{alias:"lte",method(n){return this.$_addRule({name:"lt",args:{threshold:n,equal:!0}})}},greater:{alias:"gt",method(n){return this.$_addRule({name:"gt",args:{threshold:n,equal:!1}})}},less:{alias:"lt",method(n){return this.$_addRule({name:"lt",args:{threshold:n,equal:!1}})}},positive:{method(){return this.$_addRule({name:"gt",args:{threshold:0,equal:!1}})}},negative:{method(){return this.$_addRule({name:"lt",args:{threshold:0,equal:!1}})}}}}}const J={pk:Object.keys(te.KeyType),hash:Object.keys(te.HashType),role:Object.keys(te.RoleType)};function bt(i){return{type:"DID",base:i.string().trim(),messages:{"did.empty":"Expect {{#label}} to be non-empty string","did.invalid":"Expect {{#label}} to be valid did","did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}"',"did.prefix":'Expect prefix of {{#label}} to be "{{#expected}}"'},validate(n,l){return!n||typeof n!="string"?{errors:l.error("did.empty",{value:n})}:Z(n)===!1?{errors:l.error("did.invalid",{value:n})}:{value:n}},rules:{type:{args:[{name:"key",ref:!0,assert:n=>Object.keys(J).includes(n),message:`must be one of ${Object.keys(J).join(", ")}`},{name:"expected",assert:n=>Object.keys(J).some(l=>J[l].includes(n)),message:"must be valid type"}],validate(n,l,r){const a=re(n);return r.key==="pk"&&a.pk!==r.expected?l.error("did.pk",{...r,actual:a.pk}):r.key==="hash"&&a.hash!==r.expected?l.error("did.hash",{...r,actual:a.hash}):r.key==="role"&&a.role!==r.expected?l.error("did.role",{...r,actual:a.role}):n}},pk:{method(n){return this.$_addRule({name:"type",args:{key:"pk",expected:n}})}},hash:{method(n){return this.$_addRule({name:"type",args:{key:"hash",expected:n}})}},role:{method(n){return this.$_addRule({name:"type",args:{key:"role",expected:n}})}},wallet:{method(n){return this.$_addRule({name:"wallet",args:{type:n}})},args:[{name:"type",ref:!0,assert:n=>["arcblock","ethereum","default","eth","passkey"].includes(n),message:"must be a string",normalize:n=>n.trim()}],validate(n,l,r={}){const a=rt(n),o=re(n);return["ethereum","eth"].includes(r.type)&&ne(a,st)===!1?l.error("did.wallet",{expected:r.type,actual:JSON.stringify(o)}):["arcblock","default"].includes(r.type)&&ne(a,at)===!1?l.error("did.wallet",{expected:r.type,actual:JSON.stringify(o)}):["passkey"].includes(r.type)&&ne(a,ot)===!1?l.error("did.wallet",{expected:r.type,actual:JSON.stringify(o)}):n}},prefix:{method(n=""){return this.$_addRule({name:"prefix",args:{str:n}})},args:[{name:"str",ref:!0,assert:n=>["",nt].includes(n),message:"must be a string",normalize:n=>n.trim()}],validate(n,l,r={}){return r.str&&n.startsWith(r.str)===!1?l.error("did.prefix",{expected:r.str}):!r.str&&W(n)!==n?l.error("did.prefix",{expected:r.str}):n}}}}}const t=ft.extend(bt).extend(ht),pe=/^(0x)?([A-Fa-f0-9]{64})$/;t.object({genesisTime:t.date().iso().required().raw(),genesisTx:t.string().regex(pe).required().allow(""),renaissanceTime:t.date().iso().required().raw(),renaissanceTx:t.string().regex(pe).required().allow("")});const De=t.object({address:t.DID().prefix().role("ROLE_TOKEN").required(),value:t.BN().min(0).required()});t.object({name:t.string().min(1).max(256).required(),value:t.string().min(1).max(1024).required(),description:t.string().min(1).max(256).optional().allow(""),required:t.boolean().optional().default(!1)});const Te=t.alternatives().try(t.DID().prefix().role("ROLE_ACCOUNT"),t.DID().prefix().role("ROLE_APPLICATION"),t.DID().prefix().role("ROLE_BLOCKLET"),t.DID().prefix().wallet("ethereum"),t.DID().prefix().wallet("passkey"));t.array().items(t.object({owner:Te.required(),tokensList:t.array().items(De).default([]),assetsList:t.array().items(t.DID().prefix().role("ROLE_ASSET")).default([])}));t.array().items({signer:t.DID().prefix().required(),pk:t.any().required(),signature:t.any().required(),delegator:t.DID().prefix().valid("").optional(),data:t.any().optional()});t.object({type:t.string().min(1).max(32).required(),contractAddress:t.DID().prefix().wallet("ethereum").required(),chainType:t.string().min(1).max(32).required(),chainName:t.string().min(1).max(32).required(),chainId:t.number().positive().required()});const se=t.object({type:t.string().valid("svg","url","uri").required(),content:t.string().when("type",{is:"uri",then:t.string().max(20480).dataUri().required()}).when("type",{is:"url",then:t.string().max(2048).uri({scheme:["http","https"]}).required()})}),Ee=t.object({id:t.string().max(2048).uri({scheme:["http","https"]}).required(),scope:t.string().valid("public","private").default("public")});t.object({id:t.DID().prefix().required(),pk:t.string().required(),name:t.string().min(1).max(256).required()});const yt={address:t.DID().prefix().role("ROLE_ASSET").required(),moniker:t.string().min(2).max(255).required(),data:t.any().required(),readonly:t.boolean().default(!1),transferrable:t.boolean().default(!1),ttl:t.number().min(0).default(0),parent:t.DID().prefix().optional().allow(""),issuer:t.DID().prefix().optional().allow(""),endpoint:Ee.optional().allow(null).default(null),display:se.optional().allow(null).default(null),tags:t.array().items(t.string().min(1).max(64)).max(4).optional()},jt={address:t.DID().prefix().role("ROLE_FACTORY").required(),name:t.string().min(2).max(255).required(),description:t.string().min(2).max(255).required(),settlement:t.string().valid("instant","periodic").default("instant"),limit:t.number().integer().min(0).default(0),trustedIssuers:t.array().items(t.DID().prefix()).max(8).optional(),data:t.any().optional().allow(null).default(null),display:se.optional().allow(null).default(null),input:t.object({value:t.BN().positive().min("0").default("0"),tokens:t.array().items(De).max(8).optional(),assets:t.array().items(t.alternatives().try(t.DID().prefix().role("ROLE_ASSET"),t.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:t.array().items(t.object({name:t.string().min(1).max(255).required(),description:t.string().max(255).optional().allow(""),required:t.boolean().required()})).optional()}),output:t.object({moniker:t.string().min(2).max(255).required(),data:t.any().required(),readonly:t.boolean().default(!1),transferrable:t.boolean().default(!1),ttl:t.number().min(0).default(0),parent:t.string().max(255).required(),issuer:t.string().max(255).required(),endpoint:Ee.optional(),display:se.optional(),tags:t.array().items(t.string().min(1).max(64)).max(4).optional()}),hooks:t.array().items(t.object({name:t.string().valid("mint","postMint","preMint").required(),type:t.string().valid("url","contract").required(),hook:t.string().min(1).max(4096).required(),compiled:t.array().items(t.object()).optional()})).optional()},kt={tokenHolder:Te,assetSchema:t.object(yt).options({stripUnknown:!0,noDefaults:!1}),factorySchema:t.object(jt).options({stripUnknown:!0,noDefaults:!1})};function Oe({onCancel:i,onSuccess:n,blocklet:l}){const{vaults:r=[],appPid:a}=l,{t:o,locale:s}=Y(),{connectApi:u}=ve(),{api:g}=$(),{teamDid:p}=Se(),[f,x]=ke({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});h.useEffect(()=>{if(!Z(f.address))return;const c=W(f.address),I=f.fetched.find(D=>D.address===c),b=f.errored.find(D=>D.address===c);!f.fetching&&!I&&!b&&(x({fetching:!0}),Qe(Xe.MAIN_CHAIN_ENDPOINT).getAccountState({address:c}).then(T=>{T.state?x({fetching:!1,fetched:[...f.fetched.filter(q=>q.address!==c),T.state]}):x({fetching:!1,errored:[...f.errored.filter(q=>q.address!==c),{address:c}]})}).catch(T=>{console.error(T),x({fetching:!1,error:V(T)})}))},[f.address,f.fetching]),h.useEffect(()=>{if(f.address){const c=W(f.address);if(!Z(c)){x({error:o("blocklet.config.vault.error.invalid")});return}if(kt.tokenHolder.validate(c).error){x({error:o("blocklet.config.vault.error.holder")});return}if(r.find(b=>b.did===c)){x({error:o("blocklet.config.vault.error.duplicate")});return}if(dt([l.appDid,l.appPid,...l.migratedFrom.map(b=>b.appDid)].filter(Boolean)).includes(c)){x({error:o("blocklet.config.vault.error.appDid")});return}}x({error:""})},[f.address]);const j=async()=>{x({loading:!0});try{const c=await g.configVault({input:{teamDid:p,vaultDid:W(f.address)}});u.open({locale:s,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:600*1e3,passkeyBehavior:"none",extraParams:{sessionId:c.sessionId},messages:{title:o("blocklet.config.vault.approve.title"),scan:o(`blocklet.config.vault.approve.${r.length>0?"byLast":"byOwner"}`),confirm:o("blocklet.config.vault.approve.confirm"),success:o("blocklet.config.vault.approve.success")},onSuccess:()=>{u.open({locale:s,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:600*1e3,passkeyBehavior:"none",extraParams:{sessionId:c.sessionId},messages:{title:o("blocklet.config.vault.commit.title"),scan:o("blocklet.config.vault.commit.scan"),confirm:o("blocklet.config.vault.commit.confirm"),success:o("blocklet.config.vault.commit.success")},onSuccess:()=>{x({loading:!1}),n()},onClose:()=>{x({loading:!1}),u.close()}})},onClose:()=>{x({loading:!1}),u.close()}})}catch(c){x({loading:!1,error:V(c)})}},C=W(f.address),w=[];Z(C)&&w.push({key:o("blocklet.config.vault.role"),value:e.jsx($e,{color:"primary",variant:"outlined",size:"small",label:re(C).role||"-"})});const k=f.fetched.find(c=>c.address===C);return k&&w.push({key:o("blocklet.config.vault.firstSeen"),value:me(k.context?.genesisTime,"-")},{key:o("blocklet.config.vault.lastSeen"),value:me(k.context?.renaissanceTime,"-")},{key:o("blocklet.config.vault.migratedFrom"),value:k.migratedFrom.length?k.migratedFrom.map(c=>e.jsx(fe,{did:c,showQrcode:!0,compact:!0,size:14,locale:s},c)):"-"},{key:o("blocklet.config.vault.migratedTo"),value:k.migratedTo.length?k.migratedTo.map(c=>e.jsx(fe,{did:c,showQrcode:!0,compact:!0,size:14,locale:s},c)):"-"}),e.jsx(je,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:i,title:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(xe,{}),o("blocklet.config.vault.title")]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(A,{onClick:i,children:o("common.cancel")}),e.jsx(A,{onClick:j,variant:"contained",disabled:!!f.error||f.loading,children:o("common.confirm")})]}),children:e.jsxs(U,{direction:"column",spacing:3,children:[e.jsxs(F,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[o("blocklet.config.vault.desc")," ",o("blocklet.config.vault.tip")]}),r.length>0&&e.jsxs(m,{children:[e.jsxs(F,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[o("blocklet.config.vault.current"),":"]}),e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ut,{did:r[r.length-1].did,showQrcode:!0,style:{width:"auto"}}),e.jsx(pt,{vaults:r,appPid:a})]})]}),e.jsx(He,{fullWidth:!0,"data-cy":"input-factory-address",label:o("blocklet.config.vault.address"),error:!!f.error,helperText:f.error,value:f.address,onChange:c=>{x({address:c.target.value,error:""})},slotProps:{input:{endAdornment:f.fetching?e.jsx(Ue,{position:"end",children:e.jsx(Q,{size:16})}):null}}}),e.jsx(m,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:w.map(c=>e.jsx(mt,{valueComponent:"div",nameWidth:120,name:c.key,children:c.value},c.key))})]})})}Oe.propTypes={onCancel:y.func.isRequired,onSuccess:y.func.isRequired,blocklet:y.object.isRequired};function vt({teamDid:i,size:n="small",...l}){const{t:r}=Y(),{api:a}=$(),[o,s]=h.useState(!1),[u,g]=h.useState(null),p=()=>{s(!1),g(null)},f=async()=>{try{s(!0);const j=await a.rotateSessionKey({input:{teamDid:i}});O.success(r("blocklet.config.rotateSessionKey.success",{count:j.removed?.length||0})),setTimeout(()=>{window.location.reload()},1e3)}catch(j){O.error(V(j))}finally{s(!1),g(null)}},x={title:r("blocklet.config.rotateSessionKey.title"),description:r("blocklet.config.rotateSessionKey.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:f,onCancel:p};return e.jsxs("div",{...l,children:[e.jsxs(A,{onClick:()=>g(x),color:"error",variant:"outlined",size:n,children:[o?e.jsx(Q,{size:16,style:{marginRight:5}}):null,r("blocklet.config.rotateSessionKey.action")]}),u&&e.jsx(ae,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}function oe({blocklet:i,onUpdate:n=()=>{},hasPermission:l=!1}){const{info:r,api:a,inService:o}=$(),{t:s,locale:u}=h.useContext(it),[g,p]=ke({loading:!1,showTransferOwner:!1,showConfigVault:!1}),[f,x]=h.useState(()=>i?.settings?.gateway?.wafPolicy?.enabled??!0),[j,C]=h.useState(()=>!!i?.settings?.enableSessionHardening),[w,k]=h.useState(()=>!!i?.settings?.invite?.enabled),[c,I]=h.useState(()=>{const d=i?.settings?.org||{};return{enabled:d.enabled||!1,maxMemberPerOrg:d.maxMemberPerOrg||100,maxOrgPerUser:d.maxOrgPerUser||10}}),b=g.loading||!l,{did:D}=i.meta,T=o?window.env?.gateway?.wafPolicy?.enabled:r?.routing.wafPolicy?.enabled;if(ye(i.status))return null;const q=i.environments.find(d=>d.key===B.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),R=!q||q.value==="yes",K=i.environments.find(d=>d.key===B.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE)?.value||B.BLOCKLET_TENANT_MODES.SINGLE,_=(d,P)=>async H=>{if(!g.loading){p({loading:!0});try{const{checked:L}=H.target,{blocklet:Be}=await a.configBlocklet({input:{did:i.meta.did,configs:[{key:B.BLOCKLET_CONFIGURABLE_KEY[d],value:P(L)}]}});n(Be)}catch(L){O.error(L.message)}finally{p({loading:!1})}}},ee=_("BLOCKLET_DELETABLE",d=>d?"no":"yes"),Ie=_("BLOCKLET_APP_TENANT_MODE",d=>d?B.BLOCKLET_TENANT_MODES.MULTIPLE:B.BLOCKLET_TENANT_MODES.SINGLE),G=(d,P)=>async H=>{if(!g.loading){p({loading:!0});try{const L=H.target.checked;await a.updateBlockletSettings({input:d(L)}),P&&P(L)}catch(L){O.error(L.message)}finally{p({loading:!1})}}},qe=G(d=>({did:i.meta.did,invite:{enabled:d}}),k),Le=G(d=>({did:i.meta.did,org:{enabled:d,maxMemberPerOrg:100,maxOrgPerUser:10}}),d=>{I({...c,enabled:d})}),le=async(d,P)=>{if(!g.loading){p({loading:!0});try{await a.updateBlockletSettings({input:{did:i.meta.did,org:{...c,[d]:P}}}),I({...c,[d]:P})}catch(H){O.error(H.message)}finally{p({loading:!1})}}},Ae=G(d=>({did:i.meta.did,gateway:{wafPolicy:{enabled:d}}}),x),_e=G(d=>({did:i.meta.did,enableSessionHardening:d}),d=>{C(d),et()}),Pe=async()=>{if(!g.loading){p({loading:!0});try{const{blocklet:d}=await a.getBlocklet({input:{did:i.meta.did}});n(d)}catch(d){O.error(d.message)}finally{p({loading:!1})}}};return e.jsxs(U,{p:3,sx:{border:"1px solid red",borderRadius:2,p:3},className:"advanced-config",children:[!o&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:s("blocklet.config.deletable.name"),desc:s(R?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(M,{disabled:b,checked:!R,defaultChecked:!0,onChange:ee})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}})]}),e.jsx(Ce,{inService:o,disabled:b,loading:g.loading,onChange:Pe}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),o&&e.jsx(tt,{role:"owner",children:d=>(d||gt)&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:s("blocklet.config.vault.title"),desc:s("blocklet.config.vault.desc"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(A,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>p({showConfigVault:!0}),children:[e.jsx(xe,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.config.vault.title")]})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),g.showConfigVault&&e.jsx(Oe,{blocklet:i,onCancel:()=>p({showConfigVault:!1}),onSuccess:()=>p({showConfigVault:!1})}),e.jsx(v,{title:s("team.transferApp.name"),desc:s("team.transferApp.description"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(A,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>p({showTransferOwner:!0}),children:[e.jsx(We,{style:{fontSize:"1.3em",marginRight:4}}),s("team.transferApp.name")]})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),g.showTransferOwner&&e.jsx(we,{onCancel:()=>p({showTransferOwner:!1}),onSuccess:()=>p({showTransferOwner:!1})})]})}),e.jsx(v,{title:s("blocklet.config.clearCache.name"),desc:s("blocklet.config.clearCache.purpose"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(xt,{teamDid:D})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),e.jsx(v,{title:s("blocklet.config.rotateSessionKey.name"),desc:s("blocklet.config.rotateSessionKey.purpose"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(vt,{style:{whiteSpace:"nowrap"},teamDid:D})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),e.jsx(v,{title:s("blocklet.config.tenantMode.name"),desc:s(`blocklet.config.tenantMode.${K}`),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(M,{disabled:b,checked:K===B.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:Ie})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),e.jsx(v,{title:s("team.invite.setting"),desc:s(`team.invite.${w?"enabled":"disabled"}`),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(M,{disabled:b,checked:w,onChange:qe})})}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),e.jsx(v,{title:e.jsxs(U,{direction:"row",sx:{alignItems:"center",gap:1},children:[s("setting.form.enableSessionHardening.switchLabel"),e.jsx(ce,{title:s("setting.form.enableSessionHardening.switchTips"),children:e.jsx(de,{sx:{ml:.5,fontSize:"20px"},color:"primary"})})]}),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(M,{disabled:b,checked:j,onChange:_e})})}),T&&e.jsxs(e.Fragment,{children:[e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),e.jsx(v,{title:e.jsxs(U,{direction:"row",sx:{alignItems:"center",gap:1},children:[s("router.gateway.wafPolicy.title"),e.jsx(ce,{title:e.jsx(m,{sx:{fontSize:"14px",lineHeight:1.5},children:e.jsx(m,{sx:{color:"common.white",ml:.5},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${u}/enable-web-application-firewall`,target:"_blank",rel:"noopener noreferrer",children:s("dashboard.document")})}),children:e.jsx(de,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]}),desc:s("router.gateway.wafPolicy.switchLabel"),children:e.jsx(m,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(M,{disabled:b,checked:f,onChange:Ae})})})]}),e.jsx(m,{className:"config-form",component:S,sx:{my:3}}),e.jsx(v,{title:e.jsx(U,{direction:"row",sx:{alignItems:"center",gap:1},children:s("common.orgs")}),desc:s("team.orgs.explain"),children:e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:2,width:"100%",alignSelf:{xs:"flex-start",md:"flex-end"}},children:[e.jsx(M,{disabled:b,checked:c.enabled,onChange:Le}),c.enabled&&e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:400,mt:1},children:[e.jsx(ue,{style:{marginTop:0},disabled:b,loading:g.loading,type:"number",min:2,initialValue:c.maxOrgPerUser,label:s("team.orgs.invite.maxOrgs"),placeholder:s("team.orgs.invite.maxOrgs"),onSubmit:d=>le("maxOrgPerUser",d)}),e.jsx(ue,{style:{marginTop:0},disabled:b,loading:g.loading,type:"number",min:2,initialValue:c.maxMemberPerOrg,label:s("team.orgs.invite.maxMembers"),placeholder:s("team.orgs.invite.maxMembers"),onSubmit:d=>le("maxMemberPerOrg",d)})]})]})})]})}const St=X(oe,"mutate_blocklets"),Ct=X(oe,"",be);function wt(i){const{inService:n}=$();return n?e.jsx(Ct,{...i}):e.jsx(St,{...i})}oe.propTypes={blocklet:y.object.isRequired,onUpdate:y.func,hasPermission:y.bool};function ie({blocklet:i,onUpdate:n=()=>{},hasPermission:l=!1}){return ye(i.status)?null:e.jsx(Et,{children:e.jsx(wt,{blocklet:i,onUpdate:n,hasPermission:l})})}const Dt=X(ie,"mutate_blocklets"),Tt=X(ie,"",be);function mn(i){const{inService:n}=$();return n?e.jsx(Tt,{...i}):e.jsx(Dt,{...i})}ie.propTypes={blocklet:y.object.isRequired,onUpdate:y.func,hasPermission:y.bool};const Et=ge(m)`
8
- max-width: 1536px;
9
-
10
- .advanced-config {
11
- border: 0;
12
- padding: 0;
13
- }
14
- `;export{mn as default};
@@ -1 +0,0 @@
1
- import{D as a}from"./vendor-utils-BzQg432x.js";a.defaults.timeout=10*1e3;const o=a.create();export{o as a};
@@ -1 +0,0 @@
1
- import{z as E,x as T}from"./vendor-utils-BzQg432x.js";import{W as j,V as k,c as M}from"./index-CXp5SI_f.js";import{r as e}from"./vendor-react-DX7tU9aY.js";import{W as B}from"./vendor-ux-CLT2i3Pv.js";import{u as H}from"./use-mobile-DwGMuJlg.js";import{G as I,j as o,al as w,a7 as N}from"./vendor-mui-core-CV-FnYH_.js";import"./vendor-arcblock-Dll6qxMT.js";import"./vendor-hooks-DAZ1H6Va.js";function $(){const{info:x,inService:g}=j(),{blocklet:y}=k(),{locale:u}=B(),f=e.useRef(null),r=I(),[L,R]=e.useState(0),m=H(),[t,S]=e.useState(!0),s=e.useRef(null);let a="";g?a=M.WELLKNOWN_SERVICE_PATH_PREFIX:a=x.routing.adminPath;const c=new URLSearchParams;g?c.set("appUrl",window.location.origin):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=T(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);s.current.contentWindow.postMessage({type:"SEND_THEME",payload:n},window.location.origin)}},[r]),d=e.useCallback(()=>{s.current&&s.current.contentWindow.postMessage({type:"SEND_LOCALE",payload:u},window.location.origin)},[u]);return e.useEffect(()=>{const n=i=>{i.origin===window.location.origin&&(i.data.type==="REQUEST_THEME"&&l(),i.data.type==="THEME_BUILDER_LOADED"&&(d(),S(!1)))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[l,d]),e.useEffect(()=>{t===!1&&l()},[r,t,l]),e.useEffect(()=>{t===!1&&d()},[u,t,d]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),i=document.querySelector(".dashboard-content"),p=()=>{if(f.current){const{height:b}=n.getBoundingClientRect(),{top:C}=i.getBoundingClientRect(),{top:_}=f.current.getBoundingClientRect();let h=b-_+C-(m?108:164);m&&(h=Math.min(h,600)),R(h)}};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[m,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:f}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(N,{})}),o.jsx("iframe",{title:"Theme Builder",ref:s,src:`${E(window.location.origin,a,"/hosted/theme-builder/")}?${c.toString()}`,style:{border:0,width:"100%",height:`${L}px`,display:t?"none":"block"}})]})}export{$ as default};
@@ -1,35 +0,0 @@
1
- import{Q as U,W as A,bm as H,bF as F,bY as Z,aQ as G,ba as K}from"./vendor-ux-CLT2i3Pv.js";import{W,c as _}from"./index-CXp5SI_f.js";import{j as e,G as I,al as g,aY as Q,T as $,an as N,b6 as X,I as D,cc as Y,dP as q,L as J,a7 as ee,z as te,y as oe,bN as ne,M as se,bO as re,aT as ae}from"./vendor-mui-core-CV-FnYH_.js";import{r as i,L as ie}from"./vendor-react-DX7tU9aY.js";import{p as le}from"./util-DkTwHdRu.js";import{u as ce}from"./useLocalStorage-BQfIniHX.js";import{M as T}from"./index-Cax1AxL9.js";import{d as de,e as M}from"./vendor-utils-BzQg432x.js";import{S as O}from"./shorten-label-CuBHsWUR.js";import{r as V}from"./index-B9FojAjj.js";import{b as pe}from"./team-BTz28XqK.js";import"./vendor-hooks-DAZ1H6Va.js";import"./vendor-arcblock-Dll6qxMT.js";import"./base32-7iZvvdX8.js";import"./session-Bp3LV7zJ.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-joIVZ1nl.js";import"./theme-mode-toggle-D3bcd10D.js";import"./use-mobile-CyUZDIaX.js";import"./index-CEJb82tA.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./use-app-logo-IRizt64R.js";const B=i.createContext({}),{Provider:ue,Consumer:Ze}=B;function me(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function fe({children:t,scope:c="",categories:n=[],showScope:l,scopeFormatter:u,blocklets:x}){const{api:h,info:v}=W(),[C,m]=i.useState([]),[f,y]=i.useState({total:0,pageSize:me(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,o]=ce(`audit-log-category-${c}`,"all"),S=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>n.length?P.value==="all"||n.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const j=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(j.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),m(j.list),y(j.paging),s(!1)}catch(j){U.error(j.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",f.pageSize)},[f.pageSize]),i.useEffect(()=>{b({page:1,pageSize:f.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:f.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:S,blocklets:x,setCategory:o,data:C,paging:f,setPaging:y,showScope:l,scopeFormatter:u,actionOrContent:w,setActionOrContent:a};return e.jsx(ue,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(B);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,n=[];let l;for(;(l=c.exec(t))!==null;)n.push({text:l[1],url:l[2]});return n}const xe=`
2
- <svg style="width:38px;height:38px;" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z" fill="url(#paint0_linear_606_96)"/>
4
- <path fill-rule="evenodd" clip-rule="evenodd" d="M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z" fill="url(#paint1_linear_606_96)"/>
5
- <defs>
6
- <linearGradient id="paint0_linear_606_96" x1="31.72" y1="95.7208" x2="95.488" y2="34.3249" gradientUnits="userSpaceOnUse">
7
- <stop stop-color="#0FA4B7"/>
8
- <stop offset="0.494757" stop-color="#1DC1C7"/>
9
- <stop offset="1" stop-color="#2BE0D7"/>
10
- </linearGradient>
11
- <linearGradient id="paint1_linear_606_96" x1="28.4374" y1="99.2464" x2="98.7613" y2="44.9372" gradientUnits="userSpaceOnUse">
12
- <stop stop-color="#0FA4B7"/>
13
- <stop offset="0.494757" stop-color="#1DC1C7"/>
14
- <stop offset="1" stop-color="#2BE0D7"/>
15
- </linearGradient>
16
- </defs>
17
- </svg>
18
- `;function he({title:t,subTitle:c,titleInfo:n,action:l,createdAt:u,content:x,isLast:h,titleLink:v,avatarUrl:C,inService:m,renderTag:f}){const{locale:y}=A(),{palette:L}=I(),[s,w]=i.useState(!1),[a,d]=i.useState(!1),[o,p]=i.useState(window.innerWidth),S=i.useRef(null),b=()=>{const r=S.current?.mdp?.current;r&&d(r.scrollHeight>r.offsetHeight)};i.useEffect(()=>{const r=de(()=>{p(window.innerWidth)},100);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),i.useEffect(()=>{b()},[o,x]);const k=i.useMemo(()=>Object.entries(n).map(([r,z])=>({key:r,value:z})).filter(r=>!!r.value),[n]),P=i.useMemo(()=>{let r=x;return m&&ge(x).forEach(j=>{/^(?:\/[^/]+)*\/blocklets\/[^/]+\/members$/.test(j.url)&&(r=r.replace(j.url,`${_.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/did-connect/members`))}),r},[x,m]);return e.jsx(g,{"data-cy":"log-entry",sx:{borderBottom:h?"none":`1px solid ${L.divider}`,padding:2},children:e.jsxs(g,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,width:"100%"},children:[e.jsx(g,{sx:{mt:.5},className:"log-author",children:C?e.jsx(Q,{src:C,size:36,shape:"circle"}):e.jsx("div",{dangerouslySetInnerHTML:{__html:xe}})}),e.jsxs(g,{sx:{width:240},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx($,{color:"textSecondary",component:"p",sx:{display:"flex"},children:v?e.jsx(ie,{to:v,target:"_blank",children:e.jsx(O,{maxLength:26,children:t})}):e.jsx(O,{maxLength:26,children:t})}),typeof f=="function"&&f()]}),e.jsx(N,{"aria-label":"Audit device info",title:e.jsx(g,{sx:{color:"#fff",display:"flex",flexDirection:"column",fontSize:12},children:k?.map(r=>e.jsx($,{sx:{fontSize:12,color:"#fff"},children:`${r.key}: ${r.value}`},r.key))}),children:e.jsxs($,{component:"span",color:"textSecondary",sx:{fontSize:13},children:[c,e.jsx(X,{sx:{ml:.5,fontSize:12,verticalAlign:"middle"}})]})})]}),e.jsxs(g,{sx:{width:200},children:[e.jsx($,{sx:{fontSize:"16px",color:L.text.primary,backgroundColor:L.background.default,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'"},children:l}),e.jsx($,{component:"span",color:"textSecondary",children:e.jsx(H,{value:u,locale:y,type:"all",disableTimezone:!0,sx:{fontSize:12}})})]}),e.jsx(g,{sx:{flex:1,".wmde-markdown":{bgcolor:"background.default",color:"text.primary",".code-highlight":{"white-space":"pre-wrap;","word-break":"break-all"}}},children:a&&s?e.jsx($,{className:"log-content",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{maxWidth:"lg"},children:e.jsx(T,{source:P,rehypePlugins:[[V,{target:"_blank"}]]})}):e.jsx($,{className:"log-content",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{maxWidth:"lg",display:s?"block":"-webkit-box",WebkitLineClamp:s?"none":2,WebkitBoxOrient:"vertical",overflow:s?"visible":"hidden",wordBreak:"break-word"},children:e.jsx(T,{ref:S,source:P,rehypePlugins:[[V,{target:"_blank"}]]})})}),e.jsxs(g,{children:[a&&e.jsx(D,{size:"small",onClick:()=>w(!s),children:s?e.jsx(Y,{sx:{fontSize:22}}):e.jsx(q,{sx:{fontSize:22}})}),e.jsx(D,{size:"small",children:e.jsx(F,{sx:{fontSize:22},content:x})})]})]})})}const Le=({log:t,info:c,inService:n})=>n?`${_.WELLKNOWN_BLOCKLET_ADMIN_PATH}/members?did=${t.actor.did}`:t.scope===c.did?`/team/members?did=${t.actor.did}`:`/blocklets/${t.scope}/members?did=${t.actor.did}`;function be({log:t,isLast:c}){const{inService:n,info:l}=W(),{t:u}=A(),{teamDid:x}=pe(),{showScope:h,scopeFormatter:v=a=>a,blocklets:C}=R(),m=i.useMemo(()=>{const a=t?.componentDid,d=t?.scope;if(!a)return null;if(n)return(window.blocklet?.componentMountPoints??[]).find(({did:k})=>k===a)||null;const o=C.find(({appPid:b,appDid:k})=>[b,k].includes(d));return o&&(o.children??[]).find(({meta:b})=>b?.did===a)?.meta||null},[C,n,t?.componentDid,t?.scope]);if(!t.actor.did)return null;const f=!["blocklet",""].includes(t.actor.role),y=()=>{if(m){const o=m.title??m.name??"",p=h?` - ${v(t.scope)}`:"";return`${o}${p}`}const a=t.actor.fullName??"",d=h?v(t.scope):"";return a?h?`${a} - ${d}`:a:d},L=h?t.link:Le({log:t,inService:n,info:l}),s=()=>{if(m)return`${n?`${_.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo-bundle/${t.componentDid}`:`/blocklet/logo-bundle/${t.scope}/${t.componentDid}`}?v=${m?.version}`;const{avatar:a,source:d}=t.actor||{};return a?le(a,x,n,d==="server"):""},w=()=>m?e.jsx(N,{title:t.componentDid,children:e.jsx(K,{type:"success",children:"SDK"},"source")}):"";return e.jsx(he,{isLast:c,isUser:f,avatarDid:t.actor.did,avatarUrl:s(),title:y()||u("common.unrecordedUser"),renderTag:w,titleLink:L,subTitle:t.actor.role?t.actor.role:"guest",content:t.content,action:t.action,inService:n,titleInfo:{IP:t.ip,OS:`${M(t,"env.os.name","")}${M(t,"env.os.version","")}`,Client:`${M(t,"env.browser.name","")}${M(t,"env.browser.Version","")}`},createdAt:t.createdAt})}function ve(){const{t}=A(),{palette:c}=I(),{data:n,loading:l,paging:u,setPaging:x,filter:h,categories:v,setCategory:C,fetch:m,actionOrContent:f,setActionOrContent:y}=R(),L=I(),s=J(L.breakpoints.down("sm")),w=i.useMemo(()=>({flexDirection:s?"column":"row",alignItems:s?"flex-start":"center",justifyContent:s?"flex-start":"space-between","& > div":s?{width:"100%",flex:1,".toolbar-search-area":{width:"100% !important",flex:"1 !important"}}:{}}),[s]),a=o=>{const p=Number(o.target.value);x({...u,pageSize:p}),m({page:1,pageSize:p,silent:!1})},d=o=>{x({...u,page:o+1}),m({page:o+1,pageSize:u.pageSize,silent:!1})};return l&&n.length===0?e.jsx("div",{style:{textAlign:"center",marginTop:"50px"},children:e.jsx(ee,{})}):e.jsxs(Ce,{"data-cy":"audit-logs",children:[e.jsxs(g,{className:"audit-logs-toolbar",sx:{display:"flex",flexDirection:s?"column":"row",gap:2,alignItems:s?"flex-start":"center",justifyContent:s?"flex-start":"space-between",...w},children:[e.jsxs(te,{sx:s?{width:"100%",flex:1}:{width:240,flexShrink:0},variant:"outlined",children:[e.jsx(oe,{children:t("common.filter")}),e.jsx(ne,{size:"small","data-cy":"filter-by-category-trigger",value:h.category,onChange:o=>C(o.target.value),fullWidth:!0,sx:{borderRadius:1},label:t("common.category"),disabled:l,children:v.map(o=>e.jsx(se,{value:o.value,"data-cy":`filter-by-category-${o.value}`,children:e.jsx(g,{children:e.jsx("span",{children:o.label})})},o.label))})]}),e.jsx(Z,{options:{searchPlaceholder:t("common.auditLogsSearch"),searchDebounceTime:600},search:f,searchText:f,searchTextUpdate:y,searchClose:()=>y(""),onSearchOpen:()=>{}})]}),n.length===0&&e.jsx(G,{children:t("common.empty")}),e.jsx(g,{sx:{mt:2,border:n?.length>0?`1px solid ${c.divider}`:"none",borderRadius:1},children:n.length>0&&n.map((o,p)=>e.jsx(be,{log:o,isLast:p===n.length-1},o.id))}),e.jsx(g,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:e.jsx(re,{disabled:l,page:u.page-1,count:u.total,rowsPerPage:u.pageSize,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:o,to:p,count:S})=>`${o}–${p} / ${S!==-1?S:`${t()}more than ${p}`}`,onPageChange:(o,p)=>d(p),onRowsPerPageChange:a})})]})}function Ge({scope:t,categories:c,showScope:n,scopeFormatter:l,blocklets:u}){return e.jsx(fe,{scope:t,categories:c,showScope:n,scopeFormatter:l,blocklets:u,children:e.jsx(ve,{})})}const Ce=ae.div`
19
- .log-content {
20
- p {
21
- margin-bottom: 4px;
22
- }
23
- ul,
24
- ol {
25
- padding-left: 2rem;
26
- }
27
- li {
28
- list-style-type: disc;
29
- }
30
- code.code-highlight {
31
- max-height: 300px;
32
- overflow: auto;
33
- }
34
- }
35
- `;export{Ge as default};
@@ -1 +0,0 @@
1
- import{L as E,j as e,al as t,a7 as A,R as l,ci as W,T as a,aY as z,an as R,bP as I,bK as L,a6 as O,a4 as T,bb as f,b3 as F}from"./vendor-mui-core-CV-FnYH_.js";import{r as x}from"./vendor-react-DX7tU9aY.js";import{t as D}from"./vendor-hooks-DAZ1H6Va.js";import{z as b}from"./vendor-utils-BzQg432x.js";import{u as U,c as u,U as B,H,aE as K,n as M}from"./index-CXp5SI_f.js";import{K as p}from"./landing-page-JLA-ZD1t.js";import{W as V,M as y}from"./vendor-ux-CLT2i3Pv.js";import{W as Q}from"./did-address-CG36eCOx.js";import"./vendor-arcblock-Dll6qxMT.js";import"./use-blocklet-logo-Cf1j7pQz.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=U(),{t:c}=V(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=E("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await M.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(A,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(B,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:o}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(H,{children:e.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(K,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(a,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:o.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(R,{title:o.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:o.fullName})}),e.jsx(t,{className:"did",children:e.jsx(Q,{compact:!0,responsive:!1,did:o.did,showQrcode:!v})})]})]}),e.jsxs(a,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(I,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(O,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(o.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(a,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(a,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(a,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(a,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(a,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
@@ -1 +0,0 @@
1
- import{j as e,al as l,b4 as B,T as f,G as H,n as Z,an as $,X as u}from"./vendor-mui-core-CV-FnYH_.js";import{V as O,u as U,w as I,bM as P}from"./index-CXp5SI_f.js";import{W as D,Y as w,b3 as F,Z as Y}from"./vendor-ux-CLT2i3Pv.js";import{a as G}from"./page-header-qdK3sAJh.js";import{r as x}from"./vendor-react-DX7tU9aY.js";import{U as Q}from"./actions-BlWED76c.js";import{S as W}from"./button-uUU4Wycr.js";import{S as X}from"./layout-Cwvm7lmD.js";import{S as _}from"./step-actions-DIZRcnXf.js";import"./vendor-arcblock-Dll6qxMT.js";import"./vendor-hooks-DAZ1H6Va.js";import"./vendor-utils-BzQg432x.js";import"./passkey-rounded-_WDHIZVd.js";import"./login-method-item-CyTsqz88.js";import"./isEmail-BwGDo3Ws.js";import"./isIP-BBY240SU.js";import"./content-layout-Dlmn5DW6.js";import"./use-mobile-DFkQ5N0b.js";const J={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},K={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},M=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:K,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function z({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=M(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(w,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(Y,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(w,{icon:P,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}z.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=U(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const V=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},k=()=>{c.refresh(),o(!1),a(!1),i(null)},v=M(s),R=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(X,{children:[e.jsx("div",{className:"header",children:e.jsx(G,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(z,{type:t,account:y[t],onBind:V,bindButton:t==="passkey"?e.jsx(Q,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{k()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:R.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(w,{icon:J}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(I,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:600*1e3,webWalletUrl:F(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{k()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(_,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
@@ -1 +0,0 @@
1
- import{j as t,al as r,X as p}from"./vendor-mui-core-CV-FnYH_.js";import m from"./branding-CwSyd5WC.js";import{G as o}from"./index-CXp5SI_f.js";import"./vendor-react-DX7tU9aY.js";import"./vendor-ux-CLT2i3Pv.js";import"./vendor-utils-BzQg432x.js";import"./vendor-hooks-DAZ1H6Va.js";import"./sanitize-Bzl4lTuH.js";import"./omit-Dq0FLBY8.js";import"./index-jIvFgWDS.js";import"./form-text-input-CPLafaTk.js";import"./required-DnQpCGsD.js";import"./form-wrapper-kWYD3nZz.js";import"./edit.svg-BGhTyO6h.js";import"./permission-CvrrGfG6.js";import"./session-Bp3LV7zJ.js";import"./use-app-logo-IRizt64R.js";import"./logo-uploader-CyZuvhwV.js";import"./section-CZylgxjz.js";import"./vendor-arcblock-Dll6qxMT.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
@@ -1,40 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrCTi6nm.css"),window.__toCdnUrl("assets/index-_3Fxot8G.css")])))=>i.map(i=>d[i]);
2
- import{W as fe,_ as be}from"./vendor-ux-CLT2i3Pv.js";import{j as e,b3 as $,T as E,al as x,aY as je,an as Y,I as A,bB as Z,Z as se,aT as ve,b1 as ye,a0 as we,c3 as Ce,C as J,aH as Se,c4 as Ie,S as Pe,R as W,X as P}from"./vendor-mui-core-CV-FnYH_.js";import{c as D}from"./index-CXp5SI_f.js";import{E as N}from"./empty-spinner-DB1GKIOS.js";import{r as ke,u as Re}from"./vendor-hooks-DAZ1H6Va.js";import{r as m}from"./vendor-react-DX7tU9aY.js";import{D as G,C as Q,P as ee}from"./react-beautiful-dnd.esm-CWJ5I9Zv.js";import{S as F}from"./studio-CVIa8-XY.js";import"./vendor-utils-BzQg432x.js";import"./vendor-arcblock-Dll6qxMT.js";import"./raf-schd.esm-BZ-2sjAE.js";import"./index-3H6a5edM.js";import"./nav-menu-DSdXRbfg.js";import"./fallback-D-IHOW-7.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=k,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function k(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-DqcciDRh.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Ye(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,k]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=ke(async()=>{const i=await(await fetch(_)).json();return k(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx($,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),k(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(U,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(U,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(G,{onDragEnd:H,children:e.jsx(Q,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(Z,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(U,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(G,{onDragEnd:H,children:e.jsx(Q,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(Z,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs($,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function U({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs($,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx($,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}U.propTypes={title:P.string.isRequired,rules:P.array.isRequired,tips:P.array.isRequired,children:P.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,k]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(J,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(J,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(Pe,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(k(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>k(!1)))}}ne.propTypes={handleOperateVideo:P.func.isRequired,t:P.func.isRequired,defaultUrl:P.string,videos:P.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
3
- margin-top: 24px;
4
- .image-wrapper {
5
- margin-bottom: 16px;
6
- max-width: 400px;
7
- max-height: 225px;
8
- width: 400px;
9
- height: 225px;
10
- overflow: hidden;
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- background-color: #eee;
15
- margin-right: 16px;
16
- position: relative;
17
- cursor: grab;
18
- &:active {
19
- cursor: grabbing;
20
- }
21
- .action {
22
- visibility: hidden;
23
- position: absolute;
24
- right: 10px;
25
- opacity: 0.7;
26
- background-color: white;
27
- box-shadow: 0 0 20px 0px #000;
28
- &:hover {
29
- opacity: 1;
30
- }
31
- }
32
- &:hover .action {
33
- visibility: visible;
34
- }
35
- }
36
- .image-wrapper img {
37
- width: 100%;
38
- height: auto;
39
- }
40
- `;export{Ye as default};
@@ -1 +0,0 @@
1
- import{j as u,aY as x,X as e}from"./vendor-mui-core-CV-FnYH_.js";import{U as $}from"./vendor-ux-CLT2i3Pv.js";import{z as c}from"./vendor-utils-BzQg432x.js";import{W as l,a3 as v,aQ as j,c as y,aR as E,aS as P}from"./index-CXp5SI_f.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,n=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${n?"~":""}`;let a=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)a=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;a=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:a,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...n}){const r=l(),{logoUrl:a,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=n,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:a,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...n,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-CV-FnYH_.js";import{b5 as r}from"./vendor-ux-CLT2i3Pv.js";function m({...t}){return o.jsx(r,{className:"bottom-button",variant:"contained",color:"primary",...t})}export{m as S};
@@ -1,39 +0,0 @@
1
- import{aT as E,j as e,al as m,X as V}from"./vendor-mui-core-CV-FnYH_.js";import{al as J,x as ne,I as H,bW as oe,o as ae,k as ie,c as ce,n as le,q as ue,bX as de,L as me}from"./index-CXp5SI_f.js";import{b as he,a as j,m as X}from"./vendor-hooks-DAZ1H6Va.js";import{r as d}from"./vendor-react-DX7tU9aY.js";import{ab as pe,a2 as fe,B as ge,F as we,z as O}from"./vendor-utils-BzQg432x.js";import{u as xe}from"./launch-result-message-DJqF-slD.js";import{W as be,a1 as ke,Q}from"./vendor-ux-CLT2i3Pv.js";import{g as Ue}from"./get-safe-url-beob4f2C.js";import{S as q}from"./button-uUU4Wycr.js";import{S as ye}from"./layout-Cwvm7lmD.js";import{p as Re,P as Le,S as Se}from"./starting-progress-CWp5fTY0.js";import"./vendor-arcblock-Dll6qxMT.js";import"./content-layout-Dlmn5DW6.js";const ve=E(xe)`
2
- && .result-footer {
3
- height: 120px;
4
- > div {
5
- flex-wrap: wrap;
6
- }
7
- }
8
- `,je="https://launcher.arcblock.io",Ee=t=>{if(!t)return je;const{protocol:c,host:s}=pe(fe(t));return`${c}//${s}`},$e=t=>t?{"__did-connect__":ge.from(JSON.stringify({switchBehavior:"auto",forceConnected:t,showClose:!1}),"utf8").toString("base64")}:{},Be=(t=0)=>new Promise(c=>setTimeout(c,t));async function Pe(t,c=5){if(!t)throw new Error("domain is required");if(typeof c!="number")throw new Error("timeout must be a number");if(c<=1)throw new Error("time must be greater than 1s");async function s(n){try{const l=`${n}://${t}`,a=await J.evaluateURL(l,{preferAccessible:!0});return a.accessible?a.url:!1}catch{return!1}}async function R(){let n=await s("https");if(n)return n;let l=c;for(;l-- >0;)if(await Be(1e3),n=await s("https"),n)return n;return n||null}const h=await R();return h?{accessible:!0,url:h}:{accessible:!1}}function Ce({onPrevious:t=()=>{},launcherSession:c={}}){const{t:s}=be(),[R,h]=d.useState(!1),[n,l]=d.useState("starting"),[a,$]=d.useState(),[g,B]=d.useState(null),{blocklet:o}=ne(),[P,C]=d.useState(!1),[p,K]=d.useState(""),L=H("fromLauncher"),G=H("launcherUrl"),Y=Ee(G),Z=$e(c?.userDid),w=!["starting","running"].includes(n),I=n==="starting",T={stopped:s("blocklet.start"),starting:s("blocklet.starting"),running:s("blocklet.open")},_=he(async()=>{const r=o?.controller?.launcherSessionId||o?.meta?.did,i=r?`/apps/${r}/overview`:"apps",u=await oe(Y);return we(O(u,"/u/",i),Z)});d.useEffect(()=>{_().then(r=>{B(r)}).catch(()=>{B(null)})},[_]);const ee=async()=>{try{const i=new URL(window.location.href).searchParams.get("redirect");if(!i)return null;const u=await Pe(i,6);return u.accessible?u.url:null}catch(r){return console.error("checkRedirectUrl error",r),null}},A=async()=>{if(L&&g){window.location.href=g;return}C(!0);const r=await ee(),u=new URL(window.location.href).searchParams.get("redirect"),z=u&&r;if(!p||!ie(p)){Q.error(s("blocklet.gotoVisitError"));return}let U=p,v=[];if(z)try{const y=new URL(r);U=y.href,v=[y.hostname]}catch(y){console.error("Invalid redirect URL:",u,y)}const M=X.get("login_token"),W=X.get("vid"),f=new URL(U);f.host!==window.location.host&&M&&(f.pathname=O(ce.WELLKNOWN_SERVICE_PATH_PREFIX,"redirect-with-login"),f.searchParams.set("setupToken",M),W&&f.searchParams.set("visitorId",W),U=f.href),window.location.href=Ue(U,v.length?{allowDomains:v}:{}),C(!1)},S=async()=>{h(!0),l("starting");try{await le.post("/blocklet/start?fromSetup=1");const{blocklet:{status:r}={}}=await ue.getBlocklet({input:{did:o.meta.did}});h(!1),l(r),$(r==="running"?null:s("setup.complete.notRunning"))}catch(r){const i=r?.response?.data||r.message;Q.error(i),h(!1),l("stopped"),$(i)}};d.useEffect(()=>{l(o.status),["starting","running"].includes(o.status)||S()},[]),d.useEffect(()=>{p||(async()=>{const i=await J.evaluateURLs(o.site.domainAliases.map(u=>de(u.value,me)),{preferAccessible:!0});i.length>0&&K(i[0].url)})()},[o,p]);const x=j(()=>o?.children?.length,[o]),b=j(()=>o?.children?.filter(r=>ae.isBlockletRunning(r))?.length||0,[o]),k=j(()=>x?b?Math.round(Math.max(b/x,.15)*100):5:0,[b,x]),D=localStorage.getItem("blocklet-server-url"),F=I||!p;L&&!F&&(w?S():A());const te=ke(Re,w?{ml:3}:{},I?{width:`${k}%`,"&::after":{width:`${k}%`},"&::before":{width:`${k}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${k}%`}}}}:{}),re={starting:s("setup.complete.readyToStart"),running:s("setup.complete.title")},se=()=>P?s("setup.complete.opening"):n==="starting"&&!a?`(${b}/${x}) ${s("blocklet.starting")}`:T[n]||T.stopped,N=e.jsx(Le,{blocklets:o.children??[],status:n,debounce:!1,children:e.jsx(q,{sx:te,onClick:()=>w?S():A(),loading:F||P,children:e.jsx("span",{style:{position:"relative",zIndex:2},children:se()})})});return e.jsx(Ie,{children:e.jsx(ve,{variant:a?"error":"success",title:e.jsxs(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[e.jsx(m,{sx:{fontSize:24,fontWeight:600},children:a?s("setup.complete.failedTitle"):re[n]||""}),n==="starting"&&!a?e.jsx(Se,{blocklets:o.children??[]}):null]}),footer:e.jsxs(Te,{children:[w&&e.jsx(q,{variant:"outlined",disabled:R,onClick:()=>t(),children:s("setup.previous")}),L?e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:N}),a&&g?e.jsx(m,{sx:{width:"100%",mt:2},children:e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:s("launchBlocklet.nav.viewMyApps")})}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:N}),(n==="running"||a)&&!!D&&e.jsx(m,{sx:{width:"100%",mt:2},children:e.jsx("a",{href:D,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:s("setup.complete.backToServer")})}),a&&e.jsx(m,{className:"error-message",sx:{fontSize:14,color:"#888",mt:1},children:a})]})]})})})}const Ie=E(ye)`
9
- justify-content: center;
10
- .icon-success {
11
- width: 64px;
12
- height: 64px;
13
- color: ${t=>t.theme.palette.success.main};
14
- }
15
- .back-to-server-link {
16
- color: ${t=>t.theme.palette.primary.main};
17
- }
18
- .error-message {
19
- color: ${t=>t.theme.palette.error.main};
20
- height: 15em;
21
- overflow: hidden;
22
- overflow-y: scroll;
23
- }
24
- `;Ce.propTypes={onPrevious:V.func,launcherSession:V.object};const Te=E(m)`
25
- width: 100%;
26
- margin-top: auto;
27
- padding-top: 24px;
28
- display: flex;
29
- align-items: center;
30
- justify-content: center;
31
- .bottom-button {
32
- min-width: 200px;
33
- }
34
- ${t=>t.theme.breakpoints.down("md")} {
35
- .bottom-button {
36
- width: 100%;
37
- }
38
- }
39
- `;export{Ce as default};
@@ -1,32 +0,0 @@
1
- import{j as r,aT as w,X as f}from"./vendor-mui-core-CV-FnYH_.js";import{r as d}from"./vendor-react-DX7tU9aY.js";import{n as U,z as F,a4 as G,an as q,x as H}from"./vendor-utils-BzQg432x.js";import{W as V,Q as D}from"./vendor-ux-CLT2i3Pv.js";import{S as z}from"./index-C1fKsLzf.js";import{a as M}from"./page-header-qdK3sAJh.js";import{x as Y,a0 as Q,G as a,c as W,o as B}from"./index-CXp5SI_f.js";import{S as X}from"./layout-Cwvm7lmD.js";import{S as $}from"./step-actions-DIZRcnXf.js";import{S as J}from"./button-uUU4Wycr.js";import"./vendor-hooks-DAZ1H6Va.js";import"./Google-DKRt92nm.js";import"./cloneDeep-YxES7wNt.js";import"./create-passport-svg-hldNORaB.js";import"./vendor-arcblock-Dll6qxMT.js";import"./required-DnQpCGsD.js";import"./form-wrapper-kWYD3nZz.js";import"./logo-uploader-CyZuvhwV.js";import"./collapse-RMuUWnK3.js";import"./content-layout-Dlmn5DW6.js";import"./use-mobile-DFkQ5N0b.js";function A({children:h=[],bottom:x,onBottomFix:m=U}){const i=d.useRef(null),l=d.useRef(null),E=d.useRef(null),c=d.useRef(null),[L,g]=d.useState(!1);return d.useEffect(()=>{let t;const u=()=>{t||(t=setTimeout(()=>{l.current&&(l.current.scrollHeight>i.current.clientHeight-E.current.clientHeight?(c.current!=="fix"&&(m("fix"),c.current="fix"),g(!0)):(c.current!=="scroll"&&(m("scroll"),c.current="scroll"),g(!1))),t=null},50))};let p;return window.ResizeObserver?p=new ResizeObserver(u):window.addEventListener("resize",u),p.observe(i.current),p.observe(l.current),()=>{p?p.disconnect():window.removeEventListener("resize",u),t&&clearTimeout(t)}},[m]),r.jsxs(Z,{ref:i,className:`${L?"scroll-mode":""}`,children:[r.jsx("div",{className:"compact-context",ref:l,children:h}),r.jsx("div",{className:"fix-container",ref:E,children:x})]})}const Z=w.div`
2
- display: flex;
3
- flex-direction: column;
4
- width: 100%;
5
- height: 100%;
6
- animation: fadein ease 0.5s;
7
-
8
- .fix-container {
9
- margin-top: auto;
10
- width: 100%;
11
- }
12
-
13
- &.scroll-mode {
14
- .compact-context {
15
- flex: 1;
16
- overflow-y: auto;
17
- }
18
- .fix-container {
19
- margin-top: auto;
20
- flex-shrink: 0;
21
- }
22
- }
23
-
24
- @keyframes fadein {
25
- 0% {
26
- opacity: 0;
27
- }
28
- 100% {
29
- opacity: 1;
30
- }
31
- }
32
- `;A.propTypes={children:f.any,bottom:f.element.isRequired,onBottomFix:f.func};function ee({onNext:h=()=>{},onPrevious:x=()=>{},buttonText:m=""}){const{t:i}=V(),[l,E]=d.useState(!1),[c,L]=d.useState(null),{did:g,blocklet:t,actions:u}=Y(),{prefix:p,getSessionInHeader:R}=Q();let O=(t.configs||[]).filter(e=>!a.BLOCKLET_CONFIGURABLE_KEY[e.key]);const T=t.environments.find(e=>e.key==="BLOCKLET_PASSPORT_COLOR"),S=F(W.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${t?.updatedAt}`),P=[{key:a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE,description:i("blocklet.config.logoSquare"),value:t.environments.find(e=>e.key==="BLOCKLET_APP_LOGO_SQUARE")?.value,componentType:"uploader",skipButtonDisabled:!0,solo:!0,componentProps:{url:S,height:120,width:120,type:"square",did:g,prefix:p,headers:R,onUploaded:u.refreshBlocklet}},{key:a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:i("blocklet.config.name"),value:t.environments.find(e=>e.key==="BLOCKLET_APP_NAME").value},{key:a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:i("blocklet.config.description"),value:t.environments.find(e=>e.key==="BLOCKLET_APP_DESCRIPTION").value},{key:a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,description:i("blocklet.config.passportColor"),value:T?T.value:"auto",hidden:!0,componentType:"passport",componentProps:{blocklet:t}}],k=[];B.forEachChildSync(t,(e,{ancestors:o})=>{const n=o.slice(1).map(s=>s.meta.did);k.push((e.configs||[]).map(s=>({...s,childDid:n.concat(e.meta.did)})))}),t.meta.group===a.BlockletGroup.gateway&&(O=O.filter(e=>!e.secure&&e.shared));const K=G(q([...O,...k]),"key").filter(e=>!!e.key).sort((e,o)=>e.required&&!o.required?-1:o.required&&!e.required?1:0),N=B.getAppMissingConfigs(t).length,b=async e=>{const{childDid:o,...n}=c,s=[{...H(n,["key","value","description"]),value:e}];try{E(!0),await u.configBlocklet({configs:s,childDid:o})}catch(C){D.error(C.message)}finally{E(!1)}},v={},I=[...P,...K].reduce((e,o)=>{const{value:n,...s}=o;v[o.key]=n;const C=n?n.match(a.BLOCKLET_AUTOMATIC_ENV_VALUE_REGEX):null;if(C!==null||n===a.BLOCKLET_AUTOMATIC_ENV_VALUE){let y=e.find(_=>_.componentType==="collapse");return y||(y={key:"BLOCKLET_CONFIG_COLLAPSE",description:i("blocklet.config.advanced"),componentType:"collapse",children:[]}),C!==null&&(s.hidden=!0),y.children.push({...s}),[...e.filter(_=>_.componentType!=="collapse"),y]}return e.push({...s}),e},[]).map(e=>{if(e.componentType==="collapse"){const o=e.children.every(n=>n.hidden===!0);return{...e,hidden:o}}return e}),j=()=>{x()};return r.jsxs(X,{children:[r.jsx("div",{className:"header",style:{marginBottom:16},children:r.jsx(M,{title:i("setup.config.title"),subTitle:i("setup.config.subTitle"),onClickBack:j})}),r.jsx("div",{className:"container-main",children:r.jsx("div",{className:"container-inner",children:r.jsx(A,{bottom:r.jsx($,{mt:8,disabled:l||c,blocklet:t,onStartNow:()=>h("complete"),children:r.jsx(J,{variant:"contained",disabled:l||N||c,onClick:()=>{u.refreshFuel({showError:!1}),h()},children:m||i("setup.next")})}),children:r.jsx(z,{style:{margin:"0 auto 20px"},loading:l,schema:I,defaultValue:v,onChange:(e,{action:o,currentItem:n})=>{o==="edit"?L(n):["cancel","confirm"].includes(o)&&L(null),o==="confirm"&&b(e[n.key])}})})})})]})}ee.propTypes={buttonText:f.string,onNext:f.func,onPrevious:f.func};export{ee as default};
@@ -1 +0,0 @@
1
- import{dr as e,ds as c,dt as t,du as o}from"./vendor-mui-core-CV-FnYH_.js";import{c as n}from"./index-CXp5SI_f.js";const a=[{value:n.WHO_CAN_ACCESS.ALL,icon:e,title:{zh:"面向所有人",en:"Open to Everyone"},description:{zh:"任何人都可以访问应用而不需要身份验证。",en:"Anyone can access this blocklet without authenticating."}},{value:n.WHO_CAN_ACCESS.INVITED,icon:c,title:{zh:"仅限受邀",en:"Invite-Only Access"},description:{zh:"仅限受邀用户可访问应用。",en:"Only invited members can access."}},{value:n.WHO_CAN_ACCESS.ADMIN,icon:t,title:{zh:"仅限拥有者 & 管理员",en:"Owner & Admin Access."},description:{zh:"仅限拥有者或管理员访问应用。",en:"Only the owner or an admin can access it."}},{value:n.WHO_CAN_ACCESS.OWNER,icon:o,title:{zh:"仅限拥有者",en:"Owner-Only Access"},description:{zh:"仅限拥有者访问应用。",en:"Only the blocklet owner can access it."}}];export{a as A};
@@ -1 +0,0 @@
1
- import{G as ee,j as s,al as g,L as ne,a7 as oe,af as se,R as te}from"./vendor-mui-core-CV-FnYH_.js";import{u as re,j as ae,r as D,L as ce}from"./vendor-react-DX7tU9aY.js";import{u as ie,z as le,j as de,c as pe,p as S,H as E,S as U,k as me,i as fe}from"./index-CXp5SI_f.js";import{a as R,b as x,j as ge,x as he}from"./vendor-hooks-DAZ1H6Va.js";import{o as ue}from"./vendor-arcblock-Dll6qxMT.js";import{W as we,af as ke,a3 as xe,Q as T,aw as Te}from"./vendor-ux-CLT2i3Pv.js";import{u as be}from"./use-passport-id-B-b-_oYF.js";import{b as ve,c as Ce,F as _e,z as Ie,x as ye,a2 as Pe,a5 as Le}from"./vendor-utils-BzQg432x.js";import{g as M}from"./get-safe-url-beob4f2C.js";import{K as je}from"./landing-page-JLA-ZD1t.js";import{d}from"./logger-CCAAJ2Xo.js";import"./use-blocklet-logo-Cf1j7pQz.js";const De={primary:{light:"#51A2FF"}},N="authorization_response",Se=fe(),Ee="blocklet:onLogin",h=new BroadcastChannel(Ee);function Qe(){const{getPassportId:O}=be(),{session:F,connectApi:A}=ie(),{t:a,locale:u}=we(),B=re(),[i]=ae(),{encrypt:H}=le(),W=ee(),b=ke();let p={};try{p=JSON.parse(decodeURIComponent(de(i.get("params"))))}catch(n){console.error("parse connect params failed",n)}ve(i.get("popup"));const z=R(()=>{const n=globalThis.blocklet?.settings?.actionConfig?.login;return n?.[u]||n?.en},[globalThis.blocklet?.settings?.actionConfig?.login,u]),{action:m="login",passkeyBehavior:K="both",extraParams:l={},messages:J,...w}=p;D.useEffect(()=>{l.inviter&&window.localStorage.setItem("inviter",l.inviter)},[l.inviter]);const c=i.get("redirect"),v=i.get("opener"),k=i.get("_ek_");l.passportId=O(),m==="login"&&Ce(w.forceConnected)&&(w.forceConnected=!1);const f=n=>k?H(JSON.stringify(n),k):n,C=D.useMemo(()=>c||!window.opener?"redirect":"popup",[c]),_=async n=>{const e=await Se.federated.getTrustedDomains();if(!v){e.forEach(o=>{window.opener.postMessage(n,Pe(o)),window.opener.postMessage(n,Le(o))});return}const t=new URL(v);if(!e.includes(t.hostname))throw T.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(n,t.origin)},I=({encrypted:n=!0,...e},t,o)=>{d("connect page onSuccess",{encrypted:n,result:e,options:o}),n&&(e.sessionToken&&(e.sessionToken=t(e.sessionToken)),e.csrfToken&&(e.csrfToken=t(e.csrfToken)),e.refreshToken&&(e.refreshToken=t(e.refreshToken)),e.visitorId&&(e.visitorId=t(e.visitorId)),d("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const L={type:N,response:e,options:o};({redirect:()=>{d("connect page onSuccess redirect",e),setTimeout(()=>{if(U(),c){const j=decodeURIComponent(c),r=S(j);k&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",f(e.sessionToken)),e.csrfToken&&r.searchParams.set("csrfToken",f(e.csrfToken)),e.refreshToken&&r.searchParams.set("refreshToken",f(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",f(e.visitorId)),o?.connected_did&&r.searchParams.set("connected_did",o.connected_did),o?.connected_pk&&r.searchParams.set("connected_pk",o.connected_pk),o?.connected_app&&r.searchParams.set("connected_app",o.connected_app),o?.connected_wallet_os&&r.searchParams.set("connected_wallet_os",o.connected_wallet_os),o?.saveConnect&&r.searchParams.set("saveConnect",o.saveConnect),h.postMessage({...ye(e,["sessionToken","refreshToken","visitorId"])}),me(j)?window.location.replace(M(r.href,{allowDomains:null})):B(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},3e3)},popup:async()=>{d("connect page onSuccess popup",L),await _(L),U(),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[C]()},Q=n=>{const e={type:N,error:n.message,errorDescription:n.message};d("connect page onError",{res:e}),{redirect:()=>{T.error(n.message)},popup:()=>{_(e)}}[C]()},$=R(()=>{if(m!=="login")return null;const n=window.blocklet?.trustedFactories||[];return n?.length>0?s.jsxs(g,{children:[a("exchangePassport.tooltip1"),s.jsx(g,{component:ce,reloadDocument:!0,to:_e(Ie(pe.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:c||"/"}),sx:{color:De.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),s.jsx(g,{component:"ul",sx:{pl:1.5},children:n.map(e=>s.jsx(g,{component:"li",children:e},e))})]}):null},[m]),G=x(async()=>{if(!c)return!0;let n;try{n=new URL(c)}catch{return!1}let e;try{e=new URL(p?.baseUrl)}catch{try{e=new URL(p?.prefix)}catch(t){console.error("baseUrl and prefix are both invalid",t)}}if(e){let t=[];if(e.origin===window.location.origin?t=window.blocklet.domainAliases||[]:t=(await xe(e.origin))?.domainAliases||[],!t.includes(n.hostname))return T.error(a("login.invalidRedirectUrl")),!1}return!0}),y=x(()=>{const n=decodeURIComponent(c),e=S(n);window.location.replace(M(e.href,{allowDomains:null}))}),V=!0,X=!0,q=ne(n=>n.breakpoints.down("lg")),P=x(async()=>{if(await G()&&V){window.temporaryDIDConnectOnSuccess=(t,o)=>{I(t,o,{saveConnect:!0})};const e=Te({title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},z||{},J||{});setTimeout(()=>{A.open({locale:u,action:m,passkeyBehavior:K,extraParams:l,...w,className:"connect",popup:!0,messages:e,extraContent:$,useSocket:!0,allowWallet:["1","true",void 0,null].includes(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET),onSuccess:I,onError:Q,hideCloseButton:X})})}});if(ge(()=>{P(),h.addEventListener("message",y)}),he(()=>{delete window.temporaryDIDConnectOnSuccess,h.removeEventListener("message",y),h.close()}),F.loading)return s.jsxs(s.Fragment,{children:[s.jsx(E,{children:s.jsx("title",{children:"DID Connect"})}),s.jsx(ue,{children:s.jsx(oe,{})})]});const Y=globalThis.blocklet.appName,Z=globalThis.blocklet.appDescription;return s.jsxs(s.Fragment,{children:[s.jsx(E,{children:s.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),q&&!b.arcSphere?s.jsx(se,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${W.palette.background.default} !important`}}}):s.jsx(je,{did:globalThis.blocklet.appPid,title:Y,description:Z,actions:b.arcSphere?null:s.jsx(te,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:P,children:a("login.login")})})]})}export{Qe as default};
@@ -1 +0,0 @@
1
- import{r as h}from"./vendor-react-DX7tU9aY.js";import{W as x,R as C,Q as f}from"./vendor-ux-CLT2i3Pv.js";import{c as w,b,a as R}from"./index-2M4w6J9r.js";import{o as y,G as I,V as E,W as T,b7 as P,bm as U}from"./index-CXp5SI_f.js";import{j as t,al as m,T as g,I as B,bB as q,X as r,cm as W}from"./vendor-mui-core-CV-FnYH_.js";import"./index-BojVbZw0.js";import{u as F}from"./config-space-DfstlHnF.js";import{f as D}from"./index-DBs9Ljax.js";import{a as N,D as O,z as A}from"./vendor-utils-BzQg432x.js";import"./api-B8JXuhVp.js";function J(){const{t:e}=x();return t.jsx(m,{children:t.jsxs(m,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center"},children:[t.jsx(w,{style:{width:250,height:250}}),t.jsx(g,{sx:{marginTop:"24px"},children:e("storage.spaces.connect.providerForStorage")})]})})}function j({spaceGateway:e,onDeleteSpace:i=()=>{}}){const{t:n}=x(),[a,l]=h.useState(!1),[o,d]=h.useState(!1),u=(s,p)=>{s?.stopPropagation(),l(p)},c=async s=>{try{s?.stopPropagation(),d(!0),await i(e),l(!1)}catch(p){console.error(p),f.error(`${n("storage.spaces.gateway.delete.failed")}: ${D(p)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(B,{size:"small",onClick:s=>u(s,!0),children:t.jsx(q,{})}),t.jsx(C,{title:n("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:n("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:o}},cancelButton:{text:n("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:c,onCancel:s=>u(s,!1),children:t.jsx(g,{sx:{wordWrap:"break-word"},children:n("storage.spaces.gateway.delete.descForStorage",{name:`${e?.name}`})})})]})}j.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};function S({spaceGateway:e,onDisconnect:i=()=>{}}){const{t:n}=x(),a=async()=>{try{await i(),f.success(n("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(l){console.error(l),f.error(D(l))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}S.propTypes={spaceGateway:r.shape({did:r.string.isRequired,name:r.string.isRequired,url:r.string.isRequired,endpoint:r.string.isRequired}).isRequired,onDisconnect:r.func};function K(){const{t:e}=x(),{spaceGateway:i,settingStorageEndpoint:n}=F();return t.jsxs(m,{sx:{display:"flex",flexDirection:"column"},children:[t.jsx(m,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:t.jsx(g,{sx:{fontSize:"1rem",fontWeight:"bold"},children:e("storage.spaces.connected.title")})}),t.jsx(m,{children:t.jsx(b,{sx:{marginTop:2},endpoint:i.endpoint,selected:!0,action:a=>t.jsx(S,{...a,onDisconnect:()=>n(null)})})})]})}function $({blocklet:e}){if(N(e))return{};const{appDid:i}=e,n=y.getAppName(e),a=y.getAppDescription(e),o=e?.site?.domainAliases?.sort((c,s)=>c.accessibility.accessible&&s.accessibility.accessible?+c.isProtected-+s.isProtected:+s.accessibility.accessible-+c.accessibility.accessible)?.map(c=>{const s=c?.domainStatus?.isHttps?"https://":"http://",p=c?.value;return`${s}${p}`}).filter(Boolean)?.[0],d=I.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:i,appName:n,appDescription:a,appUrl:o,scopes:d,referrer:u,isReady:!!o}}function v({onConnect:e=()=>{},...i}){const{blocklet:n}=E(),{info:a}=T(),{t:l}=x(),o=$({blocklet:n}),d=P(a),u={checkFn:O.create({baseURL:A(window.location.origin,U())}).get,webWalletUrl:d,extraParams:{appPid:n.appPid,appDid:o.appDid,appName:o.appName,appDescription:o.appDescription,appUrl:o.appUrl,referrer:o.referrer,scopes:o.scopes,nodeDid:a.did}},c=async({spaceGateway:s})=>{try{await e(s),f.success(l("storage.spaces.connectedWithName",{name:s.name}))}catch(p){console.error(p),f.error(D(p))}};return t.jsx(R,{...i,options:u,onSuccess:c})}v.propTypes={onConnect:W.func};export{K as C,J as D,v as a,$ as u};