@abtnode/blocklet-services 1.16.29 → 1.16.30-beta-958ae719

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 (209) hide show
  1. package/api/index.js +2 -0
  2. package/api/libs/connect/session.js +6 -2
  3. package/api/routes/federated.js +3 -14
  4. package/api/routes/openembed.js +164 -0
  5. package/api/routes/user.js +7 -6
  6. package/api/services/auth/connect/setup.js +2 -2
  7. package/dist/assets/{Add-B2tTKEMF.js → Add-CG0lOPyd.js} +1 -1
  8. package/dist/assets/{AddBox-B_ujO0_p.js → AddBox-Cwjttlhg.js} +1 -1
  9. package/dist/assets/{Alert-Dpm7qDYx.js → Alert-g4kHOcZt.js} +1 -1
  10. package/dist/assets/{ArrowDropDown-Bbuyv1lE.js → ArrowDropDown-BTiX8PXn.js} +1 -1
  11. package/dist/assets/{Avatar-BUFa3I7L.js → Avatar-CR4hwIIm.js} +1 -1
  12. package/dist/assets/{ButtonGroup-Dy_3TNWh.js → ButtonGroup-CgY-ppCE.js} +1 -1
  13. package/dist/assets/{CheckCircle-CJm2emkm.js → CheckCircle-Vqx7zt5L.js} +1 -1
  14. package/dist/assets/{ChevronRight-86t7cTOH.js → ChevronRight-DyDbYWH3.js} +1 -1
  15. package/dist/assets/{Close-BYk04MBB.js → Close-CtwY6QYr.js} +1 -1
  16. package/dist/assets/{CloseOutlined-J2mzxYfr.js → CloseOutlined-ZLLhO9hq.js} +1 -1
  17. package/dist/assets/{Delete-B9GqJi6E.js → Delete-CRjviPIR.js} +1 -1
  18. package/dist/assets/{DeleteOutline-4tV22N5G.js → DeleteOutline-C5wDmNvo.js} +1 -1
  19. package/dist/assets/{Done-COFqGl-V.js → Done-Cl6BxREa.js} +1 -1
  20. package/dist/assets/{Download-BN2qoa8L.js → Download-BzWUtZG0.js} +1 -1
  21. package/dist/assets/{Edit-MwMrwmSL.js → Edit-CnHAWZqz.js} +1 -1
  22. package/dist/assets/{EditIcon-BXD4Yp7Y.js → EditIcon-DC9F3tcA.js} +1 -1
  23. package/dist/assets/{Error-BPziGUer.js → Error-pSlqmXD8.js} +1 -1
  24. package/dist/assets/{ExpandMore-Bndw6T5W.js → ExpandMore-DjWcUZ_t.js} +1 -1
  25. package/dist/assets/{FilterList-Drg2vaRW.js → FilterList-DclE2l4O.js} +5 -5
  26. package/dist/assets/{FormControl-DPMPTS0i.js → FormControl-CTJIBsW8.js} +1 -1
  27. package/dist/assets/{FormControlLabel-BEUPUFZZ.js → FormControlLabel-xqZ79iQ8.js} +1 -1
  28. package/dist/assets/{FormGroup-B8n_A1si.js → FormGroup-B7SNePwe.js} +1 -1
  29. package/dist/assets/{Google-CW7wCZhn.js → Google-C2r6grDK.js} +3 -3
  30. package/dist/assets/{Hidden-rBUI7TaF.js → Hidden-CVIT9GQJ.js} +1 -1
  31. package/dist/assets/{InfoOutlined-BeHnOzxv.js → InfoOutlined-BNiOudlP.js} +1 -1
  32. package/dist/assets/{InputAdornment-dFvDjSPj.js → InputAdornment-BtP5WuDE.js} +1 -1
  33. package/dist/assets/{InputLabel-Cr2F0wL_.js → InputLabel-o8Jz2Es-.js} +1 -1
  34. package/dist/assets/{LastPage-BsSK0r__.js → LastPage-DOrkqqL0.js} +1 -1
  35. package/dist/assets/{Launch-DpNNGEN3.js → Launch-CPwTTy1C.js} +1 -1
  36. package/dist/assets/{LaunchOutlined-CRtlq0AR.js → LaunchOutlined-DGyXSGnN.js} +1 -1
  37. package/dist/assets/{Link-R_Yn6p48.js → Link-CyjzJAjs.js} +1 -1
  38. package/dist/assets/{ListItemText-CBTf5ICv.js → ListItemText-CRfaCcXD.js} +1 -1
  39. package/dist/assets/{LoadingButton-BoQb-s6Y.js → LoadingButton-D0rQ4RAj.js} +1 -1
  40. package/dist/assets/{LockIcon-w57uKQ3n.js → LockIcon-DRPStlvR.js} +1 -1
  41. package/dist/assets/{Loop-BTr7nsa4.js → Loop-BgnXgwOk.js} +1 -1
  42. package/dist/assets/{MoreVert-CrVGyEb1.js → MoreVert-Dw6DD_Y2.js} +1 -1
  43. package/dist/assets/{OpenInNew-Bwk37Gfj.js → OpenInNew-DbfI3Lh3.js} +1 -1
  44. package/dist/assets/{Pagination-YU3tVxJ_.js → Pagination-DC7XW3JJ.js} +1 -1
  45. package/dist/assets/{PlayArrow-BJoSmHTy.js → PlayArrow-D4Qo296a.js} +1 -1
  46. package/dist/assets/{QuestionMarkCircle-BrwbMFMj.js → QuestionMarkCircle-DM_KgJxi.js} +1 -1
  47. package/dist/assets/{RadioGroup-D3rZMCGA.js → RadioGroup-4mE-Sstp.js} +1 -1
  48. package/dist/assets/{Search-c39KP22B.js → Search-5XN6Shqj.js} +1 -1
  49. package/dist/assets/{Select-DmK_UTE4.js → Select-B7YRgule.js} +1 -1
  50. package/dist/assets/{ServerLogo-D0823EKu.js → ServerLogo-BUr8k8lJ.js} +1 -1
  51. package/dist/assets/{Skeleton-DN0tRP6u.js → Skeleton-BLQuUW4t.js} +1 -1
  52. package/dist/assets/{Slider-C_ldMI6V.js → Slider-DtDM_Fj3.js} +1 -1
  53. package/dist/assets/{Stepper-2xT4uG_5.js → Stepper-ipc5scPk.js} +1 -1
  54. package/dist/assets/{TextField-Bkhn_ICi.js → TextField-endZMNmB.js} +1 -1
  55. package/dist/assets/{Toolbar-C0HRONVo.js → Toolbar-DX1aq1wO.js} +1 -1
  56. package/dist/assets/{ViewList-Bk6tK-64.js → ViewList-CasIbr2G.js} +1 -1
  57. package/dist/assets/{access-control-BcwTyvZM.js → access-control-DkNCBsPA.js} +2 -2
  58. package/dist/assets/{actions-D4k69_We.js → actions-9fivoUdA.js} +1 -1
  59. package/dist/assets/{add-component-core-B0AEX2FM.js → add-component-core-wL-COQaV.js} +1 -1
  60. package/dist/assets/add-resource-Df_RDVa7.js +1 -0
  61. package/dist/assets/{addon-B5MwpZhH.js → addon-Cv3tGV2W.js} +1 -1
  62. package/dist/assets/{analytics-EroCOImH.js → analytics-rvn5F6QD.js} +6 -6
  63. package/dist/assets/api-BNgzqvJ7.js +1 -0
  64. package/dist/assets/{ar-D-8bmv2Q.js → ar-CYspPmSu.js} +1 -1
  65. package/dist/assets/{audit-logs-Drk8FNek.js → audit-logs-2O7BG2mg.js} +1 -1
  66. package/dist/assets/{button-D1lJuSFs.js → button-CEyyV78a.js} +1 -1
  67. package/dist/assets/{click-to-copy-DEiZxYJs.js → click-to-copy-D1J7QI3P.js} +1 -1
  68. package/dist/assets/{complete-Cdfx9nd9.js → complete-jHArngON.js} +2 -2
  69. package/dist/assets/{component-BV7xH0dQ.js → component-DPFryr0O.js} +45 -45
  70. package/dist/assets/{config-BX1_V_Zk.js → config-itS8qGTV.js} +2 -2
  71. package/dist/assets/{config-ndRRaW6N.js → config-jPzmOFAo.js} +1 -1
  72. package/dist/assets/{config-navigation-BESD8UIe.js → config-navigation-1vegbn3x.js} +1 -1
  73. package/dist/assets/confirm-6IBLCQWG.js +7 -0
  74. package/dist/assets/{connect-Bf6AtQ9N.js → connect-Io-Sd2o8.js} +1 -1
  75. package/dist/assets/{connect-to-CJW-XMyq.js → connect-to-B7cIbJqa.js} +2 -2
  76. package/dist/assets/{connect-CuJeZswg.js → connect-yhMAMNNa.js} +1 -1
  77. package/dist/assets/{content-layout-gVbqQFw2.js → content-layout-C1Pp8q6y.js} +1 -1
  78. package/dist/assets/{dashboard-Dqyu1z0z.js → dashboard-wzf1gV3S.js} +3 -3
  79. package/dist/assets/{de-BXUm1QYV.js → de-DIG5UukX.js} +1 -1
  80. package/dist/assets/{did-address-CNBFLmND.js → did-address-DbLRcPW2.js} +1 -1
  81. package/dist/assets/{domain-BeQX5z9S.js → domain-Ciwj74aJ.js} +1 -1
  82. package/dist/assets/{domain-list-Ci50sEhN.js → domain-list-m_UrIGIZ.js} +1 -1
  83. package/dist/assets/{es-CH6tZGrR.js → es-iIE-oygq.js} +1 -1
  84. package/dist/assets/{exchange-passport-iiwCGzBP.js → exchange-passport-BO-a9dn2.js} +1 -1
  85. package/dist/assets/{fallback-AxhiHbBa.js → fallback-DfrimSeM.js} +1 -1
  86. package/dist/assets/{format-error-BvsdhOPE.js → format-error-BhfIHXu5.js} +1 -1
  87. package/dist/assets/{fr-roccVFT3.js → fr-D8XyKysR.js} +1 -1
  88. package/dist/assets/{fuel-xzXBP1hL.js → fuel-CG6ojqAM.js} +1 -1
  89. package/dist/assets/{fullpage-okV_7hyQ.js → fullpage-56S9hblE.js} +1 -1
  90. package/dist/assets/{hi-VN-lZj6f.js → hi-C12r029w.js} +1 -1
  91. package/dist/assets/{home-BbZvooYM.js → home-Cky9w9lt.js} +1 -1
  92. package/dist/assets/{id-C-ovCb8b.js → id-BM1nX889.js} +1 -1
  93. package/dist/assets/{iframe-BCrCaSL7.js → iframe-C8eAx0ue.js} +1 -1
  94. package/dist/assets/{index-Cxy6HL90.js → index-07q3psNE.js} +4 -4
  95. package/dist/assets/{index-De6Naxqp.js → index-BOI9Etqy.js} +1 -1
  96. package/dist/assets/{index-BYqabJ7u.js → index-BV6891pg.js} +1 -1
  97. package/dist/assets/{index-BuKpBFXJ.js → index-BX4EYBTI.js} +1 -1
  98. package/dist/assets/{index-DnjdsAXn.js → index-BXLC5YsG.js} +1 -1
  99. package/dist/assets/{index-zsXw46EV.js → index-BfYPk2Ns.js} +5 -5
  100. package/dist/assets/{index-CJRQAR_e.js → index-BmnLIYuM.js} +1 -1
  101. package/dist/assets/{index-C0C8sj0f.js → index-Bybdue8D.js} +1 -1
  102. package/dist/assets/{index-BDo-QYGM.js → index-C1bE9VVH.js} +1 -1
  103. package/dist/assets/{index-4972Ig28.js → index-CBjzOjOd.js} +1 -1
  104. package/dist/assets/{index-DN_A6H1f.js → index-CKcMAUDG.js} +1 -1
  105. package/dist/assets/index-CNFT0-Ni.js +54 -0
  106. package/dist/assets/{index-GxRfisAA.js → index-CWIS84zj.js} +1 -1
  107. package/dist/assets/index-CkRJpRBQ.js +288 -0
  108. package/dist/assets/{index-Cf5QKw7p.js → index-CmxSwDI6.js} +2 -2
  109. package/dist/assets/{index-CP2d3Av1.js → index-CrLI5hsM.js} +1 -1
  110. package/dist/assets/{index-CoH56Uqf.js → index-CsBSc17R.js} +1 -1
  111. package/dist/assets/{index-BeqdHb1K.js → index-CurAG5ra.js} +1 -1
  112. package/dist/assets/{index-DjRZjTaR.js → index-CyJ9Y2Pj.js} +1 -1
  113. package/dist/assets/{index-U0futuIe.js → index-D5aNUG7R.js} +1 -1
  114. package/dist/assets/{index-Cp_VQSnB.js → index-DDlZxdHs.js} +12 -12
  115. package/dist/assets/index-DHlnMGYf.js +262 -0
  116. package/dist/assets/{index-oJ0qFAnh.js → index-DT-emwXk.js} +1 -1
  117. package/dist/assets/{index-DK_iQDKo.js → index-DZJL1WDO.js} +1 -1
  118. package/dist/assets/{index-C6Gfmuv5.js → index-DateZnmM.js} +1 -1
  119. package/dist/assets/index-Dmbbtwcx.js +1290 -0
  120. package/dist/assets/{index-lriS0sBo.js → index-GW-nVnu4.js} +1 -1
  121. package/dist/assets/{index-D7gdkTd_.js → index-JnaF5h1j.js} +1 -1
  122. package/dist/assets/{index-DDLwOMuE.js → index-L5tSQmgu.js} +2 -2
  123. package/dist/assets/index-VVvFogSs.js +4 -0
  124. package/dist/assets/{index-DRw1PpfG.js → index-dy4QInQY.js} +1 -1
  125. package/dist/assets/{index-BUCbH5ql.js → index-hRsyLKnV.js} +7 -7
  126. package/dist/assets/{index.es-CXIzaenE.js → index.es-CD9lf3-y.js} +1 -1
  127. package/dist/assets/{index.esm-BHld0R34.js → index.esm-CpwI0AL8.js} +1 -1
  128. package/dist/assets/{invitation-w8YedKTy.js → invitation-Crk_xWho.js} +8 -8
  129. package/dist/assets/invite-CAtT4wk7.js +10 -0
  130. package/dist/assets/issue-passport-BrZORR7a.js +1 -0
  131. package/dist/assets/{item-DE26aStl.js → item-BDrWi6Cq.js} +1 -1
  132. package/dist/assets/{ja-D-sN9ij0.js → ja-D8yfIRFO.js} +1 -1
  133. package/dist/assets/{jss-plugin-props-sort.esm-BdIs7KPF.js → jss-plugin-props-sort.esm-CxybFEV3.js} +1 -1
  134. package/dist/assets/{ko-DFpbqZ_Q.js → ko-BYDKCXC0.js} +1 -1
  135. package/dist/assets/{launch-result-message-CaevuCfD.js → launch-result-message-DBJzH0h9.js} +1 -1
  136. package/dist/assets/{layout-DL9ESJOH.js → layout-DtKhmT8b.js} +1 -1
  137. package/dist/assets/{list-header-Ds_unX2d.js → list-header-Cu1hbnbK.js} +1 -1
  138. package/dist/assets/localization-CVbsHC7x.js +1 -0
  139. package/dist/assets/{log-Dxy_6gha.js → log-DJmTBua7.js} +1 -1
  140. package/dist/assets/{login-CAqDnaRd.js → login-Q7ywRtFl.js} +1 -1
  141. package/dist/assets/{login-oauth-callback-DYXwpvqB.js → login-oauth-callback-ByuyyozV.js} +1 -1
  142. package/dist/assets/{logo-uploader-DJ-jwxYK.js → logo-uploader-CckDhLFg.js} +3 -3
  143. package/dist/assets/{lost-passport-Dgwel0md.js → lost-passport-n3NQrqmC.js} +3 -3
  144. package/dist/assets/{lottie-DqVCevwM.js → lottie-DCFmlsXD.js} +1 -1
  145. package/dist/assets/{notifications-pIEPdGq8.js → notifications-B0WHkfOF.js} +1 -1
  146. package/dist/assets/{open-window-Cxc_Ng-U.js → open-window-pAT9qa3y.js} +1 -1
  147. package/dist/assets/overview-DJSRJCyQ.js +12 -0
  148. package/dist/assets/{page-header-Dj8RNld9.js → page-header-ChIMB2y3.js} +1 -1
  149. package/dist/assets/{permission-D-DD_G6T.js → permission-BEB8Rrlb.js} +1 -1
  150. package/dist/assets/{preferences-l2R71Kr4.js → preferences-BU9WNieK.js} +1 -1
  151. package/dist/assets/{pt-BXC7UTMq.js → pt-B9DRiZEN.js} +1 -1
  152. package/dist/assets/publish-resource-B4Cy2eZf.js +1 -0
  153. package/dist/assets/{react-ChRfz7rm.js → react-iG64dalH.js} +3 -3
  154. package/dist/assets/{redux-BzBcp8M-.js → redux-CSBj6943.js} +1 -1
  155. package/dist/assets/{resource-dialog-BL0PXuZY.js → resource-dialog-BGVNvpOa.js} +3 -3
  156. package/dist/assets/{ru-BbD1NNUC.js → ru-CUxGgO8D.js} +1 -1
  157. package/dist/assets/sdk-D8S3f1Cw.js +1 -0
  158. package/dist/assets/{selector-DM39G-IG.js → selector-B2CAnybg.js} +3 -3
  159. package/dist/assets/session-CUH6PcMg.js +1 -0
  160. package/dist/assets/setup-CirnA0Ka.js +19 -0
  161. package/dist/assets/{shorten-label-CBUJuv2z.js → shorten-label-C5kLk3Aq.js} +1 -1
  162. package/dist/assets/{slicedToArray-D3qT2xrr.js → slicedToArray-CCyaOd9K.js} +2 -2
  163. package/dist/assets/{spaces-Dy94Pppx.js → spaces-pVN9ClcY.js} +1 -1
  164. package/dist/assets/{start-B5SkjHxA.js → start-iEd5-B9Q.js} +1 -1
  165. package/dist/assets/{step-actions-lNBluf34.js → step-actions-iUTFNQ9f.js} +2 -2
  166. package/dist/assets/{studio-Dyzo9gvw.js → studio-DkxabEpU.js} +1 -1
  167. package/dist/assets/{switch-control-BZoRefS-.js → switch-control-DB62K84_.js} +1 -1
  168. package/dist/assets/{th-VkDcmE_T.js → th-D6abaOt7.js} +1 -1
  169. package/dist/assets/{toUpper-qfNUvmkW.js → toUpper-DvPEhWeW.js} +1 -1
  170. package/dist/assets/{transfer-DMokNRYm.js → transfer-DV6QHiEb.js} +1 -1
  171. package/dist/assets/{uniqBy-DER8YBQ7.js → uniqBy-CkxUwg8y.js} +1 -1
  172. package/dist/assets/{unsubscribe-B_tAr5rg.js → unsubscribe-CD6qdfbQ.js} +1 -1
  173. package/dist/assets/{url-join-CDpgNuEj.js → url-join-BXgiL0Wq.js} +1 -1
  174. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-lPpkEES7.js → use-blocklet-info-for-connect-did-spaces-N1tQaruo.js} +1 -1
  175. package/dist/assets/{use-mobile-BCnZR7ht.js → use-mobile-CQDS3X6b.js} +1 -1
  176. package/dist/assets/{useAsync-DSoiLp-a.js → useAsync-CHkkpEZ8.js} +1 -1
  177. package/dist/assets/{useFormControl-CBqLeNuP.js → useFormControl-ThWDsTIL.js} +1 -1
  178. package/dist/assets/{useLocalStorage-DjbRNkiJ.js → useLocalStorage-ObVD0Nh9.js} +1 -1
  179. package/dist/assets/{useSetState-B6lpt1LL.js → useSetState-B70PB8qU.js} +1 -1
  180. package/dist/assets/useSlot-BhbSJM-8.js +1 -0
  181. package/dist/assets/{useSlotProps-CzXTdauO.js → useSlotProps-D0ZQmbeH.js} +1 -1
  182. package/dist/assets/{useThemeProps-CYE8bkPe.js → useThemeProps-B8VNQkzV.js} +1 -1
  183. package/dist/assets/{user-center-DcNHg_hw.js → user-center-1nVYLWmw.js} +1 -1
  184. package/dist/assets/{user-sessions-6jF4DueP.js → user-sessions-DzP40a_O.js} +1 -1
  185. package/dist/assets/{util-BbQsgaPf.js → util-ZqhH60bn.js} +1 -1
  186. package/dist/assets/{vi-CanFbf1v.js → vi-BsX5AAJJ.js} +1 -1
  187. package/dist/assets/wrap-locale-BKjycvsN.js +1 -0
  188. package/dist/assets/{zh-BxXo7x1m.js → zh-BxFByN8K.js} +1 -1
  189. package/dist/assets/{zh-tw-Bvqjz2OU.js → zh-tw-D7VeUoit.js} +1 -1
  190. package/dist/index.html +1 -1
  191. package/dist/service-worker.js +1 -1
  192. package/package.json +25 -25
  193. package/dist/assets/add-resource-Dwhlr_-p.js +0 -1
  194. package/dist/assets/api-DBUv9UoZ.js +0 -1
  195. package/dist/assets/confirm-D0ewRRow.js +0 -7
  196. package/dist/assets/index-3rOQRHRT.js +0 -262
  197. package/dist/assets/index-Bqq3wHbl.js +0 -4
  198. package/dist/assets/index-Bwekh9E9.js +0 -54
  199. package/dist/assets/index-D1xJMZP4.js +0 -288
  200. package/dist/assets/index-RoEjkyyY.js +0 -1290
  201. package/dist/assets/invite-B5s2JB7B.js +0 -10
  202. package/dist/assets/issue-passport-0D5U2s9S.js +0 -1
  203. package/dist/assets/localization-NJebqRnT.js +0 -1
  204. package/dist/assets/overview-BGv5mEim.js +0 -12
  205. package/dist/assets/publish-resource-JgFEyA5w.js +0 -1
  206. package/dist/assets/session-DCmLCX5v.js +0 -1
  207. package/dist/assets/setup-BpjY2WnV.js +0 -14
  208. package/dist/assets/useSlot-Dcztxd47.js +0 -1
  209. package/dist/assets/wrap-locale-Cu_W5gFD.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__fileDeps=["assets/react-ChRfz7rm.js","assets/index-RoEjkyyY.js","assets/index-CCovGSMB.css","assets/index-BuKpBFXJ.js","assets/preact.module-B1z5cdvs.js","assets/index-oJ0qFAnh.js","assets/index-BDo-QYGM.js","assets/toUpper-qfNUvmkW.js","assets/index-Cp_VQSnB.js","assets/fallback-AxhiHbBa.js","assets/index-BYqabJ7u.js","assets/Toolbar-C0HRONVo.js","assets/Hidden-rBUI7TaF.js","assets/index-DDLwOMuE.js","assets/MoreVert-CrVGyEb1.js","assets/selector-DM39G-IG.js","assets/ExpandMore-Bndw6T5W.js","assets/Avatar-BUFa3I7L.js","assets/useSlot-Dcztxd47.js","assets/resource-dialog-BL0PXuZY.js","assets/use-mobile-BCnZR7ht.js","assets/OpenInNew-Bwk37Gfj.js","assets/CloseOutlined-J2mzxYfr.js","assets/Link-R_Yn6p48.js","assets/index-BeqdHb1K.js","assets/index-U0futuIe.js","assets/index-De6Naxqp.js","assets/FormControlLabel-BEUPUFZZ.js","assets/useFormControl-CBqLeNuP.js","assets/index-DK_iQDKo.js","assets/FilterList-Drg2vaRW.js","assets/useThemeProps-CYE8bkPe.js","assets/toPropertyKey-hKuLU48H.js","assets/FormControl-DPMPTS0i.js","assets/FormGroup-B8n_A1si.js","assets/InputLabel-Cr2F0wL_.js","assets/ListItemText-CBTf5ICv.js","assets/Select-DmK_UTE4.js","assets/TextField-Bkhn_ICi.js","assets/LastPage-BsSK0r__.js","assets/index-DnjdsAXn.js","assets/redux-BzBcp8M-.js","assets/Search-c39KP22B.js","assets/Delete-B9GqJi6E.js","assets/index-DRw1PpfG.js","assets/url-join-CDpgNuEj.js","assets/uniqBy-DER8YBQ7.js","assets/react-BW7E7-P9.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
- import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC as Fe,T as J,r as C,aF as x1,aI as l2,aJ as Ue,aK as qe,cL as s2,fo as o1,X as Te,Y as Ne,B as z,m as Oe,P as h,$ as We,F as X,e as m1,u as le,aM as je,aV as Ve,bv as l1,a1 as Ze,L as ue,bI as v0,a as ve,az as ie,J as r2,s as $,Z as ae,dr as n2,a9 as Ce,c as he,G as i2,bT as v1,ce as g0,cA as a2,cJ as He,cK as b0,bh as c2,c_ as d2,cE as Xe,bC as pe,c1 as Je,f9 as u2,a7 as K1,b as oe,bk as p2,dt as h2,ae as j0,bl as f2,ck as x2,aQ as X1,aP as m2,a2 as w0,fp as J1,e_ as Ie,bi as v2,ap as R0,cR as g2,k as b2,ay as j2,al as w2,am as r1}from"./index-RoEjkyyY.js";import{d as g1}from"./Add-B2tTKEMF.js";import{d as R2}from"./AddBox-B_ujO0_p.js";import{d as C0}from"./Delete-B9GqJi6E.js";import{d as C2}from"./Error-BPziGUer.js";import{D as b1}from"./index-DK_iQDKo.js";import{T as y0,b as y2}from"./index-DN_A6H1f.js";import{C as j1}from"./confirm-D0ewRRow.js";import{u as s1}from"./session-DCmLCX5v.js";import{W as Q1}from"./did-address-CNBFLmND.js";import{B as w1,d as z2}from"./ChevronRight-86t7cTOH.js";import{S as ge}from"./shorten-label-CBUJuv2z.js";import{A as z0}from"./Avatar-BUFa3I7L.js";import{d as S2}from"./Download-BN2qoa8L.js";import{d as k2}from"./QuestionMarkCircle-BrwbMFMj.js";import{b as M2,c as Y1,T as I2}from"./index-BeqdHb1K.js";import{_ as Me}from"./useSetState-B6lpt1LL.js";import{c as R1}from"./index-BDo-QYGM.js";import{C as d1,F as u1,S as L2}from"./FormControlLabel-BEUPUFZZ.js";import{A as S0}from"./Alert-Dpm7qDYx.js";import{p as e1}from"./index-HqFqdQ4r.js";import"./api-DBUv9UoZ.js";import{i as P2}from"./index-C0C8sj0f.js";import{d as T2}from"./ExpandMore-Bndw6T5W.js";import{d as N2}from"./OpenInNew-Bwk37Gfj.js";import{u as k0}from"./useThemeProps-CYE8bkPe.js";import{u as V2}from"./useSlotProps-CzXTdauO.js";import{d as D2}from"./DeleteOutline-4tV22N5G.js";import{c as _2,A as M0,u as B2,S as E2,U as A2}from"./item-DE26aStl.js";import{d as O2}from"./ArrowDropDown-Bbuyv1lE.js";import{f as Pe}from"./format-error-BvsdhOPE.js";import{B as p1}from"./ButtonGroup-Dy_3TNWh.js";import{T as Le}from"./TextField-Bkhn_ICi.js";import{M as C1}from"./InputAdornment-dFvDjSPj.js";import{C as H2}from"./click-to-copy-DEiZxYJs.js";import{d as $2}from"./Launch-DpNNGEN3.js";import{L as F2}from"./MoreVert-CrVGyEb1.js";import{a as U2}from"./ListItemText-CBTf5ICv.js";import{S as Z1}from"./index-De6Naxqp.js";import{M as q2}from"./index-DjRZjTaR.js";import{r as W2}from"./index-CJRQAR_e.js";import{d as G2}from"./Done-COFqGl-V.js";import{c as I0,d as L0,b as K2,S as X2,a as J2}from"./Stepper-2xT4uG_5.js";import{R as Q2,a as e0}from"./RadioGroup-D3rZMCGA.js";import"./FilterList-Drg2vaRW.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-DPMPTS0i.js";import"./useFormControl-CBqLeNuP.js";import"./FormGroup-B8n_A1si.js";import"./InputLabel-Cr2F0wL_.js";import"./Select-DmK_UTE4.js";import"./LastPage-BsSK0r__.js";import"./Toolbar-C0HRONVo.js";import"./index-DnjdsAXn.js";import"./redux-BzBcp8M-.js";import"./Search-c39KP22B.js";import"./index-U0futuIe.js";import"./Link-R_Yn6p48.js";import"./useSlot-Dcztxd47.js";import"./jss-plugin-props-sort.esm-BdIs7KPF.js";const Y2=o2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),Z2=["slots","slotProps"],et=se(m0)(({theme:e})=>O({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":O({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":O({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:G1(e.palette.grey[200],.12)}:{backgroundColor:G1(e.palette.grey[600],.12)})})),tt=se(Y2)({width:24,height:16});function ot(e){const{slots:t={},slotProps:l={}}=e,r=be(e,Z2),n=e;return o.jsx("li",{children:o.jsx(et,O({focusRipple:!0},r,{ownerState:n,children:o.jsx(tt,O({as:t.CollapsedIcon,ownerState:n},l.collapsedIcon))}))})}function lt(e){return Fe("MuiBreadcrumbs",e)}const st=$e("MuiBreadcrumbs",["root","ol","li","separator"]),rt=st,nt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],it=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},lt,t)},at=se(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${rt.li}`]:t.li},t.root]})({}),ct=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),dt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,t,l,r){return e.reduce((n,d,i)=>(i<e.length-1?n=n.concat(d,o.jsx(dt,{"aria-hidden":!0,className:t,ownerState:r,children:l},`separator-${i}`)):n.push(d),n),[])}const pt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiBreadcrumbs"}),{children:n,className:d,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:b=1,maxItems:y=8,separator:p="/"}=r,c=be(r,nt),[m,g]=C.useState(!1),v=O({},r,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:b,maxItems:y,separator:p}),R=it(v),S=l2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=C.useRef(null),T=k=>{const U=()=>{g(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return b+x>=k.length?k:[...k.slice(0,b),o.jsx(ot,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...k.slice(k.length-x,k.length)]},L=C.Children.toArray(n).filter(k=>C.isValidElement(k)).map((k,U)=>o.jsx("li",{className:R.li,children:k},`child-${U}`));return o.jsx(at,O({ref:l,component:i,color:"text.secondary",className:Ue(R.root,d),ownerState:v},c,{children:o.jsx(ct,{className:R.ol,ref:N,ownerState:v,children:ut(m||y&&L.length<=y?L:T(L),R.separator,p,v)})}))}),P0=pt;function ht(e){return Fe("MuiStepButton",e)}const ft=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),t0=ft,xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ht,t)},vt=se(m0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${t0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>O({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${t0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepButton"}),{children:n,className:d,icon:i,optional:a}=r,u=be(r,xt),{disabled:f,active:x}=C.useContext(I0),{orientation:b}=C.useContext(L0),y=O({},r,{orientation:b}),p=mt(y),c={icon:i,optional:a},m=s2(n,["StepLabel"])?C.cloneElement(n,c):o.jsx(K2,O({},c,{children:n}));return o.jsx(vt,O({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,d),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),bt=gt;function jt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const wt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Rt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},jt,t)},Ct=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>O({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),yt=se(o1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),zt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepContent"}),{children:n,className:d,TransitionComponent:i=o1,transitionDuration:a="auto",TransitionProps:u}=r,f=be(r,wt);C.useContext(L0);const{active:x,last:b,expanded:y}=C.useContext(I0),p=O({},r,{last:b}),c=Rt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Ct,O({className:Ue(c.root,d),ref:l,ownerState:p},f,{children:o.jsx(yt,O({as:i,in:x||y,className:c.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:n}))}))}),St=zt;var y1={},kt=Ne;Object.defineProperty(y1,"__esModule",{value:!0});var T0=y1.default=void 0,Mt=kt(Te()),It=o;T0=y1.default=(0,Mt.default)((0,It.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var z1={},Lt=Ne;Object.defineProperty(z1,"__esModule",{value:!0});var N0=z1.default=void 0,Pt=Lt(Te()),Tt=o;N0=z1.default=(0,Pt.default)((0,Tt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function ze({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}ze.propTypes={size:h.number};ze.defaultProps={size:24};function S1({did:e,projectId:t,title:l,logo:r,describe:n}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${r}`,[a,u]=C.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(z0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(ge,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(ge,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:n||"/"})]})]})}S1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function k1({initUrl:e}){const t=m1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:n}=le(),{api:d}=je(),{api:i}=s1(),[a,u]=C.useState(!0),{blocklet:f}=Ve(),[x,b]=C.useState(null),[y,p]=C.useState(!1),c=We(M=>M.breakpoints.down("xl")),{componentDid:m=""}=l1(),[g,v]=C.useState(null),R=()=>{d.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const P=(M==null?void 0:M.projects)||[];u(!1),v(P)}).catch(M=>{u(!1),$.error(M.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=M=>{b(M)},T=()=>{u(!1),p(!0)},L=()=>{p(!1),b(null)},k=M=>{$.error(M.message),p(!1),b(null)},U=M=>{if(!(M!=null&&M.deleted)){$.error("Delete project failed");return}R(),p(!1),b(null)};if(C.useEffect(()=>{R()},[]),!g&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(ze,{})});if(!g)return null;if(!g.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),o.jsx(Ze,{onClick:S,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const P=g[M];return o.jsx(ue,{to:`${P.id}`,children:o.jsx(S1,{did:f.meta.did,projectId:P.id,logo:P.blockletLogo,title:P.blockletTitle,describe:P.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(y0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(Q1,{size:14,compact:!0,responsive:!1,did:M}):null}},c||m?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(Q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},c||m?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const P=(f.children||[]).find(E=>E.meta.did===M);return P?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:14,blocklet:P,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:P.meta.title})]},M):""}}},c||l?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(ge,{children:M})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(v0,{value:Number(M),locale:n})}},{label:r("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const P=g[M];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${P.id}/new-release/${P.lastReleaseId}`,children:o.jsx(ve,{title:r("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"create",children:o.jsx(R2,{style:{fontSize:18}})})})}),!!P.lastReleaseId&&o.jsx(ve,{title:r("blocklet.publish.viewLastRelease",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${P.id}/view/${P.lastReleaseId}`,children:o.jsx(T0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:r("blocklet.publish.delete",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"delete",onClick:()=>N(P),children:o.jsx(C0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),I=y?o.jsx(r2,{open:!0,popup:!0,onClose:L,action:"check-has-project-id",locale:n,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:k,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Nt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),o.jsx(ve,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(N0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Ze,{onClick:S,variant:"contained",children:[o.jsx(g1,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(b1,{className:"main-table",locale:n,data:g,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(j1,{title:`${r("common.delete")} ${x.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:T,onCancel:()=>b(null),children:o.jsx(z,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(C2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(J,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),I]})}k1.propTypes={initUrl:h.object};k1.defaultProps={initUrl:null};const Nt=ae(z)`
1
+ const __vite__fileDeps=["assets/react-iG64dalH.js","assets/index-Dmbbtwcx.js","assets/index-CCovGSMB.css","assets/index-BX4EYBTI.js","assets/preact.module-B1z5cdvs.js","assets/index-DT-emwXk.js","assets/index-C1bE9VVH.js","assets/toUpper-DvPEhWeW.js","assets/index-DDlZxdHs.js","assets/fallback-DfrimSeM.js","assets/index-BV6891pg.js","assets/Toolbar-DX1aq1wO.js","assets/Hidden-CVIT9GQJ.js","assets/index-L5tSQmgu.js","assets/MoreVert-Dw6DD_Y2.js","assets/selector-B2CAnybg.js","assets/ExpandMore-DjWcUZ_t.js","assets/Avatar-CR4hwIIm.js","assets/useSlot-BhbSJM-8.js","assets/resource-dialog-BGVNvpOa.js","assets/OpenInNew-DbfI3Lh3.js","assets/CloseOutlined-ZLLhO9hq.js","assets/use-mobile-CQDS3X6b.js","assets/Link-CyjzJAjs.js","assets/index-CurAG5ra.js","assets/index-D5aNUG7R.js","assets/index-BOI9Etqy.js","assets/FormControlLabel-xqZ79iQ8.js","assets/useFormControl-ThWDsTIL.js","assets/index-DZJL1WDO.js","assets/FilterList-DclE2l4O.js","assets/useThemeProps-B8VNQkzV.js","assets/toPropertyKey-hKuLU48H.js","assets/FormControl-CTJIBsW8.js","assets/FormGroup-B7SNePwe.js","assets/InputLabel-o8Jz2Es-.js","assets/ListItemText-CRfaCcXD.js","assets/Select-B7YRgule.js","assets/TextField-endZMNmB.js","assets/LastPage-DOrkqqL0.js","assets/index-BXLC5YsG.js","assets/redux-CSBj6943.js","assets/Search-5XN6Shqj.js","assets/Delete-CRjviPIR.js","assets/index-dy4QInQY.js","assets/url-join-BXgiL0Wq.js","assets/uniqBy-CkxUwg8y.js","assets/react-BW7E7-P9.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ import{ap as o2,j as o,aD as se,cF as m0,aH as O,fo as G1,aG as be,aB as $e,aC as Fe,T as J,r as C,aF as x1,aI as l2,aJ as Ue,aK as qe,cL as s2,fp as o1,X as Te,Y as Ne,B as z,m as Oe,P as h,$ as We,F as X,e as m1,u as le,aM as je,aV as Ve,bu as l1,a1 as Ze,L as ue,bH as v0,a as ve,az as ie,J as r2,s as $,Z as ae,ds as n2,a9 as Ce,c as he,G as i2,bS as v1,cd as g0,cA as a2,cJ as He,cK as b0,af as c2,c_ as d2,cE as Xe,bB as pe,c0 as Je,fa as u2,a7 as K1,b as oe,bj as p2,du as h2,ae as j0,bk as f2,ck as x2,aQ as X1,aP as m2,a2 as w0,fq as J1,e$ as Ie,bh as v2,aq as R0,cR as g2,k as b2,ay as j2,am as w2,an as r1}from"./index-Dmbbtwcx.js";import{d as g1}from"./Add-CG0lOPyd.js";import{d as R2}from"./AddBox-Cwjttlhg.js";import{d as C0}from"./Delete-CRjviPIR.js";import{d as C2}from"./Error-pSlqmXD8.js";import{D as b1}from"./index-DZJL1WDO.js";import{T as y0,b as y2}from"./index-CKcMAUDG.js";import{C as j1}from"./confirm-6IBLCQWG.js";import{u as s1}from"./session-CUH6PcMg.js";import{W as Q1}from"./did-address-DbLRcPW2.js";import{B as w1,d as z2}from"./ChevronRight-DyDbYWH3.js";import{S as ge}from"./shorten-label-C5kLk3Aq.js";import{A as z0}from"./Avatar-CR4hwIIm.js";import{d as S2}from"./Download-BzWUtZG0.js";import{d as k2}from"./QuestionMarkCircle-DM_KgJxi.js";import{b as M2,c as Y1,T as I2}from"./index-CurAG5ra.js";import{_ as Me}from"./useSetState-B70PB8qU.js";import{c as R1}from"./index-C1bE9VVH.js";import{C as d1,F as u1,S as L2}from"./FormControlLabel-xqZ79iQ8.js";import{A as S0}from"./Alert-g4kHOcZt.js";import{p as e1}from"./index-HqFqdQ4r.js";import"./api-BNgzqvJ7.js";import{i as P2}from"./index-Bybdue8D.js";import{d as T2}from"./ExpandMore-DjWcUZ_t.js";import{d as N2}from"./OpenInNew-DbfI3Lh3.js";import{u as k0}from"./useThemeProps-B8VNQkzV.js";import{u as V2}from"./useSlotProps-D0ZQmbeH.js";import{d as D2}from"./DeleteOutline-C5wDmNvo.js";import{c as _2,A as M0,u as B2,S as E2,U as A2}from"./item-BDrWi6Cq.js";import{d as O2}from"./ArrowDropDown-BTiX8PXn.js";import{f as Pe}from"./format-error-BhfIHXu5.js";import{B as p1}from"./ButtonGroup-CgY-ppCE.js";import{T as Le}from"./TextField-endZMNmB.js";import{M as C1}from"./InputAdornment-BtP5WuDE.js";import{C as H2}from"./click-to-copy-D1J7QI3P.js";import{d as $2}from"./Launch-CPwTTy1C.js";import{L as F2}from"./MoreVert-Dw6DD_Y2.js";import{a as U2}from"./ListItemText-CRfaCcXD.js";import{S as Z1}from"./index-BOI9Etqy.js";import{M as q2}from"./index-CyJ9Y2Pj.js";import{r as W2}from"./index-BmnLIYuM.js";import{d as G2}from"./Done-Cl6BxREa.js";import{c as I0,d as L0,b as K2,S as X2,a as J2}from"./Stepper-ipc5scPk.js";import{R as Q2,a as e0}from"./RadioGroup-4mE-Sstp.js";import"./FilterList-DclE2l4O.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-CTJIBsW8.js";import"./useFormControl-ThWDsTIL.js";import"./FormGroup-B7SNePwe.js";import"./InputLabel-o8Jz2Es-.js";import"./Select-B7YRgule.js";import"./LastPage-DOrkqqL0.js";import"./Toolbar-DX1aq1wO.js";import"./index-BXLC5YsG.js";import"./redux-CSBj6943.js";import"./Search-5XN6Shqj.js";import"./index-D5aNUG7R.js";import"./Link-CyjzJAjs.js";import"./useSlot-BhbSJM-8.js";import"./jss-plugin-props-sort.esm-CxybFEV3.js";const Y2=o2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),Z2=["slots","slotProps"],et=se(m0)(({theme:e})=>O({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":O({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":O({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:G1(e.palette.grey[200],.12)}:{backgroundColor:G1(e.palette.grey[600],.12)})})),tt=se(Y2)({width:24,height:16});function ot(e){const{slots:t={},slotProps:l={}}=e,r=be(e,Z2),n=e;return o.jsx("li",{children:o.jsx(et,O({focusRipple:!0},r,{ownerState:n,children:o.jsx(tt,O({as:t.CollapsedIcon,ownerState:n},l.collapsedIcon))}))})}function lt(e){return Fe("MuiBreadcrumbs",e)}const st=$e("MuiBreadcrumbs",["root","ol","li","separator"]),rt=st,nt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],it=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},lt,t)},at=se(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${rt.li}`]:t.li},t.root]})({}),ct=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),dt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,t,l,r){return e.reduce((n,d,i)=>(i<e.length-1?n=n.concat(d,o.jsx(dt,{"aria-hidden":!0,className:t,ownerState:r,children:l},`separator-${i}`)):n.push(d),n),[])}const pt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiBreadcrumbs"}),{children:n,className:d,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:b=1,maxItems:y=8,separator:p="/"}=r,c=be(r,nt),[m,g]=C.useState(!1),v=O({},r,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:b,maxItems:y,separator:p}),R=it(v),S=l2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=C.useRef(null),T=k=>{const U=()=>{g(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return b+x>=k.length?k:[...k.slice(0,b),o.jsx(ot,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...k.slice(k.length-x,k.length)]},L=C.Children.toArray(n).filter(k=>C.isValidElement(k)).map((k,U)=>o.jsx("li",{className:R.li,children:k},`child-${U}`));return o.jsx(at,O({ref:l,component:i,color:"text.secondary",className:Ue(R.root,d),ownerState:v},c,{children:o.jsx(ct,{className:R.ol,ref:N,ownerState:v,children:ut(m||y&&L.length<=y?L:T(L),R.separator,p,v)})}))}),P0=pt;function ht(e){return Fe("MuiStepButton",e)}const ft=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),t0=ft,xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ht,t)},vt=se(m0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${t0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>O({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${t0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepButton"}),{children:n,className:d,icon:i,optional:a}=r,u=be(r,xt),{disabled:f,active:x}=C.useContext(I0),{orientation:b}=C.useContext(L0),y=O({},r,{orientation:b}),p=mt(y),c={icon:i,optional:a},m=s2(n,["StepLabel"])?C.cloneElement(n,c):o.jsx(K2,O({},c,{children:n}));return o.jsx(vt,O({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,d),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),bt=gt;function jt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const wt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Rt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},jt,t)},Ct=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>O({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),yt=se(o1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),zt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepContent"}),{children:n,className:d,TransitionComponent:i=o1,transitionDuration:a="auto",TransitionProps:u}=r,f=be(r,wt);C.useContext(L0);const{active:x,last:b,expanded:y}=C.useContext(I0),p=O({},r,{last:b}),c=Rt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Ct,O({className:Ue(c.root,d),ref:l,ownerState:p},f,{children:o.jsx(yt,O({as:i,in:x||y,className:c.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:n}))}))}),St=zt;var y1={},kt=Ne;Object.defineProperty(y1,"__esModule",{value:!0});var T0=y1.default=void 0,Mt=kt(Te()),It=o;T0=y1.default=(0,Mt.default)((0,It.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var z1={},Lt=Ne;Object.defineProperty(z1,"__esModule",{value:!0});var N0=z1.default=void 0,Pt=Lt(Te()),Tt=o;N0=z1.default=(0,Pt.default)((0,Tt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function ze({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}ze.propTypes={size:h.number};ze.defaultProps={size:24};function S1({did:e,projectId:t,title:l,logo:r,describe:n}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${r}`,[a,u]=C.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(z0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(ge,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(ge,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:n||"/"})]})]})}S1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function k1({initUrl:e}){const t=m1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:n}=le(),{api:d}=je(),{api:i}=s1(),[a,u]=C.useState(!0),{blocklet:f}=Ve(),[x,b]=C.useState(null),[y,p]=C.useState(!1),c=We(M=>M.breakpoints.down("xl")),{componentDid:m=""}=l1(),[g,v]=C.useState(null),R=()=>{d.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const P=(M==null?void 0:M.projects)||[];u(!1),v(P)}).catch(M=>{u(!1),$.error(M.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=M=>{b(M)},T=()=>{u(!1),p(!0)},L=()=>{p(!1),b(null)},k=M=>{$.error(M.message),p(!1),b(null)},U=M=>{if(!(M!=null&&M.deleted)){$.error("Delete project failed");return}R(),p(!1),b(null)};if(C.useEffect(()=>{R()},[]),!g&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(ze,{})});if(!g)return null;if(!g.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),o.jsx(Ze,{onClick:S,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const P=g[M];return o.jsx(ue,{to:`${P.id}`,children:o.jsx(S1,{did:f.meta.did,projectId:P.id,logo:P.blockletLogo,title:P.blockletTitle,describe:P.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(y0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(Q1,{size:14,compact:!0,responsive:!1,did:M}):null}},c||m?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(Q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},c||m?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const P=(f.children||[]).find(E=>E.meta.did===M);return P?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:14,blocklet:P,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:P.meta.title})]},M):""}}},c||l?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(ge,{children:M})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(v0,{value:Number(M),locale:n})}},{label:r("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const P=g[M];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${P.id}/new-release/${P.lastReleaseId}`,children:o.jsx(ve,{title:r("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"create",children:o.jsx(R2,{style:{fontSize:18}})})})}),!!P.lastReleaseId&&o.jsx(ve,{title:r("blocklet.publish.viewLastRelease",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${P.id}/view/${P.lastReleaseId}`,children:o.jsx(T0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:r("blocklet.publish.delete",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"delete",onClick:()=>N(P),children:o.jsx(C0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),I=y?o.jsx(r2,{open:!0,popup:!0,onClose:L,action:"check-has-project-id",locale:n,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:k,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Nt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),o.jsx(ve,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(N0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Ze,{onClick:S,variant:"contained",children:[o.jsx(g1,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(b1,{className:"main-table",locale:n,data:g,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(j1,{title:`${r("common.delete")} ${x.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:T,onCancel:()=>b(null),children:o.jsx(z,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(C2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(J,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),I]})}k1.propTypes={initUrl:h.object};k1.defaultProps={initUrl:null};const Nt=ae(z)`
3
3
  .main-table > div:first-child {
4
4
  display: none;
5
5
  }
@@ -133,7 +133,7 @@ import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC a
133
133
  background: #fff;
134
134
  z-index: 10;
135
135
  }
136
- `,a0="lastWantToConnectStoreId";function ql(e){var a,u;const[t,l]=C.useState(null),{session:r}=s1(),n=C.useCallback(f=>{l(f),localStorage.setItem(a0,f==null?void 0:f.id)},[l]),d=C.useMemo(()=>{var y,p,c,m;const f=localStorage.getItem(a0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(g=>g.id===f):null;if(x)return x;let b=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(g=>{var v;return!(g.id!==X.BLOCKLET_STORE.id||g.scope&&g.scope!=="studio"&&g.scope!==((v=r==null?void 0:r.user)==null?void 0:v.did))});return b||(b=(m=(c=e==null?void 0:e.settings)==null?void 0:c.storeList)==null?void 0:m[0]),b},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=r==null?void 0:r.user)==null?void 0:u.did]);return[t||d||{},n]}const a1={};async function $0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:r=4e3,timerKey:n=""}){a1[n]&&clearTimeout(a1[n]),await new Promise(a=>setTimeout(a,r));const d=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-d>l?u(f):n?a1[n]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Wl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Gl(e,{did:t,projectId:l,messageId:r}){return $0(async()=>{var d;const n=await e.getProject({input:{did:t,projectId:l,messageId:r}});if(!((d=n==null?void 0:n.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return n.project.blockletDid},{timerKey:"connect-studio"})}function Kl(e,{did:t,projectId:l,storeId:r}){return $0(async()=>{var i,a;const n=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=n==null?void 0:n.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!n.project.connectedStores.find(u=>u.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const F0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:r})=>{var i,a;const n=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let d=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===r),{teamDid:n,storeList:d}};function E1({blocklet:e,store:t={},onChangeStore:l,onClick:r,disabled:n,loading:d,componentDid:i}){var P,E,A;const{t:a}=le(),{session:u}=s1(),{api:f,info:x,inService:b}=je(),y=Ve(),[p,c]=C.useState(!1),m=C.useRef(null),[g,v]=C.useState(!1),[R,S]=C.useState(null),N=H=>{l(H),c(!1)},T=()=>{c(!0)},L=H=>{m.current&&m.current.contains(H.target)||c(!1)},k=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var H;if(R)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:R.url,projectId:"",scope:R.scope||"studio"}}),await((H=y==null?void 0:y.actions)==null?void 0:H.refreshBlocklet())}catch(q){$.error(`Remove Blocklet Store Error: ${Pe(q)}`)}finally{S(null)}},{storeList:I}=F0({fromBlocklet:b,blocklet:e,nodeInfo:x,componentDid:i,userDid:(P=u==null?void 0:u.user)==null?void 0:P.did}),M=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(p1,{disabled:n,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(oe,{onClick:r,children:[d&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(oe,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(O2,{})})]}),o.jsx(p2,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:H})=>o.jsx(h2,{...H,style:{transformOrigin:"center top"},children:o.jsx(j0,{children:o.jsx(f2,{onClickAway:L,children:o.jsxs(x2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[I==null?void 0:I.map(q=>{var K;return o.jsxs(X1,{selected:q.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(q),children:[o.jsxs(z,{children:[o.jsx(ge,{sx:{fontSize:"16px"},maxLength:24,children:q.name}),o.jsx(ge,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:q.url})]}),_2({store:q,userDid:(K=u==null?void 0:u.user)==null?void 0:K.did})&&o.jsx(ie,{sx:{ml:1},onClick:G=>{G.preventDefault(),G.stopPropagation(),S(q)},children:o.jsx(pe,{icon:"ic:outline-delete"})})]},q.url)}),o.jsx(m2,{}),o.jsxs(X1,{onClick:k,children:[o.jsx(g1,{font:!0}),o.jsx(J,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),g&&o.jsx(M0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:M,storeList:I,scope:"studio",onAdd:(A=y==null?void 0:y.actions)==null?void 0:A.refreshBlocklet}),R&&o.jsx(j1,{displayError:!0,title:`${a("common.delete")} ${R.name}`,description:a("blocklet.publish.deleteStoreTip",{name:R.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}E1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};E1.defaultProps={store:null,blocklet:null};const c0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],d0=1024*1024*10,u0=C.lazy(()=>w0(()=>import("./react-ChRfz7rm.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function U0({projectId:e,readOnly:t,loading:l,blocklet:r,params:n,setParams:d,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:b,componentDid:y}){const{t:p}=le(),{api:c}=je(),m=m1(),g=C.useRef(null),v=C.useRef(null),[R,S]=ql(r),N=B2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async P=>{const E=setTimeout(()=>{u(!1)},2e4),A=await Gl(c,P);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},L=()=>{if(!n.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(R!=null&&R.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const P=Wl();N(async(E,A)=>{var H,q,K;try{const G=await c.connectByStudio({input:{did:(H=r==null?void 0:r.meta)==null?void 0:H.did,blockletTitle:n==null?void 0:n.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:((q=n==null?void 0:n.blockletComponents)==null?void 0:q.length)>0?"pack":"resource",componentDid:y,messageId:P,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(G!=null&&G.url)){$.error("failed to connect to store");return}A(G.url),T({did:(K=r==null?void 0:r.meta)==null?void 0:K.did,projectId:"",messageId:P})}catch(G){const Y=Pe(G);$.error(Y),u(!1)}})},k=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,V=n!=null&&n.blockletLogo?`${k}/${n.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,I=((n==null?void 0:n.blockletScreenshots)||[]).filter(Boolean).map(P=>`${U}/${P}`),M=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Xl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:n.blockletTitle||"",onChange:P=>{a({blockletTitle:""}),d({blockletTitle:P.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Le,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(C1,{position:"end",children:o.jsx(E1,{blocklet:r,store:R,componentDid:y,onChangeStore:S,disabled:!n.blockletTitle||t||l,loading:l,onClick:L})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:n.blockletDescription||"",onChange:P=>{a({blockletDescription:""}),d({blockletDescription:P.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(J,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(z0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{M()&&g.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(J,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[I.map((P,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:P}),!t&&o.jsx(ie,{className:"action",onClick:()=>{d(A=>{const H=[...A.blockletScreenshots];return H.splice(E,1),{...A,blockletScreenshots:H}})},children:o.jsx(D2,{})})]},P)),I.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(C.Suspense,{fallback:o.jsx(ze,{}),children:[o.jsx(u0,{ref:g,popup:!0,onUploadFinish:P=>{d({blockletLogo:P.data.filename}),b(""),g.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(u0,{ref:v,popup:!0,onUploadFinish:P=>{d(E=>{var H;const A=E.blockletScreenshots||[];return A.push((H=P.data)==null?void 0:H.filename),{...E,blockletScreenshots:A}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:5-I.length}}},"uploader-screenshot")]})]})}U0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Xl=ae.div`
136
+ `,a0="lastWantToConnectStoreId";function ql(e){var a,u;const[t,l]=C.useState(null),{session:r}=s1(),n=C.useCallback(f=>{l(f),localStorage.setItem(a0,f==null?void 0:f.id)},[l]),d=C.useMemo(()=>{var y,p,c,m;const f=localStorage.getItem(a0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(g=>g.id===f):null;if(x)return x;let b=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(g=>{var v;return!(g.id!==X.BLOCKLET_STORE.id||g.scope&&g.scope!=="studio"&&g.scope!==((v=r==null?void 0:r.user)==null?void 0:v.did))});return b||(b=(m=(c=e==null?void 0:e.settings)==null?void 0:c.storeList)==null?void 0:m[0]),b},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=r==null?void 0:r.user)==null?void 0:u.did]);return[t||d||{},n]}const a1={};async function $0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:r=4e3,timerKey:n=""}){a1[n]&&clearTimeout(a1[n]),await new Promise(a=>setTimeout(a,r));const d=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-d>l?u(f):n?a1[n]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Wl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Gl(e,{did:t,projectId:l,messageId:r}){return $0(async()=>{var d;const n=await e.getProject({input:{did:t,projectId:l,messageId:r}});if(!((d=n==null?void 0:n.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return n.project.blockletDid},{timerKey:"connect-studio"})}function Kl(e,{did:t,projectId:l,storeId:r}){return $0(async()=>{var i,a;const n=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=n==null?void 0:n.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!n.project.connectedStores.find(u=>u.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const F0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:r})=>{var i,a;const n=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let d=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===r),{teamDid:n,storeList:d}};function E1({blocklet:e,store:t={},onChangeStore:l,onClick:r,disabled:n,loading:d,componentDid:i}){var P,E,A;const{t:a}=le(),{session:u}=s1(),{api:f,info:x,inService:b}=je(),y=Ve(),[p,c]=C.useState(!1),m=C.useRef(null),[g,v]=C.useState(!1),[R,S]=C.useState(null),N=H=>{l(H),c(!1)},T=()=>{c(!0)},L=H=>{m.current&&m.current.contains(H.target)||c(!1)},k=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var H;if(R)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:R.url,projectId:"",scope:R.scope||"studio"}}),await((H=y==null?void 0:y.actions)==null?void 0:H.refreshBlocklet())}catch(q){$.error(`Remove Blocklet Store Error: ${Pe(q)}`)}finally{S(null)}},{storeList:I}=F0({fromBlocklet:b,blocklet:e,nodeInfo:x,componentDid:i,userDid:(P=u==null?void 0:u.user)==null?void 0:P.did}),M=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(p1,{disabled:n,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(oe,{onClick:r,children:[d&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(oe,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(O2,{})})]}),o.jsx(p2,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:H})=>o.jsx(h2,{...H,style:{transformOrigin:"center top"},children:o.jsx(j0,{children:o.jsx(f2,{onClickAway:L,children:o.jsxs(x2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[I==null?void 0:I.map(q=>{var K;return o.jsxs(X1,{selected:q.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(q),children:[o.jsxs(z,{children:[o.jsx(ge,{sx:{fontSize:"16px"},maxLength:24,children:q.name}),o.jsx(ge,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:q.url})]}),_2({store:q,userDid:(K=u==null?void 0:u.user)==null?void 0:K.did})&&o.jsx(ie,{sx:{ml:1},onClick:G=>{G.preventDefault(),G.stopPropagation(),S(q)},children:o.jsx(pe,{icon:"ic:outline-delete"})})]},q.url)}),o.jsx(m2,{}),o.jsxs(X1,{onClick:k,children:[o.jsx(g1,{font:!0}),o.jsx(J,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),g&&o.jsx(M0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:M,storeList:I,scope:"studio",onAdd:(A=y==null?void 0:y.actions)==null?void 0:A.refreshBlocklet}),R&&o.jsx(j1,{displayError:!0,title:`${a("common.delete")} ${R.name}`,description:a("blocklet.publish.deleteStoreTip",{name:R.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}E1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};E1.defaultProps={store:null,blocklet:null};const c0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],d0=1024*1024*10,u0=C.lazy(()=>w0(()=>import("./react-iG64dalH.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function U0({projectId:e,readOnly:t,loading:l,blocklet:r,params:n,setParams:d,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:b,componentDid:y}){const{t:p}=le(),{api:c}=je(),m=m1(),g=C.useRef(null),v=C.useRef(null),[R,S]=ql(r),N=B2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async P=>{const E=setTimeout(()=>{u(!1)},2e4),A=await Gl(c,P);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},L=()=>{if(!n.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(R!=null&&R.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const P=Wl();N(async(E,A)=>{var H,q,K;try{const G=await c.connectByStudio({input:{did:(H=r==null?void 0:r.meta)==null?void 0:H.did,blockletTitle:n==null?void 0:n.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:((q=n==null?void 0:n.blockletComponents)==null?void 0:q.length)>0?"pack":"resource",componentDid:y,messageId:P,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(G!=null&&G.url)){$.error("failed to connect to store");return}A(G.url),T({did:(K=r==null?void 0:r.meta)==null?void 0:K.did,projectId:"",messageId:P})}catch(G){const Y=Pe(G);$.error(Y),u(!1)}})},k=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,V=n!=null&&n.blockletLogo?`${k}/${n.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,I=((n==null?void 0:n.blockletScreenshots)||[]).filter(Boolean).map(P=>`${U}/${P}`),M=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Xl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:n.blockletTitle||"",onChange:P=>{a({blockletTitle:""}),d({blockletTitle:P.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Le,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(C1,{position:"end",children:o.jsx(E1,{blocklet:r,store:R,componentDid:y,onChangeStore:S,disabled:!n.blockletTitle||t||l,loading:l,onClick:L})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:n.blockletDescription||"",onChange:P=>{a({blockletDescription:""}),d({blockletDescription:P.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(J,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(z0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{M()&&g.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(J,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[I.map((P,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:P}),!t&&o.jsx(ie,{className:"action",onClick:()=>{d(A=>{const H=[...A.blockletScreenshots];return H.splice(E,1),{...A,blockletScreenshots:H}})},children:o.jsx(D2,{})})]},P)),I.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(C.Suspense,{fallback:o.jsx(ze,{}),children:[o.jsx(u0,{ref:g,popup:!0,onUploadFinish:P=>{d({blockletLogo:P.data.filename}),b(""),g.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(u0,{ref:v,popup:!0,onUploadFinish:P=>{d(E=>{var H;const A=E.blockletScreenshots||[];return A.push((H=P.data)==null?void 0:H.filename),{...E,blockletScreenshots:A}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:5-I.length}}},"uploader-screenshot")]})]})}U0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Xl=ae.div`
137
137
  margin-top: 24px;
138
138
  .screenshot {
139
139
  margin-bottom: 16px;
@@ -164,7 +164,7 @@ import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC a
164
164
  width: 100%; /* 图像宽度填充容器 */
165
165
  height: auto; /* 图像高度自适应 */
166
166
  }
167
- `;var A1={},Jl=Ne;Object.defineProperty(A1,"__esModule",{value:!0});var q0=A1.default=void 0,Ql=Jl(Te()),Yl=o;q0=A1.default=(0,Ql.default)((0,Yl.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const Zl=(e,t,l,r)=>{const n=e?[...e]:[],d=((t==null?void 0:t.children)||[]).reduce((i,a)=>(i[a.meta.did]=!0,i),{});return Object.keys(l).forEach(i=>{if(!d[i])return;let a=!1;r||n.forEach(u=>{u.did===i&&(u.included=!0,u.required=!0,a=!0)}),a||n.push({did:i,included:!0,required:!0})}),n},e3=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],r=await(await fetch(e)).blob();return new File([r],t,{type:r.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*t3(e,t){let l=0;for(;l<e.size;)yield e.slice(l,l+t),l+=t}const o3=async({did:e,projectId:t,uploadType:l="logo",imageUrl:r})=>{const n=await e3(r);new FormData().append("file",n);const i={uploaderId:"Uploader",relativePath:encodeURIComponent(n.name),name:encodeURIComponent(n.name),type:n.type},u=(await J1.post(he(X.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,l,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":n.size,"X-Uploader-File-Ext":n.name.split(".").pop(),"Upload-Metadata":Object.keys(i).map(y=>`${y} ${btoa(i[y])}`).join(",")}})).headers.location,f=2*1024*1024;let x=0,b="";for(const y of t3(n,f)){const p=await J1.patch(he(X.WELLKNOWN_SERVICE_PATH_PREFIX,u),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":x,"Content-Type":"application/offset+octet-stream"}});x+=y.size,b=p.data.filename}return b},W0=({params:e,hasSelectedResources:t,projectId:l,status:r,t:n})=>{const d=[];return e.blockletTitle||d.push({param:"blockletTitle",message:n("blocklet.publish.errorTip.noTitle")}),(!l||l===X.UNOWNED_DID)&&d.push({param:"projectId",message:n("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&d.push({param:"blockletResource",message:n("blocklet.publish.errorTip.noResource")}),e.blockletVersion?Ie.valid(e.blockletVersion)||d.push({param:"blockletVersion",message:n("blocklet.publish.errorTip.inValidVersion")}):d.push({param:"blockletVersion",message:n("blocklet.publish.errorTip.noVersion")}),r===Ce.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||d.push({param:"blockletDescription",message:n("blocklet.publish.errorTip.noDescription")}),e.note||d.push({param:"note",message:n("blocklet.publish.errorTip.noNote")})),d.length?d:null},l3=({params:e,hasSelectedResources:t,step:l,t:r,projectId:n})=>{if(l===0){if(!e.blockletTitle)return r("blocklet.publish.errorTip.noTitle");if(!n||n===X.UNOWNED_DID)return r("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return r("blocklet.publish.errorTip.noDescription")}if(l===2&&!e.uploadedResource&&!t)return r("blocklet.publish.errorTip.noResource");if(l>=4){if(!e.blockletVersion)return r("blocklet.publish.errorTip.noVersion");if(!Ie.valid(e.blockletVersion))return r("blocklet.publish.errorTip.inValidVersion");if(!e.note)return r("blocklet.publish.errorTip.noNote")}return""};function O1({blocklet:e,releaseId:t,connectedStores:l,projectId:r,releaseType:n,publishedStoreIds:d,onPublish:i,onDelete:a,projectType:u,componentDid:f,onOpenConnectStore:x,behavior:b,onSelectConnectStore:y}){var S,N;const{t:p}=le(),{actions:{refreshBlocklet:c}}=Ve(),{session:m}=s1(),{storeList:g}=F0({fromBlocklet:!0,blocklet:e,componentDid:f,userDid:(S=m==null?void 0:m.user)==null?void 0:S.did}),v=C.useMemo(()=>l!=null&&l.length?l==null?void 0:l.reduce((T,L)=>(T[L.storeId]=L,T),{}):{},[l]),R=(N=e==null?void 0:e.meta)==null?void 0:N.did;return o.jsxs(o.Fragment,{children:[b==="connect"&&!!(g!=null&&g.length)&&o.jsx(S0,{severity:"info",style:{width:"100%"},children:o.jsxs(z,{color:y2[400],component:"a",href:u==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[p(u==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),o.jsx($2,{sx:{marginLeft:1}})]})}),o.jsx(v2,{children:g==null?void 0:g.map(T=>o.jsx(F2,{"data-cy":"store-switch",children:o.jsx(U2,{children:o.jsx(E2,{behavior:b,onSelectConnectStore:y,releaseId:t,projectId:r,releaseType:n,kind:"publish",teamDid:R,store:T,published:(d==null?void 0:d.indexOf(T.id))>-1,connectedStore:v[T.id],onPublish:i,onDelete:a,scope:T.scope||"studio",onOpenConnectStore:x})})},T.url))}),o.jsx(M0,{teamDid:R,storeList:g,scope:"studio",onAdd:c})]})}O1.propTypes={blocklet:h.object.isRequired,projectId:h.string.isRequired,releaseId:h.string.isRequired,releaseType:h.string.isRequired,onPublish:h.func,onDelete:h.func,publishedStoreIds:h.arrayOf(h.string),connectedStores:h.arrayOf(h.object).isRequired,projectType:h.string,componentDid:h.string,onOpenConnectStore:h.func,onSelectConnectStore:h.func,behavior:h.string};O1.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};function G0({did:e,params:t,setParams:l,projectId:r,open:n,onClose:d}){const{t:i}=le(),[a,u]=C.useState(!1),{api:f}=je(),[x,b]=C.useState(!1),[y,p]=C.useState(!1),c=()=>{b(t.autoUpload),p(t.possibleSameStore),u(!1),d(!1)},m=async()=>{u(!0);try{await f.updateProject({input:{did:e,projectId:r,blockletTitle:t.blockletTitle,blockletDescription:t.blockletDescription,blockletIntroduction:t.blockletIntroduction,autoUpload:!!x,possibleSameStore:!!y}}),l({autoUpload:x,possibleSameStore:y}),d(!1)}catch(v){$.error(v.message)}u(!1)};C.useEffect(()=>{b(t.autoUpload),p(t.possibleSameStore)},[t]);const g=!!(r&&r!==X.UNOWNED_DID);return o.jsx(R0,{title:i("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:n,onClose:c,actions:o.jsxs(o.Fragment,{children:[o.jsx(oe,{onClick:v=>{v.stopPropagation(),d()},color:"inherit",children:i("common.cancel")}),g&&o.jsxs(oe,{onClick:v=>{v.stopPropagation(),m()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a,variant:"contained",autoFocus:!0,children:[a&&o.jsx(Oe,{size:16}),i("common.confirm")]})]}),children:g?o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:pe,icon:"ph:upload",sx:{fontSize:24,mr:2}}),o.jsx(J,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.autoUploadTip")}),o.jsx(Z1,{checked:x,onChange:(v,R)=>b(R)})]}),o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:pe,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),o.jsx(J,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.possibleSameStoreTip")}),o.jsx(Z1,{checked:y,onChange:(v,R)=>p(R)})]})]}):o.jsxs(z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[o.jsx(z,{component:pe,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),o.jsx(J,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.needProjectId")})]})})}G0.propTypes={did:h.string.isRequired,params:h.object.isRequired,open:h.bool.isRequired,onClose:h.func.isRequired,setParams:h.func.isRequired,projectId:h.string.isRequired};var x0;const c1=(x0=window.env)==null?void 0:x0.serverEndpoint;function K0({projectId:e,params:t,setParamsErrTip:l,initUrl:r,setParams:n,mode:d,loading:i,blocklet:a,release:u,isPublished:f,releaseId:x,getData:b,getRelease:y,componentDid:p,resourceRelateComponents:c,disabledSelectComponents:m,saveSelectedEventsRef:g,hasSelectedResources:v,initLogoUrl:R,setLoading:S,releaseUsedLast:N,setReleaseUsedLast:T,projectType:L}){var xe,de;const{t:k,locale:U}=le(),{api:V}=je(),I=m1(),[M,P]=C.useState(!1),[E,A]=C.useState(!1),[H,q]=C.useState(),K=We(F=>F.breakpoints.down("md")),G=((xe=t==null?void 0:t.blockletComponents)==null?void 0:xe.length)>0?"pack":"resource",Y=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),y()},Se=async F=>{var Ke,_e,Be;const Z=W0({params:t,hasSelectedResources:v,projectId:e,status:F,t:k});if(Z){$.error(Z.map(W=>W.message).join("; ")),l(Z.reduce((W,ee)=>({...W,[ee.param]:ee.message}),{}));return}const B={...t};if(B.blockletComponents=Zl(B.blockletComponents,a,c,m),B.blockletVersion=Ie.valid(B.blockletVersion),!B.blockletVersion){$.error("Invalid Blocklet Version"),l({blockletVersion:"Invalid Blocklet Version"});return}if(R)try{const W=await o3({did:a.meta.did,projectId:e,imageUrl:R});B.blockletLogo=W,n({blockletLogo:W})}catch(W){$.error(W.message);return}if(t.resourceFromSelect){B.uploadedResource="";try{const W=Object.keys(g.current);await e1(W.map(ee=>()=>{const Ee=g.current[ee];return $l({api:V,locale:U,projectId:e,releaseId:N?"":x,appDid:a.meta.did,component:Ee.component,resources:Ee.resources,initUrl:r})}),{concurrency:2})}catch(W){$.error(((Be=(_e=(Ke=W==null?void 0:W.response)==null?void 0:Ke.data)==null?void 0:_e.error)==null?void 0:Be.message)||W.message),l({blockletResource:"Invalid save the resource"});return}}else B.blockletComponents=[];B.blockletTitle=(B.blockletTitle||"").trim(),B.blockletDescription=(B.blockletDescription||"").trim(),B.blockletIntroduction=(B.blockletIntroduction||"").trim(),B.note=(B.note||"").trim(),B.blockletComponents=((B==null?void 0:B.blockletComponents)||[]).filter(W=>W.included).map(W=>v1(W,["did","required"])).map(JSON.stringify);try{await V.createRelease({input:{...B,did:a.meta.did,projectId:e,releaseId:N?"":x,status:F}}),F==="draft"?$.success(k("blocklet.publish.saveDraftSuccess")):(T(!1),$.success(k("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),l({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(W){const ee=Pe(W);$.error(ee),(/resource/.test(ee)||/zip/.test(ee))&&l({blockletResource:ee})}const re=await V.getProject({input:{did:a.meta.did,projectId:e}}),ne=re.project.lastReleaseId;t.autoUpload&&await e1(re.project.connectedStores.map(W=>async()=>{try{const ee=await V.publishToStore({input:{did:a.meta.did,storeId:W.storeId,storeName:W.storeName,projectId:e,releaseId:ne,type:G}});$.success(o.jsx(A2,{storeName:W.storeName,storeUrl:W.storeUrl,developerDid:W.developerDid,published:ee.url==="published"}),{duration:1e4})}catch(ee){$.error(Pe(ee))}}),{concurrency:4}),Y==null||Y(),I(`../${e}/view/${ne}`,{replace:!0})},fe=F=>(S(!0),Se(F).finally(()=>{S(!1)})),ce=async F=>{await Kl(V,F),b()},te=()=>{A(!0)};let Q=null;if(f&&c1){const F=he(c1,`/api/project/${a.meta.did}/${e}/${x}/release/blocklet.json`);if(L==="pack"){const Z=new URL(c1);Z.pathname=he(Z.pathname,"/launch-blocklet/agreement"),Z.searchParams.set("blocklet_meta_url",F),Q=K?o.jsx(ie,{component:"a",disabled:i,href:Z.href,target:"_blank",rel:"noreferrer",color:"primary",sx:{mr:1},onClick:()=>q(F),children:o.jsx(pe,{icon:"ic:baseline-install-desktop"})}):o.jsx(oe,{href:Z.href,disabled:i,target:"_blank",rel:"noreferrer",variant:"outlined",sx:{mr:1},onClick:()=>q(F),children:k("common.install")})}else Q=o.jsxs(o.Fragment,{children:[K?o.jsx(ie,{disabled:i,color:"primary",sx:{mr:1},onClick:()=>q(F),children:o.jsx(pe,{icon:"ic:baseline-install-desktop"})}):o.jsx(oe,{disabled:i,variant:"outlined",sx:{mr:1},onClick:()=>q(F),children:k("blocklet.publish.copyInstallUrl")}),o.jsx(g2,{fullWidth:!0,maxWidth:"sm",open:H,onClose:()=>q(""),children:o.jsxs(z,{sx:{py:5,px:4,wordBreak:"break-all"},children:[o.jsx(J,{variant:"h6",sx:{mb:2},children:k("blocklet.publish.installResourceTip")}),o.jsx(H2,{children:H}),o.jsxs(J,{sx:{mt:2},children:[k("blocklet.publish.installResourceTip2"),o.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:k("blocklet.publish.installResourceHelp")})]})]})})]})}return o.jsxs(o.Fragment,{children:[o.jsx(s3,{className:"sticky-header",children:o.jsxs(z,{display:"flex",alignItems:"center",flexDirection:"row",children:[o.jsxs(P0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(ue,{to:"../",children:k("common.blockletStudio")}),e===X.UNOWNED_DID?o.jsx(J,{color:"text.primary",children:o.jsx(ge,{maxLength:K?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):o.jsx(ue,{to:`../${e}`,children:o.jsx(ge,{maxLength:K?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),o.jsx(J,{color:"text.primary",children:d==="create"?k("common.create"):(t==null?void 0:t.blockletVersion)||k("common.edit")})]}),o.jsx(z,{flex:"1"}),!f&&o.jsxs(p1,{disabled:i,variant:"contained",children:[o.jsxs(oe,{variant:"contained",onClick:()=>fe(Ce.PROJECT.RELEASE_STATUS.published),children:[i&&o.jsx(Oe,{size:14,sx:{mr:.5},color:"inherit"}),k("blocklet.publish.createRelease")]}),o.jsx(oe,{variant:"contained",onClick:te,children:o.jsx(pe,{icon:"mage:settings-fill",fontSize:"16px"})})]}),f&&o.jsxs(o.Fragment,{children:[Q,K?null:o.jsx(oe,{component:"a",disabled:i,href:he(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${a.meta.did}/${e}/${x}/download/${(u.files||[])[0]}`),variant:"outlined",sx:{mr:1},children:k("common.download")}),o.jsxs(p1,{disabled:i,variant:"contained",children:[o.jsxs(oe,{variant:"contained",onClick:()=>P(!0),children:[i?o.jsx(Oe,{size:14,sx:{mr:1},color:"inherit"}):o.jsx(q0,{sx:{fontSize:"1.3em",mr:1}}),k(K?"common.upload":"blocklet.publish.connectOrUpload")]}),o.jsx(oe,{variant:"contained",onClick:te,children:o.jsx(pe,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})}),o.jsx(R0,{title:k("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:M,onClose:()=>P(!1),children:o.jsx(O1,{projectType:L,blocklet:a,releaseType:G,projectId:e,releaseId:x,componentDid:p,onPublish:Y,onOpenConnectStore:ce,onDelete:b,connectedStores:t.connectedStores||[],publishedStoreIds:u==null?void 0:u.publishedStoreIds})}),o.jsx(G0,{did:(de=a==null?void 0:a.meta)==null?void 0:de.did,params:t,projectId:e,open:E,setParams:n,onClose:()=>A(!1)})]})}K0.propTypes={projectId:h.string.isRequired,params:h.object.isRequired,mode:h.string.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,release:h.object.isRequired,isPublished:h.bool.isRequired,releaseId:h.string.isRequired,getData:h.func.isRequired,getRelease:h.func.isRequired,componentDid:h.string.isRequired,resourceRelateComponents:h.object.isRequired,disabledSelectComponents:h.bool.isRequired,saveSelectedEventsRef:h.object.isRequired,hasSelectedResources:h.bool.isRequired,initLogoUrl:h.string.isRequired,setLoading:h.func.isRequired,releaseUsedLast:h.bool.isRequired,setReleaseUsedLast:h.func.isRequired,projectType:h.string.isRequired,setParamsErrTip:h.func.isRequired,setParams:h.func.isRequired,initUrl:h.object.isRequired};const s3=ae.div`
167
+ `;var A1={},Jl=Ne;Object.defineProperty(A1,"__esModule",{value:!0});var q0=A1.default=void 0,Ql=Jl(Te()),Yl=o;q0=A1.default=(0,Ql.default)((0,Yl.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const Zl=(e,t,l,r)=>{const n=e?[...e]:[],d=((t==null?void 0:t.children)||[]).reduce((i,a)=>(i[a.meta.did]=!0,i),{});return Object.keys(l).forEach(i=>{if(!d[i])return;let a=!1;r||n.forEach(u=>{u.did===i&&(u.included=!0,u.required=!0,a=!0)}),a||n.push({did:i,included:!0,required:!0})}),n},e3=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],r=await(await fetch(e)).blob();return new File([r],t,{type:r.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*t3(e,t){let l=0;for(;l<e.size;)yield e.slice(l,l+t),l+=t}const o3=async({did:e,projectId:t,uploadType:l="logo",imageUrl:r})=>{const n=await e3(r);new FormData().append("file",n);const i={uploaderId:"Uploader",relativePath:encodeURIComponent(n.name),name:encodeURIComponent(n.name),type:n.type},u=(await J1.post(he(X.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,l,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":n.size,"X-Uploader-File-Ext":n.name.split(".").pop(),"Upload-Metadata":Object.keys(i).map(y=>`${y} ${btoa(i[y])}`).join(",")}})).headers.location,f=2*1024*1024;let x=0,b="";for(const y of t3(n,f)){const p=await J1.patch(he(X.WELLKNOWN_SERVICE_PATH_PREFIX,u),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":x,"Content-Type":"application/offset+octet-stream"}});x+=y.size,b=p.data.filename}return b},W0=({params:e,hasSelectedResources:t,projectId:l,status:r,t:n})=>{const d=[];return e.blockletTitle||d.push({param:"blockletTitle",message:n("blocklet.publish.errorTip.noTitle")}),(!l||l===X.UNOWNED_DID)&&d.push({param:"projectId",message:n("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&d.push({param:"blockletResource",message:n("blocklet.publish.errorTip.noResource")}),e.blockletVersion?Ie.valid(e.blockletVersion)||d.push({param:"blockletVersion",message:n("blocklet.publish.errorTip.inValidVersion")}):d.push({param:"blockletVersion",message:n("blocklet.publish.errorTip.noVersion")}),r===Ce.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||d.push({param:"blockletDescription",message:n("blocklet.publish.errorTip.noDescription")}),e.note||d.push({param:"note",message:n("blocklet.publish.errorTip.noNote")})),d.length?d:null},l3=({params:e,hasSelectedResources:t,step:l,t:r,projectId:n})=>{if(l===0){if(!e.blockletTitle)return r("blocklet.publish.errorTip.noTitle");if(!n||n===X.UNOWNED_DID)return r("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return r("blocklet.publish.errorTip.noDescription")}if(l===2&&!e.uploadedResource&&!t)return r("blocklet.publish.errorTip.noResource");if(l>=4){if(!e.blockletVersion)return r("blocklet.publish.errorTip.noVersion");if(!Ie.valid(e.blockletVersion))return r("blocklet.publish.errorTip.inValidVersion");if(!e.note)return r("blocklet.publish.errorTip.noNote")}return""};function O1({blocklet:e,releaseId:t,connectedStores:l,projectId:r,releaseType:n,publishedStoreIds:d,onPublish:i,onDelete:a,projectType:u,componentDid:f,onOpenConnectStore:x,behavior:b,onSelectConnectStore:y}){var S,N;const{t:p}=le(),{actions:{refreshBlocklet:c}}=Ve(),{session:m}=s1(),{storeList:g}=F0({fromBlocklet:!0,blocklet:e,componentDid:f,userDid:(S=m==null?void 0:m.user)==null?void 0:S.did}),v=C.useMemo(()=>l!=null&&l.length?l==null?void 0:l.reduce((T,L)=>(T[L.storeId]=L,T),{}):{},[l]),R=(N=e==null?void 0:e.meta)==null?void 0:N.did;return o.jsxs(o.Fragment,{children:[b==="connect"&&!!(g!=null&&g.length)&&o.jsx(S0,{severity:"info",style:{width:"100%"},children:o.jsxs(z,{color:y2[400],component:"a",href:u==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[p(u==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),o.jsx($2,{sx:{marginLeft:1}})]})}),o.jsx(v2,{children:g==null?void 0:g.map(T=>o.jsx(F2,{"data-cy":"store-switch",children:o.jsx(U2,{children:o.jsx(E2,{behavior:b,onSelectConnectStore:y,releaseId:t,projectId:r,releaseType:n,kind:"publish",teamDid:R,store:T,published:(d==null?void 0:d.indexOf(T.id))>-1,connectedStore:v[T.id],onPublish:i,onDelete:a,scope:T.scope||"studio",onOpenConnectStore:x})})},T.url))}),o.jsx(M0,{teamDid:R,storeList:g,scope:"studio",onAdd:c})]})}O1.propTypes={blocklet:h.object.isRequired,projectId:h.string.isRequired,releaseId:h.string.isRequired,releaseType:h.string.isRequired,onPublish:h.func,onDelete:h.func,publishedStoreIds:h.arrayOf(h.string),connectedStores:h.arrayOf(h.object).isRequired,projectType:h.string,componentDid:h.string,onOpenConnectStore:h.func,onSelectConnectStore:h.func,behavior:h.string};O1.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};function G0({did:e,params:t,setParams:l,projectId:r,open:n,onClose:d}){const{t:i}=le(),[a,u]=C.useState(!1),{api:f}=je(),[x,b]=C.useState(!1),[y,p]=C.useState(!1),c=()=>{b(t.autoUpload),p(t.possibleSameStore),u(!1),d(!1)},m=async()=>{u(!0);try{await f.updateProject({input:{did:e,projectId:r,blockletTitle:t.blockletTitle||"",blockletDescription:t.blockletDescription||"",blockletIntroduction:t.blockletIntroduction||"",autoUpload:!!x,possibleSameStore:!!y}}),l({autoUpload:x,possibleSameStore:y}),d(!1)}catch(v){$.error(v.message)}u(!1)};C.useEffect(()=>{b(t.autoUpload),p(t.possibleSameStore)},[t]);const g=!!(r&&r!==X.UNOWNED_DID);return o.jsx(R0,{title:i("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:n,onClose:c,actions:o.jsxs(o.Fragment,{children:[o.jsx(oe,{onClick:v=>{v.stopPropagation(),d()},color:"inherit",children:i("common.cancel")}),g&&o.jsxs(oe,{onClick:v=>{v.stopPropagation(),m()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a,variant:"contained",autoFocus:!0,children:[a&&o.jsx(Oe,{size:16}),i("common.confirm")]})]}),children:g?o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:pe,icon:"ph:upload",sx:{fontSize:24,mr:2}}),o.jsx(J,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.autoUploadTip")}),o.jsx(Z1,{checked:x,onChange:(v,R)=>b(R)})]}),o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:pe,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),o.jsx(J,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.possibleSameStoreTip")}),o.jsx(Z1,{checked:y,onChange:(v,R)=>p(R)})]})]}):o.jsxs(z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[o.jsx(z,{component:pe,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),o.jsx(J,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.needProjectId")})]})})}G0.propTypes={did:h.string.isRequired,params:h.object.isRequired,open:h.bool.isRequired,onClose:h.func.isRequired,setParams:h.func.isRequired,projectId:h.string.isRequired};var x0;const c1=(x0=window.env)==null?void 0:x0.serverEndpoint;function K0({projectId:e,params:t,setParamsErrTip:l,initUrl:r,setParams:n,mode:d,loading:i,blocklet:a,release:u,isPublished:f,releaseId:x,getData:b,getRelease:y,componentDid:p,resourceRelateComponents:c,disabledSelectComponents:m,saveSelectedEventsRef:g,hasSelectedResources:v,initLogoUrl:R,setLoading:S,releaseUsedLast:N,setReleaseUsedLast:T,projectType:L}){var xe,de;const{t:k,locale:U}=le(),{api:V}=je(),I=m1(),[M,P]=C.useState(!1),[E,A]=C.useState(!1),[H,q]=C.useState(),K=We(F=>F.breakpoints.down("md")),G=((xe=t==null?void 0:t.blockletComponents)==null?void 0:xe.length)>0?"pack":"resource",Y=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),y()},Se=async F=>{var Ke,_e,Be;const Z=W0({params:t,hasSelectedResources:v,projectId:e,status:F,t:k});if(Z){$.error(Z.map(W=>W.message).join("; ")),l(Z.reduce((W,ee)=>({...W,[ee.param]:ee.message}),{}));return}const B={...t};if(B.blockletComponents=Zl(B.blockletComponents,a,c,m),B.blockletVersion=Ie.valid(B.blockletVersion),!B.blockletVersion){$.error("Invalid Blocklet Version"),l({blockletVersion:"Invalid Blocklet Version"});return}if(R)try{const W=await o3({did:a.meta.did,projectId:e,imageUrl:R});B.blockletLogo=W,n({blockletLogo:W})}catch(W){$.error(W.message);return}if(t.resourceFromSelect){B.uploadedResource="";try{const W=Object.keys(g.current);await e1(W.map(ee=>()=>{const Ee=g.current[ee];return $l({api:V,locale:U,projectId:e,releaseId:N?"":x,appDid:a.meta.did,component:Ee.component,resources:Ee.resources,initUrl:r})}),{concurrency:2})}catch(W){$.error(((Be=(_e=(Ke=W==null?void 0:W.response)==null?void 0:Ke.data)==null?void 0:_e.error)==null?void 0:Be.message)||W.message),l({blockletResource:"Invalid save the resource"});return}}else B.blockletComponents=[];B.blockletTitle=(B.blockletTitle||"").trim(),B.blockletDescription=(B.blockletDescription||"").trim(),B.blockletIntroduction=(B.blockletIntroduction||"").trim(),B.note=(B.note||"").trim(),B.blockletComponents=((B==null?void 0:B.blockletComponents)||[]).filter(W=>W.included).map(W=>v1(W,["did","required"])).map(JSON.stringify);try{await V.createRelease({input:{...B,did:a.meta.did,projectId:e,releaseId:N?"":x,status:F}}),F==="draft"?$.success(k("blocklet.publish.saveDraftSuccess")):(T(!1),$.success(k("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),l({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(W){const ee=Pe(W);$.error(ee),(/resource/.test(ee)||/zip/.test(ee))&&l({blockletResource:ee})}const re=await V.getProject({input:{did:a.meta.did,projectId:e}}),ne=re.project.lastReleaseId;t.autoUpload&&await e1(re.project.connectedStores.map(W=>async()=>{try{const ee=await V.publishToStore({input:{did:a.meta.did,storeId:W.storeId,storeName:W.storeName,projectId:e,releaseId:ne,type:G}});$.success(o.jsx(A2,{storeName:W.storeName,storeUrl:W.storeUrl,developerDid:W.developerDid,published:ee.url==="published"}),{duration:1e4})}catch(ee){$.error(Pe(ee))}}),{concurrency:4}),Y==null||Y(),I(`../${e}/view/${ne}`,{replace:!0})},fe=F=>(S(!0),Se(F).finally(()=>{S(!1)})),ce=async F=>{await Kl(V,F),b()},te=()=>{A(!0)};let Q=null;if(f&&c1){const F=he(c1,`/api/project/${a.meta.did}/${e}/${x}/release/blocklet.json`);if(L==="pack"){const Z=new URL(c1);Z.pathname=he(Z.pathname,"/launch-blocklet/agreement"),Z.searchParams.set("blocklet_meta_url",F),Q=K?o.jsx(ie,{component:"a",disabled:i,href:Z.href,target:"_blank",rel:"noreferrer",color:"primary",sx:{mr:1},onClick:()=>q(F),children:o.jsx(pe,{icon:"ic:baseline-install-desktop"})}):o.jsx(oe,{href:Z.href,disabled:i,target:"_blank",rel:"noreferrer",variant:"outlined",sx:{mr:1},onClick:()=>q(F),children:k("common.install")})}else Q=o.jsxs(o.Fragment,{children:[K?o.jsx(ie,{disabled:i,color:"primary",sx:{mr:1},onClick:()=>q(F),children:o.jsx(pe,{icon:"ic:baseline-install-desktop"})}):o.jsx(oe,{disabled:i,variant:"outlined",sx:{mr:1},onClick:()=>q(F),children:k("blocklet.publish.copyInstallUrl")}),o.jsx(g2,{fullWidth:!0,maxWidth:"sm",open:H,onClose:()=>q(""),children:o.jsxs(z,{sx:{py:5,px:4,wordBreak:"break-all"},children:[o.jsx(J,{variant:"h6",sx:{mb:2},children:k("blocklet.publish.installResourceTip")}),o.jsx(H2,{children:H}),o.jsxs(J,{sx:{mt:2},children:[k("blocklet.publish.installResourceTip2"),o.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:k("blocklet.publish.installResourceHelp")})]})]})})]})}return o.jsxs(o.Fragment,{children:[o.jsx(s3,{className:"sticky-header",children:o.jsxs(z,{display:"flex",alignItems:"center",flexDirection:"row",children:[o.jsxs(P0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(ue,{to:"../",children:k("common.blockletStudio")}),e===X.UNOWNED_DID?o.jsx(J,{color:"text.primary",children:o.jsx(ge,{maxLength:K?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):o.jsx(ue,{to:`../${e}`,children:o.jsx(ge,{maxLength:K?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),o.jsx(J,{color:"text.primary",children:d==="create"?k("common.create"):(t==null?void 0:t.blockletVersion)||k("common.edit")})]}),o.jsx(z,{flex:"1"}),!f&&o.jsxs(p1,{disabled:i,variant:"contained",children:[o.jsxs(oe,{variant:"contained",onClick:()=>fe(Ce.PROJECT.RELEASE_STATUS.published),children:[i&&o.jsx(Oe,{size:14,sx:{mr:.5},color:"inherit"}),k("blocklet.publish.createRelease")]}),o.jsx(oe,{variant:"contained",onClick:te,children:o.jsx(pe,{icon:"mage:settings-fill",fontSize:"16px"})})]}),f&&o.jsxs(o.Fragment,{children:[Q,K?null:o.jsx(oe,{component:"a",disabled:i,href:he(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${a.meta.did}/${e}/${x}/download/${(u.files||[])[0]}`),variant:"outlined",sx:{mr:1},children:k("common.download")}),o.jsxs(p1,{disabled:i,variant:"contained",children:[o.jsxs(oe,{variant:"contained",onClick:()=>P(!0),children:[i?o.jsx(Oe,{size:14,sx:{mr:1},color:"inherit"}):o.jsx(q0,{sx:{fontSize:"1.3em",mr:1}}),k(K?"common.upload":"blocklet.publish.connectOrUpload")]}),o.jsx(oe,{variant:"contained",onClick:te,children:o.jsx(pe,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})}),o.jsx(R0,{title:k("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:M,onClose:()=>P(!1),children:o.jsx(O1,{projectType:L,blocklet:a,releaseType:G,projectId:e,releaseId:x,componentDid:p,onPublish:Y,onOpenConnectStore:ce,onDelete:b,connectedStores:t.connectedStores||[],publishedStoreIds:u==null?void 0:u.publishedStoreIds})}),o.jsx(G0,{did:(de=a==null?void 0:a.meta)==null?void 0:de.did,params:t,projectId:e,open:E,setParams:n,onClose:()=>A(!1)})]})}K0.propTypes={projectId:h.string.isRequired,params:h.object.isRequired,mode:h.string.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,release:h.object.isRequired,isPublished:h.bool.isRequired,releaseId:h.string.isRequired,getData:h.func.isRequired,getRelease:h.func.isRequired,componentDid:h.string.isRequired,resourceRelateComponents:h.object.isRequired,disabledSelectComponents:h.bool.isRequired,saveSelectedEventsRef:h.object.isRequired,hasSelectedResources:h.bool.isRequired,initLogoUrl:h.string.isRequired,setLoading:h.func.isRequired,releaseUsedLast:h.bool.isRequired,setReleaseUsedLast:h.func.isRequired,projectType:h.string.isRequired,setParamsErrTip:h.func.isRequired,setParams:h.func.isRequired,initUrl:h.object.isRequired};const s3=ae.div`
168
168
  .sticky-header {
169
169
  margin-top: -12px;
170
170
  padding: 12px 0;
@@ -178,7 +178,7 @@ import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC a
178
178
  padding-bottom: 12px;
179
179
  border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
180
180
  }
181
- `;function X0({text:e}){return e?o.jsx(q2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[W2,{target:"_blank"}]]}):o.jsx(ye,{Icon:Ge})}X0.propTypes={text:h.string.isRequired};function J0({params:e,setParams:t,paramsErrTip:l,loading:r,setParamsErrTip:n,readOnly:d}){var x;const{t:i}=le(),[a,u]=C.useState(d?"preview":"write"),f=(b,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(J,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(M2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Y1,{value:"write",label:"Write"}),o.jsx(Y1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Le,{disabled:r||d,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:o.jsxs(C1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",Ce.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:b=>{n({blockletIntroduction:""}),t({blockletIntroduction:b.target.value.slice(0,Ce.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(X0,{text:e.blockletIntroduction||""})})]})}J0.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var H1={},r3=Ne;Object.defineProperty(H1,"__esModule",{value:!0});var Q0=H1.default=void 0,n3=r3(Te()),p0=o;Q0=H1.default=(0,n3.default)([(0,p0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,p0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function $1({step:e,ok:t,active:l,error:r}){let n="grey.500",d=e+1;return t&&(d=o.jsx(G2,{sx:{fontSize:18,margin:0},color:"white"})),r||!t&&l>e?(n="error.main",d=o.jsx(Q0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(n="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:n,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:d})}$1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};$1.defaultProps={step:0,ok:!1,active:0,error:""};function Y0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:r,params:n,loading:d,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=le(),x=()=>{l(c=>c+1)},b=()=>{l(c=>c-1)},y=c=>c===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):c===2?i==null?void 0:i.blockletResource:c>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||W0({hasSelectedResources:r,params:n,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(X2,{activeStep:t,orientation:"vertical",children:e.map((c,m)=>{const g={},v=d||!l3({hasSelectedResources:r,params:n,projectId:u,step:m,t:f}),R=d?"":y(m);return R&&(g.optional=o.jsx(J,{variant:"caption",color:"error",children:R}),g.error=!0),o.jsxs(J2,{children:[o.jsx(bt,{icon:o.jsx($1,{error:R,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:R?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...g,children:o.jsx(J,{fontSize:"14px",fontWeight:"500",color:R||!v&&t>m?"error.main":"inherit",children:c.label})}),o.jsxs(St,{children:[o.jsx(J,{fontSize:12,children:c.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(oe,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:R||!v,children:f("common.continue")}),m>0&&o.jsx(oe,{disabled:m===0,onClick:b,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},c.label)})}),t>=e.length-1&&o.jsx(j0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(J,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}Y0.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const i3=[".zip",".gz"],a3=1024*1024*100,c3=C.lazy(()=>w0(()=>import("./react-ChRfz7rm.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function F1({app:e,projectId:t,readOnly:l,params:r,setParams:n,setParamsErrTip:d,error:i}){const{t:a}=le(),u=C.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(J,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(L2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!r.uploadedResource&&o.jsx(J,{component:"a",href:`${x}/params.uploadedResource`,children:r.uploadedResource}),!l&&o.jsx(oe,{variant:"outlined",size:"small",onClick:()=>{var b;f()&&((b=u.current)==null||b.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(C.Suspense,{fallback:o.jsx(ze,{}),children:o.jsx(c3,{ref:u,popup:!0,onUploadFinish:b=>{var y;n({uploadedResource:b.data.filename}),d({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:i3,maxFileSize:a3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}F1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};F1.defaultProps={};function t1({readOnly:e,params:t,setParams:l,paramsErrTip:r,setParamsErrTip:n,loading:d}){var a;const{t:i}=le();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{required:!0,disabled:d||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{n({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),o.jsx(Le,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(C1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",Ce.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{n({note:""}),l({note:u.target.value.slice(0,Ce.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}t1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};t1.defaultProps={};const d3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const r=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},r),value:r})},h0=(e,t)=>{const l=v1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(r=>({...r,included:!0})):l.blockletComponents=(t.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},u3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},f0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function U1({initUrl:e,...t}){var W1;const{projectId:l,mode:r,releaseId:n,componentDid:d=""}=l1(),{t:i}=le(),{blocklet:a}=Ve(),[u,f]=Me({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,b]=Me({}),[y,p]=C.useState(!1),[c,m]=Me(null),{api:g}=je(),v=We(D=>D.breakpoints.down("md")),[R,S]=C.useState({}),[N,T]=C.useState(!1),L=C.useRef({}),[k,U]=Me({}),[V,I]=C.useState(""),[M,P]=Me({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),A=E==="readonly",H=C.useMemo(()=>{const D={};return Object.keys(M).forEach(_=>{const Re=M[_];Re&&Re.forEach(t2=>{D[t2]=!0})}),D},[M]),q=C.useCallback(D=>{A&&f({blockletComponents:[]}),P(D)},[A,P,f]),K=C.useCallback((...D)=>{U(...D),b({blockletResource:""})},[]),G=n==="none"?(u==null?void 0:u.lastReleaseId)||"":n,[Y,Se]=C.useState(r==="new-release"?4:0);C.useEffect(()=>{l&&b({projectId:""})},[l,b]);const fe=C.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(H).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,H]),ce=[],te=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!d||D.meta.did===d);te.forEach(D=>{d3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[Q,xe]=C.useState((W1=ce[0])==null?void 0:W1.value),de=!N&&(c==null?void 0:c.status)==="published",F=de,Z=b2(()=>{if(!e)return;I(e.searchParams.get("logo")),f(_=>{var Re;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Re=_==null?void 0:_.blockletComponents)!=null&&Re.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),B=async()=>{if(G)try{const D=await g.getRelease({input:{did:a.meta.did,projectId:l,releaseId:G}});if(p(!1),!D.release){$.error("Release not found");return}r!=="view"&&(D.release.note=""),f(_=>h0({..._,...D.release,blockletVersion:r==="create"||r==="new-release"?Ie.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Pe(D))}},re=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const D=await g.getProject({input:{did:a.meta.did,projectId:l}});p(!1);const _=D.project||{};_.blockletVersion?(r==="create"||r==="new-release")&&Ie.valid(_.blockletVersion)&&(_.blockletVersion=Ie.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Re=h0(_,a);f(Re),_.lastReleaseId||Z()}catch(D){p(!1),$.error(Pe(D))}},ne=C.useCallback(async()=>{if(r==="view"){if(!G){$.error("Empty release id");return}await re(),await B();return}await re(),G&&(T(!0),await B())},[r,G]),Ke=D=>{f({blockletComponents:D})};C.useEffect(()=>{ne()},[ne]),C.useEffect(()=>{l===X.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&Z()},[l,e,r,Z]);const _e=C.useMemo(()=>!!Object.keys(k).find(D=>!!k[D].length),[k]);if(!u&&y)return o.jsx(ze,{});if(!u)return null;const Be=te.find(D=>D.meta.did===Q);if(te.every(D=>D.status!=="running")&&(te!=null&&te.length))return o.jsx(ye,{children:i("blocklet.publish.allComponentsNotRunning")});const ee=D=>{xe(D)},Ee=e==null?void 0:e.searchParams.get("resourcesTitle"),q1=e==null?void 0:e.searchParams.get("componentsTitle"),ke=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Ee||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:q1||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],e2=ke[Y]||ke[ke.length-1],we=u3[Y];return o.jsxs(p3,{...t,children:[o.jsx(K0,{blocklet:a,release:c,getData:ne,getRelease:B,mode:r,params:u,setParams:f,setParamsErrTip:b,readOnly:F,isPublished:de,loading:y,setLoading:p,initLogoUrl:V,releaseId:G,projectId:l,projectType:fe,resourceComponents:te,resourceComponentsMap:M,resourceRelateComponents:H,resourceItem:Be,saveSelectedEventsRef:L,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(Y0,{steps:ke,viewMode:r==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Y,setActiveStep:Se,projectId:l,resourcesUrlTitle:Ee,componentsUrlTitle:q1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&we!=="introduction"&&o.jsxs(J,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[e2.label,we==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(k2,{})})})]}),(v||we==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(U0,{projectId:l,setParams:f,setParamsErrTip:b,params:u,componentDid:d,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:F,initLogoUrl:V,setInitLogoUrl:I})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})}),(v||we==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(J0,{loading:y,readOnly:F,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:b})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.resources].label}),o.jsx(z,{display:v||we==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(Q2,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!d&&o.jsx(I2,{tabs:ce,current:Q,onChange:ee,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(B1,{loading:y,initialResources:R,saveSelectedEventsRef:L,selectedResourceIds:k,setSelectedResourceIds:K,setResourceComponentsMap:q,error:x.blockletResource,app:a,readOnly:F,component:Be,componentDid:d,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...c,id:G}})]}),!u.resourceFromSelect&&o.jsx(F1,{app:a,readOnly:F,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:b})]})})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.blocklets].label}),(v||we==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(L1,{projectType:fe,disabled:y||F,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:H,dependentComponentsMode:E})})})}),!v&&we==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})})]})]})]})]})}U1.propTypes={initUrl:h.object};U1.defaultProps={initUrl:null};const p3=ae.div`
181
+ `;function X0({text:e}){return e?o.jsx(q2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[W2,{target:"_blank"}]]}):o.jsx(ye,{Icon:Ge})}X0.propTypes={text:h.string.isRequired};function J0({params:e,setParams:t,paramsErrTip:l,loading:r,setParamsErrTip:n,readOnly:d}){var x;const{t:i}=le(),[a,u]=C.useState(d?"preview":"write"),f=(b,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(J,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(M2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Y1,{value:"write",label:"Write"}),o.jsx(Y1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Le,{disabled:r||d,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:o.jsxs(C1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",Ce.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:b=>{n({blockletIntroduction:""}),t({blockletIntroduction:b.target.value.slice(0,Ce.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(X0,{text:e.blockletIntroduction||""})})]})}J0.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var H1={},r3=Ne;Object.defineProperty(H1,"__esModule",{value:!0});var Q0=H1.default=void 0,n3=r3(Te()),p0=o;Q0=H1.default=(0,n3.default)([(0,p0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,p0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function $1({step:e,ok:t,active:l,error:r}){let n="grey.500",d=e+1;return t&&(d=o.jsx(G2,{sx:{fontSize:18,margin:0},color:"white"})),r||!t&&l>e?(n="error.main",d=o.jsx(Q0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(n="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:n,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:d})}$1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};$1.defaultProps={step:0,ok:!1,active:0,error:""};function Y0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:r,params:n,loading:d,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=le(),x=()=>{l(c=>c+1)},b=()=>{l(c=>c-1)},y=c=>c===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):c===2?i==null?void 0:i.blockletResource:c>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||W0({hasSelectedResources:r,params:n,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(X2,{activeStep:t,orientation:"vertical",children:e.map((c,m)=>{const g={},v=d||!l3({hasSelectedResources:r,params:n,projectId:u,step:m,t:f}),R=d?"":y(m);return R&&(g.optional=o.jsx(J,{variant:"caption",color:"error",children:R}),g.error=!0),o.jsxs(J2,{children:[o.jsx(bt,{icon:o.jsx($1,{error:R,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:R?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...g,children:o.jsx(J,{fontSize:"14px",fontWeight:"500",color:R||!v&&t>m?"error.main":"inherit",children:c.label})}),o.jsxs(St,{children:[o.jsx(J,{fontSize:12,children:c.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(oe,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:R||!v,children:f("common.continue")}),m>0&&o.jsx(oe,{disabled:m===0,onClick:b,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},c.label)})}),t>=e.length-1&&o.jsx(j0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(J,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}Y0.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const i3=[".zip",".gz"],a3=1024*1024*100,c3=C.lazy(()=>w0(()=>import("./react-iG64dalH.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).then(e=>({default:e.Uploader})));function F1({app:e,projectId:t,readOnly:l,params:r,setParams:n,setParamsErrTip:d,error:i}){const{t:a}=le(),u=C.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(J,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(L2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!r.uploadedResource&&o.jsx(J,{component:"a",href:`${x}/params.uploadedResource`,children:r.uploadedResource}),!l&&o.jsx(oe,{variant:"outlined",size:"small",onClick:()=>{var b;f()&&((b=u.current)==null||b.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(C.Suspense,{fallback:o.jsx(ze,{}),children:o.jsx(c3,{ref:u,popup:!0,onUploadFinish:b=>{var y;n({uploadedResource:b.data.filename}),d({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:i3,maxFileSize:a3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}F1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};F1.defaultProps={};function t1({readOnly:e,params:t,setParams:l,paramsErrTip:r,setParamsErrTip:n,loading:d}){var a;const{t:i}=le();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{required:!0,disabled:d||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{n({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),o.jsx(Le,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(C1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",Ce.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{n({note:""}),l({note:u.target.value.slice(0,Ce.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}t1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};t1.defaultProps={};const d3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const r=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},r),value:r})},h0=(e,t)=>{const l=v1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(r=>({...r,included:!0})):l.blockletComponents=(t.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},u3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},f0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function U1({initUrl:e,...t}){var W1;const{projectId:l,mode:r,releaseId:n,componentDid:d=""}=l1(),{t:i}=le(),{blocklet:a}=Ve(),[u,f]=Me({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,b]=Me({}),[y,p]=C.useState(!1),[c,m]=Me(null),{api:g}=je(),v=We(D=>D.breakpoints.down("md")),[R,S]=C.useState({}),[N,T]=C.useState(!1),L=C.useRef({}),[k,U]=Me({}),[V,I]=C.useState(""),[M,P]=Me({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),A=E==="readonly",H=C.useMemo(()=>{const D={};return Object.keys(M).forEach(_=>{const Re=M[_];Re&&Re.forEach(t2=>{D[t2]=!0})}),D},[M]),q=C.useCallback(D=>{A&&f({blockletComponents:[]}),P(D)},[A,P,f]),K=C.useCallback((...D)=>{U(...D),b({blockletResource:""})},[]),G=n==="none"?(u==null?void 0:u.lastReleaseId)||"":n,[Y,Se]=C.useState(r==="new-release"?4:0);C.useEffect(()=>{l&&b({projectId:""})},[l,b]);const fe=C.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(H).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,H]),ce=[],te=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!d||D.meta.did===d);te.forEach(D=>{d3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[Q,xe]=C.useState((W1=ce[0])==null?void 0:W1.value),de=!N&&(c==null?void 0:c.status)==="published",F=de,Z=b2(()=>{if(!e)return;I(e.searchParams.get("logo")),f(_=>{var Re;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Re=_==null?void 0:_.blockletComponents)!=null&&Re.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),B=async()=>{if(G)try{const D=await g.getRelease({input:{did:a.meta.did,projectId:l,releaseId:G}});if(p(!1),!D.release){$.error("Release not found");return}r!=="view"&&(D.release.note=""),f(_=>h0({..._,...D.release,blockletVersion:r==="create"||r==="new-release"?Ie.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Pe(D))}},re=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const D=await g.getProject({input:{did:a.meta.did,projectId:l}});p(!1);const _=D.project||{};_.blockletVersion?(r==="create"||r==="new-release")&&Ie.valid(_.blockletVersion)&&(_.blockletVersion=Ie.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Re=h0(_,a);f(Re),_.lastReleaseId||Z()}catch(D){p(!1),$.error(Pe(D))}},ne=C.useCallback(async()=>{if(r==="view"){if(!G){$.error("Empty release id");return}await re(),await B();return}await re(),G&&(T(!0),await B())},[r,G]),Ke=D=>{f({blockletComponents:D})};C.useEffect(()=>{ne()},[ne]),C.useEffect(()=>{l===X.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&Z()},[l,e,r,Z]);const _e=C.useMemo(()=>!!Object.keys(k).find(D=>!!k[D].length),[k]);if(!u&&y)return o.jsx(ze,{});if(!u)return null;const Be=te.find(D=>D.meta.did===Q);if(te.every(D=>D.status!=="running")&&(te!=null&&te.length))return o.jsx(ye,{children:i("blocklet.publish.allComponentsNotRunning")});const ee=D=>{xe(D)},Ee=e==null?void 0:e.searchParams.get("resourcesTitle"),q1=e==null?void 0:e.searchParams.get("componentsTitle"),ke=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Ee||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:q1||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],e2=ke[Y]||ke[ke.length-1],we=u3[Y];return o.jsxs(p3,{...t,children:[o.jsx(K0,{blocklet:a,release:c,getData:ne,getRelease:B,mode:r,params:u,setParams:f,setParamsErrTip:b,readOnly:F,isPublished:de,loading:y,setLoading:p,initLogoUrl:V,releaseId:G,projectId:l,projectType:fe,resourceComponents:te,resourceComponentsMap:M,resourceRelateComponents:H,resourceItem:Be,saveSelectedEventsRef:L,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(Y0,{steps:ke,viewMode:r==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Y,setActiveStep:Se,projectId:l,resourcesUrlTitle:Ee,componentsUrlTitle:q1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&we!=="introduction"&&o.jsxs(J,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[e2.label,we==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(k2,{})})})]}),(v||we==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(U0,{projectId:l,setParams:f,setParamsErrTip:b,params:u,componentDid:d,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:F,initLogoUrl:V,setInitLogoUrl:I})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})}),(v||we==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(J0,{loading:y,readOnly:F,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:b})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.resources].label}),o.jsx(z,{display:v||we==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(Q2,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!d&&o.jsx(I2,{tabs:ce,current:Q,onChange:ee,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(B1,{loading:y,initialResources:R,saveSelectedEventsRef:L,selectedResourceIds:k,setSelectedResourceIds:K,setResourceComponentsMap:q,error:x.blockletResource,app:a,readOnly:F,component:Be,componentDid:d,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...c,id:G}})]}),!u.resourceFromSelect&&o.jsx(F1,{app:a,readOnly:F,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:b})]})})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.blocklets].label}),(v||we==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(L1,{projectType:fe,disabled:y||F,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:H,dependentComponentsMode:E})})})}),!v&&we==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})})]})]})]})]})}U1.propTypes={initUrl:h.object};U1.defaultProps={initUrl:null};const p3=ae.div`
182
182
  .section {
183
183
  &.full-width {
184
184
  max-width: 100%;
@@ -1 +1 @@
1
- import{d as A,v as R,p as w,e as p}from"./index-DjRZjTaR.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
1
+ import{d as A,v as R,p as w,e as p}from"./index-CyJ9Y2Pj.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
@@ -1 +1 @@
1
- import{b4 as a}from"./index-RoEjkyyY.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
1
+ import{b4 as a}from"./index-Dmbbtwcx.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
@@ -1,4 +1,4 @@
1
- import{b4 as l}from"./index-RoEjkyyY.js";var c={exports:{}};/*!
1
+ import{b4 as l}from"./index-Dmbbtwcx.js";var c={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
@@ -1,4 +1,4 @@
1
- import{j as r,T as i,P as e,dr as f,fa as c,br as u}from"./index-RoEjkyyY.js";function l({name:t,nameFormatter:o,layout:a,children:n,valueComponent:s,nameWidth:m,...p}){return r.jsxs(d,{layout:a,width:m,...p,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:o(t)}),n&&r.jsx(i,{color:"textPrimary",component:s,className:"info-row__value",children:n})]})}l.propTypes={name:e.any.isRequired,layout:e.oneOf(["horizontal","vertical"]),children:e.any,nameFormatter:e.func,valueComponent:e.string,nameWidth:e.number};l.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const o=t.split(" ").map(a=>f(c(a))).join(" ");return typeof t=="string"?o:t},valueComponent:"div",layout:"horizontal"};const d=u("div")`
1
+ import{j as r,T as i,P as e,ds as f,fb as c,bq as u}from"./index-Dmbbtwcx.js";function l({name:t,nameFormatter:o,layout:a,children:n,valueComponent:s,nameWidth:m,...p}){return r.jsxs(d,{layout:a,width:m,...p,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:o(t)}),n&&r.jsx(i,{color:"textPrimary",component:s,className:"info-row__value",children:n})]})}l.propTypes={name:e.any.isRequired,layout:e.oneOf(["horizontal","vertical"]),children:e.any,nameFormatter:e.func,valueComponent:e.string,nameWidth:e.number};l.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const o=t.split(" ").map(a=>f(c(a))).join(" ");return typeof t=="string"?o:t},valueComponent:"div",layout:"horizontal"};const d=u("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1,4 +1,4 @@
1
- import{bq as e,P as o,r as g,j as l,br as u,bs as h,bh as x,T as w}from"./index-RoEjkyyY.js";const T={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},O=T,a={error:{color:e.common.white,backgroundColor:e.error.main},warning:{color:e.common.white,backgroundColor:e.warning.main},success:{color:e.common.white,backgroundColor:e.success.main},primary:{color:e.common.white,backgroundColor:e.primary.main},reverse:{color:"#fff",backgroundColor:"#222"}};function s(n){const t=h(n,s,["style"]),{type:r,content:p,children:m,style:d,className:y,forwardedRef:f,...b}=t,{palette:c}=x(),i=Object.assign({},a[r]||a.primary,d);return c[r]&&Object.assign(i,{color:c[r].contrastText||e.common.white,backgroundColor:c[r].main}),l.jsx(k,{ref:f,component:"span",className:y,style:i,...b,children:p||m})}s.propTypes={children:o.any.isRequired,type:o.oneOf(Object.keys(a)),content:o.string,className:o.string,style:o.oneOfType([o.object,o.string])};s.defaultProps={type:"primary",content:"",className:"",style:{}};const j=g.forwardRef((n,t)=>l.jsx(s,{...n,forwardedRef:t})),P=j,k=u(w)`
1
+ import{bp as e,P as o,r as b,j as p,bq as u,br as h,af as x,T as w}from"./index-Dmbbtwcx.js";const T={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},O=T,a={error:{color:e.common.white,backgroundColor:e.error.main},warning:{color:e.common.white,backgroundColor:e.warning.main},success:{color:e.common.white,backgroundColor:e.success.main},primary:{color:e.common.white,backgroundColor:e.primary.main},reverse:{color:"#fff",backgroundColor:"#222"}};function s(n){const t=h(n,s,["style"]),{type:r,content:l,children:m,style:d,className:f,forwardedRef:y,...g}=t,{palette:c}=x(),i=Object.assign({},a[r]||a.primary,d);return c[r]&&Object.assign(i,{color:c[r].contrastText||e.common.white,backgroundColor:c[r].main}),p.jsx(k,{ref:y,component:"span",className:f,style:i,...g,children:l||m})}s.propTypes={children:o.any.isRequired,type:o.oneOf(Object.keys(a)),content:o.string,className:o.string,style:o.oneOfType([o.object,o.string])};s.defaultProps={type:"primary",content:"",className:"",style:{}};const j=b.forwardRef((n,t)=>p.jsx(s,{...n,forwardedRef:t})),P=j,k=u(w)`
2
2
  && {
3
3
  display: inline-flex;
4
4
  justify-content: center;
@@ -0,0 +1,54 @@
1
+ import{co as Q,aV as N,r as f,aM as P,bT as pe,s as v,a9 as K,u as L,j as e,P as x,eQ as Ke,c0 as le,c as G,fd as Ge,T as S,B as y,J as de,aq as Xe,a1 as te,m as Z,Z as ve,a0 as We,gy as Ye,X as ne,Y as oe,aQ as _,fc as qe,az as _e,aO as $e,$ as et,Q as tt,bc as Se,bW as st,ct as nt,F as z,bd as q,a as ot,gz as at,C as it,bD as rt}from"./index-Dmbbtwcx.js";import{S as Ae}from"./index-CmxSwDI6.js";import"./api-BNgzqvJ7.js";import{u as Ie,P as ct}from"./use-blocklet-info-for-connect-did-spaces-N1tQaruo.js";import{b as lt,h as dt,d as se,e as Be,f as pt,i as Ce,j as ut,k as ht,l as ke,c as mt}from"./spaces-pVN9ClcY.js";import{f as X,D as ft}from"./format-error-BhfIHXu5.js";import{T as xt}from"./TextField-endZMNmB.js";import{A as gt}from"./Alert-g4kHOcZt.js";import{I as yt}from"./index-CBjzOjOd.js";import{E as De}from"./Link-CyjzJAjs.js";import{W as jt}from"./did-address-DbLRcPW2.js";import{S as Ee}from"./switch-control-DB62K84_.js";import{d as St}from"./MoreVert-Dw6DD_Y2.js";import{d as At}from"./DeleteOutline-C5wDmNvo.js";import{L as $,a as ee}from"./ListItemText-CRfaCcXD.js";import{e as Bt}from"./mode-B2dWMeTO.js";import{T as ce}from"./index-CKcMAUDG.js";import{D as Ct}from"./index-DZJL1WDO.js";import"./ExpandMore-DjWcUZ_t.js";import"./ButtonGroup-CgY-ppCE.js";import"./CloseOutlined-ZLLhO9hq.js";import"./index-Bybdue8D.js";import"./FormControl-CTJIBsW8.js";import"./useFormControl-ThWDsTIL.js";import"./InputLabel-o8Jz2Es-.js";import"./Select-B7YRgule.js";import"./useSlot-BhbSJM-8.js";import"./index-BOI9Etqy.js";import"./FormControlLabel-xqZ79iQ8.js";import"./FilterList-DclE2l4O.js";import"./useThemeProps-B8VNQkzV.js";import"./toPropertyKey-hKuLU48H.js";import"./FormGroup-B7SNePwe.js";import"./index-CurAG5ra.js";import"./LastPage-DOrkqqL0.js";import"./Toolbar-DX1aq1wO.js";import"./index-BXLC5YsG.js";import"./redux-CSBj6943.js";import"./Search-5XN6Shqj.js";import"./Delete-CRjviPIR.js";import"./index-D5aNUG7R.js";async function kt({blockletDid:s,nodeApi:t,spaceGateways:a}){let n=!1;const c=await Promise.all(a.map(async i=>{let{name:o}=i;const r=await lt(i.endpoint);return!Q.isEmpty(r)&&r!==o&&(o=r,n=!0),{...i,name:o}}));return n&&await Promise.all(c.filter(i=>i.did).map(i=>t.updateBlockletSpaceGateway({input:{did:s,where:{did:i.did},spaceGateway:{...i}}}))),c}function vt({setLoading:s,refresh:t}={}){var r;const{blocklet:a}=N(),n=(r=a==null?void 0:a.meta)==null?void 0:r.did,[c,i]=f.useState([]),{api:o}=P();return pe(async()=>{try{if(!n){i([]);return}s==null||s(!0);const{spaceGateways:l}=await o.getBlockletSpaceGateways({input:{did:n}}),d=await kt({blockletDid:n,nodeApi:o,spaceGateways:l});i(d??[])}catch(l){console.error(l),v.error(X(l))}finally{s==null||s(!1)}},[n,t]),{spaceGateways:c}}function Ue({deps:s,setLoading:t}={deps:[],setLoading:()=>{}}){var r;const{blocklet:a}=N(),[n,c]=f.useState([]),{api:i}=P(),o=Q.debounce(async()=>{try{if(t(!0),!a){c([]);return}const{backups:l}=await i.getBlockletBackups({input:{did:a.meta.did}});c(l??[])}catch(l){console.error(l),v.error(X(l))}finally{t(!1)}},2e3);return pe(async()=>{o()},[(r=a==null?void 0:a.meta)==null?void 0:r.did].concat(s)),{backups:n}}function It({appDid:s}){const{backups:t}=Ue(),[a,n]=f.useState({message:"",progress:0,completed:!1}),c=P(),{ws:{useSubscription:i}}=c;return i(K.BlockletEvents.backupProgress,o=>{s===(o==null?void 0:o.appDid)&&n(()=>({...o}))},[s]),f.useEffect(()=>{var o;if(t!=null&&t.length&&Q.isNull((o=t[0])==null?void 0:o.status)){const[r]=t;n(()=>({message:r.message,progress:r.progress,completed:r.progress>=100}))}},[t]),a}function Dt({deps:s}={deps:[]}){var i;const{blocklet:t}=N(),{api:a}=P(),[n,c]=f.useState(null);return pe(async()=>{var o;if((o=t==null?void 0:t.meta)!=null&&o.did){const{autoBackup:r}=await a.getAutoBackup({input:{did:t.meta.did}});c(r)}},[(i=t==null?void 0:t.meta)==null?void 0:i.did].concat(s)),n}const be=f.createContext({}),{Provider:Et,Consumer:Rs}=be;function ue({children:s}){const{t}=L(),{api:a}=P(),{blocklet:n}=N(),[c,i]=f.useState(!1),[o,r]=f.useState(!1),{spaceGateways:l}=vt({refresh:o,setLoading:i}),d=It({appDid:n==null?void 0:n.appDid}),[m,E]=f.useState(!1),j=f.useMemo(()=>dt(n==null?void 0:n.environments),[n,o,m]),[g,A]=f.useState(!1),{backups:I}=Ue({deps:[d],setLoading:A}),[V,D]=f.useState(l==null?void 0:l.find(p=>p.endpoint===j)),[M,u]=f.useState(!1),w=Dt({deps:[M]}),U=()=>{r(p=>!p)},O=()=>{E(p=>!p)},k=()=>{u(p=>!p)},R=async p=>{await a.updateAutoBackup({input:{did:n.meta.did,autoBackup:p}}),k()},h=async(p,F)=>{l.push({...p,loading:!0}),await a.addBlockletSpaceGateway({input:{did:n.meta.did,spaceGateway:p}}),j!==F&&await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:F}]}}),U(),D(p)},B=async p=>{p&&(p.endpoint===j&&(await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),w!=null&&w.enabled&&await R({enabled:!1})),await a.deleteBlockletSpaceGateway({input:{did:n.meta.did,spaceGatewayDid:p==null?void 0:p.did}}),U(),D(p))},C=async p=>{await a.updateBlockletSpaceGateway({input:{did:n.meta.did,where:{did:p.did},spaceGateway:p}}),j!==p.endpoint&&await a.configBlocklet({input:{did:[n.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:p.endpoint}]}}),v.success(t("storage.spaces.connectedWithName",{name:(p==null?void 0:p.name)??"DID Spaces"})),U()},T=p=>(p==null?void 0:p.endpoint)===j;return e.jsx(Et,{value:{spaceGateways:l,selectedSpaceGateway:V,addSpaceGateway:h,deleteSpaceGateway:B,updateSpaceGateway:C,refreshSpaceGateways:U,spaceGatewaysLoading:c,spaceGatewayIsSelected:T,updateAutoBackup:R,backupEndpoint:j,backupProgress:d,backups:I,backupsLoading:g,refreshBackupEndpoint:O,autoBackup:w},children:s})}ue.propTypes={children:x.any.isRequired};ue.defaultProps={};function H(){return f.useContext(be)}function ae({...s}){const{blocklet:t}=N(),{info:a}=P(),{t:n,locale:c}=L(),[i,o]=f.useState(""),[r,l]=f.useState(!1),[d,m]=f.useState(!1),[E,j]=f.useState(""),g=Ie({blocklet:t}),A=Ke(a),{spaceGateways:I,addSpaceGateway:V}=H(),[D,M]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,checkFn:le.create({baseURL:G(window.location.origin,Ge())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:g.appName},c),scan:n("storage.spaces.provideNFT.scan",{appName:g.appName},c),confirm:"",success:e.jsx(S,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{M(h=>({...h,open:!1}))}}),[u,w]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:g.appName},c),scan:n("storage.spaces.authorize.scan",{appName:g.appName},c),confirm:"",success:e.jsx(S,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{w(h=>({...h,open:!1}))}}),U=async({endpoint:h,name:B,did:C})=>{const T=await Be(h);if(!await Ce(T)){v.error(n("storage.spaces.gateway.add.invalidUrl"));return}if(I.some(W=>W.endpoint===h)){v.error(n("storage.spaces.gateway.add.duplicate",{name:B}));return}const F={name:B,did:C,url:T,endpoint:h};await V(F,h),v.success(n("storage.spaces.connectedWithName",{name:(F==null?void 0:F.name)??"DID Spaces"}))},O=async(h,B)=>{try{if(!Q.isEmpty(h.spaceGateway))await U(B(h.spaceGateway));else{const C=B(h.endpoint),T=h.space?B(h.space):{};await U({endpoint:C,did:se(C),name:"DID Space",...T})}w(C=>({...C,open:!1})),o(null),M(C=>({...C,open:!1}))}catch(C){console.error(C),v.error(X(C))}},k=()=>{M(h=>({...h,open:!0,extraParams:{appPid:t.appPid,appName:g.appName,appDescription:g.appDescription,scopes:g.scopes,appUrl:g.appUrl,referrer:g.referrer,nodeDid:a.did}}))},R=async()=>{try{l(!0);const h=await Be(i),B=pt(h),C=new URL(h).searchParams.get("spaceDid");if(!await Ce(B))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));w(T=>({...T,open:!0,prefix:G(B,"space/api/did"),baseUrl:new URL(B).origin,checkFn:le.create({baseURL:G(B,"space")}).get,extraParams:{appDid:g.appDid,appName:g.appName,appDescription:g.appDescription,scopes:g.scopes,appUrl:g.appUrl,referrer:g.referrer,nodeDid:a.did,spaceDid:C}})),m(!1)}catch(h){const B=`${n("storage.spaces.gateway.add.failed",c)}: ${X(h)}`;j(B)}finally{l(!1)}};return e.jsxs(y,{children:[e.jsx(Ae,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:k,menu:[e.jsx(Ae.Item,{sx:{textTransform:"none"},onClick:()=>m(!0),size:"small",...s,children:n("storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(S,{sx:{fontWeight:"bold",textTransform:"none"},children:n("storage.spaces.connect.useWallet")})}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:D.prefix,open:D.open,popup:!0,action:D.action,webWalletUrl:A,baseUrl:D.baseUrl,checkFn:D.checkFn,onSuccess:O,onClose:D.onClose,checkTimeout:D.checkTimeout,extraParams:D.extraParams,messages:D.messages,locale:c}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:u.prefix,open:u.open,popup:!0,action:u.action,baseUrl:u.baseUrl,checkFn:u.checkFn,onSuccess:O,onClose:u.onClose,checkTimeout:u.checkTimeout,extraParams:u.extraParams,messages:u.messages,locale:c}),e.jsxs(Xe,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:d,onClose:()=>m(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(te,{onClick:h=>{h.stopPropagation(),m(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(te,{onClick:R,color:"primary",disabled:r||!i,variant:"contained",autoFocus:!0,children:[r&&e.jsx(Z,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(ft,{component:"div",children:e.jsx(S,{component:"div",children:e.jsx(xt,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:i,onChange:h=>{j(null),o(h.target.value)},disabled:r,onKeyPress:async h=>{h.key==="Enter"&&await R()},autoFocus:!0})})})}),!!E&&e.jsx(gt,{severity:"error",style:{width:"100%"},children:E})]})]})}ae.propTypes={};ae.defaultProps={};function we({...s}){const{t}=f.useContext(We),{blocklet:a,loadingDiskInfo:n,actions:c}=N();if(f.useEffect(()=>{c.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),a.diskInfo){const i=(l,d,m)=>e.jsxs(S,{children:[m?e.jsx(De,{style:{cursor:"pointer"},onClick:m,underline:"hover",children:l}):l," ",e.jsx("strong",{children:d?Ye(d):"empty"})]}),o=a.environments.reduce((l,d)=>(l[d.key]=d.value,l),{}),r=[{key:"appDir",name:t("blocklet.diskInfo.appDir"),value:i(o.BLOCKLET_APP_DIR,a.diskInfo.app)},{key:"dataDir",name:t("blocklet.diskInfo.dataDir"),value:i(o.BLOCKLET_DATA_DIR,a.diskInfo.data)},{key:"logDir",name:t("blocklet.diskInfo.logDir"),value:i(o.BLOCKLET_LOG_DIR,a.diskInfo.log)},{key:"cacheDir",name:t("blocklet.diskInfo.cacheDir"),value:i(o.BLOCKLET_CACHE_DIR,a.diskInfo.cache)}];return e.jsx(Ut,{component:"div",...s,children:r.map(l=>e.jsx(yt,{valueComponent:"div",nameWidth:120,name:l.name,children:l.value},l.key))})}return n?e.jsx(Z,{}):e.jsx(S,{children:t("blocklet.diskInfo.empty")})}const Ut=ve(S)``;var Re=function(t){return e.jsxs("svg",{...t,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,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"})]})]})};Re.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Te(){const{t:s}=L();return e.jsxs(y,{children:[e.jsxs(y,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(Re,{style:{width:250,height:250}}),e.jsx(S,{marginTop:"24px",marginBottom:"24px",children:s("storage.spaces.connect.provider")}),e.jsx(ae,{})]}),e.jsx(S,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:s("common.dataStorage")}),e.jsx(we,{})]})}Te.propTypes={};var he={},bt=oe;Object.defineProperty(he,"__esModule",{value:!0});var Fe=he.default=void 0,wt=bt(ne()),Rt=e;Fe=he.default=(0,wt.default)((0,Rt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var me={},Tt=oe;Object.defineProperty(me,"__esModule",{value:!0});var Oe=me.default=void 0,Ft=Tt(ne()),Ot=e;Oe=me.default=(0,Ft.default)((0,Ot.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var fe={},Lt=oe;Object.defineProperty(fe,"__esModule",{value:!0});var Le=fe.default=void 0,Mt=Lt(ne()),Nt=e;Le=fe.default=(0,Mt.default)((0,Nt.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function xe({spaceGateway:s,onDelete:t}){const{t:a}=L(),[n,c]=f.useState(!1),[i,o]=f.useState(!1),r=(d,m)=>{d==null||d.preventDefault(),d==null||d.stopPropagation(),c(m)},l=async d=>{try{d==null||d.stopPropagation(),o(!0),await t(s),c(!1)}catch(m){console.error(m),v.error(`${a("storage.space.gateway.delete.failed")}: ${X(m)}`)}finally{o(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(_,{color:"red",onClick:d=>r(d,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(At,{fontSize:"small"})}),e.jsx(ee,{style:{color:"red"},children:a("common.delete")})]}),e.jsx(qe,{title:e.jsx(S,{variant:"h6",children:a("common.delConfirmDescription",{data:`${s==null?void 0:s.name}`})}),open:n,confirmButton:{text:a("common.confirm"),props:{variant:"contained",color:"error",loading:i}},cancelButton:{text:a("common.cancel"),props:{variant:"contained",color:"primary"},loading:i},onConfirm:l,onCancel:d=>r(d,!1)})]})}xe.propTypes={onDelete:x.func,spaceGateway:x.shape({name:x.string.isRequired,url:x.string.isRequired,protected:x.bool}).isRequired};xe.defaultProps={onDelete:()=>{}};function ge({spaceGateway:s,connected:t,onDelete:a,onConnect:n,enableSwitchToSpace:c,backupInProgress:i,...o}){const[r,l]=f.useState(null),{t:d}=L(),[m,E]=f.useState(!1),j=(A,I)=>{A.stopPropagation(),A.preventDefault(),l(I&&A.currentTarget)},g=async A=>{try{E(!0),j(A,!1),await n(s)}catch(I){console.error(I),v.error(I.message)}finally{E(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(_e,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:A=>j(A,!0),size:"small",...o,children:m||s!=null&&s.loading?e.jsx(Z,{size:"24px"}):e.jsx(St,{})}),e.jsxs($e,{id:"simple-menu",anchorEl:r,keepMounted:!0,open:!!r,onClose:A=>j(A,!1),children:[e.jsxs(_,{onClick:A=>{j(A,!1),window.open(s.endpoint?ut(s.endpoint):s.url)},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Fe,{fontSize:"small"})}),e.jsx(ee,{children:d("common.open")})]}),e.jsxs(_,{onClick:A=>{j(A,!1),window.open(ht(s.endpoint))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Le,{fontSize:"small"})}),e.jsx(ee,{children:d("storage.spaces.strategy.viewBackupFiles")})]}),!t&&c&&e.jsxs(_,{onClick:g,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Oe,{fontSize:"small"})}),e.jsx(ee,{children:d("storage.spaces.connect.switchToSpace")})]}),!i&&e.jsx(xe,{spaceGateway:s,onDelete:a})]})]})}ge.propTypes={spaceGateway:x.shape({name:x.string.isRequired,url:x.string.isRequired,protected:x.bool,endpoint:x.string.isRequired,loading:x.bool}).isRequired,connected:x.bool.isRequired,enableSwitchToSpace:x.bool,onDelete:x.func,onConnect:x.func,backupInProgress:x.bool};ge.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};var Me=function(t){return e.jsx("svg",{...t,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Me.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var Ne=function(t){return e.jsx("svg",{...t,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})})};Ne.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ye({spaceGateway:s,connected:t,onDelete:a,onBackupNow:n,...c}){const i=et(b=>b.breakpoints.down("md")),{t:o,locale:r}=L(),{blocklet:l}=N(),{api:d,info:{did:m}}=P(),{appDid:E,appName:j,appDescription:g,scopes:A,appUrl:I,referrer:V}=Ie({blocklet:l}),{updateSpaceGateway:D,backupEndpoint:M,backupProgress:u,refreshBackupEndpoint:w}=H(),[U,O]=f.useState(!1),[k,R]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:o("storage.spaces.authorize.title",{appName:j},r),scan:o("storage.spaces.authorize.scan",{appName:j},r),confirm:"",success:e.jsx(S,{gutterBottom:!0,children:o("storage.spaces.authorize.success")})},onClose:()=>{R(b=>({...b,open:!1}))}}),{data:h,loading:B}=tt(async()=>t?ke(M):!0,{refreshDeps:[t,M,k==null?void 0:k.open,U]}),C=t&&h,T=t&&!U&&h&&!(s!=null&&s.loading),p=t&&U&&h,F=t&&!h&&!B&&!U,W=async()=>{if(await ke(s==null?void 0:s.endpoint)){await d.configBlocklet({input:{did:[l.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:s.endpoint}]}}),w(),v.success(o("storage.spaces.connect.switchToSpaceSucceeded",{name:s.name?`(${s.name})`:""}));return}R(Y=>({...Y,open:!0,prefix:G(s.url,"space/api/did"),baseUrl:new URL(s.url).origin,checkFn:le.create({baseURL:G(s.url,"space")}).get,extraParams:{appDid:E,appName:j,appDescription:g,scopes:A,appUrl:I,referrer:V,nodeDid:m,spaceDid:s.did}}))},Qe=async(b,Y)=>{const ie=Y(b.endpoint),He=se(ie),J=b.space?Y(b.space):{};if(s.did&&He!==s.did){R(re=>({...re,open:!1})),v.error(o("storage.spaces.gateway.switch.failedForMismatchSpace",{name:J!=null&&J.name?J.name:""}));return}const Ve={...s,name:J.name??"DID Space",did:J.did??se(ie),endpoint:ie};await D(Ve),R(re=>({...re,open:!1}))},Ze=async()=>{try{if(U)return;O(!0),await n()}catch(b){console.error(b),v.error(b.message)}finally{O(!0)}};return f.useEffect(()=>{u!=null&&u.completed?((u==null?void 0:u.progress)===100&&v.success(o("storage.spaces.backupSuccessfully")),O(!1),u.progress=0,u.message=""):u.progress&&O(!0)},[u]),e.jsxs(Pt,{style:{position:"relative"},children:[e.jsxs(y,{sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...c,children:[e.jsx(y,{display:"flex",children:e.jsx(ct,{alt:s.did,src:mt(s.endpoint)})}),e.jsxs(y,{className:"spaces-info",display:"flex",flexGrow:(!i||!p)&&1,minWidth:"180px",flexDirection:p?"row":"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[e.jsxs(y,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[e.jsx(S,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:s.name}),C&&e.jsx(Se,{label:e.jsxs(e.Fragment,{children:[e.jsx(Me,{style:{marginRight:"4px"}}),o("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}}),F&&e.jsx(Se,{label:e.jsxs(e.Fragment,{children:[e.jsx(Ne,{style:{marginRight:"4px"}}),o("storage.spaces.disconnected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}})]}),e.jsx(y,{className:"spaces-address",display:p?"none":"flex",color:"#9397A1",marginTop:"8px",children:e.jsx(S,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:s.did&&e.jsx(jt,{copyable:!1,size:14,compact:!0,responsive:!1,did:s.did})})})]}),e.jsxs(y,{className:"spaces-backup",display:"flex",alignItems:"center",flex:i&&p&&1,children:[T&&e.jsxs(y,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:[e.jsx(te,{variant:"contained",size:"small",onClick:Ze,children:o("storage.spaces.strategy.backupNow")}),Bt&&e.jsx(Ee,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:e.jsx(S,{sx:{marginRight:"8px",fontSize:"16px"},children:e.jsx("span",{children:o("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),p&&e.jsxs(y,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",minWidth:!i&&"640px",marginLeft:i&&"16px",width:i&&"360px",marginRight:"auto",alignSelf:"flex-end",children:[e.jsx(S,{color:"primary",children:u==null?void 0:u.message}),e.jsxs(y,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[e.jsx(y,{sx:{width:"100%",mr:1},children:e.jsx(st,{color:"primary",variant:"determinate",value:u==null?void 0:u.progress})}),e.jsx(y,{sx:{maxWidth:"100%"},children:e.jsxs(S,{variant:"body2",color:"text.secondary",children:[u==null?void 0:u.progress,"%"]})})]})]}),F&&e.jsx(y,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:e.jsx(te,{color:"error",variant:"contained",size:"small",onClick:W,children:o("storage.spaces.disconnected.reconnectNow")})}),e.jsx(ge,{sx:{marginLeft:"16px",marginRight:"16px",alignItems:"flex-end",justifyItems:"flex-end"},spaceGateway:s,connected:t,onDelete:a,onConnect:W,enableSwitchToSpace:(u==null?void 0:u.completed)||Q.isEmpty(u==null?void 0:u.message),backupInProgress:p})]})]}),e.jsx(de,{forceConnected:!1,saveConnect:!1,prefix:k.prefix,open:k.open,popup:!0,action:k.action,baseUrl:k.baseUrl,checkFn:k.checkFn,onSuccess:Qe,onClose:k.onClose,checkTimeout:k.checkTimeout,extraParams:k.extraParams,messages:k.messages,locale:r},"get-endpoint"),e.jsx(y,{className:`selected-container ${t?"selected":""}`,children:e.jsx(nt,{className:"selected-icon"})})]})}ye.propTypes={spaceGateway:x.shape({did:x.string.isRequired,name:x.string.isRequired,url:x.string.isRequired,endpoint:x.string.isRequired,protected:x.bool,loading:x.bool}).isRequired,connected:x.bool.isRequired,progress:x.any.isRequired,onDelete:x.func,onBackupNow:x.func};ye.defaultProps={onDelete:()=>{},onBackupNow:()=>{}};const Pt=ve(y)`
2
+ .selected-container {
3
+ position: absolute;
4
+ right: 0px;
5
+ bottom: 0px;
6
+ display: flex;
7
+ -webkit-box-pack: end;
8
+ justify-content: flex-end;
9
+ align-items: flex-end;
10
+ width: 32px;
11
+ height: 32px;
12
+ border-radius: 0px 0px 8px;
13
+ color: rgb(255, 255, 255);
14
+ overflow: hidden;
15
+ transition: all 0.4s ease 0s;
16
+
17
+ &::after {
18
+ position: absolute;
19
+ z-index: 0;
20
+ left: 60px;
21
+ top: 60px;
22
+ display: block;
23
+ width: 0px;
24
+ height: 0px;
25
+ border-width: 16px;
26
+ border-style: solid;
27
+ border-color: transparent #1dc1c7 #1dc1c7 transparent;
28
+ transition: all 0.1s ease 0s;
29
+ content: '';
30
+ }
31
+
32
+ .selected-icon {
33
+ visibility: hidden;
34
+ width: 60%;
35
+ height: 60%;
36
+ position: relative;
37
+ z-index: 2;
38
+ margin: 0px 1px 1px 0px;
39
+ font-size: 16px;
40
+ transition: all 0.2s ease 0s;
41
+ }
42
+ }
43
+
44
+ .selected-container.selected {
45
+ &::after {
46
+ left: 0px;
47
+ top: 0px;
48
+ }
49
+
50
+ .selected-icon {
51
+ visibility: visible;
52
+ }
53
+ }
54
+ `;var je={},zt=oe;Object.defineProperty(je,"__esModule",{value:!0});var Pe=je.default=void 0,Jt=zt(ne()),Qt=e;Pe=je.default=(0,Jt.default)((0,Qt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline");function ze({...s}){const{t,locale:a}=L(),{spaceGateways:n,backups:c}=H(),i=[{label:"DID Spaces",name:"target",options:{customBodyRenderLite:o=>{var A;const{targetUrl:r,targetName:l,status:d,createdAt:m}=c[o],E=d===z.BACKUPS.STATUS.PROGRESS&&q().diff(m,"hours")>=z.BACKUPS.TIMEOUT_HOURS,j=d===z.BACKUPS.STATUS.SUCCEEDED&&!E,g=l||((A=n.find(I=>r==null?void 0:r.includes(se(I==null?void 0:I.endpoint))))==null?void 0:A.name)||"Unknown DID Space";return j?e.jsx(De,{fontSize:"16px",href:r,target:"_blank",children:g}):e.jsx(S,{variant:"body1",fontSize:"16px",children:g})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:o=>{const r=t(o===0?"common.auto":"common.manual");return e.jsx(ce,{children:r})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:o=>q(o).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:o=>Q.isEmpty(o)?"":q(o).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:o=>{const{status:r,message:l,createdAt:d}=(c==null?void 0:c[o])??{},m=r===z.BACKUPS.STATUS.PROGRESS&&q().diff(d,"hours")>=z.BACKUPS.TIMEOUT_HOURS,E=m&&t("common.timeoutError"),j=r===z.BACKUPS.STATUS.PROGRESS&&!m,g=r===z.BACKUPS.STATUS.SUCCEEDED&&!m;return j?e.jsxs(S,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(Z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):g?e.jsx(ce,{type:"success",children:t("common.succeeded")}):e.jsxs(y,{display:"inline-flex",alignItems:"center",children:[e.jsx(ce,{type:"error",children:t("common.failed")}),"  ",e.jsx(ot,{style:{display:"flex",alignItems:"center",flexShrink:0},title:l||E,children:e.jsx(at,{children:e.jsx(Pe,{style:{width:"24px",height:"24px"},color:"error"})})})]})}}}];return e.jsx(y,{...s,children:c!=null&&c.length?e.jsx(Ct,{title:e.jsx(S,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")}),data:c,columns:i,emptyNode:t("storage.spaces.record.emptyData",a),options:{download:!1,filter:!1,print:!1}}):e.jsxs(e.Fragment,{children:[e.jsx(y,{display:"flex",height:"56px",lineHeight:"56px",alignItems:"center",children:e.jsx(S,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(y,{color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")})]})})}ze.propTypes={};function Je({...s}){const{t}=L(),{autoBackup:a,updateAutoBackup:n}=H(),c=async()=>{try{const i=!a.enabled;await n({enabled:i}),v.success(t(i?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(i){v.error(i.message)}};return e.jsx(Ee,{checked:!!(a!=null&&a.enabled),onChange:c,name:"enableWelcomePage",labelProps:{label:e.jsx(S,{marginRight:"8px",children:e.jsx("span",{children:t("storage.spaces.autoBackup.title")})})},style:{...s.style}})}Je.propTypes={};function Zt(){const{t:s}=L(),{blocklet:t}=N(),{api:a}=P(),{spaceGateways:n,spaceGatewaysLoading:c,deleteSpaceGateway:i,spaceGatewayIsSelected:o}=H(),r=c&&!(n!=null&&n.length),l=async m=>{await i(m),v.success(s("storage.spaces.gateway.delete.succeeded",{name:`(${m.name})`}))},d=async()=>{await a.backupBlocklet({input:{appDid:t.appDid,to:"spaces"}})};return e.jsxs(y,{display:"flex",flexDirection:"column",children:[e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:[e.jsx(S,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:s("storage.spaces.connected.title")}),e.jsx(Je,{style:{marginRight:"32px"}}),e.jsx(ae,{})]}),e.jsx(y,{children:r?e.jsx(y,{display:"flex",justifyContent:"center",children:e.jsx(Z,{})}):n.map(m=>e.jsx(ye,{style:{marginTop:"12px"},spaceGateway:m,connected:o(m),onDelete:l,onBackupNow:d},m.endpoint))}),e.jsx(ze,{sx:{marginTop:"24px"}}),e.jsx(S,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:s("common.dataStorage")}),e.jsx(we,{})]})}function Ht(){const{spaceGatewaysLoading:s,spaceGateways:t}=H();return s?e.jsx(it,{relative:"parent",children:e.jsx(Z,{})}):rt(t)?e.jsx(Te,{}):e.jsx(Zt,{})}function Ts(){return e.jsx(ue,{children:e.jsx(Ht,{})})}export{Ts as default};