@abtnode/blocklet-services 1.17.8-beta-20260108-021819-e099f0ca → 1.17.8-beta-20260108-224855-28496abb

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 (130) hide show
  1. package/api/util/blocklet-utils.js +9 -4
  2. package/dist/assets/{Google-JbLVL0lz.js → Google-BI3aC5vK.js} +1 -1
  3. package/dist/assets/{access-control-DMsY0Jfu.js → access-control-BL-PuDiR.js} +1 -1
  4. package/dist/assets/{add-component-core-DXBsHpN1.js → add-component-core-BzMN094F.js} +1 -1
  5. package/dist/assets/{add-resource-B1owMSeP.js → add-resource-BRF-rYME.js} +1 -1
  6. package/dist/assets/{addon-B42_QFF5.js → addon-yDIBSjIk.js} +1 -1
  7. package/dist/assets/{advanced-BnFynWN7.js → advanced-DEE0XFtQ.js} +1 -1
  8. package/dist/assets/{aigne-Qq2FBVAW.js → aigne-9evgyH7b.js} +1 -1
  9. package/dist/assets/{appearance-Dnc6HNzY.js → appearance-C8B414U2.js} +1 -1
  10. package/dist/assets/{audit-logs-Cfw8JmA4.js → audit-logs-qNutRhHx.js} +1 -1
  11. package/dist/assets/{authorize-B_1efpwx.js → authorize-CZSHuYdu.js} +1 -1
  12. package/dist/assets/{base32-r3F0yIbl.js → base32-z3esjJBn.js} +1 -1
  13. package/dist/assets/{bind-account-Cw-tBmC3.js → bind-account-QxLU_sxt.js} +1 -1
  14. package/dist/assets/{branding-BxEmV2m2.js → branding-Bk26INk9.js} +1 -1
  15. package/dist/assets/{branding-CBavw5s2.js → branding-_XszRU-Z.js} +1 -1
  16. package/dist/assets/{branding-CbYOEW_s.js → branding-tR0gcoY_.js} +1 -1
  17. package/dist/assets/{bundle-avatar-1zs0l21j.js → bundle-avatar-2AQWR0ld.js} +1 -1
  18. package/dist/assets/{complete-CIQgRJri.js → complete-CEvsz8uU.js} +1 -1
  19. package/dist/assets/{component-qZAbczHw.js → component-BrZ1DWiw.js} +2 -2
  20. package/dist/assets/{config-btuzRTop.js → config-6tpm84_l.js} +1 -1
  21. package/dist/assets/{config-BaKRlJau.js → config-CwlqBQNt.js} +1 -1
  22. package/dist/assets/config-cdtQwn5t.js +53 -0
  23. package/dist/assets/{config-navigation-BNsZpUQd.js → config-navigation-CZ9V7otK.js} +2 -2
  24. package/dist/assets/{config-space-BZQrckxG.js → config-space-CZRqkXsR.js} +1 -1
  25. package/dist/assets/{confirm-D6AvlbAp.js → confirm-Ch-CAgUO.js} +1 -1
  26. package/dist/assets/{connect-_I5q1wXN.js → connect-BNkv99fz.js} +1 -1
  27. package/dist/assets/{connect-Dv4BPfET.js → connect-CadBIZOq.js} +1 -1
  28. package/dist/assets/{connect-BC85oS0g.js → connect-i7rkK26L.js} +1 -1
  29. package/dist/assets/{connect-to-CVH3cw77.js → connect-to-lX3lujSp.js} +1 -1
  30. package/dist/assets/{dashboard-BQgUp8NI.js → dashboard-CmJOnF0g.js} +2 -2
  31. package/dist/assets/{delete-confirm-BLy-Oo1o.js → delete-confirm-DiU5PO2T.js} +1 -1
  32. package/dist/assets/{domain-BqtauLm5.js → domain-DHqSA0zl.js} +1 -1
  33. package/dist/assets/{domain-action-card-nuzd77mn.js → domain-action-card-BsNaII7k.js} +1 -1
  34. package/dist/assets/{domains-Cg8723ho.js → domains-BQ_Of9Oo.js} +1 -1
  35. package/dist/assets/{email-CCNEyVGq.js → email-DXdzQLls.js} +1 -1
  36. package/dist/assets/engine-D18zeIE7.js +1 -0
  37. package/dist/assets/{exchange-passport-DR-pKNHM.js → exchange-passport-NOgYhNpm.js} +1 -1
  38. package/dist/assets/{form-Bkig0Zr5.js → form-DhecYoSJ.js} +1 -1
  39. package/dist/assets/{fuel-tC2bCgpP.js → fuel-DgzL5KSX.js} +1 -1
  40. package/dist/assets/{gen-access-key-BbtCn0wJ.js → gen-access-key-BxnyhhCR.js} +1 -1
  41. package/dist/assets/{gen-simple-access-key-DbKaLz9m.js → gen-simple-access-key-BJI-4yOF.js} +1 -1
  42. package/dist/assets/{get-safe-url-DxqVk96E.js → get-safe-url-BVTaUfvO.js} +1 -1
  43. package/dist/assets/{home-BdXWvJM-.js → home-Bibhtg_U.js} +1 -1
  44. package/dist/assets/{iframe-BHP6CYbe.js → iframe-CqiUrjUO.js} +1 -1
  45. package/dist/assets/{index-DixUQBnm.js → index-0ZSFNH-D.js} +1 -1
  46. package/dist/assets/{index-C96Fw4Lj.js → index-BhpNA6ar.js} +1 -1
  47. package/dist/assets/{index-D3L_FG1K.js → index-BszSKE9L.js} +1 -1
  48. package/dist/assets/{index-BbSDwNE6.js → index-CHkWO9t3.js} +1 -1
  49. package/dist/assets/{index-BPZITdMW.js → index-Cdaohlhu.js} +1 -1
  50. package/dist/assets/{index-DVrxzIzr.js → index-CdsI3g5U.js} +1 -1
  51. package/dist/assets/index-CsYL8tps.js +1 -0
  52. package/dist/assets/{index-CNGNZ6kv.js → index-D88DUiSg.js} +1 -1
  53. package/dist/assets/{index-B0O4cfgn.js → index-D8NN8LDz.js} +1 -1
  54. package/dist/assets/{index-BEfIUbZC.js → index-DI4CWTXR.js} +62 -62
  55. package/dist/assets/{index-BvB9yPsA.js → index-DUnMyyWn.js} +3 -3
  56. package/dist/assets/{index-DUL9RfTo.js → index-D_ckidZn.js} +1 -1
  57. package/dist/assets/{index-5IYIk-ZG.js → index-DlifV2p1.js} +1 -1
  58. package/dist/assets/{index-BGo7DXlf.js → index-DzdHYw6g.js} +1 -1
  59. package/dist/assets/{index-B7hLDto7.js → index-Ge2WhAk1.js} +1 -1
  60. package/dist/assets/{index-BoLm67SH.js → index-POuATgdm.js} +1 -1
  61. package/dist/assets/index-TBM4hzrY.js +81 -0
  62. package/dist/assets/{index-BasnkqHA.js → index-WjASWJcO.js} +1 -1
  63. package/dist/assets/{index-Cvt4JvUl.js → index-fC-FqmP3.js} +1 -1
  64. package/dist/assets/{index-yvRJAzQn.js → index-gohmHhDq.js} +1 -1
  65. package/dist/assets/{index-Ly6A31IO.js → index-hBDzzv6I.js} +1 -1
  66. package/dist/assets/{index-dC2vB2_g.js → index-iX-pnOjy.js} +1 -1
  67. package/dist/assets/{index-BrDWLIA2.js → index-jILCQaR3.js} +1 -1
  68. package/dist/assets/{index-D320ZZ3W.js → index-m_xRKGyG.js} +1 -1
  69. package/dist/assets/{index-Bv2O-NCZ.js → index-mt_AKU_F.js} +2 -2
  70. package/dist/assets/{index-DTdf57JC.js → index-u9tqiWy4.js} +1 -1
  71. package/dist/assets/{index-BHnD9G0G.js → index-uexcv8C-.js} +1 -1
  72. package/dist/assets/{info-outline-rounded-YiCh4oGg.js → info-outline-rounded-BLwoUxyI.js} +1 -1
  73. package/dist/assets/{invitation-CnuNtRnn.js → invitation-DSs7YT3_.js} +1 -1
  74. package/dist/assets/{invitations-D_3NLIPO.js → invitations-DK7oD-E6.js} +1 -1
  75. package/dist/assets/{invite-CUVHQCSI.js → invite-CdWfDz--.js} +1 -1
  76. package/dist/assets/{isURL-vNa-ZfGd.js → isURL-DMMDDAKA.js} +1 -1
  77. package/dist/assets/{issue-passport-Do2LhI-f.js → issue-passport-yIqheTA0.js} +1 -1
  78. package/dist/assets/{item-BabsiwzU.js → item-BV3WfK17.js} +1 -1
  79. package/dist/assets/{landing-page-B5QvkHHO.js → landing-page-BDAr8Hmo.js} +1 -1
  80. package/dist/assets/{layout-DRVZ4L0D.js → layout-DzZv-Jny.js} +1 -1
  81. package/dist/assets/{list-B22ZyQqz.js → list-B6eMSw29.js} +1 -1
  82. package/dist/assets/{list-BbHzj-7w.js → list-BWd3aUjb.js} +1 -1
  83. package/dist/assets/{localization-BFHoFo4B.js → localization-oLJXrcTA.js} +1 -1
  84. package/dist/assets/{log-BigiLZw2.js → log-BskdQbRf.js} +1 -1
  85. package/dist/assets/{login-DeBY1fPe.js → login-CfL0Uf6Y.js} +1 -1
  86. package/dist/assets/{login-oauth-callback-Du-bMipe.js → login-oauth-callback-_6XAZMOE.js} +1 -1
  87. package/dist/assets/{logo-uploader-DEFzQY0j.js → logo-uploader-D5E5QaRF.js} +1 -1
  88. package/dist/assets/{lost-passport-DkN5GdCK.js → lost-passport-CUtEI06a.js} +1 -1
  89. package/dist/assets/{open-window-CdadJ5vo.js → open-window-Bi6zVDJd.js} +1 -1
  90. package/dist/assets/{over-due-invoice-payment-CXZ42RZu.js → over-due-invoice-payment-B7FQEnNH.js} +1 -1
  91. package/dist/assets/{overview-a9TXaGnH.js → overview-C7QghcRT.js} +1 -1
  92. package/dist/assets/{passport-C_PAxd9K.js → passport-B_eTMTmZ.js} +1 -1
  93. package/dist/assets/{passport-item-BudJHbYX.js → passport-item-D53yZ-cF.js} +1 -1
  94. package/dist/assets/{permission-CeqEAPPT.js → permission-DC8i_y8F.js} +1 -1
  95. package/dist/assets/{preferences-ixUbb8gE.js → preferences-DzDUGj-O.js} +1 -1
  96. package/dist/assets/{profile-embed-BIwa1Yt3.js → profile-embed-B3QUDkbU.js} +1 -1
  97. package/dist/assets/{provider-icon-CkqIY6iX.js → provider-icon-D15U0Izg.js} +1 -1
  98. package/dist/assets/{publish-resource-BpvxLOlV.js → publish-resource-DCIlLUPS.js} +1 -1
  99. package/dist/assets/{runtime-TkU2snTc.js → runtime-BHekBabT.js} +1 -1
  100. package/dist/assets/sdk-CJUhxOGJ.js +1 -0
  101. package/dist/assets/{security-Dw0iwARQ.js → security-BMslI5IZ.js} +1 -1
  102. package/dist/assets/{session-Cin9Rizr.js → session-CZpDtsCZ.js} +1 -1
  103. package/dist/assets/{setup-Daw0Bdkr.js → setup-CCvGdFDO.js} +1 -1
  104. package/dist/assets/{spaces-DghHe7uP.js → spaces-D3H6AchN.js} +1 -1
  105. package/dist/assets/{start-SLdZOtVD.js → start-SeWUP0mo.js} +1 -1
  106. package/dist/assets/{starting-progress-BiI8hmaj.js → starting-progress-Y3UjFmoX.js} +1 -1
  107. package/dist/assets/{status-DRNtY6SL.js → status-MSXp_buG.js} +1 -1
  108. package/dist/assets/{step-actions-Cb6B0FCJ.js → step-actions-BNFJWVZI.js} +1 -1
  109. package/dist/assets/{studio-CVfdma-R.js → studio-CRjDRBty.js} +1 -1
  110. package/dist/assets/{team-DkV63Yjl.js → team-YWd-FRKh.js} +1 -1
  111. package/dist/assets/{traffic-C8BReAMz.js → traffic-0IuWlrAD.js} +1 -1
  112. package/dist/assets/{transfer-Dt4V38KL.js → transfer-DRS2VUAN.js} +1 -1
  113. package/dist/assets/{unsubscribe-rCcvC6Dj.js → unsubscribe-xDow2Z6m.js} +1 -1
  114. package/dist/assets/{use-app-logo-DnCfhAzv.js → use-app-logo-hIHAHSSI.js} +1 -1
  115. package/dist/assets/{user-center-Cnc61do7.js → user-center-COnqQuqE.js} +1 -1
  116. package/dist/assets/{user-follower-Cc2pWcSL.js → user-follower-DVX8m-Zk.js} +1 -1
  117. package/dist/assets/{util-CMCJQTXJ.js → util-Dee1Ybp3.js} +1 -1
  118. package/dist/assets/{util-BgLSp_5A.js → util-GXkeqbBQ.js} +1 -1
  119. package/dist/assets/{wait-connect-TKbZWSFd.js → wait-connect-CLe9IfYi.js} +1 -1
  120. package/dist/assets/{wizard-BSaM_cSr.js → wizard-8Tk0iyxY.js} +1 -1
  121. package/dist/assets/{wizard-components-BOHnkwWH.js → wizard-components-C10frai0.js} +1 -1
  122. package/dist/assets/{wrap-locale-CFhaO2KZ.js → wrap-locale-CxYp8fAf.js} +1 -1
  123. package/dist/assets/{zh-DG89vJJ6.js → zh-BRjrClew.js} +1 -1
  124. package/dist/index.html +1 -1
  125. package/package.json +24 -24
  126. package/dist/assets/config-CoSaZVwp.js +0 -53
  127. package/dist/assets/engine-DOYgeVKF.js +0 -1
  128. package/dist/assets/index-B3RkYGd7.js +0 -1
  129. package/dist/assets/index-Bm1VCAzZ.js +0 -81
  130. package/dist/assets/sdk-CMvNWVGa.js +0 -1
