@abtnode/blocklet-services 1.16.45-beta-20250610-112229-2eb0face → 1.16.45-beta-20250612-231219-481217be
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.
- package/api/cache.js +36 -21
- package/api/libs/connect/session.js +2 -2
- package/api/middlewares/proxy-to-daemon.js +6 -2
- package/api/routes/blocklet.js +25 -5
- package/api/routes/dns-resolver.js +1 -1
- package/api/routes/env.js +2 -1
- package/api/services/auth/connect/invite.js +1 -1
- package/api/services/auth/connect/issue-passport.js +1 -1
- package/api/services/auth/connect/verify-destroy.js +3 -6
- package/api/services/auth/connect/verify-elevated.js +8 -9
- package/api/services/auth/session.js +1 -1
- package/api/services/oauth/server.js +2 -1
- package/api/socket/channel/did.js +2 -2
- package/dist/assets/{AdapterDayjs-Dvf_tKNm.js → AdapterDayjs-BzjU9O7t.js} +1 -1
- package/dist/assets/{ArrowDropDown-w902LDz5.js → ArrowDropDown-CrJjI_sT.js} +1 -1
- package/dist/assets/{CheckCircle-DKLAiayP.js → CheckCircle-BcPSvH2E.js} +1 -1
- package/dist/assets/{ChevronLeft-DoQQtCAX.js → ChevronLeft-Ch9iK6fF.js} +1 -1
- package/dist/assets/{ChevronRight-Ch_6RLsY.js → ChevronRight-DclARA5k.js} +1 -1
- package/dist/assets/{DeleteOutline-CPVsjCvJ.js → DeleteOutline-CnS2XiM1.js} +1 -1
- package/dist/assets/{Done-C5C8-4SV.js → Done-C9LPqADS.js} +1 -1
- package/dist/assets/{Download-DqajrKRK.js → Download-D9LfWoxF.js} +1 -1
- package/dist/assets/{Edit-D_qzRYqq.js → Edit-rPlryssW.js} +1 -1
- package/dist/assets/{Error-KxELF1Nr.js → Error-q_AhSCeT.js} +1 -1
- package/dist/assets/{ExpandLess-JVHHKQQZ.js → ExpandLess-Da2Rv9Ox.js} +1 -1
- package/dist/assets/{Google-BBqC-Muc.js → Google-Buu8u6PW.js} +1 -1
- package/dist/assets/{Home-DD-eYV7C.js → Home-DkCBzKe9.js} +1 -1
- package/dist/assets/{InfoOutlined-CEh25_NY.js → InfoOutlined-C8ZBPUhD.js} +1 -1
- package/dist/assets/{Launch-Cs8Cmdb_.js → Launch-Nu8TBDKk.js} +1 -1
- package/dist/assets/{LaunchOutlined-CH9e3hkq.js → LaunchOutlined-DQZ7S23O.js} +1 -1
- package/dist/assets/{MoreHoriz-Cpg0a_lm.js → MoreHoriz-Ba9rYlyz.js} +1 -1
- package/dist/assets/{PlayArrow-Hu915_DX.js → PlayArrow-RVSfCmrB.js} +1 -1
- package/dist/assets/{TuneOutlined-DRDP7kDe.js → TuneOutlined-CwV20zYf.js} +1 -1
- package/dist/assets/{ViewList-DN8B89Ry.js → ViewList-D1BI4ac9.js} +1 -1
- package/dist/assets/{access-control-MsBNowAW.js → access-control-C-kFaf9T.js} +1 -1
- package/dist/assets/{actions-CcWHhKZq.js → actions-DYQW2ChM.js} +1 -1
- package/dist/assets/{add-component-core-C3s0hRWv.js → add-component-core-UeQfX1b1.js} +34 -34
- package/dist/assets/{add-resource-LwzRr27k.js → add-resource-BdL-oJxe.js} +1 -1
- package/dist/assets/{addon-Dju3pjTL.js → addon-DMedfvRj.js} +1 -1
- package/dist/assets/{advanced-DYaxCBlN.js → advanced-BZZToP_j.js} +2 -2
- package/dist/assets/api-87p2GGd0.js +1 -0
- package/dist/assets/{appearance-A-FJhFPq.js → appearance-CYop22yw.js} +1 -1
- package/dist/assets/{audit-logs-Cs45RZoE.js → audit-logs-BtBk6uAY.js} +1 -1
- package/dist/assets/{authorize-fdrPc1Nd.js → authorize-CQZkUNyV.js} +1 -1
- package/dist/assets/{base-chart-DIErGYHN.js → base-chart-C2FJuVG1.js} +1 -1
- package/dist/assets/{base32-Do9iD28a.js → base32-DEjena1X.js} +1 -1
- package/dist/assets/{branding-CT66qulY.js → branding-7ppDxFZf.js} +2 -2
- package/dist/assets/{branding-OfbhdEgY.js → branding-gXMozCeI.js} +1 -1
- package/dist/assets/{bundle-avatar-LAkmelll.js → bundle-avatar-B5-ypzmO.js} +1 -1
- package/dist/assets/{button-B_vgCyye.js → button-YPMo8IwK.js} +1 -1
- package/dist/assets/{click-to-copy-BfYfYud0.js → click-to-copy-BMX2P5UB.js} +1 -1
- package/dist/assets/{cloneDeep-ro06l5HL.js → cloneDeep-Jl_OPbSo.js} +1 -1
- package/dist/assets/{collapse-DRY-fGId.js → collapse-9taxUXec.js} +1 -1
- package/dist/assets/{complete-kFFCUlMp.js → complete-C8T0HN-B.js} +1 -1
- package/dist/assets/{component-DkUWDmEA.js → component-D6hOmRzO.js} +1 -1
- package/dist/assets/{config-Dw2MWXp7.js → config-DcwlSddI.js} +1 -1
- package/dist/assets/{config-WtCW9USL.js → config-Sq1CUTiJ.js} +1 -1
- package/dist/assets/{config-navigation-DxvpF5im.js → config-navigation-IR_yUgmM.js} +3 -3
- package/dist/assets/{config-space-CU10Rw2i.js → config-space-C3fS58cn.js} +1 -1
- package/dist/assets/{confirm-Vh9bFw1L.js → confirm-DApmnpvm.js} +1 -1
- package/dist/assets/{connect-lFo0rnUJ.js → connect-BF4GoRL-.js} +1 -1
- package/dist/assets/{connect-Cg0d_ebx.js → connect-Bf8y7fMm.js} +1 -1
- package/dist/assets/{connect-to-1dd-PxCa.js → connect-to-Bwfa2hMr.js} +1 -1
- package/dist/assets/{dashboard-BS4bpY03.js → dashboard-B2X6c8E8.js} +3 -3
- package/dist/assets/{delete-confirm-CzUZlQMV.js → delete-confirm-BsEqJQRY.js} +1 -1
- package/dist/assets/{did-address-Ca4O6-Gb.js → did-address-L54dTMrT.js} +1 -1
- package/dist/assets/{domain-CcapWTGW.js → domain-BGh0GDuZ.js} +1 -1
- package/dist/assets/{domain-action-card-BxEOdRG6.js → domain-action-card-DWqnvzry.js} +1 -1
- package/dist/assets/domains-CdwErmIF.js +1 -0
- package/dist/assets/{dot-ClH4jhsr.js → dot-iw3hN9HL.js} +1 -1
- package/dist/assets/{email-BKF-qRvM.js → email-By_nAv9m.js} +1 -1
- package/dist/assets/{exchange-passport-C05YacXz.js → exchange-passport-BsgMfRJS.js} +1 -1
- package/dist/assets/{fuel-D5i0LwEE.js → fuel-RMmgm9AQ.js} +1 -1
- package/dist/assets/{gen-access-key-OYE9vkTV.js → gen-access-key-4teK8Dys.js} +1 -1
- package/dist/assets/{get-safe-url-CJuFtnAD.js → get-safe-url-B8xlSMyD.js} +1 -1
- package/dist/assets/{get-safe-url-ClddTGUv.js → get-safe-url-t1C0E5Ux.js} +1 -1
- package/dist/assets/{home-DR0M74FO.js → home-CmHUXg5q.js} +1 -1
- package/dist/assets/{iframe-CymxKzen.js → iframe-Dj9NLHp2.js} +1 -1
- package/dist/assets/{index-BpvW-cUy.js → index-BCtTVvHw.js} +1 -1
- package/dist/assets/{index-BtF2_mmu.js → index-Bb7iSrGO.js} +1 -1
- package/dist/assets/{index-BSIauQNZ.js → index-Be8E3hiQ.js} +1 -1
- package/dist/assets/{index-DqYKLMVq.js → index-BeE0KRva.js} +1 -1
- package/dist/assets/{index-DJmmHgxv.js → index-BzZuK-66.js} +1 -1
- package/dist/assets/{index-BJQsWjyx.js → index-C8uNNoMb.js} +1 -1
- package/dist/assets/{index-DGclkoMp.js → index-CCOwwQoc.js} +1 -1
- package/dist/assets/{index-iO-8g74B.js → index-CJQbYw9E.js} +1 -1
- package/dist/assets/{index-Dntq1ezd.js → index-CKY4HT0P.js} +1 -1
- package/dist/assets/{index-6_wWEItq.js → index-CMYalRl2.js} +5 -5
- package/dist/assets/{index-B354cP6P.js → index-Cs3-IS09.js} +1 -1
- package/dist/assets/{index-BbupHZzB.js → index-DXeoVV9Y.js} +1 -1
- package/dist/assets/{index-DZfl-BHr.js → index-DaM-GRtb.js} +1 -1
- package/dist/assets/{index-Cphaf-Ek.js → index-Dfw2EDXA.js} +4 -4
- package/dist/assets/{index-BTKm4T5J.js → index-Dgsq6V-N.js} +1 -1
- package/dist/assets/{index--zVoF7lp.js → index-DtZg53T9.js} +1 -1
- package/dist/assets/{index-CRe5KsOj.js → index-F85lIJcp.js} +1 -1
- package/dist/assets/{index-Hgoqly4p.js → index-Inc_KF9k.js} +3 -3
- package/dist/assets/{index-CaercczO.js → index-Mzv6hCex.js} +1 -1
- package/dist/assets/{index-CMXod_BF.js → index-NnUiYa0L.js} +1 -1
- package/dist/assets/{index-D5uPwJ6o.js → index-SX_KWrQh.js} +1 -1
- package/dist/assets/{invitation-CHKJRReb.js → invitation-Ck_kq3Tr.js} +1 -1
- package/dist/assets/{invite-BIyTLjFG.js → invite-89aeW4Ho.js} +1 -1
- package/dist/assets/{issue-passport-D_1dgjgm.js → issue-passport-4udVYVdq.js} +1 -1
- package/dist/assets/{item-Cvm3RZ4-.js → item-D0U5vYXJ.js} +1 -1
- package/dist/assets/{layout-7LZ3RpDb.js → layout-CQb1lhEv.js} +1 -1
- package/dist/assets/{list-CqGQfIx9.js → list-BOdwWlS0.js} +2 -2
- package/dist/assets/{list-Bz8uJNpj.js → list-KVxvPXZu.js} +1 -1
- package/dist/assets/localization-OxVxEhoS.js +1 -0
- package/dist/assets/{log-CEcMfPWb.js → log-DOIh9luu.js} +1 -1
- package/dist/assets/{logger-DMlN-IbM.js → logger-Dhaq1LDX.js} +1 -1
- package/dist/assets/{login-y0a0ypm7.js → login-J6Bsrh3B.js} +1 -1
- package/dist/assets/{login-oauth-callback-CnAgJXgp.js → login-oauth-callback-BRmEibAb.js} +1 -1
- package/dist/assets/{logo-uploader-BAsVxZ3U.js → logo-uploader-Dzebv-rF.js} +3 -3
- package/dist/assets/{lost-passport-D-GKwrh2.js → lost-passport-p5ZuXjnG.js} +1 -1
- package/dist/assets/{omit-O1pUD7ku.js → omit-BlzmxIB5.js} +1 -1
- package/dist/assets/{open-window-B-GejaY2.js → open-window-Byi7CkW_.js} +1 -1
- package/dist/assets/{overview-V76wvba7.js → overview-ClOSCvvh.js} +1 -1
- package/dist/assets/{page-header-huQjTQSw.js → page-header-C_KAJILy.js} +1 -1
- package/dist/assets/{passport-item-tcnz8j0r.js → passport-item-Du8-xENr.js} +1 -1
- package/dist/assets/{permission-BfejVUva.js → permission-ClRym5FB.js} +1 -1
- package/dist/assets/{preferences-6lvT1ugx.js → preferences-B6Y0XpLo.js} +1 -1
- package/dist/assets/{profile-embed-BqPZ87OZ.js → profile-embed-C_hd_hMh.js} +1 -1
- package/dist/assets/publish-resource-kHaYkbDE.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-Btnab_OF.js → react-beautiful-dnd.esm-CHsohizU.js} +1 -1
- package/dist/assets/{runtime-qegegcsI.js → runtime-D5P_2uNM.js} +1 -1
- package/dist/assets/{sanitize-DbZs1H_T.js → sanitize-B18rcrOf.js} +1 -1
- package/dist/assets/sdk-CbugbTkF.js +1 -0
- package/dist/assets/{security-Cxiq1ziT.js → security-CXewZHyS.js} +1 -1
- package/dist/assets/{session-CwC5SgVz.js → session-Bkvl2PSP.js} +1 -1
- package/dist/assets/{setup-Dilg0too.js → setup-TPtYDnBB.js} +3 -3
- package/dist/assets/{spaces-Cgazj3bm.js → spaces-C1lh7et6.js} +1 -1
- package/dist/assets/{start-FFKcgzTb.js → start-BgSlMXsE.js} +1 -1
- package/dist/assets/{starting-progress-CKWusmmh.js → starting-progress-BikYigPA.js} +1 -1
- package/dist/assets/{status-D98jk27v.js → status-DDvFiBxA.js} +1 -1
- package/dist/assets/{step-actions-Cp7vl1Uh.js → step-actions-_23FIn8v.js} +1 -1
- package/dist/assets/{studio-CvtVT5aS.js → studio-Db5oA_Tx.js} +1 -1
- package/dist/assets/{switch-control-DCl96cpf.js → switch-control-BYqb8MZf.js} +1 -1
- package/dist/assets/{table-tips-DdnbF0LB.js → table-tips-BW6G2sKO.js} +1 -1
- package/dist/assets/{traffic-Bf1b6xSQ.js → traffic-CUSLm0PX.js} +1 -1
- package/dist/assets/{transfer-ChzHdW_I.js → transfer-CSsXAviu.js} +1 -1
- package/dist/assets/{unsubscribe-CRSsqbPw.js → unsubscribe-BA46-fTa.js} +1 -1
- package/dist/assets/{use-blocklet-logo-D73B-sw0.js → use-blocklet-logo-CTCMbFiC.js} +1 -1
- package/dist/assets/{useAsync-B6ZHbOEG.js → useAsync-DVHp96Uu.js} +1 -1
- package/dist/assets/{useLocalStorage-B85cd9HR.js → useLocalStorage-DyVGBDlt.js} +1 -1
- package/dist/assets/{user-center-h3PNeVcw.js → user-center-Cap4mg5H.js} +3 -3
- package/dist/assets/{util-SfP61JNJ.js → util-DlS4tWs9.js} +1 -1
- package/dist/assets/{util-B5wObXV8.js → util-M3UFXQFT.js} +1 -1
- package/dist/assets/{vendor-arcblock-qCd0o3Hz.js → vendor-arcblock-DiSm3oUX.js} +5 -5
- package/dist/assets/{vendor-hooks-BCm626KH.js → vendor-hooks-BFlOfe0M.js} +1 -1
- package/dist/assets/vendor-utils-BotmZdBm.js +208 -0
- package/dist/assets/{vendor-ux-did-connect-dVrbSJfQ.js → vendor-ux-did-connect-DVX9lQ8a.js} +60 -60
- package/dist/assets/{wrap-locale-C5884ev0.js → wrap-locale-B8EvOR-l.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +33 -33
- package/dist/assets/api-CQoRx33p.js +0 -1
- package/dist/assets/domains-C9MeMLdA.js +0 -1
- package/dist/assets/localization-gg0fgyqC.js +0 -1
- package/dist/assets/publish-resource-BqdiC6O1.js +0 -1
- package/dist/assets/sdk-DOmS9lyP.js +0 -1
- package/dist/assets/vendor-utils-B3iZkn2R.js +0 -208
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m}from"./vendor-react-DEoibe3W.js";import{a as w,k as C,a2 as T,ax as P,bZ as R}from"./vendor-ux-did-connect-
|
|
1
|
+
import{r as m}from"./vendor-react-DEoibe3W.js";import{a as w,k as C,a2 as T,ax as P,bZ as R}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{l as v}from"./vendor-hooks-BFlOfe0M.js";import{j as e,aa as s,ab as y,ak as j,al as L,bo as M,br as W,bn as B,q as _,ap as A,I as D,y as z,H as F}from"./vendor-mui-core-Bq8gXTan.js";import{d as q}from"./Launch-Nu8TBDKk.js";import{a as K}from"./api-87p2GGd0.js";import{T as N}from"./table-tips-BW6G2sKO.js";import{D as k}from"./index-CMYalRl2.js";import{u as U}from"./dashboard-B2X6c8E8.js";import"./vendor-utils-BotmZdBm.js";import"./lottie-web-jYmAQWuC.js";import"./InfoOutlined-C8ZBPUhD.js";import"./use-mobile-DwzRjjku.js";import"./vendor-arcblock-DiSm3oUX.js";import"./useLocalStorage-DyVGBDlt.js";import"./index-8eXqqyHQ.js";import"./confirm-DApmnpvm.js";import"./PlayArrow-RVSfCmrB.js";import"./get-safe-url-B8xlSMyD.js";import"./session-Bkvl2PSP.js";import"./use-blocklet-logo-CTCMbFiC.js";import"./dot-iw3hN9HL.js";import"./useAsync-DVHp96Uu.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";function $({endpoint:n}){const[i,r]=m.useState("mcp-link"),h=k(),{api:g}=k(),{teamDid:p}=U(),{t:u,locale:d}=w(),{data:o,run:b,loading:x}=v(()=>g.createAccessKey({input:{teamDid:p,passport:C.SERVER_ROLES.ADMIN,authType:"simple",remark:"Generated by MCP Servers"}}),{manual:!0}),{imgPrefix:t}=h,a=m.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[t]),l=a.find(c=>c.value===i),f=m.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.accessKeySecret},[o]),S=m.useMemo(()=>!f&&i!=="mcp-link",[f,i]),I=c=>{const E=`npx @blocklet/install-mcp@latest i ${n} --client ${c} --streamableHTTP --oauth2Bearer ${f}`;switch(c){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return E;case"mcp-link":default:return n}};return e.jsxs(s,{children:[e.jsx(P,{tabs:a,current:i,onChange:r,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(s,{component:"h2",children:i==="mcp-link"?l==null?void 0:l.label:`${l==null?void 0:l.label} ${u("installCommand")}`}),i!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${d}/mcp-${i}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(q,{})})})]}),e.jsxs(s,{position:"relative",sx:{"& .codeblock__inner":{overflow:"auto !important"}},children:[e.jsx(R,{code:I(i),language:"shell",style:{margin:0}}),S&&e.jsx(s,{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",sx:{bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:x?e.jsx(y,{}):e.jsx(z,{variant:"contained",color:"primary",onClick:b,size:"small",children:`${u("common.generate")} ${u("command")}`})})]})]})]})}$.propTypes={endpoint:F.string.isRequired};function ge(){var x;const[n,i]=m.useState(null),{t:r,locale:h}=w(),g=`${(x=window==null?void 0:window.blocklet)==null?void 0:x.appUrl}${C.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:p,loading:u,error:d}=v(()=>Promise.all([K.get(g)])),o=m.useMemo(()=>{var t,a;return((a=(t=p==null?void 0:p[0])==null?void 0:t.data)==null?void 0:a.servers)||[]},[p]);m.useEffect(()=>{o!=null&&o.length&&i(o.find(t=>{var a;return t.did===((a=window==null?void 0:window.blocklet)==null?void 0:a.did)})||o[0])},[o]);const b=t=>{const a=t.target.value;i(o.find(l=>l.did===a))};return u?e.jsx(s,{children:e.jsx(y,{})}):d?e.jsx(j,{color:"error",children:d==null?void 0:d.message}):o!=null&&o.length?e.jsxs(L,{gap:2,sx:{maxWidth:1200},children:[e.jsx(N,{title:r("mcp.listTitle"),tooltipTitle:r("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${h}/mcp-server`}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(W,{id:"server-select-label",children:r("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:(n==null?void 0:n.did)||"",label:r("mcp.available"),onChange:b,children:o.map(t=>e.jsx(_,{value:t.did,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(T,{variant:"rounded",shape:"square",did:t.did,src:t.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:t.name})]})},t.did))})]}),n&&e.jsx($,{endpoint:n.endpoint})]}):e.jsx(j,{color:"warning",children:r("mcp.noServer")})}export{ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as S,g as Ee,b as dt}from"./vendor-react-DEoibe3W.js";import{a as pt,l as ne}from"./vendor-hooks-
|
|
1
|
+
import{r as S,g as Ee,b as dt}from"./vendor-react-DEoibe3W.js";import{a as pt,l as ne}from"./vendor-hooks-BFlOfe0M.js";import{j as e,aa as y,H as w,ah as H,E as ut,T as E,X as mt,al as te,ad as Y,ab as $,ak as $e,a9 as ft,I as q,O as W,q as oe,N as ht,br as Me,cl as Oe,cm as ee,bT as We,bq as qe,bx as xt,bs as gt,bR as yt,v as jt,y as vt,bn as bt,s as Ct}from"./vendor-mui-core-Bq8gXTan.js";import{a as L,ar as U,ax as St,$ as fe,a3 as A,ac as xe,k as G,aV as Tt,B as _,r as wt,a5 as ge,bH as He,i as Ue,bg as Pt,b_ as Ae,bu as It,bG as Rt}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{D as F,y as Ge,n as Dt,V as J,G as kt,ad as At,f as Ft,b as re,aE as Nt,T as Ve}from"./index-CMYalRl2.js";import{l as Lt,c as Bt,v as ye,M as X}from"./vendor-arcblock-DiSm3oUX.js";import{W as je}from"./did-address-L54dTMrT.js";import{u as M}from"./dashboard-B2X6c8E8.js";import{r as ve,a as be,b as Ce,c as ie,d as zt,e as Ke,u as _t,f as Et}from"./passport-item-Du8-xENr.js";import{p as Ye}from"./util-M3UFXQFT.js";import{u as $t}from"./use-mobile-DwzRjjku.js";import{w as V,P as Ze}from"./permission-ClRym5FB.js";import{C as Mt}from"./Google-Buu8u6PW.js";import{P as Z,aA as Ot,K as Wt}from"./vendor-utils-BotmZdBm.js";import{E as le}from"./EditIcon-DfiDnAsm.js";import{C as Se}from"./confirm-DApmnpvm.js";import{L as Je}from"./list-header-C7gle0n0.js";import{f as se}from"./index-8eXqqyHQ.js";import{_ as qt}from"./useSetState-CWq0AVWn.js";import{L as Ht}from"./LockIcon-BEG59s5q.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DyVGBDlt.js";import"./PlayArrow-RVSfCmrB.js";import"./get-safe-url-B8xlSMyD.js";import"./session-Bkvl2PSP.js";import"./use-blocklet-logo-CTCMbFiC.js";import"./InfoOutlined-C8ZBPUhD.js";import"./dot-iw3hN9HL.js";import"./useAsync-DVHp96Uu.js";import"./use-mobile-CtTQsfXN.js";import"./base32-DEjena1X.js";import"./cloneDeep-Jl_OPbSo.js";const Fe="info";function Te({createPassportSvg:c,passport:o,onCancel:d,onSwitchPassport:f}){const{t:u}=L(),l=pt({tab:Fe}),h={info:{label:u("common.basicInfo"),value:Fe,component:()=>e.jsx(Qe,{passport:o,createPassportSvg:c})},logs:{label:u("common.logs"),value:"logs",component:()=>e.jsx(tt,{passport:o})},related:{label:u("team.passport.related"),value:"related",component:()=>e.jsx(st,{passport:o,onSwitchPassport:f})}},s=Object.values(h).map(({label:n,value:t})=>({label:n,value:t})).filter(n=>n.value==="related"?o.parentDid:!0),m=h[l.tab]||h.info,r=n=>{l.tab=n};return e.jsx(U,{title:u("common.passport"),onClose:d,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ut,{children:[e.jsx(y,{className:"tabs",children:e.jsx(St,{tabs:s,current:l.tab,onChange:r,scrollButtons:"auto"})}),e.jsx(y,{className:"body",children:e.jsx(m.component,{})})]})})}Te.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};Te.defaultProps={onSwitchPassport:()=>{}};const Ut=H(y)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,H as h,ah as Je,T as C,ab as A,e as Ze,cD as Z,ae as G,cE as Ge,aa as j,al as W,s as ge,ad as Se,ap as et,cF as ze,a9 as ye,q,b7 as Y,b8 as H,y as tt,at as st,as as Ae}from"./vendor-mui-core-Bq8gXTan.js";import{l as nt,i as Pe,b as fe}from"./vendor-hooks-
|
|
1
|
+
import{j as e,H as h,ah as Je,T as C,ab as A,e as Ze,cD as Z,ae as G,cE as Ge,aa as j,al as W,s as ge,ad as Se,ap as et,cF as ze,a9 as ye,q,b7 as Y,b8 as H,y as tt,at as st,as as Ae}from"./vendor-mui-core-Bq8gXTan.js";import{l as nt,i as Pe,b as fe}from"./vendor-hooks-BFlOfe0M.js";import{r as y,h as ot}from"./vendor-react-DEoibe3W.js";import{c as _,y as rt,W as at,J as it,X as ct,l as lt,w as dt,Y as ue,x as ut}from"./vendor-arcblock-DiSm3oUX.js";import{a3 as B,a as T,bb as pt,k as R,bg as V,ac as mt,r as je,bD as ft,B as pe,at as ht,F as _e,ax as xt}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{G as O,D as M,y as E,a3 as gt,af as St,aF as yt}from"./index-CMYalRl2.js";import{u as jt}from"./use-mobile-DwzRjjku.js";import{b as Q,d as Me,a8 as bt,I as Ct,E as Ue,A as he}from"./vendor-utils-BotmZdBm.js";import"./api-87p2GGd0.js";import{u as Ne,C as kt,D as Dt,a as Bt}from"./connect-to-Bwfa2hMr.js";import{b as wt,c as Et,d as Tt,i as It,e as xe,f as Rt,h as vt,j as At}from"./spaces-C1lh7et6.js";import{f as X}from"./index-8eXqqyHQ.js";import{I as Ot}from"./index-BzZuK-66.js";import{R as Lt}from"./index-CKY4HT0P.js";import{d as zt}from"./MoreHoriz-Ba9rYlyz.js";import{c as Pt}from"./dashboard-B2X6c8E8.js";import{d as _t}from"./DeleteOutline-CnS2XiM1.js";import{g as Oe}from"./get-safe-url-B8xlSMyD.js";import{S as Mt}from"./switch-control-BYqb8MZf.js";import{C as Ut,u as Nt}from"./config-space-C3fS58cn.js";import{L as Le}from"./list-header-C7gle0n0.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DyVGBDlt.js";import"./confirm-DApmnpvm.js";import"./PlayArrow-RVSfCmrB.js";import"./session-Bkvl2PSP.js";import"./use-blocklet-logo-CTCMbFiC.js";import"./InfoOutlined-C8ZBPUhD.js";import"./dot-iw3hN9HL.js";import"./useAsync-DVHp96Uu.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";async function Wt({blockletDid:t,nodeApi:r,spaceGateways:o}){let s=!1;const i=await Promise.all(o.map(async n=>{let{name:a}=n;const d=await wt(n.endpoint);return!Q(d)&&d!==a&&(a=d,s=!0),{...n,name:a}}));return s&&await Promise.all(i.filter(n=>n.did).map(n=>r.updateBlockletSpaceGateway({input:{did:t,where:{did:n.did},spaceGateway:{...n}}}))),i}function Ft({refresh:t}={}){var i;const{blocklet:r}=O(),o=(i=r==null?void 0:r.meta)==null?void 0:i.did,{api:s}=M();return nt(async()=>{if(!o)return[];const{spaceGateways:n}=await s.getBlockletSpaceGateways({input:{did:o}});return await Wt({blockletDid:o,nodeApi:s,spaceGateways:n})??[]},{refreshDeps:[o,t],onError(n){var a;(a=n==null?void 0:n.message)!=null&&a.includes("not logged")?console.warn(n):(console.error(n),B.error(X(n)))}})}function We({deps:t,setLoading:r,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[i,n]=y.useState([]),{api:a}=M(),[d,u]=y.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),c=Me(async()=>{try{if(r(!0),!s){n([]);return}const{backups:p}=await a.getBlockletBackups({input:{did:s.meta.did,startTime:d,endTime:u}});n(p??[])}catch(p){console.error(p),B.error(X(p))}finally{r(!1)}},1e3);return Pe(async()=>{c()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:i}}function Kt({appDid:t}){const{backups:r}=We(),[o,s]=y.useState({message:"",progress:0,completed:!1}),i=M(),{ws:{useSubscription:n}}=i;return n(_.BlockletEvents.backupProgress,a=>{t===(a==null?void 0:a.appDid)&&s(()=>({...a}))},[t]),y.useEffect(()=>{var a;if(r!=null&&r.length&&bt((a=r[0])==null?void 0:a.status)){const[d]=r;s(()=>({message:d.message,progress:d.progress,completed:d.progress>=100}))}},[r]),o}function $t({deps:t=[],setLoading:r=()=>{}}={}){var d;const{blocklet:o}=O(),[s,i]=y.useState([]),{api:n}=M(),a=y.useCallback(Me(async()=>{var u;if(!n||!((u=o==null?void 0:o.meta)!=null&&u.did)){i([]);return}try{r(!0);const c=E(),x=c.subtract(1,"year"),{summary:p}=await n.getBlockletBackupSummary({input:{did:o.meta.did,startTime:x.toISOString(),endTime:c.toISOString()}});i(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(X(c)),i([])}finally{r(!1)}},1e3),[]);return Pe(async()=>(await a(),()=>{a.cancel()}),[(d=o==null?void 0:o.meta)==null?void 0:d.did].concat(t)),{backupSummary:s}}const Fe=y.createContext({}),{Provider:qt,Consumer:Ws}=Fe;function be({children:t}){var K;const{t:r}=T(),{api:o}=M(),{blocklet:s}=O(),[i,n]=y.useState(null),[a,d]=y.useState(!1),{data:u,loading:c,mutate:x}=Ft({refresh:a}),p=Ct(u),g=Kt({appDid:s==null?void 0:s.appDid}),f=y.useMemo(()=>Et(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[b,D]=y.useState(!1),[S,l]=y.useState(!1),{backups:te}=We({deps:[S,i],setLoading:D,backupDate:i}),[se,ne]=y.useState(!1),{backupSummary:oe}=$t({deps:[se]}),[U,z]=y.useState(u==null?void 0:u.find(m=>m.endpoint===f)),I=(K=s==null?void 0:s.settings)==null?void 0:K.autoBackup,v=()=>{d(m=>!m)},re=()=>{ne(m=>!m)},ae=()=>{l(m=>!m)},F=async m=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:m}})},J=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(m,N)=>{try{x(w=>{const P=[...w];return P.push({...m,loading:!0}),P}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:m}}),f!==N&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),z(m),v(),B.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(w){throw console.error(w),x(P=>[...P].filter(de=>de.did!==m.did)),w}},ce=async m=>{m&&(m.endpoint===f&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await F({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),x(N=>{const w=[...N];return w.splice(w.indexOf(m),1),w}),z(m),v())},le=async m=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:m.did},spaceGateway:m}}),f!==m.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),B.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===f;return e.jsx(qt,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:F,abortBlockletBackup:J,backupEndpoint:f,backupProgress:g,backups:te,backupSummary:oe,refreshBackupSummary:re,refreshBackups:ae,setBackupDate:n,backupsLoading:b,autoBackup:I},children:t})}be.propTypes={children:h.any.isRequired};be.defaultProps={};function L(){return y.useContext(Fe)}function ee({...t}){const{blocklet:r}=O(),{info:o}=M(),{t:s}=T(),i=Ne({blocklet:r}),n=gt(o),{spaceGateways:a,addSpaceGateway:d}=L(),u={checkFn:Ue.create({baseURL:he(window.location.origin,St())}).get,webWalletUrl:n,extraParams:{appPid:r.appPid,appDid:i.appDid,appName:i.appName,appDescription:i.appDescription,appUrl:i.appUrl,referrer:i.referrer,scopes:i.scopes,nodeDid:o.did}},c=async({endpoint:p,name:g,did:f})=>{const b=await Tt(p);if(!await It(b)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(a.some(l=>l.endpoint===p)){B.error(s("storage.spaces.gateway.add.duplicate",{name:g}));return}await d({name:g,did:f,url:b,endpoint:p},p)},x=async({spaceGateway:p})=>{try{await c(p)}catch(g){console.error(g),B.error(X(g))}};return e.jsx(rt,{...t,connectScope:"app",options:u,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Ke({...t}){const{t:r}=y.useContext(pt),{blocklet:o,loadingDiskInfo:s,actions:i}=O();if(y.useEffect(()=>{i==null||i.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),o.diskInfo){const n=(u,c,x)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?yt(c):"empty"})]}),a=o.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),d=[{key:"appDir",name:r("blocklet.diskInfo.appDir"),value:n(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:r("blocklet.diskInfo.dataDir"),value:n(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:r("blocklet.diskInfo.logDir"),value:n(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:r("blocklet.diskInfo.cacheDir"),value:n(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Yt,{component:"div",...t,children:d.map(u=>e.jsx(Ot,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return s?e.jsx(A,{}):e.jsx(C,{children:r("blocklet.diskInfo.empty")})}const Yt=Je(C)``;function Ce(){const{t}=T(),{setBackupDate:r,backupSummary:o}=L(),s=at({key:"lg"}),i=y.useRef(null),n=Ze(),a=y.useCallback(c=>{r(c)},[r]),d=y.useMemo(()=>{const c=E().add(1,"day"),x=E().subtract(11,"month").startOf("month"),p=new Map(o.map(f=>[f.date,{date:f.date,successCount:f.successCount,errorCount:f.errorCount}])),g=[];for(let f=x.clone();E(f).isBefore(c);f=f.add(1,"day")){const b=f.format("YYYY-MM-DD");g.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return g},[o]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:l}=d[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${l}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:Z[600]},{min:-9,max:-6,color:Z[500]},{min:-6,max:-3,color:Z[400]},{min:-3,max:-1,color:Z[300]},{min:0,max:0,color:n.palette.grey[200]},{min:1,max:3,color:G[300]},{min:3,max:6,color:G[400]},{min:6,max:9,color:G[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:G[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:n.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,color:n.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:n.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:n.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:d.map(b=>[b.date,b.errorCount?-b.errorCount:b.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ge[200],color:"inherit"}}}}),[d,t,n]);return e.jsxs(e.Fragment,{children:[e.jsx(j,{ref:i,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(j,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Lt,{option:u,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&a(c.data[0])}}})})}),e.jsx(j,{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2,children:e.jsxs(W,{direction:s?"column":"row",spacing:s?2:1,width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center",children:[e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.failed")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.without")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.succeeded")})]})]})})]})}Ce.propTypes={};const Ht=ge(({className:t,...r})=>e.jsx(Se,{...r,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function ke({status:t,message:r,createdAt:o}){const{t:s}=T(),i=t===R.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=R.BACKUPS.TIMEOUT_HOURS,n=i&&s("common.timeoutError"),a=t===R.BACKUPS.STATUS.PROGRESS&&!i,d=t===R.BACKUPS.STATUS.SUCCEEDED&&!i;return a?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):d?e.jsx(V,{type:"success",children:s("common.succeeded")}):e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"error",children:s("common.failed")})," ",e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:r||n,children:e.jsx(ze,{children:e.jsx(it,{style:{width:"24px",height:"24px"},color:"error"})})})]})}ke.propTypes={status:h.string.isRequired,message:h.string,createdAt:h.string.isRequired};ke.defaultProps={message:""};function De({metadata:t}){const{t:r}=T();if(Q(t))return e.jsx(V,{type:"success",children:r("common.succeeded")});const o=t.count||0,s=t.size||0,i=ct(s,{iec:!0}),n=e.jsxs(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[r("common.fileCount"),": ",o]}),e.jsxs(C,{variant:"body2",children:[r("common.fileSize"),": ",i]})]});return e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"success",children:r("common.succeeded")})," ",e.jsx(Ht,{title:n,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ze,{children:e.jsx(lt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}De.propTypes={metadata:h.object};De.defaultProps={metadata:{}};function Be(){const{t,locale:r}=T(),{spaceGateways:o,backups:s,backupsLoading:i}=L(),n=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:d=>{var D;const{targetUrl:u,targetName:c,status:x,createdAt:p}=s[d],g=x===R.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,f=x===R.BACKUPS.STATUS.SUCCEEDED&&!g,b=c||((D=o.find(S=>u==null?void 0:u.includes(xe(S==null?void 0:S.endpoint))))==null?void 0:D.name)||"Unknown DID Space";return f?e.jsx(et,{fontSize:"16px",href:u,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:d=>{const u=t(d===0?"common.auto":"common.manual");return e.jsx(V,{children:u})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:d=>E(d).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:d=>Q(d)?"":E(d).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:d=>{const u=(s==null?void 0:s[d])??{},{status:c,message:x,createdAt:p,metadata:g}=u,f=c===R.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,b=c===R.BACKUPS.STATUS.PROGRESS&&!f,D=c===R.BACKUPS.STATUS.SUCCEEDED&&!f;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):D?e.jsx(De,{metadata:g}):e.jsx(ke,{status:c,message:x,createdAt:p})}}}],[s,o,t]),a=y.useMemo(()=>!(s!=null&&s.length),[s]);return e.jsx(e.Fragment,{children:a?e.jsx(j,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(mt,{title:"",loading:i,data:s,columns:n,emptyNode:t("storage.spaces.record.emptyData",r),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Be.propTypes={};function $e(){const{t}=T();return e.jsxs(j,{children:[e.jsxs(j,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(j,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(dt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(Ce,{})]})]}),e.jsx(Be,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ke,{})]})}$e.propTypes={};var we={},Vt=ye;Object.defineProperty(we,"__esModule",{value:!0});var qe=we.default=void 0,Qt=Vt(je()),Xt=e;qe=we.default=(0,Qt.default)((0,Xt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ee={},Jt=ye;Object.defineProperty(Ee,"__esModule",{value:!0});var Ye=Ee.default=void 0,Zt=Jt(je()),Gt=e;Ye=Ee.default=(0,Zt.default)((0,Gt.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Te={},es=ye;Object.defineProperty(Te,"__esModule",{value:!0});var He=Te.default=void 0,ts=es(je()),ss=e;He=Te.default=(0,ts.default)((0,ss.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function Ie({spaceGateway:t,onConfirm:r,onCancel:o}){const{t:s}=T(),[i,n]=y.useState(!1),[a,d]=y.useState(!1),u=(p,g)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),n(g)},c=async p=>{try{p==null||p.stopPropagation(),d(!0),await(r==null?void 0:r(t)),n(!1)}catch(g){console.error(g),B.error(`${s("storage.space.gateway.delete.failed")}: ${X(g)}`)}finally{n(!1),d(!1)}},x=p=>{u(p,!1),o==null||o(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(q,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(_t,{fontSize:"small"})}),e.jsx(H,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(ft,{title:s("storage.spaces.gateway.delete.title"),open:i,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:a}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:a}},onConfirm:c,onCancel:x,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Ie.propTypes={spaceGateway:h.shape({name:h.string.isRequired,url:h.string.isRequired,protected:h.bool}).isRequired,onConfirm:h.func,onCancel:h.func};Ie.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function Re({spaceGateway:t,selected:r,onDelete:o,onConnect:s,enableSwitchToSpace:i,backupInProgress:n,...a}){const{abortBlockletBackup:d}=L(),[u,c]=y.useState(null),{t:x}=T(),[p,g]=y.useState(!1),f=(S,l)=>{S.stopPropagation(),S.preventDefault(),c(l&&S.currentTarget)},b=async S=>{try{g(!0),f(S,!1),await s(t)}catch(l){console.error(l),B.error(l.message)}finally{g(!1)}},D=async S=>{try{g(!0),f(S,!1),await d()}catch(l){console.error(l),B.error(l.message)}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(A,{sx:{ml:1},size:"24px"}):e.jsx(tt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>f(S,!0),...a,children:e.jsx(zt,{})}),e.jsxs(st,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:S=>f(S,!1),children:[e.jsxs(q,{onClick:S=>{f(S,!1),window.open(Oe(t.endpoint?Rt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(qe,{fontSize:"small"})}),e.jsx(H,{children:x("common.open")})]}),e.jsxs(q,{onClick:S=>{f(S,!1),window.open(Oe(vt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!r&&i&&e.jsxs(q,{onClick:b,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ye,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.connect.switchToSpace")})]}),n&&e.jsxs(q,{onClick:D,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Pt,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!n&&e.jsx(Ie,{spaceGateway:t,onConfirm:async()=>{c(null),await(o==null?void 0:o(t))},onCancel:()=>c(null)})]})]})}Re.propTypes={spaceGateway:h.shape({name:h.string.isRequired,url:h.string.isRequired,protected:h.bool,endpoint:h.string.isRequired,loading:h.bool}).isRequired,selected:h.bool.isRequired,enableSwitchToSpace:h.bool,onDelete:h.func,onConnect:h.func,backupInProgress:h.bool};Re.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const ns=ge(({className:t,...r})=>e.jsx(Se,{...r,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function ve({spaceGateway:t,spaceStatus:r,selected:o,onConnected:s,onDeleted:i,onBackedUp:n}){const{t:a,locale:d}=T(),{blocklet:u}=O(),{api:c,info:{did:x}}=M(),{appDid:p,appName:g,appDescription:f,scopes:b,appUrl:D,referrer:S}=Ne({blocklet:u}),{backupProgress:l,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:ne,refreshBackups:oe}=L(),[U,z]=y.useState(!1),[I,v]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:a("storage.spaces.authorize.title",{appName:g},d),scan:a("storage.spaces.authorize.scan",{appName:g},d),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{v(k=>({...k,open:!1}))}}),re=o&&!U&&r===ue.DISCONNECTED,ae=o&&!U&&!t.loading&&r===ue.CONNECTED,F=o&&U&&r===ue.CONNECTED&&(l==null?void 0:l.progress)>=0,J=async()=>{try{if(await At(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[u.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(a("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s==null||s(null,t);return}}catch(k){console.error(k),s==null||s(k,t);return}v(k=>({...k,open:!0,prefix:he(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ue.create({baseURL:he(t.url,"space")}).get,extraParams:{appDid:p,appName:g,appDescription:f,scopes:b,appUrl:D,referrer:S,nodeDid:x,spaceDid:t.did}}))},ie=async(k,K)=>{const m=K(k.endpoint),N=xe(m),w=k.space?K(k.space):{};if(t.did&&N!==t.did){v(de=>({...de,open:!1}));const $=a("storage.spaces.gateway.switch.failedForMismatchSpace",{name:w!=null&&w.name?w.name:""});B.error($),s==null||s(new Error($),t);return}const P={...t,name:w.name??"DID Space",did:w.did??xe(m),endpoint:m};await te(P),v($=>({...$,open:!1})),s==null||s(null,P)},ce=async()=>{try{if(U)return;z(!0),await c.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(k){console.error(k),B.error(k.message),n==null||n(k,t)}finally{z(!0)}},le=async()=>{try{await se(t),B.success(a("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),i==null||i(null,t)}catch(k){console.error(k),i==null||i(k,t)}};return y.useEffect(()=>{l!=null&&l.completed?(o&&((l==null?void 0:l.progress)===100?(B.success(a("storage.spaces.backupSuccessfully")),n==null||n(null,t)):l.message&&(n==null||n(new Error(l==null?void 0:l.message),t)),l.progress=0,l.message=""),z(!1),setTimeout(()=>{ne(),oe()},1e3)):l.progress&&z(!0)},[l]),e.jsxs(e.Fragment,{children:[e.jsxs(j,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:a("storage.spaces.strategy.backupNow")}),re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:J,children:a("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(ns,{title:(l==null?void 0:l.message)&&e.jsx(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:l.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(A,{variant:"determinate",value:l==null?void 0:l.progress,size:14,sx:{mr:1}}),l==null?void 0:l.progress,"%"]})}),e.jsx(ht,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:d},"get-endpoint")]}),e.jsx(Re,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:le,onConnect:J,enableSwitchToSpace:(l==null?void 0:l.completed)||Q(l==null?void 0:l.message),backupInProgress:F})]})}ve.propTypes={spaceGateway:h.shape({did:h.string.isRequired,name:h.string.isRequired,url:h.string.isRequired,endpoint:h.string.isRequired,protected:h.bool,loading:h.bool}).isRequired,spaceStatus:h.string.isRequired,selected:h.bool.isRequired,onConnected:h.func,onDeleted:h.func,onBackedUp:h.func};ve.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ve({...t}){const{t:r}=T();return e.jsxs(j,{...t,children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:r("storage.spaces.backup.records")})}),e.jsx(Ce,{}),e.jsx(Be,{})]})}Ve.propTypes={};function Qe({...t}){const{t:r}=T(),{autoBackup:o,updateAutoBackup:s}=L(),i=async()=>{try{const n=!(o!=null&&o.enabled);await s({enabled:n}),B.success(r(n?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(n){B.error(n.message)}};return e.jsx(Mt,{checked:!!(o!=null&&o.enabled),onChange:i,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:r("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Qe.propTypes={};function os(){const{t}=T(),{spaceGateways:r,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=L(),i=o&&!(r!=null&&r.length),n=({spaceGateway:a,spaceStatus:d,selected:u,refresh:c})=>e.jsx(ve,{spaceGateway:a,spaceStatus:d,selected:u,onConnected:()=>c(),onBackedUp:x=>x&&c()});return e.jsxs(j,{display:"flex",flexDirection:"column",children:[e.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),e.jsx(Qe,{}),e.jsx(ee,{})]}),e.jsx(j,{mt:2,children:i?e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsx(A,{})}):e.jsx(Ae,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:r.map(a=>e.jsx(Ae,{item:!0,xs:12,md:6,children:e.jsx(ut,{endpoint:a.endpoint,selected:s(a),action:n},a.endpoint)},a.endpoint))})})}),e.jsx(Ve,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ke,{})]})}function rs(){const{spaceGatewaysFirstLoading:t,spaceGateways:r}=L();return t?e.jsx(_e,{relative:"parent",children:e.jsx(A,{})}):Q(r)?e.jsx($e,{}):e.jsx(os,{})}function as(){return e.jsx(be,{children:e.jsx(rs,{})})}function is(){const{spaceGateway:t,settingStorageEndpoint:r,updateSpaceGateway:o,hasStorageEndpoint:s,loading:i,storageEndpoint:n}=Nt(),a=fe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return i?e.jsx(_e,{relative:"parent",children:e.jsx(A,{})}):e.jsxs(j,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(kt,{spaceGateway:t,settingStorageEndpoint:r}):e.jsx(Dt,{}),e.jsx(j,{sx:a,children:e.jsx(Bt,{onConnect:o,storageEndpoint:n})})]})}function cs(){const{t}=T();return e.jsxs(Ut,{children:[e.jsxs(W,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(is,{})]})}function Xe({navOrientation:t,...r}){const{t:o,locale:s}=T(),{blocklet:i}=O(),n=jt({key:"md"}),[a,d]=ot(),u=a.get("tab")||"backup",c=n?"horizontal":t,x=fe(()=>{var l;const D=[{label:o("common.backup"),value:"backup"}],S=(l=i==null?void 0:i.capabilities)==null?void 0:l.didSpace;return(S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&D.push({label:o("common.storage"),value:"storage"}),D},[s,c]),g=fe(()=>({backup:e.jsx(as,{}),storage:e.jsx(cs,{})}))[u],f=D=>{d(S=>(D==="backup"?S.delete("tab"):S.set("tab",D),S))};if(x.length<=1)return e.jsx(me,{children:g});const b=e.jsx(xt,{tabs:x,current:u,orientation:c,onChange:f,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(j,{...r,children:e.jsxs(W,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(j,{sx:{flexShrink:0},children:e.jsx(Le,{left:b})}),e.jsx(j,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:g})})]})});if(c==="horizontal")return e.jsxs(j,{...r,children:[e.jsx(Le,{left:b}),e.jsx(me,{sx:{mt:2},children:g})]})}Xe.propTypes={navOrientation:h.oneOf(["vertical","horizontal"])};Xe.defaultProps={navOrientation:"vertical"};const me=ge(j)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as j,f as Et,l as ut,L as we,g as Hn,u as Gn,i as Jn,j as wt}from"./vendor-react-DEoibe3W.js";import{a9 as Ie,j as e,v as Ve,aa as c,aq as Lt,H as s,ad as ye,I as de,T as A,s as Xn,c5 as Go,D as pt,ah as Re,aw as Yn,bR as ot,ak as ht,bs as nt,bw as st,y as ee,ab as Se,P as Jo,G as Xo,w as qt,a8 as Yo,M as Zo,q as be,X as Zn,aj as Qo,t as Ko,bT as Qn,N as Ye,z as en,O as re,al as Ce,c6 as tn,L as on,A as Nt,b8 as nn,bJ as sn,bx as Kn,e as rn,at as es,bZ as ts,af as os,U as ln,W as rt,bE as ns,bF as ss,c7 as rs,c8 as ls,bn as It,bo as is,bq as cs,bu as as,bv as Rt}from"./vendor-mui-core-Bq8gXTan.js";import{D as ke,G as Te,ag as ds,a8 as us,f as Io,ah as To,ac as ps,ai as hs,aj as fs,ak as bs}from"./index-6_wWEItq.js";import{r as $e,k as X,a as Q,bG as cn,i as ms,B as Le,bg as an,$ as dn,bd as un,at as xs,bH as gs,ac as At,a3 as M,a8 as js,I as ue,bI as ks,bm as ys,_ as pn,b as Me,ar as ft,be as vs,ax as hn}from"./vendor-ux-did-connect-dVrbSJfQ.js";import{v as bt,c as fe,i as ws,z as Rs,B as Ee,p as Cs}from"./vendor-arcblock-qCd0o3Hz.js";import{d as Ss}from"./Error-KxELF1Nr.js";import{C as mt}from"./confirm-Vh9bFw1L.js";import{u as Fe}from"./session-CwC5SgVz.js";import{W as Tt}from"./did-address-Ca4O6-Gb.js";import{E as Ze}from"./empty-spinner-BHwHZpq-.js";import{B as zt}from"./bundle-avatar-LAkmelll.js";import{S as De}from"./shorten-label-BQvbtscf.js";import{L as Ot}from"./list-header-C7gle0n0.js";import{a0 as Ds,A as pe,J as Wt,E as fn}from"./vendor-utils-B3iZkn2R.js";import{d as Is}from"./Download-DqajrKRK.js";import{C as bn}from"./click-to-copy-BfYfYud0.js";import{Q as Ts}from"./QuestionMarkCircle-jbhclAfX.js";import{x as $s,u as Ps}from"./vendor-hooks-BCm626KH.js";import{_ as Xe}from"./useSetState-CWq0AVWn.js";import{c as Bt}from"./index-DVQCgvFb.js";import{d as Mt}from"./Launch-Cs8Cmdb_.js";import{E as Vt}from"./index-DEZojGsm.js";import"./api-CQoRx33p.js";import{d as _s}from"./ChevronRight-Ch_6RLsY.js";import{T as Es,a as Ls}from"./vendor-mui-x-1nqAyytV.js";import{d as lt}from"./DeleteOutline-CPVsjCvJ.js";import{D as $o,C as Po,P as _o}from"./react-beautiful-dnd.esm-Btnab_OF.js";import{c as qs,A as mn,u as xn,S as Ns,a as As,b as zs,e as Os,U as Ws,f as Ct,g as gn,n as Bs,h as Ms,i as Eo,k as Vs,l as Us}from"./item-Cvm3RZ4-.js";import{d as Fs}from"./ArrowDropDown-w902LDz5.js";import{f as je}from"./index-8eXqqyHQ.js";import{d as jn}from"./Done-C5C8-4SV.js";import{D as Hs}from"./delete-confirm-CzUZlQMV.js";import{g as kn}from"./get-safe-url-ClddTGUv.js";import{M as Gs}from"./index-CTlzm-Mc.js";import{r as Js}from"./index-Bv7OAPJU.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ut={},Xs=Ie;Object.defineProperty(Ut,"__esModule",{value:!0});var yn=Ut.default=void 0,Ys=Xs($e()),Zs=e;yn=Ut.default=(0,Ys.default)((0,Zs.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Ft={},Qs=Ie;Object.defineProperty(Ft,"__esModule",{value:!0});var vn=Ft.default=void 0,Ks=Qs($e()),er=e;vn=Ft.default=(0,Ks.default)((0,er.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Ht={},tr=Ie;Object.defineProperty(Ht,"__esModule",{value:!0});var wn=Ht.default=void 0,or=tr($e()),nr=e;wn=Ht.default=(0,or.default)((0,nr.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Gt({did:t,projectId:o,title:n,logo:r,describe:i}){const l=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[u,d]=j.useState(!1),x=Ve(b=>b.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[e.jsx(Lt,{sx:{borderRadius:1},src:l}),e.jsxs(c,{children:[e.jsx(De,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:n||"/"}),e.jsx(De,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Gt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Jt({initUrl:t}){const o=Et(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:r,locale:i}=Q(),{api:a}=ke(),{api:l}=Fe(),[u,d]=j.useState(!0),{blocklet:x}=Te(),[b,p]=j.useState(null),[h,m]=j.useState(!1),f=Ve(C=>C.breakpoints.down("xl")),y=Ve(C=>C.breakpoints.down("md")),{componentDid:v=""}=ut(),[g,k]=j.useState(null),S=`publish-${x.meta.did}`,R=cn(S),[T,D]=j.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),B=()=>{a.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:n}}).then(C=>{const _=(C==null?void 0:C.projects)||[];d(!1),k(_)}).catch(C=>{d(!1),M.error(C.message)})},$=()=>{o(`${X.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=C=>{p(C)},G=()=>{d(!1),m(!0)},U=()=>{m(!1),p(null)},w=C=>{M.error(C.message),m(!1),p(null)},I=C=>{if(!(C!=null&&C.deleted)){M.error("Delete project failed");return}B(),m(!1),p(null)};j.useEffect(()=>{B()},[]);const q=j.useMemo(()=>{var _;if(!T.searchText)return g;let C=(_=T.searchText)==null?void 0:_.trim();return C?(C=ms.toAddress(C).toLocaleLowerCase(),g.filter(J=>J.blockletTitle.toLowerCase().includes(C)||J.blockletDid.toLowerCase().includes(C))):g},[g,T.searchText]);if(!g&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Ze,{})});if(!g)return null;if(!g.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx(Le,{onClick:$,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const P=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:C=>{const _=g[C];return e.jsx(we,{to:`${_.id}`,children:e.jsx(Gt,{did:x.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:C=>C?e.jsx(an,{type:"success",children:C}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:C=>C?e.jsx(Tt,{size:14,compact:!0,responsive:!1,did:C}):null}},f||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:C=>C?e.jsx(Tt,{onClick:()=>{o(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${C}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:C}):null}},f||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:C=>{const _=(x.children||[]).find(J=>J.meta.did===C);return _?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(zt,{size:14,blocklet:_,ancestors:[x]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},C):""}}},f||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:C=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(De,{children:C})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:C=>e.jsx(dn,{value:Number(C),locale:i})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:C=>{const _=g[C];return e.jsxs(c,{display:"flex",children:[e.jsx(we,{to:`${_.id}/new-release/none/${_.lastReleaseId}`,children:e.jsx(ye,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"create",children:e.jsx(yn,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&e.jsx(ye,{title:r("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}/${_.blockletVersion}`,children:e.jsx(vn,{sx:{fontSize:18}})})})}),e.jsx(ye,{title:r("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"delete",onClick:()=>z(_),children:e.jsx(un,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),N=({page:C,rowsPerPage:_,searchText:J})=>{T.pageSize!==_?D(F=>({...F,searchText:"",pageSize:_,page:1})):T.page!==C+1?D(F=>({...F,searchText:"",page:C+1})):T.searchText!==J&&D(F=>({...F,searchText:J,page:1}))},H=h?e.jsx(xs,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:I,onError:w,extraParams:{projectId:b.id,did:x.meta.did,name:b.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:b.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:b.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(sr,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(ye,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(wn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(gs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:y},search:T.searchText,searchText:T.searchText,searchTextUpdate:C=>D(_=>({..._,searchText:C})),searchClose:()=>D(C=>({...C,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(Le,{onClick:$,variant:"contained",children:[e.jsx(bt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:i,data:q,columns:P,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:S,onChange:N}),b&&e.jsx(mt,{title:`${r("common.delete")} ${b.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:G,onCancel:()=>p(null),children:e.jsx(c,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(C=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Ss,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",color:"text.secondary",children:C})]}))})}),H]})}const sr=Xn(c)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Inc_KF9k.js","assets/vendor-ux-did-connect-DVX9lQ8a.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BotmZdBm.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-hooks-BFlOfe0M.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-DiSm3oUX.js","assets/index-BCtTVvHw.js","assets/index-CMYalRl2.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as j,f as Et,l as ut,L as we,g as Hn,u as Gn,i as Jn,j as wt}from"./vendor-react-DEoibe3W.js";import{a9 as Ie,j as e,v as Ve,aa as c,aq as Lt,H as s,ad as ye,I as de,T as A,s as Xn,c5 as Go,D as pt,ah as Re,aw as Yn,bR as ot,ak as ht,bs as nt,bw as st,y as ee,ab as Se,P as Jo,G as Xo,w as qt,a8 as Yo,M as Zo,q as be,X as Zn,aj as Qo,t as Ko,bT as Qn,N as Ye,z as en,O as re,al as Ce,c6 as tn,L as on,A as Nt,b8 as nn,bJ as sn,bx as Kn,e as rn,at as es,bZ as ts,af as os,U as ln,W as rt,bE as ns,bF as ss,c7 as rs,c8 as ls,bn as It,bo as is,bq as cs,bu as as,bv as Rt}from"./vendor-mui-core-Bq8gXTan.js";import{D as ke,G as Te,ag as ds,a8 as us,f as Io,ah as To,ac as ps,ai as hs,aj as fs,ak as bs}from"./index-CMYalRl2.js";import{r as $e,k as X,a as Q,bG as cn,i as ms,B as Le,bg as an,$ as dn,bd as un,at as xs,bH as gs,ac as At,a3 as M,a8 as js,I as ue,bI as ks,bm as ys,_ as pn,b as Me,ar as ft,be as vs,ax as hn}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{v as bt,c as fe,i as ws,z as Rs,B as Ee,p as Cs}from"./vendor-arcblock-DiSm3oUX.js";import{d as Ss}from"./Error-q_AhSCeT.js";import{C as mt}from"./confirm-DApmnpvm.js";import{u as Fe}from"./session-Bkvl2PSP.js";import{W as Tt}from"./did-address-L54dTMrT.js";import{E as Ze}from"./empty-spinner-BHwHZpq-.js";import{B as zt}from"./bundle-avatar-B5-ypzmO.js";import{S as De}from"./shorten-label-BQvbtscf.js";import{L as Ot}from"./list-header-C7gle0n0.js";import{a0 as Ds,A as pe,J as Wt,E as fn}from"./vendor-utils-BotmZdBm.js";import{d as Is}from"./Download-D9LfWoxF.js";import{C as bn}from"./click-to-copy-BMX2P5UB.js";import{Q as Ts}from"./QuestionMarkCircle-jbhclAfX.js";import{x as $s,u as Ps}from"./vendor-hooks-BFlOfe0M.js";import{_ as Xe}from"./useSetState-CWq0AVWn.js";import{c as Bt}from"./index-DVQCgvFb.js";import{d as Mt}from"./Launch-Nu8TBDKk.js";import{E as Vt}from"./index-DEZojGsm.js";import"./api-87p2GGd0.js";import{d as _s}from"./ChevronRight-DclARA5k.js";import{T as Es,a as Ls}from"./vendor-mui-x-1nqAyytV.js";import{d as lt}from"./DeleteOutline-CnS2XiM1.js";import{D as $o,C as Po,P as _o}from"./react-beautiful-dnd.esm-CHsohizU.js";import{c as qs,A as mn,u as xn,S as Ns,a as As,b as zs,e as Os,U as Ws,f as Ct,g as gn,n as Bs,h as Ms,i as Eo,k as Vs,l as Us}from"./item-D0U5vYXJ.js";import{d as Fs}from"./ArrowDropDown-CrJjI_sT.js";import{f as je}from"./index-8eXqqyHQ.js";import{d as jn}from"./Done-C9LPqADS.js";import{D as Hs}from"./delete-confirm-BsEqJQRY.js";import{g as kn}from"./get-safe-url-B8xlSMyD.js";import{M as Gs}from"./index-CTlzm-Mc.js";import{r as Js}from"./index-Bv7OAPJU.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ut={},Xs=Ie;Object.defineProperty(Ut,"__esModule",{value:!0});var yn=Ut.default=void 0,Ys=Xs($e()),Zs=e;yn=Ut.default=(0,Ys.default)((0,Zs.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Ft={},Qs=Ie;Object.defineProperty(Ft,"__esModule",{value:!0});var vn=Ft.default=void 0,Ks=Qs($e()),er=e;vn=Ft.default=(0,Ks.default)((0,er.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Ht={},tr=Ie;Object.defineProperty(Ht,"__esModule",{value:!0});var wn=Ht.default=void 0,or=tr($e()),nr=e;wn=Ht.default=(0,or.default)((0,nr.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Gt({did:t,projectId:o,title:n,logo:r,describe:i}){const l=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[u,d]=j.useState(!1),x=Ve(b=>b.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[e.jsx(Lt,{sx:{borderRadius:1},src:l}),e.jsxs(c,{children:[e.jsx(De,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:n||"/"}),e.jsx(De,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Gt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Jt({initUrl:t}){const o=Et(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:r,locale:i}=Q(),{api:a}=ke(),{api:l}=Fe(),[u,d]=j.useState(!0),{blocklet:x}=Te(),[b,p]=j.useState(null),[h,m]=j.useState(!1),f=Ve(C=>C.breakpoints.down("xl")),y=Ve(C=>C.breakpoints.down("md")),{componentDid:v=""}=ut(),[g,k]=j.useState(null),S=`publish-${x.meta.did}`,R=cn(S),[T,D]=j.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),B=()=>{a.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:n}}).then(C=>{const _=(C==null?void 0:C.projects)||[];d(!1),k(_)}).catch(C=>{d(!1),M.error(C.message)})},$=()=>{o(`${X.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=C=>{p(C)},G=()=>{d(!1),m(!0)},U=()=>{m(!1),p(null)},w=C=>{M.error(C.message),m(!1),p(null)},I=C=>{if(!(C!=null&&C.deleted)){M.error("Delete project failed");return}B(),m(!1),p(null)};j.useEffect(()=>{B()},[]);const q=j.useMemo(()=>{var _;if(!T.searchText)return g;let C=(_=T.searchText)==null?void 0:_.trim();return C?(C=ms.toAddress(C).toLocaleLowerCase(),g.filter(J=>J.blockletTitle.toLowerCase().includes(C)||J.blockletDid.toLowerCase().includes(C))):g},[g,T.searchText]);if(!g&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Ze,{})});if(!g)return null;if(!g.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx(Le,{onClick:$,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const P=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:C=>{const _=g[C];return e.jsx(we,{to:`${_.id}`,children:e.jsx(Gt,{did:x.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:C=>C?e.jsx(an,{type:"success",children:C}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:C=>C?e.jsx(Tt,{size:14,compact:!0,responsive:!1,did:C}):null}},f||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:C=>C?e.jsx(Tt,{onClick:()=>{o(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${C}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:C}):null}},f||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:C=>{const _=(x.children||[]).find(J=>J.meta.did===C);return _?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(zt,{size:14,blocklet:_,ancestors:[x]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},C):""}}},f||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:C=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(De,{children:C})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:C=>e.jsx(dn,{value:Number(C),locale:i})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:C=>{const _=g[C];return e.jsxs(c,{display:"flex",children:[e.jsx(we,{to:`${_.id}/new-release/none/${_.lastReleaseId}`,children:e.jsx(ye,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"create",children:e.jsx(yn,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&e.jsx(ye,{title:r("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}/${_.blockletVersion}`,children:e.jsx(vn,{sx:{fontSize:18}})})})}),e.jsx(ye,{title:r("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"delete",onClick:()=>z(_),children:e.jsx(un,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),N=({page:C,rowsPerPage:_,searchText:J})=>{T.pageSize!==_?D(F=>({...F,searchText:"",pageSize:_,page:1})):T.page!==C+1?D(F=>({...F,searchText:"",page:C+1})):T.searchText!==J&&D(F=>({...F,searchText:J,page:1}))},H=h?e.jsx(xs,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:I,onError:w,extraParams:{projectId:b.id,did:x.meta.did,name:b.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:b.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:b.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(sr,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(ye,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(wn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(gs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:y},search:T.searchText,searchText:T.searchText,searchTextUpdate:C=>D(_=>({..._,searchText:C})),searchClose:()=>D(C=>({...C,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(Le,{onClick:$,variant:"contained",children:[e.jsx(bt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:i,data:q,columns:P,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:S,onChange:N}),b&&e.jsx(mt,{title:`${r("common.delete")} ${b.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:G,onCancel:()=>p(null),children:e.jsx(c,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(C=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Ss,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",color:"text.secondary",children:C})]}))})}),H]})}const sr=Xn(c)`
|
|
3
3
|
${({theme:t})=>t.breakpoints.down("md")} {
|
|
4
4
|
.MuiTableRow-root {
|
|
5
5
|
border-color: ${({theme:t})=>t.palette.divider};
|
|
@@ -142,7 +142,7 @@ import{r as j,f as Et,l as ut,L as we,g as Hn,u as Gn,i as Jn,j as wt}from"./ven
|
|
|
142
142
|
background: #fff;
|
|
143
143
|
z-index: 10;
|
|
144
144
|
}
|
|
145
|
-
`;var no={},Lr=Ie;Object.defineProperty(no,"__esModule",{value:!0});var $t=no.default=void 0,qr=Lr($e()),Nr=e;$t=no.default=(0,qr.default)((0,Nr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const zo="lastWantToConnectStoreId";function Ar(t){var u,d;const[o,n]=j.useState(null),{session:r}=Fe(),i=j.useCallback(x=>{n(x),localStorage.setItem(zo,x==null?void 0:x.id)},[n]),a=j.useMemo(()=>{var h,m,f,y;const x=localStorage.getItem(zo),b=x?(((h=t==null?void 0:t.settings)==null?void 0:h.storeList)||[]).find(v=>v.id===x):null;if(b)return b;let p=(((m=t==null?void 0:t.settings)==null?void 0:m.storeList)||[]).find(v=>{var g;return!(v.id!==X.BLOCKLET_STORE.id||v.scope&&v.scope!=="studio"&&v.scope!==((g=r==null?void 0:r.user)==null?void 0:g.did))});return p||(p=(y=(f=t==null?void 0:t.settings)==null?void 0:f.storeList)==null?void 0:y[0]),p},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(d=r==null?void 0:r.user)==null?void 0:d.did]);return[o||a||{},i]}const Dt={};async function so(t,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:r=4e3,timerKey:i=""}){Dt[i]&&clearTimeout(Dt[i]),await new Promise(u=>setTimeout(u,r));const a=Date.now(),l=async(u,d)=>{try{const x=await t();u(x)}catch(x){Date.now()-a>n?d(x):i?Dt[i]=setTimeout(()=>l(u,d),o):setTimeout(()=>l(u,d),o)}};return new Promise(l)}function zr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Or(t,{did:o,projectId:n,messageId:r}){return so(async()=>{var a;const i=await t.getProject({input:{did:o,projectId:n,messageId:r}});if(!((a=i==null?void 0:i.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return i.project.blockletDid},{timerKey:"connect-studio"})}function Wr(t,{did:o,projectId:n,storeId:r}){return so(async()=>{var l,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(l=i==null?void 0:i.project)==null?void 0:l.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!i.project.connectedStores.find(d=>d.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}function Br(t,{did:o,projectId:n,endpointId:r}){return so(async()=>{var l,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(l=i==null?void 0:i.project)==null?void 0:l.connectedEndpoints)!=null&&u.length))throw new Error("Connected endpoint not found");if(!i.project.connectedEndpoints.find(d=>d.endpointId===r))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${r}`})}const Mr=({fromBlocklet:t,nodeInfo:o,blocklet:n,userDid:r})=>{var l,u;const i=t?(l=n==null?void 0:n.meta)==null?void 0:l.did:o==null?void 0:o.did;let a=t?((u=n==null?void 0:n.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(d=>d.protected||!d.scope||d.scope==="studio"||d.scope===r),{teamDid:i,storeList:a}},ro=Mr;function lo({blocklet:t,store:o={},onChangeStore:n,onClick:r,disabled:i,loading:a,componentDid:l}){var w,I,q;const{t:u}=Q(),{session:d}=Fe(),{api:x,info:b,inService:p}=ke(),h=Te(),[m,f]=j.useState(!1),y=j.useRef(null),[v,g]=j.useState(!1),[k,S]=j.useState(null),R=P=>{n(P),f(!1)},T=()=>{f(!m)},D=P=>{y.current&&y.current.contains(P.target)||f(!1)},B=()=>{g(!0)},$=()=>{g(!1)},z=async()=>{var P;if(k)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:k.url,projectId:"",scope:k.scope||"studio"}}),await((P=h==null?void 0:h.actions)==null?void 0:P.refreshBlocklet())}catch(N){M.error(`Remove Blocklet Store Error: ${je(N)}`)}finally{S(null)}},{storeList:G}=ro({fromBlocklet:p,blocklet:t,nodeInfo:b,componentDid:l,userDid:(w=d==null?void 0:d.user)==null?void 0:w.did}),U=(I=t==null?void 0:t.meta)==null?void 0:I.did;return e.jsxs(e.Fragment,{children:[e.jsxs(st,{disabled:i,ref:y,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(ee,{onClick:r,children:[a&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(ee,{size:"small","aria-controls":m?"split-button-menu":void 0,"aria-expanded":m?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:e.jsx(Fs,{})})]}),e.jsx(Jo,{sx:{zIndex:10},open:m,anchorEl:y.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:P})=>e.jsx(Xo,{...P,style:{transformOrigin:"center top"},children:e.jsx(qt,{children:e.jsx(Yo,{onClickAway:D,children:e.jsxs(Zo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[G==null?void 0:G.map(N=>{var H;return e.jsxs(be,{selected:N.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>R(N),children:[e.jsxs(c,{children:[e.jsx(De,{sx:{fontSize:"16px"},maxLength:24,children:N.name}),e.jsx(De,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:N.url})]}),qs({store:N,userDid:(H=d==null?void 0:d.user)==null?void 0:H.did})&&e.jsx(de,{sx:{ml:1},onClick:C=>{C.preventDefault(),C.stopPropagation(),S(N)},children:e.jsx(ue,{icon:"ic:outline-delete"})})]},N.url)}),e.jsx(Zn,{}),e.jsxs(be,{onClick:B,children:[e.jsx(bt,{font:!0}),e.jsx(A,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(mn,{hiddenChildren:!0,open:!0,onClose:$,teamDid:U,storeList:G,scope:"studio",onAdd:(q=h==null?void 0:h.actions)==null?void 0:q.refreshBlocklet}),k&&e.jsx(mt,{displayError:!0,title:`${u("common.delete")} ${k.name}`,description:u("blocklet.publish.deleteStoreTip",{name:k.name}),confirm:u("common.confirm"),onConfirm:z,onCancel:()=>S(null)})]})}lo.propTypes={store:s.object,blocklet:s.object,onChangeStore:s.func.isRequired,onClick:s.func.isRequired,loading:s.bool.isRequired,disabled:s.bool.isRequired,componentDid:s.string.isRequired,projectType:s.string.isRequired,getData:s.func.isRequired};lo.defaultProps={store:null,blocklet:null};const Vr=(t,o,n)=>{const r=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/logo/upload`,i=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/screenshot/upload`,a=t!=null&&t.blockletLogo?`${r}/${t.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,l=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${i}/${u}`);return{logoUrl:a,screenshotUrls:l,uploadLogoPrefix:r,uploadScreenshotPrefix:i}},$n=Vr,Ur=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");return o||n};function xt({url:t,style:o,controls:n,modestbranding:r}){var u;const{t:i}=Q(),a=t.includes("youtube.com")||t.includes("youtu.be"),l=t.includes("vimeo.com");if(a){const d=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${n}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(l){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ue,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:i("studio.videoDialogNoSrc")})]})})}xt.propTypes={url:s.string.isRequired,style:s.object,controls:s.number,modestbranding:s.number};xt.defaultProps={style:{},controls:1,modestbranding:1};function Pn({setParams:t,onClose:o,params:n}){const{t:r}=Q(),[i,a]=j.useState(""),l=i&&n.blockletVideos.includes(i),u=Ur(i),d=()=>{t(x=>{const b=[...x.blockletVideos];return b.push(i),{...x,blockletVideos:b}}),o()};return e.jsxs(pt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Qo,{children:r("studio.videoDialogTitle")}),e.jsxs(Ko,{children:[e.jsx(Qn,{fullWidth:!0,value:i,onChange:x=>a(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:i?e.jsx(Ye,{position:"end",children:e.jsx(de,{onClick:()=>a(""),children:e.jsx(ys,{})})}):null,error:l}),l&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(xt,{url:i,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(en,{children:[e.jsx(ee,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(ee,{disabled:!u||l,onClick:d,children:r("studio.confirm")})]})]})}Pn.propTypes={onClose:s.func.isRequired,params:s.object.isRequired,setParams:s.func.isRequired};function Pt({errors:t,storeList:o,...n}){const{t:r}=Q();return e.jsxs(c,{...n,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([i,a])=>{const l=Object.values(a),u=o.find(d=>d.url===i);return l.length>0&&e.jsxs(c,{children:[e.jsx(ye,{title:i,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),l.map(d=>e.jsx(c,{component:"li",ml:2,sx:{wordBreak:!0},children:d},d))]},i)})]})}Pt.propTypes={errors:s.object.isRequired,storeList:s.array.isRequired};const Oo=j.lazy(()=>pn(()=>import("./index-Hgoqly4p.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function io({projectId:t,readOnly:o,loading:n,blocklet:r,params:i,setParams:a,paramsErrTip:l,setParamsErrTip:u,warning:d,setLoading:x,initUrl:b,initLogoUrl:p,setInitLogoUrl:h,componentDid:m}){const{t:f,locale:y}=Q(),{api:v}=ke(),g=Et(),k=j.useRef(null),S=j.useRef(null),[R,T]=Ar(r),[D,B]=j.useState(!1),$=xn({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async E=>{const Z=setTimeout(()=>{x(!1)},2e4),Y=await Or(v,E);x(!1),clearTimeout(Z),window.parent.postMessage({event:"studioDialog.connected",componentDid:m},"*"),g(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${Y}/create`),{replace:!0})},G=()=>{if(!i.blockletTitle){M.error(f("blocklet.publish.errorTip.noTitle"));return}if(!(R!=null&&R.url)){M.error(f("blocklet.publish.noStoreSelected"));return}const E=zr();$(async(Z,Y)=>{var oe,le,te;try{const ne=await v.connectByStudio({input:{did:(oe=r==null?void 0:r.meta)==null?void 0:oe.did,blockletTitle:i==null?void 0:i.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:((le=i==null?void 0:i.blockletComponents)==null?void 0:le.length)>0?"pack":"resource",componentDid:m,messageId:E,tenantScope:(b==null?void 0:b.searchParams.get("tenantScope"))||""}});if(!(ne!=null&&ne.url)){M.error("failed to connect to store");return}Y(ne.url),z({did:(te=r==null?void 0:r.meta)==null?void 0:te.did,projectId:"",messageId:E})}catch(ne){const ae=je(ne);M.error(ae),x(!1)}})},{logoUrl:U,screenshotUrls:w,uploadLogoPrefix:I,uploadScreenshotPrefix:q}=$n(i,r,t),{logoErrors:P,screenshotErrors:N,storeList:H,hasLogoWarning:C,hasScreenshotWarning:_}=d,J=()=>o?!1:!t||t===X.UNOWNED_DID?(M.error(f("blocklet.publish.errorTip.noFirstDid")),!1):!0,F=E=>{if(!E.destination)return;const Z=Array.from(i.blockletScreenshots),[Y]=Z.splice(E.source.index,1);Z.splice(E.destination.index,0,Y),a(oe=>({...oe,blockletScreenshots:Z}))},K=E=>{if(!E.destination)return;const Z=Array.from(i.blockletVideos),[Y]=Z.splice(E.source.index,1);Z.splice(E.destination.index,0,Y),a(oe=>({...oe,blockletVideos:Z}))};return e.jsxs(Fr,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.title")}`,placeholder:`Blocklet ${f("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:i.blockletTitle||"",onChange:E=>{u({blockletTitle:""}),a({blockletTitle:E.target.value})},error:!!l.blockletTitle,helperText:l.blockletTitle||""}),e.jsx(re,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===X.UNOWNED_DID&&e.jsx(Ye,{position:"end",children:e.jsx(lo,{blocklet:r,store:R,componentDid:m,onChangeStore:T,disabled:!i.blockletTitle||o||n,loading:n,onClick:G})})},error:!!l.projectId,helperText:l.projectId||"",value:t===X.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.description")}`,placeholder:`Blocklet ${f("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletDescription||"",onChange:E=>{u({blockletDescription:""}),a({blockletDescription:E.target.value.slice(0,159)})},error:!!l.blockletDescription,helperText:l.blockletDescription||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.homepageTip")}`,placeholder:`Blocklet ${f("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletHomepage||"",onChange:E=>{E.target.value&&!/^(http|https):\/\//.test(E.target.value)?u({blockletHomepage:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),a({blockletHomepage:E.target.value})},error:!!l.blockletHomepage,helperText:l.blockletHomepage||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.community")}`,placeholder:`Blocklet ${f("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletCommunity||"",onChange:E=>{E.target.value&&!/^(http|https):\/\//.test(E.target.value)?u({blockletCommunity:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),a({blockletCommunity:E.target.value})},error:!!l.blockletCommunity,helperText:l.blockletCommunity||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.support")}`,placeholder:`Blocklet ${f("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletSupport||"",onChange:E=>{E.target.value&&!/^(http|https):\/\//.test(E.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(E.target.value)?u({blockletSupport:f("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),a({blockletSupport:E.target.value})},error:!!l.blockletSupport,helperText:l.blockletSupport||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.repository")}`,placeholder:`Blocklet ${f("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletRepository||"",onChange:E=>{E.target.value&&!/^(git|https|svn)/.test(E.target.value)?u({blockletRepository:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),a({blockletRepository:E.target.value})},error:!!l.blockletRepository,helperText:l.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Ce,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.logo")}),e.jsxs(Ce,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Lt,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:p||U,onClick:()=>{var E;J()&&((E=k.current)==null||E.open())}})})]}),C&&e.jsx(Pt,{errors:P,storeList:H,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Ce,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.screenshot")}),e.jsxs(Ce,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:f("studio.orderTip")})]})})]})]}),e.jsx($o,{onDragEnd:o?void 0:F,children:e.jsx(Po,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(E,Z)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:Z.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Z.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:E.innerRef,...E.droppableProps,children:[w.map((Y,oe)=>e.jsx(_o,{draggableId:Y,index:oe,isDragDisabled:o,children:(le,te)=>e.jsxs(c,{ref:le.innerRef,...le.draggableProps,className:"screenshot",sx:{transform:te.isDragging?"scale(1.05)":"none",boxShadow:te.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:Y}),!o&&e.jsx(de,{...le.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx($t,{})}),!o&&e.jsx(de,{className:"action",onClick:()=>{a(ne=>{const ae=[...ne.blockletScreenshots];return ae.splice(oe,1),{...ne,blockletScreenshots:ae}})},children:e.jsx(lt,{})})]})},Y)),E.placeholder,w.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var Y;J()&&((Y=S.current)==null||Y.open())},children:"+"})]})})})]}),_&&e.jsx(Pt,{errors:N,storeList:H}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Ce,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("studio.video")}),e.jsxs(Ce,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"secondary.main"},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"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:f("studio.orderTip")})]})})]})]}),e.jsx($o,{onDragEnd:o?void 0:K,children:e.jsx(Po,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(E,Z)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:Z.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Z.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:E.innerRef,...E.droppableProps,children:[i.blockletVideos.map((Y,oe)=>e.jsx(_o,{draggableId:Y,index:oe,isDragDisabled:o,children:(le,te)=>e.jsxs(c,{ref:le.innerRef,...le.draggableProps,className:"screenshot",sx:{transform:te.isDragging?"scale(1.05)":"none",boxShadow:te.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(xt,{url:Y,style:{pointerEvents:te.isDragging?"none":"auto"}}),!o&&e.jsx(de,{...le.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx($t,{})}),!o&&e.jsx(de,{className:"action",onClick:()=>{a(ne=>{const ae=[...ne.blockletVideos];return ae.splice(oe,1),{...ne,blockletVideos:ae}})},children:e.jsx(lt,{})})]})},Y)),E.placeholder,i.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{J()&&B(!0)},children:"+"})]})})})]})]})}),e.jsxs(j.Suspense,{fallback:e.jsx(Ze,{}),children:[e.jsx(Oo,{ref:k,locale:y,popup:!0,onUploadFinish:E=>{var Z;a({blockletLogo:E.data.filename}),h(""),(Z=k.current)==null||Z.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,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"),D&&e.jsx(Pn,{onClose:()=>B(!1),params:i,setParams:a}),e.jsx(Oo,{ref:S,locale:y,popup:!0,onUploadFinish:E=>{var Z;a(Y=>{var le;const oe=Y.blockletScreenshots||[];return oe.push((le=E.data)==null?void 0:le.filename),{...Y,blockletScreenshots:oe}}),(Z=S.current)==null||Z.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:q,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-w.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")]})]})}io.propTypes={projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,warning:s.object.isRequired,loading:s.bool.isRequired,blocklet:s.object.isRequired,setLoading:s.func.isRequired,initUrl:s.object,componentDid:s.string,initLogoUrl:s.string.isRequired,setInitLogoUrl:s.func.isRequired};io.defaultProps={initUrl:null,componentDid:""};const Fr=Re.div`
|
|
145
|
+
`;var no={},Lr=Ie;Object.defineProperty(no,"__esModule",{value:!0});var $t=no.default=void 0,qr=Lr($e()),Nr=e;$t=no.default=(0,qr.default)((0,Nr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const zo="lastWantToConnectStoreId";function Ar(t){var u,d;const[o,n]=j.useState(null),{session:r}=Fe(),i=j.useCallback(x=>{n(x),localStorage.setItem(zo,x==null?void 0:x.id)},[n]),a=j.useMemo(()=>{var h,m,f,y;const x=localStorage.getItem(zo),b=x?(((h=t==null?void 0:t.settings)==null?void 0:h.storeList)||[]).find(v=>v.id===x):null;if(b)return b;let p=(((m=t==null?void 0:t.settings)==null?void 0:m.storeList)||[]).find(v=>{var g;return!(v.id!==X.BLOCKLET_STORE.id||v.scope&&v.scope!=="studio"&&v.scope!==((g=r==null?void 0:r.user)==null?void 0:g.did))});return p||(p=(y=(f=t==null?void 0:t.settings)==null?void 0:f.storeList)==null?void 0:y[0]),p},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(d=r==null?void 0:r.user)==null?void 0:d.did]);return[o||a||{},i]}const Dt={};async function so(t,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:r=4e3,timerKey:i=""}){Dt[i]&&clearTimeout(Dt[i]),await new Promise(u=>setTimeout(u,r));const a=Date.now(),l=async(u,d)=>{try{const x=await t();u(x)}catch(x){Date.now()-a>n?d(x):i?Dt[i]=setTimeout(()=>l(u,d),o):setTimeout(()=>l(u,d),o)}};return new Promise(l)}function zr(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Or(t,{did:o,projectId:n,messageId:r}){return so(async()=>{var a;const i=await t.getProject({input:{did:o,projectId:n,messageId:r}});if(!((a=i==null?void 0:i.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return i.project.blockletDid},{timerKey:"connect-studio"})}function Wr(t,{did:o,projectId:n,storeId:r}){return so(async()=>{var l,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(l=i==null?void 0:i.project)==null?void 0:l.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!i.project.connectedStores.find(d=>d.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}function Br(t,{did:o,projectId:n,endpointId:r}){return so(async()=>{var l,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(l=i==null?void 0:i.project)==null?void 0:l.connectedEndpoints)!=null&&u.length))throw new Error("Connected endpoint not found");if(!i.project.connectedEndpoints.find(d=>d.endpointId===r))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${r}`})}const Mr=({fromBlocklet:t,nodeInfo:o,blocklet:n,userDid:r})=>{var l,u;const i=t?(l=n==null?void 0:n.meta)==null?void 0:l.did:o==null?void 0:o.did;let a=t?((u=n==null?void 0:n.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(d=>d.protected||!d.scope||d.scope==="studio"||d.scope===r),{teamDid:i,storeList:a}},ro=Mr;function lo({blocklet:t,store:o={},onChangeStore:n,onClick:r,disabled:i,loading:a,componentDid:l}){var w,I,q;const{t:u}=Q(),{session:d}=Fe(),{api:x,info:b,inService:p}=ke(),h=Te(),[m,f]=j.useState(!1),y=j.useRef(null),[v,g]=j.useState(!1),[k,S]=j.useState(null),R=P=>{n(P),f(!1)},T=()=>{f(!m)},D=P=>{y.current&&y.current.contains(P.target)||f(!1)},B=()=>{g(!0)},$=()=>{g(!1)},z=async()=>{var P;if(k)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:k.url,projectId:"",scope:k.scope||"studio"}}),await((P=h==null?void 0:h.actions)==null?void 0:P.refreshBlocklet())}catch(N){M.error(`Remove Blocklet Store Error: ${je(N)}`)}finally{S(null)}},{storeList:G}=ro({fromBlocklet:p,blocklet:t,nodeInfo:b,componentDid:l,userDid:(w=d==null?void 0:d.user)==null?void 0:w.did}),U=(I=t==null?void 0:t.meta)==null?void 0:I.did;return e.jsxs(e.Fragment,{children:[e.jsxs(st,{disabled:i,ref:y,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(ee,{onClick:r,children:[a&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(ee,{size:"small","aria-controls":m?"split-button-menu":void 0,"aria-expanded":m?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:e.jsx(Fs,{})})]}),e.jsx(Jo,{sx:{zIndex:10},open:m,anchorEl:y.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:P})=>e.jsx(Xo,{...P,style:{transformOrigin:"center top"},children:e.jsx(qt,{children:e.jsx(Yo,{onClickAway:D,children:e.jsxs(Zo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[G==null?void 0:G.map(N=>{var H;return e.jsxs(be,{selected:N.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>R(N),children:[e.jsxs(c,{children:[e.jsx(De,{sx:{fontSize:"16px"},maxLength:24,children:N.name}),e.jsx(De,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:N.url})]}),qs({store:N,userDid:(H=d==null?void 0:d.user)==null?void 0:H.did})&&e.jsx(de,{sx:{ml:1},onClick:C=>{C.preventDefault(),C.stopPropagation(),S(N)},children:e.jsx(ue,{icon:"ic:outline-delete"})})]},N.url)}),e.jsx(Zn,{}),e.jsxs(be,{onClick:B,children:[e.jsx(bt,{font:!0}),e.jsx(A,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(mn,{hiddenChildren:!0,open:!0,onClose:$,teamDid:U,storeList:G,scope:"studio",onAdd:(q=h==null?void 0:h.actions)==null?void 0:q.refreshBlocklet}),k&&e.jsx(mt,{displayError:!0,title:`${u("common.delete")} ${k.name}`,description:u("blocklet.publish.deleteStoreTip",{name:k.name}),confirm:u("common.confirm"),onConfirm:z,onCancel:()=>S(null)})]})}lo.propTypes={store:s.object,blocklet:s.object,onChangeStore:s.func.isRequired,onClick:s.func.isRequired,loading:s.bool.isRequired,disabled:s.bool.isRequired,componentDid:s.string.isRequired,projectType:s.string.isRequired,getData:s.func.isRequired};lo.defaultProps={store:null,blocklet:null};const Vr=(t,o,n)=>{const r=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/logo/upload`,i=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/screenshot/upload`,a=t!=null&&t.blockletLogo?`${r}/${t.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,l=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${i}/${u}`);return{logoUrl:a,screenshotUrls:l,uploadLogoPrefix:r,uploadScreenshotPrefix:i}},$n=Vr,Ur=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");return o||n};function xt({url:t,style:o,controls:n,modestbranding:r}){var u;const{t:i}=Q(),a=t.includes("youtube.com")||t.includes("youtu.be"),l=t.includes("vimeo.com");if(a){const d=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${n}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(l){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ue,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:i("studio.videoDialogNoSrc")})]})})}xt.propTypes={url:s.string.isRequired,style:s.object,controls:s.number,modestbranding:s.number};xt.defaultProps={style:{},controls:1,modestbranding:1};function Pn({setParams:t,onClose:o,params:n}){const{t:r}=Q(),[i,a]=j.useState(""),l=i&&n.blockletVideos.includes(i),u=Ur(i),d=()=>{t(x=>{const b=[...x.blockletVideos];return b.push(i),{...x,blockletVideos:b}}),o()};return e.jsxs(pt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Qo,{children:r("studio.videoDialogTitle")}),e.jsxs(Ko,{children:[e.jsx(Qn,{fullWidth:!0,value:i,onChange:x=>a(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:i?e.jsx(Ye,{position:"end",children:e.jsx(de,{onClick:()=>a(""),children:e.jsx(ys,{})})}):null,error:l}),l&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(xt,{url:i,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(en,{children:[e.jsx(ee,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(ee,{disabled:!u||l,onClick:d,children:r("studio.confirm")})]})]})}Pn.propTypes={onClose:s.func.isRequired,params:s.object.isRequired,setParams:s.func.isRequired};function Pt({errors:t,storeList:o,...n}){const{t:r}=Q();return e.jsxs(c,{...n,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([i,a])=>{const l=Object.values(a),u=o.find(d=>d.url===i);return l.length>0&&e.jsxs(c,{children:[e.jsx(ye,{title:i,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),l.map(d=>e.jsx(c,{component:"li",ml:2,sx:{wordBreak:!0},children:d},d))]},i)})]})}Pt.propTypes={errors:s.object.isRequired,storeList:s.array.isRequired};const Oo=j.lazy(()=>pn(()=>import("./index-Inc_KF9k.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function io({projectId:t,readOnly:o,loading:n,blocklet:r,params:i,setParams:a,paramsErrTip:l,setParamsErrTip:u,warning:d,setLoading:x,initUrl:b,initLogoUrl:p,setInitLogoUrl:h,componentDid:m}){const{t:f,locale:y}=Q(),{api:v}=ke(),g=Et(),k=j.useRef(null),S=j.useRef(null),[R,T]=Ar(r),[D,B]=j.useState(!1),$=xn({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async E=>{const Z=setTimeout(()=>{x(!1)},2e4),Y=await Or(v,E);x(!1),clearTimeout(Z),window.parent.postMessage({event:"studioDialog.connected",componentDid:m},"*"),g(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${Y}/create`),{replace:!0})},G=()=>{if(!i.blockletTitle){M.error(f("blocklet.publish.errorTip.noTitle"));return}if(!(R!=null&&R.url)){M.error(f("blocklet.publish.noStoreSelected"));return}const E=zr();$(async(Z,Y)=>{var oe,le,te;try{const ne=await v.connectByStudio({input:{did:(oe=r==null?void 0:r.meta)==null?void 0:oe.did,blockletTitle:i==null?void 0:i.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:((le=i==null?void 0:i.blockletComponents)==null?void 0:le.length)>0?"pack":"resource",componentDid:m,messageId:E,tenantScope:(b==null?void 0:b.searchParams.get("tenantScope"))||""}});if(!(ne!=null&&ne.url)){M.error("failed to connect to store");return}Y(ne.url),z({did:(te=r==null?void 0:r.meta)==null?void 0:te.did,projectId:"",messageId:E})}catch(ne){const ae=je(ne);M.error(ae),x(!1)}})},{logoUrl:U,screenshotUrls:w,uploadLogoPrefix:I,uploadScreenshotPrefix:q}=$n(i,r,t),{logoErrors:P,screenshotErrors:N,storeList:H,hasLogoWarning:C,hasScreenshotWarning:_}=d,J=()=>o?!1:!t||t===X.UNOWNED_DID?(M.error(f("blocklet.publish.errorTip.noFirstDid")),!1):!0,F=E=>{if(!E.destination)return;const Z=Array.from(i.blockletScreenshots),[Y]=Z.splice(E.source.index,1);Z.splice(E.destination.index,0,Y),a(oe=>({...oe,blockletScreenshots:Z}))},K=E=>{if(!E.destination)return;const Z=Array.from(i.blockletVideos),[Y]=Z.splice(E.source.index,1);Z.splice(E.destination.index,0,Y),a(oe=>({...oe,blockletVideos:Z}))};return e.jsxs(Fr,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.title")}`,placeholder:`Blocklet ${f("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:i.blockletTitle||"",onChange:E=>{u({blockletTitle:""}),a({blockletTitle:E.target.value})},error:!!l.blockletTitle,helperText:l.blockletTitle||""}),e.jsx(re,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===X.UNOWNED_DID&&e.jsx(Ye,{position:"end",children:e.jsx(lo,{blocklet:r,store:R,componentDid:m,onChangeStore:T,disabled:!i.blockletTitle||o||n,loading:n,onClick:G})})},error:!!l.projectId,helperText:l.projectId||"",value:t===X.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.description")}`,placeholder:`Blocklet ${f("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletDescription||"",onChange:E=>{u({blockletDescription:""}),a({blockletDescription:E.target.value.slice(0,159)})},error:!!l.blockletDescription,helperText:l.blockletDescription||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.homepageTip")}`,placeholder:`Blocklet ${f("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletHomepage||"",onChange:E=>{E.target.value&&!/^(http|https):\/\//.test(E.target.value)?u({blockletHomepage:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),a({blockletHomepage:E.target.value})},error:!!l.blockletHomepage,helperText:l.blockletHomepage||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.community")}`,placeholder:`Blocklet ${f("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletCommunity||"",onChange:E=>{E.target.value&&!/^(http|https):\/\//.test(E.target.value)?u({blockletCommunity:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),a({blockletCommunity:E.target.value})},error:!!l.blockletCommunity,helperText:l.blockletCommunity||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.support")}`,placeholder:`Blocklet ${f("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletSupport||"",onChange:E=>{E.target.value&&!/^(http|https):\/\//.test(E.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(E.target.value)?u({blockletSupport:f("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),a({blockletSupport:E.target.value})},error:!!l.blockletSupport,helperText:l.blockletSupport||"",sx:{mt:3}}),e.jsx(re,{disabled:n||o,label:`Blocklet ${f("common.repository")}`,placeholder:`Blocklet ${f("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletRepository||"",onChange:E=>{E.target.value&&!/^(git|https|svn)/.test(E.target.value)?u({blockletRepository:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),a({blockletRepository:E.target.value})},error:!!l.blockletRepository,helperText:l.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Ce,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.logo")}),e.jsxs(Ce,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Lt,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:p||U,onClick:()=>{var E;J()&&((E=k.current)==null||E.open())}})})]}),C&&e.jsx(Pt,{errors:P,storeList:H,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Ce,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.screenshot")}),e.jsxs(Ce,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:f("studio.orderTip")})]})})]})]}),e.jsx($o,{onDragEnd:o?void 0:F,children:e.jsx(Po,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(E,Z)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:Z.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Z.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:E.innerRef,...E.droppableProps,children:[w.map((Y,oe)=>e.jsx(_o,{draggableId:Y,index:oe,isDragDisabled:o,children:(le,te)=>e.jsxs(c,{ref:le.innerRef,...le.draggableProps,className:"screenshot",sx:{transform:te.isDragging?"scale(1.05)":"none",boxShadow:te.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:Y}),!o&&e.jsx(de,{...le.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx($t,{})}),!o&&e.jsx(de,{className:"action",onClick:()=>{a(ne=>{const ae=[...ne.blockletScreenshots];return ae.splice(oe,1),{...ne,blockletScreenshots:ae}})},children:e.jsx(lt,{})})]})},Y)),E.placeholder,w.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var Y;J()&&((Y=S.current)==null||Y.open())},children:"+"})]})})})]}),_&&e.jsx(Pt,{errors:N,storeList:H}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Ce,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("studio.video")}),e.jsxs(Ce,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"secondary.main"},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"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:f("studio.orderTip")})]})})]})]}),e.jsx($o,{onDragEnd:o?void 0:K,children:e.jsx(Po,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(E,Z)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:Z.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Z.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:E.innerRef,...E.droppableProps,children:[i.blockletVideos.map((Y,oe)=>e.jsx(_o,{draggableId:Y,index:oe,isDragDisabled:o,children:(le,te)=>e.jsxs(c,{ref:le.innerRef,...le.draggableProps,className:"screenshot",sx:{transform:te.isDragging?"scale(1.05)":"none",boxShadow:te.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(xt,{url:Y,style:{pointerEvents:te.isDragging?"none":"auto"}}),!o&&e.jsx(de,{...le.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx($t,{})}),!o&&e.jsx(de,{className:"action",onClick:()=>{a(ne=>{const ae=[...ne.blockletVideos];return ae.splice(oe,1),{...ne,blockletVideos:ae}})},children:e.jsx(lt,{})})]})},Y)),E.placeholder,i.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{J()&&B(!0)},children:"+"})]})})})]})]})}),e.jsxs(j.Suspense,{fallback:e.jsx(Ze,{}),children:[e.jsx(Oo,{ref:k,locale:y,popup:!0,onUploadFinish:E=>{var Z;a({blockletLogo:E.data.filename}),h(""),(Z=k.current)==null||Z.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,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"),D&&e.jsx(Pn,{onClose:()=>B(!1),params:i,setParams:a}),e.jsx(Oo,{ref:S,locale:y,popup:!0,onUploadFinish:E=>{var Z;a(Y=>{var le;const oe=Y.blockletScreenshots||[];return oe.push((le=E.data)==null?void 0:le.filename),{...Y,blockletScreenshots:oe}}),(Z=S.current)==null||Z.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:q,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-w.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")]})]})}io.propTypes={projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,warning:s.object.isRequired,loading:s.bool.isRequired,blocklet:s.object.isRequired,setLoading:s.func.isRequired,initUrl:s.object,componentDid:s.string,initLogoUrl:s.string.isRequired,setInitLogoUrl:s.func.isRequired};io.defaultProps={initUrl:null,componentDid:""};const Fr=Re.div`
|
|
146
146
|
margin-top: 24px;
|
|
147
147
|
.screenshot {
|
|
148
148
|
margin-bottom: 16px;
|
|
@@ -190,7 +190,7 @@ import{r as j,f as Et,l as ut,L as we,g as Hn,u as Gn,i as Jn,j as wt}from"./ven
|
|
|
190
190
|
padding-bottom: 12px;
|
|
191
191
|
border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
|
|
192
192
|
}
|
|
193
|
-
`;function Nn({text:t}){const{palette:o}=rn();return t?e.jsx(Gs,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:Cs.sanitize(t),rehypePlugins:[[Js,{target:"_blank"}]]}):e.jsx(Ue,{Icon:Vt})}Nn.propTypes={text:s.string.isRequired};function An({params:t,setParams:o,paramsErrTip:n,loading:r,setParamsErrTip:i,readOnly:a}){var b;const{t:l}=Q(),[u,d]=j.useState(a?"preview":"write"),x=(p,h)=>{d(h)};return e.jsxs(c,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",fontWeight:"bold",sx:{},children:l("common.introduction")}),e.jsxs(ln,{value:u,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(rt,{value:"write",label:"Write"}),e.jsx(rt,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(re,{disabled:r||a,sx:{border:"none"},placeholder:`Blocklet ${l("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:e.jsxs(Ye,{position:"end",children:[((b=t==null?void 0:t.blockletIntroduction)==null?void 0:b.length)||0," / ",fe.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{i({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,fe.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(Nn,{text:t.blockletIntroduction||""})})]})}An.propTypes={params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,readOnly:s.bool.isRequired,loading:s.bool.isRequired};var go={},nl=Ie;Object.defineProperty(go,"__esModule",{value:!0});var _t=go.default=void 0,sl=nl($e()),Mo=e;_t=go.default=(0,sl.default)([(0,Mo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Mo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function jo({step:t,ok:o,active:n,error:r,warning:i}){let a="grey.500",l=t+1;return o&&(l=e.jsx(jn,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&n>t?(a="error.main",l=e.jsx(_t,{sx:{fontSize:18,margin:0},color:"white"})):i?(a="warning.main",l=e.jsx(_t,{sx:{fontSize:18,margin:0},color:"white"})):n>=t&&(a="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:a,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:l})}jo.propTypes={step:s.number,ok:s.bool,active:s.number,error:s.string,warning:s.bool};jo.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function ko({steps:t,activeStep:o,setActiveStep:n,hasSelectedResources:r,params:i,loading:a,paramsErrTip:l,warning:u,viewMode:d,projectId:x}){const{t:b}=Q(),p=()=>{n(y=>y+1)},h=()=>{n(y=>y-1)},m=y=>y===0?(l==null?void 0:l.blockletTitle)||(l==null?void 0:l.projectId)||(l==null?void 0:l.blockletDescription)||(l==null?void 0:l.blockletHomepage)||(l==null?void 0:l.blockletSupport)||(l==null?void 0:l.blockletCommunity)||(l==null?void 0:l.blockletRepository):y===2?(l==null?void 0:l.blockletResource)||(l==null?void 0:l.blockletDocker)||(l==null?void 0:l.dockerImageName):y>=4?(l==null?void 0:l.blockletVersion)||(l==null?void 0:l.note):"",f=d||En({hasSelectedResources:r,params:i,projectId:x,t:b})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(ns,{activeStep:o,orientation:"vertical",children:t.map((y,v)=>{const g={},k=a||!Kr({hasSelectedResources:r,params:i,projectId:x,step:v,t:b}),S=a?"":m(v);return S&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:S}),g.error=!0),e.jsxs(ss,{children:[e.jsx(rs,{icon:e.jsx(jo,{error:S,warning:v===0?u.hasWarning:!1,active:f?99:o,step:v,ok:k}),sx:{cursor:"pointer",color:S?"error.main":"inherit"},disabled:!1,onClick:()=>n(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:S||!k&&o>v?"error.main":"inherit",children:y.label})}),e.jsxs(ls,{children:[e.jsx(A,{fontSize:12,children:y.description}),!f&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(ee,{variant:"contained",onClick:p,sx:{mt:1,mr:1},disabled:S||!k,children:b("common.continue")}),v>0&&e.jsx(ee,{disabled:v===0,onClick:h,sx:{mt:1,mr:1},children:b("common.back")})]})})]})]},y.label)})}),o>=t.length-1&&e.jsx(qt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}ko.propTypes={steps:s.array.isRequired,activeStep:s.number.isRequired,setActiveStep:s.func.isRequired,params:s.object.isRequired,viewMode:s.oneOfType([s.string,s.bool]),loading:s.bool.isRequired,projectId:s.string.isRequired,hasSelectedResources:s.oneOfType([s.string,s.bool]),warning:s.object.isRequired,paramsErrTip:s.shape({projectId:s.string,blockletVersion:s.string,blockletTitle:s.string,blockletDescription:s.string,note:s.string,blockletResource:s.string,blockletHomepage:s.string,blockletSupport:s.string,blockletCommunity:s.string,blockletRepository:s.string,blockletDocker:s.object,dockerImageName:s.string}).isRequired};ko.defaultProps={hasSelectedResources:!1,viewMode:""};const rl=[".zip",".gz"],ll=1024*1024*100,il=j.lazy(()=>pn(()=>import("./index-Hgoqly4p.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function yo({app:t,projectId:o,readOnly:n,params:r,setParams:i,setParamsErrTip:a,error:l}){const{t:u,locale:d}=Q(),x=j.useRef(null),b=()=>n?!1:!o||o===X.UNOWNED_DID?(M.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,p=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Ce,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${p}/params.uploadedResource`,children:r.uploadedResource}),!n&&e.jsx(ee,{variant:"outlined",size:"small",onClick:()=>{var h;b()&&((h=x.current)==null||h.open())},children:r.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(j.Suspense,{fallback:e.jsx(Ze,{}),children:e.jsx(il,{ref:x,locale:d,popup:!0,onUploadFinish:h=>{var m;i({uploadedResource:h.data.filename}),a({blockletResource:""}),(m=x.current)==null||m.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:p,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:rl,maxFileSize:ll,maxNumberOfFiles:1}}},"uploader-resource")}),!!l&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:l})]})}yo.propTypes={app:s.object.isRequired,projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,error:s.string.isRequired,setParamsErrTip:s.func.isRequired};yo.defaultProps={};function at({readOnly:t,params:o,setParams:n,paramsErrTip:r,setParamsErrTip:i,loading:a}){var u;const{t:l}=Q();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(re,{required:!0,disabled:a||t,label:`Blocklet ${l("common.version")}`,placeholder:`Blocklet ${l("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{i({blockletVersion:""}),n({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),e.jsx(re,{label:l("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Ye,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",fe.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{i({note:""}),n({note:d.target.value.slice(0,fe.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}at.propTypes={readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,loading:s.bool.isRequired};at.defaultProps={};function zn(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&zn(t[o]);return t}function dt({index:t,item:o,dockerParams:n,setDockerParams:r,dataKey:i,t:a,readOnly:l}){const u=(o==null?void 0:o.value)||"",[d,x]=j.useState(!1),b=()=>{var U;(U=n[i])==null||U.splice(t,1),r({...n,[i]:[...n[i]]})},p=(U,w)=>{var I;(I=n[i])!=null&&I[t]&&(w?(n[i][t].custom=n[i][t].value,n[i][t].value=`$${Ct(o.key)}`):(n[i][t].value=n[i][t].custom||"",n[i][t].custom="")),r({...n,[i]:[...n[i]]})},h=(U,w)=>{var q;const I=((q=n[i][t])==null?void 0:q.value)||"";n[i][t]={...n[i][t],secure:w,value:w&&I===fe.BLOCKLET_AUTOMATIC_ENV_VALUE?"":I},r({...n,[i]:[...n[i]]})},m=(U,w)=>{n[i][t]={...n[i][t],shared:w},r({...n,[i]:[...n[i]]})},f=(U,w)=>{var q;const I=((q=n[i][t])==null?void 0:q.value)||"";n[i][t]={...n[i][t],required:w,value:w&&I===fe.BLOCKLET_AUTOMATIC_ENV_VALUE?"":I},r({...n,[i]:[...n[i]]})},y=(U,w)=>{n[i][t]={...n[i][t],value:w?fe.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...n,[i]:[...n[i]]})},v=U=>{n[i][t]={...n[i][t],description:U.target.value},r({...n,[i]:[...n[i]]})},g=U=>{const w=U.target.value==="web"?"web":"docker";w==="web"&&n.dockerArgs.forEach(P=>{P.type="docker"});const q=`/${n.dockerImage.replace(/\W/g,"-")}-${t}`;n.dockerArgs[t]={...n.dockerArgs[t],type:w,path:w==="docker"?q:"/",protocol:"http",prefix:w==="docker"?q:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...n,dockerArgs:[...n.dockerArgs]})},k=U=>{n.dockerArgs[t]={...n.dockerArgs[t],proxyBehavior:U.target.value==="direct"?"direct":"service"},r({...n,dockerArgs:[...n.dockerArgs]})},S=U=>{const w=U.target.value;n[i][t]={...n[i][t],prefix:w,path:w==="*"?"/":w},r({...n,[i]:[...n[i]]})},R=U=>{var w;(w=n[i])!=null&&w[t]&&(n[i][t].value=U.target.value),r({...n,[i]:[...n[i]]})},T=u===`$${Ct(o.key)}`||o.custom,D=i==="dockerArgs"&&!gn[o.key],B=Bs[o.key],$=i==="dockerEnvs",z=o.key==="--publish";let G=o.key;return z&&o.type==="web"?G="--publish (Web)":$&&(G=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(A,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:G})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(re,{disabled:l||T||D||o.value===fe.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:T?`$${Ct(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Ye,{position:"end",sx:{zoom:.9},children:[(!(B||D)||$||z)&&e.jsx(de,{onClick:()=>x(!0),children:e.jsx(ue,{icon:"icon-park-outline:setting-config"})}),!l&&e.jsx(de,{onClick:b,color:D?"error":"default",children:e.jsx(ue,{icon:"ic:round-delete"})})]})},error:D,onChange:R}),D&&e.jsx(A,{variant:"caption",color:"error",children:a("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(A,{variant:"caption",color:"text.secondary",children:a("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&Ms[o.key](u)&&e.jsx(A,{variant:"caption",color:"error",children:a("blocklet.publish.docker.volumeTips")})]}),d&&e.jsx(ft,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:a($?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>x(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[B||D||$?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.needCustomInput")}),e.jsx(Ee,{disabled:l,checked:T,onChange:p,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.shared")}),e.jsx(Ee,{disabled:l,checked:o.shared,onChange:m,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.required")}),e.jsx(Ee,{disabled:l,checked:o.required,onChange:f,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.secure")}),e.jsx(Ee,{disabled:l,checked:o.secure,onChange:h,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.autoGenerated")}),e.jsx(Ee,{disabled:l,checked:o.value===fe.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:y,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.description")}),e.jsx(re,{disabled:l,value:o.description,onChange:v,sx:{flex:1},label:a("blocklet.publish.docker.description")})]}),z&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.portType")}),e.jsxs(It,{value:o.type||"docker",onChange:g,children:[e.jsx(be,{value:"docker",children:"Docker"}),e.jsx(be,{value:"web",children:"Web"})]})]}),z&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.proxyBehavior")}),e.jsxs(It,{value:o.proxyBehavior||"service",onChange:k,children:[e.jsx(be,{value:"service",children:a("blocklet.publish.docker.serviceProxy")}),e.jsx(be,{value:"direct",children:a("blocklet.publish.docker.directProxy")})]})]}),z&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.prefix")}),e.jsx(re,{disabled:l,value:o.prefix,onChange:S,sx:{flex:1},label:a("blocklet.publish.docker.prefix")})]})]})})]})}dt.propTypes={dockerParams:s.object.isRequired,setDockerParams:s.func.isRequired,dataKey:s.string.isRequired,item:s.object.isRequired,t:s.func.isRequired,readOnly:s.bool.isRequired,index:s.number.isRequired};dt.defaultProps={};const cl=`
|
|
193
|
+
`;function Nn({text:t}){const{palette:o}=rn();return t?e.jsx(Gs,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:Cs.sanitize(t),rehypePlugins:[[Js,{target:"_blank"}]]}):e.jsx(Ue,{Icon:Vt})}Nn.propTypes={text:s.string.isRequired};function An({params:t,setParams:o,paramsErrTip:n,loading:r,setParamsErrTip:i,readOnly:a}){var b;const{t:l}=Q(),[u,d]=j.useState(a?"preview":"write"),x=(p,h)=>{d(h)};return e.jsxs(c,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",fontWeight:"bold",sx:{},children:l("common.introduction")}),e.jsxs(ln,{value:u,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(rt,{value:"write",label:"Write"}),e.jsx(rt,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(re,{disabled:r||a,sx:{border:"none"},placeholder:`Blocklet ${l("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:e.jsxs(Ye,{position:"end",children:[((b=t==null?void 0:t.blockletIntroduction)==null?void 0:b.length)||0," / ",fe.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{i({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,fe.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(Nn,{text:t.blockletIntroduction||""})})]})}An.propTypes={params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,readOnly:s.bool.isRequired,loading:s.bool.isRequired};var go={},nl=Ie;Object.defineProperty(go,"__esModule",{value:!0});var _t=go.default=void 0,sl=nl($e()),Mo=e;_t=go.default=(0,sl.default)([(0,Mo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Mo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function jo({step:t,ok:o,active:n,error:r,warning:i}){let a="grey.500",l=t+1;return o&&(l=e.jsx(jn,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&n>t?(a="error.main",l=e.jsx(_t,{sx:{fontSize:18,margin:0},color:"white"})):i?(a="warning.main",l=e.jsx(_t,{sx:{fontSize:18,margin:0},color:"white"})):n>=t&&(a="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:a,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:l})}jo.propTypes={step:s.number,ok:s.bool,active:s.number,error:s.string,warning:s.bool};jo.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function ko({steps:t,activeStep:o,setActiveStep:n,hasSelectedResources:r,params:i,loading:a,paramsErrTip:l,warning:u,viewMode:d,projectId:x}){const{t:b}=Q(),p=()=>{n(y=>y+1)},h=()=>{n(y=>y-1)},m=y=>y===0?(l==null?void 0:l.blockletTitle)||(l==null?void 0:l.projectId)||(l==null?void 0:l.blockletDescription)||(l==null?void 0:l.blockletHomepage)||(l==null?void 0:l.blockletSupport)||(l==null?void 0:l.blockletCommunity)||(l==null?void 0:l.blockletRepository):y===2?(l==null?void 0:l.blockletResource)||(l==null?void 0:l.blockletDocker)||(l==null?void 0:l.dockerImageName):y>=4?(l==null?void 0:l.blockletVersion)||(l==null?void 0:l.note):"",f=d||En({hasSelectedResources:r,params:i,projectId:x,t:b})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(ns,{activeStep:o,orientation:"vertical",children:t.map((y,v)=>{const g={},k=a||!Kr({hasSelectedResources:r,params:i,projectId:x,step:v,t:b}),S=a?"":m(v);return S&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:S}),g.error=!0),e.jsxs(ss,{children:[e.jsx(rs,{icon:e.jsx(jo,{error:S,warning:v===0?u.hasWarning:!1,active:f?99:o,step:v,ok:k}),sx:{cursor:"pointer",color:S?"error.main":"inherit"},disabled:!1,onClick:()=>n(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:S||!k&&o>v?"error.main":"inherit",children:y.label})}),e.jsxs(ls,{children:[e.jsx(A,{fontSize:12,children:y.description}),!f&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(ee,{variant:"contained",onClick:p,sx:{mt:1,mr:1},disabled:S||!k,children:b("common.continue")}),v>0&&e.jsx(ee,{disabled:v===0,onClick:h,sx:{mt:1,mr:1},children:b("common.back")})]})})]})]},y.label)})}),o>=t.length-1&&e.jsx(qt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}ko.propTypes={steps:s.array.isRequired,activeStep:s.number.isRequired,setActiveStep:s.func.isRequired,params:s.object.isRequired,viewMode:s.oneOfType([s.string,s.bool]),loading:s.bool.isRequired,projectId:s.string.isRequired,hasSelectedResources:s.oneOfType([s.string,s.bool]),warning:s.object.isRequired,paramsErrTip:s.shape({projectId:s.string,blockletVersion:s.string,blockletTitle:s.string,blockletDescription:s.string,note:s.string,blockletResource:s.string,blockletHomepage:s.string,blockletSupport:s.string,blockletCommunity:s.string,blockletRepository:s.string,blockletDocker:s.object,dockerImageName:s.string}).isRequired};ko.defaultProps={hasSelectedResources:!1,viewMode:""};const rl=[".zip",".gz"],ll=1024*1024*100,il=j.lazy(()=>pn(()=>import("./index-Inc_KF9k.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function yo({app:t,projectId:o,readOnly:n,params:r,setParams:i,setParamsErrTip:a,error:l}){const{t:u,locale:d}=Q(),x=j.useRef(null),b=()=>n?!1:!o||o===X.UNOWNED_DID?(M.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,p=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Ce,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${p}/params.uploadedResource`,children:r.uploadedResource}),!n&&e.jsx(ee,{variant:"outlined",size:"small",onClick:()=>{var h;b()&&((h=x.current)==null||h.open())},children:r.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(j.Suspense,{fallback:e.jsx(Ze,{}),children:e.jsx(il,{ref:x,locale:d,popup:!0,onUploadFinish:h=>{var m;i({uploadedResource:h.data.filename}),a({blockletResource:""}),(m=x.current)==null||m.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:p,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:rl,maxFileSize:ll,maxNumberOfFiles:1}}},"uploader-resource")}),!!l&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:l})]})}yo.propTypes={app:s.object.isRequired,projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,error:s.string.isRequired,setParamsErrTip:s.func.isRequired};yo.defaultProps={};function at({readOnly:t,params:o,setParams:n,paramsErrTip:r,setParamsErrTip:i,loading:a}){var u;const{t:l}=Q();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(re,{required:!0,disabled:a||t,label:`Blocklet ${l("common.version")}`,placeholder:`Blocklet ${l("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{i({blockletVersion:""}),n({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),e.jsx(re,{label:l("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Ye,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",fe.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{i({note:""}),n({note:d.target.value.slice(0,fe.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}at.propTypes={readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,loading:s.bool.isRequired};at.defaultProps={};function zn(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&zn(t[o]);return t}function dt({index:t,item:o,dockerParams:n,setDockerParams:r,dataKey:i,t:a,readOnly:l}){const u=(o==null?void 0:o.value)||"",[d,x]=j.useState(!1),b=()=>{var U;(U=n[i])==null||U.splice(t,1),r({...n,[i]:[...n[i]]})},p=(U,w)=>{var I;(I=n[i])!=null&&I[t]&&(w?(n[i][t].custom=n[i][t].value,n[i][t].value=`$${Ct(o.key)}`):(n[i][t].value=n[i][t].custom||"",n[i][t].custom="")),r({...n,[i]:[...n[i]]})},h=(U,w)=>{var q;const I=((q=n[i][t])==null?void 0:q.value)||"";n[i][t]={...n[i][t],secure:w,value:w&&I===fe.BLOCKLET_AUTOMATIC_ENV_VALUE?"":I},r({...n,[i]:[...n[i]]})},m=(U,w)=>{n[i][t]={...n[i][t],shared:w},r({...n,[i]:[...n[i]]})},f=(U,w)=>{var q;const I=((q=n[i][t])==null?void 0:q.value)||"";n[i][t]={...n[i][t],required:w,value:w&&I===fe.BLOCKLET_AUTOMATIC_ENV_VALUE?"":I},r({...n,[i]:[...n[i]]})},y=(U,w)=>{n[i][t]={...n[i][t],value:w?fe.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...n,[i]:[...n[i]]})},v=U=>{n[i][t]={...n[i][t],description:U.target.value},r({...n,[i]:[...n[i]]})},g=U=>{const w=U.target.value==="web"?"web":"docker";w==="web"&&n.dockerArgs.forEach(P=>{P.type="docker"});const q=`/${n.dockerImage.replace(/\W/g,"-")}-${t}`;n.dockerArgs[t]={...n.dockerArgs[t],type:w,path:w==="docker"?q:"/",protocol:"http",prefix:w==="docker"?q:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...n,dockerArgs:[...n.dockerArgs]})},k=U=>{n.dockerArgs[t]={...n.dockerArgs[t],proxyBehavior:U.target.value==="direct"?"direct":"service"},r({...n,dockerArgs:[...n.dockerArgs]})},S=U=>{const w=U.target.value;n[i][t]={...n[i][t],prefix:w,path:w==="*"?"/":w},r({...n,[i]:[...n[i]]})},R=U=>{var w;(w=n[i])!=null&&w[t]&&(n[i][t].value=U.target.value),r({...n,[i]:[...n[i]]})},T=u===`$${Ct(o.key)}`||o.custom,D=i==="dockerArgs"&&!gn[o.key],B=Bs[o.key],$=i==="dockerEnvs",z=o.key==="--publish";let G=o.key;return z&&o.type==="web"?G="--publish (Web)":$&&(G=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(A,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:G})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(re,{disabled:l||T||D||o.value===fe.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:T?`$${Ct(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Ye,{position:"end",sx:{zoom:.9},children:[(!(B||D)||$||z)&&e.jsx(de,{onClick:()=>x(!0),children:e.jsx(ue,{icon:"icon-park-outline:setting-config"})}),!l&&e.jsx(de,{onClick:b,color:D?"error":"default",children:e.jsx(ue,{icon:"ic:round-delete"})})]})},error:D,onChange:R}),D&&e.jsx(A,{variant:"caption",color:"error",children:a("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(A,{variant:"caption",color:"text.secondary",children:a("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&Ms[o.key](u)&&e.jsx(A,{variant:"caption",color:"error",children:a("blocklet.publish.docker.volumeTips")})]}),d&&e.jsx(ft,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:a($?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>x(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[B||D||$?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.needCustomInput")}),e.jsx(Ee,{disabled:l,checked:T,onChange:p,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.shared")}),e.jsx(Ee,{disabled:l,checked:o.shared,onChange:m,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.required")}),e.jsx(Ee,{disabled:l,checked:o.required,onChange:f,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.secure")}),e.jsx(Ee,{disabled:l,checked:o.secure,onChange:h,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:a("blocklet.publish.docker.autoGenerated")}),e.jsx(Ee,{disabled:l,checked:o.value===fe.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:y,sx:{zoom:.9}})]}),$&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.description")}),e.jsx(re,{disabled:l,value:o.description,onChange:v,sx:{flex:1},label:a("blocklet.publish.docker.description")})]}),z&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.portType")}),e.jsxs(It,{value:o.type||"docker",onChange:g,children:[e.jsx(be,{value:"docker",children:"Docker"}),e.jsx(be,{value:"web",children:"Web"})]})]}),z&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.proxyBehavior")}),e.jsxs(It,{value:o.proxyBehavior||"service",onChange:k,children:[e.jsx(be,{value:"service",children:a("blocklet.publish.docker.serviceProxy")}),e.jsx(be,{value:"direct",children:a("blocklet.publish.docker.directProxy")})]})]}),z&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:a("blocklet.publish.docker.prefix")}),e.jsx(re,{disabled:l,value:o.prefix,onChange:S,sx:{flex:1},label:a("blocklet.publish.docker.prefix")})]})]})})]})}dt.propTypes={dockerParams:s.object.isRequired,setDockerParams:s.func.isRequired,dataKey:s.string.isRequired,item:s.object.isRequired,t:s.func.isRequired,readOnly:s.bool.isRequired,index:s.number.isRequired};dt.defaultProps={};const cl=`
|
|
194
194
|
docker run --name postgrest
|
|
195
195
|
-p 3000:3000
|
|
196
196
|
-e PGRST_DB_URI="postgres://username:password@host:port/database"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h}from"./vendor-react-DEoibe3W.js";import{H as e,j as a,bo as Y,bq as w,O as S,q as j,aa as v}from"./vendor-mui-core-Bq8gXTan.js";import{y as s}from"./index-
|
|
1
|
+
import{r as h}from"./vendor-react-DEoibe3W.js";import{H as e,j as a,bo as Y,bq as w,O as S,q as j,aa as v}from"./vendor-mui-core-Bq8gXTan.js";import{y as s}from"./index-CMYalRl2.js";import{a as H}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{A as M}from"./vendor-arcblock-DiSm3oUX.js";import{b as _}from"./vendor-hooks-BFlOfe0M.js";import{L as A,D as y}from"./vendor-mui-x-1nqAyytV.js";import{A as C}from"./AdapterDayjs-BzjU9O7t.js";function x({value:r,onChange:i,error:m,helperText:u,label:t,timezone:n}){const d=n?s().tz(n):s(),p=_(()=>{let l=s();return r&&(l=n?s(r).tz(n):s(r)),l.format("YYYY-MM-DD[T]HH:mm")},[r,n]),D=l=>{const T=n?s(l).tz(n).format("YYYY-MM-DD HH:mm:00"):s(l).format("YYYY-MM-DD HH:mm:00");i(new Date(T))};return a.jsx(A,{dateAdapter:C,children:a.jsxs(Y,{fullWidth:!0,error:m,children:[a.jsx(y,{label:t,minDateTime:d,value:s(p),onChange:D,slotProps:{textField:{error:m,helperText:m?u:""}},format:"YYYY-MM-DD HH:mm"}),u&&a.jsx(w,{children:u})]})})}x.propTypes={value:e.oneOfType([e.string,e.instanceOf(Date)]),onChange:e.func.isRequired,error:e.bool,helperText:e.string,label:e.string,timezone:e.string};x.defaultProps={value:null,error:!1,helperText:"",label:"",timezone:""};function E(r){return a.jsx(M,{...r,width:20,height:20})}const c={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function b({placeholder:r,value:i,onChange:m,timezone:u}){const{t}=H(),[n,d]=h.useState(i||""),[p,D]=h.useState(null),l=h.useMemo(()=>[{value:new Date(Date.now()+c.MINUTES_30),label:`30 ${t("common.minutes")}`},{value:new Date(Date.now()+c.HOUR_1),label:`1 ${t("common.hour")}`},{value:new Date(Date.now()+c.HOURS_3),label:`3 ${t("common.hours")}`},{value:new Date(Date.now()+c.DAY_1),label:`1 ${t("common.day")}`},{value:new Date(Date.now()+c.DAYS_7),label:`7 ${t("common.days")}`},{value:new Date(Date.now()+c.DAYS_30),label:`30 ${t("common.days")}`},{value:"custom",label:t("common.custom")}],[t]),T=o=>{if(d(o),o==="custom"){const f=s().toDate();D(f),m(f)}else m(o)},g=o=>{D(o),m(o)};return h.useEffect(()=>{i&&(l.find(f=>s(f.value).isSame(i))||(d("custom"),D(i)))},[]),a.jsxs(a.Fragment,{children:[a.jsx(Y,{fullWidth:!0,children:a.jsx(S,{select:!0,value:n,label:r||t("team.passport.passportExpireTime"),onChange:o=>T(o.target.value),variant:"outlined",SelectProps:{IconComponent:E},children:l.map(o=>a.jsx(j,{value:o.value,children:o.label},o.value))})}),n==="custom"&&a.jsx(v,{children:a.jsx(x,{value:p,onChange:g,label:t("team.passport.customExpireTime"),timezone:u,error:!p,helperText:p?void 0:t("team.passport.customExpireTime")})})]})}b.propTypes={value:e.oneOfType([e.string,e.instanceOf(Date)]),onChange:e.func.isRequired,timezone:e.string,placeholder:e.string};b.defaultProps={value:"",timezone:"",placeholder:""};export{b as T};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-D2t-u0YU.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as e,aa as n,as as g,T as z,O as U,bu as q,bs as W,bv as H,cG as N,y as O,ah as I,ai as B,ck as J,dy as X,dz as K,I as Y,dA as Q,e as Z,b$ as ee}from"./vendor-mui-core-Bq8gXTan.js";import{r as b}from"./vendor-react-DEoibe3W.js";import{H as te,a as E,f as re,i as ie,d as oe}from"./vendor-hooks-
|
|
2
|
+
import{j as e,aa as n,as as g,T as z,O as U,bu as q,bs as W,bv as H,cG as N,y as O,ah as I,ai as B,ck as J,dy as X,dz as K,I as Y,dA as Q,e as Z,b$ as ee}from"./vendor-mui-core-Bq8gXTan.js";import{r as b}from"./vendor-react-DEoibe3W.js";import{H as te,a as E,f as re,i as ie,d as oe}from"./vendor-hooks-BFlOfe0M.js";import{T as ae,bF as se,_}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{aP as ne}from"./vendor-utils-BotmZdBm.js";import{getAIKitComponent as le}from"./index-Inc_KF9k.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DiSm3oUX.js";import"./index-BCtTVvHw.js";import"./index-CMYalRl2.js";import"./index-DVQCgvFb.js";const F=b.createContext({}),D=()=>b.useContext(F);function de({children:t,restrictions:c,i18n:s,theme:o}){const[l,f]=te({loading:!1}),x=a=>f(j=>({...j,loading:a})),m=b.useMemo(()=>({...l,onLoading:x,restrictions:c,i18n:s}),[l]);return e.jsx(ae,{theme:o,children:e.jsx(F.Provider,{value:m,children:t})})}const ce=["1024x1024","1024x1792","1792x1024"],xe=["256x256","512x512","1024x1024"],ue=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function pe({onSubmit:t}){const{loading:c,i18n:s}=D(),o=E({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),l=()=>{const a=JSON.parse(JSON.stringify(o));Object.values(o).every(y=>!!y)&&t(a)},{run:f}=re(l,{wait:500}),x={width:"100%",pl:1,pr:1},m=o.model==="dall-e-2"?xe:ce;return e.jsxs(me,{onSubmit:a=>a.preventDefault(),children:[e.jsx(n,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(g,{container:!0,gap:2.5,children:[e.jsxs(g,{item:!0,xs:12,children:[e.jsx(z,{gutterBottom:!0,className:"title label",color:"text.primary",children:s("aiImagePrompt")}),e.jsx(U,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:s("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:o.prompt??"",onChange:a=>{a.stopPropagation(),o.prompt=a.target.value},inputProps:{maxLength:1e3}})]}),e.jsxs(g,{item:!0,xs:12,children:[e.jsx(z,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageModel")}`}),e.jsx(q,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:o.model,onChange:a=>{o.number=1,o.size="1024x1024",o.model=a.target.value},children:ue.map(a=>e.jsx(W,{value:a.value,control:e.jsx(H,{size:"small"}),label:a.label},a.label))})]}),e.jsxs(g,{item:!0,xs:12,children:[e.jsx(z,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageSize")}: ${o.size}`}),e.jsx(g,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(n,{flex:1,children:e.jsx(n,{...x,children:e.jsx(N,{size:"small",min:0,max:m.length-1,step:1,value:m.findIndex(a=>a==o.size),onChange:(a,j)=>{o.size=m[j]}})})})})]}),o.model==="dall-e-2"&&e.jsxs(g,{item:!0,xs:12,children:[e.jsx(z,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageNumber")}: ${o.number}`}),e.jsx(n,{...x,children:e.jsx(N,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:o.number,onChange:(a,j)=>{a.stopPropagation(),o.number=Number(j)}})})]})]})}),e.jsx(O,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:f,disabled:c,children:s(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const me=I(n)`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
height: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,ab as S,aa as c,H as d,ah as g}from"./vendor-mui-core-Bq8gXTan.js";import{r as y}from"./vendor-react-DEoibe3W.js";import{bb as v,F as w,B as m}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as t,ab as S,aa as c,H as d,ah as g}from"./vendor-mui-core-Bq8gXTan.js";import{r as y}from"./vendor-react-DEoibe3W.js";import{bb as v,F as w,B as m}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{P}from"./page-header-C_KAJILy.js";import{G as T}from"./index-CMYalRl2.js";import{u as b}from"./config-space-C3fS58cn.js";import{C as B,D as E,a as D}from"./connect-to-Bwfa2hMr.js";import{S as u}from"./step-actions-_23FIn8v.js";import{S as G}from"./layout-CQb1lhEv.js";import"./vendor-utils-BotmZdBm.js";import"./vendor-hooks-BFlOfe0M.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DiSm3oUX.js";import"./spaces-C1lh7et6.js";import"./api-87p2GGd0.js";import"./index-8eXqqyHQ.js";import"./DeleteOutline-CnS2XiM1.js";import"./use-mobile-CtTQsfXN.js";import"./content-layout-BC2QkTYi.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=T(),{spaceGateway:f,settingStorageEndpoint:j,updateSpaceGateway:C,hasStorageEndpoint:h,loading:o,storageEndpoint:s}=b();return o?t.jsx(w,{relative:"parent",children:t.jsx(S,{})}):t.jsxs(N,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:h?t.jsx(B,{spaceGateway:f,settingStorageEndpoint:j}):t.jsx(E,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(D,{onConnect:C,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const N=g(G)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{l as default};
|