@abtnode/blocklet-services 1.16.42-beta-20250408-050422-92c8eef3 → 1.16.42-beta-20250409-161010-b0a88c5c

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 (199) hide show
  1. package/api/index.js +1 -1
  2. package/api/routes/user-session.js +2 -2
  3. package/api/routes/user.js +36 -0
  4. package/api/services/auth/connect/destroy-myself.js +64 -0
  5. package/api/services/auth/index.js +2 -0
  6. package/api/services/auth/session.js +36 -16
  7. package/dist/assets/{ArrowDropDown-WXsjNpSB.js → ArrowDropDown-CDjPVis_.js} +1 -1
  8. package/dist/assets/{CheckCircle-D7CrWlJ6.js → CheckCircle-BHD7aj9l.js} +1 -1
  9. package/dist/assets/{ChevronLeft-DeulnkX8.js → ChevronLeft-CUdxcGLW.js} +1 -1
  10. package/dist/assets/{ChevronRight-CACHNf5Y.js → ChevronRight-Bol9kSyE.js} +1 -1
  11. package/dist/assets/{Community-BKnwgGcO.js → Community-Ds1NG5Zj.js} +1 -1
  12. package/dist/assets/{DeleteOutline-DT1G93_1.js → DeleteOutline-BiIEYa8g.js} +1 -1
  13. package/dist/assets/{Done-D9sjuoNQ.js → Done-kAy_Y9ti.js} +1 -1
  14. package/dist/assets/{Download-CBzqKt6X.js → Download-COul5Jpx.js} +1 -1
  15. package/dist/assets/{EditIcon-Bww8_WRx.js → EditIcon-Bt91o1l6.js} +1 -1
  16. package/dist/assets/{Email-C6-GXQIV.js → Email-C7SKOpM8.js} +1 -1
  17. package/dist/assets/{Error-l_WxG8z-.js → Error-xVtnHALO.js} +1 -1
  18. package/dist/assets/{ExpandLess-uIJAqSZm.js → ExpandLess-CW9G6ynD.js} +1 -1
  19. package/dist/assets/{Google-BchHLUIl.js → Google-D98Bf-5Y.js} +1 -1
  20. package/dist/assets/{Holiday-BSfwdA-4.js → Holiday-Dfj3kBBI.js} +1 -1
  21. package/dist/assets/{InfoOutlined-DFTm-vVr.js → InfoOutlined-jnMrCCfZ.js} +1 -1
  22. package/dist/assets/{Launch-DQCS90NS.js → Launch-DFNlDQlk.js} +1 -1
  23. package/dist/assets/{LaunchOutlined-DttrDnYo.js → LaunchOutlined-yZsgpXar.js} +1 -1
  24. package/dist/assets/{Location-CT1S5M1P.js → Location--4ueDivQ.js} +1 -1
  25. package/dist/assets/{LockIcon-kY343jXt.js → LockIcon-B84lMZao.js} +1 -1
  26. package/dist/assets/{Meeting-PVrGyQbK.js → Meeting-CVVnP-bH.js} +1 -1
  27. package/dist/assets/{MoreHoriz-BD8SroCJ.js → MoreHoriz-BqdKN70-.js} +1 -1
  28. package/dist/assets/{OffSick-DD3oLLQu.js → OffSick-C_2x7yDI.js} +1 -1
  29. package/dist/assets/{Phone-BcpEH3XZ.js → Phone-CaKOX2Yu.js} +1 -1
  30. package/dist/assets/{PlayArrow-BEUAi9Bt.js → PlayArrow-CXtQLadK.js} +1 -1
  31. package/dist/assets/{QuestionMarkCircle-BHP2onYz.js → QuestionMarkCircle-5K6WR8Pc.js} +1 -1
  32. package/dist/assets/{ServerLogo-Bi89KNz4.js → ServerLogo-C4P-qXGV.js} +1 -1
  33. package/dist/assets/{Timezone-Ce85fX7w.js → Timezone-Bgwxnj29.js} +1 -1
  34. package/dist/assets/{TuneOutlined-CzDTcEdK.js → TuneOutlined-EaV8HxdX.js} +1 -1
  35. package/dist/assets/{ViewList-6gwww-su.js → ViewList-BPuXZDcI.js} +1 -1
  36. package/dist/assets/{WorkingRemotely-DfgJTsRm.js → WorkingRemotely-Dm2BOs5c.js} +1 -1
  37. package/dist/assets/{access-control-Bp6fLweq.js → access-control-CuKW2kRZ.js} +1 -1
  38. package/dist/assets/{actions-C9vqEgMU.js → actions-DqeM3yie.js} +1 -1
  39. package/dist/assets/{add-component-core-e0A2r7mm.js → add-component-core-DXPSI3Ti.js} +23 -22
  40. package/dist/assets/add-resource-S3Z1zjbJ.js +1 -0
  41. package/dist/assets/{addon-BNDsoean.js → addon-B5UBB-pU.js} +1 -1
  42. package/dist/assets/{advanced-vuRNp9gZ.js → advanced-Cvboset8.js} +1 -1
  43. package/dist/assets/api-BVwAqPhr.js +1 -0
  44. package/dist/assets/appearance-DmQgth7a.js +1 -0
  45. package/dist/assets/{audit-logs-C51Acdy3.js → audit-logs-LLoqbniS.js} +3 -3
  46. package/dist/assets/{base32-CEWQZb_G.js → base32-CMrsHquD.js} +1 -1
  47. package/dist/assets/{branding-PF95Dp3j.js → branding-BfxdFbW1.js} +2 -2
  48. package/dist/assets/{branding-B4OmIbxT.js → branding-DcviCyPr.js} +3 -3
  49. package/dist/assets/bundle-avatar-Ci9fNblN.js +1 -0
  50. package/dist/assets/button-OxbVr1Od.js +1 -0
  51. package/dist/assets/click-to-copy-q_I2l6Sg.js +1 -0
  52. package/dist/assets/cloneDeep-g5lbcy6_.js +1 -0
  53. package/dist/assets/complete-ogipf6id.js +45 -0
  54. package/dist/assets/{component-BbpzttYw.js → component-DVhWy5jQ.js} +1 -1
  55. package/dist/assets/{config-DXNBk8Sr.js → config-BdUShvO-.js} +1 -1
  56. package/dist/assets/{config-BRGxJ2eh.js → config-YsfQuvvt.js} +2 -2
  57. package/dist/assets/{config-navigation-Bp_tpZTf.js → config-navigation-C4hgzi4R.js} +3 -3
  58. package/dist/assets/config-space-DJ-fZ6j4.js +1 -0
  59. package/dist/assets/{confirm-DMfA-cen.js → confirm-C1Nde1Nq.js} +1 -1
  60. package/dist/assets/connect-BkxyLG9H.js +1 -0
  61. package/dist/assets/{connect-BbnPPMBE.js → connect-dGBjAgNF.js} +1 -1
  62. package/dist/assets/connect-to-CdG3TX0A.js +1 -0
  63. package/dist/assets/{content-layout-uPtoKIAs.js → content-layout-Bs-vdQ_U.js} +1 -1
  64. package/dist/assets/dashboard-2jQIZ8v5.js +222 -0
  65. package/dist/assets/{delete-confirm-BOPmqCDE.js → delete-confirm-CpPzqeJx.js} +1 -1
  66. package/dist/assets/{did-address-_2BUka_2.js → did-address-D-fI5ZyH.js} +1 -1
  67. package/dist/assets/{domain-C058D5cL.js → domain-1X_uRV9L.js} +1 -1
  68. package/dist/assets/{domain-action-card-hJylsZDf.js → domain-action-card-Crwneu7N.js} +2 -2
  69. package/dist/assets/domains-BHkUaPc7.js +1 -0
  70. package/dist/assets/{email-DTd5dLMw.js → email-DGh9v0en.js} +3 -3
  71. package/dist/assets/{empty-spinner-CoimPnT0.js → empty-spinner-Cia24BVr.js} +1 -1
  72. package/dist/assets/exchange-passport-CgGOJDm9.js +1 -0
  73. package/dist/assets/{format-error-LAoTjvJe.js → format-error-BrmqJs5a.js} +1 -1
  74. package/dist/assets/{fuel-D1-QzTfA.js → fuel-CItPP5Vk.js} +1 -1
  75. package/dist/assets/{get-safe-url-B2pIo8YT.js → get-safe-url-B2BlmlqT.js} +1 -1
  76. package/dist/assets/{get-safe-url-M62JolcK.js → get-safe-url-C2N97NJc.js} +1 -1
  77. package/dist/assets/{home-D8xdbvkr.js → home-12LB7wlV.js} +1 -1
  78. package/dist/assets/{iframe-BGb_KeKZ.js → iframe-54rcs7kU.js} +1 -1
  79. package/dist/assets/{index-B9lZsGBd.js → index-0CgHVUpB.js} +1 -1
  80. package/dist/assets/{index-DvX6CH9d.js → index-3dawiJIg.js} +3 -3
  81. package/dist/assets/{index-DY7FozBP.js → index-4WjT4o1e.js} +5 -5
  82. package/dist/assets/{index-C-E-0SKx.js → index-643kpB1h.js} +1 -1
  83. package/dist/assets/{index-Bn6qMcz9.js → index-9XJ5HzSd.js} +1 -1
  84. package/dist/assets/index-BIu-u1kW.js +1 -0
  85. package/dist/assets/{index-CKv9guDo.js → index-BTOIZL6e.js} +1 -1
  86. package/dist/assets/{index-DvDiL1rm.js → index-BYsXlcQC.js} +1 -1
  87. package/dist/assets/{index-DUqEJSX8.js → index-Bj10Vbvc.js} +4 -4
  88. package/dist/assets/index-C4dzrN-k.js +290 -0
  89. package/dist/assets/{index-Dja0MgHa.js → index-CB6NPYWM.js} +3 -3
  90. package/dist/assets/index-CFs0La6o.js +15 -0
  91. package/dist/assets/{index-pV_0wOyY.js → index-CPE8Apzb.js} +1 -1
  92. package/dist/assets/{index--QvOAcHK.js → index-CTpJt8AJ.js} +47 -45
  93. package/dist/assets/{index-BYC998Xz.js → index-Cuoxr9xB.js} +1 -1
  94. package/dist/assets/{index-Biod65HH.js → index-D5G2v7wN.js} +2 -2
  95. package/dist/assets/{index-CqRb1YIC.js → index-DKPGWA5E.js} +1 -1
  96. package/dist/assets/{index-BQddb9SV.js → index-DQC9zneB.js} +11 -11
  97. package/dist/assets/{index-tUQxVYYQ.js → index-DVQCgvFb.js} +1 -1
  98. package/dist/assets/index-DVogNW6l.js +1 -0
  99. package/dist/assets/{index-CDJctLrv.js → index-DkZfhapD.js} +1 -1
  100. package/dist/assets/{index-Bcipz7Xh.js → index-Du71d9ZJ.js} +1 -1
  101. package/dist/assets/{index-r4W5xGua.js → index-G26gYrxE.js} +2 -2
  102. package/dist/assets/{index-DOTrxWIb.js → index-YqrAgavD.js} +1 -1
  103. package/dist/assets/{index-COXsk6dn.js → index-jny05NvM.js} +30 -30
  104. package/dist/assets/{invitation-CLrDi0w3.js → invitation-BBqRmSx1.js} +6 -6
  105. package/dist/assets/invite-CKxzd-7d.js +1 -0
  106. package/dist/assets/issue-passport-BA7u3NC-.js +1 -0
  107. package/dist/assets/{item-DFeRxihy.js → item-DssQyiFI.js} +2 -2
  108. package/dist/assets/landing-page-2uYUfHoY.js +1 -0
  109. package/dist/assets/{launch-result-message-DvcvHHH1.js → launch-result-message-C0Ao1hE-.js} +1 -1
  110. package/dist/assets/{layout-BQ9Qhixa.js → layout-R4Ynfcbq.js} +2 -2
  111. package/dist/assets/{list-BO1EU3G2.js → list-BhXWs05I.js} +18 -9
  112. package/dist/assets/{list-header-DvakxkxK.js → list-header-BibBP5t1.js} +1 -1
  113. package/dist/assets/localization-BsSUbpzO.js +1 -0
  114. package/dist/assets/{log-Qir3lxDV.js → log-D4PQ7UF3.js} +7 -7
  115. package/dist/assets/{login-C780ZUv4.js → login-CuCcTu--.js} +1 -1
  116. package/dist/assets/{login-oauth-callback-CfaWz0tg.js → login-oauth-callback-BzcAZfXM.js} +1 -1
  117. package/dist/assets/{logo-uploader-gCM0_9lk.js → logo-uploader-C9TwiAKx.js} +3 -3
  118. package/dist/assets/{lost-passport-ieF1z1Fq.js → lost-passport-DD7XCIgg.js} +4 -4
  119. package/dist/assets/{lottie-react.esm-CPHH620R.js → lottie-react.esm-D2t-u0YU.js} +1 -1
  120. package/dist/assets/{lottie-web-B6s7dDoL.js → lottie-web-jYmAQWuC.js} +1 -1
  121. package/dist/assets/omit-DF3Nt1_-.js +1 -0
  122. package/dist/assets/{open-window-DMkA-B_A.js → open-window-Dsc5mHei.js} +1 -1
  123. package/dist/assets/{overview-CqE5Qd7t.js → overview-BjFpvrpN.js} +2 -2
  124. package/dist/assets/{page-header-D3dCkXy7.js → page-header-B7j9M6Zp.js} +1 -1
  125. package/dist/assets/{permission-ClAqVelD.js → permission-CLAOGeOf.js} +1 -1
  126. package/dist/assets/preferences-qZW-dsds.js +1 -0
  127. package/dist/assets/profile-embed-6mTqkL03.js +1 -0
  128. package/dist/assets/publish-resource-DO-PRxdk.js +1 -0
  129. package/dist/assets/{raf-schd.esm-GV-XhwE0.js → raf-schd.esm-B3j6BePR.js} +1 -1
  130. package/dist/assets/{react-beautiful-dnd.esm-Cx5BcFIr.js → react-beautiful-dnd.esm-Bu3K07pf.js} +1 -1
  131. package/dist/assets/{relative-time-BUHtgSDe.js → relative-time-Cu4jaQ9H.js} +1 -1
  132. package/dist/assets/{runtime-B5YY9Qgr.js → runtime-kNyRK8Hy.js} +1 -1
  133. package/dist/assets/sdk-BjsIctsl.js +1 -0
  134. package/dist/assets/{security-Dad28Y4W.js → security-Dkk4FgYt.js} +4 -4
  135. package/dist/assets/session-UJ7B0EdV.js +1 -0
  136. package/dist/assets/{setup-DEJbIHrj.js → setup-SAEzURDR.js} +3 -3
  137. package/dist/assets/{shorten-label-C642GTxb.js → shorten-label-DDBwv81M.js} +1 -1
  138. package/dist/assets/{simple-select-i-SepLIh.js → simple-select-vCKkiHhG.js} +1 -1
  139. package/dist/assets/{slicedToArray-B6WXjdrb.js → slicedToArray-Da5X2Yv5.js} +1 -1
  140. package/dist/assets/spaces-B_lJq3Uz.js +1 -0
  141. package/dist/assets/{start-9UMY8DNC.js → start-C53MN0u7.js} +1 -1
  142. package/dist/assets/status-5Z1CW-le.js +1 -0
  143. package/dist/assets/{step-actions-DZ9FTtHm.js → step-actions-CujnheOz.js} +1 -1
  144. package/dist/assets/{studio-Bv91lan_.js → studio-BYzuzhpL.js} +1 -1
  145. package/dist/assets/{switch-control-DjMziEFc.js → switch-control-DWiX5YiK.js} +1 -1
  146. package/dist/assets/{traffic-DPZuINtB.js → traffic-WemHsP0B.js} +3 -3
  147. package/dist/assets/{transfer-PY0D3H2H.js → transfer-CF7CWbdm.js} +1 -1
  148. package/dist/assets/{unsubscribe-B3uFNG06.js → unsubscribe-Dfof7yLG.js} +1 -1
  149. package/dist/assets/{use-mobile-B_Gqv6b6.js → use-mobile-DjnNmGRG.js} +1 -1
  150. package/dist/assets/{use-mobile-DudfIz3d.js → use-mobile-DpXDDjat.js} +1 -1
  151. package/dist/assets/{useAsync-BmuLIImU.js → useAsync-De6s-0n9.js} +1 -1
  152. package/dist/assets/{useAsyncRetry-CwtLImQi.js → useAsyncRetry-B6OdNqyX.js} +1 -1
  153. package/dist/assets/{useLocalStorage-C1_Fkr6_.js → useLocalStorage-DLwAkPmo.js} +1 -1
  154. package/dist/assets/{useSetState-BL3ktMon.js → useSetState-CWq0AVWn.js} +1 -1
  155. package/dist/assets/{user-center-C2i8ji9Q.js → user-center-CowUpoIn.js} +3 -3
  156. package/dist/assets/{util-CORzDFgw.js → util-B6E4W35Y.js} +1 -1
  157. package/dist/assets/util-C57yoAn6.js +1 -0
  158. package/dist/assets/{vendor-arcblock-D8eCUoJY.js → vendor-arcblock-CD8CMsgQ.js} +148 -81
  159. package/dist/assets/{vendor-hooks-DtYI0-rF.js → vendor-hooks-8r-lvvPs.js} +1 -1
  160. package/dist/assets/{vendor-mui-core-C-PhacC8.js → vendor-mui-core-1jJmAutq.js} +2 -2
  161. package/dist/assets/{vendor-mui-x-BiTj3AZC.js → vendor-mui-x-CPwlD3uT.js} +1 -1
  162. package/dist/assets/{vendor-react-DoD83n6N.js → vendor-react-DEoibe3W.js} +1 -1
  163. package/dist/assets/{vendor-utils-CRBr0QUY.js → vendor-utils-Cm2BKG2b.js} +6 -6
  164. package/dist/assets/{vendor-ux-did-connect-BQ3cvv_1.js → vendor-ux-did-connect-DlrX4cqq.js} +4 -4
  165. package/dist/assets/{wrap-locale-BFOSjPWa.js → wrap-locale-NNP_yq5G.js} +1 -1
  166. package/dist/index.html +8 -8
  167. package/dist/service-worker.js +1 -1
  168. package/package.json +41 -41
  169. package/dist/assets/add-resource-tZ8OPVzc.js +0 -1
  170. package/dist/assets/api-DlN8K5Jg.js +0 -1
  171. package/dist/assets/appearance-CFcde0Qw.js +0 -1
  172. package/dist/assets/bundle-avatar-xyEwd0kl.js +0 -1
  173. package/dist/assets/button-BQLtMsfK.js +0 -1
  174. package/dist/assets/click-to-copy-CkbZjUXU.js +0 -1
  175. package/dist/assets/cloneDeep-C7Ok409J.js +0 -1
  176. package/dist/assets/complete-BnqT6D6R.js +0 -45
  177. package/dist/assets/config-space-DLpGXOv3.js +0 -1
  178. package/dist/assets/connect-DrhKSeJG.js +0 -1
  179. package/dist/assets/connect-to-BWtx4RxY.js +0 -1
  180. package/dist/assets/dashboard-D1IAu0pg.js +0 -213
  181. package/dist/assets/domains-CHSNHTzm.js +0 -1
  182. package/dist/assets/exchange-passport-CUoEzJAn.js +0 -1
  183. package/dist/assets/index-Be9flGYn.js +0 -1
  184. package/dist/assets/index-Bgbz960f.js +0 -15
  185. package/dist/assets/index-BmIHv0Ao.js +0 -290
  186. package/dist/assets/index-Tc7h84RU.js +0 -1
  187. package/dist/assets/invite-BlqLHSHA.js +0 -1
  188. package/dist/assets/issue-passport-0xgFeiRm.js +0 -1
  189. package/dist/assets/landing-page-Dl8nGCZh.js +0 -1
  190. package/dist/assets/localization-rR3sV7At.js +0 -1
  191. package/dist/assets/omit-r8RGw6zD.js +0 -1
  192. package/dist/assets/preferences-YM19d1y9.js +0 -1
  193. package/dist/assets/profile-embed-DJJJzari.js +0 -1
  194. package/dist/assets/publish-resource-BFGnGhHk.js +0 -1
  195. package/dist/assets/sdk-DRBcrGrS.js +0 -1
  196. package/dist/assets/session-Clq9kJzg.js +0 -1
  197. package/dist/assets/spaces-CcqmBId2.js +0 -1
  198. package/dist/assets/status-BFrUchan.js +0 -1
  199. package/dist/assets/util-BL-qFiRh.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as B,j as h}from"./vendor-mui-core-1jJmAutq.js";import{l as L,r}from"./vendor-react-DEoibe3W.js";import{y as W,D as O}from"./vendor-utils-Cm2BKG2b.js";import{u as A,al as K}from"./vendor-ux-did-connect-DlrX4cqq.js";import{l as w,u as T,s as _}from"./vendor-hooks-8r-lvvPs.js";import{A as F,S as $}from"./add-component-core-DXPSI3Ti.js";import{n as z,K as G}from"./index-CTpJt8AJ.js";import"./lottie-web-jYmAQWuC.js";import"./item-DssQyiFI.js";import"./vendor-arcblock-CD8CMsgQ.js";import"./format-error-BrmqJs5a.js";import"./Launch-DFNlDQlk.js";import"./Done-kAy_Y9ti.js";import"./DeleteOutline-BiIEYa8g.js";import"./delete-confirm-CpPzqeJx.js";import"./click-to-copy-q_I2l6Sg.js";import"./shorten-label-DDBwv81M.js";import"./confirm-C1Nde1Nq.js";import"./session-UJ7B0EdV.js";import"./get-safe-url-C2N97NJc.js";import"./did-address-D-fI5ZyH.js";import"./launch-result-message-C0Ao1hE-.js";import"./page-header-B7j9M6Zp.js";import"./config-space-DJ-fZ6j4.js";import"./spaces-B_lJq3Uz.js";import"./api-BVwAqPhr.js";import"./logo-uploader-C9TwiAKx.js";import"./index-DVQCgvFb.js";import"./index-D5G2v7wN.js";import"./Google-D98Bf-5Y.js";import"./cloneDeep-g5lbcy6_.js";import"./index-BTOIZL6e.js";import"./index-0CgHVUpB.js";import"./index-DKPGWA5E.js";import"./useLocalStorage-DLwAkPmo.js";import"./util-C57yoAn6.js";import"./use-mobile-DpXDDjat.js";import"./content-layout-Bs-vdQ_U.js";import"./connect-to-CdG3TX0A.js";import"./ArrowDropDown-CDjPVis_.js";import"./ChevronLeft-CUdxcGLW.js";import"./ChevronRight-Bol9kSyE.js";function Be(){var d;const{t:f}=A(),{blocklet:i}=z(),{componentDid:s}=L(),g=B(e=>e.breakpoints.down("md")),o=new URL(window.location.href),C=o.searchParams.get("mode")==="dialog",c=o.searchParams.get("resourceType")||"",p=o.searchParams.get("resourceDid")||s,R=o.searchParams.get("store")||"",y=o.searchParams.get("showFromUrl")!=="false",S=o.searchParams.get("showResourcesSwitch")!=="false",D=o.searchParams.get("enableRunBackground")!=="false",E=o.searchParams.get("showCategory")!=="false",n=(d=i==null?void 0:i.meta)==null?void 0:d.did,m=R.split(",").filter(Boolean).map(e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).origin}catch(t){return console.error(t),null}}).filter(Boolean),[P,U]=r.useState(m.map(e=>({url:e,name:e.replace("https://","")}))),[b,x]=r.useState(null),[j,M]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await Promise.all(m.map(async t=>{const a=W(t,"/api/store.json"),{data:v}=await O.get(a);return{url:t,name:v.name}}));U(e||[])}catch(e){console.error(e)}})()},[m.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const e=G();return n&&e.connect(),()=>{n&&e.isConnected()&&e.disconnect()}},[n]),w(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const l=T(e=>{var t,a;((t=e.data)==null?void 0:t.event)==="resourceDialog.select"&&((a=e.data)==null?void 0:a.componentDid)===s&&(x(e.data.data),M(e.data.storeUrl))});w(()=>{window.addEventListener("message",l)}),_(()=>{window.removeEventListener("message",l)});const u=({inDialog:e=!0}={})=>h.jsx(F,{stores:P,selectedMeta:b,storeUrl:j,resourceType:c,resourceDid:p,mode:"embed",inDialog:e,storageKey:$(`${c}+${p}`),showResourcesSwitch:S,showFromUrl:y,enableRunBackground:D,showCategory:E});return C?h.jsx(K,{className:"resource-dialog",title:f("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:g?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,t)=>{t!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:u()}):u({inDialog:!1})}export{Be as default};
@@ -1,4 +1,4 @@
1
- import{r as t,u as M}from"./vendor-react-DoD83n6N.js";import{j as e,I as b,E as o,aa as r}from"./vendor-mui-core-C-PhacC8.js";import{aZ as f,o as g,n as H}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{Q as Z}from"./QuestionMarkCircle-BHP2onYz.js";var a=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"})})};a.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"};a.displayName="globe";const j=a;function l({SessionContext:s,extraItems:C,showLocale:c,showHelper:i,showSessionManager:p,sessionManagerProps:d}){const{session:w}=t.useContext(s),{locale:h}=t.useContext(f),u=M(),x=()=>{if(u.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[C.map((n,m)=>t.cloneElement(n,{key:m})),c&&e.jsx(v,{"data-cy":"locale-addon",icon:j,size:23,showText:!1,className:"locale-addon"}),i&&e.jsx(b,{onClick:x,children:e.jsx(Z,{})}),p&&e.jsx(k,{locale:h,session:w,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}l.propTypes={SessionContext:o.object.isRequired,webWalletUrl:o.string,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};l.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};const k=r(g)`
1
+ import{r as t,u as M}from"./vendor-react-DEoibe3W.js";import{j as e,I as b,E as o,aa as r}from"./vendor-mui-core-1jJmAutq.js";import{a$ as f,x as g,w as H}from"./vendor-ux-did-connect-DlrX4cqq.js";import{Q as Z}from"./QuestionMarkCircle-5K6WR8Pc.js";var a=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"})})};a.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"};a.displayName="globe";const j=a;function l({SessionContext:s,extraItems:C,showLocale:c,showHelper:i,showSessionManager:p,sessionManagerProps:d}){const{session:w}=t.useContext(s),{locale:h}=t.useContext(f),u=M(),x=()=>{if(u.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[C.map((n,m)=>t.cloneElement(n,{key:m})),c&&e.jsx(v,{"data-cy":"locale-addon",icon:j,size:23,showText:!1,className:"locale-addon"}),i&&e.jsx(b,{onClick:x,children:e.jsx(Z,{})}),p&&e.jsx(k,{locale:h,session:w,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}l.propTypes={SessionContext:o.object.isRequired,webWalletUrl:o.string,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};l.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};const k=r(g)`
2
2
  .user-addon {
3
3
  .user-avatar {
4
4
  width: 28px;
@@ -1,4 +1,4 @@
1
- import{r as Ee,e as qe}from"./vendor-react-DoD83n6N.js";import{a2 as vt,j as L,a3 as Ve,E as Oe,a4 as U,x as cr,T as ze,aa as Yt,bp as ur,bM as fr,bs as hr,ad as dr,A as mr,ae as pr,M as gr,K as vr,bq as mt}from"./vendor-mui-core-C-PhacC8.js";import{A as Be,D as yr,f as br,aB as _r,m as wr,au as xr,w as Zt,Q as Qt,h as Ne,O as Xt}from"./index--QvOAcHK.js";import{P as Mr,w as Ke}from"./permission-ClAqVelD.js";import{r as yt,u as Je,B as Te,V as Ie,al as er,k as $r,aj as tr,bS as kr,aE as jr,ai as De,m as Sr,P as Ht,aZ as Rr}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{v as rr}from"./vendor-hooks-DtYI0-rF.js";import{C as bt}from"./confirm-DMfA-cen.js";import{f as Fe}from"./format-error-LAoTjvJe.js";import{_ as Ar}from"./useSetState-BL3ktMon.js";import{u as sr}from"./session-Clq9kJzg.js";import{C as Or}from"./click-to-copy-CkbZjUXU.js";import{u as nr}from"./dashboard-D1IAu0pg.js";import{r as Er,aF as Cr}from"./vendor-utils-CRBr0QUY.js";import{I as Dr}from"./index-CqRb1YIC.js";import{W as Ir}from"./did-address-_2BUka_2.js";import{V as Tr}from"./status-BFrUchan.js";import"./vendor-arcblock-D8eCUoJY.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-C1_Fkr6_.js";import"./PlayArrow-BEUAi9Bt.js";import"./get-safe-url-M62JolcK.js";import"./index-Tc7h84RU.js";import"./useAsyncRetry-CwtLImQi.js";import"./useAsync-BmuLIImU.js";import"./InfoOutlined-DFTm-vVr.js";import"./use-mobile-DudfIz3d.js";import"./omit-r8RGw6zD.js";var _t={},Nr=vt;Object.defineProperty(_t,"__esModule",{value:!0});var ir=_t.default=void 0,Lr=Nr(yt()),qr=L;ir=_t.default=(0,Lr.default)((0,qr.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var wt={},Pr=vt;Object.defineProperty(wt,"__esModule",{value:!0});var xt=wt.default=void 0,zr=Pr(yt()),Gt=L;xt=wt.default=(0,zr.default)([(0,Gt.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,Gt.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");const Br=localStorage.getItem("enableDebug")==="true";function Fr({teamDid:I,size:P="small",...F}){const{t:T}=Je(),{api:N}=Be(),[p,w]=Ee.useState(!1),[l,$]=Ee.useState(null),y=()=>{w(!1),$(null)},m=async()=>{var a;try{w(!0);const i=await N.clearCache({input:{teamDid:I}});Ie.success(T("blocklet.config.clearCache.success",{count:((a=i.removed)==null?void 0:a.length)||0}))}catch(i){Ie.error(Fe(i))}finally{w(!1),$(null)}},e={title:T("blocklet.config.clearCache.title"),description:T("blocklet.config.clearCache.description"),confirm:T("common.confirm"),cancel:T("common.cancel"),onConfirm:m,onCancel:y};return L.jsxs("div",{...F,children:[L.jsxs(Te,{onClick:()=>$(e),color:"error",variant:"outlined",size:P,children:[p?L.jsx(Ve,{size:16,style:{marginRight:5}}):null,T("blocklet.config.clearCache.action")]}),l&&L.jsx(bt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}var Mt={},Jr=vt;Object.defineProperty(Mt,"__esModule",{value:!0});var ar=Mt.default=void 0,Ur=Jr(yt()),Vr=L;ar=Mt.default=(0,Ur.default)((0,Vr.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"KeyOutlined");function $t({onChange:I,disabled:P,loading:F,inService:T}){const{t:N}=Je(),{api:p,session:w}=sr(),{blocklet:l}=yr(),[$,y]=Ar({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),m=()=>y({isConnectOpen:!1}),e=()=>{if(br.isInProgress(l.status)){Ie.error(N("blocklet.error.isInProgress"));return}y({confirmDialogOpen:!0})};return L.jsxs(U,{className:"config-form",mt:2,children:[L.jsxs(U,{className:"config-item",children:[L.jsxs(U,{className:"config-label",mb:0,children:[N("blocklet.config.migrate.button"),L.jsx(U,{className:"config-desc",children:N("blocklet.config.migrate.description")})]}),L.jsxs(cr,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:P||F,onClick:e,children:[L.jsx(ar,{style:{fontSize:"1.3em",marginRight:4}}),N("blocklet.config.migrate.button")]})]}),$.isConnectOpen&&L.jsx(er,{popup:!0,open:$.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:p.get,checkTimeout:5*60*1e3,onSuccess:()=>{I(),T&&w.logout(),m()},extraParams:{appDid:l.appDid},messages:{title:N("setup.keyPair.title"),scan:N("setup.keyPair.scan"),confirm:N("setup.keyPair.confirm"),success:N("setup.keyPair.success")},onClose:m}),$.confirmDialogOpen&&L.jsx(bt,{title:L.jsx(ze,{sx:{fontSize:"20px",fontWeight:"500"},children:N("blocklet.config.migrate.title")}),description:L.jsx(ze,{sx:{fontSize:"14px",color:"#9397A1"},children:N("blocklet.config.migrate.confirm")}),confirm:N("common.confirm"),cancel:N("common.cancel"),onConfirm:()=>y({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>y({confirmDialogOpen:!1})})]})}$t.propTypes={onChange:Oe.func,disabled:Oe.bool,loading:Oe.bool,inService:Oe.bool};$t.defaultProps={onChange:()=>{},disabled:!1,loading:!1,inService:!1};function kt({onCancel:I,onSuccess:P,onError:F}){const{api:T}=Ee.useContext($r),[N,p]=Ee.useState(!1),{t:w,locale:l}=Je(),[$,y]=Ee.useState(""),[m,e]=Ee.useState(!1),[a,i]=Ee.useState(0),[r,t]=Ee.useState(""),{endpoint:c}=nr(),[s,o]=Ee.useState(!1),h=f=>{y(null),p(!0);try{t(f.result),i(j.length-1)}catch(v){const x=Fe(v);y(x),F(v)}finally{p(!1)}},g=()=>{e(!0),i(1)},b=()=>{e(!1),i(0)},j=[{body:L.jsxs(U,{children:[L.jsx(ze,{children:w("team.transferApp.transferDialog.tips.progress")}),L.jsx(ze,{mt:3,mb:2,children:w("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),onCancel:I,onConfirm:g},{cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),body:()=>L.jsx(er,{action:"transfer-app-owner",open:m,locale:l,checkFn:T.get,onClose:b,onSuccess:h,checkTimeout:5*60*1e3,extraParams:{},messages:{title:w("team.transferApp.connectDialog.title"),scan:w("team.transferApp.connectDialog.scan"),confirm:w("team.transferApp.connectDialog.confirm"),success:w("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const f=_r({transferId:r.transferId,endpoint:c});return L.jsxs(L.Fragment,{children:[L.jsx(U,{component:Pe,dangerouslySetInnerHTML:{__html:w("team.transferApp.transferDialog.createSuccessTip1")}}),L.jsx(U,{component:Pe,mt:2,children:L.jsx(Pe,{children:w("team.transferApp.transferDialog.createSuccessTip3")})}),L.jsxs(U,{children:[L.jsx(U,{component:Pe,mt:2,children:L.jsx(Pe,{children:w("team.transferApp.transferDialog.createSuccessTip2",{expireDate:wr(r.expireDate,l)})})}),L.jsx(U,{my:1,children:L.jsx(Or,{children:f})})]}),L.jsx("div",{children:L.jsx(ur,{value:"end",control:L.jsx(fr,{checked:s,onChange:v=>o(v.target.checked)}),label:w("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:w("common.confirm"),onConfirm:P}],k=j[a];return L.jsxs(tr,{title:L.jsx(Pe,{className:"title",children:w("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:L.jsxs(L.Fragment,{children:[k.cancel&&L.jsx(Te,{onClick:k.onCancel,color:"inherit",children:k.cancel}),L.jsxs(Te,{onClick:k.onConfirm,color:"error",disabled:N||a===j.length-1&&!s,variant:"contained",autoFocus:!0,children:[N&&L.jsx(Ve,{size:16}),k.confirm]})]}),children:[L.jsx(hr,{component:"div",children:typeof k.body=="function"?k.body():k.body}),!!$&&L.jsx(dr,{severity:"error",variant:"icon",children:$})]})}kt.propTypes={onCancel:Oe.func.isRequired,onSuccess:Oe.func.isRequired,onError:Oe.func};kt.defaultProps={onError:()=>{}};const Pe=Yt.div`
1
+ import{r as Ee,e as qe}from"./vendor-react-DEoibe3W.js";import{a2 as vt,j as L,a3 as Ve,E as Oe,a4 as U,x as cr,T as ze,aa as Yt,br as ur,bN as fr,bu as hr,ad as dr,A as mr,ae as pr,M as gr,K as vr,bs as mt}from"./vendor-mui-core-1jJmAutq.js";import{z as Be,C as yr,f as br,ax as _r,l as wr,aq as xr,v as Zt,M as Qt,L as Xt}from"./index-CTpJt8AJ.js";import{P as Mr,w as Ke}from"./permission-CLAOGeOf.js";import{r as yt,u as Je,B as Te,Z as Ie,an as er,m as $r,al as tr,bS as kr,aG as jr,l as De,p as Sr,X as Ht,a$ as Rr}from"./vendor-ux-did-connect-DlrX4cqq.js";import{v as rr}from"./vendor-hooks-8r-lvvPs.js";import{c as Ne}from"./vendor-arcblock-CD8CMsgQ.js";import{C as bt}from"./confirm-C1Nde1Nq.js";import{f as Fe}from"./format-error-BrmqJs5a.js";import{_ as Ar}from"./useSetState-CWq0AVWn.js";import{u as sr}from"./session-UJ7B0EdV.js";import{C as Or}from"./click-to-copy-q_I2l6Sg.js";import{u as nr}from"./dashboard-2jQIZ8v5.js";import{r as Er,aF as Cr}from"./vendor-utils-Cm2BKG2b.js";import{I as Dr}from"./index-DKPGWA5E.js";import{W as Ir}from"./did-address-D-fI5ZyH.js";import{V as Tr}from"./status-5Z1CW-le.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DLwAkPmo.js";import"./PlayArrow-CXtQLadK.js";import"./get-safe-url-C2N97NJc.js";import"./index-DVogNW6l.js";import"./useAsyncRetry-B6OdNqyX.js";import"./useAsync-De6s-0n9.js";import"./InfoOutlined-jnMrCCfZ.js";import"./use-mobile-DjnNmGRG.js";import"./omit-DF3Nt1_-.js";var _t={},Nr=vt;Object.defineProperty(_t,"__esModule",{value:!0});var ir=_t.default=void 0,Lr=Nr(yt()),qr=L;ir=_t.default=(0,Lr.default)((0,qr.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var wt={},Pr=vt;Object.defineProperty(wt,"__esModule",{value:!0});var xt=wt.default=void 0,zr=Pr(yt()),Gt=L;xt=wt.default=(0,zr.default)([(0,Gt.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,Gt.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");const Br=localStorage.getItem("enableDebug")==="true";function Fr({teamDid:I,size:P="small",...F}){const{t:T}=Je(),{api:N}=Be(),[p,w]=Ee.useState(!1),[l,$]=Ee.useState(null),y=()=>{w(!1),$(null)},m=async()=>{var a;try{w(!0);const i=await N.clearCache({input:{teamDid:I}});Ie.success(T("blocklet.config.clearCache.success",{count:((a=i.removed)==null?void 0:a.length)||0}))}catch(i){Ie.error(Fe(i))}finally{w(!1),$(null)}},e={title:T("blocklet.config.clearCache.title"),description:T("blocklet.config.clearCache.description"),confirm:T("common.confirm"),cancel:T("common.cancel"),onConfirm:m,onCancel:y};return L.jsxs("div",{...F,children:[L.jsxs(Te,{onClick:()=>$(e),color:"error",variant:"outlined",size:P,children:[p?L.jsx(Ve,{size:16,style:{marginRight:5}}):null,T("blocklet.config.clearCache.action")]}),l&&L.jsx(bt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}var Mt={},Jr=vt;Object.defineProperty(Mt,"__esModule",{value:!0});var ar=Mt.default=void 0,Ur=Jr(yt()),Vr=L;ar=Mt.default=(0,Ur.default)((0,Vr.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"KeyOutlined");function $t({onChange:I,disabled:P,loading:F,inService:T}){const{t:N}=Je(),{api:p,session:w}=sr(),{blocklet:l}=yr(),[$,y]=Ar({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),m=()=>y({isConnectOpen:!1}),e=()=>{if(br.isInProgress(l.status)){Ie.error(N("blocklet.error.isInProgress"));return}y({confirmDialogOpen:!0})};return L.jsxs(U,{className:"config-form",mt:2,children:[L.jsxs(U,{className:"config-item",children:[L.jsxs(U,{className:"config-label",mb:0,children:[N("blocklet.config.migrate.button"),L.jsx(U,{className:"config-desc",children:N("blocklet.config.migrate.description")})]}),L.jsxs(cr,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:P||F,onClick:e,children:[L.jsx(ar,{style:{fontSize:"1.3em",marginRight:4}}),N("blocklet.config.migrate.button")]})]}),$.isConnectOpen&&L.jsx(er,{popup:!0,open:$.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:p.get,checkTimeout:5*60*1e3,onSuccess:()=>{I(),T&&w.logout(),m()},extraParams:{appDid:l.appDid},messages:{title:N("setup.keyPair.title"),scan:N("setup.keyPair.scan"),confirm:N("setup.keyPair.confirm"),success:N("setup.keyPair.success")},onClose:m}),$.confirmDialogOpen&&L.jsx(bt,{title:L.jsx(ze,{sx:{fontSize:"20px",fontWeight:"500"},children:N("blocklet.config.migrate.title")}),description:L.jsx(ze,{sx:{fontSize:"14px",color:"#9397A1"},children:N("blocklet.config.migrate.confirm")}),confirm:N("common.confirm"),cancel:N("common.cancel"),onConfirm:()=>y({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>y({confirmDialogOpen:!1})})]})}$t.propTypes={onChange:Oe.func,disabled:Oe.bool,loading:Oe.bool,inService:Oe.bool};$t.defaultProps={onChange:()=>{},disabled:!1,loading:!1,inService:!1};function kt({onCancel:I,onSuccess:P,onError:F}){const{api:T}=Ee.useContext($r),[N,p]=Ee.useState(!1),{t:w,locale:l}=Je(),[$,y]=Ee.useState(""),[m,e]=Ee.useState(!1),[a,i]=Ee.useState(0),[r,t]=Ee.useState(""),{endpoint:c}=nr(),[s,o]=Ee.useState(!1),h=f=>{y(null),p(!0);try{t(f.result),i(j.length-1)}catch(v){const x=Fe(v);y(x),F(v)}finally{p(!1)}},g=()=>{e(!0),i(1)},b=()=>{e(!1),i(0)},j=[{body:L.jsxs(U,{children:[L.jsx(ze,{children:w("team.transferApp.transferDialog.tips.progress")}),L.jsx(ze,{mt:3,mb:2,children:w("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),onCancel:I,onConfirm:g},{cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),body:()=>L.jsx(er,{action:"transfer-app-owner",open:m,locale:l,checkFn:T.get,onClose:b,onSuccess:h,checkTimeout:5*60*1e3,extraParams:{},messages:{title:w("team.transferApp.connectDialog.title"),scan:w("team.transferApp.connectDialog.scan"),confirm:w("team.transferApp.connectDialog.confirm"),success:w("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const f=_r({transferId:r.transferId,endpoint:c});return L.jsxs(L.Fragment,{children:[L.jsx(U,{component:Pe,dangerouslySetInnerHTML:{__html:w("team.transferApp.transferDialog.createSuccessTip1")}}),L.jsx(U,{component:Pe,mt:2,children:L.jsx(Pe,{children:w("team.transferApp.transferDialog.createSuccessTip3")})}),L.jsxs(U,{children:[L.jsx(U,{component:Pe,mt:2,children:L.jsx(Pe,{children:w("team.transferApp.transferDialog.createSuccessTip2",{expireDate:wr(r.expireDate,l)})})}),L.jsx(U,{my:1,children:L.jsx(Or,{children:f})})]}),L.jsx("div",{children:L.jsx(ur,{value:"end",control:L.jsx(fr,{checked:s,onChange:v=>o(v.target.checked)}),label:w("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:w("common.confirm"),onConfirm:P}],k=j[a];return L.jsxs(tr,{title:L.jsx(Pe,{className:"title",children:w("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:L.jsxs(L.Fragment,{children:[k.cancel&&L.jsx(Te,{onClick:k.onCancel,color:"inherit",children:k.cancel}),L.jsxs(Te,{onClick:k.onConfirm,color:"error",disabled:N||a===j.length-1&&!s,variant:"contained",autoFocus:!0,children:[N&&L.jsx(Ve,{size:16}),k.confirm]})]}),children:[L.jsx(hr,{component:"div",children:typeof k.body=="function"?k.body():k.body}),!!$&&L.jsx(dr,{severity:"error",variant:"icon",children:$})]})}kt.propTypes={onCancel:Oe.func.isRequired,onSuccess:Oe.func.isRequired,onError:Oe.func};kt.defaultProps={onError:()=>{}};const Pe=Yt.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  &.title {
@@ -0,0 +1 @@
1
+ import{D as a}from"./vendor-utils-Cm2BKG2b.js";a.defaults.timeout=10*1e3;const o=a.create();export{o as a};
@@ -0,0 +1 @@
1
+ import{I as l}from"./iframe-54rcs7kU.js";import{y as i}from"./vendor-utils-Cm2BKG2b.js";import{p}from"./vendor-ux-did-connect-DlrX4cqq.js";import{r as d}from"./vendor-react-DEoibe3W.js";import{z as f,C as h}from"./index-CTpJt8AJ.js";import{j as e,a4 as u,a3 as x}from"./vendor-mui-core-1jJmAutq.js";import"./vendor-arcblock-CD8CMsgQ.js";import"./vendor-hooks-8r-lvvPs.js";import"./lottie-web-jYmAQWuC.js";function R(){const{info:n,inService:r}=f(),{blocklet:c}=h(),s="calc(100vh - 430px)",[a,m]=d.useState(!0);let t="";r?t=p.WELLKNOWN_SERVICE_PATH_PREFIX:t=n.routing.adminPath;const o=new URLSearchParams;return r||o.set("authKey","__sst"),o.set("schemaKey",i(window.location.origin,t,`/api/theme?id=${encodeURIComponent(c.appDid)}`)),e.jsxs(e.Fragment,{children:[a&&e.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:s},children:e.jsx(x,{})}),e.jsx(l,{url:`${i(window.location.origin,t,"/hosted/theme-builder/")}?${o.toString()}`,frameBorder:0,styles:{border:0,width:"100%",height:s,display:a?"none":"block"},onLoad:()=>{m(!1)}})]})}export{R as default};
@@ -1,4 +1,4 @@
1
- import{V as U,r as W,bc as N,u as V,bo as H,X as Z,m as F}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{j as e,a2 as G,a4 as p,bi as q,T as w,a5 as K,I as $,a3 as J,bl as X,bo as Q,bk as Y,ak as ee,bK as te,aa as re}from"./vendor-mui-core-C-PhacC8.js";import{p as oe}from"./util-CORzDFgw.js";import{r as l,L as ae}from"./vendor-react-DoD83n6N.js";import{_ as se}from"./useLocalStorage-C1_Fkr6_.js";import{A as O}from"./index--QvOAcHK.js";import{M}from"./index-CKv9guDo.js";import{J as ie}from"./vendor-arcblock-D8eCUoJY.js";import{d as ne}from"./InfoOutlined-DFTm-vVr.js";import{d as le}from"./vendor-utils-CRBr0QUY.js";import{R as ce}from"./relative-time-BUHtgSDe.js";import{S as E}from"./shorten-label-C642GTxb.js";import{r as I}from"./index-DvDiL1rm.js";import{u as de}from"./dashboard-D1IAu0pg.js";import"./vendor-hooks-DtYI0-rF.js";import"./lottie-web-B6s7dDoL.js";import"./base32-CEWQZb_G.js";import"./index-Tc7h84RU.js";import"./confirm-DMfA-cen.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-BEUAi9Bt.js";import"./get-safe-url-M62JolcK.js";import"./session-Clq9kJzg.js";import"./useAsyncRetry-CwtLImQi.js";import"./useAsync-BmuLIImU.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-DudfIz3d.js";const T=l.createContext({}),{Provider:pe,Consumer:Je}=T;function ue(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function fe({children:t,scope:o="",categories:i=[],showScope:c,scopeFormatter:g}){const{api:f,info:C}=O(),[x,L]=l.useState([]),[a,h]=l.useState({total:0,pageSize:ue(),pageCount:0,page:1}),[v,m]=l.useState(!1),[r,n]=l.useState(""),[d,z]=se(`audit-log-category-${o}`,"all"),s=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(S=>i.length?S.value==="all"||i.includes(S.value):!0),u=async({page:S=1,pageSize:k=20,silent:P=!0}={})=>{if(!v){P||m(!0);try{const b=await f.getAuditLogs({input:{paging:{page:S,pageSize:k},category:d==="all"?"":d,scope:o,actionOrContent:r}});c&&(b.list||[]).forEach(_=>{_.scope!==C.did&&(_.link=`/blocklets/${_.scope}/components`)}),L(b.list),h(b.paging),m(!1)}catch(b){U.error(b.message),m(!1)}}};l.useEffect(()=>{localStorage.setItem("audit-log-page-size",a.pageSize)},[a.pageSize]),l.useEffect(()=>{u({page:1,pageSize:a.pageSize,silent:!1})},[]),l.useEffect(()=>{u({page:1,pageSize:a.pageSize,silent:!1})},[d,r]);const j={loading:v,fetch:u,filter:{category:d,scope:o},categories:s,setCategory:z,data:x,paging:a,setPaging:h,showScope:c,scopeFormatter:g,actionOrContent:r,setActionOrContent:n};return e.jsx(pe,{value:{auditLogs:j},children:t})}function B(){const{auditLogs:t}=l.useContext(T);return t}var A={},me=G;Object.defineProperty(A,"__esModule",{value:!0});var R=A.default=void 0,ge=me(W()),xe=e;R=A.default=(0,ge.default)((0,xe.jsx)("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore");const Le=`
1
+ import{Z as U,r as W,bc as N,u as V,bo as H,$ as Z,p as F}from"./vendor-ux-did-connect-DlrX4cqq.js";import{j as e,a2 as G,a4 as p,bk as q,T as w,a5 as K,I as A,a3 as Q,bn as J,bq as X,bm as Y,ak as ee,bL as te,aa as re}from"./vendor-mui-core-1jJmAutq.js";import{p as oe}from"./util-B6E4W35Y.js";import{r as l,L as ae}from"./vendor-react-DEoibe3W.js";import{_ as se}from"./useLocalStorage-DLwAkPmo.js";import{z as O}from"./index-CTpJt8AJ.js";import{M}from"./index-BTOIZL6e.js";import{Q as ie}from"./vendor-arcblock-CD8CMsgQ.js";import{d as ne}from"./InfoOutlined-jnMrCCfZ.js";import{d as le}from"./vendor-utils-Cm2BKG2b.js";import{R as ce}from"./relative-time-Cu4jaQ9H.js";import{S as E}from"./shorten-label-DDBwv81M.js";import{r as I}from"./index-BYsXlcQC.js";import{u as de}from"./dashboard-2jQIZ8v5.js";import"./vendor-hooks-8r-lvvPs.js";import"./lottie-web-jYmAQWuC.js";import"./base32-CMrsHquD.js";import"./index-DVogNW6l.js";import"./confirm-C1Nde1Nq.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-CXtQLadK.js";import"./get-safe-url-C2N97NJc.js";import"./session-UJ7B0EdV.js";import"./useAsyncRetry-B6OdNqyX.js";import"./useAsync-De6s-0n9.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DjnNmGRG.js";const T=l.createContext({}),{Provider:pe,Consumer:Qe}=T;function ue(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function fe({children:t,scope:o="",categories:i=[],showScope:c,scopeFormatter:g}){const{api:f,info:C}=O(),[x,L]=l.useState([]),[a,h]=l.useState({total:0,pageSize:ue(),pageCount:0,page:1}),[v,m]=l.useState(!1),[r,n]=l.useState(""),[d,z]=se(`audit-log-category-${o}`,"all"),s=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(S=>i.length?S.value==="all"||i.includes(S.value):!0),u=async({page:S=1,pageSize:k=20,silent:P=!0}={})=>{if(!v){P||m(!0);try{const b=await f.getAuditLogs({input:{paging:{page:S,pageSize:k},category:d==="all"?"":d,scope:o,actionOrContent:r}});c&&(b.list||[]).forEach(_=>{_.scope!==C.did&&(_.link=`/blocklets/${_.scope}/components`)}),L(b.list),h(b.paging),m(!1)}catch(b){U.error(b.message),m(!1)}}};l.useEffect(()=>{localStorage.setItem("audit-log-page-size",a.pageSize)},[a.pageSize]),l.useEffect(()=>{u({page:1,pageSize:a.pageSize,silent:!1})},[]),l.useEffect(()=>{u({page:1,pageSize:a.pageSize,silent:!1})},[d,r]);const j={loading:v,fetch:u,filter:{category:d,scope:o},categories:s,setCategory:z,data:x,paging:a,setPaging:h,showScope:c,scopeFormatter:g,actionOrContent:r,setActionOrContent:n};return e.jsx(pe,{value:{auditLogs:j},children:t})}function B(){const{auditLogs:t}=l.useContext(T);return t}var $={},me=G;Object.defineProperty($,"__esModule",{value:!0});var R=$.default=void 0,ge=me(W()),xe=e;R=$.default=(0,ge.default)((0,xe.jsx)("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore");const Le=`
2
2
  <svg style="width:38px;height:38px;" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path fill-rule="evenodd" clip-rule="evenodd" d="M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z" fill="url(#paint0_linear_606_96)"/>
4
4
  <path fill-rule="evenodd" clip-rule="evenodd" d="M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z" fill="url(#paint1_linear_606_96)"/>
@@ -15,7 +15,7 @@ import{V as U,r as W,bc as N,u as V,bo as H,X as Z,m as F}from"./vendor-ux-did-c
15
15
  </linearGradient>
16
16
  </defs>
17
17
  </svg>
18
- `;function he({title:t,subTitle:o,titleInfo:i,action:c,createdAt:g,content:f,isLast:C,titleLink:x,avatarUrl:L}){const[a,h]=l.useState(!1),[v,m]=l.useState(!1),[r,n]=l.useState(window.innerWidth),d=l.useRef(null),z=()=>{var u,j;const s=(j=(u=d.current)==null?void 0:u.mdp)==null?void 0:j.current;s&&m(s.scrollHeight>s.offsetHeight)};l.useEffect(()=>{const s=le(()=>{n(window.innerWidth)},100);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),l.useEffect(()=>{z()},[r,f]);const y=l.useMemo(()=>Object.entries(i).map(([s,u])=>({key:s,value:u})).filter(s=>!!s.value),[i]);return e.jsx(p,{"data-cy":"log-entry",sx:{borderBottom:C?"none":"1px solid #ddd",padding:2},children:e.jsxs(p,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,width:"100%"},children:[e.jsx(p,{sx:{mt:.5},className:"log-author",children:L?e.jsx(q,{src:L,size:36,shape:"circle"}):e.jsx("div",{dangerouslySetInnerHTML:{__html:Le}})}),e.jsxs(p,{sx:{width:240},children:[e.jsx(w,{color:"textSecondary",component:"p",display:"flex",children:x?e.jsx(ae,{to:x,target:"_blank",children:e.jsx(E,{maxLength:26,children:t})}):e.jsx(E,{maxLength:26,children:t})}),e.jsx(K,{"aria-label":"Audit device info",title:e.jsx(p,{sx:{color:"#fff",display:"flex",flexDirection:"column",fontSize:12},children:y==null?void 0:y.map(s=>e.jsx(w,{sx:{color:"#fff"},fontSize:12,children:`${s.key}: ${s.value}`},s.key))}),children:e.jsxs(w,{component:"span",color:"textSecondary",fontSize:13,children:[o,e.jsx(ne,{sx:{ml:.5,fontSize:12,verticalAlign:"middle"}})]})})]}),e.jsxs(p,{sx:{width:200},children:[e.jsx(w,{sx:{fontSize:"16px",color:"rgb(36, 41, 47)",backgroundColor:"#fff",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'"},children:c}),e.jsx(w,{component:"span",color:"textSecondary",fontSize:13,children:e.jsx(ce,{value:g})})]}),e.jsx(p,{sx:{flex:1},children:v&&a?e.jsx(w,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,children:e.jsx(M,{source:f,rehypePlugins:[[I,{target:"_blank"}]]})}):e.jsx(w,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{display:a?"block":"-webkit-box",WebkitLineClamp:a?"none":2,WebkitBoxOrient:"vertical",overflow:a?"visible":"hidden",wordBreak:"break-word"},children:e.jsx(M,{ref:d,source:f,rehypePlugins:[[I,{target:"_blank"}]]})})}),e.jsxs(p,{children:[v&&e.jsx($,{size:"small",onClick:()=>h(!a),children:a?e.jsx(ie,{sx:{fontSize:22}}):e.jsx(R,{sx:{fontSize:22}})}),e.jsx($,{size:"small",children:e.jsx(N,{sx:{fontSize:22},content:f})})]})]})})}const ve=({log:t,info:o,inService:i})=>i?`${F.WELLKNOWN_BLOCKLET_ADMIN_PATH}/members?did=${t.actor.did}`:t.scope===o.did?`/team/members?did=${t.actor.did}`:`/blocklets/${t.scope}/members?did=${t.actor.did}`;function Ce({log:t,isLast:o}){var m,r,n,d,z,y,s,u,j,S,k,P,b,_;const{inService:i,info:c}=O(),{t:g}=V(),{teamDid:f}=de(),{showScope:C,scopeFormatter:x=D=>D}=B();if(!t.actor.did)return null;const L=!["blocklet",""].includes(t.actor.role);let a=t.actor.fullName;C&&(a=t.actor.fullName?`${a} - ${x(t.scope)}`:x(t.scope));const h=C?t.link:ve({log:t,inService:i,info:c}),v=t.actor.avatar?oe((m=t.actor)==null?void 0:m.avatar,f,i,((r=t.actor)==null?void 0:r.source)==="server"):"";return e.jsx(he,{isLast:o,isUser:L,avatarDid:t.actor.did,avatarUrl:v,title:a||g("common.unrecordedUser"),titleLink:h,subTitle:t.actor.role?t.actor.role:g("common.unrecordedRole"),content:t.content,action:t.action,titleInfo:{IP:t.ip,OS:`${(d=(n=t.env)==null?void 0:n.os)==null?void 0:d.name}${(y=(z=t.env)==null?void 0:z.os)!=null&&y.version?` ${(u=(s=t.env)==null?void 0:s.os)==null?void 0:u.version}`:""}`,Client:`${(S=(j=t.env)==null?void 0:j.browser)==null?void 0:S.name}${(P=(k=t.env)==null?void 0:k.browser)!=null&&P.Version?` ${(_=(b=t.env)==null?void 0:b.browser)==null?void 0:_.Version}`:""}`},createdAt:t.createdAt})}function be(){const{t}=V(),{data:o,loading:i,paging:c,setPaging:g,filter:f,categories:C,setCategory:x,fetch:L,actionOrContent:a,setActionOrContent:h}=B(),v=r=>{const n=Number(r.target.value);g({...c,pageSize:n}),L({page:1,pageSize:n,silent:!1})},m=r=>{g({...c,page:r+1}),L({page:r+1,pageSize:c.pageSize,silent:!1})};return i&&o.length===0?e.jsx("div",{style:{textAlign:"center",marginTop:"50px"},children:e.jsx(J,{})}):e.jsxs(ye,{"data-cy":"audit-logs",children:[e.jsxs(p,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsxs(X,{style:{width:"240px"},variant:"outlined",children:[e.jsx(Q,{children:t("common.filter")}),e.jsx(Y,{size:"small","data-cy":"filter-by-category-trigger",value:f.category,onChange:r=>x(r.target.value),fullWidth:!0,sx:{borderRadius:1},label:t("common.category"),disabled:i,children:C.map(r=>e.jsx(ee,{value:r.value,"data-cy":`filter-by-category-${r.value}`,children:e.jsx(p,{children:e.jsx("span",{children:r.label})})},r.label))})]}),e.jsx(p,{sx:{flex:1}}),e.jsx(H,{options:{searchPlaceholder:t("common.auditLogsSearch"),searchDebounceTime:600},search:a,searchText:a,searchTextUpdate:h,searchClose:()=>h(""),onSearchOpen:()=>{}})]}),o.length===0&&e.jsx(Z,{children:t("common.empty")}),e.jsx(p,{sx:{mt:2,border:(o==null?void 0:o.length)>0?"1px solid #ddd":"none",borderRadius:1},children:o.length>0&&o.map((r,n)=>e.jsx(Ce,{log:r,isLast:n===o.length-1},r.id))}),e.jsx(p,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:e.jsx(te,{disabled:i,page:c.page-1,count:c.total,rowsPerPage:c.pageSize,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:n,count:d})=>`${r}–${n} / ${d!==-1?d:`${t()}more than ${n}`}`,onPageChange:(r,n)=>m(n),onRowsPerPageChange:v})})]})}function Xe({scope:t,categories:o,showScope:i,scopeFormatter:c}){return e.jsx(fe,{scope:t,categories:o,showScope:i,scopeFormatter:c,children:e.jsx(be,{})})}const ye=re.div`
18
+ `;function he({title:t,subTitle:o,titleInfo:i,action:c,createdAt:g,content:f,isLast:C,titleLink:x,avatarUrl:L}){const[a,h]=l.useState(!1),[v,m]=l.useState(!1),[r,n]=l.useState(window.innerWidth),d=l.useRef(null),z=()=>{var u,j;const s=(j=(u=d.current)==null?void 0:u.mdp)==null?void 0:j.current;s&&m(s.scrollHeight>s.offsetHeight)};l.useEffect(()=>{const s=le(()=>{n(window.innerWidth)},100);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),l.useEffect(()=>{z()},[r,f]);const y=l.useMemo(()=>Object.entries(i).map(([s,u])=>({key:s,value:u})).filter(s=>!!s.value),[i]);return e.jsx(p,{"data-cy":"log-entry",sx:{borderBottom:C?"none":"1px solid #ddd",padding:2},children:e.jsxs(p,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,width:"100%"},children:[e.jsx(p,{sx:{mt:.5},className:"log-author",children:L?e.jsx(q,{src:L,size:36,shape:"circle"}):e.jsx("div",{dangerouslySetInnerHTML:{__html:Le}})}),e.jsxs(p,{sx:{width:240},children:[e.jsx(w,{color:"textSecondary",component:"p",display:"flex",children:x?e.jsx(ae,{to:x,target:"_blank",children:e.jsx(E,{maxLength:26,children:t})}):e.jsx(E,{maxLength:26,children:t})}),e.jsx(K,{"aria-label":"Audit device info",title:e.jsx(p,{sx:{color:"#fff",display:"flex",flexDirection:"column",fontSize:12},children:y==null?void 0:y.map(s=>e.jsx(w,{sx:{color:"#fff"},fontSize:12,children:`${s.key}: ${s.value}`},s.key))}),children:e.jsxs(w,{component:"span",color:"textSecondary",fontSize:13,children:[o,e.jsx(ne,{sx:{ml:.5,fontSize:12,verticalAlign:"middle"}})]})})]}),e.jsxs(p,{sx:{width:200},children:[e.jsx(w,{sx:{fontSize:"16px",color:"rgb(36, 41, 47)",backgroundColor:"#fff",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'"},children:c}),e.jsx(w,{component:"span",color:"textSecondary",fontSize:13,children:e.jsx(ce,{value:g})})]}),e.jsx(p,{sx:{flex:1},children:v&&a?e.jsx(w,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,children:e.jsx(M,{source:f,rehypePlugins:[[I,{target:"_blank"}]]})}):e.jsx(w,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{display:a?"block":"-webkit-box",WebkitLineClamp:a?"none":2,WebkitBoxOrient:"vertical",overflow:a?"visible":"hidden",wordBreak:"break-word"},children:e.jsx(M,{ref:d,source:f,rehypePlugins:[[I,{target:"_blank"}]]})})}),e.jsxs(p,{children:[v&&e.jsx(A,{size:"small",onClick:()=>h(!a),children:a?e.jsx(ie,{sx:{fontSize:22}}):e.jsx(R,{sx:{fontSize:22}})}),e.jsx(A,{size:"small",children:e.jsx(N,{sx:{fontSize:22},content:f})})]})]})})}const ve=({log:t,info:o,inService:i})=>i?`${F.WELLKNOWN_BLOCKLET_ADMIN_PATH}/members?did=${t.actor.did}`:t.scope===o.did?`/team/members?did=${t.actor.did}`:`/blocklets/${t.scope}/members?did=${t.actor.did}`;function Ce({log:t,isLast:o}){var m,r,n,d,z,y,s,u,j,S,k,P,b,_;const{inService:i,info:c}=O(),{t:g}=V(),{teamDid:f}=de(),{showScope:C,scopeFormatter:x=D=>D}=B();if(!t.actor.did)return null;const L=!["blocklet",""].includes(t.actor.role);let a=t.actor.fullName;C&&(a=t.actor.fullName?`${a} - ${x(t.scope)}`:x(t.scope));const h=C?t.link:ve({log:t,inService:i,info:c}),v=t.actor.avatar?oe((m=t.actor)==null?void 0:m.avatar,f,i,((r=t.actor)==null?void 0:r.source)==="server"):"";return e.jsx(he,{isLast:o,isUser:L,avatarDid:t.actor.did,avatarUrl:v,title:a||g("common.unrecordedUser"),titleLink:h,subTitle:t.actor.role?t.actor.role:g("common.unrecordedRole"),content:t.content,action:t.action,titleInfo:{IP:t.ip,OS:`${(d=(n=t.env)==null?void 0:n.os)==null?void 0:d.name}${(y=(z=t.env)==null?void 0:z.os)!=null&&y.version?` ${(u=(s=t.env)==null?void 0:s.os)==null?void 0:u.version}`:""}`,Client:`${(S=(j=t.env)==null?void 0:j.browser)==null?void 0:S.name}${(P=(k=t.env)==null?void 0:k.browser)!=null&&P.Version?` ${(_=(b=t.env)==null?void 0:b.browser)==null?void 0:_.Version}`:""}`},createdAt:t.createdAt})}function be(){const{t}=V(),{data:o,loading:i,paging:c,setPaging:g,filter:f,categories:C,setCategory:x,fetch:L,actionOrContent:a,setActionOrContent:h}=B(),v=r=>{const n=Number(r.target.value);g({...c,pageSize:n}),L({page:1,pageSize:n,silent:!1})},m=r=>{g({...c,page:r+1}),L({page:r+1,pageSize:c.pageSize,silent:!1})};return i&&o.length===0?e.jsx("div",{style:{textAlign:"center",marginTop:"50px"},children:e.jsx(Q,{})}):e.jsxs(ye,{"data-cy":"audit-logs",children:[e.jsxs(p,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsxs(J,{style:{width:"240px"},variant:"outlined",children:[e.jsx(X,{children:t("common.filter")}),e.jsx(Y,{size:"small","data-cy":"filter-by-category-trigger",value:f.category,onChange:r=>x(r.target.value),fullWidth:!0,sx:{borderRadius:1},label:t("common.category"),disabled:i,children:C.map(r=>e.jsx(ee,{value:r.value,"data-cy":`filter-by-category-${r.value}`,children:e.jsx(p,{children:e.jsx("span",{children:r.label})})},r.label))})]}),e.jsx(p,{sx:{flex:1}}),e.jsx(H,{options:{searchPlaceholder:t("common.auditLogsSearch"),searchDebounceTime:600},search:a,searchText:a,searchTextUpdate:h,searchClose:()=>h(""),onSearchOpen:()=>{}})]}),o.length===0&&e.jsx(Z,{children:t("common.empty")}),e.jsx(p,{sx:{mt:2,border:(o==null?void 0:o.length)>0?"1px solid #ddd":"none",borderRadius:1},children:o.length>0&&o.map((r,n)=>e.jsx(Ce,{log:r,isLast:n===o.length-1},r.id))}),e.jsx(p,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:e.jsx(te,{disabled:i,page:c.page-1,count:c.total,rowsPerPage:c.pageSize,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:n,count:d})=>`${r}–${n} / ${d!==-1?d:`${t()}more than ${n}`}`,onPageChange:(r,n)=>m(n),onRowsPerPageChange:v})})]})}function Je({scope:t,categories:o,showScope:i,scopeFormatter:c}){return e.jsx(fe,{scope:t,categories:o,showScope:i,scopeFormatter:c,children:e.jsx(be,{})})}const ye=re.div`
19
19
  .log-content {
20
20
  p {
21
21
  margin-bottom: 4px;
@@ -32,4 +32,4 @@ import{V as U,r as W,bc as N,u as V,bo as H,X as Z,m as F}from"./vendor-ux-did-c
32
32
  overflow: auto;
33
33
  }
34
34
  }
35
- `;export{Xe as default};
35
+ `;export{Je as default};
@@ -1 +1 @@
1
- import{aD as l}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{a as x}from"./vendor-react-DoD83n6N.js";class m{constructor(e,t,o){this.name=e,this.prefix=t,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class w{constructor(e,t,o){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return f(this,e)}}class g{constructor(e){this.decoders=e}or(e){return f(this,e)}decode(e){const t=e[0],o=this.decoders[t];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const f=(r,e)=>new g({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class y{constructor(e,t,o,s){this.name=e,this.prefix=t,this.baseEncode=o,this.baseDecode=s,this.encoder=new m(e,t,o),this.decoder=new w(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const E=({name:r,prefix:e,encode:t,decode:o})=>new y(r,e,t,o),$=(r,e,t,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let c=r.length;for(;r[c-1]==="=";)--c;const i=new Uint8Array(c*t/8|0);let n=0,d=0,u=0;for(let p=0;p<c;++p){const h=s[r[p]];if(h===void 0)throw new SyntaxError(`Non-${o} character`);d=d<<t|h,n+=t,n>=8&&(n-=8,i[u++]=255&d>>n)}if(n>=t||255&d<<8-n)throw new SyntaxError("Unexpected end of data");return i},A=(r,e,t)=>{const o=e[e.length-1]==="=",s=(1<<t)-1;let c="",i=0,n=0;for(let d=0;d<r.length;++d)for(n=n<<8|r[d],i+=8;i>t;)i-=t,c+=e[s&n>>i];if(i&&(c+=e[s&n<<t-i]),o)for(;c.length*t&7;)c+="=";return c},a=({name:r,prefix:e,bitsPerChar:t,alphabet:o})=>E({prefix:e,name:r,encode(s){return A(s,o,t)},decode(s){return $(s,o,t,r)}}),C=a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),P=a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),v=a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),D=a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O=a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j=a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k=a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),N=Object.freeze(Object.defineProperty({__proto__:null,base32:C,base32hex:v,base32hexpad:O,base32hexpadupper:j,base32hexupper:D,base32pad:S,base32padupper:U,base32upper:P,base32z:k},Symbol.toStringTag,{value:"Module"})),B=x(N),{toBuffer:q,toAddress:z,toBase58:J,toHex:T}=l,{base32:b}=B,H=r=>{if(!r)return r;const e=q(z(r));return b.encode(e)},I=r=>{if(!r)return r;const e=b.decode(r),t=J(e);return t.length>30?t:T(e)};var V={encode:H,decode:I};export{V as b};
1
+ import{aF as l}from"./vendor-ux-did-connect-DlrX4cqq.js";import{a as x}from"./vendor-react-DEoibe3W.js";class m{constructor(e,t,o){this.name=e,this.prefix=t,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class w{constructor(e,t,o){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return f(this,e)}}class g{constructor(e){this.decoders=e}or(e){return f(this,e)}decode(e){const t=e[0],o=this.decoders[t];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const f=(r,e)=>new g({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class y{constructor(e,t,o,s){this.name=e,this.prefix=t,this.baseEncode=o,this.baseDecode=s,this.encoder=new m(e,t,o),this.decoder=new w(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const E=({name:r,prefix:e,encode:t,decode:o})=>new y(r,e,t,o),$=(r,e,t,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let c=r.length;for(;r[c-1]==="=";)--c;const i=new Uint8Array(c*t/8|0);let n=0,d=0,u=0;for(let p=0;p<c;++p){const h=s[r[p]];if(h===void 0)throw new SyntaxError(`Non-${o} character`);d=d<<t|h,n+=t,n>=8&&(n-=8,i[u++]=255&d>>n)}if(n>=t||255&d<<8-n)throw new SyntaxError("Unexpected end of data");return i},A=(r,e,t)=>{const o=e[e.length-1]==="=",s=(1<<t)-1;let c="",i=0,n=0;for(let d=0;d<r.length;++d)for(n=n<<8|r[d],i+=8;i>t;)i-=t,c+=e[s&n>>i];if(i&&(c+=e[s&n<<t-i]),o)for(;c.length*t&7;)c+="=";return c},a=({name:r,prefix:e,bitsPerChar:t,alphabet:o})=>E({prefix:e,name:r,encode(s){return A(s,o,t)},decode(s){return $(s,o,t,r)}}),C=a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),P=a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),v=a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),O=a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),j=a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),k=a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),D=a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),N=Object.freeze(Object.defineProperty({__proto__:null,base32:C,base32hex:v,base32hexpad:j,base32hexpadupper:k,base32hexupper:O,base32pad:S,base32padupper:U,base32upper:P,base32z:D},Symbol.toStringTag,{value:"Module"})),B=x(N),{toBuffer:q,toAddress:z,toBase58:J,toHex:T}=l,{base32:b}=B,F=r=>{if(!r)return r;const e=q(z(r));return b.encode(e)},H=r=>{if(!r)return r;const e=b.decode(r),t=J(e);return t.length>30?t:T(e)};var R={encode:F,decode:H};export{R as b};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dja0MgHa.js","assets/vendor-ux-did-connect-BQ3cvv_1.js","assets/vendor-react-DoD83n6N.js","assets/vendor-utils-CRBr0QUY.js","assets/vendor-mui-core-C-PhacC8.js","assets/vendor-hooks-DtYI0-rF.js","assets/lottie-web-B6s7dDoL.js","assets/vendor-ux-did-connect-BDmhBveY.css","assets/vendor-arcblock-D8eCUoJY.js","assets/index-B9lZsGBd.js","assets/index--QvOAcHK.js","assets/index-tUQxVYYQ.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{_ as Se}from"./vendor-arcblock-D8eCUoJY.js";import{a2 as Pe,j as e,ae as z,T as I,a4 as m,bi as Ie,a5 as re,I as F,D as ue,E as w,ac as Re,r as ke,bP as Ee,K as oe,y as _e,x as $,aa as Oe}from"./vendor-mui-core-C-PhacC8.js";import{r as De,u as Le,b6 as Ve,m as L}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{E as M}from"./empty-spinner-CoimPnT0.js";import{d as ie}from"./DeleteOutline-DT1G93_1.js";import{m as Te,e as $e}from"./vendor-hooks-DtYI0-rF.js";import{r as h}from"./vendor-react-DoD83n6N.js";import{D as se,C as ne,P as ae}from"./react-beautiful-dnd.esm-Cx5BcFIr.js";import{S as K}from"./studio-Bv91lan_.js";import"./vendor-utils-CRBr0QUY.js";import"./lottie-web-B6s7dDoL.js";import"./raf-schd.esm-GV-XhwE0.js";import"./TuneOutlined-CzDTcEdK.js";var C={};Object.defineProperty(C,"__esModule",{value:!0});C.getVideoId=V;var Ue=C.getEmbedUrl=ze,We=C.getVideoCoverUrl=Fe,Ae=C.getVideoCheckUrl=Ne;C.getYoutubeId=pe;C.getVimeoId=he;C.isVideoUrl=qe;function pe(r){var s,l,i;const t=r.trim();return t.includes("youtu.be/")?(s=t.split("youtu.be/")[1])==null?void 0:s.split("?")[0]:t.includes("/embed/")?(l=t.split("/embed/")[1])==null?void 0:l.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?(i=t.split("/shorts/")[1])==null?void 0:i.split("?")[0]:""}function he(r){var s,l,i,a,u,y,g;const t=r.trim();return t.includes("/embed/")?(s=t.split("/embed/")[1])==null?void 0:s.split("?")[0]:t.includes("vimeo.com/video/")?(l=t.split("/video/")[1])==null?void 0:l.split("?")[0]:t.includes("vimeo.com/channels/")?(a=(i=t.split("/channels/")[1])==null?void 0:i.split("/")[1])==null?void 0:a.split("?")[0]:t.includes("vimeo.com/groups/")?(y=(u=t.split("/groups/")[1])==null?void 0:u.split("/")[1])==null?void 0:y.split("?")[0]:t.includes("vimeo.com/")?(g=t.split("vimeo.com/")[1])==null?void 0:g.split("?")[0]:""}const U={};function V(r){const t=r.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(U[t]||(U[t]=(()=>{const s=new URL(t);return s.host.includes("youtube.com")||s.host.includes("youtu.be")?[pe(t),"youtube"]:s.host.includes("vimeo.com")?[he(t),"vimeo"]:[]})()),U[t])}const k={};function ze(r,{modestbranding:t=1,controls:s=0,autoplay:l=0}={}){const i=r.trim();if(!i)return"";if(k[i]!==void 0)return k[i];const[a,u]=V(i);return u==="youtube"?k[i]=`https://www.youtube.com/embed/${a}?modestbranding=${t}&controls=${s}&autoplay=${l}`:u==="vimeo"?k[i]=`https://player.vimeo.com/video/${a}?autoplay=${l}`:k[i]="",k[i]}const E={};function Fe(r){const t=r.trim();if(!t)return"";if(E[t]!==void 0)return E[t];const[s,l]=V(t);return l==="youtube"?E[t]=`https://img.youtube.com/vi/${s}/mqdefault.jpg`:l==="vimeo"?E[t]=`https://i.vimeocdn.com/${s}/1000x563`:E[t]="",E[t]}function Ne(r){const t=r.trim();if(!t)return"";const[s,l]=V(t);return l==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${s}&format=json`:l==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${s}`:""}function qe(r){const t=r.trim();return V(t).length>0}var X={},He=Pe;Object.defineProperty(X,"__esModule",{value:!0});var me=X.default=void 0,Be=He(De()),Ke=e;me=X.default=(0,Be.default)((0,Ke.jsx)("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z"}),"ContentPaste");const le=h.lazy(()=>Se(()=>import("./index-Dja0MgHa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(r=>({default:r.Uploader}))),Me=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Xe=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Ye=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,W=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,Je=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,ce=5,de=3;function ut(){var ee;const{t:r,locale:t}=Le(),[s,l]=h.useState(!1),[i,a]=h.useState(!1),[u,y]=h.useState([]),[g,j]=h.useState([]),[x,S]=h.useState(""),[T,_]=h.useState(""),[N,q]=h.useState(Date.now()),p=Te(async()=>{var c;const n=await(await fetch(W)).json();return y(n.screenshots||[]),j(((c=n.videos)==null?void 0:c.filter(d=>!!d))||[]),n}),R=h.useRef(null),f=h.useRef(null);if(p.loading&&!p.data)return e.jsx(K,{children:e.jsx(M,{size:40})});if(p.error)return e.jsx(K,{children:e.jsx(z,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(I,{color:"error.main",sx:{fontWeight:"bold"},children:p.error.message})})});const v=async o=>{const n=o.filter(c=>!!c);j(n),await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:n})})},H=async o=>{const n=Array.from(g),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),await v(n)},ge=async o=>{const n=Array.from(u),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),y(n),await fetch(`${W}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:n})})},J=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ge(o):o.source.droppableId==="videos"&&await H(o),p.runAsync())},Z=o=>{_(o.trim()),a(!0)},G=async(o,n="")=>{let c=[];n?c=o?g.map(d=>d===n?o.trim():d):g.filter(d=>d!==n):o&&(c=[...g,o.trim()]),_(""),a(!1),(o||n)&&await v(c),p.runAsync()},xe=o=>{l(!0),S(o)},Q=()=>{l(!1),S("")};function be(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],n=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(A,{title:r("common.logo"),rules:o,tips:n,children:e.jsx(m,{sx:{flex:1,cursor:"pointer"},children:e.jsx(Ie,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Ye}?t=${N}`,onClick:()=>{var c;return(c=R.current)==null?void 0:c.open()}})})})}function ve(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${ce}`},{label:r("studio.size"),value:"<5MB"}],n=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(A,{title:r("common.screenshot"),tips:n,rules:o,children:e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"screenshots",direction:"horizontal",children:(d,O)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:O.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:O.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[u.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(P,D)=>{const te=`${W}/${b}`;return e.jsxs(m,{ref:P.innerRef,...P.draggableProps,...P.dragHandleProps,className:"image-wrapper",sx:{transform:D.isDragging?"scale(1.05)":"none",boxShadow:D.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:te,onClick:()=>xe(b),style:{cursor:"pointer"}}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(te,{method:"DELETE"}),p.runAsync()},children:e.jsx(ie,{})})})]})}},b)),d.placeholder,u.length<ce&&c()]})})})});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>{var d;return(d=f.current)==null?void 0:d.open()},children:"+"})}}function je(){const o=[{label:r("studio.count"),value:`1~${de}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],n=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(A,{title:r("studio.video"),tips:n,rules:o,children:[e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"videos",direction:"horizontal",children:(d,O)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:O.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:O.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[g.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(P,D)=>e.jsxs(m,{ref:P.innerRef,...P.draggableProps,...P.dragHandleProps,className:"image-wrapper",sx:{transform:D.isDragging?"scale(1.05)":"none",boxShadow:D.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:We(b),onClick:()=>Z(b),style:{cursor:"pointer"}}),e.jsx(m,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>Z(b),children:e.jsx(fe,{})}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>G(null,b),children:e.jsx(ie,{})})})]})},b)),d.placeholder,g.length<de&&c()]})})}),i&&e.jsx(Y,{t:r,handleOperateVideo:G,defaultUrl:T,videos:g})]});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>a(!0),children:"+"})}}function ye(){return e.jsx(ue,{open:s,onClose:Q,maxWidth:"xl",PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none"}},children:e.jsx("img",{src:`${W}/${x}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:Q})})}function we(){return e.jsxs(h.Suspense,{fallback:e.jsx(M,{size:40}),children:[e.jsx(le,{ref:R,locale:t,popup:!0,onUploadFinish:()=>{var o;(o=R.current)==null||o.close(),q(Date.now()),p.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Me,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(le,{ref:f,popup:!0,onUploadFinish:()=>{var o;(o=f.current)==null||o.close(),p.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Xe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-u.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const Ce=`https://www.arcblock.io/docs/blocklet-store/${t}/supplying-images`;return e.jsx(K,{children:e.jsxs(Ze,{children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(I,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:(ee=p.data)==null?void 0:ee.title})}),e.jsxs(I,{variant:"body2",color:"text.secondary",children:[r("studio.description")," ",e.jsx("a",{href:Ce,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),be(),ve(),je(),ye(),we()]})})}function A({title:r,rules:t,tips:s,children:l}){return e.jsxs(m,{display:"flex",flexDirection:"column",sx:{mb:4},children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(I,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(z,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:t.map(a=>i(a.label,a.value))}),s.map(a=>e.jsx(m,{sx:{fontSize:"13px",opacity:.8},children:i(a.label,a.value)}))]}),l]});function i(a,u){return e.jsxs(m,{component:"span",children:[e.jsxs(m,{component:"span",sx:{color:"#555",mr:.5},children:[a,":"]}),e.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u})]})}}A.propTypes={title:w.string.isRequired,rules:w.array.isRequired,tips:w.array.isRequired,children:w.node.isRequired};function Y({handleOperateVideo:r,t,defaultUrl:s="",videos:l}){var R;const[i,a]=h.useState(s),[u,y]=h.useState(!1),[g,j]=h.useState(!1),x=h.useRef(i),S=i!==s&&l.includes(i),T=!i&&s,_=!S&&(i&&i!==x.current||u),N=!!((R=navigator.clipboard)!=null&&R.readText),{run:q}=$e(p,{wait:500,leading:!0});return e.jsxs(ue,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Re,{children:t(s?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(ke,{children:[e.jsx(Ee,{fullWidth:!0,value:i,onChange:f=>{const v=f.target.value.trim();a(v),v?q(v):j(!1)},placeholder:t("studio.videoInputLabel"),endAdornment:i?e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:()=>{a(""),p("")},children:e.jsx(Ve,{})})}):N&&e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();a(f),p(f)}catch(f){console.error(f)}},children:e.jsx(me,{})})})}),e.jsxs(m,{mb:2,mt:.5,children:[S&&e.jsx(I,{variant:"body2",color:"error",children:t("studio.duplicateVideo")}),!S&&g&&e.jsx(I,{variant:"body2",color:"error",children:t("studio.videoDialogNoSrc")})]}),x.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${x.current}`,src:Ue(x.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:u?e.jsx(M,{size:40}):e.jsx(I,{variant:"h5",color:"text.secondary",children:e.jsx(fe,{})})})]}),e.jsxs(_e,{children:[e.jsx($,{onClick:()=>r(),children:t("studio.cancel")}),T&&e.jsx($,{variant:"contained",color:"error",onClick:()=>r(null,s),children:t("studio.delete")}),_&&e.jsx($,{variant:"contained",onClick:()=>p(i),disabled:!i||u,children:t("studio.preview")}),!T&&!_&&e.jsx($,{variant:"contained",onClick:()=>r(x.current),disabled:!x.current||s===x.current||S,children:t("studio.confirm")})]})]});function p(f){x.current="";const v=Ae(f);j(f?!v:!1),v&&(y(!0),fetch(v).then(H=>{H.ok?(x.current=f,j(!1)):j(!0)}).catch(()=>{j(!0)}).finally(()=>y(!1)))}}Y.propTypes={handleOperateVideo:w.func.isRequired,t:w.func.isRequired,defaultUrl:w.string,videos:w.array.isRequired};Y.defaultProps={defaultUrl:""};function fe(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Ze=Oe.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CB6NPYWM.js","assets/vendor-ux-did-connect-DlrX4cqq.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-Cm2BKG2b.js","assets/vendor-mui-core-1jJmAutq.js","assets/vendor-hooks-8r-lvvPs.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-BDmhBveY.css","assets/vendor-arcblock-CD8CMsgQ.js","assets/index-0CgHVUpB.js","assets/index-CTpJt8AJ.js","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{_ as Se}from"./vendor-arcblock-CD8CMsgQ.js";import{a2 as Ie,j as e,ae as z,T as P,a4 as m,bk as Pe,a5 as re,I as F,D as ue,E as w,ac as ke,r as Re,bQ as Ee,K as oe,y as _e,x as $,aa as Oe}from"./vendor-mui-core-1jJmAutq.js";import{r as De,u as Le,b6 as Ve,p as L}from"./vendor-ux-did-connect-DlrX4cqq.js";import{E as M}from"./empty-spinner-Cia24BVr.js";import{d as ie}from"./DeleteOutline-BiIEYa8g.js";import{m as Te,e as $e}from"./vendor-hooks-8r-lvvPs.js";import{r as h}from"./vendor-react-DEoibe3W.js";import{D as se,C as ne,P as ae}from"./react-beautiful-dnd.esm-Bu3K07pf.js";import{S as K}from"./studio-BYzuzhpL.js";import"./vendor-utils-Cm2BKG2b.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";import"./TuneOutlined-EaV8HxdX.js";var C={};Object.defineProperty(C,"__esModule",{value:!0});C.getVideoId=V;var Ue=C.getEmbedUrl=ze,We=C.getVideoCoverUrl=Fe,Ae=C.getVideoCheckUrl=Ne;C.getYoutubeId=pe;C.getVimeoId=he;C.isVideoUrl=qe;function pe(r){var s,l,i;const t=r.trim();return t.includes("youtu.be/")?(s=t.split("youtu.be/")[1])==null?void 0:s.split("?")[0]:t.includes("/embed/")?(l=t.split("/embed/")[1])==null?void 0:l.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?(i=t.split("/shorts/")[1])==null?void 0:i.split("?")[0]:""}function he(r){var s,l,i,a,u,y,g;const t=r.trim();return t.includes("/embed/")?(s=t.split("/embed/")[1])==null?void 0:s.split("?")[0]:t.includes("vimeo.com/video/")?(l=t.split("/video/")[1])==null?void 0:l.split("?")[0]:t.includes("vimeo.com/channels/")?(a=(i=t.split("/channels/")[1])==null?void 0:i.split("/")[1])==null?void 0:a.split("?")[0]:t.includes("vimeo.com/groups/")?(y=(u=t.split("/groups/")[1])==null?void 0:u.split("/")[1])==null?void 0:y.split("?")[0]:t.includes("vimeo.com/")?(g=t.split("vimeo.com/")[1])==null?void 0:g.split("?")[0]:""}const U={};function V(r){const t=r.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(U[t]||(U[t]=(()=>{const s=new URL(t);return s.host.includes("youtube.com")||s.host.includes("youtu.be")?[pe(t),"youtube"]:s.host.includes("vimeo.com")?[he(t),"vimeo"]:[]})()),U[t])}const R={};function ze(r,{modestbranding:t=1,controls:s=0,autoplay:l=0}={}){const i=r.trim();if(!i)return"";if(R[i]!==void 0)return R[i];const[a,u]=V(i);return u==="youtube"?R[i]=`https://www.youtube.com/embed/${a}?modestbranding=${t}&controls=${s}&autoplay=${l}`:u==="vimeo"?R[i]=`https://player.vimeo.com/video/${a}?autoplay=${l}`:R[i]="",R[i]}const E={};function Fe(r){const t=r.trim();if(!t)return"";if(E[t]!==void 0)return E[t];const[s,l]=V(t);return l==="youtube"?E[t]=`https://img.youtube.com/vi/${s}/mqdefault.jpg`:l==="vimeo"?E[t]=`https://i.vimeocdn.com/${s}/1000x563`:E[t]="",E[t]}function Ne(r){const t=r.trim();if(!t)return"";const[s,l]=V(t);return l==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${s}&format=json`:l==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${s}`:""}function qe(r){const t=r.trim();return V(t).length>0}var X={},He=Ie;Object.defineProperty(X,"__esModule",{value:!0});var me=X.default=void 0,Be=He(De()),Ke=e;me=X.default=(0,Be.default)((0,Ke.jsx)("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z"}),"ContentPaste");const le=h.lazy(()=>Se(()=>import("./index-CB6NPYWM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(r=>({default:r.Uploader}))),Me=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Xe=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Ye=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,W=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,Je=`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,ce=5,de=3;function ut(){var ee;const{t:r,locale:t}=Le(),[s,l]=h.useState(!1),[i,a]=h.useState(!1),[u,y]=h.useState([]),[g,j]=h.useState([]),[x,S]=h.useState(""),[T,_]=h.useState(""),[N,q]=h.useState(Date.now()),p=Te(async()=>{var c;const n=await(await fetch(W)).json();return y(n.screenshots||[]),j(((c=n.videos)==null?void 0:c.filter(d=>!!d))||[]),n}),k=h.useRef(null),f=h.useRef(null);if(p.loading&&!p.data)return e.jsx(K,{children:e.jsx(M,{size:40})});if(p.error)return e.jsx(K,{children:e.jsx(z,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(P,{color:"error.main",sx:{fontWeight:"bold"},children:p.error.message})})});const v=async o=>{const n=o.filter(c=>!!c);j(n),await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:n})})},H=async o=>{const n=Array.from(g),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),await v(n)},ge=async o=>{const n=Array.from(u),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),y(n),await fetch(`${W}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:n})})},J=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ge(o):o.source.droppableId==="videos"&&await H(o),p.runAsync())},Z=o=>{_(o.trim()),a(!0)},Q=async(o,n="")=>{let c=[];n?c=o?g.map(d=>d===n?o.trim():d):g.filter(d=>d!==n):o&&(c=[...g,o.trim()]),_(""),a(!1),(o||n)&&await v(c),p.runAsync()},xe=o=>{l(!0),S(o)},G=()=>{l(!1),S("")};function be(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],n=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(A,{title:r("common.logo"),rules:o,tips:n,children:e.jsx(m,{sx:{flex:1,cursor:"pointer"},children:e.jsx(Pe,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Ye}?t=${N}`,onClick:()=>{var c;return(c=k.current)==null?void 0:c.open()}})})})}function ve(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${ce}`},{label:r("studio.size"),value:"<5MB"}],n=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(A,{title:r("common.screenshot"),tips:n,rules:o,children:e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"screenshots",direction:"horizontal",children:(d,O)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:O.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:O.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[u.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(I,D)=>{const te=`${W}/${b}`;return e.jsxs(m,{ref:I.innerRef,...I.draggableProps,...I.dragHandleProps,className:"image-wrapper",sx:{transform:D.isDragging?"scale(1.05)":"none",boxShadow:D.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:te,onClick:()=>xe(b),style:{cursor:"pointer"}}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(te,{method:"DELETE"}),p.runAsync()},children:e.jsx(ie,{})})})]})}},b)),d.placeholder,u.length<ce&&c()]})})})});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>{var d;return(d=f.current)==null?void 0:d.open()},children:"+"})}}function je(){const o=[{label:r("studio.count"),value:`1~${de}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],n=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(A,{title:r("studio.video"),tips:n,rules:o,children:[e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"videos",direction:"horizontal",children:(d,O)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:O.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:O.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[g.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(I,D)=>e.jsxs(m,{ref:I.innerRef,...I.draggableProps,...I.dragHandleProps,className:"image-wrapper",sx:{transform:D.isDragging?"scale(1.05)":"none",boxShadow:D.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:We(b),onClick:()=>Z(b),style:{cursor:"pointer"}}),e.jsx(m,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>Z(b),children:e.jsx(fe,{})}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>Q(null,b),children:e.jsx(ie,{})})})]})},b)),d.placeholder,g.length<de&&c()]})})}),i&&e.jsx(Y,{t:r,handleOperateVideo:Q,defaultUrl:T,videos:g})]});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>a(!0),children:"+"})}}function ye(){return e.jsx(ue,{open:s,onClose:G,maxWidth:"xl",PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none"}},children:e.jsx("img",{src:`${W}/${x}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:G})})}function we(){return e.jsxs(h.Suspense,{fallback:e.jsx(M,{size:40}),children:[e.jsx(le,{ref:k,locale:t,popup:!0,onUploadFinish:()=>{var o;(o=k.current)==null||o.close(),q(Date.now()),p.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Me,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(le,{ref:f,popup:!0,onUploadFinish:()=>{var o;(o=f.current)==null||o.close(),p.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Xe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-u.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const Ce=`https://www.arcblock.io/docs/blocklet-store/${t}/supplying-images`;return e.jsx(K,{children:e.jsxs(Ze,{children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(P,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:(ee=p.data)==null?void 0:ee.title})}),e.jsxs(P,{variant:"body2",color:"text.secondary",children:[r("studio.description")," ",e.jsx("a",{href:Ce,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),be(),ve(),je(),ye(),we()]})})}function A({title:r,rules:t,tips:s,children:l}){return e.jsxs(m,{display:"flex",flexDirection:"column",sx:{mb:4},children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(P,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(z,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:t.map(a=>i(a.label,a.value))}),s.map(a=>e.jsx(m,{sx:{fontSize:"13px",opacity:.8},children:i(a.label,a.value)}))]}),l]});function i(a,u){return e.jsxs(m,{component:"span",children:[e.jsxs(m,{component:"span",sx:{color:"#555",mr:.5},children:[a,":"]}),e.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u})]})}}A.propTypes={title:w.string.isRequired,rules:w.array.isRequired,tips:w.array.isRequired,children:w.node.isRequired};function Y({handleOperateVideo:r,t,defaultUrl:s="",videos:l}){var k;const[i,a]=h.useState(s),[u,y]=h.useState(!1),[g,j]=h.useState(!1),x=h.useRef(i),S=i!==s&&l.includes(i),T=!i&&s,_=!S&&(i&&i!==x.current||u),N=!!((k=navigator.clipboard)!=null&&k.readText),{run:q}=$e(p,{wait:500,leading:!0});return e.jsxs(ue,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ke,{children:t(s?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(Re,{children:[e.jsx(Ee,{fullWidth:!0,value:i,onChange:f=>{const v=f.target.value.trim();a(v),v?q(v):j(!1)},placeholder:t("studio.videoInputLabel"),endAdornment:i?e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:()=>{a(""),p("")},children:e.jsx(Ve,{})})}):N&&e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();a(f),p(f)}catch(f){console.error(f)}},children:e.jsx(me,{})})})}),e.jsxs(m,{mb:2,mt:.5,children:[S&&e.jsx(P,{variant:"body2",color:"error",children:t("studio.duplicateVideo")}),!S&&g&&e.jsx(P,{variant:"body2",color:"error",children:t("studio.videoDialogNoSrc")})]}),x.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${x.current}`,src:Ue(x.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:u?e.jsx(M,{size:40}):e.jsx(P,{variant:"h5",color:"text.secondary",children:e.jsx(fe,{})})})]}),e.jsxs(_e,{children:[e.jsx($,{onClick:()=>r(),children:t("studio.cancel")}),T&&e.jsx($,{variant:"contained",color:"error",onClick:()=>r(null,s),children:t("studio.delete")}),_&&e.jsx($,{variant:"contained",onClick:()=>p(i),disabled:!i||u,children:t("studio.preview")}),!T&&!_&&e.jsx($,{variant:"contained",onClick:()=>r(x.current),disabled:!x.current||s===x.current||S,children:t("studio.confirm")})]})]});function p(f){x.current="";const v=Ae(f);j(f?!v:!1),v&&(y(!0),fetch(v).then(H=>{H.ok?(x.current=f,j(!1)):j(!0)}).catch(()=>{j(!0)}).finally(()=>y(!1)))}}Y.propTypes={handleOperateVideo:w.func.isRequired,t:w.func.isRequired,defaultUrl:w.string,videos:w.array.isRequired};Y.defaultProps={defaultUrl:""};function fe(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Ze=Oe.div`
3
3
  margin-top: 24px;
4
4
  .image-wrapper {
5
5
  margin-bottom: 16px;
@@ -1,4 +1,4 @@
1
- import{b as Q,r as f}from"./vendor-react-DoD83n6N.js";import{E as s,j as e,I as Y,br as me,x as ue,P as te,v as pe,a0 as ge,an as he,ak as xe,bY as be,M as se,a4 as n,a3 as ne,aa as $,cS as Z,bU as ye,A as je,bn as Le,al as J,T as Ee,bf as z}from"./vendor-mui-core-C-PhacC8.js";import{aZ as ae,d as W,V as Ce}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{v as Se}from"./vendor-hooks-DtYI0-rF.js";import{A as ie,h as j,O as Ne,Q as _e}from"./index--QvOAcHK.js";import{d as le}from"./Done-D9sjuoNQ.js";import{F as oe,R as re,L as U}from"./logo-uploader-gCM0_9lk.js";import{E as ke}from"./EditIcon-Bww8_WRx.js";import{d as Oe}from"./ArrowDropDown-WXsjNpSB.js";import{w as ce}from"./permission-ClAqVelD.js";import{b as Re}from"./index-Tc7h84RU.js";import"./vendor-utils-CRBr0QUY.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-D8eCUoJY.js";import"./index-tUQxVYYQ.js";import"./session-Clq9kJzg.js";function H({triggers:t,onEnterEdit:r,disabled:p}){const g=Q.useRef(null),[L,u]=Q.useState(!1),b=d=>{u(!1),d()},l=()=>{u(d=>!d)},c=d=>{g.current&&g.current.contains(d.target)||u(!1)};return t.length===0?e.jsx(Y,{"data-cy":"schema-form-item-edit",onClick:r,disabled:p,size:"large",children:e.jsx(ke,{})}):e.jsxs(e.Fragment,{children:[e.jsx(me,{variant:"outlined",ref:g,"aria-label":"split button",children:e.jsx(ue,{size:"large","aria-controls":L?"split-button-menu":void 0,"aria-expanded":L?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:l,children:e.jsx(Oe,{})})}),e.jsx(te,{sx:{zIndex:9999},open:L,anchorEl:g.current,role:void 0,placement:"bottom-end",children:e.jsx(pe,{children:e.jsx(ge,{onClickAway:c,children:e.jsx(he,{id:"split-button-menu",autoFocusItem:!0,children:t.map(d=>e.jsx(xe,{onClick:()=>b(d.handler),children:d.title},d.key))})})})})]})}H.propTypes={triggers:s.arrayOf(s.shape({key:s.string.isRequired,title:s.string.isRequired,handler:s.func.isRequired})),onEnterEdit:s.func.isRequired,disabled:s.bool.isRequired};H.defaultProps={triggers:[]};const ee=(t,r,p)=>t===null&&r&&p?"******":t?r?"******":t:"",Te=be`
1
+ import{b as Z,r as f}from"./vendor-react-DEoibe3W.js";import{E as s,j as e,I as D,bt as me,x as ue,P as te,v as pe,a0 as ge,an as he,ak as xe,bZ as be,M as se,a4 as n,a3 as ne,aa as W,cT as J,bV as ye,A as je,bp as Le,al as Q,T as Ee,bf as F}from"./vendor-mui-core-1jJmAutq.js";import{a$ as ae,d as $,Z as Ce}from"./vendor-ux-did-connect-DlrX4cqq.js";import{v as Se}from"./vendor-hooks-8r-lvvPs.js";import{c as j}from"./vendor-arcblock-CD8CMsgQ.js";import{d as ie}from"./Done-kAy_Y9ti.js";import{F as le,R as oe,L as K}from"./logo-uploader-C9TwiAKx.js";import{E as Ne}from"./EditIcon-Bt91o1l6.js";import{d as _e}from"./ArrowDropDown-CDjPVis_.js";import{z as re,L as ke,M as Oe}from"./index-CTpJt8AJ.js";import{w as ce}from"./permission-CLAOGeOf.js";import{b as Te}from"./index-DVogNW6l.js";import"./vendor-utils-Cm2BKG2b.js";import"./lottie-web-jYmAQWuC.js";import"./index-DVQCgvFb.js";import"./session-UJ7B0EdV.js";function H({triggers:t,onEnterEdit:r,disabled:p}){const g=Z.useRef(null),[L,u]=Z.useState(!1),b=d=>{u(!1),d()},l=()=>{u(d=>!d)},c=d=>{g.current&&g.current.contains(d.target)||u(!1)};return t.length===0?e.jsx(D,{"data-cy":"schema-form-item-edit",onClick:r,disabled:p,size:"large",children:e.jsx(Ne,{})}):e.jsxs(e.Fragment,{children:[e.jsx(me,{variant:"outlined",ref:g,"aria-label":"split button",children:e.jsx(ue,{size:"large","aria-controls":L?"split-button-menu":void 0,"aria-expanded":L?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:l,children:e.jsx(_e,{})})}),e.jsx(te,{sx:{zIndex:9999},open:L,anchorEl:g.current,role:void 0,placement:"bottom-end",children:e.jsx(pe,{children:e.jsx(ge,{onClickAway:c,children:e.jsx(he,{id:"split-button-menu",autoFocusItem:!0,children:t.map(d=>e.jsx(xe,{onClick:()=>b(d.handler),children:d.title},d.key))})})})})]})}H.propTypes={triggers:s.arrayOf(s.shape({key:s.string.isRequired,title:s.string.isRequired,handler:s.func.isRequired})),onEnterEdit:s.func.isRequired,disabled:s.bool.isRequired};H.defaultProps={triggers:[]};const ee=(t,r,p)=>t===null&&r&&p?"******":t?r?"******":t:"",Re=be`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -8,14 +8,14 @@ import{b as Q,r as f}from"./vendor-react-DoD83n6N.js";import{E as s,j as e,I as
8
8
  25%, 75% {
9
9
  transform: scale(1.1) translateX(3px);
10
10
  }
11
- `;function M({label:t,disabled:r,required:p,initialValue:g,onChange:L,placeholder:u,style:b,onSubmit:l,secure:c,triggers:d,formatterBeforeSubmit:R,...K}){const[I,T]=f.useState(!1),[N,v]=f.useState(!1),{t:G}=f.useContext(ae),[E,w]=f.useState(c&&g==="__encrypted__"?null:g),[h,C]=f.useState(E),[y,k]=f.useState(!1),[a,m]=f.useState(!1),A=async()=>{v(!0);try{if(await l(h)===!1)C(E);else{let F=h;typeof R=="function"&&(F=R(h)),C(F),w(F),k(!1)}}catch{C(E)}finally{v(!1),T(!1)}},x=S=>{k(S!==h),C(S),L(S)},_=S=>{S.key==="Enter"&&A()},P=f.useCallback(()=>{m(!0),setTimeout(()=>{m(!1)},500)},[]),q=f.useCallback(()=>{y&&P(),!y&&!r&&!N&&(T(!1),k(!1))},[y,r,N,P]),V=I?e.jsx(se,{style:{flex:1},fullWidth:!0,value:h,onChange:S=>{x(S.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:u,onKeyDown:_,onBlur:q,disabled:r,type:c?"password":"text",...K}):e.jsx(n,{px:1,"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap",cursor:"text"},onClick:()=>{r||T(!0)},children:ee(h,c,g)?ee(h,c,g):e.jsx("span",{className:"placeholder",children:G("common.requiredInputPlaceholder",{name:u||t})})});return e.jsx(oe,{className:"form",style:b,children:e.jsxs(n,{className:"form-item",children:[e.jsxs(n,{className:"form-item-label",children:[t,p&&e.jsx(re,{})]}),e.jsxs(n,{className:"form-item-body",style:{alignItems:"flex-start"},children:[e.jsx(n,{className:"form-item-input",children:V}),e.jsx(n,{className:"form-item-action",style:{marginLeft:d.length?12:0},children:I?e.jsxs(e.Fragment,{children:[y?e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:A,disabled:r||N||!y,sx:{animation:a?`${Te} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:N?e.jsx(ne,{size:24}):e.jsx(le,{})}):null,e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{C(E),T(!1),k(!1)},style:{paddingLeft:y?4:8},disabled:r||N,size:"large",children:e.jsx(W,{})})]}):e.jsx(n,{children:d.length?e.jsx(H,{triggers:d,disabled:r}):null})})]})]})})}M.propTypes={style:s.object,onSubmit:s.func,onChange:s.func,label:s.string,initialValue:s.string,placeholder:s.string,required:s.bool,disabled:s.bool,secure:s.bool,triggers:s.array,formatterBeforeSubmit:s.func};M.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null};function X({label:t,disabled:r,required:p,initialValue:g,onChange:L,style:u,onSubmit:b,triggers:l,options:c,formatterBeforeSubmit:d,helperText:R,placeholder:K,renderImage:I,renderLabel:T,filterKeys:N,noEmpty:v,...G}){const[E,w]=f.useState(!1),[h,C]=f.useState(!1),[y,k]=f.useState(""),a=f.useRef(null),[m,A]=f.useState(g),[x,_]=f.useState(m),P=f.useMemo(()=>{if(!c)return{};const o={};return c.forEach(i=>{o[i.code]=i}),o},[c]),q=()=>{if(!c)return[];if(!y)return c.map(i=>i.code);const o=new RegExp(y.toLowerCase());return c.filter(i=>{var O;for(let B=0;B<N.length;B++){const fe=N[B];if(o.test((O=i[fe])==null?void 0:O.toLowerCase()))return!0}return!1}).map(i=>i.code)},V=async()=>{C(!0);try{await b(typeof d=="function"?d(x):x)===!1?_(m):v&&!x.length?(_(g),A(g)):(_(x),A(x))}catch{_(m)}finally{C(!1),w(!1)}},S=(o,i)=>{if(!Array.isArray(i)){_([]),L([]);return}const O=i.filter(B=>P[B]);if(!O.length){_([]),L([]);return}_(O),L(O)},F=o=>{o.stopPropagation(),w(!0),setTimeout(()=>{if(a.current){const i=a.current.querySelector("input");i&&i.focus()}},500)},de=E?e.jsx(ye,{ref:a,options:c,value:x,onChange:S,inputValue:y,onInputChange:(o,i)=>{k(i)},PopperComponent:Pe,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:q,getOptionLabel:o=>{var i;return(i=P[o])==null?void 0:i.name},renderInput:o=>e.jsx(se,{...o,label:"",placeholder:K}),renderOption:(o,i)=>{var B;const O=x.indexOf(i)!==-1;return f.createElement(we,{component:"li",...o,key:i},I(P[i]||{}),e.jsx(n,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:O?"700":"normal"},children:T(i,P[i])||((B=P[i])==null?void 0:B.name)}),e.jsx(n,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:O?"visible":"hidden"}}))},...G}):e.jsx(n,{px:1,className:"form-item-input slot",onClick:F,style:{whiteSpace:"pre-wrap",cursor:"text"},children:x.filter(o=>c.some(i=>i.code===o)).map(o=>e.jsx(je,{label:c.find(i=>i.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(oe,{className:"form",style:u,children:e.jsxs(n,{className:"form-item",children:[e.jsxs(n,{className:"form-item-label",children:[t,p&&e.jsx(re,{})]}),e.jsxs(n,{className:"form-item-body",children:[e.jsx(n,{className:"form-item-input",children:de}),e.jsx(n,{className:"form-item-action",children:E?e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:V,disabled:r||h,size:"large",children:h?e.jsx(ne,{size:24}):e.jsx(le,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(m),w(!1)},disabled:r||h,size:"large",children:e.jsx(W,{})})]}):null})]}),E&&R&&e.jsx(Le,{children:R})]})})}X.propTypes={style:s.object,onSubmit:s.func,onChange:s.func,label:s.string,initialValue:s.string,required:s.bool,disabled:s.bool,triggers:s.array,options:s.array,helperText:s.string,formatterBeforeSubmit:s.func,placeholder:s.string,renderImage:s.func,filterKeys:s.arrayOf(s.string),noEmpty:s.bool,renderLabel:s.func};X.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:t=>t.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(t,r)=>"",noEmpty:!1};const we=$.div`
11
+ `;function M({label:t,disabled:r,required:p,initialValue:g,onChange:L,placeholder:u,style:b,onSubmit:l,secure:c,triggers:d,formatterBeforeSubmit:T,...U}){const[I,R]=f.useState(!1),[N,v]=f.useState(!1),{t:G}=f.useContext(ae),[E,w]=f.useState(c&&g==="__encrypted__"?null:g),[h,C]=f.useState(E),[y,k]=f.useState(!1),[a,m]=f.useState(!1),A=async()=>{v(!0);try{if(await l(h)===!1)C(E);else{let z=h;typeof T=="function"&&(z=T(h)),C(z),w(z),k(!1)}}catch{C(E)}finally{v(!1),R(!1)}},x=S=>{k(S!==h),C(S),L(S)},_=S=>{S.key==="Enter"&&A()},P=f.useCallback(()=>{m(!0),setTimeout(()=>{m(!1)},500)},[]),q=f.useCallback(()=>{y&&P(),!y&&!r&&!N&&(R(!1),k(!1))},[y,r,N,P]),V=I?e.jsx(se,{style:{flex:1},fullWidth:!0,value:h,onChange:S=>{x(S.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:u,onKeyDown:_,onBlur:q,disabled:r,type:c?"password":"text",...U}):e.jsx(n,{px:1,"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap",cursor:"text"},onClick:()=>{r||R(!0)},children:ee(h,c,g)?ee(h,c,g):e.jsx("span",{className:"placeholder",children:G("common.requiredInputPlaceholder",{name:u||t})})});return e.jsx(le,{className:"form",style:b,children:e.jsxs(n,{className:"form-item",children:[e.jsxs(n,{className:"form-item-label",children:[t,p&&e.jsx(oe,{})]}),e.jsxs(n,{className:"form-item-body",style:{alignItems:"flex-start"},children:[e.jsx(n,{className:"form-item-input",children:V}),e.jsx(n,{className:"form-item-action",style:{marginLeft:d.length?12:0},children:I?e.jsxs(e.Fragment,{children:[y?e.jsx(D,{"data-cy":"schema-form-item-confirm",onClick:A,disabled:r||N||!y,sx:{animation:a?`${Re} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:N?e.jsx(ne,{size:24}):e.jsx(ie,{})}):null,e.jsx(D,{"data-cy":"schema-form-item-cancel",onClick:()=>{C(E),R(!1),k(!1)},style:{paddingLeft:y?4:8},disabled:r||N,size:"large",children:e.jsx($,{})})]}):e.jsx(n,{children:d.length?e.jsx(H,{triggers:d,disabled:r}):null})})]})]})})}M.propTypes={style:s.object,onSubmit:s.func,onChange:s.func,label:s.string,initialValue:s.string,placeholder:s.string,required:s.bool,disabled:s.bool,secure:s.bool,triggers:s.array,formatterBeforeSubmit:s.func};M.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null};function X({label:t,disabled:r,required:p,initialValue:g,onChange:L,style:u,onSubmit:b,triggers:l,options:c,formatterBeforeSubmit:d,helperText:T,placeholder:U,renderImage:I,renderLabel:R,filterKeys:N,noEmpty:v,...G}){const[E,w]=f.useState(!1),[h,C]=f.useState(!1),[y,k]=f.useState(""),a=f.useRef(null),[m,A]=f.useState(g),[x,_]=f.useState(m),P=f.useMemo(()=>{if(!c)return{};const o={};return c.forEach(i=>{o[i.code]=i}),o},[c]),q=()=>{if(!c)return[];if(!y)return c.map(i=>i.code);const o=new RegExp(y.toLowerCase());return c.filter(i=>{var O;for(let B=0;B<N.length;B++){const fe=N[B];if(o.test((O=i[fe])==null?void 0:O.toLowerCase()))return!0}return!1}).map(i=>i.code)},V=async()=>{C(!0);try{await b(typeof d=="function"?d(x):x)===!1?_(m):v&&!x.length?(_(g),A(g)):(_(x),A(x))}catch{_(m)}finally{C(!1),w(!1)}},S=(o,i)=>{if(!Array.isArray(i)){_([]),L([]);return}const O=i.filter(B=>P[B]);if(!O.length){_([]),L([]);return}_(O),L(O)},z=o=>{o.stopPropagation(),w(!0),setTimeout(()=>{if(a.current){const i=a.current.querySelector("input");i&&i.focus()}},500)},de=E?e.jsx(ye,{ref:a,options:c,value:x,onChange:S,inputValue:y,onInputChange:(o,i)=>{k(i)},PopperComponent:Pe,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:q,getOptionLabel:o=>{var i;return(i=P[o])==null?void 0:i.name},renderInput:o=>e.jsx(se,{...o,label:"",placeholder:U}),renderOption:(o,i)=>{var B;const O=x.indexOf(i)!==-1;return f.createElement(we,{component:"li",...o,key:i},I(P[i]||{}),e.jsx(n,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:O?"700":"normal"},children:R(i,P[i])||((B=P[i])==null?void 0:B.name)}),e.jsx(n,{component:$,sx:{opacity:.5,width:18,height:18},style:{visibility:O?"visible":"hidden"}}))},...G}):e.jsx(n,{px:1,className:"form-item-input slot",onClick:z,style:{whiteSpace:"pre-wrap",cursor:"text"},children:x.filter(o=>c.some(i=>i.code===o)).map(o=>e.jsx(je,{label:c.find(i=>i.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(le,{className:"form",style:u,children:e.jsxs(n,{className:"form-item",children:[e.jsxs(n,{className:"form-item-label",children:[t,p&&e.jsx(oe,{})]}),e.jsxs(n,{className:"form-item-body",children:[e.jsx(n,{className:"form-item-input",children:de}),e.jsx(n,{className:"form-item-action",children:E?e.jsxs(e.Fragment,{children:[e.jsx(D,{"data-cy":"schema-form-item-confirm",onClick:V,disabled:r||h,size:"large",children:h?e.jsx(ne,{size:24}):e.jsx(ie,{})}),e.jsx(D,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(m),w(!1)},disabled:r||h,size:"large",children:e.jsx($,{})})]}):null})]}),E&&T&&e.jsx(Le,{children:T})]})})}X.propTypes={style:s.object,onSubmit:s.func,onChange:s.func,label:s.string,initialValue:s.string,required:s.bool,disabled:s.bool,triggers:s.array,options:s.array,helperText:s.string,formatterBeforeSubmit:s.func,placeholder:s.string,renderImage:s.func,filterKeys:s.arrayOf(s.string),noEmpty:s.bool,renderLabel:s.func};X.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:t=>t.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(t,r)=>"",noEmpty:!1};const we=W.div`
12
12
  display: flex;
13
13
  justify-content: space-between;
14
14
  align-items: center;
15
15
  height: 48px;
16
16
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
17
17
  font-size: 1.1em;
18
- `,Pe=$(te)(()=>({[`& .${Z.paper}`]:{boxShadow:"0px 8px 12px rgba(92, 92, 92, 0.04), 0px -10px 12px rgba(92, 92, 92, 0.04)",borderRadius:"6px",width:"100%",border:"1px solid rgba(0, 0, 0, 0.12)",color:"inherit",fontSize:13,position:"absolute",left:0,top:0},[`& .${Z.listbox}`]:{padding:0}})),Be=Object.keys(j.SUPPORTED_LANGUAGES).map(t=>({code:t,name:j.SUPPORTED_LANGUAGES[t].nativeName,enName:j.SUPPORTED_LANGUAGES[t].name})),Ae=["name","enName","code"];function D({blocklet:t,onUpdate:r,hasPermission:p,...g}){const{api:L,prefix:u,getSessionInHeader:b}=ie(),{t:l}=f.useContext(ae),[c,d]=Se({loading:!1,showTransferOwner:!1,showConfigVault:!1}),R=c.loading||!p,{logoUrl:K,rectLogoUrl:I,faviconUrl:T,splashPortraitUrl:N,splashLandscapeUrl:v,ogImageUrl:G}=Re({blocklet:t});if(_e(t.status))return null;const E=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES),w=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL),h=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER),C=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR),y=[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:l("blocklet.config.name"),value:t.environments.find(a=>a.key==="BLOCKLET_APP_NAME").value},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:l("blocklet.config.description"),value:t.environments.find(a=>a.key==="BLOCKLET_APP_DESCRIPTION").value},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:l("blocklet.config.appUrl"),value:w?w.value:""},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:l("blocklet.config.copyrightOwner"),value:h?h.value:""},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:l("blocklet.config.copyrightYear"),value:C?C.value:""}],k=async(a,m)=>{const A=[{key:a,value:m}];try{d({loading:!0});const{blocklet:x}=await L.configBlocklet({input:{did:t.meta.did,configs:A}});r(x)}catch(x){Ce.error(x.message)}finally{d({loading:!1})}};return e.jsxs(Ue,{...g,children:[y.map(a=>e.jsxs(n,{className:"config-form",mt:2,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:0,children:a.description}),e.jsx(M,{style:{marginTop:0},disabled:R,loading:c.loading,initialValue:a.value,placeholder:a.description,onSubmit:m=>k(a.key,m)})]},a.key)),e.jsx(n,{className:"config-form",component:J,my:3}),e.jsx(Ee,{variant:"body2",color:"#ff9800",pb:2,children:l("blocklet.config.changeImageTip")}),e.jsxs(z,{container:!0,spacing:2,children:[e.jsxs(z,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.logoSquare")}),e.jsx(U,{did:t.meta.did,height:80,width:80,type:"square",prefix:u,url:K,enabled:p,headers:b,aspectRatio:1}),e.jsx(n,{className:"config-label",fontSize:14,mt:4,children:l("blocklet.config.logoRect")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.logoRectDesc")}),e.jsx(U,{did:t.meta.did,height:80,width:240,type:"rect",prefix:u,url:I,enabled:p,headers:b,aspectRatio:NaN,minWidth:360,minHeight:120}),e.jsx(n,{className:"config-label",fontSize:14,mt:4,children:l("blocklet.config.logoFavicon")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.logoFaviconDesc")}),e.jsx(U,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:u,url:T,enabled:p,headers:b,aspectRatio:1})]}),e.jsxs(z,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.splashPortrait")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.splashPortraitDesc")}),e.jsx(U,{did:t.meta.did,height:400,width:225,type:"splash-portrait",prefix:u,url:N,enabled:p,headers:b,aspectRatio:9/16,minWidth:900,minHeight:1600,allowSVG:!1})]}),e.jsxs(z,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.splashLandscape")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.splashLandscapeDesc")}),e.jsx(U,{did:t.meta.did,height:225,width:400,type:"splash-landscape",prefix:u,url:v,enabled:p,headers:b,aspectRatio:16/9,minWidth:1600,minHeight:900,allowSVG:!1})]}),e.jsxs(z,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.ogImage")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.ogImageDesc")}),e.jsx(U,{did:t.meta.did,width:400,height:210,type:"og-image",prefix:u,url:G,enabled:p,headers:b,aspectRatio:40/21,minWidth:1200,minHeight:630,allowSVG:!1})]})]}),e.jsx(n,{className:"config-form",component:J,my:3}),e.jsxs(n,{className:"config-form",mt:2,sx:{".form-item:last-child":{marginBottom:0}},children:[e.jsx(n,{className:"config-label",fontSize:14,mb:0,children:l("blocklet.config.languages")}),e.jsx(X,{style:{marginTop:0},disabled:R,loading:c.loading,options:Be,noEmpty:!0,initialValue:E?E.value.split(","):["en","zh"],onSubmit:a=>k("BLOCKLET_APP_LANGUAGES",a),helperText:l("blocklet.config.selectLanguagesTip"),placeholder:l("blocklet.config.languagesSearch"),filterKeys:Ae,renderLabel:(a,m)=>m.name===m.enName?`${m.name} (${a.toUpperCase()})`:`${m.name}, ${m.enName} (${a.toUpperCase()})`})]})]})}const Ie=ce(D,"mutate_blocklets"),ve=ce(D,"",Ne);function et(t){const{inService:r}=ie();return r?e.jsx(ve,{...t}):e.jsx(Ie,{...t})}D.propTypes={blocklet:s.object.isRequired,onUpdate:s.func,hasPermission:s.bool};D.defaultProps={onUpdate:()=>{},hasPermission:!1};const Ue=$(n)`
18
+ `,Pe=W(te)(()=>({[`& .${J.paper}`]:{boxShadow:"0px 8px 12px rgba(92, 92, 92, 0.04), 0px -10px 12px rgba(92, 92, 92, 0.04)",borderRadius:"6px",width:"100%",border:"1px solid rgba(0, 0, 0, 0.12)",color:"inherit",fontSize:13,position:"absolute",left:0,top:0},[`& .${J.listbox}`]:{padding:0}})),Be=Object.keys(j.SUPPORTED_LANGUAGES).map(t=>({code:t,name:j.SUPPORTED_LANGUAGES[t].nativeName,enName:j.SUPPORTED_LANGUAGES[t].name})),Ae=["name","enName","code"];function Y({blocklet:t,onUpdate:r,hasPermission:p,...g}){const{api:L,prefix:u,getSessionInHeader:b}=re(),{t:l}=f.useContext(ae),[c,d]=Se({loading:!1,showTransferOwner:!1,showConfigVault:!1}),T=c.loading||!p,{logoUrl:U,rectLogoUrl:I,faviconUrl:R,splashPortraitUrl:N,splashLandscapeUrl:v,ogImageUrl:G}=Te({blocklet:t});if(Oe(t.status))return null;const E=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES),w=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL),h=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER),C=t.environments.find(a=>a.key===j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR),y=[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:l("blocklet.config.name"),value:t.environments.find(a=>a.key==="BLOCKLET_APP_NAME").value},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:l("blocklet.config.description"),value:t.environments.find(a=>a.key==="BLOCKLET_APP_DESCRIPTION").value},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:l("blocklet.config.appUrl"),value:w?w.value:""},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:l("blocklet.config.copyrightOwner"),value:h?h.value:""},{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:l("blocklet.config.copyrightYear"),value:C?C.value:""}],k=async(a,m)=>{const A=[{key:a,value:m}];try{d({loading:!0});const{blocklet:x}=await L.configBlocklet({input:{did:t.meta.did,configs:A}});r(x)}catch(x){Ce.error(x.message)}finally{d({loading:!1})}};return e.jsxs(Ke,{...g,children:[y.map(a=>e.jsxs(n,{className:"config-form",mt:2,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:0,children:a.description}),e.jsx(M,{style:{marginTop:0},disabled:T,loading:c.loading,initialValue:a.value,placeholder:a.description,onSubmit:m=>k(a.key,m)})]},a.key)),e.jsx(n,{className:"config-form",component:Q,my:3}),e.jsx(Ee,{variant:"body2",color:"#ff9800",pb:2,children:l("blocklet.config.changeImageTip")}),e.jsxs(F,{container:!0,spacing:2,children:[e.jsxs(F,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.logoSquare")}),e.jsx(K,{did:t.meta.did,height:80,width:80,type:"square",prefix:u,url:U,enabled:p,headers:b,aspectRatio:1}),e.jsx(n,{className:"config-label",fontSize:14,mt:4,children:l("blocklet.config.logoRect")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.logoRectDesc")}),e.jsx(K,{did:t.meta.did,height:80,width:240,type:"rect",prefix:u,url:I,enabled:p,headers:b,aspectRatio:NaN,minWidth:360,minHeight:120}),e.jsx(n,{className:"config-label",fontSize:14,mt:4,children:l("blocklet.config.logoFavicon")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.logoFaviconDesc")}),e.jsx(K,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:u,url:R,enabled:p,headers:b,aspectRatio:1})]}),e.jsxs(F,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.splashPortrait")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.splashPortraitDesc")}),e.jsx(K,{did:t.meta.did,height:400,width:225,type:"splash-portrait",prefix:u,url:N,enabled:p,headers:b,aspectRatio:9/16,minWidth:900,minHeight:1600,allowSVG:!1})]}),e.jsxs(F,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.splashLandscape")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.splashLandscapeDesc")}),e.jsx(K,{did:t.meta.did,height:225,width:400,type:"splash-landscape",prefix:u,url:v,enabled:p,headers:b,aspectRatio:16/9,minWidth:1600,minHeight:900,allowSVG:!1})]}),e.jsxs(F,{item:!0,xs:12,lg:4,children:[e.jsx(n,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:l("blocklet.config.ogImage")}),e.jsx(n,{mb:1.5,className:"config-desc",children:l("blocklet.config.ogImageDesc")}),e.jsx(K,{did:t.meta.did,width:400,height:210,type:"og-image",prefix:u,url:G,enabled:p,headers:b,aspectRatio:40/21,minWidth:1200,minHeight:630,allowSVG:!1})]})]}),e.jsx(n,{className:"config-form",component:Q,my:3}),e.jsxs(n,{className:"config-form",mt:2,sx:{".form-item:last-child":{marginBottom:0}},children:[e.jsx(n,{className:"config-label",fontSize:14,mb:0,children:l("blocklet.config.languages")}),e.jsx(X,{style:{marginTop:0},disabled:T,loading:c.loading,options:Be,noEmpty:!0,initialValue:E?E.value.split(","):["en","zh"],onSubmit:a=>k("BLOCKLET_APP_LANGUAGES",a),helperText:l("blocklet.config.selectLanguagesTip"),placeholder:l("blocklet.config.languagesSearch"),filterKeys:Ae,renderLabel:(a,m)=>m.name===m.enName?`${m.name} (${a.toUpperCase()})`:`${m.name}, ${m.enName} (${a.toUpperCase()})`})]})]})}const Ie=ce(Y,"mutate_blocklets"),ve=ce(Y,"",ke);function et(t){const{inService:r}=re();return r?e.jsx(ve,{...t}):e.jsx(Ie,{...t})}Y.propTypes={blocklet:s.object.isRequired,onUpdate:s.func,hasPermission:s.bool};Y.defaultProps={onUpdate:()=>{},hasPermission:!1};const Ke=W(n)`
19
19
  .config-form {
20
20
  flex-grow: 1;
21
21
  overflow-y: auto;
@@ -0,0 +1 @@
1
+ import{j as f,bk as E,E as a}from"./vendor-mui-core-1jJmAutq.js";import{p as P,Y as $}from"./vendor-ux-did-connect-DlrX4cqq.js";import{y as p}from"./vendor-utils-Cm2BKG2b.js";import{z as y,A as j,R,T as h,U as A}from"./index-CTpJt8AJ.js";function w({blocklet:r,ancestors:g=[]}){var d,m;const s=y(),{inService:n}=s,i=j(r==null?void 0:r.status)||R(r==null?void 0:r.status),o=`?v=${(d=r==null?void 0:r.meta)==null?void 0:d.version}${i?"~":""}`;let t=n?`${p(A,P.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${o}`:p(s.imgPrefix,"blocklet.png");if(r.source==="registry"&&r.deployedFrom&&r.meta.logo)t=`${p(r.deployedFrom,h(r.meta.bundleDid,r.meta.logo))}${o}`;else{const u=((m=window.env)==null?void 0:m.apiPrefix)||"/",e=g.concat(r),c=n?e.slice(1):e;t=`${p(u,`/blocklet/logo-bundle${c.map(x=>`/${x.meta.did}`).join("")}`)}${o}`}return{logoUrl:t,inService:n}}function v({blocklet:r,style:g,size:s,ancestors:n,...i}){const o=y(),{logoUrl:t,inService:d}=w({blocklet:r,ancestors:n}),{variant:m}=i,u=d?()=>{}:c=>{c.target.src=`${o.imgPrefix}/blocklet.png`};let e=f.jsx("img",{src:t,onError:u,alt:r.meta.name,style:{width:s}});return r.meta.logo||(e=f.jsx($,{did:r.meta.did||"",responsive:!0})),f.jsx(E,{variant:m||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},g),...i,children:e})}v.propTypes={blocklet:a.object.isRequired,style:a.object,size:a.oneOfType([a.number,a.string]),ancestors:a.array};v.defaultProps={style:{},size:40,ancestors:[]};export{v as B};
@@ -0,0 +1 @@
1
+ import{j as o}from"./vendor-mui-core-1jJmAutq.js";import{B as n}from"./vendor-ux-did-connect-DlrX4cqq.js";function m({...t}){return o.jsx(n,{className:"bottom-button",variant:"contained",color:"primary",...t})}export{m as S};
@@ -0,0 +1 @@
1
+ import{r as i}from"./vendor-react-DEoibe3W.js";import{j as t,E as e}from"./vendor-mui-core-1jJmAutq.js";import{a$ as s,bn as c}from"./vendor-ux-did-connect-DlrX4cqq.js";function n({children:p,...r}){const{t:o}=i.useContext(s);return t.jsx(c,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...r,children:p})}n.propTypes={children:e.any.isRequired};export{n as C};
@@ -0,0 +1 @@
1
+ import{a as e}from"./vendor-react-DEoibe3W.js";import{am as r}from"./vendor-utils-Cm2BKG2b.js";const o=e(r);export{o as r};
@@ -0,0 +1,45 @@
1
+ import{aa as d,j as e,a3 as T,a4 as h,E as C}from"./vendor-mui-core-1jJmAutq.js";import{u as B,a2 as _,Z as v,p as $}from"./vendor-ux-did-connect-DlrX4cqq.js";import{n as A,o as F,ak as I,d as M,e as N,ac as W,al as z,P as O}from"./index-CTpJt8AJ.js";import{r as a}from"./vendor-react-DEoibe3W.js";import{y as V}from"./vendor-utils-Cm2BKG2b.js";import{L as X}from"./launch-result-message-C0Ao1hE-.js";import{g as H}from"./get-safe-url-B2BlmlqT.js";import{S as E}from"./button-OxbVr1Od.js";import{S as K}from"./layout-R4Ynfcbq.js";import"./vendor-hooks-8r-lvvPs.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CD8CMsgQ.js";import"./content-layout-Bs-vdQ_U.js";const Q=d(X)`
2
+ && .result-footer {
3
+ height: 120px;
4
+ > div {
5
+ flex-wrap: wrap;
6
+ }
7
+ }
8
+ `,Z=Q;function U({onPrevious:s}){const{t:r}=B(),[x,g]=a.useState(!1),[c,u]=a.useState("starting"),[i,k]=a.useState(),{blocklet:l}=A(),[n,P]=a.useState(""),w=F("fromLauncher"),m=!["starting","running"].includes(c),y=c==="starting",L={stopped:r("blocklet.start"),starting:r("blocklet.starting"),running:r("blocklet.open")},R=()=>{const t=new URL(window.location.href).searchParams.get("redirect");if(!n||!_(n)){v.error(r("blocklet.gotoVisitError"));return}let o=new URL(n);t&&(o=new URL(t,n));const j=I.get("login_token");o.host!==window.location.host&&j&&(o.pathname=V($.WELLKNOWN_SERVICE_PATH_PREFIX,"redirect-with-login"),o.searchParams.set("setupToken",j)),window.location.href=H(o.href)},f=async()=>{var p;g(!0),u("starting");try{await M.post("/blocklet/start?fromSetup=1");const{blocklet:{status:t}={}}=await N.getBlocklet({input:{did:l.meta.did}});g(!1),u(t),k(t==="running"?null:r("setup.complete.notRunning"))}catch(t){const o=((p=t==null?void 0:t.response)==null?void 0:p.data)||t.message;v.error(o),g(!1),u("stopped"),k(o)}};a.useEffect(()=>{u(l.status),["starting","running"].includes(l.status)||f()},[]),a.useEffect(()=>{n||(async()=>{const t=await W.evaluateURLs(l.site.domainAliases.map(o=>z(o.value,O)),{preferAccessible:!0});t.length>0&&P(t[0].url)})()},[l,n]);const S=localStorage.getItem("blocklet-server-url"),b=y||!n;return w&&!b&&(m?f():R()),e.jsx(q,{children:e.jsx(Z,{variant:i?"error":"success",title:r(i?"setup.complete.failedTitle":"setup.complete.title"),footer:e.jsxs(D,{children:[m&&e.jsx(E,{variant:"outlined",disabled:x,onClick:()=>s(),children:r("setup.previous")}),w?e.jsxs(G,{rel:"noreferrer",children:[e.jsx(T,{size:16,style:{marginRight:14}})," ",r("common.redirecting")]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{style:{marginLeft:m?24:0},disabled:x||y,onClick:()=>m?f():R(),loading:b,children:L[c]||L.stopped}),(c==="running"||i)&&!!S&&e.jsx(h,{width:"100%",mt:2,children:e.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:r("setup.complete.backToServer")})}),i&&e.jsx(h,{className:"error-message",fontSize:14,color:"#888",mt:1,children:i})]})]})})})}const q=d(K)`
9
+ justify-content: center;
10
+ .icon-success {
11
+ width: 64px;
12
+ height: 64px;
13
+ color: ${s=>s.theme.palette.success.main};
14
+ }
15
+ .back-to-server-link {
16
+ color: ${s=>s.theme.palette.primary.main};
17
+ }
18
+ .error-message {
19
+ color: ${s=>s.theme.palette.error.main};
20
+ height: 15em;
21
+ overflow: hidden;
22
+ overflow-y: scroll;
23
+ }
24
+ `;U.propTypes={onPrevious:C.func};U.defaultProps={onPrevious:()=>{}};const D=d(h)`
25
+ width: 100%;
26
+ margin-top: auto;
27
+ padding-top: 24px;
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ .bottom-button {
32
+ min-width: 200px;
33
+ }
34
+ ${s=>s.theme.breakpoints.down("md")} {
35
+ .bottom-button {
36
+ width: 100%;
37
+ }
38
+ }
39
+ `,G=d.a`
40
+ display: flex;
41
+ justify-content: center;
42
+ align-items: center;
43
+ height: 36px;
44
+ color: ${s=>s.theme.palette.primary.main};
45
+ `;export{U as default};