@abtnode/blocklet-services 1.16.47-beta-20250714-035905-f63c5239 → 1.16.47-beta-20250715-034905-11207b15

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 (113) hide show
  1. package/api/cache.js +18 -0
  2. package/api/index.js +3 -1
  3. package/api/routes/user.js +39 -24
  4. package/api/services/auth/session.js +26 -1
  5. package/api/util/attach-shared-utils.js +6 -0
  6. package/dist/assets/{access-control-BTl2b0_r.js → access-control-Ccw74KG_.js} +1 -1
  7. package/dist/assets/{add-component-core-BOoCneV-.js → add-component-core-CbHoe5zJ.js} +1 -1
  8. package/dist/assets/{add-resource-BDCkbNIh.js → add-resource-Cq_fc1jD.js} +1 -1
  9. package/dist/assets/{addon-BeC_aHOu.js → addon-DZMRJstX.js} +1 -1
  10. package/dist/assets/{advanced-CHM2QKVn.js → advanced-2-zZxGm_.js} +1 -1
  11. package/dist/assets/{appearance-Clh0JdWn.js → appearance-DpzMSH9F.js} +1 -1
  12. package/dist/assets/{arrow-down.svg-DeuTsvwW.js → arrow-down.svg-CAhyD6_b.js} +1 -1
  13. package/dist/assets/{audit-logs-Bx2GRj51.js → audit-logs-ChoY3Mh6.js} +1 -1
  14. package/dist/assets/{authorize-BfoNT0Qc.js → authorize-CRwwOLYT.js} +1 -1
  15. package/dist/assets/{branding-Mzvrkrgp.js → branding-1Tnui43I.js} +2 -2
  16. package/dist/assets/{branding-BPSId1bW.js → branding-BFlQm__X.js} +1 -1
  17. package/dist/assets/{bundle-avatar-ILqcOXfQ.js → bundle-avatar-cdYjPEnW.js} +1 -1
  18. package/dist/assets/{complete-BTTVqsFH.js → complete-B-DZw0Xp.js} +1 -1
  19. package/dist/assets/{component-CZsqaEGa.js → component-B7p437A9.js} +3 -3
  20. package/dist/assets/{config-pwqw6mKI.js → config-CpnLJaUO.js} +1 -1
  21. package/dist/assets/{config-CsfaL3tp.js → config-CxEXdwoA.js} +1 -1
  22. package/dist/assets/{config-navigation-BScenIA7.js → config-navigation-CU19NqaO.js} +3 -3
  23. package/dist/assets/{config-space-BR2sk-vG.js → config-space-B6WEaHVR.js} +1 -1
  24. package/dist/assets/{confirm-BheJ2Ufd.js → confirm-B0IPtkVS.js} +1 -1
  25. package/dist/assets/{connect-B9pUUEJT.js → connect-BOc7_s4F.js} +1 -1
  26. package/dist/assets/{connect-zmlPofkl.js → connect-NXiMoe1T.js} +1 -1
  27. package/dist/assets/{connect-to-BhkfbcZn.js → connect-to-RFZZSI5s.js} +1 -1
  28. package/dist/assets/{dashboard-BNgYy0di.js → dashboard-ClQmhIHS.js} +3 -3
  29. package/dist/assets/{delete-confirm-CUBrOHBo.js → delete-confirm-DeAivjJv.js} +1 -1
  30. package/dist/assets/{domain-B3eQWEOO.js → domain-Cx4UiImS.js} +1 -1
  31. package/dist/assets/{domain-action-card-CBTVUEnd.js → domain-action-card-BMJauDDL.js} +1 -1
  32. package/dist/assets/{domains-8hb8xbui.js → domains-D8HTnCBf.js} +1 -1
  33. package/dist/assets/{email-BzzQ7YHo.js → email-_MWdgnCs.js} +1 -1
  34. package/dist/assets/engine-C3CQWke3.js +1 -0
  35. package/dist/assets/{exchange-passport-BWzbqk8T.js → exchange-passport-B5Avk2mv.js} +1 -1
  36. package/dist/assets/{form-DpZdkoSu.js → form-Cfox3G5b.js} +1 -1
  37. package/dist/assets/{fuel-DxwQFDm7.js → fuel--qkuIoAW.js} +1 -1
  38. package/dist/assets/{gen-access-key-Ohdhh-5N.js → gen-access-key-B4DsFFIf.js} +1 -1
  39. package/dist/assets/{get-safe-url-OoUcjrQf.js → get-safe-url-Cch2GZCp.js} +1 -1
  40. package/dist/assets/{home-BxrggRGV.js → home-DIigPTxS.js} +1 -1
  41. package/dist/assets/{iframe-DhNKb9Jt.js → iframe-CQ_bWNrw.js} +1 -1
  42. package/dist/assets/{index-BGaB1moG.js → index-8pSMU0so.js} +1 -1
  43. package/dist/assets/{index-DmO-2vsC.js → index-BEq2q2jr.js} +1 -1
  44. package/dist/assets/{index-kNB6-E_A.js → index-B_4qd0Ji.js} +1 -1
  45. package/dist/assets/{index-BbEkQqX9.js → index-BcuyH8tS.js} +3 -3
  46. package/dist/assets/{index-C3Oin-rp.js → index-Bo6LJIBD.js} +1 -1
  47. package/dist/assets/{index-C3_BZaQ8.js → index-BpL1e-bN.js} +1 -1
  48. package/dist/assets/{index-B-8dOK-Y.js → index-BsdYXeYP.js} +1 -1
  49. package/dist/assets/{index-Cs05i-2B.js → index-Bv6qc7SO.js} +1 -1
  50. package/dist/assets/{index-D395izvx.js → index-C4mYBCsd.js} +1 -1
  51. package/dist/assets/{index-Cg6pvT4l.js → index-CQb3b4r6.js} +1 -1
  52. package/dist/assets/{index-O-lXWVIy.js → index-CSSFAW5K.js} +1 -1
  53. package/dist/assets/{index-CorCl-pq.js → index-ChVoQcrO.js} +1 -1
  54. package/dist/assets/{index-DU3TZEl3.js → index-CjiaOjxw.js} +1 -1
  55. package/dist/assets/{index-DS5fiq8O.js → index-CnoeBPbk.js} +1 -1
  56. package/dist/assets/{index-BuVnqwoA.js → index-CzB-WPWn.js} +1 -1
  57. package/dist/assets/{index-DZWmwO2T.js → index-D1bv9ooM.js} +1 -1
  58. package/dist/assets/{index-BqnBQH2g.js → index-D27Eda5K.js} +1 -1
  59. package/dist/assets/{index-DUDL3BD9.js → index-DEPyMifK.js} +1 -1
  60. package/dist/assets/{index-Cv05o3sv.js → index-DawEtQPD.js} +1 -1
  61. package/dist/assets/{index-B0W6E--0.js → index-DdCAwzrE.js} +1 -1
  62. package/dist/assets/{index-DKMFPAvn.js → index-b_dnNRMF.js} +2 -2
  63. package/dist/assets/{index-1KOtJL2Z.js → index-dIkcxCDN.js} +61 -61
  64. package/dist/assets/{index-CHGxveAN.js → index-pq4T68Se.js} +4 -4
  65. package/dist/assets/{index-DbGh6qKc.js → index-thbUUXKQ.js} +1 -1
  66. package/dist/assets/{invitation-CT4PmJ8m.js → invitation-D4tu3NNd.js} +1 -1
  67. package/dist/assets/{invite-DckurcYp.js → invite-DdCiERzE.js} +1 -1
  68. package/dist/assets/{issue-passport-C1XqnwRq.js → issue-passport-CmU7CVx7.js} +1 -1
  69. package/dist/assets/{item-COV9xs9_.js → item-7fmoiGq1.js} +1 -1
  70. package/dist/assets/{landing-page-BEJgKdih.js → landing-page-DrswynDN.js} +1 -1
  71. package/dist/assets/{layout-BaT-7chZ.js → layout-u6VjgU9W.js} +1 -1
  72. package/dist/assets/{list-yYy6WE3K.js → list-DLQOcQSS.js} +2 -2
  73. package/dist/assets/{list-51eHRDeU.js → list-s4SRm3p5.js} +1 -1
  74. package/dist/assets/{localization-CpB2cS1V.js → localization-CJSvysj8.js} +1 -1
  75. package/dist/assets/{log-BwgRDuS2.js → log-BCe-iHkk.js} +1 -1
  76. package/dist/assets/login-CJ9QT17a.js +1 -0
  77. package/dist/assets/{login-oauth-callback-uUI5nP9s.js → login-oauth-callback-Bn54mlE7.js} +1 -1
  78. package/dist/assets/{logo-uploader-Ds-ORNyZ.js → logo-uploader-Cct_Tgp9.js} +2 -2
  79. package/dist/assets/{lost-passport-Cutdtz69.js → lost-passport-JFuuT2LW.js} +1 -1
  80. package/dist/assets/{open-window-YipQlD-R.js → open-window-okQkGylu.js} +1 -1
  81. package/dist/assets/{over-due-invoice-payment-BBHQI0Py.js → over-due-invoice-payment-CorS-0Po.js} +1 -1
  82. package/dist/assets/{overview-LHE9mcVq.js → overview-CDbOiDio.js} +1 -1
  83. package/dist/assets/{passport-item-DGHxcu69.js → passport-item-BejfMK1X.js} +1 -1
  84. package/dist/assets/{permission-CkJCud9p.js → permission-B4PsiDVD.js} +1 -1
  85. package/dist/assets/{preferences-Dt_WlI3m.js → preferences-DmEdhu1e.js} +1 -1
  86. package/dist/assets/{profile-embed-DxhFRKuy.js → profile-embed-BK2tobXZ.js} +1 -1
  87. package/dist/assets/{publish-resource-CSCAzPp8.js → publish-resource-M4It07oz.js} +1 -1
  88. package/dist/assets/{runtime-CN3ZLyoC.js → runtime-DaXsDIcp.js} +1 -1
  89. package/dist/assets/sdk-CzxAlOgp.js +1 -0
  90. package/dist/assets/{security-CUVhaPjm.js → security-BGWWSAkV.js} +1 -1
  91. package/dist/assets/{session-CRCJ7U0D.js → session-DgH_dTEB.js} +1 -1
  92. package/dist/assets/{setup-d7D4B5vR.js → setup-9fDp38sd.js} +3 -3
  93. package/dist/assets/{spaces-Dd-MKcUF.js → spaces-CISW823t.js} +1 -1
  94. package/dist/assets/{start-BYakq8hm.js → start-BtjRI2FT.js} +1 -1
  95. package/dist/assets/{status-D2qmTwnQ.js → status-kBSo0EE3.js} +1 -1
  96. package/dist/assets/{step-actions-BZumDL_w.js → step-actions-CSysf55Z.js} +1 -1
  97. package/dist/assets/{studio-ZCHXWZLi.js → studio-DRi8O4nl.js} +1 -1
  98. package/dist/assets/{team-03A1FYUk.js → team-DA9xMdEQ.js} +1 -1
  99. package/dist/assets/{traffic-haCt0cSP.js → traffic-BQj5L64I.js} +1 -1
  100. package/dist/assets/{transfer-C66TnWBB.js → transfer-DQ-esQ54.js} +1 -1
  101. package/dist/assets/{unsubscribe-S9W0FpYV.js → unsubscribe-dC1x4NuC.js} +1 -1
  102. package/dist/assets/{user-center-9kkvIb0O.js → user-center-Dx-CKzHU.js} +3 -3
  103. package/dist/assets/{user-sessions-qOf0SwzW.js → user-sessions-CP2hMWvQ.js} +1 -1
  104. package/dist/assets/{util-rixYG6Oq.js → util-Cn9ZyU8l.js} +1 -1
  105. package/dist/assets/{util-ChXKYX5P.js → util-DLU48yb8.js} +1 -1
  106. package/dist/assets/{wrap-locale-B_DF88uA.js → wrap-locale-DOTYikON.js} +1 -1
  107. package/dist/assets/{zh-CX7yQ7kK.js → zh-BcwVs5BX.js} +1 -1
  108. package/dist/index.html +1 -1
  109. package/dist/service-worker.js +1 -1
  110. package/package.json +39 -39
  111. package/dist/assets/engine-BDb0Jr8Z.js +0 -1
  112. package/dist/assets/login-CHIxp76E.js +0 -1
  113. package/dist/assets/sdk-iEtxKj9x.js +0 -1