@@ -63,15 +63,20 @@ async function getTrustedIssuers(blocklet, { sourceAppPid, trustAllFederated = f
63
63
 
64
64
  /**
65
65
  * 检测这个 blocklet 的子组件是否有 aigne 需求
66
+ * 1. 有组件设置了 requirements.aigne 为 true
67
+ * 2. 已经连接了 aigne hub
66
68
  * @param {import('@blocklet/server-js').BlockletState} blocklet
67
69
  * @returns {boolean}
68
70
  */
69
71
  function hasAigneRequirement(blocklet) {
70
72
  const children = blocklet.children || [];
71
- if (children.length > 0) {
72
- return children.some((child) => get(child, 'meta.requirements.aigne', false));
73
- }
74
- return false;
73
+ const aigne = get(blocklet, 'settings.aigne', {});
74
+
75
+ const isAigneConnected = !!(aigne.url && aigne.key);
76
+ const hasChildWithAigneRequirement =
77
+ children.length > 0 && children.some((child) => get(child, 'meta.requirements.aigne', false));
78
+
79
+ return isAigneConnected || hasChildWithAigneRequirement;
75
80
  }
76
81
 
77
82
  module.exports = {
@@ -1,4 +1,4 @@
1
- import{e as Ce,d as xe,g as ke,a as s,r as A}from"./vendor-react-CTtPmzVP.js";import{W as g}from"./vendor-mui-core-CKKG_1TN.js";import{ao as wt,ap as Et,aq as St,a3 as R,t as Ct,ar as kt,d as Rt,as as N,c as We}from"./vendor-utils-CUs2ebe7.js";import{bW as _t}from"./index-BEfIUbZC.js";import{r as Ot}from"./cloneDeep-rgNCMFod.js";var k={},$={};const Re=Ce(wt),Mt=Ce(Et),Ft=Ce(St);var Ie;function Bt(){if(Ie)return $;Ie=1,Object.defineProperty($,"__esModule",{value:!0}),$.flattenNames=void 0;var a=_t,e=h(a),t=Re,r=h(t),n=Mt,i=h(n),o=Ft,l=h(o);function h(c){return c&&c.__esModule?c:{default:c}}var p=$.flattenNames=function c(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?c(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,r.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return $.default=p,$}var L={},qe;function At(){if(qe)return L;qe=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var a=Re,e=i(a),t=Ot,r=i(t),n=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var p=arguments[h];for(var c in p)Object.prototype.hasOwnProperty.call(p,c)&&(l[c]=p[c])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=h.default&&(0,r.default)(h.default)||{};return p.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){c[v]||(c[v]={}),c[v]=n({},c[v],d[v])}),u}),c};return L.default=o,L}var j={},Ve;function Ht(){if(Ve)return j;Ve=1,Object.defineProperty(j,"__esModule",{value:!0}),j.autoprefix=void 0;var a=Re,e=r(a),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(o[p]=h[p])}return o};function r(o){return o&&o.__esModule?o:{default:o}}var n={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var p=h[l];return p||{extend:l}}},i=j.autoprefix=function(l){var h={};return(0,e.default)(l,function(p,c){var u={};(0,e.default)(p,function(d,f){var v=n[f];v?u=t({},u,v(d)):u[f]=d}),h[c]=u}),h};return j.default=i,j}var z={},Xe;function Pt(){if(Xe)return z;Xe=1,Object.defineProperty(z,"__esModule",{value:!0}),z.hover=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=z.hover=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(c,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d}(t.default.Component)};return z.default=l,z}var G={},Ye;function Tt(){if(Ye)return G;Ye=1,Object.defineProperty(G,"__esModule",{value:!0}),G.active=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=G.active=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(c,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d}(t.default.Component)};return G.default=l,G}var fe={},Ke;function Nt(){if(Ke)return fe;Ke=1,Object.defineProperty(fe,"__esModule",{value:!0});var a=function(t,r){var n={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n[l]=h};return t===0&&i("first-child"),t===r-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),n};return fe.default=a,fe}var Ze;function Dt(){if(Ze)return k;Ze=1,Object.defineProperty(k,"__esModule",{value:!0}),k.ReactCSS=k.loop=k.handleActive=k.handleHover=k.hover=void 0;var a=Bt(),e=d(a),t=At(),r=d(t),n=Ht(),i=d(n),o=Pt(),l=d(o),h=Tt(),p=d(h),c=Nt(),u=d(c);function d(v){return v&&v.__esModule?v:{default:v}}k.hover=l.default,k.handleHover=l.default,k.handleActive=p.default,k.loop=u.default;var f=k.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),O=1;O<m;O++)E[O-1]=arguments[O];var C=(0,e.default)(E),P=(0,r.default)(b,C);return(0,i.default)(P)};return k.default=f,k}var _e=Dt();const y=ke(_e);var $t=function(e,t,r,n,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,p=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=h-(i.getBoundingClientRect().left+window.pageXOffset),u=p-(i.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(c<0?f=0:c>o?f=1:f=Math.round(c*100/o)/100,n!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},we={},Lt=function(e,t,r,n){if(typeof document>"u"&&!n)return null;var i=n?new n:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},jt=function(e,t,r,n){var i=e+"-"+t+"-"+r+(n?"-server":"");if(we[i])return we[i];var o=Lt(e,t,r,n);return we[i]=o,o},Je=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},oe=function(e){var t=e.white,r=e.grey,n=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,p=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+jt(t,r,n,i.canvas)+") center left"}}});return A.isValidElement(h)?s.cloneElement(h,Je({},h.props,{style:Je({},h.props.style,p.grid)})):s.createElement("div",{style:p.grid})};oe.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var zt=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},Gt=function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}}();function Ut(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Qe(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function Wt(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var Oe=function(a){Wt(e,a);function e(){var t,r,n,i;Ut(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(r=(n=Qe(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),n),n.handleChange=function(p){var c=$t(p,n.props.hsl,n.props.direction,n.props.a,n.container);c&&typeof n.props.onChange=="function"&&n.props.onChange(c,p)},n.handleMouseDown=function(p){n.handleChange(p),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},r),Qe(n,i)}return Gt(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var r=this,n=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
1
+ import{e as Ce,d as xe,g as ke,a as s,r as A}from"./vendor-react-CTtPmzVP.js";import{W as g}from"./vendor-mui-core-CKKG_1TN.js";import{ao as wt,ap as Et,aq as St,a3 as R,t as Ct,ar as kt,d as Rt,as as N,c as We}from"./vendor-utils-CUs2ebe7.js";import{bW as _t}from"./index-DI4CWTXR.js";import{r as Ot}from"./cloneDeep-rgNCMFod.js";var k={},$={};const Re=Ce(wt),Mt=Ce(Et),Ft=Ce(St);var Ie;function Bt(){if(Ie)return $;Ie=1,Object.defineProperty($,"__esModule",{value:!0}),$.flattenNames=void 0;var a=_t,e=h(a),t=Re,r=h(t),n=Mt,i=h(n),o=Ft,l=h(o);function h(c){return c&&c.__esModule?c:{default:c}}var p=$.flattenNames=function c(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?c(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,r.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return $.default=p,$}var L={},qe;function At(){if(qe)return L;qe=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var a=Re,e=i(a),t=Ot,r=i(t),n=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var p=arguments[h];for(var c in p)Object.prototype.hasOwnProperty.call(p,c)&&(l[c]=p[c])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=h.default&&(0,r.default)(h.default)||{};return p.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){c[v]||(c[v]={}),c[v]=n({},c[v],d[v])}),u}),c};return L.default=o,L}var j={},Ve;function Ht(){if(Ve)return j;Ve=1,Object.defineProperty(j,"__esModule",{value:!0}),j.autoprefix=void 0;var a=Re,e=r(a),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(o[p]=h[p])}return o};function r(o){return o&&o.__esModule?o:{default:o}}var n={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var p=h[l];return p||{extend:l}}},i=j.autoprefix=function(l){var h={};return(0,e.default)(l,function(p,c){var u={};(0,e.default)(p,function(d,f){var v=n[f];v?u=t({},u,v(d)):u[f]=d}),h[c]=u}),h};return j.default=i,j}var z={},Xe;function Pt(){if(Xe)return z;Xe=1,Object.defineProperty(z,"__esModule",{value:!0}),z.hover=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=z.hover=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(c,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d}(t.default.Component)};return z.default=l,z}var G={},Ye;function Tt(){if(Ye)return G;Ye=1,Object.defineProperty(G,"__esModule",{value:!0}),G.active=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=G.active=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(c,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d}(t.default.Component)};return G.default=l,G}var fe={},Ke;function Nt(){if(Ke)return fe;Ke=1,Object.defineProperty(fe,"__esModule",{value:!0});var a=function(t,r){var n={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n[l]=h};return t===0&&i("first-child"),t===r-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),n};return fe.default=a,fe}var Ze;function Dt(){if(Ze)return k;Ze=1,Object.defineProperty(k,"__esModule",{value:!0}),k.ReactCSS=k.loop=k.handleActive=k.handleHover=k.hover=void 0;var a=Bt(),e=d(a),t=At(),r=d(t),n=Ht(),i=d(n),o=Pt(),l=d(o),h=Tt(),p=d(h),c=Nt(),u=d(c);function d(v){return v&&v.__esModule?v:{default:v}}k.hover=l.default,k.handleHover=l.default,k.handleActive=p.default,k.loop=u.default;var f=k.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),O=1;O<m;O++)E[O-1]=arguments[O];var C=(0,e.default)(E),P=(0,r.default)(b,C);return(0,i.default)(P)};return k.default=f,k}var _e=Dt();const y=ke(_e);var $t=function(e,t,r,n,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,p=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=h-(i.getBoundingClientRect().left+window.pageXOffset),u=p-(i.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(c<0?f=0:c>o?f=1:f=Math.round(c*100/o)/100,n!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},we={},Lt=function(e,t,r,n){if(typeof document>"u"&&!n)return null;var i=n?new n:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},jt=function(e,t,r,n){var i=e+"-"+t+"-"+r+(n?"-server":"");if(we[i])return we[i];var o=Lt(e,t,r,n);return we[i]=o,o},Je=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},oe=function(e){var t=e.white,r=e.grey,n=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,p=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+jt(t,r,n,i.canvas)+") center left"}}});return A.isValidElement(h)?s.cloneElement(h,Je({},h.props,{style:Je({},h.props.style,p.grid)})):s.createElement("div",{style:p.grid})};oe.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var zt=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},Gt=function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}}();function Ut(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Qe(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function Wt(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var Oe=function(a){Wt(e,a);function e(){var t,r,n,i;Ut(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(r=(n=Qe(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),n),n.handleChange=function(p){var c=$t(p,n.props.hsl,n.props.direction,n.props.a,n.container);c&&typeof n.props.onChange=="function"&&n.props.onChange(c,p)},n.handleMouseDown=function(p){n.handleChange(p),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},r),Qe(n,i)}return Gt(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var r=this,n=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
2
2
  rgba(`+n.r+","+n.g+","+n.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:n.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
3
3
  rgba(`+n.r+","+n.g+","+n.b+", 1) 100%)"},pointer:{left:0,top:n.a*100+"%"}},overwrite:zt({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return s.createElement("div",{style:i.alpha},s.createElement("div",{style:i.checkboard},s.createElement(oe,{renderers:this.props.renderers})),s.createElement("div",{style:i.gradient}),s.createElement("div",{style:i.container,ref:function(l){return r.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("div",{style:i.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:i.slider}))))}}]),e}(A.PureComponent||A.Component),It=function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}}();function qt(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Vt(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Xt(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function Yt(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var Kt=1,ft=38,Zt=40,Jt=[ft,Zt],Qt=function(e){return Jt.indexOf(e)>-1},er=function(e){return Number(String(e).replace(/%/g,""))},tr=1,w=function(a){Yt(e,a);function e(t){Vt(this,e);var r=Xt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(n){r.setUpdatedValue(n.target.value,n)},r.handleKeyDown=function(n){var i=er(n.target.value);if(!isNaN(i)&&Qt(n.keyCode)){var o=r.getArrowOffset(),l=n.keyCode===ft?i+o:i-o;r.setUpdatedValue(l,n)}},r.handleDrag=function(n){if(r.props.dragLabel){var i=Math.round(r.props.value+n.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),n)}},r.handleMouseDown=function(n){r.props.dragLabel&&(n.preventDefault(),r.handleDrag(n),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},r.inputId="rc-editable-input-"+tr++,r}return It(e,[{key:"componentDidUpdate",value:function(r,n){this.props.value!==this.state.value&&(r.value!==this.props.value||n.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return qt({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Kt}},{key:"setUpdatedValue",value:function(r,n){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,n),this.setState({value:r})}},{key:"render",value:function(){var r=this,n=y({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return s.createElement("div",{style:n.wrap},s.createElement("input",{id:this.inputId,style:n.input,ref:function(o){return r.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?s.createElement("label",{htmlFor:this.inputId,style:n.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(A.PureComponent||A.Component),rr=function(e,t,r,n){var i=n.clientWidth,o=n.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,h=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,p=l-(n.getBoundingClientRect().left+window.pageXOffset),c=h-(n.getBoundingClientRect().top+window.pageYOffset);if(t==="vertical"){var u=void 0;if(c<0)u=359;else if(c>o)u=0;else{var d=-(c*100/o)+100;u=360*d/100}if(r.h!==u)return{h:u,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var f=void 0;if(p<0)f=0;else if(p>i)f=359;else{var v=p*100/i;f=360*v/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},nr=function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}}();function ar(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function et(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function ir(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var le=function(a){ir(e,a);function e(){var t,r,n,i;ar(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(r=(n=et(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),n),n.handleChange=function(p){var c=rr(p,n.props.direction,n.props.hsl,n.container);c&&typeof n.props.onChange=="function"&&n.props.onChange(c,p)},n.handleMouseDown=function(p){n.handleChange(p),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},r),et(n,i)}return nr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var r=this,n=this.props.direction,i=n===void 0?"horizontal":n,o=y({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:i==="vertical"});return s.createElement("div",{style:o.hue},s.createElement("div",{className:"hue-"+i,style:o.container,ref:function(h){return r.container=h},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
4
4
  .hue-horizontal {
@@ -1,4 +1,4 @@
1
- import{D as E,j as e,ak as l,y as h,bW as A,bX as g,bY as y,at as L,W as N}from"./vendor-mui-core-CKKG_1TN.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as I,W as j}from"./vendor-ux-DjXlxcvL.js";import{A as b}from"./config-btuzRTop.js";import{a as O}from"./page-header-BZv-tfgN.js";import{y as v,q as R,c as s,r as W}from"./index-BEfIUbZC.js";import{S as Y}from"./layout-DRVZ4L0D.js";import{S as T}from"./step-actions-Cb6B0FCJ.js";import{S as D}from"./button-LwkniwV9.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./content-layout-Dtfb5X6M.js";import"./use-mobile-Bz2ML4Gk.js";function P({onNext:a=()=>{}}){const C=E(),{t:n,locale:p}=I(),[i,c]=m.useState(!1),[S,d]=m.useState(""),{blocklet:r}=v();m.useEffect(()=>{const t=R.findServiceFromMeta(r.meta,s.NODE_SERVICES.AUTH);d(t?.config?.whoCanAccess||s.WHO_CAN_ACCESS.ALL)},[r]);const f=async t=>{let o=s.ACCESS_POLICY_PUBLIC;t===s.WHO_CAN_ACCESS.ALL?o=s.ACCESS_POLICY_PUBLIC:t===s.WHO_CAN_ACCESS.INVITED?o=s.ACCESS_POLICY_INVITED_ONLY:t===s.WHO_CAN_ACCESS.OWNER?o=s.ACCESS_POLICY_OWNER_ONLY:t===s.WHO_CAN_ACCESS.ADMIN&&(o=s.ACCESS_POLICY_ADMIN_ONLY);try{c(!0),await W.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:s.SECURITY_RULE_DEFAULT_ID,accessPolicyId:o}}}),c(!1)}catch(_){c(!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(l,{className:"header",children:e.jsx(O,{title:n("blocklet.config.access.title"),subTitle:n("blocklet.config.access.description")})}),e.jsx(l,{className:"form-container",children:e.jsx(h,{component:"fieldset",children:e.jsx(A,{name:"inherit",value:S,onChange:x,children:b.map(t=>e.jsxs(l,{sx:{mb:2,"&:last-child":{mb:0}},children:[e.jsx(g,{value:t.value,control:e.jsx(y,{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(l,{className:"tip",children:t.description[p]})]},t.value))})})}),e.jsx(T,{mt:8,disabled:i,blocklet:r,onStartNow:()=>a("complete"),children:e.jsx(D,{loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:n("setup.continue")})})]})}P.propTypes={onNext:N.func};const k=L(Y)`
1
+ import{D as E,j as e,ak as l,y as h,bW as A,bX as g,bY as y,at as L,W as N}from"./vendor-mui-core-CKKG_1TN.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as I,W as j}from"./vendor-ux-DjXlxcvL.js";import{A as b}from"./config-6tpm84_l.js";import{a as O}from"./page-header-BZv-tfgN.js";import{y as v,q as R,c as s,r as W}from"./index-DI4CWTXR.js";import{S as Y}from"./layout-DzZv-Jny.js";import{S as T}from"./step-actions-BNFJWVZI.js";import{S as D}from"./button-LwkniwV9.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./content-layout-Dtfb5X6M.js";import"./use-mobile-Bz2ML4Gk.js";function P({onNext:a=()=>{}}){const C=E(),{t:n,locale:p}=I(),[i,c]=m.useState(!1),[S,d]=m.useState(""),{blocklet:r}=v();m.useEffect(()=>{const t=R.findServiceFromMeta(r.meta,s.NODE_SERVICES.AUTH);d(t?.config?.whoCanAccess||s.WHO_CAN_ACCESS.ALL)},[r]);const f=async t=>{let o=s.ACCESS_POLICY_PUBLIC;t===s.WHO_CAN_ACCESS.ALL?o=s.ACCESS_POLICY_PUBLIC:t===s.WHO_CAN_ACCESS.INVITED?o=s.ACCESS_POLICY_INVITED_ONLY:t===s.WHO_CAN_ACCESS.OWNER?o=s.ACCESS_POLICY_OWNER_ONLY:t===s.WHO_CAN_ACCESS.ADMIN&&(o=s.ACCESS_POLICY_ADMIN_ONLY);try{c(!0),await W.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:s.SECURITY_RULE_DEFAULT_ID,accessPolicyId:o}}}),c(!1)}catch(_){c(!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(l,{className:"header",children:e.jsx(O,{title:n("blocklet.config.access.title"),subTitle:n("blocklet.config.access.description")})}),e.jsx(l,{className:"form-container",children:e.jsx(h,{component:"fieldset",children:e.jsx(A,{name:"inherit",value:S,onChange:x,children:b.map(t=>e.jsxs(l,{sx:{mb:2,"&:last-child":{mb:0}},children:[e.jsx(g,{value:t.value,control:e.jsx(y,{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(l,{className:"tip",children:t.description[p]})]},t.value))})})}),e.jsx(T,{mt:8,disabled:i,blocklet:r,onStartNow:()=>a("complete"),children:e.jsx(D,{loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:n("setup.continue")})})]})}P.propTypes={onNext:N.func};const k=L(Y)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  .header {
@@ -1,4 +1,4 @@
1
- import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as $t,T as je,J as Yt,bX as ei,a5 as ti,I as No,cy as Ao,S as Do,cu as va,ba as ya,aP as Mo,F as ba,z as Hn,bv as xa,bw as wa,bx as Sa,bf as Ea,aZ as Bo,V as ka,aO as Ta,cP as ja,cQ as Oa,cq as Ca,cG as Ia,M as ni,am as Fo,aq as Ra,b6 as lt,c5 as Pa,c7 as La,a8 as $o,ad as Uo,aV as _a,aj as qo,Q as jn,Y as Na,ca as Wo,o as zo,aU as Aa,ar as Ht,cR as Da,cS as Ma,b4 as ki,U as Ti,ah as Ba,bg as Fa,O as $a,K as Ua,P as qa,ai as Wa,an as Vo,A as ji,aI as za,cT as Va}from"./vendor-mui-core-CKKG_1TN.js";import{r as q,g as ri,j as Ka,u as Ga,p as Ha,e as Xa,a as Ft,d as Ya,f as Rn,m as Ja}from"./vendor-react-CTtPmzVP.js";import{r as ii,S as Qa,s as Ko,A as Za}from"./item-BabsiwzU.js";import{F as vt,a_ as oi,a1 as Go,V as xt,K as yt,ay as el,W as Xn,bE as Oi,l as Qt,a3 as Ho,Y as Vn,bd as Xo,al as tl,b2 as nl,u as Fr,bF as rl}from"./vendor-ux-DjXlxcvL.js";import{Z as dn,q as Bt,c as il,bx as ol,by as Yn,bv as sl,bz as al,bA as ll,bB as Yo,bC as cl,bD as ul,bE as dl,ba as hl,z as fl,_ as pl,w as Jo,bF as ml,bG as gl,ay as vl,bH as yl,Y as Jn,bI as Qo,bq as Zo,k as Qn,b8 as Ci,bJ as bl,bo as xl,bK as wl,J as Xt,bL as Sl,bM as Pn,bN as Ii,bO as El}from"./index-BEfIUbZC.js";import{j as Ri,o as kl,T as Tl,L as jl,P as Ol}from"./vendor-arcblock-BCP2x3BR.js";import{u as Pi}from"./launch-result-message-C04PaKk0.js";import{a as $r}from"./page-header-BZv-tfgN.js";import{e as gt,B as Cl,z as rn,F as Zn,A as Li,a8 as es,a3 as Il,ad as Rl,x as Pl,o as sr,ae as Ll,ak as _l,al as Nl,am as Al,a as xn,an as Dl,b as Ml}from"./vendor-utils-CUs2ebe7.js";import{f as Ur}from"./index-DBs9Ljax.js";import{e as Bl}from"./engine-DOYgeVKF.js";import{u as Fl,C as $l}from"./config-space-BZQrckxG.js";import{R as Ln}from"./required-DHjZE3-Y.js";import{S as Ul}from"./index-BrDWLIA2.js";import{s as ts,h as ql,w as Wl,f as zl,a as Vl,b as Kl,c as Gl,M as Hl}from"./index-oucqu2vy.js";import{p as On,a as Xl,b as Yl,u as ns,g as Jl,s as Ql}from"./vendor-hooks-DQAdyHrE.js";import{g as Zl}from"./get-safe-url-DxqVk96E.js";import{r as rs,A as ec}from"./config-CoSaZVwp.js";import{r as tc}from"./index-_tncRnTu.js";import{r as nc}from"./cloneDeep-rgNCMFod.js";import{u as si}from"./useLocalStorage-Brr2PSz9.js";import{v as _i}from"./index-BSZ3mQac.js";import{u as rc}from"./session-Cin9Rizr.js";import{W as ic}from"./did-address-Cq16cwTy.js";import{a as Ni}from"./api-B24x7kOD.js";import{v as oc,e as sc}from"./util-CMCJQTXJ.js";import{u as is}from"./use-mobile-_vjPRYx2.js";import{C as ac}from"./content-layout-Dtfb5X6M.js";import{C as lc,D as cc,a as uc}from"./connect-to-CVH3cw77.js";import{d as ar}from"./search-4YYphs0l.js";const Nf="blocklet-add-component-registry",Af="server-add-registry",Df=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=dn();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:B.bool,children:B.any.isRequired,onConfirm:B.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(dc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(vt,{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(oi,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const dc=tt.div`
1
+ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as $t,T as je,J as Yt,bX as ei,a5 as ti,I as No,cy as Ao,S as Do,cu as va,ba as ya,aP as Mo,F as ba,z as Hn,bv as xa,bw as wa,bx as Sa,bf as Ea,aZ as Bo,V as ka,aO as Ta,cP as ja,cQ as Oa,cq as Ca,cG as Ia,M as ni,am as Fo,aq as Ra,b6 as lt,c5 as Pa,c7 as La,a8 as $o,ad as Uo,aV as _a,aj as qo,Q as jn,Y as Na,ca as Wo,o as zo,aU as Aa,ar as Ht,cR as Da,cS as Ma,b4 as ki,U as Ti,ah as Ba,bg as Fa,O as $a,K as Ua,P as qa,ai as Wa,an as Vo,A as ji,aI as za,cT as Va}from"./vendor-mui-core-CKKG_1TN.js";import{r as q,g as ri,j as Ka,u as Ga,p as Ha,e as Xa,a as Ft,d as Ya,f as Rn,m as Ja}from"./vendor-react-CTtPmzVP.js";import{r as ii,S as Qa,s as Ko,A as Za}from"./item-BV3WfK17.js";import{F as vt,a_ as oi,a1 as Go,V as xt,K as yt,ay as el,W as Xn,bE as Oi,l as Qt,a3 as Ho,Y as Vn,bd as Xo,al as tl,b2 as nl,u as Fr,bF as rl}from"./vendor-ux-DjXlxcvL.js";import{Z as dn,q as Bt,c as il,bx as ol,by as Yn,bv as sl,bz as al,bA as ll,bB as Yo,bC as cl,bD as ul,bE as dl,ba as hl,z as fl,_ as pl,w as Jo,bF as ml,bG as gl,ay as vl,bH as yl,Y as Jn,bI as Qo,bq as Zo,k as Qn,b8 as Ci,bJ as bl,bo as xl,bK as wl,J as Xt,bL as Sl,bM as Pn,bN as Ii,bO as El}from"./index-DI4CWTXR.js";import{j as Ri,o as kl,T as Tl,L as jl,P as Ol}from"./vendor-arcblock-BCP2x3BR.js";import{u as Pi}from"./launch-result-message-C04PaKk0.js";import{a as $r}from"./page-header-BZv-tfgN.js";import{e as gt,B as Cl,z as rn,F as Zn,A as Li,a8 as es,a3 as Il,ad as Rl,x as Pl,o as sr,ae as Ll,ak as _l,al as Nl,am as Al,a as xn,an as Dl,b as Ml}from"./vendor-utils-CUs2ebe7.js";import{f as Ur}from"./index-DBs9Ljax.js";import{e as Bl}from"./engine-D18zeIE7.js";import{u as Fl,C as $l}from"./config-space-CZRqkXsR.js";import{R as Ln}from"./required-DHjZE3-Y.js";import{S as Ul}from"./index-jILCQaR3.js";import{s as ts,h as ql,w as Wl,f as zl,a as Vl,b as Kl,c as Gl,M as Hl}from"./index-oucqu2vy.js";import{p as On,a as Xl,b as Yl,u as ns,g as Jl,s as Ql}from"./vendor-hooks-DQAdyHrE.js";import{g as Zl}from"./get-safe-url-BVTaUfvO.js";import{r as rs,A as ec}from"./config-cdtQwn5t.js";import{r as tc}from"./index-_tncRnTu.js";import{r as nc}from"./cloneDeep-rgNCMFod.js";import{u as si}from"./useLocalStorage-Brr2PSz9.js";import{v as _i}from"./index-BSZ3mQac.js";import{u as rc}from"./session-CZpDtsCZ.js";import{W as ic}from"./did-address-Cq16cwTy.js";import{a as Ni}from"./api-B24x7kOD.js";import{v as oc,e as sc}from"./util-Dee1Ybp3.js";import{u as is}from"./use-mobile-_vjPRYx2.js";import{C as ac}from"./content-layout-Dtfb5X6M.js";import{C as lc,D as cc,a as uc}from"./connect-to-lX3lujSp.js";import{d as ar}from"./search-4YYphs0l.js";const Nf="blocklet-add-component-registry",Af="server-add-registry",Df=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=dn();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:B.bool,children:B.any.isRequired,onConfirm:B.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(dc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(vt,{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(oi,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const dc=tt.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-CKKG_1TN.js";import{m as B,r}from"./vendor-react-CTtPmzVP.js";import{z as W,A}from"./vendor-utils-CUs2ebe7.js";import{V as L,a_ as O}from"./vendor-ux-DjXlxcvL.js";import{h as d,b as _,r as T}from"./vendor-hooks-DQAdyHrE.js";import{A as $,S as F}from"./add-component-core-DXBsHpN1.js";import{y as K,an as z}from"./index-BEfIUbZC.js";import"./lottie-web-4koyQiv_.js";import"./item-BabsiwzU.js";import"./index-DBs9Ljax.js";import"./delete-confirm-BLy-Oo1o.js";import"./click-to-copy-Dk6ZAJOw.js";import"./confirm-D6AvlbAp.js";import"./session-Cin9Rizr.js";import"./get-safe-url-DxqVk96E.js";import"./did-address-Cq16cwTy.js";import"./wait-connect-TKbZWSFd.js";import"./vendor-arcblock-BCP2x3BR.js";import"./launch-result-message-C04PaKk0.js";import"./page-header-BZv-tfgN.js";import"./engine-DOYgeVKF.js";import"./config-space-BZQrckxG.js";import"./spaces-DghHe7uP.js";import"./api-B24x7kOD.js";import"./required-DHjZE3-Y.js";import"./index-BrDWLIA2.js";import"./Google-JbLVL0lz.js";import"./cloneDeep-rgNCMFod.js";import"./create-passport-svg-DeDfPZeD.js";import"./form-wrapper-pwkkz4we.js";import"./logo-uploader-DEFzQY0j.js";import"./collapse-D72lnPa9.js";import"./index-oucqu2vy.js";import"./config-CoSaZVwp.js";import"./isURL-vNa-ZfGd.js";import"./section-CenHBXqj.js";import"./form-text-input-BsCymY_c.js";import"./edit.svg-CTE5eATX.js";import"./index-_tncRnTu.js";import"./useLocalStorage-Brr2PSz9.js";import"./index-BSZ3mQac.js";import"./util-CMCJQTXJ.js";import"./use-mobile-_vjPRYx2.js";import"./content-layout-Dtfb5X6M.js";import"./connect-to-CVH3cw77.js";import"./index-CNGNZ6kv.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BB8sYq-N.js";import"./search-4YYphs0l.js";function $t(){const{t:u}=L(),{blocklet:h}=K(),{componentDid:s}=B(),w=v(t=>t.breakpoints.down("md")),e=new URL(window.location.href),f=e.searchParams.get("mode")==="dialog",n=e.searchParams.get("resourceType")||"",m=e.searchParams.get("resourceDid")||s,g=e.searchParams.get("store")||"",R=e.searchParams.get("showFromUrl")!=="false",y=e.searchParams.get("showResourcesSwitch")!=="false",C=e.searchParams.get("enableRunBackground")!=="false",S=e.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[b,E]=r.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),[P,D]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const x=W(o,"/api/store.json"),{data:M}=await A.get(x);return{url:o,name:M.name}}));E(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const t=z();return a&&t.connect(),()=>{a&&t.isConnected()&&t.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=_(t=>{t.data?.event==="resourceDialog.select"&&t.data?.componentDid===s&&(D(t.data.data),j(t.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),T(()=>{window.removeEventListener("message",c)});const p=({inDialog:t=!0}={})=>l.jsx($,{stores:b,selectedMeta:P,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:t,storageKey:F(`${n}+${m}`),showResourcesSwitch:y,showFromUrl:R,enableRunBackground:C,showCategory:S});return f?l.jsx(O,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{$t as default};
1
+ import{J as v,j as l}from"./vendor-mui-core-CKKG_1TN.js";import{m as B,r}from"./vendor-react-CTtPmzVP.js";import{z as W,A}from"./vendor-utils-CUs2ebe7.js";import{V as L,a_ as O}from"./vendor-ux-DjXlxcvL.js";import{h as d,b as _,r as T}from"./vendor-hooks-DQAdyHrE.js";import{A as $,S as F}from"./add-component-core-BzMN094F.js";import{y as K,an as z}from"./index-DI4CWTXR.js";import"./lottie-web-4koyQiv_.js";import"./item-BV3WfK17.js";import"./index-DBs9Ljax.js";import"./delete-confirm-DiU5PO2T.js";import"./click-to-copy-Dk6ZAJOw.js";import"./confirm-Ch-CAgUO.js";import"./session-CZpDtsCZ.js";import"./get-safe-url-BVTaUfvO.js";import"./did-address-Cq16cwTy.js";import"./wait-connect-CLe9IfYi.js";import"./vendor-arcblock-BCP2x3BR.js";import"./launch-result-message-C04PaKk0.js";import"./page-header-BZv-tfgN.js";import"./engine-D18zeIE7.js";import"./config-space-CZRqkXsR.js";import"./spaces-D3H6AchN.js";import"./api-B24x7kOD.js";import"./required-DHjZE3-Y.js";import"./index-jILCQaR3.js";import"./Google-BI3aC5vK.js";import"./cloneDeep-rgNCMFod.js";import"./create-passport-svg-DeDfPZeD.js";import"./form-wrapper-pwkkz4we.js";import"./logo-uploader-D5E5QaRF.js";import"./collapse-D72lnPa9.js";import"./index-oucqu2vy.js";import"./config-cdtQwn5t.js";import"./isURL-DMMDDAKA.js";import"./section-CenHBXqj.js";import"./form-text-input-BsCymY_c.js";import"./edit.svg-CTE5eATX.js";import"./index-_tncRnTu.js";import"./useLocalStorage-Brr2PSz9.js";import"./index-BSZ3mQac.js";import"./util-Dee1Ybp3.js";import"./use-mobile-_vjPRYx2.js";import"./content-layout-Dtfb5X6M.js";import"./connect-to-lX3lujSp.js";import"./index-D88DUiSg.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BB8sYq-N.js";import"./search-4YYphs0l.js";function $t(){const{t:u}=L(),{blocklet:h}=K(),{componentDid:s}=B(),w=v(t=>t.breakpoints.down("md")),e=new URL(window.location.href),f=e.searchParams.get("mode")==="dialog",n=e.searchParams.get("resourceType")||"",m=e.searchParams.get("resourceDid")||s,g=e.searchParams.get("store")||"",R=e.searchParams.get("showFromUrl")!=="false",y=e.searchParams.get("showResourcesSwitch")!=="false",C=e.searchParams.get("enableRunBackground")!=="false",S=e.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[b,E]=r.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),[P,D]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const x=W(o,"/api/store.json"),{data:M}=await A.get(x);return{url:o,name:M.name}}));E(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const t=z();return a&&t.connect(),()=>{a&&t.isConnected()&&t.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=_(t=>{t.data?.event==="resourceDialog.select"&&t.data?.componentDid===s&&(D(t.data.data),j(t.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),T(()=>{window.removeEventListener("message",c)});const p=({inDialog:t=!0}={})=>l.jsx($,{stores:b,selectedMeta:P,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:t,storageKey:F(`${n}+${m}`),showResourcesSwitch:y,showFromUrl:R,enableRunBackground:C,showCategory:S});return f?l.jsx(O,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{$t as default};
@@ -1,4 +1,4 @@
1
- import{r as a,i as u}from"./vendor-react-CTtPmzVP.js";import{j as e,I as z,at as n,W as o}from"./vendor-mui-core-CKKG_1TN.js";import{b9 as b,a$ as f,b0 as g}from"./vendor-ux-DjXlxcvL.js";import{X as j}from"./index-BEfIUbZC.js";import{t as k}from"./question-mark-circle.svg-GhTaklFN.js";const v=t=>a.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg",...t},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.606 17.32a7.933 7.933 0 0 1-.581-1.18c-.165-.411-.312-.86-.44-1.339a7.639 7.639 0 0 0-1.586 1.054 7.69 7.69 0 0 0 2.607 1.465zm.657-1.675c-.16-.4-.305-.848-.429-1.335A7.643 7.643 0 0 1 10 14h.002c.734 0 1.463.104 2.165.31-.124.487-.268.935-.428 1.335-.283.707-.604 1.235-.925 1.575-.32.339-.595.447-.813.447-.218 0-.493-.108-.813-.447-.322-.34-.642-.867-.925-1.575zM10 12.667a8.976 8.976 0 0 1 2.436.334c.116-.727.193-1.511.22-2.334H7.344c.027.823.103 1.607.22 2.334A8.972 8.972 0 0 1 10 12.667zM7.345 9.333c.027-.823.103-1.607.22-2.334.791.223 1.61.335 2.436.334A8.974 8.974 0 0 0 12.437 7c.116.727.193 1.511.22 2.334H7.344zm6.646 1.334c-.03.982-.127 1.925-.28 2.797a8.98 8.98 0 0 1 2.227 1.439 7.666 7.666 0 0 0 1.734-4.236h-3.681zm3.681-1.334H13.99a19.718 19.718 0 0 0-.28-2.798 8.975 8.975 0 0 0 2.228-1.438 7.665 7.665 0 0 1 1.734 4.236zm1.329.669A9 9 0 0 1 1 10a9 9 0 0 1 18 0v.002zM2.329 9.333a7.665 7.665 0 0 1 1.734-4.236A8.974 8.974 0 0 0 6.29 6.535a19.74 19.74 0 0 0-.28 2.798H2.329zm0 1.334h3.682c.03.983.126 1.925.28 2.797a8.974 8.974 0 0 0-2.228 1.439 7.665 7.665 0 0 1-1.734-4.236zm10.648 5.473c.164-.411.312-.86.44-1.34.57.285 1.103.639 1.585 1.055a7.687 7.687 0 0 1-2.606 1.465c.216-.354.41-.751.58-1.18zm-.581-13.46c.967.316 1.85.819 2.606 1.465A7.64 7.64 0 0 1 13.417 5.2c-.128-.48-.276-.928-.44-1.34a7.925 7.925 0 0 0-.581-1.18zm-.657 1.675c.16.4.304.848.428 1.335a7.64 7.64 0 0 1-2.165.31H10a7.64 7.64 0 0 1-2.166-.31c.124-.487.268-.935.429-1.335.283-.708.603-1.235.925-1.575.32-.339.595-.447.813-.447.218 0 .492.108.813.447.321.34.642.867.925 1.575zM7.025 3.86a11.7 11.7 0 0 0-.44 1.34 7.64 7.64 0 0 1-1.586-1.055A7.688 7.688 0 0 1 7.606 2.68c-.216.354-.41.751-.581 1.18z",fill:"currentColor"}));function H({SessionContext:t,extraItems:c=[],showLocale:r=!0,showHelper:l=!0,showSessionManager:i=!0,sessionManagerProps:d={}}){const{session:m}=a.useContext(t),{locale:p}=a.useContext(b),h=u(),w=()=>{if(h.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[c.map((s,x)=>a.cloneElement(s,{key:x})),r&&e.jsx(A,{"data-cy":"locale-addon",icon:v,size:23,showText:!1,className:"locale-addon"}),e.jsx(j,{}),l&&e.jsx(z,{onClick:w,children:e.jsx(k,{})}),i&&e.jsx(M,{locale:p,session:m,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}H.propTypes={SessionContext:o.object.isRequired,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};const M=n(g)`
1
+ import{r as a,i as u}from"./vendor-react-CTtPmzVP.js";import{j as e,I as z,at as n,W as o}from"./vendor-mui-core-CKKG_1TN.js";import{b9 as b,a$ as f,b0 as g}from"./vendor-ux-DjXlxcvL.js";import{X as j}from"./index-DI4CWTXR.js";import{t as k}from"./question-mark-circle.svg-GhTaklFN.js";const v=t=>a.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg",...t},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.606 17.32a7.933 7.933 0 0 1-.581-1.18c-.165-.411-.312-.86-.44-1.339a7.639 7.639 0 0 0-1.586 1.054 7.69 7.69 0 0 0 2.607 1.465zm.657-1.675c-.16-.4-.305-.848-.429-1.335A7.643 7.643 0 0 1 10 14h.002c.734 0 1.463.104 2.165.31-.124.487-.268.935-.428 1.335-.283.707-.604 1.235-.925 1.575-.32.339-.595.447-.813.447-.218 0-.493-.108-.813-.447-.322-.34-.642-.867-.925-1.575zM10 12.667a8.976 8.976 0 0 1 2.436.334c.116-.727.193-1.511.22-2.334H7.344c.027.823.103 1.607.22 2.334A8.972 8.972 0 0 1 10 12.667zM7.345 9.333c.027-.823.103-1.607.22-2.334.791.223 1.61.335 2.436.334A8.974 8.974 0 0 0 12.437 7c.116.727.193 1.511.22 2.334H7.344zm6.646 1.334c-.03.982-.127 1.925-.28 2.797a8.98 8.98 0 0 1 2.227 1.439 7.666 7.666 0 0 0 1.734-4.236h-3.681zm3.681-1.334H13.99a19.718 19.718 0 0 0-.28-2.798 8.975 8.975 0 0 0 2.228-1.438 7.665 7.665 0 0 1 1.734 4.236zm1.329.669A9 9 0 0 1 1 10a9 9 0 0 1 18 0v.002zM2.329 9.333a7.665 7.665 0 0 1 1.734-4.236A8.974 8.974 0 0 0 6.29 6.535a19.74 19.74 0 0 0-.28 2.798H2.329zm0 1.334h3.682c.03.983.126 1.925.28 2.797a8.974 8.974 0 0 0-2.228 1.439 7.665 7.665 0 0 1-1.734-4.236zm10.648 5.473c.164-.411.312-.86.44-1.34.57.285 1.103.639 1.585 1.055a7.687 7.687 0 0 1-2.606 1.465c.216-.354.41-.751.58-1.18zm-.581-13.46c.967.316 1.85.819 2.606 1.465A7.64 7.64 0 0 1 13.417 5.2c-.128-.48-.276-.928-.44-1.34a7.925 7.925 0 0 0-.581-1.18zm-.657 1.675c.16.4.304.848.428 1.335a7.64 7.64 0 0 1-2.165.31H10a7.64 7.64 0 0 1-2.166-.31c.124-.487.268-.935.429-1.335.283-.708.603-1.235.925-1.575.32-.339.595-.447.813-.447.218 0 .492.108.813.447.321.34.642.867.925 1.575zM7.025 3.86a11.7 11.7 0 0 0-.44 1.34 7.64 7.64 0 0 1-1.586-1.055A7.688 7.688 0 0 1 7.606 2.68c-.216.354-.41.751-.581 1.18z",fill:"currentColor"}));function H({SessionContext:t,extraItems:c=[],showLocale:r=!0,showHelper:l=!0,showSessionManager:i=!0,sessionManagerProps:d={}}){const{session:m}=a.useContext(t),{locale:p}=a.useContext(b),h=u(),w=()=>{if(h.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[c.map((s,x)=>a.cloneElement(s,{key:x})),r&&e.jsx(A,{"data-cy":"locale-addon",icon:v,size:23,showText:!1,className:"locale-addon"}),e.jsx(j,{}),l&&e.jsx(z,{onClick:w,children:e.jsx(k,{})}),i&&e.jsx(M,{locale:p,session:m,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}H.propTypes={SessionContext:o.object.isRequired,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};const M=n(g)`
2
2
  .user-addon {
3
3
  .user-avatar {
4
4
  width: 28px;
@@ -1,4 +1,4 @@
1
- import{r as B,g as Ue}from"./vendor-react-CTtPmzVP.js";import{j as $,a6 as ue,ak as P,Q as We,dK as Ve,T as ee,W as U,bX as Ke,a5 as He,bf as Ge,aZ as Ze,at as Oe,U as Ye,b6 as ne,z as Je,A as Qe,dL as Ae,bn as Q,a3 as K,dM as Xe,am as xe,bl as we}from"./vendor-mui-core-CKKG_1TN.js";import{Z as te,Y as et,w as Ce,q as tt,a3 as rt,cD as st,C as nt,cE as at,c as it,T as $e,G as Ee,ak as De,J as Y,cF as ot}from"./index-BEfIUbZC.js";import{w as fe,P as lt}from"./permission-CeqEAPPT.js";import{V as oe,F as Z,W as H,a_ as Ie,cU as J,cV as ct,bL as ae,n as ut,cW as ge,cX as ft,cY as dt,cZ as mt,j as ce,o as me,a1 as je,b9 as pt}from"./vendor-ux-DjXlxcvL.js";import{v as Te}from"./vendor-hooks-DQAdyHrE.js";import{C as be}from"./confirm-D6AvlbAp.js";import{f as ie}from"./index-DBs9Ljax.js";import{u as ht}from"./useSetState-L-f8mSga.js";import{u as Le}from"./session-Cin9Rizr.js";import{S as V}from"./section-CenHBXqj.js";import{C as gt}from"./click-to-copy-Dk6ZAJOw.js";import{b as qe}from"./team-DkV63Yjl.js";import{w as pe,af as yt}from"./vendor-utils-CUs2ebe7.js";import{v as bt}from"./index-BSZ3mQac.js";import{W as vt}from"./did-address-Cq16cwTy.js";import{V as _t}from"./status-DRNtY6SL.js";import{F as ke}from"./form-text-input-BsCymY_c.js";import"./vendor-arcblock-BCP2x3BR.js";import"./lottie-web-4koyQiv_.js";import"./required-DHjZE3-Y.js";import"./isURL-vNa-ZfGd.js";import"./use-app-logo-DnCfhAzv.js";import"./omit-BeaKJrg9.js";import"./index-DixUQBnm.js";import"./form-wrapper-pwkkz4we.js";import"./edit.svg-CTE5eATX.js";const xt=localStorage.getItem("enableDebug")==="true";function wt({teamDid:T,size:O="small",...I}){const{t:A}=oe(),{api:j}=te(),[x,h]=B.useState(!1),[l,y]=B.useState(null),p=()=>{h(!1),y(null)},f=async()=>{try{h(!0);const n=await j.clearCache({input:{teamDid:T}});H.success(A("blocklet.config.clearCache.success",{count:n.removed?.length||0}))}catch(n){H.error(ie(n))}finally{h(!1),y(null)}},e={title:A("blocklet.config.clearCache.title"),description:A("blocklet.config.clearCache.description"),confirm:A("common.confirm"),cancel:A("common.cancel"),onConfirm:f,onCancel:p};return $.jsxs("div",{...I,children:[$.jsxs(Z,{onClick:()=>y(e),color:"error",variant:"outlined",size:O,children:[x?$.jsx(ue,{size:16,style:{marginRight:5}}):null,A("blocklet.config.clearCache.action")]}),l&&$.jsx(be,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}function Pe({onChange:T=()=>{},disabled:O=!1,loading:I=!1,inService:A=!1}){const{t:j}=oe(),{api:x,session:h}=Le(),{blocklet:l}=et(),[y,p]=ht({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>p({isConnectOpen:!1}),e=()=>{if(tt.isInProgress(l.status)){H.error(j("blocklet.error.isInProgress"));return}p({confirmDialogOpen:!0})};return $.jsxs($.Fragment,{children:[$.jsx(V,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:$.jsx(P,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:$.jsxs(We,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:O||I,onClick:e,children:[$.jsx(Ve,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),$.jsxs($.Fragment,{children:[y.isConnectOpen&&$.jsx(Ce,{popup:!0,open:y.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:x.get,checkTimeout:5*60*1e3,onSuccess:()=>{T(),A&&h.logout(),f()},extraParams:{appDid:l.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),y.confirmDialogOpen&&$.jsx(be,{title:$.jsx(ee,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:$.jsx(ee,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>p({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>p({confirmDialogOpen:!1})})]})]})}Pe.propTypes={onChange:U.func,disabled:U.bool,loading:U.bool,inService:U.bool};function Me({onCancel:T,onSuccess:O,onError:I=()=>{}}){const{api:A}=B.useContext(rt),[j,x]=B.useState(!1),{t:h,locale:l}=oe(),[y,p]=B.useState(""),[f,e]=B.useState(!1),[n,a]=B.useState(0),[r,t]=B.useState(""),{endpoint:o}=qe(),[s,i]=B.useState(!1),u=c=>{p(null),x(!0);try{t(c.result),a(_.length-1)}catch(m){const b=ie(m);p(b),I(m)}finally{x(!1)}},d=()=>{e(!0),a(1)},g=()=>{e(!1),a(0)},_=[{body:$.jsxs(P,{children:[$.jsx(ee,{children:h("team.transferApp.transferDialog.tips.progress")}),$.jsx(ee,{sx:{mt:3,mb:2},children:h("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:h("common.cancel"),confirm:h("team.transferApp.transferDialog.createTransferLink"),onCancel:T,onConfirm:d},{cancel:h("common.cancel"),confirm:h("team.transferApp.transferDialog.createTransferLink"),body:()=>$.jsx(Ce,{action:"transfer-app-owner",open:f,locale:l,checkFn:A.get,onClose:g,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:h("team.transferApp.connectDialog.title"),scan:h("team.transferApp.connectDialog.scan"),confirm:h("team.transferApp.connectDialog.confirm"),success:h("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=st({transferId:r.transferId,endpoint:o});return $.jsxs($.Fragment,{children:[$.jsx(P,{component:X,dangerouslySetInnerHTML:{__html:h("team.transferApp.transferDialog.createSuccessTip1")}}),$.jsx(P,{component:X,sx:{mt:2},children:$.jsx(X,{children:h("team.transferApp.transferDialog.createSuccessTip3")})}),$.jsxs(P,{children:[$.jsx(P,{component:X,sx:{mt:2},children:$.jsx(X,{children:h("team.transferApp.transferDialog.createSuccessTip2",{expireDate:nt(r.expireDate,l)})})}),$.jsx(P,{sx:{my:1},children:$.jsx(gt,{children:c})})]}),$.jsx("div",{children:$.jsx(Ke,{value:"end",control:$.jsx(He,{checked:s,onChange:m=>i(m.target.checked)}),label:h("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:h("common.confirm"),onConfirm:O}],v=_[n];return $.jsxs(Ie,{title:$.jsx(X,{className:"title",children:h("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:$.jsxs($.Fragment,{children:[v.cancel&&$.jsx(Z,{onClick:v.onCancel,color:"inherit",children:v.cancel}),$.jsxs(Z,{onClick:v.onConfirm,color:"error",disabled:j||n===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&$.jsx(ue,{size:16}),v.confirm]})]}),children:[$.jsx(Ge,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!y&&$.jsx(Ze,{severity:"error",variant:"icon",children:y})]})}Me.propTypes={onCancel:U.func.isRequired,onSuccess:U.func.isRequired,onError:U.func};const X=Oe.div`
1
+ import{r as B,g as Ue}from"./vendor-react-CTtPmzVP.js";import{j as $,a6 as ue,ak as P,Q as We,dK as Ve,T as ee,W as U,bX as Ke,a5 as He,bf as Ge,aZ as Ze,at as Oe,U as Ye,b6 as ne,z as Je,A as Qe,dL as Ae,bn as Q,a3 as K,dM as Xe,am as xe,bl as we}from"./vendor-mui-core-CKKG_1TN.js";import{Z as te,Y as et,w as Ce,q as tt,a3 as rt,cD as st,C as nt,cE as at,c as it,T as $e,G as Ee,ak as De,J as Y,cF as ot}from"./index-DI4CWTXR.js";import{w as fe,P as lt}from"./permission-DC8i_y8F.js";import{V as oe,F as Z,W as H,a_ as Ie,cU as J,cV as ct,bL as ae,n as ut,cW as ge,cX as ft,cY as dt,cZ as mt,j as ce,o as me,a1 as je,b9 as pt}from"./vendor-ux-DjXlxcvL.js";import{v as Te}from"./vendor-hooks-DQAdyHrE.js";import{C as be}from"./confirm-Ch-CAgUO.js";import{f as ie}from"./index-DBs9Ljax.js";import{u as ht}from"./useSetState-L-f8mSga.js";import{u as Le}from"./session-CZpDtsCZ.js";import{S as V}from"./section-CenHBXqj.js";import{C as gt}from"./click-to-copy-Dk6ZAJOw.js";import{b as qe}from"./team-YWd-FRKh.js";import{w as pe,af as yt}from"./vendor-utils-CUs2ebe7.js";import{v as bt}from"./index-BSZ3mQac.js";import{W as vt}from"./did-address-Cq16cwTy.js";import{V as _t}from"./status-MSXp_buG.js";import{F as ke}from"./form-text-input-BsCymY_c.js";import"./vendor-arcblock-BCP2x3BR.js";import"./lottie-web-4koyQiv_.js";import"./required-DHjZE3-Y.js";import"./isURL-DMMDDAKA.js";import"./use-app-logo-hIHAHSSI.js";import"./omit-BeaKJrg9.js";import"./index-0ZSFNH-D.js";import"./form-wrapper-pwkkz4we.js";import"./edit.svg-CTE5eATX.js";const xt=localStorage.getItem("enableDebug")==="true";function wt({teamDid:T,size:O="small",...I}){const{t:A}=oe(),{api:j}=te(),[x,h]=B.useState(!1),[l,y]=B.useState(null),p=()=>{h(!1),y(null)},f=async()=>{try{h(!0);const n=await j.clearCache({input:{teamDid:T}});H.success(A("blocklet.config.clearCache.success",{count:n.removed?.length||0}))}catch(n){H.error(ie(n))}finally{h(!1),y(null)}},e={title:A("blocklet.config.clearCache.title"),description:A("blocklet.config.clearCache.description"),confirm:A("common.confirm"),cancel:A("common.cancel"),onConfirm:f,onCancel:p};return $.jsxs("div",{...I,children:[$.jsxs(Z,{onClick:()=>y(e),color:"error",variant:"outlined",size:O,children:[x?$.jsx(ue,{size:16,style:{marginRight:5}}):null,A("blocklet.config.clearCache.action")]}),l&&$.jsx(be,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}function Pe({onChange:T=()=>{},disabled:O=!1,loading:I=!1,inService:A=!1}){const{t:j}=oe(),{api:x,session:h}=Le(),{blocklet:l}=et(),[y,p]=ht({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>p({isConnectOpen:!1}),e=()=>{if(tt.isInProgress(l.status)){H.error(j("blocklet.error.isInProgress"));return}p({confirmDialogOpen:!0})};return $.jsxs($.Fragment,{children:[$.jsx(V,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:$.jsx(P,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:$.jsxs(We,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:O||I,onClick:e,children:[$.jsx(Ve,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),$.jsxs($.Fragment,{children:[y.isConnectOpen&&$.jsx(Ce,{popup:!0,open:y.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:x.get,checkTimeout:5*60*1e3,onSuccess:()=>{T(),A&&h.logout(),f()},extraParams:{appDid:l.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),y.confirmDialogOpen&&$.jsx(be,{title:$.jsx(ee,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:$.jsx(ee,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>p({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>p({confirmDialogOpen:!1})})]})]})}Pe.propTypes={onChange:U.func,disabled:U.bool,loading:U.bool,inService:U.bool};function Me({onCancel:T,onSuccess:O,onError:I=()=>{}}){const{api:A}=B.useContext(rt),[j,x]=B.useState(!1),{t:h,locale:l}=oe(),[y,p]=B.useState(""),[f,e]=B.useState(!1),[n,a]=B.useState(0),[r,t]=B.useState(""),{endpoint:o}=qe(),[s,i]=B.useState(!1),u=c=>{p(null),x(!0);try{t(c.result),a(_.length-1)}catch(m){const b=ie(m);p(b),I(m)}finally{x(!1)}},d=()=>{e(!0),a(1)},g=()=>{e(!1),a(0)},_=[{body:$.jsxs(P,{children:[$.jsx(ee,{children:h("team.transferApp.transferDialog.tips.progress")}),$.jsx(ee,{sx:{mt:3,mb:2},children:h("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:h("common.cancel"),confirm:h("team.transferApp.transferDialog.createTransferLink"),onCancel:T,onConfirm:d},{cancel:h("common.cancel"),confirm:h("team.transferApp.transferDialog.createTransferLink"),body:()=>$.jsx(Ce,{action:"transfer-app-owner",open:f,locale:l,checkFn:A.get,onClose:g,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:h("team.transferApp.connectDialog.title"),scan:h("team.transferApp.connectDialog.scan"),confirm:h("team.transferApp.connectDialog.confirm"),success:h("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=st({transferId:r.transferId,endpoint:o});return $.jsxs($.Fragment,{children:[$.jsx(P,{component:X,dangerouslySetInnerHTML:{__html:h("team.transferApp.transferDialog.createSuccessTip1")}}),$.jsx(P,{component:X,sx:{mt:2},children:$.jsx(X,{children:h("team.transferApp.transferDialog.createSuccessTip3")})}),$.jsxs(P,{children:[$.jsx(P,{component:X,sx:{mt:2},children:$.jsx(X,{children:h("team.transferApp.transferDialog.createSuccessTip2",{expireDate:nt(r.expireDate,l)})})}),$.jsx(P,{sx:{my:1},children:$.jsx(gt,{children:c})})]}),$.jsx("div",{children:$.jsx(Ke,{value:"end",control:$.jsx(He,{checked:s,onChange:m=>i(m.target.checked)}),label:h("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:h("common.confirm"),onConfirm:O}],v=_[n];return $.jsxs(Ie,{title:$.jsx(X,{className:"title",children:h("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:$.jsxs($.Fragment,{children:[v.cancel&&$.jsx(Z,{onClick:v.onCancel,color:"inherit",children:v.cancel}),$.jsxs(Z,{onClick:v.onConfirm,color:"error",disabled:j||n===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&$.jsx(ue,{size:16}),v.confirm]})]}),children:[$.jsx(Ge,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!y&&$.jsx(Ze,{severity:"error",variant:"icon",children:y})]})}Me.propTypes={onCancel:U.func.isRequired,onSuccess:U.func.isRequired,onError:U.func};const X=Oe.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  &.title {
@@ -1,4 +1,4 @@
1
- import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-CKKG_1TN.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{b9 as g}from"./vendor-ux-DjXlxcvL.js";import{a as h}from"./page-header-BZv-tfgN.js";import{Y as b}from"./index-BEfIUbZC.js";import{A as j}from"./config-CoSaZVwp.js";import{S as k}from"./step-actions-Cb6B0FCJ.js";import{S}from"./layout-DRVZ4L0D.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./isURL-vNa-ZfGd.js";import"./section-CenHBXqj.js";import"./required-DHjZE3-Y.js";import"./form-wrapper-pwkkz4we.js";import"./form-text-input-BsCymY_c.js";import"./edit.svg-CTE5eATX.js";import"./wait-connect-TKbZWSFd.js";import"./get-safe-url-DxqVk96E.js";import"./index-_tncRnTu.js";import"./index-DBs9Ljax.js";import"./use-mobile-Bz2ML4Gk.js";import"./content-layout-Dtfb5X6M.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=b(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(j,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
1
+ import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-CKKG_1TN.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{b9 as g}from"./vendor-ux-DjXlxcvL.js";import{a as h}from"./page-header-BZv-tfgN.js";import{Y as b}from"./index-DI4CWTXR.js";import{A as j}from"./config-cdtQwn5t.js";import{S as k}from"./step-actions-BNFJWVZI.js";import{S}from"./layout-DzZv-Jny.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./isURL-DMMDDAKA.js";import"./section-CenHBXqj.js";import"./required-DHjZE3-Y.js";import"./form-wrapper-pwkkz4we.js";import"./form-text-input-BsCymY_c.js";import"./edit.svg-CTE5eATX.js";import"./wait-connect-CLe9IfYi.js";import"./get-safe-url-BVTaUfvO.js";import"./index-_tncRnTu.js";import"./index-DBs9Ljax.js";import"./use-mobile-Bz2ML4Gk.js";import"./content-layout-Dtfb5X6M.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=b(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(j,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
 
@@ -1 +1 @@
1
- import{z as E,x as k}from"./vendor-utils-CUs2ebe7.js";import{Z as T,Y as j,c as M}from"./index-BEfIUbZC.js";import{r as e}from"./vendor-react-CTtPmzVP.js";import{V as B}from"./vendor-ux-DjXlxcvL.js";import{u as D}from"./use-mobile-_vjPRYx2.js";import{D as H,j as o,ak as w,a6 as I}from"./vendor-mui-core-CKKG_1TN.js";import"./vendor-arcblock-BCP2x3BR.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";function K(){const{info:x,inService:g}=T(),{blocklet:y}=j(),{locale:u}=B(),f=e.useRef(null),r=H(),[L,R]=e.useState(0),m=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.location.origin):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=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"),p=()=>{if(f.current){const{height:b}=n.getBoundingClientRect(),{top:C}=i.getBoundingClientRect(),{top:_}=f.current.getBoundingClientRect();let h=b-_+C-(m?108:164);m&&(h=Math.min(h,600)),R(h)}};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[m,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:f}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(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{z as E,x as k}from"./vendor-utils-CUs2ebe7.js";import{Z as T,Y as j,c as M}from"./index-DI4CWTXR.js";import{r as e}from"./vendor-react-CTtPmzVP.js";import{V as B}from"./vendor-ux-DjXlxcvL.js";import{u as D}from"./use-mobile-_vjPRYx2.js";import{D as H,j as o,ak as w,a6 as I}from"./vendor-mui-core-CKKG_1TN.js";import"./vendor-arcblock-BCP2x3BR.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";function K(){const{info:x,inService:g}=T(),{blocklet:y}=j(),{locale:u}=B(),f=e.useRef(null),r=H(),[L,R]=e.useState(0),m=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.location.origin):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=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"),p=()=>{if(f.current){const{height:b}=n.getBoundingClientRect(),{top:C}=i.getBoundingClientRect(),{top:_}=f.current.getBoundingClientRect();let h=b-_+C-(m?108:164);m&&(h=Math.min(h,600)),R(h)}};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[m,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:f}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(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,4 +1,4 @@
1
- import{W as U,V as _,bk as H,bv as F,bM as Z,b2 as G,ba as K}from"./vendor-ux-DjXlxcvL.js";import{Z as W,c as A}from"./index-BEfIUbZC.js";import{j as e,D as I,ak as g,b2 as X,T as $,am as B,bl as J,I as D,cj as Q,dP as q,J as Y,a6 as ee,y as te,x as ne,bZ as oe,M as se,b_ as re,at as ae}from"./vendor-mui-core-CKKG_1TN.js";import{r as i,L as ie}from"./vendor-react-CTtPmzVP.js";import{p as le}from"./util-BgLSp_5A.js";import{u as ce}from"./useLocalStorage-Brr2PSz9.js";import{M as T}from"./index-oucqu2vy.js";import{d as de,e as M}from"./vendor-utils-CUs2ebe7.js";import{S as V}from"./shorten-label-DXFyDHDr.js";import{r as O}from"./index-D-O_eFad.js";import{b as ue}from"./team-DkV63Yjl.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./base32-r3F0yIbl.js";import"./session-Cin9Rizr.js";import"./isURL-vNa-ZfGd.js";import"./use-app-logo-DnCfhAzv.js";const N=i.createContext({}),{Provider:pe,Consumer:Be}=N;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function me({children:t,scope:c="",categories:o=[],showScope:l,scopeFormatter:p,blocklets:x}){const{api:h,info:v}=W(),[C,f]=i.useState([]),[m,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,n]=ce(`audit-log-category-${c}`,"all"),j=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>o.length?P.value==="all"||o.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),f(S.list),y(S.paging),s(!1)}catch(S){U.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",m.pageSize)},[m.pageSize]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:n,data:C,paging:m,setPaging:y,showScope:l,scopeFormatter:p,actionOrContent:w,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(N);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let l;for(;(l=c.exec(t))!==null;)o.push({text:l[1],url:l[2]});return o}const xe=`
1
+ import{W as U,V as _,bk as H,bv as F,bM as Z,b2 as G,ba as K}from"./vendor-ux-DjXlxcvL.js";import{Z as W,c as A}from"./index-DI4CWTXR.js";import{j as e,D as I,ak as g,b2 as X,T as $,am as B,bl as J,I as D,cj as Q,dP as q,J as Y,a6 as ee,y as te,x as ne,bZ as oe,M as se,b_ as re,at as ae}from"./vendor-mui-core-CKKG_1TN.js";import{r as i,L as ie}from"./vendor-react-CTtPmzVP.js";import{p as le}from"./util-GXkeqbBQ.js";import{u as ce}from"./useLocalStorage-Brr2PSz9.js";import{M as T}from"./index-oucqu2vy.js";import{d as de,e as M}from"./vendor-utils-CUs2ebe7.js";import{S as V}from"./shorten-label-DXFyDHDr.js";import{r as O}from"./index-D-O_eFad.js";import{b as ue}from"./team-YWd-FRKh.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./base32-z3esjJBn.js";import"./session-CZpDtsCZ.js";import"./isURL-DMMDDAKA.js";import"./use-app-logo-hIHAHSSI.js";const N=i.createContext({}),{Provider:pe,Consumer:Be}=N;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function me({children:t,scope:c="",categories:o=[],showScope:l,scopeFormatter:p,blocklets:x}){const{api:h,info:v}=W(),[C,f]=i.useState([]),[m,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,n]=ce(`audit-log-category-${c}`,"all"),j=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>o.length?P.value==="all"||o.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),f(S.list),y(S.paging),s(!1)}catch(S){U.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",m.pageSize)},[m.pageSize]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:n,data:C,paging:m,setPaging:y,showScope:l,scopeFormatter:p,actionOrContent:w,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(N);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let l;for(;(l=c.exec(t))!==null;)o.push({text:l[1],url:l[2]});return o}const xe=`
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,cm as W,T as o,b2 as z,am as I,b$ as R,bX as L,a5 as O,a3 as T,bb as f,b6 as F}from"./vendor-mui-core-CKKG_1TN.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{v as D}from"./vendor-hooks-DQAdyHrE.js";import{z as b}from"./vendor-utils-CUs2ebe7.js";import{u as B,c as u,W as H,H as U,b0 as M,o as K}from"./index-BEfIUbZC.js";import{K as p}from"./landing-page-B5QvkHHO.js";import{V as Q,M as y}from"./vendor-ux-DjXlxcvL.js";import{W as V}from"./did-address-Cq16cwTy.js";import"./vendor-arcblock-BCP2x3BR.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 K.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.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(M,{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(V,{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(O,{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(T,{}),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(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(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,cm as W,T as o,b2 as z,am as I,b$ as R,bX as L,a5 as O,a3 as T,bb as f,b6 as F}from"./vendor-mui-core-CKKG_1TN.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{v as D}from"./vendor-hooks-DQAdyHrE.js";import{z as b}from"./vendor-utils-CUs2ebe7.js";import{u as B,c as u,W as H,H as U,b0 as M,o as K}from"./index-DI4CWTXR.js";import{K as p}from"./landing-page-BDAr8Hmo.js";import{V as Q,M as y}from"./vendor-ux-DjXlxcvL.js";import{W as V}from"./did-address-Cq16cwTy.js";import"./vendor-arcblock-BCP2x3BR.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 K.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.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(M,{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(V,{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(O,{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(T,{}),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(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(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 +1 @@
1
- import{bv as x}from"./index-BEfIUbZC.js";import{e as m}from"./vendor-react-CTtPmzVP.js";class w{constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g{constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return l(this,e)}}class y{constructor(e){this.decoders=e}or(e){return l(this,e)}decode(e){const r=e[0],o=this.decoders[r];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const l=(t,e)=>new y({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class E{constructor(e,r,o,s){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=s,this.encoder=new w(e,r,o),this.decoder=new g(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const v=({name:t,prefix:e,encode:r,decode:o})=>new E(t,e,r,o),A=(t,e,r,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let i=t.length;for(;t[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let n=0,c=0,h=0;for(let p=0;p<i;++p){const u=s[t[p]];if(u===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<r|u,n+=r,n>=8&&(n-=8,a[h++]=255&c>>n)}if(n>=r||255&c<<8-n)throw new SyntaxError("Unexpected end of data");return a},C=(t,e,r)=>{const o=e[e.length-1]==="=",s=(1<<r)-1;let i="",a=0,n=0;for(let c=0;c<t.length;++c)for(n=n<<8|t[c],a+=8;a>r;)a-=r,i+=e[s&n>>a];if(a&&(i+=e[s&n<<r-a]),o)for(;i.length*r&7;)i+="=";return i},d=({name:t,prefix:e,bitsPerChar:r,alphabet:o})=>v({prefix:e,name:t,encode(s){return C(s,o,r)},decode(s){return A(s,o,r,t)}}),P=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),D=Object.freeze(Object.defineProperty({__proto__:null,base32:P,base32hex:q,base32hexpad:O,base32hexpadupper:j,base32hexupper:B,base32pad:S,base32padupper:U,base32upper:$,base32z:k},Symbol.toStringTag,{value:"Module"})),N=m(D);var f,b;function R(){if(b)return f;b=1;const{toBuffer:t,toAddress:e,toBase58:r,toHex:o}=x(),{base32:s}=N;return f={encode:n=>{if(!n)return n;const c=t(e(n));return s.encode(c)},decode:n=>{if(!n)return n;const c=s.decode(n),h=r(c);return h.length>30?h:o(c)}},f}export{R as r};
1
+ import{bv as x}from"./index-DI4CWTXR.js";import{e as m}from"./vendor-react-CTtPmzVP.js";class w{constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g{constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return l(this,e)}}class y{constructor(e){this.decoders=e}or(e){return l(this,e)}decode(e){const r=e[0],o=this.decoders[r];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const l=(t,e)=>new y({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class E{constructor(e,r,o,s){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=s,this.encoder=new w(e,r,o),this.decoder=new g(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const v=({name:t,prefix:e,encode:r,decode:o})=>new E(t,e,r,o),A=(t,e,r,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let i=t.length;for(;t[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let n=0,c=0,h=0;for(let p=0;p<i;++p){const u=s[t[p]];if(u===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<r|u,n+=r,n>=8&&(n-=8,a[h++]=255&c>>n)}if(n>=r||255&c<<8-n)throw new SyntaxError("Unexpected end of data");return a},C=(t,e,r)=>{const o=e[e.length-1]==="=",s=(1<<r)-1;let i="",a=0,n=0;for(let c=0;c<t.length;++c)for(n=n<<8|t[c],a+=8;a>r;)a-=r,i+=e[s&n>>a];if(a&&(i+=e[s&n<<r-a]),o)for(;i.length*r&7;)i+="=";return i},d=({name:t,prefix:e,bitsPerChar:r,alphabet:o})=>v({prefix:e,name:t,encode(s){return C(s,o,r)},decode(s){return A(s,o,r,t)}}),P=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),D=Object.freeze(Object.defineProperty({__proto__:null,base32:P,base32hex:q,base32hexpad:O,base32hexpadupper:j,base32hexupper:B,base32pad:S,base32padupper:U,base32upper:$,base32z:k},Symbol.toStringTag,{value:"Module"})),N=m(D);var f,b;function R(){if(b)return f;b=1;const{toBuffer:t,toAddress:e,toBase58:r,toHex:o}=x(),{base32:s}=N;return f={encode:n=>{if(!n)return n;const c=t(e(n));return s.encode(c)},decode:n=>{if(!n)return n;const c=s.decode(n),h=r(c);return h.length>30?h:o(c)}},f}export{R as r};
@@ -1 +1 @@
1
- import{j as e,ak as l,aZ as B,T as f,D as H,n as Z,am as $,W as u}from"./vendor-mui-core-CKKG_1TN.js";import{Y as O,u as U,aC as I,w as P,cm as F}from"./index-BEfIUbZC.js";import{V as D,K as w,b8 as Y,a1 as K}from"./vendor-ux-DjXlxcvL.js";import{a as Q}from"./page-header-BZv-tfgN.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{S as W}from"./button-LwkniwV9.js";import{S as _}from"./layout-DRVZ4L0D.js";import{S as G}from"./step-actions-Cb6B0FCJ.js";import"./vendor-arcblock-BCP2x3BR.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-Dtfb5X6M.js";import"./use-mobile-Bz2ML4Gk.js";const J={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},X={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:X,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(w,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(K,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(w,{icon:F,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=U(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const R=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},k=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),V=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(_,{children:[e.jsx("div",{className:"header",children:e.jsx(Q,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:R,bindButton:t==="passkey"?e.jsx(I,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{k()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:V.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(w,{icon:J}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(P,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:10*60*1e3,webWalletUrl:Y(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{k()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(G,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
1
+ import{j as e,ak as l,aZ as B,T as f,D as H,n as Z,am as $,W as u}from"./vendor-mui-core-CKKG_1TN.js";import{Y as O,u as U,aC as I,w as P,cm as F}from"./index-DI4CWTXR.js";import{V as D,K as w,b8 as Y,a1 as K}from"./vendor-ux-DjXlxcvL.js";import{a as Q}from"./page-header-BZv-tfgN.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{S as W}from"./button-LwkniwV9.js";import{S as _}from"./layout-DzZv-Jny.js";import{S as G}from"./step-actions-BNFJWVZI.js";import"./vendor-arcblock-BCP2x3BR.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-Dtfb5X6M.js";import"./use-mobile-Bz2ML4Gk.js";const J={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},X={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:X,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(w,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(K,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(w,{icon:F,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=U(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const R=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},k=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),V=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(_,{children:[e.jsx("div",{className:"header",children:e.jsx(Q,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:R,bindButton:t==="passkey"?e.jsx(I,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{k()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:V.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(w,{icon:J}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(P,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:10*60*1e3,webWalletUrl:Y(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{k()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(G,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrCTi6nm.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
2
- import{V as fe,_ as be}from"./vendor-ux-DjXlxcvL.js";import{j as e,b6 as U,T as E,ak as x,b2 as je,am as Y,I as A,bO as J,Y as se,at as ve,b5 as ye,$ as we,ca as Ce,A as Z,aJ as Se,cb as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-CKKG_1TN.js";import{c as D}from"./index-BEfIUbZC.js";import{E as N}from"./empty-spinner-BClWI15N.js";import{p as Pe,u as Re}from"./vendor-hooks-DQAdyHrE.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-BwIgGfYj.js";import{S as F}from"./studio-CVfdma-R.js";import"./vendor-utils-CUs2ebe7.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./raf-schd.esm-XXBRsnmf.js";import"./index-yvRJAzQn.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-Bv2O-NCZ.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function 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})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(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:H,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(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:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(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`
2
+ import{V as fe,_ as be}from"./vendor-ux-DjXlxcvL.js";import{j as e,b6 as U,T as E,ak as x,b2 as je,am as Y,I as A,bO as J,Y as se,at as ve,b5 as ye,$ as we,ca as Ce,A as Z,aJ as Se,cb as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-CKKG_1TN.js";import{c as D}from"./index-DI4CWTXR.js";import{E as N}from"./empty-spinner-BClWI15N.js";import{p as Pe,u as Re}from"./vendor-hooks-DQAdyHrE.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-BwIgGfYj.js";import{S as F}from"./studio-CRjDRBty.js";import"./vendor-utils-CUs2ebe7.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./raf-schd.esm-XXBRsnmf.js";import"./index-gohmHhDq.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-mt_AKU_F.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function 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})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(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:H,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(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:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(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{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,cy as o1,at as G,ak as c,aj as W,z as h1,U as n1,I as Y,a6 as d1,by as p1,F as f1,O as x1,dg as $,W as r,c5 as v1,b2 as m1,ar as g1,T as v,a3 as u,Q as V,b6 as u1}from"./vendor-mui-core-CKKG_1TN.js";import{k as j1,M as y1,a1 as Z1,b9 as L1,W as w1}from"./vendor-ux-DjXlxcvL.js";import{v as E1}from"./vendor-hooks-DQAdyHrE.js";import{Z as q,G as _1,ak as b1,J as d}from"./index-BEfIUbZC.js";import{s as k1}from"./sanitize-yX1j-ggS.js";import{F as O1}from"./form-text-input-BsCymY_c.js";import{R as M1}from"./required-DHjZE3-Y.js";import{F as B1}from"./form-wrapper-pwkkz4we.js";import{w as J}from"./permission-CeqEAPPT.js";import{u as R1}from"./use-app-logo-DnCfhAzv.js";import{L as j}from"./logo-uploader-DEFzQY0j.js";import{S as E}from"./section-CenHBXqj.js";import"./vendor-utils-CUs2ebe7.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./omit-BeaKJrg9.js";import"./index-_tncRnTu.js";import"./edit.svg-CTE5eATX.js";import"./session-Cin9Rizr.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:z={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:z,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=G.div`
1
+ import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,cy as o1,at as G,ak as c,aj as W,z as h1,U as n1,I as Y,a6 as d1,by as p1,F as f1,O as x1,dg as $,W as r,c5 as v1,b2 as m1,ar as g1,T as v,a3 as u,Q as V,b6 as u1}from"./vendor-mui-core-CKKG_1TN.js";import{k as j1,M as y1,a1 as Z1,b9 as L1,W as w1}from"./vendor-ux-DjXlxcvL.js";import{v as E1}from"./vendor-hooks-DQAdyHrE.js";import{Z as q,G as _1,ak as b1,J as d}from"./index-DI4CWTXR.js";import{s as k1}from"./sanitize-yX1j-ggS.js";import{F as O1}from"./form-text-input-BsCymY_c.js";import{R as M1}from"./required-DHjZE3-Y.js";import{F as B1}from"./form-wrapper-pwkkz4we.js";import{w as J}from"./permission-DC8i_y8F.js";import{u as R1}from"./use-app-logo-hIHAHSSI.js";import{L as j}from"./logo-uploader-D5E5QaRF.js";import{S as E}from"./section-CenHBXqj.js";import"./vendor-utils-CUs2ebe7.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./omit-BeaKJrg9.js";import"./index-_tncRnTu.js";import"./edit.svg-CTE5eATX.js";import"./session-CZpDtsCZ.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:z={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:z,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=G.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{j as t,ak as r,W as p}from"./vendor-mui-core-CKKG_1TN.js";import m from"./branding-CBavw5s2.js";import{J as o}from"./index-BEfIUbZC.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-DjXlxcvL.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./sanitize-yX1j-ggS.js";import"./omit-BeaKJrg9.js";import"./index-_tncRnTu.js";import"./form-text-input-BsCymY_c.js";import"./required-DHjZE3-Y.js";import"./form-wrapper-pwkkz4we.js";import"./edit.svg-CTE5eATX.js";import"./permission-CeqEAPPT.js";import"./session-Cin9Rizr.js";import"./use-app-logo-DnCfhAzv.js";import"./logo-uploader-DEFzQY0j.js";import"./section-CenHBXqj.js";import"./vendor-arcblock-BCP2x3BR.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
1
+ import{j as t,ak as r,W as p}from"./vendor-mui-core-CKKG_1TN.js";import m from"./branding-_XszRU-Z.js";import{J as o}from"./index-DI4CWTXR.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-DjXlxcvL.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./sanitize-yX1j-ggS.js";import"./omit-BeaKJrg9.js";import"./index-_tncRnTu.js";import"./form-text-input-BsCymY_c.js";import"./required-DHjZE3-Y.js";import"./form-wrapper-pwkkz4we.js";import"./edit.svg-CTE5eATX.js";import"./permission-DC8i_y8F.js";import"./session-CZpDtsCZ.js";import"./use-app-logo-hIHAHSSI.js";import"./logo-uploader-D5E5QaRF.js";import"./section-CenHBXqj.js";import"./vendor-arcblock-BCP2x3BR.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
@@ -1 +1 @@
1
- import{j as u,b2 as x,W as e}from"./vendor-mui-core-CKKG_1TN.js";import{Y as $}from"./vendor-ux-DjXlxcvL.js";import{z as c}from"./vendor-utils-CUs2ebe7.js";import{Z as l,ai as v,bm as j,c as y,bn as E,bo as P}from"./index-BEfIUbZC.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,a=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${a?"~":""}`;let n=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)n=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;n=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:n,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...a}){const r=l(),{logoUrl:n,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=a,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:n,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...a,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
1
+ import{j as u,b2 as x,W as e}from"./vendor-mui-core-CKKG_1TN.js";import{Y as $}from"./vendor-ux-DjXlxcvL.js";import{z as c}from"./vendor-utils-CUs2ebe7.js";import{Z as l,ai as v,bm as j,c as y,bn as E,bo as P}from"./index-DI4CWTXR.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,a=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${a?"~":""}`;let n=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)n=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;n=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:n,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...a}){const r=l(),{logoUrl:n,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=a,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:n,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...a,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
@@ -1,4 +1,4 @@
1
- import{at as E,j as e,ak as m,W as V}from"./vendor-mui-core-CKKG_1TN.js";import{aA as X,y as ne,K as H,cw as oe,q as ae,l as ie,cx as O,c as ce,o as le,r as ue,cy as de,O as me}from"./index-BEfIUbZC.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{ae as he,a6 as pe,B as fe,F as ge,z as q}from"./vendor-utils-CUs2ebe7.js";import{b as we,a as j}from"./vendor-hooks-DQAdyHrE.js";import{u as xe}from"./launch-result-message-C04PaKk0.js";import{V as be,a3 as ke,W as K}from"./vendor-ux-DjXlxcvL.js";import{g as ye}from"./get-safe-url-DxqVk96E.js";import{S as Q}from"./button-LwkniwV9.js";import{S as Ue}from"./layout-DRVZ4L0D.js";import{p as Re,P as Se,S as Le}from"./starting-progress-BiI8hmaj.js";import"./vendor-arcblock-BCP2x3BR.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-Dtfb5X6M.js";const ve=E(xe)`
1
+ import{at as E,j as e,ak as m,W as V}from"./vendor-mui-core-CKKG_1TN.js";import{aA as X,y as ne,K as H,cw as oe,q as ae,l as ie,cx as O,c as ce,o as le,r as ue,cy as de,O as me}from"./index-DI4CWTXR.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{ae as he,a6 as pe,B as fe,F as ge,z as q}from"./vendor-utils-CUs2ebe7.js";import{b as we,a as j}from"./vendor-hooks-DQAdyHrE.js";import{u as xe}from"./launch-result-message-C04PaKk0.js";import{V as be,a3 as ke,W as K}from"./vendor-ux-DjXlxcvL.js";import{g as ye}from"./get-safe-url-BVTaUfvO.js";import{S as Q}from"./button-LwkniwV9.js";import{S as Ue}from"./layout-DzZv-Jny.js";import{p as Re,P as Se,S as Le}from"./starting-progress-Y3UjFmoX.js";import"./vendor-arcblock-BCP2x3BR.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-Dtfb5X6M.js";const ve=E(xe)`
2
2
  && .result-footer {
3
3
  height: 120px;
4
4
  > div {