@abtnode/blocklet-services 1.16.33-beta-20241015-065257-56072e40 → 1.16.33-beta-20241016-094817-da9da642
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/services/auth/connect/connect-to-did-spaces-for-user.js +21 -15
- package/dist/assets/{Add-DqnQRxKy.js → Add-DAQA4hl7.js} +1 -1
- package/dist/assets/{Alert-D-5Cob8e.js → Alert-B8kenWpY.js} +1 -1
- package/dist/assets/{ArrowDropDown-D0Z0e8Y7.js → ArrowDropDown-B4CQuaFu.js} +1 -1
- package/dist/assets/Autocomplete-D0sWlFIR.js +1 -0
- package/dist/assets/{Avatar-s-RbgNaK.js → Avatar-7y20d6uv.js} +1 -1
- package/dist/assets/{ButtonGroup-CbB4bj5R.js → ButtonGroup-DRVN-vsI.js} +1 -1
- package/dist/assets/{CheckCircle-DCNwD36J.js → CheckCircle-BI66VMY6.js} +1 -1
- package/dist/assets/{ChevronLeft-D9qAKhUC.js → ChevronLeft-DmDrmJDF.js} +1 -1
- package/dist/assets/{ChevronRight-Bg7d5X-4.js → ChevronRight-D-HWZ2Zs.js} +1 -1
- package/dist/assets/{Close-BrR3bQ06.js → Close-BWGd-Nvb.js} +1 -1
- package/dist/assets/{CloseOutlined-C5GNiQn3.js → CloseOutlined-BxdDTJtY.js} +1 -1
- package/dist/assets/Delete-Cbmwi2_n.js +1 -0
- package/dist/assets/{DeleteOutline-DmQE35jW.js → DeleteOutline-DCYu02gd.js} +1 -1
- package/dist/assets/{DialogContentText-CD_9b35x.js → DialogContentText-M0t1zhqn.js} +1 -1
- package/dist/assets/{Done-CqmY_Vcx.js → Done-DqYPOWOz.js} +1 -1
- package/dist/assets/{Download-CQuftYbA.js → Download-BRihSpJ5.js} +1 -1
- package/dist/assets/{Edit-BDivRC_m.js → Edit-Dm5CBPHC.js} +1 -1
- package/dist/assets/{EditIcon-BGTWmwGP.js → EditIcon-BzxcFyWF.js} +1 -1
- package/dist/assets/{Error-K08nzD90.js → Error-D_2Fmq_E.js} +1 -1
- package/dist/assets/{ExpandMore-CbxNhKjL.js → ExpandMore-BlBxw7cf.js} +1 -1
- package/dist/assets/{FormControl-DU81G5bu.js → FormControl-P0hOBz_d.js} +1 -1
- package/dist/assets/{FormControlLabel-8jOHLgVZ.js → FormControlLabel-DXJxfDzh.js} +1 -1
- package/dist/assets/{FormGroup-QuqjTPhE.js → FormGroup-BMxqnWKW.js} +1 -1
- package/dist/assets/{Google-D-XsFWKn.js → Google-Dz_lBWZG.js} +1 -1
- package/dist/assets/{Grid-DwcLhQj8.js → Grid-Dk_DYqwe.js} +1 -1
- package/dist/assets/{Hidden-BWJFU4i6.js → Hidden-3B3zKMrj.js} +1 -1
- package/dist/assets/{InfoOutlined-C3RYxox6.js → InfoOutlined-BxfEr3Yv.js} +1 -1
- package/dist/assets/{InputAdornment-C0QKC-6w.js → InputAdornment-DBYVP0VZ.js} +1 -1
- package/dist/assets/{InputLabel-CsbfU4t_.js → InputLabel-CUj0gAgE.js} +1 -1
- package/dist/assets/{LastPage-BSjbJ19R.js → LastPage-DfP2R9Oa.js} +1 -1
- package/dist/assets/{Launch-CaoQNMs1.js → Launch-B871fo3J.js} +1 -1
- package/dist/assets/{LaunchOutlined-vrY0ldr3.js → LaunchOutlined-DMPabe2p.js} +1 -1
- package/dist/assets/{Link-Bd4I60CZ.js → Link-DiIwF6B2.js} +1 -1
- package/dist/assets/{LoadingButton-COZG9CB2.js → LoadingButton-B9Uh-LQA.js} +1 -1
- package/dist/assets/{LockIcon-wo568AAO.js → LockIcon-PoUIp4UY.js} +1 -1
- package/dist/assets/{Loop-CUHuPZIs.js → Loop-Cz6irMix.js} +1 -1
- package/dist/assets/{Menu-__JVjbvi.js → Menu-D9WDrqHE.js} +1 -1
- package/dist/assets/{MoreHoriz-BH5FNIZr.js → MoreHoriz-Bzyp9XwU.js} +1 -1
- package/dist/assets/{MoreVert-D-K4HVDp.js → MoreVert-6cQtfCA6.js} +1 -1
- package/dist/assets/{OpenInNew-BpWAPS1j.js → OpenInNew-Cyzkq5Z6.js} +1 -1
- package/dist/assets/{Pagination-BdSgult3.js → Pagination-CIhFbEoY.js} +1 -1
- package/dist/assets/{PlayArrow-CMt8YTny.js → PlayArrow-DfVelCxI.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-BekFUFeC.js → QuestionMarkCircle-Dmo7fO3q.js} +1 -1
- package/dist/assets/{RadioGroup-B2Khdnc_.js → RadioGroup-C8LRTono.js} +1 -1
- package/dist/assets/{Search-KdQ0ouxL.js → Search-sf4kfFV4.js} +1 -1
- package/dist/assets/{Select-DAnPr_8-.js → Select-DiRwP_6a.js} +1 -1
- package/dist/assets/{ServerLogo-BbRAfhR0.js → ServerLogo-DrHcOw4m.js} +1 -1
- package/dist/assets/{Skeleton-H3kZ6ORR.js → Skeleton-DiG5VWr2.js} +1 -1
- package/dist/assets/{Slider-CoVFgzif.js → Slider-DHlnySvX.js} +1 -1
- package/dist/assets/{Stack-kpnWV2Q2.js → Stack-BkDLp2S8.js} +1 -1
- package/dist/assets/{Stepper-Bpc-SXn1.js → Stepper-Cr4Ue7LM.js} +1 -1
- package/dist/assets/{TextField-iQ2izHdV.js → TextField-CCB_Jmv_.js} +1 -1
- package/dist/assets/{Toolbar-C8tBwEgb.js → Toolbar-BAiWv4-B.js} +1 -1
- package/dist/assets/{ViewColumn-CAU8rzyD.js → ViewColumn-DhNVCNtY.js} +1 -1
- package/dist/assets/{ViewList-BN0LV4EA.js → ViewList-D2QiFryN.js} +1 -1
- package/dist/assets/{access-control-JIrHa3mu.js → access-control-B1yRTcWF.js} +1 -1
- package/dist/assets/actions-Cm4y3Vxr.js +1 -0
- package/dist/assets/{add-component-core-11KaEkJm.js → add-component-core-BAFb6uHx.js} +55 -55
- package/dist/assets/add-resource-Bxy_EIU5.js +1 -0
- package/dist/assets/{addon-s6cY0RTa.js → addon-uerpU2Yk.js} +1 -1
- package/dist/assets/{analytics-d1lnz8LZ.js → analytics-CX0H_3Z4.js} +3 -3
- package/dist/assets/api-DxtqIksv.js +1 -0
- package/dist/assets/audit-logs-B77XgUxl.js +58 -0
- package/dist/assets/{base32-BQxmSgK5.js → base32-BbDUMCim.js} +1 -1
- package/dist/assets/{bundle-avatar-CxueSElp.js → bundle-avatar-J_a9wisR.js} +1 -1
- package/dist/assets/{button-j8-IOkkQ.js → button-CZGN0DFI.js} +1 -1
- package/dist/assets/{click-to-copy-DglMzVEl.js → click-to-copy-CPjwr766.js} +1 -1
- package/dist/assets/{complete-DQAgKCkw.js → complete-C9fCRXxg.js} +2 -2
- package/dist/assets/{component-CMHk7ZdA.js → component-Bjp-R3IE.js} +1 -1
- package/dist/assets/{config-Wu6XmTD_.js → config-BxeAHcCc.js} +1 -1
- package/dist/assets/{config-DekTNtmY.js → config-ChJImtJc.js} +1 -1
- package/dist/assets/{config-navigation-DkA8cq-f.js → config-navigation-Cxy6wwv0.js} +2 -2
- package/dist/assets/{confirm-C-ZpymsR.js → confirm-CZh9lrf7.js} +1 -1
- package/dist/assets/{connect-BbggA6aj.js → connect-CKHZQLeh.js} +1 -1
- package/dist/assets/{connect-D6WVNvFp.js → connect-Cc_HQwn4.js} +1 -1
- package/dist/assets/connect-to-BvUi2lDi.js +54 -0
- package/dist/assets/{content-layout-Bw7ct9HF.js → content-layout-dCNXPQB4.js} +1 -1
- package/dist/assets/{dashboard-hWtF2-L2.js → dashboard-BhEpCrng.js} +7 -7
- package/dist/assets/{deprecate-CeNqPdFm.js → deprecate-CstKkKFM.js} +1 -1
- package/dist/assets/{did-address-D8JyTgrD.js → did-address-DXunIer2.js} +1 -1
- package/dist/assets/domain-T2wMVe21.js +9 -0
- package/dist/assets/domain-list-BIxxgG74.js +15 -0
- package/dist/assets/{email-BTR1Y1ZI.js → email-BWRSAcoV.js} +3 -3
- package/dist/assets/emotion-cache.browser.esm-Mm6229p7.js +1 -0
- package/dist/assets/{exchange-passport-CCKPXR9k.js → exchange-passport-CuCHGbCf.js} +1 -1
- package/dist/assets/{fallback-Cmo8A_sx.js → fallback-B1bvHdlx.js} +1 -1
- package/dist/assets/{format-error-Dg_Wyxee.js → format-error-MSTr4Dld.js} +1 -1
- package/dist/assets/{fuel-CyQICCYM.js → fuel-Dgzaq3De.js} +1 -1
- package/dist/assets/{fullpage-BWf8VCc2.js → fullpage-BwWBbfSq.js} +1 -1
- package/dist/assets/{home-CudcogEq.js → home-74tIkF1B.js} +1 -1
- package/dist/assets/{iframe-DeQzhqQa.js → iframe-86-twlRv.js} +1 -1
- package/dist/assets/{index-CQMONHyO.js → index-29_4R1is.js} +1 -1
- package/dist/assets/{index-ClWQBhLB.js → index-B5PmYJ9f.js} +4 -4
- package/dist/assets/{index-zI_ZOFnN.js → index-BFeN7gRX.js} +1 -1
- package/dist/assets/{index-uIjak6TC.js → index-BJZKVgnz.js} +1 -1
- package/dist/assets/{index-BiimVseX.js → index-BKvulX5F.js} +1 -1
- package/dist/assets/{index-Bkw6k1IR.js → index-BYwmGv42.js} +1 -1
- package/dist/assets/{index-DyetLrsl.js → index-B_vncBdF.js} +1 -1
- package/dist/assets/{index-LFr2EjPD.js → index-BaOr19U9.js} +1 -1
- package/dist/assets/{index-B2EWcNti.js → index-Bi4O8Q7b.js} +1 -1
- package/dist/assets/{index-HduLTk-B.js → index-BnwRbf34.js} +1 -1
- package/dist/assets/{index-lDFcjwBH.js → index-C2SclAt1.js} +3 -3
- package/dist/assets/{index-B38g4Lrs.js → index-C8tvv1mE.js} +1 -1
- package/dist/assets/{index-D4hqMq4n.js → index-C9uoGnCi.js} +5 -5
- package/dist/assets/{index-BYWPqRt3.js → index-Cb5ummYm.js} +1 -1
- package/dist/assets/{index-BKiZMfI8.js → index-D1wE6UgA.js} +1 -1
- package/dist/assets/{index-D0d5K626.js → index-D2v_q--c.js} +1 -1
- package/dist/assets/{index-DL2n6aNi.js → index-D3z0u_tU.js} +1 -1
- package/dist/assets/{index-BFdHbwvA.js → index-D6Fo42LG.js} +8 -8
- package/dist/assets/{index-DL8j4eLo.js → index-DL-uDyV1.js} +2 -2
- package/dist/assets/{index-WK-4Jv48.js → index-DY43G97W.js} +1 -1
- package/dist/assets/{index-DsFggFMW.js → index-DYgo92mz.js} +1 -1
- package/dist/assets/{index-D5hrwpNn.js → index-DYtGXeNF.js} +1 -1
- package/dist/assets/index-DZAe2asg.js +68 -0
- package/dist/assets/{index-huBceCKu.js → index-D_l3bgiM.js} +1 -1
- package/dist/assets/{index-DXdaJNxD.js → index-Df44Oc0v.js} +1 -1
- package/dist/assets/{index-Dbd0UdkJ.js → index-DlP4vQPr.js} +1 -1
- package/dist/assets/{index-BEYLS2u3.js → index-Dvdwt5er.js} +1 -1
- package/dist/assets/{index-vR66LHmq.js → index-DyV0uX5c.js} +1 -1
- package/dist/assets/{index-ByEsfkzb.js → index-HE7O7jgn.js} +1 -1
- package/dist/assets/{index-BbQ5j9k0.js → index-TIPq1YB5.js} +1 -1
- package/dist/assets/{index-LX_b6VRi.js → index-bo5TF2Hm.js} +1 -1
- package/dist/assets/{index-B1SC_K3b.js → index-j8fq8gc5.js} +1 -1
- package/dist/assets/{index-BnA2ESWk.js → index-rvdKk-hW.js} +1 -1
- package/dist/assets/{index.es-DfiZlCd9.js → index.es-D6kSEknT.js} +1 -1
- package/dist/assets/index.esm-BACx3Bgt.js +1 -0
- package/dist/assets/{invitation-BqxPLgK4.js → invitation--LuhvYG3.js} +1 -1
- package/dist/assets/{invite-DzIfhYiY.js → invite-CnAaywBJ.js} +1 -1
- package/dist/assets/{issue-passport-9BLYNaCr.js → issue-passport-CHQbzhyM.js} +1 -1
- package/dist/assets/{item-na2wyX63.js → item-DiPWmg4D.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-5l3ETyUY.js → jss-plugin-props-sort.esm-BbUCTvTY.js} +4 -4
- package/dist/assets/{launch-result-message-Cy6kSqOC.js → launch-result-message-DUOKkM73.js} +1 -1
- package/dist/assets/{layout-C5DlPn9b.js → layout-DpBlA8e2.js} +1 -1
- package/dist/assets/{list-header-BKwrl-hH.js → list-header-DWE1hNBN.js} +1 -1
- package/dist/assets/localization-C5NLdJbv.js +1 -0
- package/dist/assets/{log-CYXHC1Be.js → log-53QGCL9A.js} +1 -1
- package/dist/assets/{login-DBaWywd8.js → login-BaZ1FJDR.js} +1 -1
- package/dist/assets/{login-oauth-callback-DgED49zc.js → login-oauth-callback-CTDRh2SM.js} +1 -1
- package/dist/assets/logo-uploader-D48tPsQ7.js +122 -0
- package/dist/assets/{lost-passport-CUOsAPVE.js → lost-passport-BguCyjaA.js} +3 -3
- package/dist/assets/{lottie-B_-5Nu2X.js → lottie-DXvsb19-.js} +1 -1
- package/dist/assets/notifications-0JFtARNG.js +62 -0
- package/dist/assets/{open-window-Di3nvKTK.js → open-window-CpqnuS9I.js} +1 -1
- package/dist/assets/overview-CiGfQ_r4.js +12 -0
- package/dist/assets/{page-header-MeO_z3el.js → page-header-BhMIblde.js} +1 -1
- package/dist/assets/{permission-CE9IIvmU.js → permission-Bn8ONtBu.js} +1 -1
- package/dist/assets/{preferences-Dwq31bO_.js → preferences-Be_zxnom.js} +1 -1
- package/dist/assets/publish-resource-B2D7mrbE.js +1 -0
- package/dist/assets/{react-87q4e1zg.js → react-B76g6xcQ.js} +3 -3
- package/dist/assets/{redux-B_wza_7l.js → redux-DNNFTtlX.js} +1 -1
- package/dist/assets/{resource-dialog-o1JpezFF.js → resource-dialog-D9phHFD1.js} +1 -1
- package/dist/assets/sdk-D3N7Lly-.js +1 -0
- package/dist/assets/{selector-D4kevKoJ.js → selector-CHNq0IRi.js} +1 -1
- package/dist/assets/session-DQy8BnkU.js +1 -0
- package/dist/assets/setup-BQC0e1_I.js +19 -0
- package/dist/assets/{shorten-label-945B5Up2.js → shorten-label-DsvGvUrQ.js} +1 -1
- package/dist/assets/{slicedToArray-CnpUWxvD.js → slicedToArray-DXMU5JZD.js} +2 -2
- package/dist/assets/{spaces-DWho7Umf.js → spaces-D4gX0_rK.js} +1 -1
- package/dist/assets/{start-Cn6C_fbf.js → start-Bt8Vsvhc.js} +1 -1
- package/dist/assets/{step-actions-Bx6nqm4u.js → step-actions-Dkbriu2L.js} +1 -1
- package/dist/assets/{studio-COHSHcfG.js → studio-Dqu6paHO.js} +1 -1
- package/dist/assets/{switch-control-C49xUZcp.js → switch-control-DbSaBWqA.js} +1 -1
- package/dist/assets/{toUpper-bXsm_qXw.js → toUpper-CliKP7G7.js} +1 -1
- package/dist/assets/{transfer-CtRN0KqM.js → transfer-Bm_twE74.js} +1 -1
- package/dist/assets/{trim-DqVVu3Il.js → trim-B-4xv-e3.js} +1 -1
- package/dist/assets/{uniqBy-7lIpMVYc.js → uniqBy-B9USxWYR.js} +1 -1
- package/dist/assets/{unsubscribe-BkF0tuUQ.js → unsubscribe-CmK-13jy.js} +1 -1
- package/dist/assets/{url-join-DE9yKz66.js → url-join-M0zkNbYb.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-CRYIjvnV.js → use-blocklet-info-for-connect-did-spaces-D6v0hDzW.js} +1 -1
- package/dist/assets/{use-mobile-DKrWYav8.js → use-mobile-B0GQXwHM.js} +1 -1
- package/dist/assets/{useAsync-D04qYCKi.js → useAsync-BWFWaRkz.js} +1 -1
- package/dist/assets/{useFormControl-i0joqxpq.js → useFormControl-B0cusiJt.js} +1 -1
- package/dist/assets/useLocalStorage-CuRBIcWm.js +1 -0
- package/dist/assets/{useSetState-AqQC8uHm.js → useSetState-BMiClb9g.js} +1 -1
- package/dist/assets/{useSlot-1RyLiIq-.js → useSlot-CRlI8p2I.js} +1 -1
- package/dist/assets/{useSlotProps-ChBJ3S4r.js → useSlotProps-JEaJsoR3.js} +1 -1
- package/dist/assets/{useThemeProps-CQg5bnNT.js → useThemeProps-pSaUXwQT.js} +1 -1
- package/dist/assets/user-center-Pqaf1DAY.js +1 -0
- package/dist/assets/{user-sessions-DNBXGW2i.js → user-sessions-Cc78WqU9.js} +1 -1
- package/dist/assets/{util-dbb-2LGO.js → util-BKr59-9_.js} +1 -1
- package/dist/assets/{wrap-locale-Cng_yCBU.js → wrap-locale-CK-9zfpl.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +18 -18
- package/dist/assets/Delete-B15-niP2.js +0 -1
- package/dist/assets/ListItemText-Ch-Hk6jW.js +0 -1
- package/dist/assets/actions-C4C-_7q7.js +0 -1
- package/dist/assets/add-resource-BB2L3tHk.js +0 -1
- package/dist/assets/api-CGBrxiXH.js +0 -1
- package/dist/assets/audit-logs-BOd17etC.js +0 -58
- package/dist/assets/connect-to-CQAPJyx5.js +0 -54
- package/dist/assets/domain-XgUsUoU_.js +0 -9
- package/dist/assets/domain-list-CegYP2MT.js +0 -15
- package/dist/assets/emotion-cache.browser.esm-ChperYzD.js +0 -1
- package/dist/assets/index-IYWm69Iu.js +0 -68
- package/dist/assets/index.esm-DEFFuCAx.js +0 -1
- package/dist/assets/localization-Bt5wkdvO.js +0 -1
- package/dist/assets/logo-uploader-DICViK_m.js +0 -122
- package/dist/assets/notifications-CNKkgV5g.js +0 -62
- package/dist/assets/overview-C9i2bvR9.js +0 -12
- package/dist/assets/publish-resource-DUMhyaXr.js +0 -1
- package/dist/assets/sdk-DGa3oCWi.js +0 -1
- package/dist/assets/session-PAtiUW6l.js +0 -1
- package/dist/assets/setup-BVFgT3ZW.js +0 -19
- package/dist/assets/useLocalStorage-DKFLmhtB.js +0 -1
- package/dist/assets/user-center-DAb90CGM.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-
|
|
2
|
-
import{at as d2,j as o,aG as se,cP as g0,aK as A,fE as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cV as p2,fF as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dD as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cK as m2,cT as He,cU as w0,aj as v2,d9 as g2,cO as Je,bF as re,c3 as Qe,fr as b2,a8 as J1,fG as j2,b as ne,bm as R0,ej as C0,ai as b1,bn as y0,cy as z0,aT as Ae,aS as w2,a3 as S0,fH as Q1,fe as Le,bk as R2,au as k0,d0 as C2,l as y2,aB as z2,aq as S2,ar as i1}from"./index-lDFcjwBH.js";import{d as j1}from"./Add-DqnQRxKy.js";import{d as I0}from"./Delete-B15-niP2.js";import{d as k2}from"./Error-K08nzD90.js";import{D as w1}from"./index-D4hqMq4n.js";import{T as M0,b as I2}from"./index-WK-4Jv48.js";import{C as R1}from"./confirm-C-ZpymsR.js";import{u as s1}from"./session-PAtiUW6l.js";import{W as Y1}from"./did-address-D8JyTgrD.js";import{B as C1}from"./bundle-avatar-CxueSElp.js";import{S as be}from"./shorten-label-945B5Up2.js";import{A as P0}from"./Avatar-s-RbgNaK.js";import{d as M2}from"./Download-CQuftYbA.js";import{d as P2}from"./QuestionMarkCircle-BekFUFeC.js";import{b as L2,c as Z1,T as T2}from"./index-Bkw6k1IR.js";import{_ as Pe}from"./useSetState-AqQC8uHm.js";import{c as y1}from"./index-Dbd0UdkJ.js";import{C as u1,F as p1}from"./FormControlLabel-8jOHLgVZ.js";import{A as L0}from"./Alert-D-5Cob8e.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-CGBrxiXH.js";import{i as N2}from"./index-BKiZMfI8.js";import{d as V2}from"./ExpandMore-CbxNhKjL.js";import{d as D2}from"./ChevronRight-Bg7d5X-4.js";import{d as _2}from"./OpenInNew-BpWAPS1j.js";import{u as T0}from"./useThemeProps-CQg5bnNT.js";import{u as E2}from"./useSlotProps-ChBJ3S4r.js";import{d as B2}from"./DeleteOutline-DmQE35jW.js";import{c as A2,A as N0,u as O2,S as H2,U as $2}from"./item-na2wyX63.js";import{d as F2}from"./ArrowDropDown-D0Z0e8Y7.js";import{f as Ne}from"./format-error-Dg_Wyxee.js";import{B as h1}from"./ButtonGroup-CbB4bj5R.js";import{T as Te}from"./TextField-iQ2izHdV.js";import{I as z1}from"./InputAdornment-C0QKC-6w.js";import{C as U2}from"./click-to-copy-DglMzVEl.js";import{d as q2}from"./Launch-CaoQNMs1.js";import{L as W2}from"./MoreVert-D-K4HVDp.js";import{a as G2}from"./ListItemText-Ch-Hk6jW.js";import{S as e0}from"./index-CQMONHyO.js";import{M as K2}from"./index-vR66LHmq.js";import{r as X2}from"./index-D0d5K626.js";import{d as J2}from"./Done-CqmY_Vcx.js";import{c as V0,d as D0,b as Q2,S as Y2,a as Z2}from"./Stepper-Bpc-SXn1.js";import{S as et}from"./Stack-kpnWV2Q2.js";import{R as tt,a as t0}from"./RadioGroup-B2Khdnc_.js";import"./Grid-DwcLhQj8.js";import"./emotion-cache.browser.esm-ChperYzD.js";import"./index-zI_ZOFnN.js";import"./redux-B_wza_7l.js";import"./ViewColumn-CAU8rzyD.js";import"./FormControl-DU81G5bu.js";import"./useFormControl-i0joqxpq.js";import"./FormGroup-QuqjTPhE.js";import"./Select-DAnPr_8-.js";import"./InputLabel-CsbfU4t_.js";import"./LastPage-BSjbJ19R.js";import"./Toolbar-C8tBwEgb.js";import"./Search-KdQ0ouxL.js";import"./index-LFr2EjPD.js";import"./DialogContentText-CD_9b35x.js";import"./Link-Bd4I60CZ.js";import"./useSlot-1RyLiIq-.js";import"./jss-plugin-props-sort.esm-5l3ETyUY.js";const ot=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),lt=["slots","slotProps"],nt=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),st=se(ot)({width:24,height:16});function rt(e){const{slots:t={},slotProps:l={}}=e,s=je(e,lt),r=e;return o.jsx("li",{children:o.jsx(nt,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(st,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function it(e){return Fe("MuiBreadcrumbs",e)}const at=$e("MuiBreadcrumbs",["root","ol","li","separator"]),ct=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],dt=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},it,t)},ut=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${at.li}`]:t.li},t.root]})({}),pt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ht=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ft(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(ht,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,ct),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=dt(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(rt,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(ut,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(pt,{className:C.ol,ref:N,ownerState:v,children:ft(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function xt(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),mt=["children","className","icon","optional"],vt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},xt,t)},gt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),bt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,mt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=vt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(Q2,A({},d,{children:r}));return o.jsx(gt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function jt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const wt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Rt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},jt,t)},Ct=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),yt=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),zt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,wt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=Rt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Ct,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(yt,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},St=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,kt=St(Se()),It=o;E0=S1.default=(0,kt.default)((0,It.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 k1={},Mt=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Pt=Mt(Se()),Lt=o;B0=k1.default=(0,Pt.default)((0,Lt.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 I1={},Tt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Nt=Tt(Se()),Vt=o;A0=I1.default=(0,Nt.default)((0,Vt.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 Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Dt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(k2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const Dt=ae(z)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-B76g6xcQ.js","assets/index-C2SclAt1.js","assets/index-D8NuaJ66.css","assets/index-D3z0u_tU.js","assets/preact.module-DJUF--8d.js","assets/index-Bi4O8Q7b.js","assets/index-DlP4vQPr.js","assets/toUpper-CliKP7G7.js","assets/index-Cb5ummYm.js","assets/fallback-B1bvHdlx.js","assets/index-TIPq1YB5.js","assets/Menu-D9WDrqHE.js","assets/Toolbar-BAiWv4-B.js","assets/Hidden-3B3zKMrj.js","assets/index-BJZKVgnz.js","assets/MoreVert-6cQtfCA6.js","assets/selector-CHNq0IRi.js","assets/ExpandMore-BlBxw7cf.js","assets/Avatar-7y20d6uv.js","assets/useSlot-CRlI8p2I.js","assets/resource-dialog-D9phHFD1.js","assets/index-j8fq8gc5.js","assets/emotion-cache.browser.esm-Mm6229p7.js","assets/OpenInNew-Cyzkq5Z6.js","assets/CloseOutlined-BxdDTJtY.js","assets/use-mobile-B0GQXwHM.js","assets/Link-DiIwF6B2.js","assets/index-BYwmGv42.js","assets/index-BaOr19U9.js","assets/index-29_4R1is.js","assets/FormControlLabel-DXJxfDzh.js","assets/useFormControl-B0cusiJt.js","assets/Stack-BkDLp2S8.js","assets/index-C9uoGnCi.js","assets/useThemeProps-pSaUXwQT.js","assets/Grid-Dk_DYqwe.js","assets/index-BFeN7gRX.js","assets/redux-DNNFTtlX.js","assets/ViewColumn-DhNVCNtY.js","assets/FormControl-P0hOBz_d.js","assets/FormGroup-BMxqnWKW.js","assets/Select-DiRwP_6a.js","assets/InputLabel-CUj0gAgE.js","assets/Delete-Cbmwi2_n.js","assets/TextField-CCB_Jmv_.js","assets/LastPage-DfP2R9Oa.js","assets/Search-sf4kfFV4.js","assets/index-bo5TF2Hm.js","assets/deprecate-CstKkKFM.js","assets/url-join-M0zkNbYb.js","assets/uniqBy-B9USxWYR.js","assets/react-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{at as d2,j as o,aG as se,cP as g0,aK as A,fF as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cV as p2,fG as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dD as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cK as m2,cT as He,cU as w0,aj as v2,d9 as g2,cO as Je,bF as re,c3 as Qe,fr as b2,a8 as J1,fH as j2,b as ne,bm as R0,ej as C0,ai as b1,bn as y0,cy as z0,aT as Ae,aS as w2,a3 as S0,fI as Q1,fe as Le,bk as R2,au as k0,d0 as C2,l as y2,aB as z2,aq as S2,ar as i1}from"./index-C2SclAt1.js";import{d as j1}from"./Add-DAQA4hl7.js";import{d as I0,a as k2}from"./Delete-Cbmwi2_n.js";import{d as I2}from"./Error-D_2Fmq_E.js";import{D as w1}from"./index-C9uoGnCi.js";import{T as M0,b as M2}from"./index-DY43G97W.js";import{C as R1}from"./confirm-CZh9lrf7.js";import{u as s1}from"./session-DQy8BnkU.js";import{W as Y1}from"./did-address-DXunIer2.js";import{B as C1}from"./bundle-avatar-J_a9wisR.js";import{S as be}from"./shorten-label-DsvGvUrQ.js";import{A as P0}from"./Avatar-7y20d6uv.js";import{d as P2}from"./Download-BRihSpJ5.js";import{d as L2}from"./QuestionMarkCircle-Dmo7fO3q.js";import{b as T2,c as Z1,T as N2}from"./index-BYwmGv42.js";import{_ as Pe}from"./useSetState-BMiClb9g.js";import{c as y1}from"./index-DlP4vQPr.js";import{C as u1,F as p1}from"./FormControlLabel-DXJxfDzh.js";import{A as L0}from"./Alert-B8kenWpY.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-DxtqIksv.js";import{i as V2}from"./index-D1wE6UgA.js";import{d as D2}from"./ExpandMore-BlBxw7cf.js";import{d as _2}from"./ChevronRight-D-HWZ2Zs.js";import{d as E2}from"./OpenInNew-Cyzkq5Z6.js";import{u as T0}from"./useThemeProps-pSaUXwQT.js";import{u as B2}from"./useSlotProps-JEaJsoR3.js";import{d as A2}from"./DeleteOutline-DCYu02gd.js";import{c as O2,A as N0,u as H2,S as $2,U as F2}from"./item-DiPWmg4D.js";import{d as U2}from"./ArrowDropDown-B4CQuaFu.js";import{f as Ne}from"./format-error-MSTr4Dld.js";import{B as h1}from"./ButtonGroup-DRVN-vsI.js";import{T as Te}from"./TextField-CCB_Jmv_.js";import{I as z1}from"./InputAdornment-DBYVP0VZ.js";import{C as q2}from"./click-to-copy-CPjwr766.js";import{d as W2}from"./Launch-B871fo3J.js";import{L as G2}from"./MoreVert-6cQtfCA6.js";import{S as e0}from"./index-29_4R1is.js";import{M as K2}from"./index-DyV0uX5c.js";import{r as X2}from"./index-D2v_q--c.js";import{d as J2}from"./Done-DqYPOWOz.js";import{c as V0,d as D0,b as Q2,S as Y2,a as Z2}from"./Stepper-Cr4Ue7LM.js";import{S as et}from"./Stack-BkDLp2S8.js";import{R as tt,a as t0}from"./RadioGroup-C8LRTono.js";import"./Grid-Dk_DYqwe.js";import"./emotion-cache.browser.esm-Mm6229p7.js";import"./index-BFeN7gRX.js";import"./redux-DNNFTtlX.js";import"./ViewColumn-DhNVCNtY.js";import"./FormControl-P0hOBz_d.js";import"./useFormControl-B0cusiJt.js";import"./FormGroup-BMxqnWKW.js";import"./Select-DiRwP_6a.js";import"./InputLabel-CUj0gAgE.js";import"./LastPage-DfP2R9Oa.js";import"./Toolbar-BAiWv4-B.js";import"./Search-sf4kfFV4.js";import"./index-BaOr19U9.js";import"./DialogContentText-M0t1zhqn.js";import"./Link-DiIwF6B2.js";import"./useSlot-CRlI8p2I.js";import"./jss-plugin-props-sort.esm-BbUCTvTY.js";const ot=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),lt=["slots","slotProps"],nt=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),st=se(ot)({width:24,height:16});function rt(e){const{slots:t={},slotProps:l={}}=e,s=je(e,lt),r=e;return o.jsx("li",{children:o.jsx(nt,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(st,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function it(e){return Fe("MuiBreadcrumbs",e)}const at=$e("MuiBreadcrumbs",["root","ol","li","separator"]),ct=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],dt=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},it,t)},ut=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${at.li}`]:t.li},t.root]})({}),pt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ht=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ft(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(ht,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,ct),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=dt(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(rt,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(ut,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(pt,{className:C.ol,ref:N,ownerState:v,children:ft(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function xt(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),mt=["children","className","icon","optional"],vt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},xt,t)},gt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),bt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,mt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=vt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(Q2,A({},d,{children:r}));return o.jsx(gt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function jt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const wt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Rt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},jt,t)},Ct=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),yt=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),zt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,wt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=Rt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Ct,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(yt,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},St=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,kt=St(Se()),It=o;E0=S1.default=(0,kt.default)((0,It.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 k1={},Mt=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Pt=Mt(Se()),Lt=o;B0=k1.default=(0,Pt.default)((0,Lt.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 I1={},Tt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Nt=Tt(Se()),Vt=o;A0=I1.default=(0,Nt.default)((0,Vt.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 Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Dt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const Dt=ae(z)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
6
|
-
`;var L1={},_t=ke;Object.defineProperty(L1,"__esModule",{value:!0});var O0=L1.default=void 0,Et=_t(Se()),l0=o;O0=L1.default=(0,Et.default)([(0,l0.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,l0.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");function Bt(){var T;const{t:e,locale:t}=te(),{projectId:l}=n1(),{api:s}=we(),[r,c]=R.useState(!0),{blocklet:i}=Ve(),a=We(P=>P.breakpoints.down("md")),[u,f]=R.useState(null),[x,g]=R.useState(null),[y,p]=R.useState(null),d=(T=window.env)==null?void 0:T.serverEndpoint,m=()=>{s.getReleases({input:{did:i.meta.did,projectId:l}}).then(P=>{const I=(P==null?void 0:P.releases)||[];c(!1),f(I)}).catch(P=>{c(!1),$.error(P.message)})},b=()=>{s.doBatchQuery({getProject:{input:{did:i.meta.did,projectId:l}},getReleases:{input:{did:i.meta.did,projectId:l}}}).then(P=>{g(P.getProject.project||{}),f(P.getReleases.releases||[]),c(!1)}).catch(P=>{c(!1),$.error(P.message)})};R.useEffect(()=>{b()},[]);const v=()=>{c(!1);const P=y.id;s.deleteRelease({input:{did:i.meta.did,projectId:l,releaseId:P}}).then(()=>{c(!1),m(),$.success(e("common.removeSuccess")),p(null)}).catch(I=>{c(!1),$.error(I.message)})},C=P=>{p(P)};if(!u&&r)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!u)return null;const S=o.jsxs(_0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(ue,{to:"..",children:e("common.blockletStudio")}),o.jsx(G,{color:"text.primary",children:o.jsx(be,{maxLength:a?6:30,children:x.blockletTitle})})]});if(!u.length)return o.jsxs(o.Fragment,{children:[S,o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),o.jsx(ue,{to:"create/none",children:o.jsx(e1,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const N=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:P=>{const I=u[P];return o.jsx(ue,{to:`view/${I.id}`,children:o.jsx(M1,{did:i.meta.did,projectId:x.id,logo:I.blockletLogo,title:I.blockletVersion,describe:I.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:P=>{const I=u[P];return o.jsx(G,{className:"note",children:I.note||""})}}},{label:e("common.status"),name:"status",options:{customBodyRender:P=>o.jsx(M0,{type:P==="published"?"success":"warning",children:P==="published"?"Released":f2(P)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:P=>{const I=u[P];return I.status!==ye.PROJECT.RELEASE_STATUS.published?"":o.jsx(b0,{value:Number(I.updatedAt),locale:t})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:P=>{var L;const I=u[P];let U="",V="";const M=I.status==="published";if(M){const E=pe(d,`/api/project/${i.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),B=new URL(d);B.pathname=pe(B.pathname,"/launch-blocklet/agreement"),B.searchParams.set("blocklet_meta_url",E),U=B.href,V=pe(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${i.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const k=(L=x.blockletComponents)!=null&&L.some(E=>E.included)||I.uploadedResource?"pack":"resource";return o.jsxs(z,{display:"flex",alignItems:"center",children:[M&&k==="pack"&&o.jsx(ve,{title:e("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx("a",{style:{display:"flex"},href:U,target:"_blank",rel:"noreferrer",children:o.jsx(O0,{sx:{fontSize:18}})})})}),M&&o.jsx(ve,{title:e("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"download",children:o.jsx("a",{style:{display:"flex"},href:V,children:o.jsx(
|
|
6
|
+
`;var L1={},_t=ke;Object.defineProperty(L1,"__esModule",{value:!0});var O0=L1.default=void 0,Et=_t(Se()),l0=o;O0=L1.default=(0,Et.default)([(0,l0.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,l0.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");function Bt(){var T;const{t:e,locale:t}=te(),{projectId:l}=n1(),{api:s}=we(),[r,c]=R.useState(!0),{blocklet:i}=Ve(),a=We(P=>P.breakpoints.down("md")),[u,f]=R.useState(null),[x,g]=R.useState(null),[y,p]=R.useState(null),d=(T=window.env)==null?void 0:T.serverEndpoint,m=()=>{s.getReleases({input:{did:i.meta.did,projectId:l}}).then(P=>{const I=(P==null?void 0:P.releases)||[];c(!1),f(I)}).catch(P=>{c(!1),$.error(P.message)})},b=()=>{s.doBatchQuery({getProject:{input:{did:i.meta.did,projectId:l}},getReleases:{input:{did:i.meta.did,projectId:l}}}).then(P=>{g(P.getProject.project||{}),f(P.getReleases.releases||[]),c(!1)}).catch(P=>{c(!1),$.error(P.message)})};R.useEffect(()=>{b()},[]);const v=()=>{c(!1);const P=y.id;s.deleteRelease({input:{did:i.meta.did,projectId:l,releaseId:P}}).then(()=>{c(!1),m(),$.success(e("common.removeSuccess")),p(null)}).catch(I=>{c(!1),$.error(I.message)})},C=P=>{p(P)};if(!u&&r)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!u)return null;const S=o.jsxs(_0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(ue,{to:"..",children:e("common.blockletStudio")}),o.jsx(G,{color:"text.primary",children:o.jsx(be,{maxLength:a?6:30,children:x.blockletTitle})})]});if(!u.length)return o.jsxs(o.Fragment,{children:[S,o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),o.jsx(ue,{to:"create/none",children:o.jsx(e1,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const N=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:P=>{const I=u[P];return o.jsx(ue,{to:`view/${I.id}`,children:o.jsx(M1,{did:i.meta.did,projectId:x.id,logo:I.blockletLogo,title:I.blockletVersion,describe:I.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:P=>{const I=u[P];return o.jsx(G,{className:"note",children:I.note||""})}}},{label:e("common.status"),name:"status",options:{customBodyRender:P=>o.jsx(M0,{type:P==="published"?"success":"warning",children:P==="published"?"Released":f2(P)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:P=>{const I=u[P];return I.status!==ye.PROJECT.RELEASE_STATUS.published?"":o.jsx(b0,{value:Number(I.updatedAt),locale:t})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:P=>{var L;const I=u[P];let U="",V="";const M=I.status==="published";if(M){const E=pe(d,`/api/project/${i.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),B=new URL(d);B.pathname=pe(B.pathname,"/launch-blocklet/agreement"),B.searchParams.set("blocklet_meta_url",E),U=B.href,V=pe(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${i.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const k=(L=x.blockletComponents)!=null&&L.some(E=>E.included)||I.uploadedResource?"pack":"resource";return o.jsxs(z,{display:"flex",alignItems:"center",children:[M&&k==="pack"&&o.jsx(ve,{title:e("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx("a",{style:{display:"flex"},href:U,target:"_blank",rel:"noreferrer",children:o.jsx(O0,{sx:{fontSize:18}})})})}),M&&o.jsx(ve,{title:e("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"download",children:o.jsx("a",{style:{display:"flex"},href:V,children:o.jsx(P2,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:e("blocklet.publish.delete",{name:x.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>C(I),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}];return o.jsxs(At,{children:[o.jsxs(z,{className:"header",children:[S,o.jsx(ue,{to:"new-release/none",children:o.jsxs(e1,{variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),e("blocklet.publish.createRelease")]})})]}),o.jsx(w1,{className:"main-table",verticalKeyWidth:100,locale:t,data:u,columns:N,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),y&&o.jsx(R1,{title:e(`${e("common.delete")} ${y.blockletVersion}`),description:e("blocklet.publish.deleteReleaseTip"),confirm:e("common.confirm"),onConfirm:v,onCancel:()=>p(null)})]})}const At=ae(z)`
|
|
7
7
|
.header {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
@@ -43,7 +43,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fE as X1,aJ as je,aE as $e,aF a
|
|
|
43
43
|
display: none;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`;function tl(e,t){const l=new Set(t||[]),s=[];function r(c){l.has(c==null?void 0:c.id)&&s.push(c==null?void 0:c.id),c!=null&&c.children&&c.children.forEach(r)}return(e||[]).forEach(r),s}function ol(e){return Fe("MuiTreeView",e)}$e("MuiTreeView",["root"]);const $0={instance:null,multiSelect:!1,disabledItemsFocusable:!1,treeId:void 0,icons:{defaultCollapseIcon:null,defaultExpandIcon:null,defaultParentIcon:null,defaultEndIcon:null}},F0=R.createContext($0),ll=(e,t)=>{const l=R.useRef({}),[s,r]=R.useState(()=>{const i={};return e.forEach(a=>{a.models&&Object.entries(a.models).forEach(([u,f])=>{l.current[u]={controlledProp:f.controlledProp,defaultProp:f.defaultProp,isControlled:t[f.controlledProp]!==void 0},i[u]=t[f.defaultProp]})}),i});return Object.fromEntries(Object.entries(l.current).map(([i,a])=>{const u=a.isControlled?t[a.controlledProp]:s[i];return[i,{value:u,setValue:f=>{a.isControlled||r(x=>A({},x,{[i]:f}))}}]}))};class nl{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,l,s={}){let r=this.events[t];r||(r={highPriority:new Map,regular:new Map},this.events[t]=r),s.isFirst?r.highPriority.set(l,!0):r.regular.set(l,!0)}removeListener(t,l){this.events[t]&&(this.events[t].regular.delete(l),this.events[t].highPriority.delete(l))}removeAllListeners(){this.events={}}emit(t,...l){const s=this.events[t];if(!s)return;const r=Array.from(s.highPriority.keys()),c=Array.from(s.regular.keys());for(let i=r.length-1;i>=0;i-=1){const a=r[i];s.highPriority.has(a)&&a.apply(this,l)}for(let i=0;i<c.length;i+=1){const a=c[i];s.regular.has(a)&&a.apply(this,l)}}once(t,l){const s=this;this.on(t,function r(...c){s.removeListener(t,r),l.apply(s,c)})}}const a1=(e,t)=>{const l=e.getNode(t),s=e.getNavigableChildrenIds(l.parentId),r=s.indexOf(t);if(r===0)return l.parentId;let c=s[r-1];for(;e.isNodeExpanded(c)&&e.getNavigableChildrenIds(c).length>0;)c=e.getNavigableChildrenIds(c).pop();return c},Be=(e,t)=>{if(e.isNodeExpanded(t)&&e.getNavigableChildrenIds(t).length>0)return e.getNavigableChildrenIds(t)[0];let l=e.getNode(t);for(;l!=null;){const s=e.getNavigableChildrenIds(l.parentId),r=s[s.indexOf(l.id)+1];if(r)return r;l=e.getNode(l.parentId)}return null},f1=e=>{let t=e.getNavigableChildrenIds(null).pop();for(;e.isNodeExpanded(t);)t=e.getNavigableChildrenIds(t).pop();return t},x1=e=>e.getNavigableChildrenIds(null)[0],De=(e,t)=>{Object.assign(e,t)},sl=e=>e.isPropagationStopped!==void 0,rl=({instance:e})=>{const[t]=R.useState(()=>new nl),l=R.useCallback((...r)=>{const[c,i,a={}]=r;a.defaultMuiPrevented=!1,!(sl(a)&&a.isPropagationStopped())&&t.emit(c,i,a)},[t]),s=R.useCallback((r,c)=>(t.on(r,c),()=>{t.removeListener(r,c)}),[t]);De(e,{$$publishEvent:l,$$subscribeEvent:s})},il=[rl],al=e=>{const t=[...il,...e.plugins],l=t.reduce((d,m)=>m.getDefaultizedParams?m.getDefaultizedParams(d):d,e),s=ll(t,l),c=R.useRef({}).current,i=R.useRef(null),a=j0(i,e.rootRef),[u,f]=R.useState(()=>{const d={};return t.forEach(m=>{m.getInitialState&&Object.assign(d,m.getInitialState(l))}),d}),x=[];let g=$0;const y=d=>{const m=d({instance:c,params:l,state:u,setState:f,rootRef:i,models:s})||{};m.getRootProps&&x.push(m.getRootProps),m.contextValue&&(g=m.contextValue)};return t.forEach(y),{getRootProps:(d={})=>{const m=A({role:"tree",tabIndex:0},d,{ref:a});return x.forEach(b=>{Object.assign(m,b(d))}),m},rootRef:a,contextValue:g}},cl=["element"];function dl(e,t){for(let l=0;l<e.length;l+=1)if(t(e[l]))return l;return-1}function ul(e,t){let l=0,s=e.length-1;for(;l<=s;){const r=Math.floor((l+s)/2);if(e[r].element===t)return r;e[r].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?s=r-1:l=r+1}return l}const U0=R.createContext({});function pl(e){const t=R.useRef(null);return R.useEffect(()=>{t.current=e},[e]),t.current}const s0=()=>{};function hl(e){const[,t]=R.useState(),{registerDescendant:l=s0,unregisterDescendant:s=s0,descendants:r=[],parentId:c=null}=R.useContext(U0),i=dl(r,f=>f.element===e.element),a=pl(r),u=r.some((f,x)=>a&&a[x]&&a[x].element!==f.element);return m2(()=>{if(e.element)return l(A({},e,{index:i})),()=>{s(e.element)};t({})},[l,s,i,u,e]),{parentId:c,index:i}}function q0(e){const{children:t,id:l}=e,[s,r]=R.useState([]),c=R.useCallback(u=>{let{element:f}=u,x=je(u,cl);r(g=>{if(g.length===0)return[A({},x,{element:f,index:0})];const y=ul(g,f);let p;if(g[y]&&g[y].element===f)p=g;else{const d=A({},x,{element:f,index:y});p=g.slice(),p.splice(y,0,d)}return p.forEach((d,m)=>{d.index=m}),p})},[]),i=R.useCallback(u=>{r(f=>f.filter(x=>u!==x.element))},[]),a=R.useMemo(()=>({descendants:s,registerDescendant:c,unregisterDescendant:i,parentId:l}),[s,c,i,l]);return o.jsx(U0.Provider,{value:a,children:t})}function fl(e){const{value:t,children:l}=e;return o.jsx(F0.Provider,{value:t,children:o.jsx(q0,{children:l})})}const xl=(e,t,l)=>{e.$$publishEvent(t,l)},ml=({instance:e,params:t})=>{const l=R.useRef({}),s=R.useCallback(f=>l.current[f],[]),r=R.useCallback(f=>{l.current[f.id]=f},[]),c=R.useCallback(f=>{const x=A({},l.current);delete x[f],l.current=x,xl(e,"removeNode",{id:f})},[e]),i=R.useCallback(f=>{if(f==null)return!1;let x=e.getNode(f);if(!x)return!1;if(x.disabled)return!0;for(;x.parentId!=null;)if(x=e.getNode(x.parentId),x.disabled)return!0;return!1},[e]),a=He(f=>Object.values(l.current).filter(x=>x.parentId===f).sort((x,g)=>x.index-g.index).map(x=>x.id));De(e,{getNode:s,updateNode:r,removeNode:c,getChildrenIds:a,getNavigableChildrenIds:f=>{let x=e.getChildrenIds(f);return t.disabledItemsFocusable||(x=x.filter(g=>!e.isNodeDisabled(g))),x},isNodeDisabled:i})},V1=({instance:e,params:t,models:l})=>{const s=R.useCallback(a=>Array.isArray(l.expanded.value)?l.expanded.value.indexOf(a)!==-1:!1,[l.expanded.value]),r=R.useCallback(a=>{var u;return!!((u=e.getNode(a))!=null&&u.expandable)},[e]),c=He((a,u)=>{if(u==null)return;let f;l.expanded.value.indexOf(u)!==-1?f=l.expanded.value.filter(x=>x!==u):f=[u].concat(l.expanded.value),t.onNodeToggle&&t.onNodeToggle(a,f),l.expanded.setValue(f)});De(e,{isNodeExpanded:s,isNodeExpandable:r,toggleNodeExpansion:c,expandAllSiblings:(a,u)=>{const f=e.getNode(u),g=e.getChildrenIds(f.parentId).filter(p=>e.isNodeExpandable(p)&&!e.isNodeExpanded(p)),y=l.expanded.value.concat(g);g.length>0&&(l.expanded.setValue(y),t.onNodeToggle&&t.onNodeToggle(a,y))}})};V1.models={expanded:{controlledProp:"expanded",defaultProp:"defaultExpanded"}};const vl=[];V1.getDefaultizedParams=e=>{var t;return A({},e,{defaultExpanded:(t=e.defaultExpanded)!=null?t:vl})};const gl=(e,t,l)=>{if(t===l)return[t,l];const s=e.getNode(t),r=e.getNode(l);if(s.parentId===r.id||r.parentId===s.id)return r.parentId===s.id?[s.id,r.id]:[r.id,s.id];const c=[s.id],i=[r.id];let a=s.parentId,u=r.parentId,f=i.indexOf(a)!==-1,x=c.indexOf(u)!==-1,g=!0,y=!0;for(;!x&&!f;)g&&(c.push(a),f=i.indexOf(a)!==-1,g=a!==null,!f&&g&&(a=e.getNode(a).parentId)),y&&!f&&(i.push(u),x=c.indexOf(u)!==-1,y=u!==null,!x&&y&&(u=e.getNode(u).parentId));const p=f?a:u,d=e.getChildrenIds(p),m=c[c.indexOf(p)-1],b=i[i.indexOf(p)-1];return d.indexOf(m)<d.indexOf(b)?[t,l]:[l,t]},D1=({instance:e,params:t,models:l})=>{const s=R.useRef(null),r=R.useRef(!1),c=R.useRef([]),i=d=>Array.isArray(l.selected.value)?l.selected.value.indexOf(d)!==-1:l.selected.value===d,a=(d,m,b=!1)=>{if(!t.disableSelection){if(b){if(Array.isArray(l.selected.value)){let v;l.selected.value.indexOf(m)!==-1?v=l.selected.value.filter(C=>C!==m):v=[m].concat(l.selected.value),t.onNodeSelect&&t.onNodeSelect(d,v),l.selected.setValue(v)}}else{const v=t.multiSelect?[m]:m;t.onNodeSelect&&t.onNodeSelect(d,v),l.selected.setValue(v)}s.current=m,r.current=!1,c.current=[]}},u=(d,m)=>{const[b,v]=gl(e,d,m),C=[b];let S=b;for(;S!==v;)S=Be(e,S),C.push(S);return C},f=(d,m)=>{let b=l.selected.value.slice();const{start:v,next:C,current:S}=m;!C||!S||(c.current.indexOf(S)===-1&&(c.current=[]),r.current?c.current.indexOf(C)!==-1?(b=b.filter(N=>N===v||N!==S),c.current=c.current.filter(N=>N===v||N!==S)):(b.push(C),c.current.push(C)):(b.push(C),c.current.push(S,C)),t.onNodeSelect&&t.onNodeSelect(d,b),l.selected.setValue(b))},x=(d,m)=>{let b=l.selected.value.slice();const{start:v,end:C}=m;r.current&&(b=b.filter(T=>c.current.indexOf(T)===-1));let S=u(v,C);S=S.filter(T=>!e.isNodeDisabled(T)),c.current=S;let N=b.concat(S);N=N.filter((T,P)=>N.indexOf(T)===P),t.onNodeSelect&&t.onNodeSelect(d,N),l.selected.setValue(N)};return De(e,{isNodeSelected:i,selectNode:a,selectRange:(d,m,b=!1)=>{if(t.disableSelection)return;const{start:v=s.current,end:C,current:S}=m;b?f(d,{start:v,next:C,current:S}):v!=null&&C!=null&&x(d,{start:v,end:C}),r.current=!0},rangeSelectToLast:(d,m)=>{s.current||(s.current=m);const b=r.current?s.current:m;e.selectRange(d,{start:b,end:f1(e)})},rangeSelectToFirst:(d,m)=>{s.current||(s.current=m);const b=r.current?s.current:m;e.selectRange(d,{start:b,end:x1(e)})}}),{getRootProps:()=>({"aria-multiselectable":t.multiSelect})}};D1.models={selected:{controlledProp:"selected",defaultProp:"defaultSelected"}};const bl=[];D1.getDefaultizedParams=e=>{var t,l,s;return A({},e,{disableSelection:(t=e.disableSelection)!=null?t:!1,multiSelect:(l=e.multiSelect)!=null?l:!1,defaultSelected:(s=e.defaultSelected)!=null?s:e.multiSelect?bl:null})};const r0=1e3;class jl{constructor(t=r0){this.timeouts=new Map,this.cleanupTimeout=r0,this.cleanupTimeout=t}register(t,l,s){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{typeof l=="function"&&l(),this.timeouts.delete(s.cleanupToken)},this.cleanupTimeout);this.timeouts.set(s.cleanupToken,r)}unregister(t){const l=this.timeouts.get(t.cleanupToken);l&&(this.timeouts.delete(t.cleanupToken),clearTimeout(l))}reset(){this.timeouts&&(this.timeouts.forEach((t,l)=>{this.unregister({cleanupToken:l})}),this.timeouts=void 0)}}class wl{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,l,s){this.registry.register(t,l,s)}unregister(t){this.registry.unregister(t)}reset(){}}class Rl{}function Cl(e){let t=0;return function(s,r,c){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new wl:new jl);const[i]=R.useState(new Rl),a=R.useRef(null),u=R.useRef();u.current=c;const f=R.useRef(null);if(!a.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};a.current=s.$$subscribeEvent(r,x),t+=1,f.current={cleanupToken:t},e.registry.register(i,()=>{var g;(g=a.current)==null||g.call(a),a.current=null,f.current=null},f.current)}else!u.current&&a.current&&(a.current(),a.current=null,f.current&&(e.registry.unregister(f.current),f.current=null));R.useEffect(()=>{if(!a.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};a.current=s.$$subscribeEvent(r,x)}return f.current&&e.registry&&(e.registry.unregister(f.current),f.current=null),()=>{var x;(x=a.current)==null||x.call(a),a.current=null}},[s,r])}}const yl={registry:null},zl=Cl(yl),_1=({instance:e,params:t,state:l,setState:s,models:r,rootRef:c})=>{const i=He(p=>{const d=typeof p=="function"?p(l.focusedNodeId):p;s(m=>A({},m,{focusedNodeId:d}))}),a=R.useCallback(p=>l.focusedNodeId===p,[l.focusedNodeId]),u=He((p,d)=>{d&&(i(d),t.onNodeFocus&&t.onNodeFocus(p,d))});De(e,{isNodeFocused:a,focusNode:u}),zl(e,"removeNode",({id:p})=>{i(d=>d===p&&c.current===w0(c.current).activeElement?e.getChildrenIds(null)[0]:d)});const f=p=>d=>{var m;if((m=p.onFocus)==null||m.call(p,d),d.target===d.currentTarget){const b=C=>{const S=e.getNode(C);return S&&(S.parentId==null||e.isNodeExpanded(S.parentId))};let v;Array.isArray(r.selected.value)?v=r.selected.value.find(b):r.selected.value!=null&&b(r.selected.value)&&(v=r.selected.value),v==null&&(v=e.getNavigableChildrenIds(null)[0]),e.focusNode(d,v)}},x=p=>d=>{var m;(m=p.onBlur)==null||m.call(p,d),i(null)},g=e.getNode(l.focusedNodeId),y=g?g.idAttribute:null;return{getRootProps:p=>({onFocus:f(p),onBlur:x(p),"aria-activedescendant":y??void 0})}};_1.getInitialState=()=>({focusedNodeId:null});_1.getDefaultizedParams=e=>{var t;return A({},e,{disabledItemsFocusable:(t=e.disabledItemsFocusable)!=null?t:!1})};function Sl(e){return e&&e.length===1&&e.match(/\S/)}function i0(e,t,l){for(let s=t;s<e.length;s+=1)if(l===e[s])return s;return-1}const kl=({instance:e,params:t,state:l})=>{const r=v2().direction==="rtl",c=R.useRef({}),i=He((p,d)=>(c.current[p]=d,()=>{const m=A({},c.current);delete m[p],c.current=m}));De(e,{mapFirstChar:i});const a=p=>(l.focusedNodeId!=null&&e.isNodeExpandable(l.focusedNodeId)&&(e.isNodeExpanded(l.focusedNodeId)?e.focusNode(p,Be(e,l.focusedNodeId)):e.isNodeDisabled(l.focusedNodeId)||e.toggleNodeExpansion(p,l.focusedNodeId)),!0),u=p=>{if(l.focusedNodeId==null)return!1;if(e.isNodeExpanded(l.focusedNodeId)&&!e.isNodeDisabled(l.focusedNodeId))return e.toggleNodeExpansion(p,l.focusedNodeId),!0;const d=e.getNode(l.focusedNodeId).parentId;return d?(e.focusNode(p,d),!0):!1},f=(p,d,m)=>{let b,v;const C=m.toLowerCase(),S=[],N=[];Object.keys(c.current).forEach(T=>{const P=e.getNode(T),I=P.parentId?e.isNodeExpanded(P.parentId):!0,U=t.disabledItemsFocusable?!1:e.isNodeDisabled(T);I&&!U&&(S.push(T),N.push(c.current[T]))}),b=S.indexOf(d)+1,b>=S.length&&(b=0),v=i0(N,b,C),v===-1&&(v=i0(N,0,C)),v>-1&&e.focusNode(p,S[v])},x=(p,d)=>{e.isNodeDisabled(Be(e,d))||e.selectRange(p,{end:Be(e,d),current:d},!0)},g=(p,d)=>{e.isNodeDisabled(a1(e,d))||e.selectRange(p,{end:a1(e,d),current:d},!0)},y=p=>d=>{var m;(m=p.onKeyDown)==null||m.call(p,d);let b=!1;const v=d.key;if(d.altKey||d.currentTarget!==d.target||l.focusedNodeId==null)return;const C=d.ctrlKey||d.metaKey;switch(v){case" ":!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&(b=!0,t.multiSelect&&d.shiftKey?e.selectRange(d,{end:l.focusedNodeId}):t.multiSelect?e.selectNode(d,l.focusedNodeId,!0):e.selectNode(d,l.focusedNodeId)),d.stopPropagation();break;case"Enter":e.isNodeDisabled(l.focusedNodeId)||(e.isNodeExpandable(l.focusedNodeId)?(e.toggleNodeExpansion(d,l.focusedNodeId),b=!0):t.disableSelection||(b=!0,t.multiSelect?e.selectNode(d,l.focusedNodeId,!0):e.selectNode(d,l.focusedNodeId))),d.stopPropagation();break;case"ArrowDown":t.multiSelect&&d.shiftKey&&!t.disableSelection&&x(d,l.focusedNodeId),e.focusNode(d,Be(e,l.focusedNodeId)),b=!0;break;case"ArrowUp":t.multiSelect&&d.shiftKey&&!t.disableSelection&&g(d,l.focusedNodeId),e.focusNode(d,a1(e,l.focusedNodeId)),b=!0;break;case"ArrowRight":r?b=u(d):b=a(d);break;case"ArrowLeft":r?b=a(d):b=u(d);break;case"Home":t.multiSelect&&C&&d.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToFirst(d,l.focusedNodeId),e.focusNode(d,x1(e)),b=!0;break;case"End":t.multiSelect&&C&&d.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToLast(d,l.focusedNodeId),e.focusNode(d,f1(e)),b=!0;break;default:v==="*"?(e.expandAllSiblings(d,l.focusedNodeId),b=!0):t.multiSelect&&C&&v.toLowerCase()==="a"&&!t.disableSelection?(e.selectRange(d,{start:x1(e),end:f1(e)}),b=!0):!C&&!d.shiftKey&&Sl(v)&&(f(d,l.focusedNodeId,v),b=!0)}b&&(d.preventDefault(),d.stopPropagation())};return{getRootProps:p=>({onKeyDown:y(p)})}},Il=({instance:e,params:t})=>{const l=g2(t.id);return{getRootProps:()=>({id:l}),contextValue:{treeId:l,instance:e,multiSelect:t.multiSelect,disabledItemsFocusable:t.disabledItemsFocusable,icons:{defaultCollapseIcon:t.defaultCollapseIcon,defaultEndIcon:t.defaultEndIcon,defaultExpandIcon:t.defaultExpandIcon,defaultParentIcon:t.defaultParentIcon}}}},Ml=[ml,V1,D1,_1,kl,Il],Pl=["disabledItemsFocusable","expanded","defaultExpanded","onNodeToggle","onNodeFocus","disableSelection","defaultSelected","selected","multiSelect","onNodeSelect","id","defaultCollapseIcon","defaultEndIcon","defaultExpandIcon","defaultParentIcon","children"],Ll=e=>{const{classes:t}=e;return qe({root:["root"]},ol,t)},a0=se("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0}),Tl=R.forwardRef(function(t,l){const s=T0({props:t,name:"MuiTreeView"}),r=s,c=s,{disabledItemsFocusable:i,expanded:a,defaultExpanded:u,onNodeToggle:f,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:d,onNodeSelect:m,id:b,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:N,children:T}=c,P=je(c,Pl),{getRootProps:I,contextValue:U}=al({disabledItemsFocusable:i,expanded:a,defaultExpanded:u,onNodeToggle:f,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:d,onNodeSelect:m,id:b,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:N,plugins:Ml,rootRef:l}),V=Ll(s),M=E2({elementType:a0,externalSlotProps:{},externalForwardedProps:P,className:V.root,getSlotProps:I,ownerState:r});return o.jsx(fl,{value:U,children:o.jsx(a0,A({},M,{children:T}))})}),W0=()=>R.useContext(F0);function Nl(e){const{instance:t,multiSelect:l}=W0(),s=t?t.isNodeExpandable(e):!1,r=t?t.isNodeExpanded(e):!1,c=t?t.isNodeFocused(e):!1,i=t?t.isNodeSelected(e):!1,a=t?t.isNodeDisabled(e):!1;return{disabled:a,expanded:r,selected:i,focused:c,handleExpansion:g=>{if(t&&!a){c||t.focusNode(g,e);const y=l&&(g.shiftKey||g.ctrlKey||g.metaKey);s&&!(y&&t.isNodeExpanded(e))&&t.toggleNodeExpansion(g,e)}},handleSelection:g=>{t&&!a&&(c||t.focusNode(g,e),l&&(g.shiftKey||g.ctrlKey||g.metaKey)?g.shiftKey?t.selectRange(g,{end:e}):t.selectNode(g,e,!0):t.selectNode(g,e))},preventSelection:g=>{(g.shiftKey||g.ctrlKey||g.metaKey||a)&&g.preventDefault()}}}const Vl=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],G0=R.forwardRef(function(t,l){const{classes:s,className:r,displayIcon:c,expansionIcon:i,icon:a,label:u,nodeId:f,onClick:x,onMouseDown:g}=t,y=je(t,Vl),{disabled:p,expanded:d,selected:m,focused:b,handleExpansion:v,handleSelection:C,preventSelection:S}=Nl(f),N=a||i||c,T=I=>{S(I),g&&g(I)},P=I=>{v(I),C(I),x&&x(I)};return o.jsxs("div",A({},y,{className:Ue(r,s.root,d&&s.expanded,m&&s.selected,b&&s.focused,p&&s.disabled),onClick:P,onMouseDown:T,ref:l,children:[o.jsx("div",{className:s.iconContainer,children:N}),o.jsx("div",{className:s.label,children:u})]}))});function Dl(e){return Fe("MuiTreeItem",e)}const me=$e("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),_l=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],El=e=>{const{classes:t}=e;return qe({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Dl,t)},Bl=se("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Al=se(G0,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${me.iconContainer}`]:t.iconContainer},t.label&&{[`& .${me.label}`]:t.label}]})(({theme:e})=>({padding:"0 8px",width:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${me.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${me.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${me.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Je(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Je(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Je(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${me.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Je(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${me.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${me.label}`]:A({paddingLeft:4,width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1)})),Ol=se(l1,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),Hl=R.forwardRef(function(t,l){const s=T0({props:t,name:"MuiTreeItem"}),{children:r,className:c,collapseIcon:i,ContentComponent:a=G0,ContentProps:u,endIcon:f,expandIcon:x,disabled:g,icon:y,id:p,label:d,nodeId:m,onClick:b,onMouseDown:v,TransitionComponent:C=l1,TransitionProps:S}=s,N=je(s,_l),{icons:T,multiSelect:P,disabledItemsFocusable:I,treeId:U,instance:V}=W0();let M;p!=null?M=p:U&&m&&(M=`${U}-${m}`);const[k,L]=R.useState(null),E=R.useRef(null),B=j0(L,l),O=R.useMemo(()=>({element:k,id:m}),[m,k]),{index:K,parentId:J}=hl(O),W=!!(Array.isArray(r)?r.length:r),Z=V?V.isNodeExpanded(m):!1,Me=V?V.isNodeFocused(m):!1,he=V?V.isNodeSelected(m):!1,ce=V?V.isNodeDisabled(m):!1,oe=A({},s,{expanded:Z,focused:Me,selected:he,disabled:ce}),ee=El(oe);let ie,fe;W&&(Z?fe=i||T.defaultCollapseIcon:fe=x||T.defaultExpandIcon),W?ie=T.defaultParentIcon:ie=f||T.defaultEndIcon,R.useEffect(()=>{if(V&&K!==-1)return V.updateNode({id:m,idAttribute:M,index:K,parentId:J,expandable:W,disabled:g}),()=>V.removeNode(m)},[V,J,K,m,W,g,M]),R.useEffect(()=>{if(V&&d){var q,le;return V.mapFirstChar(m,((q=(le=E.current)==null?void 0:le.textContent)!=null?q:"").substring(0,1).toLowerCase())}},[V,m,d]);let Q;P?Q=he:he&&(Q=!0);function xe(q){if(q.target===q.currentTarget){let H;typeof q.target.getRootNode=="function"?H=q.target.getRootNode():H=w0(q.target),H.getElementById(U).focus({preventScroll:!0})}const le=!I&&ce;V&&!Me&&q.currentTarget===q.target&&!le&&V.focusNode(q,m)}return o.jsxs(Bl,A({className:Ue(ee.root,c),role:"treeitem","aria-expanded":W?Z:void 0,"aria-selected":Q,"aria-disabled":ce||void 0,id:M,tabIndex:-1},N,{ownerState:oe,onFocus:xe,ref:B,children:[o.jsx(Al,A({as:a,ref:E,classes:{root:ee.content,expanded:ee.expanded,selected:ee.selected,focused:ee.focused,disabled:ee.disabled,iconContainer:ee.iconContainer,label:ee.label},label:d,nodeId:m,onClick:b,onMouseDown:v,icon:y,expansionIcon:fe,displayIcon:ie,ownerState:oe},u)),r&&o.jsx(q0,{id:m,children:o.jsx(Ol,A({as:C,unmountOnExit:!0,className:ee.group,in:Z,component:"ul",role:"group"},S,{children:r}))})]}))});function E1({data:e,...t}){return!e||!e.length?null:o.jsx($l,{...t,children:e.map(l=>o.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:l.url,alt:l.alt||""})},l.url))})}E1.propTypes={data:h.arrayOf(h.shape({url:h.string,alt:h.string}))};E1.defaultProps={data:[]};const $l=ae(z)`
|
|
46
|
+
`;function tl(e,t){const l=new Set(t||[]),s=[];function r(c){l.has(c==null?void 0:c.id)&&s.push(c==null?void 0:c.id),c!=null&&c.children&&c.children.forEach(r)}return(e||[]).forEach(r),s}function ol(e){return Fe("MuiTreeView",e)}$e("MuiTreeView",["root"]);const $0={instance:null,multiSelect:!1,disabledItemsFocusable:!1,treeId:void 0,icons:{defaultCollapseIcon:null,defaultExpandIcon:null,defaultParentIcon:null,defaultEndIcon:null}},F0=R.createContext($0),ll=(e,t)=>{const l=R.useRef({}),[s,r]=R.useState(()=>{const i={};return e.forEach(a=>{a.models&&Object.entries(a.models).forEach(([u,f])=>{l.current[u]={controlledProp:f.controlledProp,defaultProp:f.defaultProp,isControlled:t[f.controlledProp]!==void 0},i[u]=t[f.defaultProp]})}),i});return Object.fromEntries(Object.entries(l.current).map(([i,a])=>{const u=a.isControlled?t[a.controlledProp]:s[i];return[i,{value:u,setValue:f=>{a.isControlled||r(x=>A({},x,{[i]:f}))}}]}))};class nl{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,l,s={}){let r=this.events[t];r||(r={highPriority:new Map,regular:new Map},this.events[t]=r),s.isFirst?r.highPriority.set(l,!0):r.regular.set(l,!0)}removeListener(t,l){this.events[t]&&(this.events[t].regular.delete(l),this.events[t].highPriority.delete(l))}removeAllListeners(){this.events={}}emit(t,...l){const s=this.events[t];if(!s)return;const r=Array.from(s.highPriority.keys()),c=Array.from(s.regular.keys());for(let i=r.length-1;i>=0;i-=1){const a=r[i];s.highPriority.has(a)&&a.apply(this,l)}for(let i=0;i<c.length;i+=1){const a=c[i];s.regular.has(a)&&a.apply(this,l)}}once(t,l){const s=this;this.on(t,function r(...c){s.removeListener(t,r),l.apply(s,c)})}}const a1=(e,t)=>{const l=e.getNode(t),s=e.getNavigableChildrenIds(l.parentId),r=s.indexOf(t);if(r===0)return l.parentId;let c=s[r-1];for(;e.isNodeExpanded(c)&&e.getNavigableChildrenIds(c).length>0;)c=e.getNavigableChildrenIds(c).pop();return c},Be=(e,t)=>{if(e.isNodeExpanded(t)&&e.getNavigableChildrenIds(t).length>0)return e.getNavigableChildrenIds(t)[0];let l=e.getNode(t);for(;l!=null;){const s=e.getNavigableChildrenIds(l.parentId),r=s[s.indexOf(l.id)+1];if(r)return r;l=e.getNode(l.parentId)}return null},f1=e=>{let t=e.getNavigableChildrenIds(null).pop();for(;e.isNodeExpanded(t);)t=e.getNavigableChildrenIds(t).pop();return t},x1=e=>e.getNavigableChildrenIds(null)[0],De=(e,t)=>{Object.assign(e,t)},sl=e=>e.isPropagationStopped!==void 0,rl=({instance:e})=>{const[t]=R.useState(()=>new nl),l=R.useCallback((...r)=>{const[c,i,a={}]=r;a.defaultMuiPrevented=!1,!(sl(a)&&a.isPropagationStopped())&&t.emit(c,i,a)},[t]),s=R.useCallback((r,c)=>(t.on(r,c),()=>{t.removeListener(r,c)}),[t]);De(e,{$$publishEvent:l,$$subscribeEvent:s})},il=[rl],al=e=>{const t=[...il,...e.plugins],l=t.reduce((d,m)=>m.getDefaultizedParams?m.getDefaultizedParams(d):d,e),s=ll(t,l),c=R.useRef({}).current,i=R.useRef(null),a=j0(i,e.rootRef),[u,f]=R.useState(()=>{const d={};return t.forEach(m=>{m.getInitialState&&Object.assign(d,m.getInitialState(l))}),d}),x=[];let g=$0;const y=d=>{const m=d({instance:c,params:l,state:u,setState:f,rootRef:i,models:s})||{};m.getRootProps&&x.push(m.getRootProps),m.contextValue&&(g=m.contextValue)};return t.forEach(y),{getRootProps:(d={})=>{const m=A({role:"tree",tabIndex:0},d,{ref:a});return x.forEach(b=>{Object.assign(m,b(d))}),m},rootRef:a,contextValue:g}},cl=["element"];function dl(e,t){for(let l=0;l<e.length;l+=1)if(t(e[l]))return l;return-1}function ul(e,t){let l=0,s=e.length-1;for(;l<=s;){const r=Math.floor((l+s)/2);if(e[r].element===t)return r;e[r].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?s=r-1:l=r+1}return l}const U0=R.createContext({});function pl(e){const t=R.useRef(null);return R.useEffect(()=>{t.current=e},[e]),t.current}const s0=()=>{};function hl(e){const[,t]=R.useState(),{registerDescendant:l=s0,unregisterDescendant:s=s0,descendants:r=[],parentId:c=null}=R.useContext(U0),i=dl(r,f=>f.element===e.element),a=pl(r),u=r.some((f,x)=>a&&a[x]&&a[x].element!==f.element);return m2(()=>{if(e.element)return l(A({},e,{index:i})),()=>{s(e.element)};t({})},[l,s,i,u,e]),{parentId:c,index:i}}function q0(e){const{children:t,id:l}=e,[s,r]=R.useState([]),c=R.useCallback(u=>{let{element:f}=u,x=je(u,cl);r(g=>{if(g.length===0)return[A({},x,{element:f,index:0})];const y=ul(g,f);let p;if(g[y]&&g[y].element===f)p=g;else{const d=A({},x,{element:f,index:y});p=g.slice(),p.splice(y,0,d)}return p.forEach((d,m)=>{d.index=m}),p})},[]),i=R.useCallback(u=>{r(f=>f.filter(x=>u!==x.element))},[]),a=R.useMemo(()=>({descendants:s,registerDescendant:c,unregisterDescendant:i,parentId:l}),[s,c,i,l]);return o.jsx(U0.Provider,{value:a,children:t})}function fl(e){const{value:t,children:l}=e;return o.jsx(F0.Provider,{value:t,children:o.jsx(q0,{children:l})})}const xl=(e,t,l)=>{e.$$publishEvent(t,l)},ml=({instance:e,params:t})=>{const l=R.useRef({}),s=R.useCallback(f=>l.current[f],[]),r=R.useCallback(f=>{l.current[f.id]=f},[]),c=R.useCallback(f=>{const x=A({},l.current);delete x[f],l.current=x,xl(e,"removeNode",{id:f})},[e]),i=R.useCallback(f=>{if(f==null)return!1;let x=e.getNode(f);if(!x)return!1;if(x.disabled)return!0;for(;x.parentId!=null;)if(x=e.getNode(x.parentId),x.disabled)return!0;return!1},[e]),a=He(f=>Object.values(l.current).filter(x=>x.parentId===f).sort((x,g)=>x.index-g.index).map(x=>x.id));De(e,{getNode:s,updateNode:r,removeNode:c,getChildrenIds:a,getNavigableChildrenIds:f=>{let x=e.getChildrenIds(f);return t.disabledItemsFocusable||(x=x.filter(g=>!e.isNodeDisabled(g))),x},isNodeDisabled:i})},V1=({instance:e,params:t,models:l})=>{const s=R.useCallback(a=>Array.isArray(l.expanded.value)?l.expanded.value.indexOf(a)!==-1:!1,[l.expanded.value]),r=R.useCallback(a=>{var u;return!!((u=e.getNode(a))!=null&&u.expandable)},[e]),c=He((a,u)=>{if(u==null)return;let f;l.expanded.value.indexOf(u)!==-1?f=l.expanded.value.filter(x=>x!==u):f=[u].concat(l.expanded.value),t.onNodeToggle&&t.onNodeToggle(a,f),l.expanded.setValue(f)});De(e,{isNodeExpanded:s,isNodeExpandable:r,toggleNodeExpansion:c,expandAllSiblings:(a,u)=>{const f=e.getNode(u),g=e.getChildrenIds(f.parentId).filter(p=>e.isNodeExpandable(p)&&!e.isNodeExpanded(p)),y=l.expanded.value.concat(g);g.length>0&&(l.expanded.setValue(y),t.onNodeToggle&&t.onNodeToggle(a,y))}})};V1.models={expanded:{controlledProp:"expanded",defaultProp:"defaultExpanded"}};const vl=[];V1.getDefaultizedParams=e=>{var t;return A({},e,{defaultExpanded:(t=e.defaultExpanded)!=null?t:vl})};const gl=(e,t,l)=>{if(t===l)return[t,l];const s=e.getNode(t),r=e.getNode(l);if(s.parentId===r.id||r.parentId===s.id)return r.parentId===s.id?[s.id,r.id]:[r.id,s.id];const c=[s.id],i=[r.id];let a=s.parentId,u=r.parentId,f=i.indexOf(a)!==-1,x=c.indexOf(u)!==-1,g=!0,y=!0;for(;!x&&!f;)g&&(c.push(a),f=i.indexOf(a)!==-1,g=a!==null,!f&&g&&(a=e.getNode(a).parentId)),y&&!f&&(i.push(u),x=c.indexOf(u)!==-1,y=u!==null,!x&&y&&(u=e.getNode(u).parentId));const p=f?a:u,d=e.getChildrenIds(p),m=c[c.indexOf(p)-1],b=i[i.indexOf(p)-1];return d.indexOf(m)<d.indexOf(b)?[t,l]:[l,t]},D1=({instance:e,params:t,models:l})=>{const s=R.useRef(null),r=R.useRef(!1),c=R.useRef([]),i=d=>Array.isArray(l.selected.value)?l.selected.value.indexOf(d)!==-1:l.selected.value===d,a=(d,m,b=!1)=>{if(!t.disableSelection){if(b){if(Array.isArray(l.selected.value)){let v;l.selected.value.indexOf(m)!==-1?v=l.selected.value.filter(C=>C!==m):v=[m].concat(l.selected.value),t.onNodeSelect&&t.onNodeSelect(d,v),l.selected.setValue(v)}}else{const v=t.multiSelect?[m]:m;t.onNodeSelect&&t.onNodeSelect(d,v),l.selected.setValue(v)}s.current=m,r.current=!1,c.current=[]}},u=(d,m)=>{const[b,v]=gl(e,d,m),C=[b];let S=b;for(;S!==v;)S=Be(e,S),C.push(S);return C},f=(d,m)=>{let b=l.selected.value.slice();const{start:v,next:C,current:S}=m;!C||!S||(c.current.indexOf(S)===-1&&(c.current=[]),r.current?c.current.indexOf(C)!==-1?(b=b.filter(N=>N===v||N!==S),c.current=c.current.filter(N=>N===v||N!==S)):(b.push(C),c.current.push(C)):(b.push(C),c.current.push(S,C)),t.onNodeSelect&&t.onNodeSelect(d,b),l.selected.setValue(b))},x=(d,m)=>{let b=l.selected.value.slice();const{start:v,end:C}=m;r.current&&(b=b.filter(T=>c.current.indexOf(T)===-1));let S=u(v,C);S=S.filter(T=>!e.isNodeDisabled(T)),c.current=S;let N=b.concat(S);N=N.filter((T,P)=>N.indexOf(T)===P),t.onNodeSelect&&t.onNodeSelect(d,N),l.selected.setValue(N)};return De(e,{isNodeSelected:i,selectNode:a,selectRange:(d,m,b=!1)=>{if(t.disableSelection)return;const{start:v=s.current,end:C,current:S}=m;b?f(d,{start:v,next:C,current:S}):v!=null&&C!=null&&x(d,{start:v,end:C}),r.current=!0},rangeSelectToLast:(d,m)=>{s.current||(s.current=m);const b=r.current?s.current:m;e.selectRange(d,{start:b,end:f1(e)})},rangeSelectToFirst:(d,m)=>{s.current||(s.current=m);const b=r.current?s.current:m;e.selectRange(d,{start:b,end:x1(e)})}}),{getRootProps:()=>({"aria-multiselectable":t.multiSelect})}};D1.models={selected:{controlledProp:"selected",defaultProp:"defaultSelected"}};const bl=[];D1.getDefaultizedParams=e=>{var t,l,s;return A({},e,{disableSelection:(t=e.disableSelection)!=null?t:!1,multiSelect:(l=e.multiSelect)!=null?l:!1,defaultSelected:(s=e.defaultSelected)!=null?s:e.multiSelect?bl:null})};const r0=1e3;class jl{constructor(t=r0){this.timeouts=new Map,this.cleanupTimeout=r0,this.cleanupTimeout=t}register(t,l,s){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{typeof l=="function"&&l(),this.timeouts.delete(s.cleanupToken)},this.cleanupTimeout);this.timeouts.set(s.cleanupToken,r)}unregister(t){const l=this.timeouts.get(t.cleanupToken);l&&(this.timeouts.delete(t.cleanupToken),clearTimeout(l))}reset(){this.timeouts&&(this.timeouts.forEach((t,l)=>{this.unregister({cleanupToken:l})}),this.timeouts=void 0)}}class wl{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,l,s){this.registry.register(t,l,s)}unregister(t){this.registry.unregister(t)}reset(){}}class Rl{}function Cl(e){let t=0;return function(s,r,c){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new wl:new jl);const[i]=R.useState(new Rl),a=R.useRef(null),u=R.useRef();u.current=c;const f=R.useRef(null);if(!a.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};a.current=s.$$subscribeEvent(r,x),t+=1,f.current={cleanupToken:t},e.registry.register(i,()=>{var g;(g=a.current)==null||g.call(a),a.current=null,f.current=null},f.current)}else!u.current&&a.current&&(a.current(),a.current=null,f.current&&(e.registry.unregister(f.current),f.current=null));R.useEffect(()=>{if(!a.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};a.current=s.$$subscribeEvent(r,x)}return f.current&&e.registry&&(e.registry.unregister(f.current),f.current=null),()=>{var x;(x=a.current)==null||x.call(a),a.current=null}},[s,r])}}const yl={registry:null},zl=Cl(yl),_1=({instance:e,params:t,state:l,setState:s,models:r,rootRef:c})=>{const i=He(p=>{const d=typeof p=="function"?p(l.focusedNodeId):p;s(m=>A({},m,{focusedNodeId:d}))}),a=R.useCallback(p=>l.focusedNodeId===p,[l.focusedNodeId]),u=He((p,d)=>{d&&(i(d),t.onNodeFocus&&t.onNodeFocus(p,d))});De(e,{isNodeFocused:a,focusNode:u}),zl(e,"removeNode",({id:p})=>{i(d=>d===p&&c.current===w0(c.current).activeElement?e.getChildrenIds(null)[0]:d)});const f=p=>d=>{var m;if((m=p.onFocus)==null||m.call(p,d),d.target===d.currentTarget){const b=C=>{const S=e.getNode(C);return S&&(S.parentId==null||e.isNodeExpanded(S.parentId))};let v;Array.isArray(r.selected.value)?v=r.selected.value.find(b):r.selected.value!=null&&b(r.selected.value)&&(v=r.selected.value),v==null&&(v=e.getNavigableChildrenIds(null)[0]),e.focusNode(d,v)}},x=p=>d=>{var m;(m=p.onBlur)==null||m.call(p,d),i(null)},g=e.getNode(l.focusedNodeId),y=g?g.idAttribute:null;return{getRootProps:p=>({onFocus:f(p),onBlur:x(p),"aria-activedescendant":y??void 0})}};_1.getInitialState=()=>({focusedNodeId:null});_1.getDefaultizedParams=e=>{var t;return A({},e,{disabledItemsFocusable:(t=e.disabledItemsFocusable)!=null?t:!1})};function Sl(e){return e&&e.length===1&&e.match(/\S/)}function i0(e,t,l){for(let s=t;s<e.length;s+=1)if(l===e[s])return s;return-1}const kl=({instance:e,params:t,state:l})=>{const r=v2().direction==="rtl",c=R.useRef({}),i=He((p,d)=>(c.current[p]=d,()=>{const m=A({},c.current);delete m[p],c.current=m}));De(e,{mapFirstChar:i});const a=p=>(l.focusedNodeId!=null&&e.isNodeExpandable(l.focusedNodeId)&&(e.isNodeExpanded(l.focusedNodeId)?e.focusNode(p,Be(e,l.focusedNodeId)):e.isNodeDisabled(l.focusedNodeId)||e.toggleNodeExpansion(p,l.focusedNodeId)),!0),u=p=>{if(l.focusedNodeId==null)return!1;if(e.isNodeExpanded(l.focusedNodeId)&&!e.isNodeDisabled(l.focusedNodeId))return e.toggleNodeExpansion(p,l.focusedNodeId),!0;const d=e.getNode(l.focusedNodeId).parentId;return d?(e.focusNode(p,d),!0):!1},f=(p,d,m)=>{let b,v;const C=m.toLowerCase(),S=[],N=[];Object.keys(c.current).forEach(T=>{const P=e.getNode(T),I=P.parentId?e.isNodeExpanded(P.parentId):!0,U=t.disabledItemsFocusable?!1:e.isNodeDisabled(T);I&&!U&&(S.push(T),N.push(c.current[T]))}),b=S.indexOf(d)+1,b>=S.length&&(b=0),v=i0(N,b,C),v===-1&&(v=i0(N,0,C)),v>-1&&e.focusNode(p,S[v])},x=(p,d)=>{e.isNodeDisabled(Be(e,d))||e.selectRange(p,{end:Be(e,d),current:d},!0)},g=(p,d)=>{e.isNodeDisabled(a1(e,d))||e.selectRange(p,{end:a1(e,d),current:d},!0)},y=p=>d=>{var m;(m=p.onKeyDown)==null||m.call(p,d);let b=!1;const v=d.key;if(d.altKey||d.currentTarget!==d.target||l.focusedNodeId==null)return;const C=d.ctrlKey||d.metaKey;switch(v){case" ":!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&(b=!0,t.multiSelect&&d.shiftKey?e.selectRange(d,{end:l.focusedNodeId}):t.multiSelect?e.selectNode(d,l.focusedNodeId,!0):e.selectNode(d,l.focusedNodeId)),d.stopPropagation();break;case"Enter":e.isNodeDisabled(l.focusedNodeId)||(e.isNodeExpandable(l.focusedNodeId)?(e.toggleNodeExpansion(d,l.focusedNodeId),b=!0):t.disableSelection||(b=!0,t.multiSelect?e.selectNode(d,l.focusedNodeId,!0):e.selectNode(d,l.focusedNodeId))),d.stopPropagation();break;case"ArrowDown":t.multiSelect&&d.shiftKey&&!t.disableSelection&&x(d,l.focusedNodeId),e.focusNode(d,Be(e,l.focusedNodeId)),b=!0;break;case"ArrowUp":t.multiSelect&&d.shiftKey&&!t.disableSelection&&g(d,l.focusedNodeId),e.focusNode(d,a1(e,l.focusedNodeId)),b=!0;break;case"ArrowRight":r?b=u(d):b=a(d);break;case"ArrowLeft":r?b=a(d):b=u(d);break;case"Home":t.multiSelect&&C&&d.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToFirst(d,l.focusedNodeId),e.focusNode(d,x1(e)),b=!0;break;case"End":t.multiSelect&&C&&d.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToLast(d,l.focusedNodeId),e.focusNode(d,f1(e)),b=!0;break;default:v==="*"?(e.expandAllSiblings(d,l.focusedNodeId),b=!0):t.multiSelect&&C&&v.toLowerCase()==="a"&&!t.disableSelection?(e.selectRange(d,{start:x1(e),end:f1(e)}),b=!0):!C&&!d.shiftKey&&Sl(v)&&(f(d,l.focusedNodeId,v),b=!0)}b&&(d.preventDefault(),d.stopPropagation())};return{getRootProps:p=>({onKeyDown:y(p)})}},Il=({instance:e,params:t})=>{const l=g2(t.id);return{getRootProps:()=>({id:l}),contextValue:{treeId:l,instance:e,multiSelect:t.multiSelect,disabledItemsFocusable:t.disabledItemsFocusable,icons:{defaultCollapseIcon:t.defaultCollapseIcon,defaultEndIcon:t.defaultEndIcon,defaultExpandIcon:t.defaultExpandIcon,defaultParentIcon:t.defaultParentIcon}}}},Ml=[ml,V1,D1,_1,kl,Il],Pl=["disabledItemsFocusable","expanded","defaultExpanded","onNodeToggle","onNodeFocus","disableSelection","defaultSelected","selected","multiSelect","onNodeSelect","id","defaultCollapseIcon","defaultEndIcon","defaultExpandIcon","defaultParentIcon","children"],Ll=e=>{const{classes:t}=e;return qe({root:["root"]},ol,t)},a0=se("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0}),Tl=R.forwardRef(function(t,l){const s=T0({props:t,name:"MuiTreeView"}),r=s,c=s,{disabledItemsFocusable:i,expanded:a,defaultExpanded:u,onNodeToggle:f,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:d,onNodeSelect:m,id:b,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:N,children:T}=c,P=je(c,Pl),{getRootProps:I,contextValue:U}=al({disabledItemsFocusable:i,expanded:a,defaultExpanded:u,onNodeToggle:f,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:d,onNodeSelect:m,id:b,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:N,plugins:Ml,rootRef:l}),V=Ll(s),M=B2({elementType:a0,externalSlotProps:{},externalForwardedProps:P,className:V.root,getSlotProps:I,ownerState:r});return o.jsx(fl,{value:U,children:o.jsx(a0,A({},M,{children:T}))})}),W0=()=>R.useContext(F0);function Nl(e){const{instance:t,multiSelect:l}=W0(),s=t?t.isNodeExpandable(e):!1,r=t?t.isNodeExpanded(e):!1,c=t?t.isNodeFocused(e):!1,i=t?t.isNodeSelected(e):!1,a=t?t.isNodeDisabled(e):!1;return{disabled:a,expanded:r,selected:i,focused:c,handleExpansion:g=>{if(t&&!a){c||t.focusNode(g,e);const y=l&&(g.shiftKey||g.ctrlKey||g.metaKey);s&&!(y&&t.isNodeExpanded(e))&&t.toggleNodeExpansion(g,e)}},handleSelection:g=>{t&&!a&&(c||t.focusNode(g,e),l&&(g.shiftKey||g.ctrlKey||g.metaKey)?g.shiftKey?t.selectRange(g,{end:e}):t.selectNode(g,e,!0):t.selectNode(g,e))},preventSelection:g=>{(g.shiftKey||g.ctrlKey||g.metaKey||a)&&g.preventDefault()}}}const Vl=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],G0=R.forwardRef(function(t,l){const{classes:s,className:r,displayIcon:c,expansionIcon:i,icon:a,label:u,nodeId:f,onClick:x,onMouseDown:g}=t,y=je(t,Vl),{disabled:p,expanded:d,selected:m,focused:b,handleExpansion:v,handleSelection:C,preventSelection:S}=Nl(f),N=a||i||c,T=I=>{S(I),g&&g(I)},P=I=>{v(I),C(I),x&&x(I)};return o.jsxs("div",A({},y,{className:Ue(r,s.root,d&&s.expanded,m&&s.selected,b&&s.focused,p&&s.disabled),onClick:P,onMouseDown:T,ref:l,children:[o.jsx("div",{className:s.iconContainer,children:N}),o.jsx("div",{className:s.label,children:u})]}))});function Dl(e){return Fe("MuiTreeItem",e)}const me=$e("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),_l=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],El=e=>{const{classes:t}=e;return qe({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Dl,t)},Bl=se("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Al=se(G0,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${me.iconContainer}`]:t.iconContainer},t.label&&{[`& .${me.label}`]:t.label}]})(({theme:e})=>({padding:"0 8px",width:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${me.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${me.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${me.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Je(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Je(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Je(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${me.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Je(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${me.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${me.label}`]:A({paddingLeft:4,width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1)})),Ol=se(l1,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),Hl=R.forwardRef(function(t,l){const s=T0({props:t,name:"MuiTreeItem"}),{children:r,className:c,collapseIcon:i,ContentComponent:a=G0,ContentProps:u,endIcon:f,expandIcon:x,disabled:g,icon:y,id:p,label:d,nodeId:m,onClick:b,onMouseDown:v,TransitionComponent:C=l1,TransitionProps:S}=s,N=je(s,_l),{icons:T,multiSelect:P,disabledItemsFocusable:I,treeId:U,instance:V}=W0();let M;p!=null?M=p:U&&m&&(M=`${U}-${m}`);const[k,L]=R.useState(null),E=R.useRef(null),B=j0(L,l),O=R.useMemo(()=>({element:k,id:m}),[m,k]),{index:K,parentId:J}=hl(O),W=!!(Array.isArray(r)?r.length:r),Z=V?V.isNodeExpanded(m):!1,Me=V?V.isNodeFocused(m):!1,he=V?V.isNodeSelected(m):!1,ce=V?V.isNodeDisabled(m):!1,oe=A({},s,{expanded:Z,focused:Me,selected:he,disabled:ce}),ee=El(oe);let ie,fe;W&&(Z?fe=i||T.defaultCollapseIcon:fe=x||T.defaultExpandIcon),W?ie=T.defaultParentIcon:ie=f||T.defaultEndIcon,R.useEffect(()=>{if(V&&K!==-1)return V.updateNode({id:m,idAttribute:M,index:K,parentId:J,expandable:W,disabled:g}),()=>V.removeNode(m)},[V,J,K,m,W,g,M]),R.useEffect(()=>{if(V&&d){var q,le;return V.mapFirstChar(m,((q=(le=E.current)==null?void 0:le.textContent)!=null?q:"").substring(0,1).toLowerCase())}},[V,m,d]);let Q;P?Q=he:he&&(Q=!0);function xe(q){if(q.target===q.currentTarget){let H;typeof q.target.getRootNode=="function"?H=q.target.getRootNode():H=w0(q.target),H.getElementById(U).focus({preventScroll:!0})}const le=!I&&ce;V&&!Me&&q.currentTarget===q.target&&!le&&V.focusNode(q,m)}return o.jsxs(Bl,A({className:Ue(ee.root,c),role:"treeitem","aria-expanded":W?Z:void 0,"aria-selected":Q,"aria-disabled":ce||void 0,id:M,tabIndex:-1},N,{ownerState:oe,onFocus:xe,ref:B,children:[o.jsx(Al,A({as:a,ref:E,classes:{root:ee.content,expanded:ee.expanded,selected:ee.selected,focused:ee.focused,disabled:ee.disabled,iconContainer:ee.iconContainer,label:ee.label},label:d,nodeId:m,onClick:b,onMouseDown:v,icon:y,expansionIcon:fe,displayIcon:ie,ownerState:oe},u)),r&&o.jsx(q0,{id:m,children:o.jsx(Ol,A({as:C,unmountOnExit:!0,className:ee.group,in:Z,component:"ul",role:"group"},S,{children:r}))})]}))});function E1({data:e,...t}){return!e||!e.length?null:o.jsx($l,{...t,children:e.map(l=>o.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:l.url,alt:l.alt||""})},l.url))})}E1.propTypes={data:h.arrayOf(h.shape({url:h.string,alt:h.string}))};E1.defaultProps={data:[]};const $l=ae(z)`
|
|
47
47
|
display: flex;
|
|
48
48
|
justify-content: flex-start;
|
|
49
49
|
flex-wrap: wrap;
|
|
@@ -57,7 +57,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fE as X1,aJ as je,aE as $e,aF a
|
|
|
57
57
|
margin-right: 12px;
|
|
58
58
|
margin-bottom: 12px;
|
|
59
59
|
}
|
|
60
|
-
`,c1=(e,t)=>{const l=[...e];for(;l.length>0;){const s=l.shift();if(s.id===t)return s;s.children&&l.push(...s.children)}return[]};function B1({icon:e}){return e?
|
|
60
|
+
`,c1=(e,t)=>{const l=[...e];for(;l.length>0;){const s=l.shift();if(s.id===t)return s;s.children&&l.push(...s.children)}return[]};function B1({icon:e}){return e?V2(e)?o.jsx("img",{className:"resource-icon",src:e,alt:"icon"}):o.jsx(re,{className:"resource-icon",icon:e}):null}B1.propTypes={icon:h.string};B1.defaultProps={icon:""};function A1({disabled:e,data:t,onChange:l,value:s}){const r=s;function c(p,d=[]){return d.push(p.id),p.children&&p.children.forEach(m=>c(m,d)),d}const i=p=>c(c1(t,p)),a=(p,d=[])=>{const m=c1(t,p);return m.parent?(d.push(m.parent),a(m.parent,d)):d};function u(p,d){const m=i(p.id),b=m.indexOf(p.id);return m.splice(b,1),m.every(v=>r.concat(d).includes(v))}const f=(p,d)=>{p.stopPropagation();const m=i(d),b=a(d);if(r.includes(d)){const v=r.filter(C=>!m.concat(b).includes(C));l(v)}else{const v=m;for(let C=0;C<b.length;++C)u(c1(t,b[C]),v)&&v.push(b[C]);l([...r].concat(v))}},x=p=>{p.stopPropagation()},g=t.some(p=>{var d;return((d=p.children)==null?void 0:d.length)>0}),y=p=>{var C;const d=r.indexOf(p.id)!==-1,m=Array.isArray(p.children),b=i(p.id),v=m&&!d&&r.some(S=>b.includes(S));return o.jsx(Hl,{nodeId:p.id,label:o.jsx(p1,{onClick:x,control:o.jsx(u1,{size:"small",checked:d,indeterminate:v,tabIndex:-1,disableRipple:!0,onClick:S=>f(S,p.id),disabled:p.disabled||e}),label:o.jsxs(z,{className:"content",children:[o.jsxs(z,{display:"flex",alignItems:"center",children:[p.icon&&o.jsx(B1,{icon:p.icon}),o.jsx(z,{className:"name",children:p.name}),p.url&&o.jsx("a",{href:p.url,target:"_blank",rel:"noreferrer",className:"link",children:o.jsx(E2,{className:"link-icon"})})]}),!!p.description&&o.jsx(z,{className:"description",children:p.description}),!!((C=p.images)!=null&&C.length)&&o.jsx(E1,{className:"images",data:p.images})]})}),children:m?p.children.map(y):null},p.id)};return o.jsx(Fl,{className:y1(!g&&"no-children"),multiSelect:!0,defaultCollapseIcon:o.jsx(D2,{}),defaultExpandIcon:o.jsx(_2,{}),selected:r,children:t.map(p=>y(p))})}A1.propTypes={data:h.array,value:h.array,onChange:h.func,disabled:h.bool};A1.defaultProps={data:[],value:[],onChange:()=>{},disabled:!1};const Fl=ae(Tl)`
|
|
61
61
|
&.no-children {
|
|
62
62
|
.MuiTreeItem-content {
|
|
63
63
|
padding: 0;
|
|
@@ -133,7 +133,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fE as X1,aJ as je,aE as $e,aF a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,c0="lastWantToConnectStoreId";function Gl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Kl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Xl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Jl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(F2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),A2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(w2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-87q4e1zg.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Gl(s),N=O2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Xl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Kl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Ql,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(B2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Ql=ae.div`
|
|
136
|
+
`,c0="lastWantToConnectStoreId";function Gl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Kl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Xl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Jl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(U2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),O2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(w2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-B76g6xcQ.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Gl(s),N=H2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Xl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Kl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Ql,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(A2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Ql=ae.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -164,7 +164,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fE as X1,aJ as je,aE as $e,aF a
|
|
|
164
164
|
width: 100%; /* 图像宽度填充容器 */
|
|
165
165
|
height: auto; /* 图像高度自适应 */
|
|
166
166
|
}
|
|
167
|
-
`;var $1={},Yl=ke;Object.defineProperty($1,"__esModule",{value:!0});var Q0=$1.default=void 0,Zl=Yl(Se()),e3=o;Q0=$1.default=(0,Zl.default)((0,e3.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const t3=(e,t,l,s)=>{const r=e?[...e]:[],c=((t==null?void 0:t.children)||[]).reduce((i,a)=>(i[a.meta.did]=!0,i),{});return Object.keys(l).forEach(i=>{if(!c[i])return;let a=!1;s||r.forEach(u=>{u.did===i&&(u.included=!0,u.required=!0,a=!0)}),a||r.push({did:i,included:!0,required:!0})}),r},o3=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],s=await(await fetch(e)).blob();return new File([s],t,{type:s.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*l3(e,t){let l=0;for(;l<e.size;)yield e.slice(l,l+t),l+=t}const n3=async({did:e,projectId:t,uploadType:l="logo",imageUrl:s})=>{const r=await o3(s);new FormData().append("file",r);const i={uploaderId:"Uploader",relativePath:encodeURIComponent(r.name),name:encodeURIComponent(r.name),type:r.type},u=(await Q1.post(pe(X.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,l,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":r.size,"X-Uploader-File-Ext":r.name.split(".").pop(),"Upload-Metadata":Object.keys(i).map(y=>`${y} ${btoa(i[y])}`).join(",")}})).headers.location,f=2*1024*1024;let x=0,g="";for(const y of l3(r,f)){const p=await Q1.patch(pe(X.WELLKNOWN_SERVICE_PATH_PREFIX,u),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":x,"Content-Type":"application/offset+octet-stream"}});x+=y.size,g=p.data.filename}return g},Y0=({params:e,hasSelectedResources:t,projectId:l,status:s,t:r})=>{const c=[];return e.blockletTitle||c.push({param:"blockletTitle",message:r("blocklet.publish.errorTip.noTitle")}),(!l||l===X.UNOWNED_DID)&&c.push({param:"projectId",message:r("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&c.push({param:"blockletResource",message:r("blocklet.publish.errorTip.noResource")}),e.blockletVersion?Le.valid(e.blockletVersion)||c.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.inValidVersion")}):c.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.noVersion")}),s===ye.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||c.push({param:"blockletDescription",message:r("blocklet.publish.errorTip.noDescription")}),e.note||c.push({param:"note",message:r("blocklet.publish.errorTip.noNote")})),c.length?c:null},s3=({params:e,hasSelectedResources:t,step:l,t:s,projectId:r})=>{if(l===0){if(!e.blockletTitle)return s("blocklet.publish.errorTip.noTitle");if(!r||r===X.UNOWNED_DID)return s("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return s("blocklet.publish.errorTip.noDescription")}if(l===2&&!e.uploadedResource&&!t)return s("blocklet.publish.errorTip.noResource");if(l>=4){if(!e.blockletVersion)return s("blocklet.publish.errorTip.noVersion");if(!Le.valid(e.blockletVersion))return s("blocklet.publish.errorTip.inValidVersion");if(!e.note)return s("blocklet.publish.errorTip.noNote")}return""};function F1({blocklet:e,releaseId:t,connectedStores:l,projectId:s,releaseType:r,publishedStoreIds:c,onPublish:i,onDelete:a,projectType:u,componentDid:f,onOpenConnectStore:x,behavior:g,onSelectConnectStore:y}){var S,N;const{t:p}=te(),{actions:{refreshBlocklet:d}}=Ve(),{session:m}=s1(),{storeList:b}=X0({fromBlocklet:!0,blocklet:e,componentDid:f,userDid:(S=m==null?void 0:m.user)==null?void 0:S.did}),v=R.useMemo(()=>l!=null&&l.length?l==null?void 0:l.reduce((T,P)=>(T[P.storeId]=P,T),{}):{},[l]),C=(N=e==null?void 0:e.meta)==null?void 0:N.did;return o.jsxs(o.Fragment,{children:[g==="connect"&&!!(b!=null&&b.length)&&o.jsx(L0,{severity:"info",style:{width:"100%"},children:o.jsxs(z,{color:I2[400],component:"a",href:u==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[p(u==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),o.jsx(q2,{sx:{marginLeft:1}})]})}),o.jsx(R2,{children:b==null?void 0:b.map(T=>o.jsx(W2,{"data-cy":"store-switch",children:o.jsx(G2,{children:o.jsx(H2,{behavior:g,onSelectConnectStore:y,releaseId:t,projectId:s,releaseType:r,kind:"publish",teamDid:C,store:T,published:(c==null?void 0:c.indexOf(T.id))>-1,connectedStore:v[T.id],onPublish:i,onDelete:a,scope:T.scope||"studio",onOpenConnectStore:x})})},T.url))}),o.jsx(N0,{teamDid:C,storeList:b,scope:"studio",onAdd:d})]})}F1.propTypes={blocklet:h.object.isRequired,projectId:h.string.isRequired,releaseId:h.string.isRequired,releaseType:h.string.isRequired,onPublish:h.func,onDelete:h.func,publishedStoreIds:h.arrayOf(h.string),connectedStores:h.arrayOf(h.object).isRequired,projectType:h.string,componentDid:h.string,onOpenConnectStore:h.func,onSelectConnectStore:h.func,behavior:h.string};F1.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};function Z0({did:e,params:t,setParams:l,projectId:s,open:r,onClose:c}){const{t:i}=te(),[a,u]=R.useState(!1),{api:f}=we(),[x,g]=R.useState(!1),[y,p]=R.useState(!1),d=()=>{g(t.autoUpload),p(t.possibleSameStore),u(!1),c(!1)},m=async()=>{u(!0);try{await f.updateProject({input:{did:e,projectId:s,blockletTitle:t.blockletTitle||"",blockletDescription:t.blockletDescription||"",blockletIntroduction:t.blockletIntroduction||"",autoUpload:!!x,possibleSameStore:!!y}}),l({autoUpload:x,possibleSameStore:y}),c(!1)}catch(v){$.error(v.message)}u(!1)};R.useEffect(()=>{g(t.autoUpload),p(t.possibleSameStore)},[t]);const b=!!(s&&s!==X.UNOWNED_DID);return o.jsx(k0,{title:i("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:r,onClose:d,actions:o.jsxs(o.Fragment,{children:[o.jsx(ne,{onClick:v=>{v.stopPropagation(),c()},color:"inherit",children:i("common.cancel")}),b&&o.jsxs(ne,{onClick:v=>{v.stopPropagation(),m()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a,variant:"contained",autoFocus:!0,children:[a&&o.jsx(Oe,{size:16}),i("common.confirm")]})]}),children:b?o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:re,icon:"ph:upload",sx:{fontSize:24,mr:2}}),o.jsx(G,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.autoUploadTip")}),o.jsx(e0,{checked:x,onChange:(v,C)=>g(C)})]}),o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:re,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),o.jsx(G,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.possibleSameStoreTip")}),o.jsx(e0,{checked:y,onChange:(v,C)=>p(C)})]})]}):o.jsxs(z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[o.jsx(z,{component:re,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),o.jsx(G,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.needProjectId")})]})})}Z0.propTypes={did:h.string.isRequired,params:h.object.isRequired,open:h.bool.isRequired,onClose:h.func.isRequired,setParams:h.func.isRequired,projectId:h.string.isRequired};function e2({downloadUrl:e,installUrl:t,handleSetTip:l,isPack:s,disabled:r}){const{t:c}=te(),[i,a]=R.useState(!1),u=R.useRef(null),f=()=>{a(!i)},x=g=>{u.current&&u.current.contains(g.target)||a(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(ne,{disabled:r,ref:u,onClick:f,children:o.jsx(z,{component:re,sx:{fontSize:18},icon:"bxs:download"})}),o.jsx(R0,{sx:{zIndex:10},open:i,anchorEl:u.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:g})=>o.jsx(C0,{...g,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:x,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[s&&o.jsx(z,{component:"a",href:t,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:o.jsxs(Ae,{sx:{color:"#333"},children:[o.jsx(z,{component:re,sx:{mr:1},icon:"ic:round-install-desktop"}),o.jsx(G,{variant:"inherit",children:c("blocklet.publish.installToThisServer")})]})}),o.jsxs(Ae,{onClick:l,children:[o.jsx(z,{component:re,sx:{mr:1},icon:"iconamoon:copy"}),o.jsx(G,{variant:"inherit",children:c("blocklet.publish.copyInstallUrl")})]}),o.jsx(z,{component:"a",href:e,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:o.jsxs(Ae,{sx:{color:"#333"},children:[o.jsx(z,{component:re,sx:{mr:1},icon:"ph:download"}),o.jsx(G,{variant:"inherit",children:c("common.download")})]})})]})})})})})]})}e2.propTypes={disabled:h.bool.isRequired,isPack:h.bool.isRequired,downloadUrl:h.string.isRequired,installUrl:h.string.isRequired,handleSetTip:h.func.isRequired};var v0;const h0=(v0=window.env)==null?void 0:v0.serverEndpoint;function t2({projectId:e,params:t,setParamsErrTip:l,initUrl:s,setParams:r,mode:c,loading:i,blocklet:a,release:u,isPublished:f,releaseId:x,getData:g,getRelease:y,componentDid:p,resourceRelateComponents:d,disabledSelectComponents:m,saveSelectedEventsRef:b,hasSelectedResources:v,initLogoUrl:C,setLoading:S,releaseUsedLast:N,setReleaseUsedLast:T,projectType:P}){var xe;const{t:I,locale:U}=te(),{api:V}=we(),M=v1(),[k,L]=R.useState(!1),[E,B]=R.useState(!1),[O,K]=R.useState(),J=We(q=>q.breakpoints.down("md")),W=R.useMemo(()=>{var q;return((q=t==null?void 0:t.blockletComponents)==null?void 0:q.length)>0?(t==null?void 0:t.blockletComponents.find(H=>H.included))?"resource":"pack":"resource"},[t==null?void 0:t.blockletComponents]),Z=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),y()},Me=async q=>{var Ee,r1,Xe;const le=Y0({params:t,hasSelectedResources:v,projectId:e,status:q,t:I});if(le){$.error(le.map(F=>F.message).join("; ")),l(le.reduce((F,Y)=>({...F,[Y.param]:Y.message}),{}));return}const H={...t};if(H.blockletComponents=t3(H.blockletComponents,a,d,m),H.blockletVersion=Le.valid(H.blockletVersion),!H.blockletVersion){$.error("Invalid Blocklet Version"),l({blockletVersion:"Invalid Blocklet Version"});return}if(C)try{const F=await n3({did:a.meta.did,projectId:e,imageUrl:C});H.blockletLogo=F,r({blockletLogo:F})}catch(F){$.error(F.message);return}if(t.resourceFromSelect){H.uploadedResource="";try{const F=Object.keys(b.current);await t1(F.map(Y=>()=>{const de=b.current[Y];return Ul({api:V,locale:U,projectId:e,releaseId:N?"":x,appDid:a.meta.did,component:de.component,resources:de.resources,initUrl:s})}),{concurrency:2})}catch(F){$.error(((Xe=(r1=(Ee=F==null?void 0:F.response)==null?void 0:Ee.data)==null?void 0:r1.error)==null?void 0:Xe.message)||F.message),l({blockletResource:"Invalid save the resource"});return}}else H.blockletComponents=[];H.blockletTitle=(H.blockletTitle||"").trim(),H.blockletDescription=(H.blockletDescription||"").trim(),H.blockletIntroduction=(H.blockletIntroduction||"").trim(),H.note=(H.note||"").trim(),H.blockletComponents=((H==null?void 0:H.blockletComponents)||[]).filter(F=>F.included).map(F=>g1(F,["did","required"])).map(JSON.stringify);try{await V.createRelease({input:{...H,did:a.meta.did,projectId:e,releaseId:N?"":x,status:q}}),q==="draft"?$.success(I("blocklet.publish.saveDraftSuccess")):(T(!1),$.success(I("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),l({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(F){const Y=Ne(F);$.error(Y),(/resource/.test(Y)||/zip/.test(Y))&&l({blockletResource:Y});return}const Ke=await V.getProject({input:{did:a.meta.did,projectId:e}}),_e=Ke.project.lastReleaseId;t.autoUpload&&await t1(Ke.project.connectedStores.map(F=>async()=>{try{const Y=await V.publishToStore({input:{did:a.meta.did,storeId:F.storeId,storeName:F.storeName,projectId:e,releaseId:_e,type:W}});$.success(o.jsx($2,{storeName:F.storeName,storeUrl:F.storeUrl,developerDid:F.developerDid,published:Y.url==="published"}),{duration:1e4})}catch(Y){$.error(Ne(Y))}}),{concurrency:4}),Z==null||Z(),M(`../${e}/view/${_e}`,{replace:!0})},he=q=>(S(!0),Me(q).finally(()=>{S(!1)})),ce=async q=>{await Jl(V,q),g()},oe=()=>{B(!0)},ee=pe(h0,`/api/project/${a.meta.did}/${e}/${x}/release/blocklet.json`),ie=new URL(h0);ie.pathname=pe(ie.pathname,"/launch-blocklet/agreement"),ie.searchParams.set("blocklet_meta_url",ee);const fe=ie.href,Q=()=>K(ee);return o.jsxs(o.Fragment,{children:[o.jsx(r3,{className:"sticky-header",children:o.jsxs(z,{display:"flex",alignItems:"center",flexDirection:"row",children:[o.jsxs(_0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(ue,{to:"../",children:I("common.blockletStudio")}),e===X.UNOWNED_DID?o.jsx(G,{color:"text.primary",children:o.jsx(be,{maxLength:J?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):o.jsx(ue,{to:`../${e}`,children:o.jsx(be,{maxLength:J?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),o.jsx(G,{color:"text.primary",children:c==="create"?I("common.create"):(t==null?void 0:t.blockletVersion)||I("common.edit")})]}),o.jsx(z,{flex:"1"}),!f&&o.jsxs(h1,{disabled:i,variant:"contained",children:[o.jsxs(ne,{variant:"contained",onClick:()=>he(ye.PROJECT.RELEASE_STATUS.published),children:[i&&o.jsx(Oe,{size:14,sx:{mr:.5},color:"inherit"}),I("blocklet.publish.createRelease")]}),o.jsx(ne,{variant:"contained",onClick:oe,children:o.jsx(re,{icon:"mage:settings-fill",fontSize:"16px"})})]}),f&&o.jsxs(o.Fragment,{children:[o.jsx(C2,{fullWidth:!0,maxWidth:"sm",open:O,onClose:()=>K(""),children:o.jsxs(z,{sx:{py:5,px:4,wordBreak:"break-all"},children:[o.jsx(G,{variant:"h6",sx:{mb:2},children:I("blocklet.publish.installResourceTip")}),o.jsx(U2,{children:O}),o.jsxs(G,{sx:{mt:2},children:[I("blocklet.publish.installResourceTip2"),o.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:I("blocklet.publish.installResourceHelp")})]})]})}),o.jsxs(h1,{disabled:i,variant:"contained",children:[o.jsxs(ne,{onClick:()=>L(!0),children:[i?o.jsx(Oe,{size:14,sx:{mr:1},color:"inherit"}):o.jsx(Q0,{sx:{fontSize:"1.3em",mr:1}}),I(J?"common.upload":"blocklet.publish.connectOrUpload")]}),o.jsx(e2,{isPack:W==="pack",downloadUrl:pe(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${a.meta.did}/${e}/${x}/download/${(u.files||[])[0]}`),installUrl:fe,handleSetTip:Q}),o.jsx(ne,{onClick:oe,children:o.jsx(re,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})}),o.jsx(k0,{title:I("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:k,onClose:()=>L(!1),children:o.jsx(F1,{projectType:P,blocklet:a,releaseType:W,projectId:e,releaseId:x,componentDid:p,onPublish:Z,onOpenConnectStore:ce,onDelete:g,connectedStores:t.connectedStores||[],publishedStoreIds:u==null?void 0:u.publishedStoreIds})}),o.jsx(Z0,{did:(xe=a==null?void 0:a.meta)==null?void 0:xe.did,params:t,projectId:e,open:E,setParams:r,onClose:()=>B(!1)})]})}t2.propTypes={projectId:h.string.isRequired,params:h.object.isRequired,mode:h.string.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,release:h.object.isRequired,isPublished:h.bool.isRequired,releaseId:h.string.isRequired,getData:h.func.isRequired,getRelease:h.func.isRequired,componentDid:h.string.isRequired,resourceRelateComponents:h.object.isRequired,disabledSelectComponents:h.bool.isRequired,saveSelectedEventsRef:h.object.isRequired,hasSelectedResources:h.bool.isRequired,initLogoUrl:h.string.isRequired,setLoading:h.func.isRequired,releaseUsedLast:h.bool.isRequired,setReleaseUsedLast:h.func.isRequired,projectType:h.string.isRequired,setParamsErrTip:h.func.isRequired,setParams:h.func.isRequired,initUrl:h.object.isRequired};const r3=ae.div`
|
|
167
|
+
`;var $1={},Yl=ke;Object.defineProperty($1,"__esModule",{value:!0});var Q0=$1.default=void 0,Zl=Yl(Se()),e3=o;Q0=$1.default=(0,Zl.default)((0,e3.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const t3=(e,t,l,s)=>{const r=e?[...e]:[],c=((t==null?void 0:t.children)||[]).reduce((i,a)=>(i[a.meta.did]=!0,i),{});return Object.keys(l).forEach(i=>{if(!c[i])return;let a=!1;s||r.forEach(u=>{u.did===i&&(u.included=!0,u.required=!0,a=!0)}),a||r.push({did:i,included:!0,required:!0})}),r},o3=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],s=await(await fetch(e)).blob();return new File([s],t,{type:s.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*l3(e,t){let l=0;for(;l<e.size;)yield e.slice(l,l+t),l+=t}const n3=async({did:e,projectId:t,uploadType:l="logo",imageUrl:s})=>{const r=await o3(s);new FormData().append("file",r);const i={uploaderId:"Uploader",relativePath:encodeURIComponent(r.name),name:encodeURIComponent(r.name),type:r.type},u=(await Q1.post(pe(X.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,l,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":r.size,"X-Uploader-File-Ext":r.name.split(".").pop(),"Upload-Metadata":Object.keys(i).map(y=>`${y} ${btoa(i[y])}`).join(",")}})).headers.location,f=2*1024*1024;let x=0,g="";for(const y of l3(r,f)){const p=await Q1.patch(pe(X.WELLKNOWN_SERVICE_PATH_PREFIX,u),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":x,"Content-Type":"application/offset+octet-stream"}});x+=y.size,g=p.data.filename}return g},Y0=({params:e,hasSelectedResources:t,projectId:l,status:s,t:r})=>{const c=[];return e.blockletTitle||c.push({param:"blockletTitle",message:r("blocklet.publish.errorTip.noTitle")}),(!l||l===X.UNOWNED_DID)&&c.push({param:"projectId",message:r("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&c.push({param:"blockletResource",message:r("blocklet.publish.errorTip.noResource")}),e.blockletVersion?Le.valid(e.blockletVersion)||c.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.inValidVersion")}):c.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.noVersion")}),s===ye.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||c.push({param:"blockletDescription",message:r("blocklet.publish.errorTip.noDescription")}),e.note||c.push({param:"note",message:r("blocklet.publish.errorTip.noNote")})),c.length?c:null},s3=({params:e,hasSelectedResources:t,step:l,t:s,projectId:r})=>{if(l===0){if(!e.blockletTitle)return s("blocklet.publish.errorTip.noTitle");if(!r||r===X.UNOWNED_DID)return s("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return s("blocklet.publish.errorTip.noDescription")}if(l===2&&!e.uploadedResource&&!t)return s("blocklet.publish.errorTip.noResource");if(l>=4){if(!e.blockletVersion)return s("blocklet.publish.errorTip.noVersion");if(!Le.valid(e.blockletVersion))return s("blocklet.publish.errorTip.inValidVersion");if(!e.note)return s("blocklet.publish.errorTip.noNote")}return""};function F1({blocklet:e,releaseId:t,connectedStores:l,projectId:s,releaseType:r,publishedStoreIds:c,onPublish:i,onDelete:a,projectType:u,componentDid:f,onOpenConnectStore:x,behavior:g,onSelectConnectStore:y}){var S,N;const{t:p}=te(),{actions:{refreshBlocklet:d}}=Ve(),{session:m}=s1(),{storeList:b}=X0({fromBlocklet:!0,blocklet:e,componentDid:f,userDid:(S=m==null?void 0:m.user)==null?void 0:S.did}),v=R.useMemo(()=>l!=null&&l.length?l==null?void 0:l.reduce((T,P)=>(T[P.storeId]=P,T),{}):{},[l]),C=(N=e==null?void 0:e.meta)==null?void 0:N.did;return o.jsxs(o.Fragment,{children:[g==="connect"&&!!(b!=null&&b.length)&&o.jsx(L0,{severity:"info",style:{width:"100%"},children:o.jsxs(z,{color:M2[400],component:"a",href:u==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[p(u==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),o.jsx(W2,{sx:{marginLeft:1}})]})}),o.jsx(R2,{children:b==null?void 0:b.map(T=>o.jsx(G2,{"data-cy":"store-switch",children:o.jsx(k2,{children:o.jsx($2,{behavior:g,onSelectConnectStore:y,releaseId:t,projectId:s,releaseType:r,kind:"publish",teamDid:C,store:T,published:(c==null?void 0:c.indexOf(T.id))>-1,connectedStore:v[T.id],onPublish:i,onDelete:a,scope:T.scope||"studio",onOpenConnectStore:x})})},T.url))}),o.jsx(N0,{teamDid:C,storeList:b,scope:"studio",onAdd:d})]})}F1.propTypes={blocklet:h.object.isRequired,projectId:h.string.isRequired,releaseId:h.string.isRequired,releaseType:h.string.isRequired,onPublish:h.func,onDelete:h.func,publishedStoreIds:h.arrayOf(h.string),connectedStores:h.arrayOf(h.object).isRequired,projectType:h.string,componentDid:h.string,onOpenConnectStore:h.func,onSelectConnectStore:h.func,behavior:h.string};F1.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};function Z0({did:e,params:t,setParams:l,projectId:s,open:r,onClose:c}){const{t:i}=te(),[a,u]=R.useState(!1),{api:f}=we(),[x,g]=R.useState(!1),[y,p]=R.useState(!1),d=()=>{g(t.autoUpload),p(t.possibleSameStore),u(!1),c(!1)},m=async()=>{u(!0);try{await f.updateProject({input:{did:e,projectId:s,blockletTitle:t.blockletTitle||"",blockletDescription:t.blockletDescription||"",blockletIntroduction:t.blockletIntroduction||"",autoUpload:!!x,possibleSameStore:!!y}}),l({autoUpload:x,possibleSameStore:y}),c(!1)}catch(v){$.error(v.message)}u(!1)};R.useEffect(()=>{g(t.autoUpload),p(t.possibleSameStore)},[t]);const b=!!(s&&s!==X.UNOWNED_DID);return o.jsx(k0,{title:i("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:r,onClose:d,actions:o.jsxs(o.Fragment,{children:[o.jsx(ne,{onClick:v=>{v.stopPropagation(),c()},color:"inherit",children:i("common.cancel")}),b&&o.jsxs(ne,{onClick:v=>{v.stopPropagation(),m()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a,variant:"contained",autoFocus:!0,children:[a&&o.jsx(Oe,{size:16}),i("common.confirm")]})]}),children:b?o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:re,icon:"ph:upload",sx:{fontSize:24,mr:2}}),o.jsx(G,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.autoUploadTip")}),o.jsx(e0,{checked:x,onChange:(v,C)=>g(C)})]}),o.jsxs(z,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[o.jsx(z,{component:re,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),o.jsx(G,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.possibleSameStoreTip")}),o.jsx(e0,{checked:y,onChange:(v,C)=>p(C)})]})]}):o.jsxs(z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[o.jsx(z,{component:re,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),o.jsx(G,{variant:"body1",sx:{flex:1},children:i("blocklet.publish.needProjectId")})]})})}Z0.propTypes={did:h.string.isRequired,params:h.object.isRequired,open:h.bool.isRequired,onClose:h.func.isRequired,setParams:h.func.isRequired,projectId:h.string.isRequired};function e2({downloadUrl:e,installUrl:t,handleSetTip:l,isPack:s,disabled:r}){const{t:c}=te(),[i,a]=R.useState(!1),u=R.useRef(null),f=()=>{a(!i)},x=g=>{u.current&&u.current.contains(g.target)||a(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(ne,{disabled:r,ref:u,onClick:f,children:o.jsx(z,{component:re,sx:{fontSize:18},icon:"bxs:download"})}),o.jsx(R0,{sx:{zIndex:10},open:i,anchorEl:u.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:g})=>o.jsx(C0,{...g,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:x,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[s&&o.jsx(z,{component:"a",href:t,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:o.jsxs(Ae,{sx:{color:"#333"},children:[o.jsx(z,{component:re,sx:{mr:1},icon:"ic:round-install-desktop"}),o.jsx(G,{variant:"inherit",children:c("blocklet.publish.installToThisServer")})]})}),o.jsxs(Ae,{onClick:l,children:[o.jsx(z,{component:re,sx:{mr:1},icon:"iconamoon:copy"}),o.jsx(G,{variant:"inherit",children:c("blocklet.publish.copyInstallUrl")})]}),o.jsx(z,{component:"a",href:e,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:o.jsxs(Ae,{sx:{color:"#333"},children:[o.jsx(z,{component:re,sx:{mr:1},icon:"ph:download"}),o.jsx(G,{variant:"inherit",children:c("common.download")})]})})]})})})})})]})}e2.propTypes={disabled:h.bool.isRequired,isPack:h.bool.isRequired,downloadUrl:h.string.isRequired,installUrl:h.string.isRequired,handleSetTip:h.func.isRequired};var v0;const h0=(v0=window.env)==null?void 0:v0.serverEndpoint;function t2({projectId:e,params:t,setParamsErrTip:l,initUrl:s,setParams:r,mode:c,loading:i,blocklet:a,release:u,isPublished:f,releaseId:x,getData:g,getRelease:y,componentDid:p,resourceRelateComponents:d,disabledSelectComponents:m,saveSelectedEventsRef:b,hasSelectedResources:v,initLogoUrl:C,setLoading:S,releaseUsedLast:N,setReleaseUsedLast:T,projectType:P}){var xe;const{t:I,locale:U}=te(),{api:V}=we(),M=v1(),[k,L]=R.useState(!1),[E,B]=R.useState(!1),[O,K]=R.useState(),J=We(q=>q.breakpoints.down("md")),W=R.useMemo(()=>{var q;return((q=t==null?void 0:t.blockletComponents)==null?void 0:q.length)>0?(t==null?void 0:t.blockletComponents.find(H=>H.included))?"resource":"pack":"resource"},[t==null?void 0:t.blockletComponents]),Z=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),y()},Me=async q=>{var Ee,r1,Xe;const le=Y0({params:t,hasSelectedResources:v,projectId:e,status:q,t:I});if(le){$.error(le.map(F=>F.message).join("; ")),l(le.reduce((F,Y)=>({...F,[Y.param]:Y.message}),{}));return}const H={...t};if(H.blockletComponents=t3(H.blockletComponents,a,d,m),H.blockletVersion=Le.valid(H.blockletVersion),!H.blockletVersion){$.error("Invalid Blocklet Version"),l({blockletVersion:"Invalid Blocklet Version"});return}if(C)try{const F=await n3({did:a.meta.did,projectId:e,imageUrl:C});H.blockletLogo=F,r({blockletLogo:F})}catch(F){$.error(F.message);return}if(t.resourceFromSelect){H.uploadedResource="";try{const F=Object.keys(b.current);await t1(F.map(Y=>()=>{const de=b.current[Y];return Ul({api:V,locale:U,projectId:e,releaseId:N?"":x,appDid:a.meta.did,component:de.component,resources:de.resources,initUrl:s})}),{concurrency:2})}catch(F){$.error(((Xe=(r1=(Ee=F==null?void 0:F.response)==null?void 0:Ee.data)==null?void 0:r1.error)==null?void 0:Xe.message)||F.message),l({blockletResource:"Invalid save the resource"});return}}else H.blockletComponents=[];H.blockletTitle=(H.blockletTitle||"").trim(),H.blockletDescription=(H.blockletDescription||"").trim(),H.blockletIntroduction=(H.blockletIntroduction||"").trim(),H.note=(H.note||"").trim(),H.blockletComponents=((H==null?void 0:H.blockletComponents)||[]).filter(F=>F.included).map(F=>g1(F,["did","required"])).map(JSON.stringify);try{await V.createRelease({input:{...H,did:a.meta.did,projectId:e,releaseId:N?"":x,status:q}}),q==="draft"?$.success(I("blocklet.publish.saveDraftSuccess")):(T(!1),$.success(I("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),l({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(F){const Y=Ne(F);$.error(Y),(/resource/.test(Y)||/zip/.test(Y))&&l({blockletResource:Y});return}const Ke=await V.getProject({input:{did:a.meta.did,projectId:e}}),_e=Ke.project.lastReleaseId;t.autoUpload&&await t1(Ke.project.connectedStores.map(F=>async()=>{try{const Y=await V.publishToStore({input:{did:a.meta.did,storeId:F.storeId,storeName:F.storeName,projectId:e,releaseId:_e,type:W}});$.success(o.jsx(F2,{storeName:F.storeName,storeUrl:F.storeUrl,developerDid:F.developerDid,published:Y.url==="published"}),{duration:1e4})}catch(Y){$.error(Ne(Y))}}),{concurrency:4}),Z==null||Z(),M(`../${e}/view/${_e}`,{replace:!0})},he=q=>(S(!0),Me(q).finally(()=>{S(!1)})),ce=async q=>{await Jl(V,q),g()},oe=()=>{B(!0)},ee=pe(h0,`/api/project/${a.meta.did}/${e}/${x}/release/blocklet.json`),ie=new URL(h0);ie.pathname=pe(ie.pathname,"/launch-blocklet/agreement"),ie.searchParams.set("blocklet_meta_url",ee);const fe=ie.href,Q=()=>K(ee);return o.jsxs(o.Fragment,{children:[o.jsx(r3,{className:"sticky-header",children:o.jsxs(z,{display:"flex",alignItems:"center",flexDirection:"row",children:[o.jsxs(_0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(ue,{to:"../",children:I("common.blockletStudio")}),e===X.UNOWNED_DID?o.jsx(G,{color:"text.primary",children:o.jsx(be,{maxLength:J?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):o.jsx(ue,{to:`../${e}`,children:o.jsx(be,{maxLength:J?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),o.jsx(G,{color:"text.primary",children:c==="create"?I("common.create"):(t==null?void 0:t.blockletVersion)||I("common.edit")})]}),o.jsx(z,{flex:"1"}),!f&&o.jsxs(h1,{disabled:i,variant:"contained",children:[o.jsxs(ne,{variant:"contained",onClick:()=>he(ye.PROJECT.RELEASE_STATUS.published),children:[i&&o.jsx(Oe,{size:14,sx:{mr:.5},color:"inherit"}),I("blocklet.publish.createRelease")]}),o.jsx(ne,{variant:"contained",onClick:oe,children:o.jsx(re,{icon:"mage:settings-fill",fontSize:"16px"})})]}),f&&o.jsxs(o.Fragment,{children:[o.jsx(C2,{fullWidth:!0,maxWidth:"sm",open:O,onClose:()=>K(""),children:o.jsxs(z,{sx:{py:5,px:4,wordBreak:"break-all"},children:[o.jsx(G,{variant:"h6",sx:{mb:2},children:I("blocklet.publish.installResourceTip")}),o.jsx(q2,{children:O}),o.jsxs(G,{sx:{mt:2},children:[I("blocklet.publish.installResourceTip2"),o.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:I("blocklet.publish.installResourceHelp")})]})]})}),o.jsxs(h1,{disabled:i,variant:"contained",children:[o.jsxs(ne,{onClick:()=>L(!0),children:[i?o.jsx(Oe,{size:14,sx:{mr:1},color:"inherit"}):o.jsx(Q0,{sx:{fontSize:"1.3em",mr:1}}),I(J?"common.upload":"blocklet.publish.connectOrUpload")]}),o.jsx(e2,{isPack:W==="pack",downloadUrl:pe(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${a.meta.did}/${e}/${x}/download/${(u.files||[])[0]}`),installUrl:fe,handleSetTip:Q}),o.jsx(ne,{onClick:oe,children:o.jsx(re,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})}),o.jsx(k0,{title:I("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:k,onClose:()=>L(!1),children:o.jsx(F1,{projectType:P,blocklet:a,releaseType:W,projectId:e,releaseId:x,componentDid:p,onPublish:Z,onOpenConnectStore:ce,onDelete:g,connectedStores:t.connectedStores||[],publishedStoreIds:u==null?void 0:u.publishedStoreIds})}),o.jsx(Z0,{did:(xe=a==null?void 0:a.meta)==null?void 0:xe.did,params:t,projectId:e,open:E,setParams:r,onClose:()=>B(!1)})]})}t2.propTypes={projectId:h.string.isRequired,params:h.object.isRequired,mode:h.string.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,release:h.object.isRequired,isPublished:h.bool.isRequired,releaseId:h.string.isRequired,getData:h.func.isRequired,getRelease:h.func.isRequired,componentDid:h.string.isRequired,resourceRelateComponents:h.object.isRequired,disabledSelectComponents:h.bool.isRequired,saveSelectedEventsRef:h.object.isRequired,hasSelectedResources:h.bool.isRequired,initLogoUrl:h.string.isRequired,setLoading:h.func.isRequired,releaseUsedLast:h.bool.isRequired,setReleaseUsedLast:h.func.isRequired,projectType:h.string.isRequired,setParamsErrTip:h.func.isRequired,setParams:h.func.isRequired,initUrl:h.object.isRequired};const r3=ae.div`
|
|
168
168
|
.sticky-header {
|
|
169
169
|
margin-top: -12px;
|
|
170
170
|
padding: 12px 0;
|
|
@@ -178,7 +178,7 @@ import{at as d2,j as o,aG as se,cP as g0,aK as A,fE as X1,aJ as je,aE as $e,aF a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function o2({text:e}){return e?o.jsx(K2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[X2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(L2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},i3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,a3=i3(Se()),f0=o;n2=U1.default=(0,a3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(J2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Y2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!s3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Z2,{children:[o.jsx(bt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(zt,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const c3=[".zip",".gz"],d3=1024*1024*100,u3=R.lazy(()=>S0(()=>import("./react-87q4e1zg.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(et,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(u3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c3,maxFileSize:d3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const p3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},h3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{p3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=y2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=h3[Z];return o.jsxs(f3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(P2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(tt,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(T2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const f3=ae.div`
|
|
181
|
+
`;function o2({text:e}){return e?o.jsx(K2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[X2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(T2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},i3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,a3=i3(Se()),f0=o;n2=U1.default=(0,a3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(J2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Y2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!s3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Z2,{children:[o.jsx(bt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(zt,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const c3=[".zip",".gz"],d3=1024*1024*100,u3=R.lazy(()=>S0(()=>import("./react-B76g6xcQ.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(et,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(u3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c3,maxFileSize:d3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const p3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},h3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{p3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=y2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=h3[Z];return o.jsxs(f3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(L2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(tt,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(N2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const f3=ae.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|