package/api/cache.js CHANGED
@@ -5,6 +5,8 @@ const getBlockletInfo = require('@blocklet/meta/lib/info');
5
5
  const { fromJSON } = require('@ocap/wallet');
6
6
 
7
7
  const CACHE_TTL = 60 * 60 * 1000;
8
+ const SESSION_TOKEN_TTL = 60 * 60 * 1000;
9
+ const REFRESH_TOKEN_TTL = 86400 * 7 * 1000;
8
10
  const SESSION_CACHE_DISABLED_USER_TTL = 86400 * 1000;
9
11
  const SECURITY_CONFIG_TTL = 86400 * 1000;
10
12
 
@@ -61,6 +63,18 @@ const cacheSecurityConfig = new DBCache(() => ({
61
63
  ...getAbtNodeRedisAndSQLiteUrl(),
62
64
  }));
63
65
 
66
+ const cacheSessionToken = new DBCache(() => ({
67
+ prefix: 'services-session-token',
68
+ ttl: SESSION_TOKEN_TTL,
69
+ ...getAbtNodeRedisAndSQLiteUrl(),
70
+ }));
71
+
72
+ const cacheRefreshToken = new DBCache(() => ({
73
+ prefix: 'services-refresh-token',
74
+ ttl: REFRESH_TOKEN_TTL,
75
+ ...getAbtNodeRedisAndSQLiteUrl(),
76
+ }));
77
+
64
78
  cache.getNodeInfo = ({ node }) => {
65
79
  return cacheNodeInfo.autoCache('base', () => {
66
80
  return node.getNodeInfo();
@@ -169,4 +183,8 @@ cache.sessionCacheDisabledUser = cacheSessionDisabledUser;
169
183
 
170
184
  cache.blockletInfo = cacheBlockletInfo;
171
185
 
186
+ cache.sessionToken = cacheSessionToken;
187
+
188
+ cache.refreshToken = cacheRefreshToken;
189
+
172
190
  module.exports = cache;
package/api/index.js CHANGED
@@ -671,7 +671,9 @@ self.blocklet = {
671
671
  });
672
672
 
673
673
  /* istanbul ignore if */
674
- setupAccessLogger(server, isProduction ? getAccessLogStream() : undefined, true);
674
+ setupAccessLogger(server, isProduction ? getAccessLogStream() : undefined, true, {
675
+ prefix: WELLKNOWN_SERVICE_PATH_PREFIX,
676
+ });
675
677
 
676
678
  // Auth: login token and user info
677
679
  server.use(authMiddlewares.sessionBearerToken);
@@ -6,6 +6,7 @@ const { getApplicationInfo, handleInvitationReceive } = require('@abtnode/auth/l
6
6
  const { fromAppDid } = require('@arcblock/did-ext');
7
7
  const { extractUserAvatar, getUserAvatarUrl } = require('@abtnode/util/lib/user');
8
8
  const formatContext = require('@abtnode/util/lib/format-context');
9
+ const md5 = require('@abtnode/util/lib/md5');
9
10
  const { fromBase64 } = require('@ocap/util');
10
11
  const { isFromPublicKey } = require('@arcblock/did');
11
12
  const { LOGIN_PROVIDER } = require('@blocklet/constant');
@@ -29,6 +30,8 @@ const { getDeviceData } = require('@abtnode/util/lib/device');
29
30
  const { Op } = require('sequelize');
30
31
  const getOrigin = require('@abtnode/util/lib/get-origin');
31
32
  const { getAvatarByEmail, getAvatarByUrl } = require('@abtnode/util/lib/user');
33
+ const jwtDecode = require('jwt-decode');
34
+ const { getUserPublicInfo } = require('@abtnode/auth/lib/util/user-info');
32
35
 
33
36
  const { createTokenFn, getDidConnectVersion } = require('../util');
34
37
  const initJwt = require('../libs/jwt');
@@ -46,6 +49,7 @@ const { VerifyCodeBody } = require('../emails/_templates/verify-code-body');
46
49
  const { checkFederatedCall } = require('../middlewares/check-federated');
47
50
  const { sendToUser } = require('../libs/notification');
48
51
  const { createEmailLimiter } = require('../services/kyc');
52
+ const cache = require('../cache');
49
53
 
50
54
  const validateUser = (user) => {
51
55
  try {
@@ -939,13 +943,24 @@ module.exports = {
939
943
  res.json({ users: resList });
940
944
  });
941
945
 
946
+ server.post(`${prefixApi}/checkToken`, async (req, res) => {
947
+ const { token, type = 'sessionToken' } = req.body;
948
+ const cacheInstance = type === 'sessionToken' ? cache.sessionToken : cache.refreshToken;
949
+ const cacheData = await cacheInstance.get(md5(token));
950
+ if (cacheData?.block) {
951
+ res.json({ valid: false });
952
+ return;
953
+ }
954
+ res.json({ valid: true });
955
+ });
956
+
942
957
  server.post(`${prefixApi}/logout`, ensureBlocklet(), async (req, res) => {
943
958
  if (req.user) {
944
959
  const { blocklet } = req;
945
960
  const teamDid = blocklet.appPid;
946
961
  // NOTICE: 此处需要保留从 body 携带 visitorId 的功能,用于已登录用户注销自己指定的登录会话
947
962
  // eslint-disable-next-line prefer-const
948
- let { status, visitorId, includeFederated } = req.body;
963
+ let { status, visitorId, includeFederated, refreshToken } = req.body;
949
964
  const params = {};
950
965
  if (!visitorId) {
951
966
  visitorId = req.get('x-blocklet-visitor-id');
@@ -969,6 +984,21 @@ module.exports = {
969
984
  return;
970
985
  }
971
986
 
987
+ try {
988
+ const { token } = req;
989
+ if (token) {
990
+ const sessionTtl = jwtDecode(token).exp * 1000 - Date.now();
991
+ await cache.sessionToken.set(md5(token), { block: true }, { ttl: sessionTtl });
992
+ }
993
+ // 兼容旧版本,API 不会携带 refreshToken 的情况
994
+ if (refreshToken) {
995
+ const refreshTtl = jwtDecode(refreshToken).exp * 1000 - Date.now();
996
+ await cache.refreshToken.set(md5(refreshToken), { block: true }, { ttl: refreshTtl });
997
+ }
998
+ } catch (err) {
999
+ logger.error('Failed to block session token & refresh token', { error: err });
1000
+ }
1001
+
972
1002
  await node.logoutUser({
973
1003
  ...params,
974
1004
  userDid: req.user.did,
@@ -1467,30 +1497,15 @@ module.exports = {
1467
1497
  // public api
1468
1498
  // 获取用户可以公开的信息
1469
1499
  server.get(`${prefixApi}`, ensureBlocklet(), async (req, res) => {
1470
- const inputSchema = Joi.DID().required();
1471
- const { error, value } = inputSchema.validate(req.query.did);
1472
- if (error) {
1473
- res.status(400).send({ error: error.details[0].message });
1474
- return;
1475
- }
1476
-
1477
- const { blocklet } = req;
1478
- const teamDid = blocklet.appPid;
1479
- const user = await node.getUser({ teamDid, user: { did: value } });
1480
- if (!user || !user?.approved) {
1481
- res.status(404).send({ error: 'User not found' });
1482
- return;
1483
- }
1484
- if (user.avatar) {
1485
- user.avatar = federatedUtil.getUserAvatarUrl(user.avatar, blocklet);
1500
+ try {
1501
+ const { blocklet } = req;
1502
+ const teamDid = blocklet.appPid;
1503
+ const userInfo = await getUserPublicInfo({ req, teamDid, node });
1504
+ res.json(userInfo);
1505
+ } catch (err) {
1506
+ logger.error('Failed to get user public info', { error: err, userDid: req.user.did });
1507
+ res.status(400).send(formatError(err));
1486
1508
  }
1487
- let returnFields = ['avatar', 'did', 'fullName', 'sourceAppPid', 'createdAt', 'metadata'];
1488
-
1489
- // 默认隐藏 phone,请求者是本人时显示完整信息
1490
- const isOwner = req.user?.did === user.did;
1491
- returnFields = isOwner ? [...returnFields, 'email', 'phone', 'address'] : returnFields;
1492
- user.metadata = isOwner ? user.metadata : omit(user.metadata, ['phone']);
1493
- res.json(pick(user, returnFields));
1494
1509
  });
1495
1510
 
1496
1511
  server.delete(`${prefixApi}`, checkUser, ensureBlocklet(), async (req, res) => {
@@ -7,7 +7,8 @@ const omitBy = require('lodash/omitBy');
7
7
  const merge = require('lodash/merge');
8
8
  const isEqual = require('lodash/isEqual');
9
9
  const isUndefined = require('lodash/isUndefined');
10
-
10
+ const jwtDecode = require('jwt-decode');
11
+ const { getTokenFromReq } = require('@abtnode/util/lib/get-token-from-req');
11
12
  const { verify, decode } = require('@arcblock/jwt');
12
13
  const {
13
14
  WELLKNOWN_SERVICE_PATH_PREFIX,
@@ -23,9 +24,11 @@ const isUrl = require('is-url');
23
24
  const { DBCache, getAbtNodeRedisAndSQLiteUrl } = require('@abtnode/db-cache');
24
25
  const createTranslator = require('@abtnode/util/lib/translate');
25
26
  const getOrigin = require('@abtnode/util/lib/get-origin');
27
+ const md5 = require('@abtnode/util/lib/md5');
26
28
 
27
29
  const { createTokenFn, getDidConnectVersion } = require('../../util');
28
30
  const checkUser = require('../../middlewares/check-user');
31
+ const cache = require('../../cache');
29
32
 
30
33
  const translations = {
31
34
  zh: {
@@ -312,6 +315,11 @@ module.exports = {
312
315
  router.post(`${WELLKNOWN_SERVICE_PATH_PREFIX}/api/did/refreshSession`, refreshBearerToken, async (req, res) => {
313
316
  const token = req.refreshToken;
314
317
  if (token) {
318
+ const cacheData = await cache.refreshToken.get(md5(token));
319
+ if (cacheData?.block) {
320
+ res.status(400).send(t('userSessionLogout', req.blockletLocale));
321
+ return;
322
+ }
315
323
  const teamDid = req.getBlockletDid();
316
324
  const visitorId = req.get('x-blocklet-visitor-id');
317
325
  const ua = req.get('user-agent');
@@ -420,6 +428,23 @@ module.exports = {
420
428
  });
421
429
  }
422
430
 
431
+ // 颁发新的 token 前,将原有的 token 和 refreshToken 拉黑
432
+ // req.token 无法正确获得 login_token,所以需要通过 getTokenFromReq 获取
433
+ const { token: requestSessionToken } = getTokenFromReq(req, {
434
+ cookie: {
435
+ key: 'login_token',
436
+ },
437
+ headerKey: false,
438
+ });
439
+ if (requestSessionToken) {
440
+ const sessionTtl = jwtDecode(requestSessionToken).exp * 1000 - Date.now();
441
+ await cache.sessionToken.set(md5(requestSessionToken), { block: true }, { ttl: sessionTtl });
442
+ }
443
+ if (req.refreshToken) {
444
+ const refreshTtl = jwtDecode(req.refreshToken).exp * 1000 - Date.now();
445
+ cache.refreshToken.set(md5(req.refreshToken), { block: true }, { ttl: refreshTtl });
446
+ }
447
+
423
448
  res.json(
424
449
  signResponse(
425
450
  {
@@ -7,6 +7,7 @@ const { getDefaultServiceConfig } = require('@blocklet/meta/lib/service');
7
7
  const logger = require('@abtnode/logger')('@abtnode/blocklet-services:security');
8
8
  const { authBySimpleAccessKey, isLoginToken, isAccessKey } = require('@abtnode/util/lib/auth-simple-access-key');
9
9
  const { WELLKNOWN_SERVICE_PATH_PREFIX } = require('@abtnode/constant');
10
+ const md5 = require('@abtnode/util/lib/md5');
10
11
 
11
12
  const cache = require('../cache');
12
13
  const formatContext = require('./format-context');
@@ -156,6 +157,11 @@ module.exports = ({ node, req, options }) => {
156
157
  req.ensureUser = async ({ token, visitorId, appPid, blockletInfo } = {}) => {
157
158
  try {
158
159
  if (isLoginToken(token)) {
160
+ const cacheData = await cache.sessionToken.get(md5(token));
161
+ if (cacheData?.block) {
162
+ req.user = null;
163
+ return;
164
+ }
159
165
  const teamDid = req.getBlockletDid();
160
166
  const { secret } = blockletInfo || (await req.getBlockletInfo());
161
167
  const opt = {
@@ -1,4 +1,4 @@
1
- import{D as E,j as e,ak as c,y as A,bp as h,b6 as g,bq as L,at as y,W as I}from"./vendor-mui-core-BwwTYUH3.js";import{r as m}from"./vendor-react-x2lQvn4m.js";import{T as N,H as j}from"./vendor-ux-BglKGRhr.js";import{A as O}from"./config-CsfaL3tp.js";import{a as b}from"./page-header-BuVm9h5d.js";import{m as v,f as R,c as o,h as T}from"./index-1KOtJL2Z.js";import{S as Y}from"./layout-BaT-7chZ.js";import{S as D}from"./step-actions-BZumDL_w.js";import{S as P}from"./button-CWzJXH1i.js";import"./vendor-utils-DQY0X1ND.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./content-layout-Ctpah7wH.js";import"./use-mobile-DapluIyS.js";function W({onNext:a=()=>{}}){const C=E(),{t:l,locale:p}=N(),[i,n]=m.useState(!1),[S,d]=m.useState(""),{blocklet:r}=v();m.useEffect(()=>{const t=R.findServiceFromMeta(r.meta,o.NODE_SERVICES.AUTH);d(t?.config?.whoCanAccess||o.WHO_CAN_ACCESS.ALL)},[r]);const f=async t=>{let s=o.ACCESS_POLICY_PUBLIC;t===o.WHO_CAN_ACCESS.ALL?s=o.ACCESS_POLICY_PUBLIC:t===o.WHO_CAN_ACCESS.INVITED?s=o.ACCESS_POLICY_INVITED_ONLY:t===o.WHO_CAN_ACCESS.OWNER?s=o.ACCESS_POLICY_OWNER_ONLY:t===o.WHO_CAN_ACCESS.ADMIN&&(s=o.ACCESS_POLICY_ADMIN_ONLY);try{n(!0),await T.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:o.SECURITY_RULE_DEFAULT_ID,accessPolicyId:s}}}),n(!1)}catch(_){n(!1),j.error(_.message)}},x=async t=>{i||(d(t.target.value),await f(t.target.value))},u={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:C.palette.text.secondary};return e.jsxs(k,{children:[e.jsx(c,{className:"header",children:e.jsx(b,{title:l("blocklet.config.access.title"),subTitle:l("blocklet.config.access.description")})}),e.jsx(A,{component:"fieldset",children:e.jsx(h,{name:"inherit",value:S,onChange:x,children:O.map(t=>e.jsxs(c,{sx:{mb:2},children:[e.jsx(g,{value:t.value,control:e.jsx(L,{size:"small",color:"primary"}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center",position:"relative"},children:[e.jsx(t.icon,{style:u}),e.jsx("span",{style:{marginTop:2},children:t.title[p]})]})}),e.jsx(c,{className:"tip",children:t.description[p]})]},t.value))})}),e.jsx(D,{mt:8,disabled:i,blocklet:r,onStartNow:()=>a("complete"),children:e.jsx(P,{loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:l("setup.continue")})})]})}W.propTypes={onNext:I.func};const k=y(Y)`
1
+ import{D as E,j as e,ak as c,y as A,bp as h,b6 as g,bq as L,at as y,W as I}from"./vendor-mui-core-BwwTYUH3.js";import{r as m}from"./vendor-react-x2lQvn4m.js";import{T as N,H as j}from"./vendor-ux-BglKGRhr.js";import{A as O}from"./config-CxEXdwoA.js";import{a as b}from"./page-header-BuVm9h5d.js";import{m as v,f as R,c as o,h as T}from"./index-dIkcxCDN.js";import{S as Y}from"./layout-u6VjgU9W.js";import{S as D}from"./step-actions-CSysf55Z.js";import{S as P}from"./button-CWzJXH1i.js";import"./vendor-utils-DQY0X1ND.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./content-layout-Ctpah7wH.js";import"./use-mobile-DapluIyS.js";function W({onNext:a=()=>{}}){const C=E(),{t:l,locale:p}=N(),[i,n]=m.useState(!1),[S,d]=m.useState(""),{blocklet:r}=v();m.useEffect(()=>{const t=R.findServiceFromMeta(r.meta,o.NODE_SERVICES.AUTH);d(t?.config?.whoCanAccess||o.WHO_CAN_ACCESS.ALL)},[r]);const f=async t=>{let s=o.ACCESS_POLICY_PUBLIC;t===o.WHO_CAN_ACCESS.ALL?s=o.ACCESS_POLICY_PUBLIC:t===o.WHO_CAN_ACCESS.INVITED?s=o.ACCESS_POLICY_INVITED_ONLY:t===o.WHO_CAN_ACCESS.OWNER?s=o.ACCESS_POLICY_OWNER_ONLY:t===o.WHO_CAN_ACCESS.ADMIN&&(s=o.ACCESS_POLICY_ADMIN_ONLY);try{n(!0),await T.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:o.SECURITY_RULE_DEFAULT_ID,accessPolicyId:s}}}),n(!1)}catch(_){n(!1),j.error(_.message)}},x=async t=>{i||(d(t.target.value),await f(t.target.value))},u={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:C.palette.text.secondary};return e.jsxs(k,{children:[e.jsx(c,{className:"header",children:e.jsx(b,{title:l("blocklet.config.access.title"),subTitle:l("blocklet.config.access.description")})}),e.jsx(A,{component:"fieldset",children:e.jsx(h,{name:"inherit",value:S,onChange:x,children:O.map(t=>e.jsxs(c,{sx:{mb:2},children:[e.jsx(g,{value:t.value,control:e.jsx(L,{size:"small",color:"primary"}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center",position:"relative"},children:[e.jsx(t.icon,{style:u}),e.jsx("span",{style:{marginTop:2},children:t.title[p]})]})}),e.jsx(c,{className:"tip",children:t.description[p]})]},t.value))})}),e.jsx(D,{mt:8,disabled:i,blocklet:r,onStartNow:()=>a("complete"),children:e.jsx(P,{loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:l("setup.continue")})})]})}W.propTypes={onNext:I.func};const k=y(Y)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  .header {
@@ -1,4 +1,4 @@
1
- import{W as F,j as l,a6 as Tt,at as it,ak as oe,D as qt,T as je,J as Gt,b6 as Jr,a5 as Qr,I as _o,c1 as No,S as Ao,c9 as ya,dK as ba,aP as Do,F as xa,z as Vn,bE as wa,bF as Sa,bG as Ea,bC as ka,aX as Mo,V as Ta,aO as ja,d2 as Oa,d3 as Ca,bA as Ia,c0 as Ra,M as Zr,am as Bo,aq as Pa,b1 as ut,b7 as La,ds as _a,a9 as Fo,ad as $o,aV as Na,aj as Uo,Q as kn,Y as Aa,bv as qo,o as Wo,aU as Da,ar as Kt,c6 as Ma,c5 as Ba,bY as Si,U as Ei,ah as Fa,dw as $a,O as Ua,K as qa,P as Wa,ai as za,an as zo,A as ki,aI as Va,dL as Ka}from"./vendor-mui-core-BwwTYUH3.js";import{r as q,g as ei,u as Ga,i as Ha,e as Vo,p as Xa,a as Ut,d as Ya,f as Cn,j as Ja}from"./vendor-react-x2lQvn4m.js";import{r as ti,S as Qa,s as Ko,A as Za}from"./item-COV9xs9_.js";import{n as yt,a as ni,e as Go,T as wt,I as bt,a8 as el,r as tl,B as Kn,H as Gn,av as Ti,m as Xt,o as Ho,$ as qn,E as Xo,c as nl,C as rl,aR as il}from"./vendor-ux-BglKGRhr.js";import{O as ln,f as $t,c as ol,c9 as sl,aZ as al,bR as Yo,ca as ll,bN as cl,cb as ul,cc as dl,V as hl,M as Bt,b9 as fl,$ as Jo,aC as pl,cd as ml,C as gl,ce as vl,Z as Hn,cf as Qo,bl as Zo,k as Xn,a3 as ji,cg as yl,ai as Mr,ac as bl,ch as xl,ci as wl,cj as In,ck as Oi,a_ as Sl}from"./index-1KOtJL2Z.js";import{j as Ci,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-BEuhHuNQ.js";import{u as Ii}from"./launch-result-message-BlpIIvzr.js";import{a as es}from"./page-header-BuVm9h5d.js";import{e as vt,B as Ol,C as Zt,J as Yn,D as Ri,R as ts,Q as Cl,ad as Il,A as Rl,o as rr,U as Pl,am as Ll,an as _l,ao as Nl,a as yn,S as Al,b as Dl}from"./vendor-utils-DQY0X1ND.js";import{f as Br}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-BDb0Jr8Z.js";import{u as Bl,C as Fl}from"./config-space-BR2sk-vG.js";import{R as ir}from"./logo-uploader-Ds-ORNyZ.js";import{S as $l}from"./index-BuVnqwoA.js";import{a as ns,h as Ul,w as ql,f as Wl,b as zl,d as Vl,e as Kl,M as Gl}from"./index-BEyKlMs9.js";import{k as Tn,a as Hl,b as Xl,u as rs,g as Yl,q as Jl}from"./vendor-hooks-uwq5Zgdd.js";import{g as Ql}from"./get-safe-url-OoUcjrQf.js";import{r as Zl}from"./index-MGxe3V9B.js";import{r as ec}from"./cloneDeep-BnFQZ0zY.js";import{u as ri}from"./useLocalStorage-CVZc_3z4.js";import{v as Pi}from"./index-Dl1q-Vpb.js";import{u as tc}from"./session-CRCJ7U0D.js";import{W as nc}from"./did-address-D7SiJUQw.js";import{a as Li}from"./api-CpymM8cn.js";import{v as rc,e as ic}from"./util-ChXKYX5P.js";import{u as is}from"./use-mobile-DHiqEjn5.js";import{C as oc}from"./content-layout-Ctpah7wH.js";import{C as sc,D as ac,a as lc}from"./connect-to-BhkfbcZn.js";import{d as or}from"./search-4YYphs0l.js";const Lf="blocklet-add-component-registry",_f="server-add-registry",Nf=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=ln();return q.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ss({disabled:e=!1,children:t,onConfirm:r}){return q.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}ss.propTypes={disabled:F.bool,children:F.any.isRequired,onConfirm:F.func.isRequired};function as({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=q.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(cc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(yt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(ni,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:F.func.isRequired,nextDisabled:F.bool,launching:F.bool,description:F.any,texts:F.object};const cc=it.div`
1
+ import{W as F,j as l,a6 as Tt,at as it,ak as oe,D as qt,T as je,J as Gt,b6 as Jr,a5 as Qr,I as _o,c1 as No,S as Ao,c9 as ya,dK as ba,aP as Do,F as xa,z as Vn,bE as wa,bF as Sa,bG as Ea,bC as ka,aX as Mo,V as Ta,aO as ja,d2 as Oa,d3 as Ca,bA as Ia,c0 as Ra,M as Zr,am as Bo,aq as Pa,b1 as ut,b7 as La,ds as _a,a9 as Fo,ad as $o,aV as Na,aj as Uo,Q as kn,Y as Aa,bv as qo,o as Wo,aU as Da,ar as Kt,c6 as Ma,c5 as Ba,bY as Si,U as Ei,ah as Fa,dw as $a,O as Ua,K as qa,P as Wa,ai as za,an as zo,A as ki,aI as Va,dL as Ka}from"./vendor-mui-core-BwwTYUH3.js";import{r as q,g as ei,u as Ga,i as Ha,e as Vo,p as Xa,a as Ut,d as Ya,f as Cn,j as Ja}from"./vendor-react-x2lQvn4m.js";import{r as ti,S as Qa,s as Ko,A as Za}from"./item-7fmoiGq1.js";import{n as yt,a as ni,e as Go,T as wt,I as bt,a8 as el,r as tl,B as Kn,H as Gn,av as Ti,m as Xt,o as Ho,$ as qn,E as Xo,c as nl,C as rl,aR as il}from"./vendor-ux-BglKGRhr.js";import{O as ln,f as $t,c as ol,c9 as sl,aZ as al,bR as Yo,ca as ll,bN as cl,cb as ul,cc as dl,V as hl,M as Bt,b9 as fl,$ as Jo,aC as pl,cd as ml,C as gl,ce as vl,Z as Hn,cf as Qo,bl as Zo,k as Xn,a3 as ji,cg as yl,ai as Mr,ac as bl,ch as xl,ci as wl,cj as In,ck as Oi,a_ as Sl}from"./index-dIkcxCDN.js";import{j as Ci,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-BEuhHuNQ.js";import{u as Ii}from"./launch-result-message-BlpIIvzr.js";import{a as es}from"./page-header-BuVm9h5d.js";import{e as vt,B as Ol,C as Zt,J as Yn,D as Ri,R as ts,Q as Cl,ad as Il,A as Rl,o as rr,U as Pl,am as Ll,an as _l,ao as Nl,a as yn,S as Al,b as Dl}from"./vendor-utils-DQY0X1ND.js";import{f as Br}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-C3CQWke3.js";import{u as Bl,C as Fl}from"./config-space-B6WEaHVR.js";import{R as ir}from"./logo-uploader-Cct_Tgp9.js";import{S as $l}from"./index-CzB-WPWn.js";import{a as ns,h as Ul,w as ql,f as Wl,b as zl,d as Vl,e as Kl,M as Gl}from"./index-BEyKlMs9.js";import{k as Tn,a as Hl,b as Xl,u as rs,g as Yl,q as Jl}from"./vendor-hooks-uwq5Zgdd.js";import{g as Ql}from"./get-safe-url-Cch2GZCp.js";import{r as Zl}from"./index-MGxe3V9B.js";import{r as ec}from"./cloneDeep-BnFQZ0zY.js";import{u as ri}from"./useLocalStorage-CVZc_3z4.js";import{v as Pi}from"./index-Dl1q-Vpb.js";import{u as tc}from"./session-DgH_dTEB.js";import{W as nc}from"./did-address-D7SiJUQw.js";import{a as Li}from"./api-CpymM8cn.js";import{v as rc,e as ic}from"./util-DLU48yb8.js";import{u as is}from"./use-mobile-DHiqEjn5.js";import{C as oc}from"./content-layout-Ctpah7wH.js";import{C as sc,D as ac,a as lc}from"./connect-to-RFZZSI5s.js";import{d as or}from"./search-4YYphs0l.js";const Lf="blocklet-add-component-registry",_f="server-add-registry",Nf=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=ln();return q.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ss({disabled:e=!1,children:t,onConfirm:r}){return q.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}ss.propTypes={disabled:F.bool,children:F.any.isRequired,onConfirm:F.func.isRequired};function as({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=q.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(cc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(yt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(ni,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:F.func.isRequired,nextDisabled:F.bool,launching:F.bool,description:F.any,texts:F.object};const cc=it.div`
2
2
  margin: 0 auto;
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -1 +1 @@
1
- import{J as v,j as l}from"./vendor-mui-core-BwwTYUH3.js";import{j as B,r}from"./vendor-react-x2lQvn4m.js";import{C as W,D as L}from"./vendor-utils-DQY0X1ND.js";import{T as O,a as T}from"./vendor-ux-BglKGRhr.js";import{h as d,b as A,m as _}from"./vendor-hooks-uwq5Zgdd.js";import{A as $,S as F}from"./add-component-core-BOoCneV-.js";import{m as K,D as z}from"./index-1KOtJL2Z.js";import"./lottie-web-4koyQiv_.js";import"./item-COV9xs9_.js";import"./index-DBs9Ljax.js";import"./delete-confirm-CUBrOHBo.js";import"./click-to-copy-DPQ0tcO7.js";import"./confirm-BheJ2Ufd.js";import"./session-CRCJ7U0D.js";import"./get-safe-url-OoUcjrQf.js";import"./did-address-D7SiJUQw.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./launch-result-message-BlpIIvzr.js";import"./page-header-BuVm9h5d.js";import"./engine-BDb0Jr8Z.js";import"./config-space-BR2sk-vG.js";import"./spaces-Dd-MKcUF.js";import"./api-CpymM8cn.js";import"./logo-uploader-Ds-ORNyZ.js";import"./index-BuVnqwoA.js";import"./Google-BdWLCoXr.js";import"./cloneDeep-BnFQZ0zY.js";import"./collapse-DGb2BFlZ.js";import"./index-BEyKlMs9.js";import"./index-MGxe3V9B.js";import"./useLocalStorage-CVZc_3z4.js";import"./index-Dl1q-Vpb.js";import"./util-ChXKYX5P.js";import"./use-mobile-DHiqEjn5.js";import"./content-layout-Ctpah7wH.js";import"./connect-to-BhkfbcZn.js";import"./index-DKMFPAvn.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BGTKxy_q.js";import"./search-4YYphs0l.js";function Me(){const{t:u}=O(),{blocklet:h}=K(),{componentDid:s}=B(),w=v(e=>e.breakpoints.down("md")),t=new URL(window.location.href),f=t.searchParams.get("mode")==="dialog",n=t.searchParams.get("resourceType")||"",m=t.searchParams.get("resourceDid")||s,g=t.searchParams.get("store")||"",C=t.searchParams.get("showFromUrl")!=="false",R=t.searchParams.get("showResourcesSwitch")!=="false",S=t.searchParams.get("enableRunBackground")!=="false",b=t.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[y,D]=r.useState(i.map(e=>({url:e,name:e.replace("https://","")}))),[E,P]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await Promise.all(i.map(async o=>{const x=W(o,"/api/store.json"),{data:M}=await L.get(x);return{url:o,name:M.name}}));D(e||[])}catch(e){console.error(e)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const e=z();return a&&e.connect(),()=>{a&&e.isConnected()&&e.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=A(e=>{e.data?.event==="resourceDialog.select"&&e.data?.componentDid===s&&(P(e.data.data),j(e.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),_(()=>{window.removeEventListener("message",c)});const p=({inDialog:e=!0}={})=>l.jsx($,{stores:y,selectedMeta:E,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:e,storageKey:F(`${n}+${m}`),showResourcesSwitch:R,showFromUrl:C,enableRunBackground:S,showCategory:b});return f?l.jsx(T,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{Me as default};
1
+ import{J as v,j as l}from"./vendor-mui-core-BwwTYUH3.js";import{j as B,r}from"./vendor-react-x2lQvn4m.js";import{C as W,D as L}from"./vendor-utils-DQY0X1ND.js";import{T as O,a as T}from"./vendor-ux-BglKGRhr.js";import{h as d,b as A,m as _}from"./vendor-hooks-uwq5Zgdd.js";import{A as $,S as F}from"./add-component-core-CbHoe5zJ.js";import{m as K,D as z}from"./index-dIkcxCDN.js";import"./lottie-web-4koyQiv_.js";import"./item-7fmoiGq1.js";import"./index-DBs9Ljax.js";import"./delete-confirm-DeAivjJv.js";import"./click-to-copy-DPQ0tcO7.js";import"./confirm-B0IPtkVS.js";import"./session-DgH_dTEB.js";import"./get-safe-url-Cch2GZCp.js";import"./did-address-D7SiJUQw.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./launch-result-message-BlpIIvzr.js";import"./page-header-BuVm9h5d.js";import"./engine-C3CQWke3.js";import"./config-space-B6WEaHVR.js";import"./spaces-CISW823t.js";import"./api-CpymM8cn.js";import"./logo-uploader-Cct_Tgp9.js";import"./index-CzB-WPWn.js";import"./Google-BdWLCoXr.js";import"./cloneDeep-BnFQZ0zY.js";import"./collapse-DGb2BFlZ.js";import"./index-BEyKlMs9.js";import"./index-MGxe3V9B.js";import"./useLocalStorage-CVZc_3z4.js";import"./index-Dl1q-Vpb.js";import"./util-DLU48yb8.js";import"./use-mobile-DHiqEjn5.js";import"./content-layout-Ctpah7wH.js";import"./connect-to-RFZZSI5s.js";import"./index-b_dnNRMF.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BGTKxy_q.js";import"./search-4YYphs0l.js";function Me(){const{t:u}=O(),{blocklet:h}=K(),{componentDid:s}=B(),w=v(e=>e.breakpoints.down("md")),t=new URL(window.location.href),f=t.searchParams.get("mode")==="dialog",n=t.searchParams.get("resourceType")||"",m=t.searchParams.get("resourceDid")||s,g=t.searchParams.get("store")||"",C=t.searchParams.get("showFromUrl")!=="false",R=t.searchParams.get("showResourcesSwitch")!=="false",S=t.searchParams.get("enableRunBackground")!=="false",b=t.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[y,D]=r.useState(i.map(e=>({url:e,name:e.replace("https://","")}))),[E,P]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await Promise.all(i.map(async o=>{const x=W(o,"/api/store.json"),{data:M}=await L.get(x);return{url:o,name:M.name}}));D(e||[])}catch(e){console.error(e)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const e=z();return a&&e.connect(),()=>{a&&e.isConnected()&&e.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=A(e=>{e.data?.event==="resourceDialog.select"&&e.data?.componentDid===s&&(P(e.data.data),j(e.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),_(()=>{window.removeEventListener("message",c)});const p=({inDialog:e=!0}={})=>l.jsx($,{stores:y,selectedMeta:E,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:e,storageKey:F(`${n}+${m}`),showResourcesSwitch:R,showFromUrl:C,enableRunBackground:S,showCategory:b});return f?l.jsx(T,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{Me as default};
@@ -1,4 +1,4 @@
1
- import{r as t,k as x}from"./vendor-react-x2lQvn4m.js";import{j as e,I as u,at as C,W as o}from"./vendor-mui-core-BwwTYUH3.js";import{b as M,Y as f,f as b}from"./vendor-ux-BglKGRhr.js";import{a5 as H}from"./index-1KOtJL2Z.js";import{t as Z}from"./question-mark-circle.svg-YsMacl4Q.js";const g=s=>t.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg",...s},t.createElement("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"}));function k({SessionContext:s,extraItems:n=[],showLocale:r=!0,showHelper:l=!0,showSessionManager:c=!0,sessionManagerProps:i={}}){const{session:d}=t.useContext(s),{locale:p}=t.useContext(M),w=x(),h=()=>{if(w.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:[n.map((a,m)=>t.cloneElement(a,{key:m})),r&&e.jsx(v,{"data-cy":"locale-addon",icon:g,size:23,showText:!1,className:"locale-addon"}),e.jsx(H,{}),l&&e.jsx(u,{onClick:h,children:e.jsx(Z,{})}),c&&e.jsx(j,{locale:p,session:d,size:24,showRole:!0,...i,showManageBlocklet:!1})]})}k.propTypes={SessionContext:o.object.isRequired,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};const j=C(b)`
1
+ import{r as t,k as x}from"./vendor-react-x2lQvn4m.js";import{j as e,I as u,at as C,W as o}from"./vendor-mui-core-BwwTYUH3.js";import{b as M,Y as f,f as b}from"./vendor-ux-BglKGRhr.js";import{a5 as H}from"./index-dIkcxCDN.js";import{t as Z}from"./question-mark-circle.svg-YsMacl4Q.js";const g=s=>t.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg",...s},t.createElement("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"}));function k({SessionContext:s,extraItems:n=[],showLocale:r=!0,showHelper:l=!0,showSessionManager:c=!0,sessionManagerProps:i={}}){const{session:d}=t.useContext(s),{locale:p}=t.useContext(M),w=x(),h=()=>{if(w.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:[n.map((a,m)=>t.cloneElement(a,{key:m})),r&&e.jsx(v,{"data-cy":"locale-addon",icon:g,size:23,showText:!1,className:"locale-addon"}),e.jsx(H,{}),l&&e.jsx(u,{onClick:h,children:e.jsx(Z,{})}),c&&e.jsx(j,{locale:p,session:d,size:24,showRole:!0,...i,showManageBlocklet:!1})]})}k.propTypes={SessionContext:o.object.isRequired,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};const j=C(b)`
2
2
  .user-addon {
3
3
  .user-avatar {
4
4
  width: 28px;
@@ -1,4 +1,4 @@
1
- import{r as P}from"./vendor-react-x2lQvn4m.js";import{j as k,a6 as ce,ak as T,Q as qe,cB as Ne,T as ee,W as F,b6 as Me,a5 as Pe,bC as Fe,aX as ze,at as je,U as Je,b1 as le,z as Be,A as Ue,cC as ke,be as ne,a3 as W,cD as We,am as ge,bd as ye}from"./vendor-mui-core-BwwTYUH3.js";import{O as te,Z as Ve,$ as Se,f as Ke,K as He,b2 as Ge,p as Ze,b3 as Ye,c as Qe,az as be,ax as Re,ay as Ae,M as Z,b4 as Xe}from"./index-1KOtJL2Z.js";import{w as ue,P as et}from"./permission-CkJCud9p.js";import{T as oe,n as G,H,a as Oe,a7 as tt,a8 as rt,B as st,q as K,e as ve,b as nt}from"./vendor-ux-BglKGRhr.js";import{l as Ee}from"./vendor-hooks-uwq5Zgdd.js";import{C as me}from"./confirm-BheJ2Ufd.js";import{f as ie}from"./index-DBs9Ljax.js";import{u as at}from"./useSetState-BWrXo9eH.js";import{u as Ce}from"./session-CRCJ7U0D.js";import{S as U}from"./section-BkD2aamt.js";import{C as it}from"./click-to-copy-DPQ0tcO7.js";import{u as De}from"./team-03A1FYUk.js";import{v as ot,$ as lt}from"./vendor-utils-DQY0X1ND.js";import{v as ct}from"./index-Dl1q-Vpb.js";import{W as ut}from"./did-address-D7SiJUQw.js";import{V as ft}from"./status-D2qmTwnQ.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";import"./omit-pzenKe9G.js";const dt=localStorage.getItem("enableDebug")==="true";function mt({teamDid:$,size:D="small",...L}){const{t:E}=oe(),{api:j}=te(),[w,p]=P.useState(!1),[i,g]=P.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.clearCache({input:{teamDid:$}});H.success(E("blocklet.config.clearCache.success",{count:a.removed?.length||0}))}catch(a){H.error(ie(a))}finally{p(!1),g(null)}},e={title:E("blocklet.config.clearCache.title"),description:E("blocklet.config.clearCache.description"),confirm:E("common.confirm"),cancel:E("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...L,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:D,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,E("blocklet.config.clearCache.action")]}),i&&k.jsx(me,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}function Ie({onChange:$=()=>{},disabled:D=!1,loading:L=!1,inService:E=!1}){const{t:j}=oe(),{api:w,session:p}=Ce(),{blocklet:i}=Ve(),[g,m]=at({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>m({isConnectOpen:!1}),e=()=>{if(Ke.isInProgress(i.status)){H.error(j("blocklet.error.isInProgress"));return}m({confirmDialogOpen:!0})};return k.jsxs(k.Fragment,{children:[k.jsx(U,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(qe,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:D||L,onClick:e,children:[k.jsx(Ne,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),k.jsxs(k.Fragment,{children:[g.isConnectOpen&&k.jsx(Se,{popup:!0,open:g.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:w.get,checkTimeout:5*60*1e3,onSuccess:()=>{$(),E&&p.logout(),f()},extraParams:{appDid:i.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),g.confirmDialogOpen&&k.jsx(me,{title:k.jsx(ee,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:k.jsx(ee,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>m({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>m({confirmDialogOpen:!1})})]})]})}Ie.propTypes={onChange:F.func,disabled:F.bool,loading:F.bool,inService:F.bool};function Te({onCancel:$,onSuccess:D,onError:L=()=>{}}){const{api:E}=P.useContext(He),[j,w]=P.useState(!1),{t:p,locale:i}=oe(),[g,m]=P.useState(""),[f,e]=P.useState(!1),[a,n]=P.useState(0),[r,t]=P.useState(""),{endpoint:l}=De(),[s,o]=P.useState(!1),u=c=>{m(null),w(!0);try{t(c.result),n(_.length-1)}catch(h){const b=ie(h);m(b),L(h)}finally{w(!1)}},d=()=>{e(!0),n(1)},y=()=>{e(!1),n(0)},_=[{body:k.jsxs(T,{children:[k.jsx(ee,{children:p("team.transferApp.transferDialog.tips.progress")}),k.jsx(ee,{sx:{mt:3,mb:2},children:p("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),onCancel:$,onConfirm:d},{cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),body:()=>k.jsx(Se,{action:"transfer-app-owner",open:f,locale:i,checkFn:E.get,onClose:y,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:p("team.transferApp.connectDialog.title"),scan:p("team.transferApp.connectDialog.scan"),confirm:p("team.transferApp.connectDialog.confirm"),success:p("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=Ge({transferId:r.transferId,endpoint:l});return k.jsxs(k.Fragment,{children:[k.jsx(T,{component:Y,dangerouslySetInnerHTML:{__html:p("team.transferApp.transferDialog.createSuccessTip1")}}),k.jsx(T,{component:Y,sx:{mt:2},children:k.jsx(Y,{children:p("team.transferApp.transferDialog.createSuccessTip3")})}),k.jsxs(T,{children:[k.jsx(T,{component:Y,sx:{mt:2},children:k.jsx(Y,{children:p("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Ze(r.expireDate,i)})})}),k.jsx(T,{sx:{my:1},children:k.jsx(it,{children:c})})]}),k.jsx("div",{children:k.jsx(Me,{value:"end",control:k.jsx(Pe,{checked:s,onChange:h=>o(h.target.checked)}),label:p("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:p("common.confirm"),onConfirm:D}],v=_[a];return k.jsxs(Oe,{title:k.jsx(Y,{className:"title",children:p("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:k.jsxs(k.Fragment,{children:[v.cancel&&k.jsx(G,{onClick:v.onCancel,color:"inherit",children:v.cancel}),k.jsxs(G,{onClick:v.onConfirm,color:"error",disabled:j||a===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&k.jsx(ce,{size:16}),v.confirm]})]}),children:[k.jsx(Fe,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!g&&k.jsx(ze,{severity:"error",variant:"icon",children:g})]})}Te.propTypes={onCancel:F.func.isRequired,onSuccess:F.func.isRequired,onError:F.func};const Y=je.div`
1
+ import{r as P}from"./vendor-react-x2lQvn4m.js";import{j as k,a6 as ce,ak as T,Q as qe,cB as Ne,T as ee,W as F,b6 as Me,a5 as Pe,bC as Fe,aX as ze,at as je,U as Je,b1 as le,z as Be,A as Ue,cC as ke,be as ne,a3 as W,cD as We,am as ge,bd as ye}from"./vendor-mui-core-BwwTYUH3.js";import{O as te,Z as Ve,$ as Se,f as Ke,K as He,b2 as Ge,p as Ze,b3 as Ye,c as Qe,az as be,ax as Re,ay as Ae,M as Z,b4 as Xe}from"./index-dIkcxCDN.js";import{w as ue,P as et}from"./permission-B4PsiDVD.js";import{T as oe,n as G,H,a as Oe,a7 as tt,a8 as rt,B as st,q as K,e as ve,b as nt}from"./vendor-ux-BglKGRhr.js";import{l as Ee}from"./vendor-hooks-uwq5Zgdd.js";import{C as me}from"./confirm-B0IPtkVS.js";import{f as ie}from"./index-DBs9Ljax.js";import{u as at}from"./useSetState-BWrXo9eH.js";import{u as Ce}from"./session-DgH_dTEB.js";import{S as U}from"./section-BkD2aamt.js";import{C as it}from"./click-to-copy-DPQ0tcO7.js";import{u as De}from"./team-DA9xMdEQ.js";import{v as ot,$ as lt}from"./vendor-utils-DQY0X1ND.js";import{v as ct}from"./index-Dl1q-Vpb.js";import{W as ut}from"./did-address-D7SiJUQw.js";import{V as ft}from"./status-kBSo0EE3.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";import"./omit-pzenKe9G.js";const dt=localStorage.getItem("enableDebug")==="true";function mt({teamDid:$,size:D="small",...L}){const{t:E}=oe(),{api:j}=te(),[w,p]=P.useState(!1),[i,g]=P.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.clearCache({input:{teamDid:$}});H.success(E("blocklet.config.clearCache.success",{count:a.removed?.length||0}))}catch(a){H.error(ie(a))}finally{p(!1),g(null)}},e={title:E("blocklet.config.clearCache.title"),description:E("blocklet.config.clearCache.description"),confirm:E("common.confirm"),cancel:E("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...L,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:D,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,E("blocklet.config.clearCache.action")]}),i&&k.jsx(me,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}function Ie({onChange:$=()=>{},disabled:D=!1,loading:L=!1,inService:E=!1}){const{t:j}=oe(),{api:w,session:p}=Ce(),{blocklet:i}=Ve(),[g,m]=at({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>m({isConnectOpen:!1}),e=()=>{if(Ke.isInProgress(i.status)){H.error(j("blocklet.error.isInProgress"));return}m({confirmDialogOpen:!0})};return k.jsxs(k.Fragment,{children:[k.jsx(U,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(qe,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:D||L,onClick:e,children:[k.jsx(Ne,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),k.jsxs(k.Fragment,{children:[g.isConnectOpen&&k.jsx(Se,{popup:!0,open:g.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:w.get,checkTimeout:5*60*1e3,onSuccess:()=>{$(),E&&p.logout(),f()},extraParams:{appDid:i.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),g.confirmDialogOpen&&k.jsx(me,{title:k.jsx(ee,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:k.jsx(ee,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>m({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>m({confirmDialogOpen:!1})})]})]})}Ie.propTypes={onChange:F.func,disabled:F.bool,loading:F.bool,inService:F.bool};function Te({onCancel:$,onSuccess:D,onError:L=()=>{}}){const{api:E}=P.useContext(He),[j,w]=P.useState(!1),{t:p,locale:i}=oe(),[g,m]=P.useState(""),[f,e]=P.useState(!1),[a,n]=P.useState(0),[r,t]=P.useState(""),{endpoint:l}=De(),[s,o]=P.useState(!1),u=c=>{m(null),w(!0);try{t(c.result),n(_.length-1)}catch(h){const b=ie(h);m(b),L(h)}finally{w(!1)}},d=()=>{e(!0),n(1)},y=()=>{e(!1),n(0)},_=[{body:k.jsxs(T,{children:[k.jsx(ee,{children:p("team.transferApp.transferDialog.tips.progress")}),k.jsx(ee,{sx:{mt:3,mb:2},children:p("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),onCancel:$,onConfirm:d},{cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),body:()=>k.jsx(Se,{action:"transfer-app-owner",open:f,locale:i,checkFn:E.get,onClose:y,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:p("team.transferApp.connectDialog.title"),scan:p("team.transferApp.connectDialog.scan"),confirm:p("team.transferApp.connectDialog.confirm"),success:p("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=Ge({transferId:r.transferId,endpoint:l});return k.jsxs(k.Fragment,{children:[k.jsx(T,{component:Y,dangerouslySetInnerHTML:{__html:p("team.transferApp.transferDialog.createSuccessTip1")}}),k.jsx(T,{component:Y,sx:{mt:2},children:k.jsx(Y,{children:p("team.transferApp.transferDialog.createSuccessTip3")})}),k.jsxs(T,{children:[k.jsx(T,{component:Y,sx:{mt:2},children:k.jsx(Y,{children:p("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Ze(r.expireDate,i)})})}),k.jsx(T,{sx:{my:1},children:k.jsx(it,{children:c})})]}),k.jsx("div",{children:k.jsx(Me,{value:"end",control:k.jsx(Pe,{checked:s,onChange:h=>o(h.target.checked)}),label:p("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:p("common.confirm"),onConfirm:D}],v=_[a];return k.jsxs(Oe,{title:k.jsx(Y,{className:"title",children:p("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:k.jsxs(k.Fragment,{children:[v.cancel&&k.jsx(G,{onClick:v.onCancel,color:"inherit",children:v.cancel}),k.jsxs(G,{onClick:v.onConfirm,color:"error",disabled:j||a===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&k.jsx(ce,{size:16}),v.confirm]})]}),children:[k.jsx(Fe,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!g&&k.jsx(ze,{severity:"error",variant:"icon",children:g})]})}Te.propTypes={onCancel:F.func.isRequired,onSuccess:F.func.isRequired,onError:F.func};const Y=je.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  &.title {
@@ -1 +1 @@
1
- import{C as E,A as k}from"./vendor-utils-DQY0X1ND.js";import{O as T,Z as j,c as M}from"./index-1KOtJL2Z.js";import{r as e}from"./vendor-react-x2lQvn4m.js";import{T as B}from"./vendor-ux-BglKGRhr.js";import{u as D}from"./use-mobile-DHiqEjn5.js";import{D as H,j as o,ak as w,a6 as I}from"./vendor-mui-core-BwwTYUH3.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";function K(){const{info:x,inService:g}=T(),{blocklet:y}=j(),{locale:u}=B(),p=e.useRef(null),r=H(),[L,R]=e.useState(0),f=D(),[t,S]=e.useState(!0),s=e.useRef(null);let a="";g?a=M.WELLKNOWN_SERVICE_PATH_PREFIX:a=x.routing.adminPath;const c=new URLSearchParams;g?c.set("appUrl",window.blocklet.appUrl):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=k(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);s.current.contentWindow.postMessage({type:"SEND_THEME",payload:n},window.location.origin)}},[r]),d=e.useCallback(()=>{s.current&&s.current.contentWindow.postMessage({type:"SEND_LOCALE",payload:u},window.location.origin)},[u]);return e.useEffect(()=>{const n=i=>{i.origin===window.location.origin&&(i.data.type==="REQUEST_THEME"&&l(),i.data.type==="THEME_BUILDER_LOADED"&&(d(),S(!1)))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[l,d]),e.useEffect(()=>{t===!1&&l()},[r,t,l]),e.useEffect(()=>{t===!1&&d()},[u,t,d]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),i=document.querySelector(".dashboard-content"),m=()=>{if(p.current){const{height:b}=n.getBoundingClientRect(),{top:C}=i.getBoundingClientRect(),{top:_}=p.current.getBoundingClientRect();let h=b-_+C-(f?108:164);f&&(h=Math.min(h,600)),R(h)}};return m(),window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[f,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:p}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(I,{})}),o.jsx("iframe",{title:"Theme Builder",ref:s,src:`${E(window.location.origin,a,"/hosted/theme-builder/")}?${c.toString()}`,style:{border:0,width:"100%",height:`${L}px`,display:t?"none":"block"}})]})}export{K as default};
1
+ import{C as E,A as k}from"./vendor-utils-DQY0X1ND.js";import{O as T,Z as j,c as M}from"./index-dIkcxCDN.js";import{r as e}from"./vendor-react-x2lQvn4m.js";import{T as B}from"./vendor-ux-BglKGRhr.js";import{u as D}from"./use-mobile-DHiqEjn5.js";import{D as H,j as o,ak as w,a6 as I}from"./vendor-mui-core-BwwTYUH3.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";function K(){const{info:x,inService:g}=T(),{blocklet:y}=j(),{locale:u}=B(),p=e.useRef(null),r=H(),[L,R]=e.useState(0),f=D(),[t,S]=e.useState(!0),s=e.useRef(null);let a="";g?a=M.WELLKNOWN_SERVICE_PATH_PREFIX:a=x.routing.adminPath;const c=new URLSearchParams;g?c.set("appUrl",window.blocklet.appUrl):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=k(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);s.current.contentWindow.postMessage({type:"SEND_THEME",payload:n},window.location.origin)}},[r]),d=e.useCallback(()=>{s.current&&s.current.contentWindow.postMessage({type:"SEND_LOCALE",payload:u},window.location.origin)},[u]);return e.useEffect(()=>{const n=i=>{i.origin===window.location.origin&&(i.data.type==="REQUEST_THEME"&&l(),i.data.type==="THEME_BUILDER_LOADED"&&(d(),S(!1)))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[l,d]),e.useEffect(()=>{t===!1&&l()},[r,t,l]),e.useEffect(()=>{t===!1&&d()},[u,t,d]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),i=document.querySelector(".dashboard-content"),m=()=>{if(p.current){const{height:b}=n.getBoundingClientRect(),{top:C}=i.getBoundingClientRect(),{top:_}=p.current.getBoundingClientRect();let h=b-_+C-(f?108:164);f&&(h=Math.min(h,600)),R(h)}};return m(),window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[f,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:p}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(I,{})}),o.jsx("iframe",{title:"Theme Builder",ref:s,src:`${E(window.location.origin,a,"/hosted/theme-builder/")}?${c.toString()}`,style:{border:0,width:"100%",height:`${L}px`,display:t?"none":"block"}})]})}export{K as default};
@@ -1 +1 @@
1
- import{cu as o,cv as l,cw as r,cx as n}from"./index-1KOtJL2Z.js";import{r as e}from"./vendor-react-x2lQvn4m.js";const i=Object.freeze(Object.defineProperty({__proto__:null,default:o},Symbol.toStringTag,{value:"Module"})),u=Object.freeze(Object.defineProperty({__proto__:null,default:l},Symbol.toStringTag,{value:"Module"})),d=Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"})),s=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"})),f=t=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0608 6.75011L11.5304 7.28044L8.70722 10.1036C8.31669 10.4942 7.68353 10.4942 7.293 10.1036L4.46978 7.28044L3.93945 6.75011L5.00011 5.68945L5.53044 6.21978L8.00011 8.68945L10.4698 6.21978L11.0001 5.68945L12.0608 6.75011Z",fill:"currentColor"}));export{d as E,u as L,i as P,s as T,f as l};
1
+ import{cu as o,cv as l,cw as r,cx as n}from"./index-dIkcxCDN.js";import{r as e}from"./vendor-react-x2lQvn4m.js";const i=Object.freeze(Object.defineProperty({__proto__:null,default:o},Symbol.toStringTag,{value:"Module"})),u=Object.freeze(Object.defineProperty({__proto__:null,default:l},Symbol.toStringTag,{value:"Module"})),d=Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"})),s=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"})),f=t=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0608 6.75011L11.5304 7.28044L8.70722 10.1036C8.31669 10.4942 7.68353 10.4942 7.293 10.1036L4.46978 7.28044L3.93945 6.75011L5.00011 5.68945L5.53044 6.21978L8.00011 8.68945L10.4698 6.21978L11.0001 5.68945L12.0608 6.75011Z",fill:"currentColor"}));export{d as E,u as L,i as P,s as T,f as l};
@@ -1,4 +1,4 @@
1
- import{H as N,T as E,z as U,S as R,M as H,C as F}from"./vendor-ux-BglKGRhr.js";import{O as V,c as T}from"./index-1KOtJL2Z.js";import{j as e,D as W,ak as u,b4 as Z,T as y,am as G,bd as K,I as $,bV as X,bW as q,a6 as J,y as Q,x as Y,bb as ee,M as te,bX as oe,at as re}from"./vendor-mui-core-BwwTYUH3.js";import{p as ae}from"./util-rixYG6Oq.js";import{r as s,L as se}from"./vendor-react-x2lQvn4m.js";import{u as ne}from"./useLocalStorage-CVZc_3z4.js";import{M as _}from"./index-BEyKlMs9.js";import{d as ie,e as z}from"./vendor-utils-DQY0X1ND.js";import{S as I}from"./shorten-label-BG5illgA.js";import{r as O}from"./index-C5pKXOxF.js";import{u as le}from"./team-03A1FYUk.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./base32-CkijRzDY.js";import"./session-CRCJ7U0D.js";const B=s.createContext({}),{Provider:ce,Consumer:Oe}=B;function de(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function ue({children:t,scope:l="",categories:o=[],showScope:n,scopeFormatter:p}){const{api:g,info:L}=V(),[m,h]=s.useState([]),[c,x]=s.useState({total:0,pageSize:de(),pageCount:0,page:1}),[f,d]=s.useState(!1),[v,r]=s.useState(""),[i,j]=ne(`audit-log-category-${l}`,"all"),w=[{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(b=>o.length?b.value==="all"||o.includes(b.value):!0),S=async({page:b=1,pageSize:a=20,silent:k=!0}={})=>{if(!f){k||d(!0);try{const C=await g.getAuditLogs({input:{paging:{page:b,pageSize:a},category:i==="all"?"":i,scope:l,actionOrContent:v}});n&&(C.list||[]).forEach(A=>{A.scope!==L.did&&(A.link=`/blocklets/${A.scope}/components`)}),h(C.list),x(C.paging),d(!1)}catch(C){N.error(C.message),d(!1)}}};s.useEffect(()=>{localStorage.setItem("audit-log-page-size",c.pageSize)},[c.pageSize]),s.useEffect(()=>{S({page:1,pageSize:c.pageSize,silent:!1})},[]),s.useEffect(()=>{S({page:1,pageSize:c.pageSize,silent:!1})},[i,v]);const P={loading:f,fetch:S,filter:{category:i,scope:l},categories:w,setCategory:j,data:m,paging:c,setPaging:x,showScope:n,scopeFormatter:p,actionOrContent:v,setActionOrContent:r};return e.jsx(ce,{value:{auditLogs:P},children:t})}function D(){const{auditLogs:t}=s.useContext(B);return t}function pe(t){if(!t)return[];const l=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let n;for(;(n=l.exec(t))!==null;)o.push({text:n[1],url:n[2]});return o}const ge=`
1
+ import{H as N,T as E,z as U,S as R,M as H,C as F}from"./vendor-ux-BglKGRhr.js";import{O as V,c as T}from"./index-dIkcxCDN.js";import{j as e,D as W,ak as u,b4 as Z,T as y,am as G,bd as K,I as $,bV as X,bW as q,a6 as J,y as Q,x as Y,bb as ee,M as te,bX as oe,at as re}from"./vendor-mui-core-BwwTYUH3.js";import{p as ae}from"./util-Cn9ZyU8l.js";import{r as s,L as se}from"./vendor-react-x2lQvn4m.js";import{u as ne}from"./useLocalStorage-CVZc_3z4.js";import{M as _}from"./index-BEyKlMs9.js";import{d as ie,e as z}from"./vendor-utils-DQY0X1ND.js";import{S as I}from"./shorten-label-BG5illgA.js";import{r as O}from"./index-C5pKXOxF.js";import{u as le}from"./team-DA9xMdEQ.js";import"./vendor-hooks-uwq5Zgdd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./base32-CkijRzDY.js";import"./session-DgH_dTEB.js";const B=s.createContext({}),{Provider:ce,Consumer:Oe}=B;function de(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function ue({children:t,scope:l="",categories:o=[],showScope:n,scopeFormatter:p}){const{api:g,info:L}=V(),[m,h]=s.useState([]),[c,x]=s.useState({total:0,pageSize:de(),pageCount:0,page:1}),[f,d]=s.useState(!1),[v,r]=s.useState(""),[i,j]=ne(`audit-log-category-${l}`,"all"),w=[{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(b=>o.length?b.value==="all"||o.includes(b.value):!0),S=async({page:b=1,pageSize:a=20,silent:k=!0}={})=>{if(!f){k||d(!0);try{const C=await g.getAuditLogs({input:{paging:{page:b,pageSize:a},category:i==="all"?"":i,scope:l,actionOrContent:v}});n&&(C.list||[]).forEach(A=>{A.scope!==L.did&&(A.link=`/blocklets/${A.scope}/components`)}),h(C.list),x(C.paging),d(!1)}catch(C){N.error(C.message),d(!1)}}};s.useEffect(()=>{localStorage.setItem("audit-log-page-size",c.pageSize)},[c.pageSize]),s.useEffect(()=>{S({page:1,pageSize:c.pageSize,silent:!1})},[]),s.useEffect(()=>{S({page:1,pageSize:c.pageSize,silent:!1})},[i,v]);const P={loading:f,fetch:S,filter:{category:i,scope:l},categories:w,setCategory:j,data:m,paging:c,setPaging:x,showScope:n,scopeFormatter:p,actionOrContent:v,setActionOrContent:r};return e.jsx(ce,{value:{auditLogs:P},children:t})}function D(){const{auditLogs:t}=s.useContext(B);return t}function pe(t){if(!t)return[];const l=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let n;for(;(n=l.exec(t))!==null;)o.push({text:n[1],url:n[2]});return o}const ge=`
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)"/>
@@ -1 +1 @@
1
- import{J as A,j as e,ak as t,a6 as E,Q as l,b3 as W,T as o,b4 as z,am as I,b5 as R,b6 as L,a5 as T,a3 as F,a$ as f,b1 as O}from"./vendor-mui-core-BwwTYUH3.js";import{r as x}from"./vendor-react-x2lQvn4m.js";import{l as D}from"./vendor-hooks-uwq5Zgdd.js";import{C as b}from"./vendor-utils-DQY0X1ND.js";import{a as B,c as u,t as H,H as U,G as K,e as M}from"./index-1KOtJL2Z.js";import{K as p}from"./landing-page-BEJgKdih.js";import{T as Q,F as y}from"./vendor-ux-BglKGRhr.js";import{W as $}from"./did-address-D7SiJUQw.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=B(),{t:c}=Q(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await M.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(E,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(H,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:a}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(U,{children:e.jsx("title",{children:c("oauth.authorize")})}),e.jsx(K,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(o,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:a.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:a.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:a.fullName})}),e.jsx(t,{className:"did",children:e.jsx($,{compact:!0,responsive:!1,did:a.did,showQrcode:!v})})]})]}),e.jsxs(o,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(R,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(T,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(a.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(o,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(F,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(o,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(O,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(o,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(o,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
1
+ import{J as A,j as e,ak as t,a6 as E,Q as l,b3 as W,T as o,b4 as z,am as I,b5 as R,b6 as L,a5 as T,a3 as F,a$ as f,b1 as O}from"./vendor-mui-core-BwwTYUH3.js";import{r as x}from"./vendor-react-x2lQvn4m.js";import{l as D}from"./vendor-hooks-uwq5Zgdd.js";import{C as b}from"./vendor-utils-DQY0X1ND.js";import{a as B,c as u,t as H,H as U,G as K,e as M}from"./index-dIkcxCDN.js";import{K as p}from"./landing-page-DrswynDN.js";import{T as Q,F as y}from"./vendor-ux-BglKGRhr.js";import{W as $}from"./did-address-D7SiJUQw.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=B(),{t:c}=Q(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await M.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(E,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(H,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:a}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(U,{children:e.jsx("title",{children:c("oauth.authorize")})}),e.jsx(K,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(o,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:a.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:a.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:a.fullName})}),e.jsx(t,{className:"did",children:e.jsx($,{compact:!0,responsive:!1,did:a.did,showQrcode:!v})})]})]}),e.jsxs(o,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(R,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(T,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(a.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(o,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(F,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(o,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(O,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(o,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(o,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BbEkQqX9.js","assets/index-1KOtJL2Z.js","assets/vendor-mui-core-BwwTYUH3.js","assets/vendor-react-x2lQvn4m.js","assets/vendor-ux-BglKGRhr.js","assets/vendor-utils-DQY0X1ND.js","assets/vendor-hooks-uwq5Zgdd.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-BEuhHuNQ.js","assets/index-DrVXX4fX.css","assets/index-MGxe3V9B.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
- import{T as fe,_ as be}from"./vendor-ux-BglKGRhr.js";import{j as e,b1 as U,T as E,ak as x,b4 as je,am as Y,I as A,bR as J,Y as se,at as ve,bB as ye,$ as we,bv as Ce,A as Z,aJ as Se,bS as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-BwwTYUH3.js";import{c as D}from"./index-1KOtJL2Z.js";import{E as N}from"./empty-spinner-DoD2SObf.js";import{k as Pe,u as Re}from"./vendor-hooks-uwq5Zgdd.js";import{r as m}from"./vendor-react-x2lQvn4m.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-ByowwdW2.js";import{S as F}from"./studio-ZCHXWZLi.js";import"./vendor-utils-DQY0X1ND.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./raf-schd.esm-BZ5FB5HD.js";import"./index-DmO-2vsC.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=P,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-BbEkQqX9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Xe(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(_)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx(U,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},B=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},H=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Ve}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:B,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,L)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:L.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:L.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,V)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:V.isDragging?"scale(1.05)":"none",boxShadow:V.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(J,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs($,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(Q,{onDragEnd:B,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,L)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:L.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:L.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,V)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:V.isDragging?"scale(1.05)":"none",boxShadow:V.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>H(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>H(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(J,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Le,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function $({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(U,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}$.propTypes={title:k.string.isRequired,rules:k.array.isRequired,tips:k.array.isRequired,children:k.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(ke,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:k.func.isRequired,t:k.func.isRequired,defaultUrl:k.string,videos:k.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BcuyH8tS.js","assets/index-dIkcxCDN.js","assets/vendor-mui-core-BwwTYUH3.js","assets/vendor-react-x2lQvn4m.js","assets/vendor-ux-BglKGRhr.js","assets/vendor-utils-DQY0X1ND.js","assets/vendor-hooks-uwq5Zgdd.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-BEuhHuNQ.js","assets/index-DrVXX4fX.css","assets/index-MGxe3V9B.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
+ import{T as fe,_ as be}from"./vendor-ux-BglKGRhr.js";import{j as e,b1 as U,T as E,ak as x,b4 as je,am as Y,I as A,bR as J,Y as se,at as ve,bB as ye,$ as we,bv as Ce,A as Z,aJ as Se,bS as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-BwwTYUH3.js";import{c as D}from"./index-dIkcxCDN.js";import{E as N}from"./empty-spinner-DoD2SObf.js";import{k as Pe,u as Re}from"./vendor-hooks-uwq5Zgdd.js";import{r as m}from"./vendor-react-x2lQvn4m.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-ByowwdW2.js";import{S as F}from"./studio-DRi8O4nl.js";import"./vendor-utils-DQY0X1ND.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./raf-schd.esm-BZ5FB5HD.js";import"./index-BEq2q2jr.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=P,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-BcuyH8tS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Xe(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(_)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx(U,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},B=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},H=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Ve}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:B,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,L)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:L.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:L.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,V)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:V.isDragging?"scale(1.05)":"none",boxShadow:V.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(J,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs($,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(Q,{onDragEnd:B,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,L)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:L.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:L.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,V)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:V.isDragging?"scale(1.05)":"none",boxShadow:V.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>H(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>H(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(J,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Le,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function $({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(U,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}$.propTypes={title:k.string.isRequired,rules:k.array.isRequired,tips:k.array.isRequired,children:k.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(ke,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:k.func.isRequired,t:k.func.isRequired,defaultUrl:k.string,videos:k.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
3
3
  margin-top: 24px;
4
4
  .image-wrapper {
5
5
  margin-bottom: 16px;
@@ -1,4 +1,4 @@
1
- import{a as Q,r as x}from"./vendor-react-x2lQvn4m.js";import{j as e,I as D,bg as j1,Q as T,c0 as y1,O as a1,P as Z1,ai as w1,o as b1,M as k1,W as c,z as l1,ak as i,a6 as i1,bH as c1,aj as Y,b$ as L1,c1 as M1,at as G,U as R1,F as E1,c2 as J,b7 as S1,b4 as _1,ar as C1,T as C,a3 as V,b1 as O1}from"./vendor-mui-core-BwwTYUH3.js";import{b as t1,G as B1,F as P1,e as H1,H as A1}from"./vendor-ux-BglKGRhr.js";import{l as I1}from"./vendor-hooks-uwq5Zgdd.js";import{O as s1,ax as V1,ay as z1,M as L}from"./index-1KOtJL2Z.js";import{s as F1}from"./sanitize-CCb_t50W.js";import{F as r1,R as o1,L as H}from"./logo-uploader-Ds-ORNyZ.js";import{e as T1}from"./edit.svg-D-deOViK.js";import{w as h1}from"./permission-CkJCud9p.js";import{a as N1}from"./team-03A1FYUk.js";import{S as z}from"./section-BkD2aamt.js";import"./vendor-utils-DQY0X1ND.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./omit-pzenKe9G.js";import"./index-MGxe3V9B.js";import"./session-CRCJ7U0D.js";function n1({triggers:a=[],onEnterEdit:s,disabled:p}){const h=Q.useRef(null),[M,m]=Q.useState(!1),u=f=>{m(!1),f()},l=()=>{m(f=>!f)},o=f=>{h.current&&h.current.contains(f.target)||m(!1)};return a.length===0?e.jsx(D,{"data-cy":"schema-form-item-edit",onClick:s,disabled:p,size:"large",children:e.jsx(T1,{})}):e.jsxs(e.Fragment,{children:[e.jsx(j1,{variant:"outlined",ref:h,"aria-label":"split button",children:e.jsx(T,{size:"large","aria-controls":M?"split-button-menu":void 0,"aria-expanded":M?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:l,children:e.jsx(y1,{})})}),e.jsx(a1,{sx:{zIndex:9999},open:M,anchorEl:h.current,role:void 0,placement:"bottom-end",children:e.jsx(Z1,{children:e.jsx(w1,{onClickAway:o,children:e.jsx(b1,{id:"split-button-menu",autoFocusItem:!0,children:a.map(f=>e.jsx(k1,{onClick:()=>u(f.handler),children:f.title},f.key))})})})})]})}n1.propTypes={triggers:c.arrayOf(c.shape({key:c.string.isRequired,title:c.string.isRequired,handler:c.func.isRequired})),onEnterEdit:c.func.isRequired,disabled:c.bool.isRequired};const e1=(a,s,p)=>a===null&&s&&p?"******":a?s?"******":a:"",U1=L1`
1
+ import{a as Q,r as x}from"./vendor-react-x2lQvn4m.js";import{j as e,I as D,bg as j1,Q as T,c0 as y1,O as a1,P as Z1,ai as w1,o as b1,M as k1,W as c,z as l1,ak as i,a6 as i1,bH as c1,aj as Y,b$ as L1,c1 as M1,at as G,U as R1,F as E1,c2 as J,b7 as S1,b4 as _1,ar as C1,T as C,a3 as V,b1 as O1}from"./vendor-mui-core-BwwTYUH3.js";import{b as t1,G as B1,F as P1,e as H1,H as A1}from"./vendor-ux-BglKGRhr.js";import{l as I1}from"./vendor-hooks-uwq5Zgdd.js";import{O as s1,ax as V1,ay as z1,M as L}from"./index-dIkcxCDN.js";import{s as F1}from"./sanitize-CCb_t50W.js";import{F as r1,R as o1,L as H}from"./logo-uploader-Cct_Tgp9.js";import{e as T1}from"./edit.svg-D-deOViK.js";import{w as h1}from"./permission-B4PsiDVD.js";import{a as N1}from"./team-DA9xMdEQ.js";import{S as z}from"./section-BkD2aamt.js";import"./vendor-utils-DQY0X1ND.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./omit-pzenKe9G.js";import"./index-MGxe3V9B.js";import"./session-DgH_dTEB.js";function n1({triggers:a=[],onEnterEdit:s,disabled:p}){const h=Q.useRef(null),[M,m]=Q.useState(!1),u=f=>{m(!1),f()},l=()=>{m(f=>!f)},o=f=>{h.current&&h.current.contains(f.target)||m(!1)};return a.length===0?e.jsx(D,{"data-cy":"schema-form-item-edit",onClick:s,disabled:p,size:"large",children:e.jsx(T1,{})}):e.jsxs(e.Fragment,{children:[e.jsx(j1,{variant:"outlined",ref:h,"aria-label":"split button",children:e.jsx(T,{size:"large","aria-controls":M?"split-button-menu":void 0,"aria-expanded":M?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:l,children:e.jsx(y1,{})})}),e.jsx(a1,{sx:{zIndex:9999},open:M,anchorEl:h.current,role:void 0,placement:"bottom-end",children:e.jsx(Z1,{children:e.jsx(w1,{onClickAway:o,children:e.jsx(b1,{id:"split-button-menu",autoFocusItem:!0,children:a.map(f=>e.jsx(k1,{onClick:()=>u(f.handler),children:f.title},f.key))})})})})]})}n1.propTypes={triggers:c.arrayOf(c.shape({key:c.string.isRequired,title:c.string.isRequired,handler:c.func.isRequired})),onEnterEdit:c.func.isRequired,disabled:c.bool.isRequired};const e1=(a,s,p)=>a===null&&s&&p?"******":a?s?"******":a:"",U1=L1`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -1 +1 @@
1
- import{j as u,b4 as x,W as e}from"./vendor-mui-core-BwwTYUH3.js";import{$}from"./vendor-ux-BglKGRhr.js";import{C as m}from"./vendor-utils-DQY0X1ND.js";import{O as l,a9 as v,aa as j,c as y,ab as E,ac as P}from"./index-1KOtJL2Z.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,n=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${n?"~":""}`;let a=s?`${m(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:m(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)a=`${m(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;a=`${m(g,`/blocklet/logo-bundle${p.map(c=>`/${c.meta.did}`).join("")}`)}${r}`}return{logoUrl:a,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...n}){const r=l(),{logoUrl:a,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=n,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let c=u.jsx("img",{src:a,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(c=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...n,children:c})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
1
+ import{j as u,b4 as x,W as e}from"./vendor-mui-core-BwwTYUH3.js";import{$}from"./vendor-ux-BglKGRhr.js";import{C as m}from"./vendor-utils-DQY0X1ND.js";import{O as l,a9 as v,aa as j,c as y,ab as E,ac as P}from"./index-dIkcxCDN.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,n=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${n?"~":""}`;let a=s?`${m(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:m(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)a=`${m(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;a=`${m(g,`/blocklet/logo-bundle${p.map(c=>`/${c.meta.did}`).join("")}`)}${r}`}return{logoUrl:a,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...n}){const r=l(),{logoUrl:a,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=n,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let c=u.jsx("img",{src:a,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(c=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...n,children:c})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
@@ -1,4 +1,4 @@
1
- import{at as E,j as e,ak as m,W as V}from"./vendor-mui-core-BwwTYUH3.js";import{_ as J,m as ne,aj as H,ak as oe,N as ae,al as O,c as ie,e as le,h as ce,am as ue,an as me}from"./index-1KOtJL2Z.js";import{r as u}from"./vendor-react-x2lQvn4m.js";import{J as de,C as Q}from"./vendor-utils-DQY0X1ND.js";import{b as pe,a as L}from"./vendor-hooks-uwq5Zgdd.js";import{u as he}from"./launch-result-message-BlpIIvzr.js";import{T as fe,o as ge,H as X}from"./vendor-ux-BglKGRhr.js";import{g as we}from"./get-safe-url-OoUcjrQf.js";import{g as xe,a as be}from"./setup-d7D4B5vR.js";import{S as q}from"./button-CWzJXH1i.js";import{S as ke}from"./layout-BaT-7chZ.js";import{p as ye,P as Ue,S as Se}from"./starting-progress-BvCdculj.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";import"./config-space-BR2sk-vG.js";import"./spaces-Dd-MKcUF.js";import"./api-CpymM8cn.js";import"./addon-BeC_aHOu.js";import"./question-mark-circle.svg-YsMacl4Q.js";import"./use-server-logo-BBlO0k2-.js";import"./server-logo-notext.svg-BqCXmsOm.js";import"./use-mobile-DHiqEjn5.js";import"./content-layout-Ctpah7wH.js";const ve=E(he)`
1
+ import{at as E,j as e,ak as m,W as V}from"./vendor-mui-core-BwwTYUH3.js";import{_ as J,m as ne,aj as H,ak as oe,N as ae,al as O,c as ie,e as le,h as ce,am as ue,an as me}from"./index-dIkcxCDN.js";import{r as u}from"./vendor-react-x2lQvn4m.js";import{J as de,C as Q}from"./vendor-utils-DQY0X1ND.js";import{b as pe,a as L}from"./vendor-hooks-uwq5Zgdd.js";import{u as he}from"./launch-result-message-BlpIIvzr.js";import{T as fe,o as ge,H as X}from"./vendor-ux-BglKGRhr.js";import{g as we}from"./get-safe-url-Cch2GZCp.js";import{g as xe,a as be}from"./setup-9fDp38sd.js";import{S as q}from"./button-CWzJXH1i.js";import{S as ke}from"./layout-u6VjgU9W.js";import{p as ye,P as Ue,S as Se}from"./starting-progress-BvCdculj.js";import"./vendor-arcblock-BEuhHuNQ.js";import"./lottie-web-4koyQiv_.js";import"./config-space-B6WEaHVR.js";import"./spaces-CISW823t.js";import"./api-CpymM8cn.js";import"./addon-DZMRJstX.js";import"./question-mark-circle.svg-YsMacl4Q.js";import"./use-server-logo-BBlO0k2-.js";import"./server-logo-notext.svg-BqCXmsOm.js";import"./use-mobile-DHiqEjn5.js";import"./content-layout-Ctpah7wH.js";const ve=E(he)`
2
2
  && .result-footer {
3
3
  height: 120px;
4
4
  > div {