@abtnode/blocklet-services 1.16.29 → 1.16.30-beta-00e8bdd1
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/index.js +2 -0
- package/api/routes/openembed.js +164 -0
- package/dist/assets/{Add-B2tTKEMF.js → Add-BN237Fn5.js} +1 -1
- package/dist/assets/{AddBox-B_ujO0_p.js → AddBox-3LaPVxwU.js} +1 -1
- package/dist/assets/{Alert-Dpm7qDYx.js → Alert-D6ASJuaD.js} +1 -1
- package/dist/assets/{ArrowDropDown-Bbuyv1lE.js → ArrowDropDown-BHT7uJ-_.js} +1 -1
- package/dist/assets/{Avatar-BUFa3I7L.js → Avatar-CaF_-TIa.js} +1 -1
- package/dist/assets/{ButtonGroup-Dy_3TNWh.js → ButtonGroup-BJxGB-mf.js} +1 -1
- package/dist/assets/{CheckCircle-CJm2emkm.js → CheckCircle-CczUamTZ.js} +1 -1
- package/dist/assets/{ChevronRight-86t7cTOH.js → ChevronRight-Cg14uJfK.js} +1 -1
- package/dist/assets/{Close-BYk04MBB.js → Close-x7Tkk0S3.js} +1 -1
- package/dist/assets/{CloseOutlined-J2mzxYfr.js → CloseOutlined-QOb8qkQe.js} +1 -1
- package/dist/assets/{Delete-B9GqJi6E.js → Delete-C6X9S_ep.js} +1 -1
- package/dist/assets/{DeleteOutline-4tV22N5G.js → DeleteOutline-DPoIruJ5.js} +1 -1
- package/dist/assets/{Done-COFqGl-V.js → Done-CoG4jV3h.js} +1 -1
- package/dist/assets/{Download-BN2qoa8L.js → Download-CgS76hkn.js} +1 -1
- package/dist/assets/{Edit-MwMrwmSL.js → Edit-CuIVEZdJ.js} +1 -1
- package/dist/assets/{EditIcon-BXD4Yp7Y.js → EditIcon-Ca6HYpZk.js} +1 -1
- package/dist/assets/{Error-BPziGUer.js → Error-DPYTfE3e.js} +1 -1
- package/dist/assets/{ExpandMore-Bndw6T5W.js → ExpandMore-D04IjVlX.js} +1 -1
- package/dist/assets/{FilterList-Drg2vaRW.js → FilterList-DUOw_RoL.js} +5 -5
- package/dist/assets/{FormControl-DPMPTS0i.js → FormControl-Bh9aSU12.js} +1 -1
- package/dist/assets/{FormControlLabel-BEUPUFZZ.js → FormControlLabel-BpMix3qK.js} +1 -1
- package/dist/assets/FormGroup-BfB-iN7c.js +1 -0
- package/dist/assets/{Google-CW7wCZhn.js → Google-DIEocVvQ.js} +4 -4
- package/dist/assets/{Hidden-rBUI7TaF.js → Hidden-BLcFQ9WU.js} +1 -1
- package/dist/assets/{InfoOutlined-BeHnOzxv.js → InfoOutlined-C5vT7BTM.js} +1 -1
- package/dist/assets/{InputAdornment-dFvDjSPj.js → InputAdornment-4EnHL3SV.js} +1 -1
- package/dist/assets/{InputLabel-Cr2F0wL_.js → InputLabel-BY35PBOn.js} +1 -1
- package/dist/assets/{LastPage-BsSK0r__.js → LastPage-DSqwop6h.js} +1 -1
- package/dist/assets/{Launch-DpNNGEN3.js → Launch-BYwPKhG2.js} +1 -1
- package/dist/assets/{LaunchOutlined-CRtlq0AR.js → LaunchOutlined-DkrAS-ts.js} +1 -1
- package/dist/assets/{Link-R_Yn6p48.js → Link-CHkL2_F8.js} +1 -1
- package/dist/assets/{ListItemText-CBTf5ICv.js → ListItemText-TxfvzIQH.js} +1 -1
- package/dist/assets/{LoadingButton-BoQb-s6Y.js → LoadingButton-_EYRn4Wx.js} +1 -1
- package/dist/assets/{LockIcon-w57uKQ3n.js → LockIcon-Bz8VQwMT.js} +1 -1
- package/dist/assets/{Loop-BTr7nsa4.js → Loop-D0mtfhOu.js} +1 -1
- package/dist/assets/{MoreVert-CrVGyEb1.js → MoreVert-xcNzKdjG.js} +1 -1
- package/dist/assets/{OpenInNew-Bwk37Gfj.js → OpenInNew-DLQ33Rpf.js} +1 -1
- package/dist/assets/{Pagination-YU3tVxJ_.js → Pagination-IIYxtOn3.js} +1 -1
- package/dist/assets/{PlayArrow-BJoSmHTy.js → PlayArrow-BdFq1DDL.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-BrwbMFMj.js → QuestionMarkCircle-BfRCnC--.js} +1 -1
- package/dist/assets/{RadioGroup-D3rZMCGA.js → RadioGroup-sdHfzBzc.js} +1 -1
- package/dist/assets/{Search-c39KP22B.js → Search-Dg-t_NHQ.js} +1 -1
- package/dist/assets/{Select-DmK_UTE4.js → Select-0bmPPjw1.js} +1 -1
- package/dist/assets/{ServerLogo-D0823EKu.js → ServerLogo-CXDpSA8g.js} +1 -1
- package/dist/assets/{Skeleton-DN0tRP6u.js → Skeleton-DuHnu_TW.js} +4 -4
- package/dist/assets/{Slider-C_ldMI6V.js → Slider-DaijA7CN.js} +1 -1
- package/dist/assets/{Stepper-2xT4uG_5.js → Stepper-QmSO1CtE.js} +1 -1
- package/dist/assets/{TextField-Bkhn_ICi.js → TextField-BBIigLRk.js} +1 -1
- package/dist/assets/{Toolbar-C0HRONVo.js → Toolbar-DT4-YRKk.js} +1 -1
- package/dist/assets/{ViewList-Bk6tK-64.js → ViewList-BU2uRr73.js} +1 -1
- package/dist/assets/access-control-C4ERDDDO.js +13 -0
- package/dist/assets/{actions-D4k69_We.js → actions-Ds_jVVND.js} +1 -1
- package/dist/assets/{add-component-core-B0AEX2FM.js → add-component-core-CCOhSWQB.js} +1 -1
- package/dist/assets/add-resource-Do98YBVD.js +1 -0
- package/dist/assets/{addon-B5MwpZhH.js → addon-BcSb2Zzp.js} +1 -1
- package/dist/assets/{analytics-EroCOImH.js → analytics-Ce187M51.js} +6 -6
- package/dist/assets/api-CWevC1Kw.js +1 -0
- package/dist/assets/{ar-D-8bmv2Q.js → ar-CYspPmSu.js} +1 -1
- package/dist/assets/{audit-logs-Drk8FNek.js → audit-logs-LoED-8gk.js} +1 -1
- package/dist/assets/{button-D1lJuSFs.js → button-Dfb9hD8n.js} +1 -1
- package/dist/assets/{click-to-copy-DEiZxYJs.js → click-to-copy-D62iwIju.js} +1 -1
- package/dist/assets/{complete-Cdfx9nd9.js → complete-CRtPvgDa.js} +2 -2
- package/dist/assets/{component-BV7xH0dQ.js → component-BS6BClYg.js} +45 -45
- package/dist/assets/{config-BX1_V_Zk.js → config-2JcKGcTt.js} +2 -2
- package/dist/assets/{config-ndRRaW6N.js → config-DRlEBb7g.js} +1 -1
- package/dist/assets/{config-navigation-BESD8UIe.js → config-navigation-BecqFtHY.js} +1 -1
- package/dist/assets/{confirm-D0ewRRow.js → confirm-DK53kjF4.js} +1 -1
- package/dist/assets/{connect-Bf6AtQ9N.js → connect-BSc706Qe.js} +1 -1
- package/dist/assets/{connect-CuJeZswg.js → connect-CmVMyWtw.js} +1 -1
- package/dist/assets/{connect-to-CJW-XMyq.js → connect-to-B7lXTaqa.js} +2 -2
- package/dist/assets/{content-layout-gVbqQFw2.js → content-layout-fifpb2hF.js} +1 -1
- package/dist/assets/{dashboard-Dqyu1z0z.js → dashboard-zGeemO7s.js} +3 -3
- package/dist/assets/{de-BXUm1QYV.js → de-DIG5UukX.js} +1 -1
- package/dist/assets/{did-address-CNBFLmND.js → did-address-CuLpyDcV.js} +1 -1
- package/dist/assets/{domain-BeQX5z9S.js → domain-Eb-kKi8N.js} +1 -1
- package/dist/assets/{domain-list-Ci50sEhN.js → domain-list-B2eOAUf9.js} +2 -2
- package/dist/assets/{es-CH6tZGrR.js → es-iIE-oygq.js} +1 -1
- package/dist/assets/{exchange-passport-iiwCGzBP.js → exchange-passport-D5yUNMgm.js} +1 -1
- package/dist/assets/{fallback-AxhiHbBa.js → fallback-DnwN40Eu.js} +1 -1
- package/dist/assets/{format-error-BvsdhOPE.js → format-error-eqRBGF1p.js} +2 -2
- package/dist/assets/{fr-roccVFT3.js → fr-D8XyKysR.js} +1 -1
- package/dist/assets/{fuel-xzXBP1hL.js → fuel-DL8WMBx8.js} +1 -1
- package/dist/assets/{fullpage-okV_7hyQ.js → fullpage-4QhjDOeH.js} +1 -1
- package/dist/assets/{hi-VN-lZj6f.js → hi-C12r029w.js} +1 -1
- package/dist/assets/{home-BbZvooYM.js → home-BWibX2vn.js} +1 -1
- package/dist/assets/{id-C-ovCb8b.js → id-BM1nX889.js} +1 -1
- package/dist/assets/{iframe-BCrCaSL7.js → iframe-BmoLkGVE.js} +1 -1
- package/dist/assets/{index-CP2d3Av1.js → index-AiTSrLp-.js} +1 -1
- package/dist/assets/{index-DnjdsAXn.js → index-BEHMH1Pr.js} +1 -1
- package/dist/assets/{index-Cp_VQSnB.js → index-BLek-3-t.js} +12 -12
- package/dist/assets/{index-DN_A6H1f.js → index-BN8ZIYdG.js} +1 -1
- package/dist/assets/{index-BUCbH5ql.js → index-BU0saRrz.js} +7 -7
- package/dist/assets/{index-U0futuIe.js → index-Bg9DIh8M.js} +1 -1
- package/dist/assets/{index-4972Ig28.js → index-Bhy-Ufb6.js} +1 -1
- package/dist/assets/{index-oJ0qFAnh.js → index-Bp8EriMk.js} +1 -1
- package/dist/assets/{index-BeqdHb1K.js → index-BykkL-cr.js} +1 -1
- package/dist/assets/{index-C6Gfmuv5.js → index-C7BxfHre.js} +1 -1
- package/dist/assets/index-CCgZIcqf.js +16 -0
- package/dist/assets/index-CJ9qEL1_.js +262 -0
- package/dist/assets/{index-C0C8sj0f.js → index-CKBTEFra.js} +1 -1
- package/dist/assets/{index-RoEjkyyY.js → index-CQ5dtdkj.js} +122 -122
- package/dist/assets/{index-GxRfisAA.js → index-CTW4nb9G.js} +1 -1
- package/dist/assets/{index-CoH56Uqf.js → index-CekjYFHx.js} +1 -1
- package/dist/assets/index-CoBC9oVU.js +54 -0
- package/dist/assets/{index-BDo-QYGM.js → index-CuX6Kr95.js} +1 -1
- package/dist/assets/{index-DK_iQDKo.js → index-Cxiv-wGv.js} +1 -1
- package/dist/assets/{index-D7gdkTd_.js → index-D0sxPxR3.js} +1 -1
- package/dist/assets/{index-CJRQAR_e.js → index-DIJWsYQq.js} +1 -1
- package/dist/assets/{index-BuKpBFXJ.js → index-Dbbnbznm.js} +1 -1
- package/dist/assets/{index-DRw1PpfG.js → index-DdoI0wbz.js} +1 -1
- package/dist/assets/{index-DDLwOMuE.js → index-DkVlOvts.js} +2 -2
- package/dist/assets/{index-Cxy6HL90.js → index-DpuZJtBf.js} +4 -4
- package/dist/assets/{index-De6Naxqp.js → index-DuOVToRf.js} +1 -1
- package/dist/assets/{index-DjRZjTaR.js → index-FHIuVSDt.js} +1 -1
- package/dist/assets/index-QDFDl478.js +288 -0
- package/dist/assets/{index-Bqq3wHbl.js → index-QU1KoDg_.js} +1 -1
- package/dist/assets/{index-BYqabJ7u.js → index-UZz8l3in.js} +8 -8
- package/dist/assets/{index-zsXw46EV.js → index-dIqjPoOB.js} +4 -4
- package/dist/assets/{index-lriS0sBo.js → index-iEN5H5Ls.js} +1 -1
- package/dist/assets/{index.es-CXIzaenE.js → index.es-BJiRNQw2.js} +1 -1
- package/dist/assets/{index.esm-BHld0R34.js → index.esm-DCtFyquI.js} +1 -1
- package/dist/assets/{invitation-w8YedKTy.js → invitation-CWO1OGzi.js} +8 -8
- package/dist/assets/invite-BybXZqJ_.js +10 -0
- package/dist/assets/issue-passport-_8jsDZ5J.js +1 -0
- package/dist/assets/{item-DE26aStl.js → item-_msBYiLo.js} +1 -1
- package/dist/assets/{ja-D-sN9ij0.js → ja-D8yfIRFO.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-BdIs7KPF.js → jss-plugin-props-sort.esm-CuwRRnMZ.js} +4 -4
- package/dist/assets/{ko-DFpbqZ_Q.js → ko-BYDKCXC0.js} +1 -1
- package/dist/assets/{launch-result-message-CaevuCfD.js → launch-result-message-nnQ4Z0fd.js} +1 -1
- package/dist/assets/{layout-DL9ESJOH.js → layout-0mxgsXb8.js} +1 -1
- package/dist/assets/{list-header-Ds_unX2d.js → list-header-CbhWtFvh.js} +1 -1
- package/dist/assets/localization-Ck45g-8d.js +1 -0
- package/dist/assets/{log-Dxy_6gha.js → log-ydyp6rKH.js} +8 -8
- package/dist/assets/{login-CAqDnaRd.js → login-CgXrWK_2.js} +1 -1
- package/dist/assets/{login-oauth-callback-DYXwpvqB.js → login-oauth-callback-B-Y4WGSI.js} +1 -1
- package/dist/assets/{logo-uploader-DJ-jwxYK.js → logo-uploader-B0LO5vvb.js} +3 -3
- package/dist/assets/{lost-passport-Dgwel0md.js → lost-passport-BhsqypQO.js} +3 -3
- package/dist/assets/{lottie-DqVCevwM.js → lottie-DadbWVpc.js} +1 -1
- package/dist/assets/notifications-DuPGt4pQ.js +62 -0
- package/dist/assets/{open-window-Cxc_Ng-U.js → open-window-CrkLeex9.js} +1 -1
- package/dist/assets/overview-Y5W0VfGN.js +12 -0
- package/dist/assets/{page-header-Dj8RNld9.js → page-header-CSU48K3Q.js} +1 -1
- package/dist/assets/{permission-D-DD_G6T.js → permission-BNHM2xAP.js} +1 -1
- package/dist/assets/{preferences-l2R71Kr4.js → preferences-Ccc7r_v8.js} +1 -1
- package/dist/assets/{pt-BXC7UTMq.js → pt-B9DRiZEN.js} +1 -1
- package/dist/assets/publish-resource-BfHdYGQt.js +1 -0
- package/dist/assets/{react-ChRfz7rm.js → react-Z_lC3NCb.js} +3 -3
- package/dist/assets/{redux-BzBcp8M-.js → redux-Nz09j_eP.js} +1 -1
- package/dist/assets/{resource-dialog-BL0PXuZY.js → resource-dialog-TfZOe9lD.js} +1 -1
- package/dist/assets/{ru-BbD1NNUC.js → ru-CUxGgO8D.js} +1 -1
- package/dist/assets/sdk-DtesNhKW.js +1 -0
- package/dist/assets/{selector-DM39G-IG.js → selector-Bbx9AGcC.js} +3 -3
- package/dist/assets/session-CPBKqm92.js +1 -0
- package/dist/assets/{setup-BpjY2WnV.js → setup-ClQU62xP.js} +3 -3
- package/dist/assets/{shorten-label-CBUJuv2z.js → shorten-label-BlugIeNc.js} +1 -1
- package/dist/assets/{slicedToArray-D3qT2xrr.js → slicedToArray-BDmAXaQb.js} +2 -2
- package/dist/assets/{spaces-Dy94Pppx.js → spaces-0FuTU5il.js} +1 -1
- package/dist/assets/{start-B5SkjHxA.js → start-BF5svAaM.js} +1 -1
- package/dist/assets/{step-actions-lNBluf34.js → step-actions-RI-mCX0p.js} +1 -1
- package/dist/assets/{studio-Dyzo9gvw.js → studio-Bjf7gAq8.js} +1 -1
- package/dist/assets/{switch-control-BZoRefS-.js → switch-control-C1_R7-zR.js} +1 -1
- package/dist/assets/{th-VkDcmE_T.js → th-D6abaOt7.js} +1 -1
- package/dist/assets/{toUpper-qfNUvmkW.js → toUpper-uyyCk01r.js} +1 -1
- package/dist/assets/{transfer-DMokNRYm.js → transfer-DkniK5Ag.js} +1 -1
- package/dist/assets/{uniqBy-DER8YBQ7.js → uniqBy-nqPJ5tkT.js} +1 -1
- package/dist/assets/{unsubscribe-B_tAr5rg.js → unsubscribe-BAK1nb4o.js} +1 -1
- package/dist/assets/{url-join-CDpgNuEj.js → url-join-xP4FWyyN.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-lPpkEES7.js → use-blocklet-info-for-connect-did-spaces-ChbGnu2B.js} +1 -1
- package/dist/assets/{use-mobile-BCnZR7ht.js → use-mobile-BOCpywmu.js} +1 -1
- package/dist/assets/{useAsync-DSoiLp-a.js → useAsync-D7PX5RWx.js} +1 -1
- package/dist/assets/{useFormControl-CBqLeNuP.js → useFormControl-B5XnXwzO.js} +1 -1
- package/dist/assets/{useLocalStorage-DjbRNkiJ.js → useLocalStorage-t8zs4VAz.js} +1 -1
- package/dist/assets/{useSetState-B6lpt1LL.js → useSetState-Br77TPgt.js} +1 -1
- package/dist/assets/useSlot-CeeEaDXE.js +1 -0
- package/dist/assets/{useSlotProps-CzXTdauO.js → useSlotProps-CSBBXTuv.js} +1 -1
- package/dist/assets/{useThemeProps-CYE8bkPe.js → useThemeProps-Bp8oreMA.js} +1 -1
- package/dist/assets/{user-center-DcNHg_hw.js → user-center-CvySLBqs.js} +1 -1
- package/dist/assets/{user-sessions-6jF4DueP.js → user-sessions-B1MeydkJ.js} +1 -1
- package/dist/assets/{util-BbQsgaPf.js → util-BWib46eW.js} +1 -1
- package/dist/assets/{vi-CanFbf1v.js → vi-BsX5AAJJ.js} +1 -1
- package/dist/assets/wrap-locale-WOY0-059.js +1 -0
- package/dist/assets/{zh-BxXo7x1m.js → zh-CIqkKG4c.js} +1 -1
- package/dist/assets/{zh-tw-Bvqjz2OU.js → zh-tw-D7VeUoit.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +25 -25
- package/dist/assets/FormGroup-B8n_A1si.js +0 -1
- package/dist/assets/access-control-BcwTyvZM.js +0 -13
- package/dist/assets/add-resource-Dwhlr_-p.js +0 -1
- package/dist/assets/api-DBUv9UoZ.js +0 -1
- package/dist/assets/index-3rOQRHRT.js +0 -262
- package/dist/assets/index-Bwekh9E9.js +0 -54
- package/dist/assets/index-Cf5QKw7p.js +0 -16
- package/dist/assets/index-D1xJMZP4.js +0 -288
- package/dist/assets/invite-B5s2JB7B.js +0 -10
- package/dist/assets/issue-passport-0D5U2s9S.js +0 -1
- package/dist/assets/localization-NJebqRnT.js +0 -1
- package/dist/assets/notifications-pIEPdGq8.js +0 -62
- package/dist/assets/overview-BGv5mEim.js +0 -12
- package/dist/assets/publish-resource-JgFEyA5w.js +0 -1
- package/dist/assets/session-DCmLCX5v.js +0 -1
- package/dist/assets/useSlot-Dcztxd47.js +0 -1
- package/dist/assets/wrap-locale-Cu_W5gFD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aB as Pe,aA as ze,aC as Z,ae as Ne,aD as _,aG as $,r as p,aE as Ce,aF as re,j as n,aI as R,aJ as Me,d9 as no,cX as ro,bg as ee,cI as to,da as ao,V as so,db as io,dc as lo,_ as co,c1 as po,ao as se,P as r,X as ie,Y as le,bq as y,ac as uo,ax as de,L as Q,T as D,b as ho,ay as Re,B as C,br as xo,G as q,dd as Ie,H as Te,$ as mo,O as Be,h as te,de as fo,k as X,df as go,dg as bo}from"./index-CQ5dtdkj.js";import{T as vo}from"./Toolbar-DT4-YRKk.js";import{H as Le}from"./Hidden-BLcFQ9WU.js";const ae={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};function yo(e){return Pe("MuiAppBar",e)}ze("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const jo=["className","color","enableColorOnDark","position"],wo=e=>{const{color:o,position:t,classes:a}=e,l={root:["root",`color${_(o)}`,`position${_(t)}`]};return Me(l,yo,a)},J=(e,o)=>e?`${e==null?void 0:e.replace(")","")}, ${o})`:o,ko=Z(Ne,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[`position${_(t.position)}`],o[`color${_(t.color)}`]]}})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return $({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},o.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},o.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},o.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},o.position==="static"&&{position:"static"},o.position==="relative"&&{position:"relative"},!e.vars&&$({},o.color==="default"&&{backgroundColor:t,color:e.palette.getContrastText(t)},o.color&&o.color!=="default"&&o.color!=="inherit"&&o.color!=="transparent"&&{backgroundColor:e.palette[o.color].main,color:e.palette[o.color].contrastText},o.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!o.enableColorOnDark&&{backgroundColor:null,color:null},o.color==="transparent"&&$({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&$({},o.color==="default"&&{"--AppBar-background":o.enableColorOnDark?e.vars.palette.AppBar.defaultBg:J(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":o.enableColorOnDark?e.vars.palette.text.primary:J(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},o.color&&!o.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":o.enableColorOnDark?e.vars.palette[o.color].main:J(e.vars.palette.AppBar.darkBg,e.vars.palette[o.color].main),"--AppBar-color":o.enableColorOnDark?e.vars.palette[o.color].contrastText:J(e.vars.palette.AppBar.darkColor,e.vars.palette[o.color].contrastText)},!["inherit","transparent"].includes(o.color)&&{backgroundColor:"var(--AppBar-background)"},{color:o.color==="inherit"?"inherit":"var(--AppBar-color)"},o.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),$o=p.forwardRef(function(o,t){const a=Ce({props:o,name:"MuiAppBar"}),{className:l,color:c="primary",enableColorOnDark:d=!1,position:i="fixed"}=a,u=re(a,jo),s=$({},a,{color:c,position:i,enableColorOnDark:d}),x=wo(s);return n.jsx(ko,$({square:!0,component:"header",ownerState:s,elevation:4,className:R(x.root,l,i==="fixed"&&"mui-fixed"),ref:t},u))}),Po=$o;function zo(e){return Pe("MuiDrawer",e)}ze("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const No=["BackdropProps"],Co=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],Ae=(e,o)=>{const{ownerState:t}=e;return[o.root,(t.variant==="permanent"||t.variant==="persistent")&&o.docked,o.modal]},Mo=e=>{const{classes:o,anchor:t,variant:a}=e,l={root:["root"],docked:[(a==="permanent"||a==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${_(t)}`,a!=="temporary"&&`paperAnchorDocked${_(t)}`]};return Me(l,zo,o)},Ro=Z(no,{name:"MuiDrawer",slot:"Root",overridesResolver:Ae})(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer})),ke=Z("div",{shouldForwardProp:ro,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Ae})({flex:"0 0 auto"}),Io=Z(Ne,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.paper,o[`paperAnchor${_(t.anchor)}`],t.variant!=="temporary"&&o[`paperAnchorDocked${_(t.anchor)}`]]}})(({theme:e,ownerState:o})=>$({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},o.anchor==="left"&&{left:0},o.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},o.anchor==="right"&&{right:0},o.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},o.anchor==="left"&&o.variant!=="temporary"&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},o.anchor==="top"&&o.variant!=="temporary"&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},o.anchor==="right"&&o.variant!=="temporary"&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},o.anchor==="bottom"&&o.variant!=="temporary"&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`})),De={left:"right",right:"left",top:"down",bottom:"up"};function To(e){return["left","right"].indexOf(e)!==-1}function Bo({direction:e},o){return e==="rtl"&&To(o)?De[o]:o}const Lo=p.forwardRef(function(o,t){const a=Ce({props:o,name:"MuiDrawer"}),l=ee(),c=to(),d={enter:l.transitions.duration.enteringScreen,exit:l.transitions.duration.leavingScreen},{anchor:i="left",BackdropProps:u,children:s,className:x,elevation:m=16,hideBackdrop:j=!1,ModalProps:{BackdropProps:w}={},onClose:P,open:b=!1,PaperProps:f={},SlideProps:z,TransitionComponent:M=ao,transitionDuration:L=d,variant:I="temporary"}=a,N=re(a.ModalProps,No),g=re(a,Co),k=p.useRef(!1);p.useEffect(()=>{k.current=!0},[]);const A=Bo({direction:c?"rtl":"ltr"},i),F=$({},a,{anchor:i,elevation:m,open:b,variant:I},g),T=Mo(F),h=n.jsx(Io,$({elevation:I==="temporary"?m:0,square:!0},f,{className:R(T.paper,f.className),ownerState:F,children:s}));if(I==="permanent")return n.jsx(ke,$({className:R(T.root,T.docked,x),ownerState:F,ref:t},g,{children:h}));const v=n.jsx(M,$({in:b,direction:De[A],timeout:L,appear:k.current},z,{children:h}));return I==="persistent"?n.jsx(ke,$({className:R(T.root,T.docked,x),ownerState:F,ref:t},g,{children:v})):n.jsx(Ro,$({BackdropProps:$({},u,w,{transitionDuration:L}),className:R(T.root,T.modal,x),open:b,ownerState:F,onClose:P,hideBackdrop:j,ref:t},g,N,{children:v}))}),_e=Lo;function Ao(e,o){var t,a=so(e),l=(t=o==null?void 0:o.wait)!==null&&t!==void 0?t:1e3,c=p.useMemo(function(){return io(function(){for(var d=[],i=0;i<arguments.length;i++)d[i]=arguments[i];return a.current.apply(a,lo([],co(d),!1))},l,o)},[]);return po(function(){c.cancel()}),{run:c,cancel:c.cancel,flush:c.flush}}const Do=se(n.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),_o=se(n.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),Fo=se(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),Fe=p.createContext(),Oo=e=>{const o=p.useContext(Fe);return p.useLayoutEffect(()=>{e&&o.configure(e)},[]),o};function Oe({children:e,...o}){const[t,a]=p.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),l=()=>{a(d=>({...d,inFullPage:!d.inFullPage}))},c=p.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:l,configure:d=>a(i=>({...i,...d}))}),[t]);return n.jsx(Fe.Provider,{value:c,...o,children:e})}Oe.propTypes={children:r.node.isRequired};var ce={},Wo=le;Object.defineProperty(ce,"__esModule",{value:!0});var We=ce.default=void 0,Ho=Wo(ie()),Vo=n;We=ce.default=(0,Ho.default)((0,Vo.jsx)("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");var pe={},Eo=le;Object.defineProperty(pe,"__esModule",{value:!0});var He=pe.default=void 0,qo=Eo(ie()),Uo=n;He=pe.default=(0,qo.default)((0,Uo.jsx)("path",{d:"M22 3.41 16.71 8.7 20 12h-8V4l3.29 3.29L20.59 2zM3.41 22l5.29-5.29L12 20v-8H4l3.29 3.29L2 20.59z"}),"CloseFullscreen");function ue({name:e,size:o,alt:t,color:a,style:l,prefix:c,showBadge:d,...i}){const u=`${c}/${e}-${a.replace(/^#/,"")}.png`;return n.jsxs(So,{style:{width:o,height:o},children:[n.jsx(uo,{width:o,height:o,alt:t||e,src:u,style:Object.assign({width:o},l),...i}),d&&n.jsx("i",{className:"badge-point"})]})}ue.propTypes={name:r.string.isRequired,size:r.number,color:r.string,alt:r.string,style:r.object,prefix:r.string,showBadge:r.bool};ue.defaultProps={size:36,color:"#000000",alt:"",style:{},prefix:"/images",showBadge:!1};const So=y("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|
|
@@ -22,7 +22,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
22
22
|
${e=>e.layout==="vertical"?"margin-top: 8px;":""}
|
|
23
23
|
${e=>e.layout==="vertical"?"":"margin-left: 8px;"};
|
|
24
24
|
}
|
|
25
|
-
`;function he({images:e,links:o,prefix:t,addons:a,logo:l,...c}){const d=ee(),i=de(),u=(s,x)=>new RegExp(`/${x}`).test(i.pathname);return n.jsxs(Yo,{...c,children:[n.jsx(
|
|
25
|
+
`;function he({images:e,links:o,prefix:t,addons:a,logo:l,...c}){const d=ee(),i=de(),u=(s,x)=>new RegExp(`/${x}`).test(i.pathname);return n.jsxs(Yo,{...c,children:[n.jsx(Q,{to:"/",className:"sidebar-logo",children:l||n.jsx(U,{showText:!1,size:20})}),o.map(({url:s,name:x,title:m,showBadge:j})=>{const w=u(s,x);return n.jsxs(Xo,{component:Q,selected:w,to:s,children:[n.jsx(ue,{name:e[x],size:36,color:w?"#00c2c4":d.typography.color.main,prefix:t,showBadge:j}),n.jsx(D,{component:"span",className:"menu-title",children:m})]},s)}),n.jsx("div",{style:{flex:1}}),a]})}he.propTypes={images:r.object.isRequired,links:r.array.isRequired,prefix:r.string,addons:r.any,logo:r.any};he.defaultProps={prefix:"/images",addons:null,logo:null};const Yo=p.memo(y("div")`
|
|
26
26
|
flex: 1;
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
@@ -72,7 +72,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
72
72
|
color: ${e=>e.theme.palette.text.primary};
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
`;var xe={},Jo=le;Object.defineProperty(xe,"__esModule",{value:!0});var me=xe.default=void 0,
|
|
75
|
+
`;var xe={},Jo=le;Object.defineProperty(xe,"__esModule",{value:!0});var me=xe.default=void 0,Qo=Jo(ie()),Ko=n;me=xe.default=(0,Qo.default)((0,Ko.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");const Zo=y(Po)`
|
|
76
76
|
&& {
|
|
77
77
|
z-index: ${e=>e.theme.zIndex.drawer};
|
|
78
78
|
background: ${e=>e.theme.palette.background.default};
|
|
@@ -142,7 +142,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
142
142
|
display: block;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`;function fe({children:e,brand:o,brandAddon:t,description:a,addons:l,onToggleMenu:c,homeUrl:d,logo:i,...u}){return n.jsx(Zo,{position:"sticky",className:"header",...u,children:n.jsxs(vo,{disableGutters:!1,className:"header-toolbar",children:[n.jsx(Re,{color:"inherit","aria-label":"open drawer",edge:"start",className:"header-menu","aira-label":"header menu button",onClick:c,children:n.jsx(me,{})}),n.jsxs(
|
|
145
|
+
`;function fe({children:e,brand:o,brandAddon:t,description:a,addons:l,onToggleMenu:c,homeUrl:d,logo:i,...u}){return n.jsx(Zo,{position:"sticky",className:"header",...u,children:n.jsxs(vo,{disableGutters:!1,className:"header-toolbar",children:[n.jsx(Re,{color:"inherit","aria-label":"open drawer",edge:"start",className:"header-menu","aira-label":"header menu button",onClick:c,children:n.jsx(me,{})}),n.jsxs(Q,{to:d,className:"header-link",children:[n.jsx(Le,{mdDown:!0,children:n.jsx("div",{className:"header-logo",children:i||n.jsx(U,{showText:!1})})}),n.jsxs("div",{className:"header-title",children:[n.jsxs(D,{component:"h2",noWrap:!0,className:"header-title__primary",children:[o,t]}),n.jsx(D,{component:"p",noWrap:!0,className:"header-title__secondary",children:a})]})]}),n.jsx(C,{flexGrow:1}),!!e&&n.jsx("div",{className:"header-children",children:e}),n.jsx("div",{className:"header-addons",children:l})]})})}fe.propTypes={onToggleMenu:r.func.isRequired,brand:r.string.isRequired,brandAddon:r.object,description:r.any.isRequired,children:r.any,addons:r.any,homeUrl:r.string,logo:r.any};fe.defaultProps={children:null,addons:null,brandAddon:null,homeUrl:"/",logo:null};function H(e){var m;const o=xo(e,H,["dark","style"]),{className:t,copyStart:a,style:l,brand:c,dark:d,addon:i}=o,u=`${new Date().getFullYear()}`,s=`${a}`,x=u===s?u:`${s}-${u}`;return n.jsxs(en,{className:t,style:l,dark:d,children:[n.jsx(q,{maxWidth:!1,children:n.jsxs(D,{component:"div",className:"footer",children:[n.jsxs(D,{component:"p",className:"footer-item",children:[n.jsxs("span",{className:"footer-copy",children:["Copyright © ",x," "]}),n.jsx("span",{className:"footer-brand",children:c})]}),i&&n.jsx(D,{component:"div",className:"footer-item",sx:{order:{xs:"-1",md:"initial"},ml:{xs:0,md:"auto"},width:{xs:"100%",md:"auto"}},children:i}),n.jsxs(D,{component:"p",className:"footer-item",style:{justifyContent:"flex-end",flexShrink:0},children:["Powered by",n.jsx(U,{mode:d?"light":"dark",layout:"horizontal",className:"logo-container"})]})]})}),n.jsx(C,{position:"absolute",right:16,bottom:0,fontSize:12,sx:{color:"transparent","::selection":{background:"#000",color:"#fff"}},children:(m=window==null?void 0:window.blocklet)==null?void 0:m.version})]})}H.propTypes={dark:r.bool,className:r.string,copyStart:r.oneOfType([r.string,r.number]),brand:r.string,style:r.object,addon:r.node};H.defaultProps={dark:!1,brand:"ArcBlock",copyStart:"2017",className:"",style:{},addon:null};const en=y("div",{shouldForwardProp:e=>e!=="dark"})`
|
|
146
146
|
position: relative;
|
|
147
147
|
margin-top: 64px;
|
|
148
148
|
padding: 24px 0 32px;
|
|
@@ -230,7 +230,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
230
230
|
box-shadow: 2px 16px 10px 0 rgba(0, 0, 0, ${e=>e.theme.mode==="light"?.05:.5});
|
|
231
231
|
border: 0;
|
|
232
232
|
}
|
|
233
|
-
`;function ge({children:e,title:o,brand:t,description:a,brandAddon:l,headerAddon:c,images:d,links:i,prefix:u,fullWidth:s,contentLayout:x,className:m,homeUrl:j,logo:w,...P}){const f=Ie(document.body),z=(f==null?void 0:f.width)||0,[M,L]=p.useState(z>=960?"permanent":"temporary"),[I,N]=p.useState(M==="permanent");p.useEffect(()=>{const A=z>=960?"permanent":"temporary";L(A),N(A!=="temporary")},[z]);const g=()=>{N(!I)},k=s||x==="row";return n.jsxs(on,{className:`dashboard ${m}`,...P,children:[n.jsx(Te,{title:`${o}-${t}`}),n.jsx(fe,{className:"dashboard__header",onToggleMenu:g,brand:t,brandAddon:l,description:a,addons:c,homeUrl:j,logo:w}),n.jsxs(C,{display:"flex",className:"dashboard__body",children:[n.jsx(_e,{variant:M,className:"drawer",classes:{paper:"drawerPaper"},open:I,onClose:g,ModalProps:{disablePortal:!0,keepMounted:!0},children:n.jsx(he,{className:"dashboard__sidebar",images:d,links:i,prefix:u,logo:w})}),n.jsxs(C,{className:"dashboard__main",children:[n.jsx(q,{maxWidth:k?!1:"lg",className:"dashboard__content",children:e}),n.jsx(
|
|
233
|
+
`;function ge({children:e,title:o,brand:t,description:a,brandAddon:l,headerAddon:c,images:d,links:i,prefix:u,fullWidth:s,contentLayout:x,className:m,homeUrl:j,logo:w,...P}){const f=Ie(document.body),z=(f==null?void 0:f.width)||0,[M,L]=p.useState(z>=960?"permanent":"temporary"),[I,N]=p.useState(M==="permanent");p.useEffect(()=>{const A=z>=960?"permanent":"temporary";L(A),N(A!=="temporary")},[z]);const g=()=>{N(!I)},k=s||x==="row";return n.jsxs(on,{className:`dashboard ${m}`,...P,children:[n.jsx(Te,{title:`${o}-${t}`}),n.jsx(fe,{className:"dashboard__header",onToggleMenu:g,brand:t,brandAddon:l,description:a,addons:c,homeUrl:j,logo:w}),n.jsxs(C,{display:"flex",className:"dashboard__body",children:[n.jsx(_e,{variant:M,className:"drawer",classes:{paper:"drawerPaper"},open:I,onClose:g,ModalProps:{disablePortal:!0,keepMounted:!0},children:n.jsx(he,{className:"dashboard__sidebar",images:d,links:i,prefix:u,logo:w})}),n.jsxs(C,{className:"dashboard__main",children:[n.jsx(q,{maxWidth:k?!1:"lg",className:"dashboard__content",children:e}),n.jsx(H,{})]})]})]})}ge.propTypes={children:r.any.isRequired,title:r.string,brand:r.string.isRequired,links:r.array.isRequired,images:r.object.isRequired,brandAddon:r.object,description:r.any.isRequired,headerAddon:r.any,prefix:r.string,contentLayout:r.oneOf(["row","column"]),fullWidth:r.bool,className:r.string,homeUrl:r.string,logo:r.any};ge.defaultProps={title:"Home",contentLayout:"column",headerAddon:null,brandAddon:null,prefix:"/images",fullWidth:!1,className:"",homeUrl:"/",logo:null};function Se({height:e,...o}){return n.jsx(nn,{height:e,...o})}Se.propTypes={height:r.oneOfType([r.number,r.string]).isRequired};const nn=y(C)`
|
|
234
234
|
overflow: hidden;
|
|
235
235
|
&:before {
|
|
236
236
|
content: '';
|
|
@@ -536,7 +536,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
536
536
|
.navmenu-sub--opened > .navmenu-sub-container {
|
|
537
537
|
display: block;
|
|
538
538
|
}
|
|
539
|
-
`,ve=p.createContext();function Ye(e){return e?p.Children.toArray(e).filter(o=>o.type===G||o.type===
|
|
539
|
+
`,ve=p.createContext();function Ye(e){return e?p.Children.toArray(e).filter(o=>o.type===G||o.type===W):null}function Xe(e){return p.useRef(e||`navmenu-item-id-${Math.random().toString(36).slice(2)}`).current}function S({items:e,mode:o,children:t,activeId:a,textColor:l,activeTextColor:c,bgColor:d,onSelected:i,...u}){var T;if(t=Ye(t),!(e!=null&&e.length)&&!(t!=null&&t.length))throw new Error("One of 'items' or 'children' is required by NavMenu component.");const s=Be({activeId:a,openedIds:[],hiddenItemCount:0}),x=X(h=>{s.activeId=h,i==null||i(h)}),m=X(h=>{s.openedIds.push(h)}),j=X(h=>{s.openedIds=s.openedIds.filter(v=>v!==h)}),w=te(()=>({...s,mode:o,activate:x,open:m,close:j}),[s.activeId,s.hiddenItemCount,s.openedIds,o,x,m,j]),P=p.useRef(),b=p.useRef([]),f=p.useRef(),z=s.hiddenItemCount===((T=b.current)==null?void 0:T.length),M=z?{marginLeft:"0px"}:void 0,L=te(()=>z?n.jsx(_o,{}):n.jsx(Fo,{}),[z]),I=h=>p.Children.map(h,(v,O)=>p.cloneElement(v,{ref:B=>{b.current[O]=B}})),N=Ie(P.current),{run:g}=Ao(X(()=>{let h=0,v=0,O=!1;const B=(N==null?void 0:N.width)||0,ne=f.current?f.current.offsetWidth+parseFloat(window.getComputedStyle(f.current).marginLeft):0;b.current.forEach((E,eo)=>{if(E){E.style.display="flex";const oo=eo>0?parseFloat(window.getComputedStyle(E).marginLeft):0,we=E.offsetWidth+oo;B-ne>=h+we&&!O?h+=we:(E.style.display="none",O=!0,v++)}}),v!==s.hiddenItemCount&&(s.hiddenItemCount=v)}),{wait:100});p.useLayoutEffect(()=>{o==="horizontal"&&g()},[N==null?void 0:N.width,o]),p.useEffect(()=>{if(o==="horizontal")return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[o,e]),p.useEffect(()=>{a!=null&&(s.activeId=a)},[a]);const k=R("navmenu",`navmenu--${o}`,u.className),A=(h,v,O=!1)=>h!=null&&h.children?n.jsx(W,{id:h.id,icon:h.icon,label:h.label,ref:O?B=>{b.current[v]=B}:void 0,children:h.children.map((B,ne)=>A(B,ne,!1))},h.id):n.jsx(G,{id:h.id,icon:h.icon,label:h.label,active:h.active,ref:O?B=>{b.current[v]=B}:void 0},h.id),je=e?e==null?void 0:e.slice(-s.hiddenItemCount).map((h,v)=>A(h,v)):t==null?void 0:t.slice(-s.hiddenItemCount),F=o==="inline"?ln:sn;return n.jsx(ve.Provider,{value:w,children:n.jsx(F,{...u,className:k,$textColor:l,$activeTextColor:c,$bgColor:d,children:n.jsxs("ul",{className:"navmenu-root",ref:P,children:[e?e.map((h,v)=>A(h,v,!0)):I(t),s.hiddenItemCount>0&&n.jsx(W,{expandIcon:!1,icon:L,label:"",ref:f,style:M,children:je})]})})})}S.propTypes={items:r.array,mode:r.oneOf(["horizontal","vertical","inline"]),children:r.array,activeId:r.string,textColor:r.string,activeTextColor:r.string,bgColor:r.string,onSelected:r.func};S.defaultProps={items:null,mode:"horizontal",children:null,activeId:null,textColor:"#9397a1",activeTextColor:"#25292f",bgColor:"#fff",onSelected:null};const G=p.forwardRef(({id:e,icon:o,label:t,active:a,onClick:l,...c},d)=>{const i=Xe(e),{activeId:u,activate:s}=p.useContext(ve),x=R("navmenu-item",{"navmenu-item--active":u===i},c.className);p.useEffect(()=>{a&&s(i)},[a]);const m=()=>{l==null||l(),s(i)};return n.jsxs("li",{...c,className:x,onClick:m,ref:d,children:[o&&n.jsx("span",{className:"navmenu-item-icon",children:o}),n.jsx("span",{className:"navmenu-item-label",children:t})]})});G.propTypes={id:r.string,icon:r.element,label:r.node,active:r.bool,onClick:r.func};G.defaultProps={id:null,icon:null,label:"",active:!1,onClick:null};const W=p.forwardRef(({id:e,icon:o,label:t,children:a,expandIcon:l,...c},d)=>{const i=Xe(e),{openedIds:u,open:s,close:x,mode:m}=p.useContext(ve),j=u.includes(i),w=R("navmenu-sub",{"navmenu-sub--opened":j},c.className),P=m==="inline",b=P?{onClick:()=>{u.includes(i)?x(i):s(i)}}:{onMouseEnter:()=>s(i),onMouseLeave:()=>x(i)},f=P?{onClick:z=>z.stopPropagation()}:{};return n.jsxs("li",{...c,className:w,...b,ref:d,children:[o&&n.jsx("span",{className:"navmenu-sub-icon",children:o}),n.jsx("span",{className:"navmenu-sub-label",children:t}),l&&n.jsx("span",{className:"navmenu-sub-expand-icon",children:(l==null?void 0:l({isOpen:j}))||l}),n.jsx("div",{className:"navmenu-sub-container",...f,children:n.jsx("ul",{className:"navmenu-sub-list",children:Ye(a)})})]})});W.propTypes={id:r.string,icon:r.element,label:r.node.isRequired,children:r.array.isRequired,expandIcon:r.oneOfType([r.node,r.func])};W.defaultProps={id:null,icon:null,expandIcon:({isOpen:e})=>n.jsx(Do,{style:{transform:`rotate(${e?180:0}deg)`}})};S.Item=G;S.Sub=W;function oe({children:e,routerLinkComponent:o,to:t,external:a,...l}){return a?n.jsx("a",{href:t,...l,children:e}):n.jsx(o,{to:t,...l,children:e})}oe.propTypes={children:r.any.isRequired,routerLinkComponent:r.elementType.isRequired,external:r.bool,to:r.oneOfType([r.string,r.object]).isRequired};oe.defaultProps={external:!1};function Je(e){return n.jsx(oe,{routerLinkComponent:Q,...e})}function ye({className:e,...o}){const t=o.external&&typeof e=="function"?e({}):e;return n.jsx(oe,{routerLinkComponent:go,className:t,...o})}ye.propTypes={className:r.oneOfType([r.string,r.func])};ye.defaultProps={className:""};function Qe(e,o){var u;if((u=e.children)!=null&&u.length)return dn(e,o);const{url:t,icon:a,title:l,showBadge:c,external:d,active:i}=e;return n.jsx("li",{className:"layout-sidebar-item",children:n.jsxs(ye,{external:d,to:t,className:({isActive:s})=>R("layout-sidebar-link",{"layout-sidebar-link--active":d?i:s}),children:[a&&n.jsx("span",{className:`layout-sidebar-icon ${c?"layout-sidebar-badge":""}`,children:a}),n.jsx(D,{component:"span",className:"layout-sidebar-link-text",children:l})]})},`${t}-${o}`)}function dn(e,o){return n.jsxs("li",{className:"layout-sidebar-group",children:[n.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),n.jsx("ul",{children:e.children.map(Qe)})]},`group-${e.title}-${o}`)}function K({links:e,addons:o,dense:t,...a}){return n.jsxs(pn,{...a,className:R({"layout-sidebar-dense":t}),children:[n.jsx("ul",{children:e.map(Qe)}),n.jsx("div",{style:{flex:1}}),o]})}K.propTypes={links:r.array.isRequired,addons:r.any,dense:r.bool};K.defaultProps={addons:null,dense:!1};const cn="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",pn=y("div")`
|
|
540
540
|
display: flex;
|
|
541
541
|
flex-direction: column;
|
|
542
542
|
ul {
|
|
@@ -661,7 +661,7 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
661
661
|
margin-top: 16px;
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
`;function un({closeMenu:e,...o}){const t=de();return p.useEffect(()=>{e()},[t]),n.jsx(S,{...o})}function
|
|
664
|
+
`;function un({closeMenu:e,...o}){const t=de();return p.useEffect(()=>{e()},[t]),n.jsx(S,{...o})}function Ke(e,o){return e.map(t=>{var a;return(a=t.children)!=null&&a.length?{...t,label:t.title,children:Ke(t.children,o)}:{...t,label:n.jsx(Je,{to:t.url,external:t.external,children:t.title}),active:t.external?t.active:!!bo({path:t.url,end:!1},o.pathname)}})}function Y({children:e,title:o,headerProps:t,links:a=[],fullWidth:l,dense:c,footerProps:d,...i}){const u=ee(),{inFullPage:s,showToggleButton:x,headerVisible:m,footerVisible:j,sidebarVisible:w,toggleFullPage:P}=Oo(),b=de(),f=p.useMemo(()=>Ke(a,b),[b,a]),z=f.some(g=>{var k;return!!((k=g.children)!=null&&k.length)}),M=c==="auto"?f.length>=8||z:c,L=R("dashboard",{"dashboard-dense":M},i.className),N={homeLink:g=>{var k;return n.jsx(Je,{to:((k=window.blocklet)==null?void 0:k.prefix)||"/",children:g})},...t};return n.jsxs(hn,{...i,className:L,children:[n.jsx(Te,{title:o},o),m&&n.jsx(xn,{...N,className:"dashboard-header",children:a!=null&&a.length?({isMobile:g,closeMenu:k})=>g?n.jsx(un,{mode:"inline",items:f,closeMenu:k,bgColor:"transparent",activeTextColor:u.palette.primary.main}):null:null}),n.jsxs(C,{display:"flex",className:"dashboard-body",children:[n.jsx(Le,{mdDown:!0,children:!!(a!=null&&a.length)&&w&&n.jsx(C,{className:"dashboard-sidebar",children:M?n.jsx(K,{links:a,dense:M}):n.jsx(C,{className:"dashboard-sidebar-container",children:n.jsx(K,{links:a,dense:M})})})}),n.jsxs(C,{className:"dashboard-main",children:[x&&n.jsx(C,{sx:{position:"absolute",top:4,right:4,display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,color:"#fff",bgcolor:"rgba(158,158,158, 0.6);",borderRadius:1,cursor:"pointer"},onClick:P,children:s?n.jsx(He,{style:{fontSize:18}}):n.jsx(We,{style:{fontSize:18}})}),n.jsx(q,{className:"dashboard-content",...l&&{maxWidth:!1},children:e}),j&&n.jsx(H,{...d})]})]})]})}Y.propTypes={children:r.any.isRequired,title:r.string,links:r.array.isRequired,headerProps:r.object,fullWidth:r.bool,sidebarWidth:r.number,dense:r.oneOf([!0,!1,"auto"])};Y.defaultProps={title:"Home",headerProps:{},fullWidth:!1,sidebarWidth:120,dense:"auto"};const hn=y("div",{shouldForwardProp:e=>e!=="sidebarWidth"})`
|
|
665
665
|
&.dashboard {
|
|
666
666
|
display: flex;
|
|
667
667
|
flex-direction: column;
|
|
@@ -718,4 +718,4 @@ import{aC as Pe,aB as ze,aD as Z,ae as Ne,aE as _,aH as $,r as p,aF as Ce,aG as
|
|
|
718
718
|
.header-container {
|
|
719
719
|
max-width: 100%;
|
|
720
720
|
}
|
|
721
|
-
`;function Ze({legacy:e,...o}){return e?n.jsx(ge,{...o}):n.jsx(
|
|
721
|
+
`;function Ze({legacy:e,...o}){return e?n.jsx(ge,{...o}):n.jsx(Oe,{children:n.jsx(Y,{...o})})}Ze.propTypes={...Y.propTypes,legacy:r.bool,footerProps:r.shape(H.propTypes)};Ze.defaultProps={...Y.defaultProps,legacy:!0};export{Ze as D,S as N,be as R,Oo as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__fileDeps=["assets/react-
|
|
2
|
-
import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC as Fe,T as J,r as C,aF as x1,aI as l2,aJ as Ue,aK as qe,cL as s2,fo as o1,X as Te,Y as Ne,B as z,m as Oe,P as h,$ as We,F as X,e as m1,u as le,aM as je,aV as Ve,bv as l1,a1 as Ze,L as ue,bI as v0,a as ve,az as ie,J as r2,s as $,Z as ae,dr as n2,a9 as Ce,c as he,G as i2,bT as v1,ce as g0,cA as a2,cJ as He,cK as b0,bh as c2,c_ as d2,cE as Xe,bC as pe,c1 as Je,f9 as u2,a7 as K1,b as oe,bk as p2,dt as h2,ae as j0,bl as f2,ck as x2,aQ as X1,aP as m2,a2 as w0,fp as J1,e_ as Ie,bi as v2,ap as R0,cR as g2,k as b2,ay as j2,al as w2,am as r1}from"./index-RoEjkyyY.js";import{d as g1}from"./Add-B2tTKEMF.js";import{d as R2}from"./AddBox-B_ujO0_p.js";import{d as C0}from"./Delete-B9GqJi6E.js";import{d as C2}from"./Error-BPziGUer.js";import{D as b1}from"./index-DK_iQDKo.js";import{T as y0,b as y2}from"./index-DN_A6H1f.js";import{C as j1}from"./confirm-D0ewRRow.js";import{u as s1}from"./session-DCmLCX5v.js";import{W as Q1}from"./did-address-CNBFLmND.js";import{B as w1,d as z2}from"./ChevronRight-86t7cTOH.js";import{S as ge}from"./shorten-label-CBUJuv2z.js";import{A as z0}from"./Avatar-BUFa3I7L.js";import{d as S2}from"./Download-BN2qoa8L.js";import{d as k2}from"./QuestionMarkCircle-BrwbMFMj.js";import{b as M2,c as Y1,T as I2}from"./index-BeqdHb1K.js";import{_ as Me}from"./useSetState-B6lpt1LL.js";import{c as R1}from"./index-BDo-QYGM.js";import{C as d1,F as u1,S as L2}from"./FormControlLabel-BEUPUFZZ.js";import{A as S0}from"./Alert-Dpm7qDYx.js";import{p as e1}from"./index-HqFqdQ4r.js";import"./api-DBUv9UoZ.js";import{i as P2}from"./index-C0C8sj0f.js";import{d as T2}from"./ExpandMore-Bndw6T5W.js";import{d as N2}from"./OpenInNew-Bwk37Gfj.js";import{u as k0}from"./useThemeProps-CYE8bkPe.js";import{u as V2}from"./useSlotProps-CzXTdauO.js";import{d as D2}from"./DeleteOutline-4tV22N5G.js";import{c as _2,A as M0,u as B2,S as E2,U as A2}from"./item-DE26aStl.js";import{d as O2}from"./ArrowDropDown-Bbuyv1lE.js";import{f as Pe}from"./format-error-BvsdhOPE.js";import{B as p1}from"./ButtonGroup-Dy_3TNWh.js";import{T as Le}from"./TextField-Bkhn_ICi.js";import{M as C1}from"./InputAdornment-dFvDjSPj.js";import{C as H2}from"./click-to-copy-DEiZxYJs.js";import{d as $2}from"./Launch-DpNNGEN3.js";import{L as F2}from"./MoreVert-CrVGyEb1.js";import{a as U2}from"./ListItemText-CBTf5ICv.js";import{S as Z1}from"./index-De6Naxqp.js";import{M as q2}from"./index-DjRZjTaR.js";import{r as W2}from"./index-CJRQAR_e.js";import{d as G2}from"./Done-COFqGl-V.js";import{c as I0,d as L0,b as K2,S as X2,a as J2}from"./Stepper-2xT4uG_5.js";import{R as Q2,a as e0}from"./RadioGroup-D3rZMCGA.js";import"./FilterList-Drg2vaRW.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-DPMPTS0i.js";import"./useFormControl-CBqLeNuP.js";import"./FormGroup-B8n_A1si.js";import"./InputLabel-Cr2F0wL_.js";import"./Select-DmK_UTE4.js";import"./LastPage-BsSK0r__.js";import"./Toolbar-C0HRONVo.js";import"./index-DnjdsAXn.js";import"./redux-BzBcp8M-.js";import"./Search-c39KP22B.js";import"./index-U0futuIe.js";import"./Link-R_Yn6p48.js";import"./useSlot-Dcztxd47.js";import"./jss-plugin-props-sort.esm-BdIs7KPF.js";const Y2=o2(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"),Z2=["slots","slotProps"],et=se(m0)(({theme:e})=>O({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":O({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":O({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:G1(e.palette.grey[200],.12)}:{backgroundColor:G1(e.palette.grey[600],.12)})})),tt=se(Y2)({width:24,height:16});function ot(e){const{slots:t={},slotProps:l={}}=e,r=be(e,Z2),n=e;return o.jsx("li",{children:o.jsx(et,O({focusRipple:!0},r,{ownerState:n,children:o.jsx(tt,O({as:t.CollapsedIcon,ownerState:n},l.collapsedIcon))}))})}function lt(e){return Fe("MuiBreadcrumbs",e)}const st=$e("MuiBreadcrumbs",["root","ol","li","separator"]),rt=st,nt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],it=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},lt,t)},at=se(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${rt.li}`]:t.li},t.root]})({}),ct=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),dt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,t,l,r){return e.reduce((n,d,i)=>(i<e.length-1?n=n.concat(d,o.jsx(dt,{"aria-hidden":!0,className:t,ownerState:r,children:l},`separator-${i}`)):n.push(d),n),[])}const pt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiBreadcrumbs"}),{children:n,className:d,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:b=1,maxItems:y=8,separator:p="/"}=r,c=be(r,nt),[m,g]=C.useState(!1),v=O({},r,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:b,maxItems:y,separator:p}),R=it(v),S=l2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=C.useRef(null),T=k=>{const U=()=>{g(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return b+x>=k.length?k:[...k.slice(0,b),o.jsx(ot,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...k.slice(k.length-x,k.length)]},L=C.Children.toArray(n).filter(k=>C.isValidElement(k)).map((k,U)=>o.jsx("li",{className:R.li,children:k},`child-${U}`));return o.jsx(at,O({ref:l,component:i,color:"text.secondary",className:Ue(R.root,d),ownerState:v},c,{children:o.jsx(ct,{className:R.ol,ref:N,ownerState:v,children:ut(m||y&&L.length<=y?L:T(L),R.separator,p,v)})}))}),P0=pt;function ht(e){return Fe("MuiStepButton",e)}const ft=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),t0=ft,xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ht,t)},vt=se(m0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${t0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>O({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${t0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepButton"}),{children:n,className:d,icon:i,optional:a}=r,u=be(r,xt),{disabled:f,active:x}=C.useContext(I0),{orientation:b}=C.useContext(L0),y=O({},r,{orientation:b}),p=mt(y),c={icon:i,optional:a},m=s2(n,["StepLabel"])?C.cloneElement(n,c):o.jsx(K2,O({},c,{children:n}));return o.jsx(vt,O({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,d),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),bt=gt;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})=>O({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(o1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),zt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepContent"}),{children:n,className:d,TransitionComponent:i=o1,transitionDuration:a="auto",TransitionProps:u}=r,f=be(r,wt);C.useContext(L0);const{active:x,last:b,expanded:y}=C.useContext(I0),p=O({},r,{last:b}),c=Rt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Ct,O({className:Ue(c.root,d),ref:l,ownerState:p},f,{children:o.jsx(yt,O({as:i,in:x||y,className:c.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:n}))}))}),St=zt;var y1={},kt=Ne;Object.defineProperty(y1,"__esModule",{value:!0});var T0=y1.default=void 0,Mt=kt(Te()),It=o;T0=y1.default=(0,Mt.default)((0,It.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 z1={},Lt=Ne;Object.defineProperty(z1,"__esModule",{value:!0});var N0=z1.default=void 0,Pt=Lt(Te()),Tt=o;N0=z1.default=(0,Pt.default)((0,Tt.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 ze({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}ze.propTypes={size:h.number};ze.defaultProps={size:24};function S1({did:e,projectId:t,title:l,logo:r,describe:n}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${r}`,[a,u]=C.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(z0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(ge,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(ge,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:n||"/"})]})]})}S1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function k1({initUrl:e}){const t=m1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:n}=le(),{api:d}=je(),{api:i}=s1(),[a,u]=C.useState(!0),{blocklet:f}=Ve(),[x,b]=C.useState(null),[y,p]=C.useState(!1),c=We(M=>M.breakpoints.down("xl")),{componentDid:m=""}=l1(),[g,v]=C.useState(null),R=()=>{d.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const P=(M==null?void 0:M.projects)||[];u(!1),v(P)}).catch(M=>{u(!1),$.error(M.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=M=>{b(M)},T=()=>{u(!1),p(!0)},L=()=>{p(!1),b(null)},k=M=>{$.error(M.message),p(!1),b(null)},U=M=>{if(!(M!=null&&M.deleted)){$.error("Delete project failed");return}R(),p(!1),b(null)};if(C.useEffect(()=>{R()},[]),!g&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(ze,{})});if(!g)return null;if(!g.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:r("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),o.jsx(Ze,{onClick:S,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const P=g[M];return o.jsx(ue,{to:`${P.id}`,children:o.jsx(S1,{did:f.meta.did,projectId:P.id,logo:P.blockletLogo,title:P.blockletTitle,describe:P.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(y0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(Q1,{size:14,compact:!0,responsive:!1,did:M}):null}},c||m?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(Q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},c||m?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const P=(f.children||[]).find(E=>E.meta.did===M);return P?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:14,blocklet:P,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:P.meta.title})]},M):""}}},c||l?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(ge,{children:M})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(v0,{value:Number(M),locale:n})}},{label:r("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const P=g[M];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${P.id}/new-release/${P.lastReleaseId}`,children:o.jsx(ve,{title:r("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"create",children:o.jsx(R2,{style:{fontSize:18}})})})}),!!P.lastReleaseId&&o.jsx(ve,{title:r("blocklet.publish.viewLastRelease",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${P.id}/view/${P.lastReleaseId}`,children:o.jsx(T0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:r("blocklet.publish.delete",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"delete",onClick:()=>N(P),children:o.jsx(C0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),I=y?o.jsx(r2,{open:!0,popup:!0,onClose:L,action:"check-has-project-id",locale:n,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:k,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Nt,{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:r("common.blockletStudio")}),o.jsx(ve,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(N0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Ze,{onClick:S,variant:"contained",children:[o.jsx(g1,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(b1,{className:"main-table",locale:n,data:g,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(j1,{title:`${r("common.delete")} ${x.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:T,onCancel:()=>b(null),children:o.jsx(z,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(C2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(J,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),I]})}k1.propTypes={initUrl:h.object};k1.defaultProps={initUrl:null};const Nt=ae(z)`
|
|
1
|
+
const __vite__fileDeps=["assets/react-Z_lC3NCb.js","assets/index-CQ5dtdkj.js","assets/index-CCovGSMB.css","assets/index-Dbbnbznm.js","assets/preact.module-B1z5cdvs.js","assets/index-Bp8EriMk.js","assets/index-CuX6Kr95.js","assets/toUpper-uyyCk01r.js","assets/index-BLek-3-t.js","assets/fallback-DnwN40Eu.js","assets/index-UZz8l3in.js","assets/Toolbar-DT4-YRKk.js","assets/Hidden-BLcFQ9WU.js","assets/index-DkVlOvts.js","assets/MoreVert-xcNzKdjG.js","assets/selector-Bbx9AGcC.js","assets/ExpandMore-D04IjVlX.js","assets/Avatar-CaF_-TIa.js","assets/useSlot-CeeEaDXE.js","assets/resource-dialog-TfZOe9lD.js","assets/use-mobile-BOCpywmu.js","assets/OpenInNew-DLQ33Rpf.js","assets/CloseOutlined-QOb8qkQe.js","assets/Link-CHkL2_F8.js","assets/index-BykkL-cr.js","assets/index-Bg9DIh8M.js","assets/index-DuOVToRf.js","assets/FormControlLabel-BpMix3qK.js","assets/useFormControl-B5XnXwzO.js","assets/index-Cxiv-wGv.js","assets/FilterList-DUOw_RoL.js","assets/useThemeProps-Bp8oreMA.js","assets/toPropertyKey-hKuLU48H.js","assets/FormControl-Bh9aSU12.js","assets/FormGroup-BfB-iN7c.js","assets/InputLabel-BY35PBOn.js","assets/ListItemText-TxfvzIQH.js","assets/Select-0bmPPjw1.js","assets/TextField-BBIigLRk.js","assets/LastPage-DSqwop6h.js","assets/index-BEHMH1Pr.js","assets/redux-Nz09j_eP.js","assets/Search-Dg-t_NHQ.js","assets/Delete-C6X9S_ep.js","assets/index-DdoI0wbz.js","assets/url-join-xP4FWyyN.js","assets/uniqBy-nqPJ5tkT.js","assets/react-BW7E7-P9.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
+
import{ao as o2,j as o,aC as se,cF as m0,aG as O,fo as G1,aF as be,aA as $e,aB as Fe,T as J,r as C,aE as x1,aH as l2,aI as Ue,aJ as qe,cL as s2,fp as o1,X as Te,Y as Ne,B as z,m as Oe,P as h,$ as We,F as X,e as m1,u as le,aL as je,aU as Ve,bu as l1,a1 as Ze,L as ue,bH as v0,a as ve,ay as ie,J as r2,s as $,Z as ae,ds as n2,a9 as Ce,c as he,G as i2,bS as v1,cd as g0,cA as a2,cJ as He,cK as b0,bg as c2,c_ as d2,cE as Xe,bB as pe,c0 as Je,fa as u2,a7 as K1,b as oe,bj as p2,du as h2,ae as j0,bk as f2,ck as x2,aP as X1,aO as m2,a2 as w0,fq as J1,e$ as Ie,bh as v2,ap as R0,cR as g2,k as b2,ax as j2,al as w2,am as r1}from"./index-CQ5dtdkj.js";import{d as g1}from"./Add-BN237Fn5.js";import{d as R2}from"./AddBox-3LaPVxwU.js";import{d as C0}from"./Delete-C6X9S_ep.js";import{d as C2}from"./Error-DPYTfE3e.js";import{D as b1}from"./index-Cxiv-wGv.js";import{T as y0,b as y2}from"./index-BN8ZIYdG.js";import{C as j1}from"./confirm-DK53kjF4.js";import{u as s1}from"./session-CPBKqm92.js";import{W as Q1}from"./did-address-CuLpyDcV.js";import{B as w1,d as z2}from"./ChevronRight-Cg14uJfK.js";import{S as ge}from"./shorten-label-BlugIeNc.js";import{A as z0}from"./Avatar-CaF_-TIa.js";import{d as S2}from"./Download-CgS76hkn.js";import{d as k2}from"./QuestionMarkCircle-BfRCnC--.js";import{b as M2,c as Y1,T as I2}from"./index-BykkL-cr.js";import{_ as Me}from"./useSetState-Br77TPgt.js";import{c as R1}from"./index-CuX6Kr95.js";import{C as d1,F as u1,S as L2}from"./FormControlLabel-BpMix3qK.js";import{A as S0}from"./Alert-D6ASJuaD.js";import{p as e1}from"./index-HqFqdQ4r.js";import"./api-CWevC1Kw.js";import{i as P2}from"./index-CKBTEFra.js";import{d as T2}from"./ExpandMore-D04IjVlX.js";import{d as N2}from"./OpenInNew-DLQ33Rpf.js";import{u as k0}from"./useThemeProps-Bp8oreMA.js";import{u as V2}from"./useSlotProps-CSBBXTuv.js";import{d as D2}from"./DeleteOutline-DPoIruJ5.js";import{c as _2,A as M0,u as B2,S as E2,U as A2}from"./item-_msBYiLo.js";import{d as O2}from"./ArrowDropDown-BHT7uJ-_.js";import{f as Pe}from"./format-error-eqRBGF1p.js";import{B as p1}from"./ButtonGroup-BJxGB-mf.js";import{T as Le}from"./TextField-BBIigLRk.js";import{M as C1}from"./InputAdornment-4EnHL3SV.js";import{C as H2}from"./click-to-copy-D62iwIju.js";import{d as $2}from"./Launch-BYwPKhG2.js";import{L as F2}from"./MoreVert-xcNzKdjG.js";import{a as U2}from"./ListItemText-TxfvzIQH.js";import{S as Z1}from"./index-DuOVToRf.js";import{M as q2}from"./index-FHIuVSDt.js";import{r as W2}from"./index-DIJWsYQq.js";import{d as G2}from"./Done-CoG4jV3h.js";import{c as I0,d as L0,b as K2,S as X2,a as J2}from"./Stepper-QmSO1CtE.js";import{R as Q2,a as e0}from"./RadioGroup-sdHfzBzc.js";import"./FilterList-DUOw_RoL.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-Bh9aSU12.js";import"./useFormControl-B5XnXwzO.js";import"./FormGroup-BfB-iN7c.js";import"./InputLabel-BY35PBOn.js";import"./Select-0bmPPjw1.js";import"./LastPage-DSqwop6h.js";import"./Toolbar-DT4-YRKk.js";import"./index-BEHMH1Pr.js";import"./redux-Nz09j_eP.js";import"./Search-Dg-t_NHQ.js";import"./index-Bg9DIh8M.js";import"./Link-CHkL2_F8.js";import"./useSlot-CeeEaDXE.js";import"./jss-plugin-props-sort.esm-CuwRRnMZ.js";const Y2=o2(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"),Z2=["slots","slotProps"],et=se(m0)(({theme:e})=>O({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":O({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":O({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:G1(e.palette.grey[200],.12)}:{backgroundColor:G1(e.palette.grey[600],.12)})})),tt=se(Y2)({width:24,height:16});function ot(e){const{slots:t={},slotProps:l={}}=e,r=be(e,Z2),n=e;return o.jsx("li",{children:o.jsx(et,O({focusRipple:!0},r,{ownerState:n,children:o.jsx(tt,O({as:t.CollapsedIcon,ownerState:n},l.collapsedIcon))}))})}function lt(e){return Fe("MuiBreadcrumbs",e)}const st=$e("MuiBreadcrumbs",["root","ol","li","separator"]),rt=st,nt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],it=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},lt,t)},at=se(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${rt.li}`]:t.li},t.root]})({}),ct=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),dt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,t,l,r){return e.reduce((n,d,i)=>(i<e.length-1?n=n.concat(d,o.jsx(dt,{"aria-hidden":!0,className:t,ownerState:r,children:l},`separator-${i}`)):n.push(d),n),[])}const pt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiBreadcrumbs"}),{children:n,className:d,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:b=1,maxItems:y=8,separator:p="/"}=r,c=be(r,nt),[m,g]=C.useState(!1),v=O({},r,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:b,maxItems:y,separator:p}),R=it(v),S=l2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=C.useRef(null),T=k=>{const U=()=>{g(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return b+x>=k.length?k:[...k.slice(0,b),o.jsx(ot,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...k.slice(k.length-x,k.length)]},L=C.Children.toArray(n).filter(k=>C.isValidElement(k)).map((k,U)=>o.jsx("li",{className:R.li,children:k},`child-${U}`));return o.jsx(at,O({ref:l,component:i,color:"text.secondary",className:Ue(R.root,d),ownerState:v},c,{children:o.jsx(ct,{className:R.ol,ref:N,ownerState:v,children:ut(m||y&&L.length<=y?L:T(L),R.separator,p,v)})}))}),P0=pt;function ht(e){return Fe("MuiStepButton",e)}const ft=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),t0=ft,xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ht,t)},vt=se(m0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${t0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>O({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${t0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepButton"}),{children:n,className:d,icon:i,optional:a}=r,u=be(r,xt),{disabled:f,active:x}=C.useContext(I0),{orientation:b}=C.useContext(L0),y=O({},r,{orientation:b}),p=mt(y),c={icon:i,optional:a},m=s2(n,["StepLabel"])?C.cloneElement(n,c):o.jsx(K2,O({},c,{children:n}));return o.jsx(vt,O({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,d),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),bt=gt;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})=>O({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(o1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),zt=C.forwardRef(function(t,l){const r=x1({props:t,name:"MuiStepContent"}),{children:n,className:d,TransitionComponent:i=o1,transitionDuration:a="auto",TransitionProps:u}=r,f=be(r,wt);C.useContext(L0);const{active:x,last:b,expanded:y}=C.useContext(I0),p=O({},r,{last:b}),c=Rt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Ct,O({className:Ue(c.root,d),ref:l,ownerState:p},f,{children:o.jsx(yt,O({as:i,in:x||y,className:c.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:n}))}))}),St=zt;var y1={},kt=Ne;Object.defineProperty(y1,"__esModule",{value:!0});var T0=y1.default=void 0,Mt=kt(Te()),It=o;T0=y1.default=(0,Mt.default)((0,It.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 z1={},Lt=Ne;Object.defineProperty(z1,"__esModule",{value:!0});var N0=z1.default=void 0,Pt=Lt(Te()),Tt=o;N0=z1.default=(0,Pt.default)((0,Tt.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 ze({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}ze.propTypes={size:h.number};ze.defaultProps={size:24};function S1({did:e,projectId:t,title:l,logo:r,describe:n}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${r}`,[a,u]=C.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(z0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(ge,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(ge,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:n||"/"})]})]})}S1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function k1({initUrl:e}){const t=m1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:n}=le(),{api:d}=je(),{api:i}=s1(),[a,u]=C.useState(!0),{blocklet:f}=Ve(),[x,b]=C.useState(null),[y,p]=C.useState(!1),c=We(M=>M.breakpoints.down("xl")),{componentDid:m=""}=l1(),[g,v]=C.useState(null),R=()=>{d.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const P=(M==null?void 0:M.projects)||[];u(!1),v(P)}).catch(M=>{u(!1),$.error(M.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=M=>{b(M)},T=()=>{u(!1),p(!0)},L=()=>{p(!1),b(null)},k=M=>{$.error(M.message),p(!1),b(null)},U=M=>{if(!(M!=null&&M.deleted)){$.error("Delete project failed");return}R(),p(!1),b(null)};if(C.useEffect(()=>{R()},[]),!g&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(ze,{})});if(!g)return null;if(!g.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:r("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),o.jsx(Ze,{onClick:S,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const P=g[M];return o.jsx(ue,{to:`${P.id}`,children:o.jsx(S1,{did:f.meta.did,projectId:P.id,logo:P.blockletLogo,title:P.blockletTitle,describe:P.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(y0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(Q1,{size:14,compact:!0,responsive:!1,did:M}):null}},c||m?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(Q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},c||m?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const P=(f.children||[]).find(E=>E.meta.did===M);return P?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:14,blocklet:P,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:P.meta.title})]},M):""}}},c||l?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(ge,{children:M})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(v0,{value:Number(M),locale:n})}},{label:r("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const P=g[M];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${P.id}/new-release/${P.lastReleaseId}`,children:o.jsx(ve,{title:r("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"create",children:o.jsx(R2,{style:{fontSize:18}})})})}),!!P.lastReleaseId&&o.jsx(ve,{title:r("blocklet.publish.viewLastRelease",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${P.id}/view/${P.lastReleaseId}`,children:o.jsx(T0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:r("blocklet.publish.delete",{name:P.blockletTitle}),placement:"top",children:o.jsx(ie,{color:"primary","aria-label":"delete",onClick:()=>N(P),children:o.jsx(C0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),I=y?o.jsx(r2,{open:!0,popup:!0,onClose:L,action:"check-has-project-id",locale:n,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:k,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Nt,{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:r("common.blockletStudio")}),o.jsx(ve,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(N0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Ze,{onClick:S,variant:"contained",children:[o.jsx(g1,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(b1,{className:"main-table",locale:n,data:g,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(j1,{title:`${r("common.delete")} ${x.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:T,onCancel:()=>b(null),children:o.jsx(z,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(C2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(J,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),I]})}k1.propTypes={initUrl:h.object};k1.defaultProps={initUrl:null};const Nt=ae(z)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,a0="lastWantToConnectStoreId";function ql(e){var a,u;const[t,l]=C.useState(null),{session:r}=s1(),n=C.useCallback(f=>{l(f),localStorage.setItem(a0,f==null?void 0:f.id)},[l]),d=C.useMemo(()=>{var y,p,c,m;const f=localStorage.getItem(a0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(g=>g.id===f):null;if(x)return x;let b=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(g=>{var v;return!(g.id!==X.BLOCKLET_STORE.id||g.scope&&g.scope!=="studio"&&g.scope!==((v=r==null?void 0:r.user)==null?void 0:v.did))});return b||(b=(m=(c=e==null?void 0:e.settings)==null?void 0:c.storeList)==null?void 0:m[0]),b},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=r==null?void 0:r.user)==null?void 0:u.did]);return[t||d||{},n]}const a1={};async function $0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:r=4e3,timerKey:n=""}){a1[n]&&clearTimeout(a1[n]),await new Promise(a=>setTimeout(a,r));const d=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-d>l?u(f):n?a1[n]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Wl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Gl(e,{did:t,projectId:l,messageId:r}){return $0(async()=>{var d;const n=await e.getProject({input:{did:t,projectId:l,messageId:r}});if(!((d=n==null?void 0:n.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return n.project.blockletDid},{timerKey:"connect-studio"})}function Kl(e,{did:t,projectId:l,storeId:r}){return $0(async()=>{var i,a;const n=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=n==null?void 0:n.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!n.project.connectedStores.find(u=>u.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const F0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:r})=>{var i,a;const n=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let d=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===r),{teamDid:n,storeList:d}};function E1({blocklet:e,store:t={},onChangeStore:l,onClick:r,disabled:n,loading:d,componentDid:i}){var P,E,A;const{t:a}=le(),{session:u}=s1(),{api:f,info:x,inService:b}=je(),y=Ve(),[p,c]=C.useState(!1),m=C.useRef(null),[g,v]=C.useState(!1),[R,S]=C.useState(null),N=H=>{l(H),c(!1)},T=()=>{c(!0)},L=H=>{m.current&&m.current.contains(H.target)||c(!1)},k=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var H;if(R)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:R.url,projectId:"",scope:R.scope||"studio"}}),await((H=y==null?void 0:y.actions)==null?void 0:H.refreshBlocklet())}catch(q){$.error(`Remove Blocklet Store Error: ${Pe(q)}`)}finally{S(null)}},{storeList:I}=F0({fromBlocklet:b,blocklet:e,nodeInfo:x,componentDid:i,userDid:(P=u==null?void 0:u.user)==null?void 0:P.did}),M=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(p1,{disabled:n,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(oe,{onClick:r,children:[d&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(oe,{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(O2,{})})]}),o.jsx(p2,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:H})=>o.jsx(h2,{...H,style:{transformOrigin:"center top"},children:o.jsx(j0,{children:o.jsx(f2,{onClickAway:L,children:o.jsxs(x2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[I==null?void 0:I.map(q=>{var K;return o.jsxs(X1,{selected:q.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(q),children:[o.jsxs(z,{children:[o.jsx(ge,{sx:{fontSize:"16px"},maxLength:24,children:q.name}),o.jsx(ge,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:q.url})]}),_2({store:q,userDid:(K=u==null?void 0:u.user)==null?void 0:K.did})&&o.jsx(ie,{sx:{ml:1},onClick:G=>{G.preventDefault(),G.stopPropagation(),S(q)},children:o.jsx(pe,{icon:"ic:outline-delete"})})]},q.url)}),o.jsx(m2,{}),o.jsxs(X1,{onClick:k,children:[o.jsx(g1,{font:!0}),o.jsx(J,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),g&&o.jsx(M0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:M,storeList:I,scope:"studio",onAdd:(A=y==null?void 0:y.actions)==null?void 0:A.refreshBlocklet}),R&&o.jsx(j1,{displayError:!0,title:`${a("common.delete")} ${R.name}`,description:a("blocklet.publish.deleteStoreTip",{name:R.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}E1.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};E1.defaultProps={store:null,blocklet:null};const c0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],d0=1024*1024*10,u0=C.lazy(()=>w0(()=>import("./react-ChRfz7rm.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])).then(e=>({default:e.Uploader})));function U0({projectId:e,readOnly:t,loading:l,blocklet:r,params:n,setParams:d,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:b,componentDid:y}){const{t:p}=le(),{api:c}=je(),m=m1(),g=C.useRef(null),v=C.useRef(null),[R,S]=ql(r),N=B2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async P=>{const E=setTimeout(()=>{u(!1)},2e4),A=await Gl(c,P);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},L=()=>{if(!n.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(R!=null&&R.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const P=Wl();N(async(E,A)=>{var H,q,K;try{const G=await c.connectByStudio({input:{did:(H=r==null?void 0:r.meta)==null?void 0:H.did,blockletTitle:n==null?void 0:n.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:((q=n==null?void 0:n.blockletComponents)==null?void 0:q.length)>0?"pack":"resource",componentDid:y,messageId:P,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(G!=null&&G.url)){$.error("failed to connect to store");return}A(G.url),T({did:(K=r==null?void 0:r.meta)==null?void 0:K.did,projectId:"",messageId:P})}catch(G){const Y=Pe(G);$.error(Y),u(!1)}})},k=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,V=n!=null&&n.blockletLogo?`${k}/${n.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,I=((n==null?void 0:n.blockletScreenshots)||[]).filter(Boolean).map(P=>`${U}/${P}`),M=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Xl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{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:n.blockletTitle||"",onChange:P=>{a({blockletTitle:""}),d({blockletTitle:P.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Le,{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(C1,{position:"end",children:o.jsx(E1,{blocklet:r,store:R,componentDid:y,onChangeStore:S,disabled:!n.blockletTitle||t||l,loading:l,onClick:L})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Le,{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:n.blockletDescription||"",onChange:P=>{a({blockletDescription:""}),d({blockletDescription:P.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(J,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(z0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{M()&&g.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(J,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[I.map((P,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:P}),!t&&o.jsx(ie,{className:"action",onClick:()=>{d(A=>{const H=[...A.blockletScreenshots];return H.splice(E,1),{...A,blockletScreenshots:H}})},children:o.jsx(D2,{})})]},P)),I.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:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(C.Suspense,{fallback:o.jsx(ze,{}),children:[o.jsx(u0,{ref:g,popup:!0,onUploadFinish:P=>{d({blockletLogo:P.data.filename}),b(""),g.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(u0,{ref:v,popup:!0,onUploadFinish:P=>{d(E=>{var H;const A=E.blockletScreenshots||[];return A.push((H=P.data)==null?void 0:H.filename),{...E,blockletScreenshots:A}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:5-I.length}}},"uploader-screenshot")]})]})}U0.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 Xl=ae.div`
|
|
136
|
+
`,a0="lastWantToConnectStoreId";function ql(e){var a,u;const[t,l]=C.useState(null),{session:r}=s1(),n=C.useCallback(f=>{l(f),localStorage.setItem(a0,f==null?void 0:f.id)},[l]),d=C.useMemo(()=>{var y,p,c,m;const f=localStorage.getItem(a0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(g=>g.id===f):null;if(x)return x;let b=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(g=>{var v;return!(g.id!==X.BLOCKLET_STORE.id||g.scope&&g.scope!=="studio"&&g.scope!==((v=r==null?void 0:r.user)==null?void 0:v.did))});return b||(b=(m=(c=e==null?void 0:e.settings)==null?void 0:c.storeList)==null?void 0:m[0]),b},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=r==null?void 0:r.user)==null?void 0:u.did]);return[t||d||{},n]}const a1={};async function $0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:r=4e3,timerKey:n=""}){a1[n]&&clearTimeout(a1[n]),await new Promise(a=>setTimeout(a,r));const d=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-d>l?u(f):n?a1[n]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Wl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Gl(e,{did:t,projectId:l,messageId:r}){return $0(async()=>{var d;const n=await e.getProject({input:{did:t,projectId:l,messageId:r}});if(!((d=n==null?void 0:n.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return n.project.blockletDid},{timerKey:"connect-studio"})}function Kl(e,{did:t,projectId:l,storeId:r}){return $0(async()=>{var i,a;const n=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=n==null?void 0:n.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!n.project.connectedStores.find(u=>u.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const F0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:r})=>{var i,a;const n=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let d=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===r),{teamDid:n,storeList:d}};function E1({blocklet:e,store:t={},onChangeStore:l,onClick:r,disabled:n,loading:d,componentDid:i}){var P,E,A;const{t:a}=le(),{session:u}=s1(),{api:f,info:x,inService:b}=je(),y=Ve(),[p,c]=C.useState(!1),m=C.useRef(null),[g,v]=C.useState(!1),[R,S]=C.useState(null),N=H=>{l(H),c(!1)},T=()=>{c(!0)},L=H=>{m.current&&m.current.contains(H.target)||c(!1)},k=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var H;if(R)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:R.url,projectId:"",scope:R.scope||"studio"}}),await((H=y==null?void 0:y.actions)==null?void 0:H.refreshBlocklet())}catch(q){$.error(`Remove Blocklet Store Error: ${Pe(q)}`)}finally{S(null)}},{storeList:I}=F0({fromBlocklet:b,blocklet:e,nodeInfo:x,componentDid:i,userDid:(P=u==null?void 0:u.user)==null?void 0:P.did}),M=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(p1,{disabled:n,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(oe,{onClick:r,children:[d&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(oe,{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(O2,{})})]}),o.jsx(p2,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:H})=>o.jsx(h2,{...H,style:{transformOrigin:"center top"},children:o.jsx(j0,{children:o.jsx(f2,{onClickAway:L,children:o.jsxs(x2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[I==null?void 0:I.map(q=>{var K;return o.jsxs(X1,{selected:q.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(q),children:[o.jsxs(z,{children:[o.jsx(ge,{sx:{fontSize:"16px"},maxLength:24,children:q.name}),o.jsx(ge,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:q.url})]}),_2({store:q,userDid:(K=u==null?void 0:u.user)==null?void 0:K.did})&&o.jsx(ie,{sx:{ml:1},onClick:G=>{G.preventDefault(),G.stopPropagation(),S(q)},children:o.jsx(pe,{icon:"ic:outline-delete"})})]},q.url)}),o.jsx(m2,{}),o.jsxs(X1,{onClick:k,children:[o.jsx(g1,{font:!0}),o.jsx(J,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),g&&o.jsx(M0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:M,storeList:I,scope:"studio",onAdd:(A=y==null?void 0:y.actions)==null?void 0:A.refreshBlocklet}),R&&o.jsx(j1,{displayError:!0,title:`${a("common.delete")} ${R.name}`,description:a("blocklet.publish.deleteStoreTip",{name:R.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}E1.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};E1.defaultProps={store:null,blocklet:null};const c0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],d0=1024*1024*10,u0=C.lazy(()=>w0(()=>import("./react-Z_lC3NCb.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])).then(e=>({default:e.Uploader})));function U0({projectId:e,readOnly:t,loading:l,blocklet:r,params:n,setParams:d,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:b,componentDid:y}){const{t:p}=le(),{api:c}=je(),m=m1(),g=C.useRef(null),v=C.useRef(null),[R,S]=ql(r),N=B2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async P=>{const E=setTimeout(()=>{u(!1)},2e4),A=await Gl(c,P);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},L=()=>{if(!n.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(R!=null&&R.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const P=Wl();N(async(E,A)=>{var H,q,K;try{const G=await c.connectByStudio({input:{did:(H=r==null?void 0:r.meta)==null?void 0:H.did,blockletTitle:n==null?void 0:n.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:((q=n==null?void 0:n.blockletComponents)==null?void 0:q.length)>0?"pack":"resource",componentDid:y,messageId:P,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(G!=null&&G.url)){$.error("failed to connect to store");return}A(G.url),T({did:(K=r==null?void 0:r.meta)==null?void 0:K.did,projectId:"",messageId:P})}catch(G){const Y=Pe(G);$.error(Y),u(!1)}})},k=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,V=n!=null&&n.blockletLogo?`${k}/${n.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,I=((n==null?void 0:n.blockletScreenshots)||[]).filter(Boolean).map(P=>`${U}/${P}`),M=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Xl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{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:n.blockletTitle||"",onChange:P=>{a({blockletTitle:""}),d({blockletTitle:P.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Le,{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(C1,{position:"end",children:o.jsx(E1,{blocklet:r,store:R,componentDid:y,onChangeStore:S,disabled:!n.blockletTitle||t||l,loading:l,onClick:L})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Le,{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:n.blockletDescription||"",onChange:P=>{a({blockletDescription:""}),d({blockletDescription:P.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(J,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(z0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{M()&&g.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(J,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[I.map((P,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:P}),!t&&o.jsx(ie,{className:"action",onClick:()=>{d(A=>{const H=[...A.blockletScreenshots];return H.splice(E,1),{...A,blockletScreenshots:H}})},children:o.jsx(D2,{})})]},P)),I.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:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(C.Suspense,{fallback:o.jsx(ze,{}),children:[o.jsx(u0,{ref:g,popup:!0,onUploadFinish:P=>{d({blockletLogo:P.data.filename}),b(""),g.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(u0,{ref:v,popup:!0,onUploadFinish:P=>{d(E=>{var H;const A=E.blockletScreenshots||[];return A.push((H=P.data)==null?void 0:H.filename),{...E,blockletScreenshots:A}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:c0,maxFileSize:d0,maxNumberOfFiles:5-I.length}}},"uploader-screenshot")]})]})}U0.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 Xl=ae.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{ao as o2,j as o,aD as se,cF as m0,aH as O,fn as G1,aG as be,aB as $e,aC a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function X0({text:e}){return e?o.jsx(q2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[W2,{target:"_blank"}]]}):o.jsx(ye,{Icon:Ge})}X0.propTypes={text:h.string.isRequired};function J0({params:e,setParams:t,paramsErrTip:l,loading:r,setParamsErrTip:n,readOnly:d}){var x;const{t:i}=le(),[a,u]=C.useState(d?"preview":"write"),f=(b,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(J,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(M2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Y1,{value:"write",label:"Write"}),o.jsx(Y1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Le,{disabled:r||d,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:o.jsxs(C1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",Ce.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:b=>{n({blockletIntroduction:""}),t({blockletIntroduction:b.target.value.slice(0,Ce.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(X0,{text:e.blockletIntroduction||""})})]})}J0.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 H1={},r3=Ne;Object.defineProperty(H1,"__esModule",{value:!0});var Q0=H1.default=void 0,n3=r3(Te()),p0=o;Q0=H1.default=(0,n3.default)([(0,p0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,p0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function $1({step:e,ok:t,active:l,error:r}){let n="grey.500",d=e+1;return t&&(d=o.jsx(G2,{sx:{fontSize:18,margin:0},color:"white"})),r||!t&&l>e?(n="error.main",d=o.jsx(Q0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(n="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:n,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:d})}$1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};$1.defaultProps={step:0,ok:!1,active:0,error:""};function Y0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:r,params:n,loading:d,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=le(),x=()=>{l(c=>c+1)},b=()=>{l(c=>c-1)},y=c=>c===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):c===2?i==null?void 0:i.blockletResource:c>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||W0({hasSelectedResources:r,params:n,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(X2,{activeStep:t,orientation:"vertical",children:e.map((c,m)=>{const g={},v=d||!l3({hasSelectedResources:r,params:n,projectId:u,step:m,t:f}),R=d?"":y(m);return R&&(g.optional=o.jsx(J,{variant:"caption",color:"error",children:R}),g.error=!0),o.jsxs(J2,{children:[o.jsx(bt,{icon:o.jsx($1,{error:R,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:R?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...g,children:o.jsx(J,{fontSize:"14px",fontWeight:"500",color:R||!v&&t>m?"error.main":"inherit",children:c.label})}),o.jsxs(St,{children:[o.jsx(J,{fontSize:12,children:c.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(oe,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:R||!v,children:f("common.continue")}),m>0&&o.jsx(oe,{disabled:m===0,onClick:b,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},c.label)})}),t>=e.length-1&&o.jsx(j0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(J,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}Y0.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 i3=[".zip",".gz"],a3=1024*1024*100,c3=C.lazy(()=>w0(()=>import("./react-ChRfz7rm.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])).then(e=>({default:e.Uploader})));function F1({app:e,projectId:t,readOnly:l,params:r,setParams:n,setParamsErrTip:d,error:i}){const{t:a}=le(),u=C.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(J,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(L2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!r.uploadedResource&&o.jsx(J,{component:"a",href:`${x}/params.uploadedResource`,children:r.uploadedResource}),!l&&o.jsx(oe,{variant:"outlined",size:"small",onClick:()=>{var b;f()&&((b=u.current)==null||b.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(C.Suspense,{fallback:o.jsx(ze,{}),children:o.jsx(c3,{ref:u,popup:!0,onUploadFinish:b=>{var y;n({uploadedResource:b.data.filename}),d({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:i3,maxFileSize:a3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}F1.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};F1.defaultProps={};function t1({readOnly:e,params:t,setParams:l,paramsErrTip:r,setParamsErrTip:n,loading:d}){var a;const{t:i}=le();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{required:!0,disabled:d||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=>{n({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),o.jsx(Le,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(C1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",Ce.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{n({note:""}),l({note:u.target.value.slice(0,Ce.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}t1.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};t1.defaultProps={};const d3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const r=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},r),value:r})},h0=(e,t)=>{const l=v1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(r=>({...r,included:!0})):l.blockletComponents=(t.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},u3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},f0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function U1({initUrl:e,...t}){var W1;const{projectId:l,mode:r,releaseId:n,componentDid:d=""}=l1(),{t:i}=le(),{blocklet:a}=Ve(),[u,f]=Me({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,b]=Me({}),[y,p]=C.useState(!1),[c,m]=Me(null),{api:g}=je(),v=We(D=>D.breakpoints.down("md")),[R,S]=C.useState({}),[N,T]=C.useState(!1),L=C.useRef({}),[k,U]=Me({}),[V,I]=C.useState(""),[M,P]=Me({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),A=E==="readonly",H=C.useMemo(()=>{const D={};return Object.keys(M).forEach(_=>{const Re=M[_];Re&&Re.forEach(t2=>{D[t2]=!0})}),D},[M]),q=C.useCallback(D=>{A&&f({blockletComponents:[]}),P(D)},[A,P,f]),K=C.useCallback((...D)=>{U(...D),b({blockletResource:""})},[]),G=n==="none"?(u==null?void 0:u.lastReleaseId)||"":n,[Y,Se]=C.useState(r==="new-release"?4:0);C.useEffect(()=>{l&&b({projectId:""})},[l,b]);const fe=C.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(H).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,H]),ce=[],te=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!d||D.meta.did===d);te.forEach(D=>{d3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[Q,xe]=C.useState((W1=ce[0])==null?void 0:W1.value),de=!N&&(c==null?void 0:c.status)==="published",F=de,Z=b2(()=>{if(!e)return;I(e.searchParams.get("logo")),f(_=>{var Re;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:(Re=_==null?void 0:_.blockletComponents)!=null&&Re.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{}}),B=async()=>{if(G)try{const D=await g.getRelease({input:{did:a.meta.did,projectId:l,releaseId:G}});if(p(!1),!D.release){$.error("Release not found");return}r!=="view"&&(D.release.note=""),f(_=>h0({..._,...D.release,blockletVersion:r==="create"||r==="new-release"?Ie.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Pe(D))}},re=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const D=await g.getProject({input:{did:a.meta.did,projectId:l}});p(!1);const _=D.project||{};_.blockletVersion?(r==="create"||r==="new-release")&&Ie.valid(_.blockletVersion)&&(_.blockletVersion=Ie.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Re=h0(_,a);f(Re),_.lastReleaseId||Z()}catch(D){p(!1),$.error(Pe(D))}},ne=C.useCallback(async()=>{if(r==="view"){if(!G){$.error("Empty release id");return}await re(),await B();return}await re(),G&&(T(!0),await B())},[r,G]),Ke=D=>{f({blockletComponents:D})};C.useEffect(()=>{ne()},[ne]),C.useEffect(()=>{l===X.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&Z()},[l,e,r,Z]);const _e=C.useMemo(()=>!!Object.keys(k).find(D=>!!k[D].length),[k]);if(!u&&y)return o.jsx(ze,{});if(!u)return null;const Be=te.find(D=>D.meta.did===Q);if(te.every(D=>D.status!=="running")&&(te!=null&&te.length))return o.jsx(ye,{children:i("blocklet.publish.allComponentsNotRunning")});const ee=D=>{xe(D)},Ee=e==null?void 0:e.searchParams.get("resourcesTitle"),q1=e==null?void 0:e.searchParams.get("componentsTitle"),ke=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Ee||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:q1||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],e2=ke[Y]||ke[ke.length-1],we=u3[Y];return o.jsxs(p3,{...t,children:[o.jsx(K0,{blocklet:a,release:c,getData:ne,getRelease:B,mode:r,params:u,setParams:f,setParamsErrTip:b,readOnly:F,isPublished:de,loading:y,setLoading:p,initLogoUrl:V,releaseId:G,projectId:l,projectType:fe,resourceComponents:te,resourceComponentsMap:M,resourceRelateComponents:H,resourceItem:Be,saveSelectedEventsRef:L,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(Y0,{steps:ke,viewMode:r==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Y,setActiveStep:Se,projectId:l,resourcesUrlTitle:Ee,componentsUrlTitle:q1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&we!=="introduction"&&o.jsxs(J,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[e2.label,we==="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(k2,{})})})]}),(v||we==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(U0,{projectId:l,setParams:f,setParamsErrTip:b,params:u,componentDid:d,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:F,initLogoUrl:V,setInitLogoUrl:I})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})}),(v||we==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(J0,{loading:y,readOnly:F,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:b})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.resources].label}),o.jsx(z,{display:v||we==="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(Q2,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!d&&o.jsx(I2,{tabs:ce,current:Q,onChange:ee,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(B1,{loading:y,initialResources:R,saveSelectedEventsRef:L,selectedResourceIds:k,setSelectedResourceIds:K,setResourceComponentsMap:q,error:x.blockletResource,app:a,readOnly:F,component:Be,componentDid:d,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...c,id:G}})]}),!u.resourceFromSelect&&o.jsx(F1,{app:a,readOnly:F,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:b})]})})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.blocklets].label}),(v||we==="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(L1,{projectType:fe,disabled:y||F,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:H,dependentComponentsMode:E})})})}),!v&&we==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})})]})]})]})]})}U1.propTypes={initUrl:h.object};U1.defaultProps={initUrl:null};const p3=ae.div`
|
|
181
|
+
`;function X0({text:e}){return e?o.jsx(q2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[W2,{target:"_blank"}]]}):o.jsx(ye,{Icon:Ge})}X0.propTypes={text:h.string.isRequired};function J0({params:e,setParams:t,paramsErrTip:l,loading:r,setParamsErrTip:n,readOnly:d}){var x;const{t:i}=le(),[a,u]=C.useState(d?"preview":"write"),f=(b,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(J,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(M2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Y1,{value:"write",label:"Write"}),o.jsx(Y1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Le,{disabled:r||d,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:o.jsxs(C1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",Ce.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:b=>{n({blockletIntroduction:""}),t({blockletIntroduction:b.target.value.slice(0,Ce.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(X0,{text:e.blockletIntroduction||""})})]})}J0.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 H1={},r3=Ne;Object.defineProperty(H1,"__esModule",{value:!0});var Q0=H1.default=void 0,n3=r3(Te()),p0=o;Q0=H1.default=(0,n3.default)([(0,p0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,p0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function $1({step:e,ok:t,active:l,error:r}){let n="grey.500",d=e+1;return t&&(d=o.jsx(G2,{sx:{fontSize:18,margin:0},color:"white"})),r||!t&&l>e?(n="error.main",d=o.jsx(Q0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(n="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:n,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:d})}$1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};$1.defaultProps={step:0,ok:!1,active:0,error:""};function Y0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:r,params:n,loading:d,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=le(),x=()=>{l(c=>c+1)},b=()=>{l(c=>c-1)},y=c=>c===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):c===2?i==null?void 0:i.blockletResource:c>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||W0({hasSelectedResources:r,params:n,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(X2,{activeStep:t,orientation:"vertical",children:e.map((c,m)=>{const g={},v=d||!l3({hasSelectedResources:r,params:n,projectId:u,step:m,t:f}),R=d?"":y(m);return R&&(g.optional=o.jsx(J,{variant:"caption",color:"error",children:R}),g.error=!0),o.jsxs(J2,{children:[o.jsx(bt,{icon:o.jsx($1,{error:R,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:R?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...g,children:o.jsx(J,{fontSize:"14px",fontWeight:"500",color:R||!v&&t>m?"error.main":"inherit",children:c.label})}),o.jsxs(St,{children:[o.jsx(J,{fontSize:12,children:c.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(oe,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:R||!v,children:f("common.continue")}),m>0&&o.jsx(oe,{disabled:m===0,onClick:b,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},c.label)})}),t>=e.length-1&&o.jsx(j0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(J,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}Y0.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 i3=[".zip",".gz"],a3=1024*1024*100,c3=C.lazy(()=>w0(()=>import("./react-Z_lC3NCb.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])).then(e=>({default:e.Uploader})));function F1({app:e,projectId:t,readOnly:l,params:r,setParams:n,setParamsErrTip:d,error:i}){const{t:a}=le(),u=C.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(J,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(L2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!r.uploadedResource&&o.jsx(J,{component:"a",href:`${x}/params.uploadedResource`,children:r.uploadedResource}),!l&&o.jsx(oe,{variant:"outlined",size:"small",onClick:()=>{var b;f()&&((b=u.current)==null||b.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(C.Suspense,{fallback:o.jsx(ze,{}),children:o.jsx(c3,{ref:u,popup:!0,onUploadFinish:b=>{var y;n({uploadedResource:b.data.filename}),d({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:i3,maxFileSize:a3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}F1.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};F1.defaultProps={};function t1({readOnly:e,params:t,setParams:l,paramsErrTip:r,setParamsErrTip:n,loading:d}){var a;const{t:i}=le();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Le,{required:!0,disabled:d||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=>{n({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),o.jsx(Le,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(C1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",Ce.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{n({note:""}),l({note:u.target.value.slice(0,Ce.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}t1.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};t1.defaultProps={};const d3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const r=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(w1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},r),value:r})},h0=(e,t)=>{const l=v1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(r=>({...r,included:!0})):l.blockletComponents=(t.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},u3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},f0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function U1({initUrl:e,...t}){var W1;const{projectId:l,mode:r,releaseId:n,componentDid:d=""}=l1(),{t:i}=le(),{blocklet:a}=Ve(),[u,f]=Me({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,b]=Me({}),[y,p]=C.useState(!1),[c,m]=Me(null),{api:g}=je(),v=We(D=>D.breakpoints.down("md")),[R,S]=C.useState({}),[N,T]=C.useState(!1),L=C.useRef({}),[k,U]=Me({}),[V,I]=C.useState(""),[M,P]=Me({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),A=E==="readonly",H=C.useMemo(()=>{const D={};return Object.keys(M).forEach(_=>{const Re=M[_];Re&&Re.forEach(t2=>{D[t2]=!0})}),D},[M]),q=C.useCallback(D=>{A&&f({blockletComponents:[]}),P(D)},[A,P,f]),K=C.useCallback((...D)=>{U(...D),b({blockletResource:""})},[]),G=n==="none"?(u==null?void 0:u.lastReleaseId)||"":n,[Y,Se]=C.useState(r==="new-release"?4:0);C.useEffect(()=>{l&&b({projectId:""})},[l,b]);const fe=C.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(H).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,H]),ce=[],te=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!d||D.meta.did===d);te.forEach(D=>{d3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[Q,xe]=C.useState((W1=ce[0])==null?void 0:W1.value),de=!N&&(c==null?void 0:c.status)==="published",F=de,Z=b2(()=>{if(!e)return;I(e.searchParams.get("logo")),f(_=>{var Re;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:(Re=_==null?void 0:_.blockletComponents)!=null&&Re.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{}}),B=async()=>{if(G)try{const D=await g.getRelease({input:{did:a.meta.did,projectId:l,releaseId:G}});if(p(!1),!D.release){$.error("Release not found");return}r!=="view"&&(D.release.note=""),f(_=>h0({..._,...D.release,blockletVersion:r==="create"||r==="new-release"?Ie.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Pe(D))}},re=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const D=await g.getProject({input:{did:a.meta.did,projectId:l}});p(!1);const _=D.project||{};_.blockletVersion?(r==="create"||r==="new-release")&&Ie.valid(_.blockletVersion)&&(_.blockletVersion=Ie.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Re=h0(_,a);f(Re),_.lastReleaseId||Z()}catch(D){p(!1),$.error(Pe(D))}},ne=C.useCallback(async()=>{if(r==="view"){if(!G){$.error("Empty release id");return}await re(),await B();return}await re(),G&&(T(!0),await B())},[r,G]),Ke=D=>{f({blockletComponents:D})};C.useEffect(()=>{ne()},[ne]),C.useEffect(()=>{l===X.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&Z()},[l,e,r,Z]);const _e=C.useMemo(()=>!!Object.keys(k).find(D=>!!k[D].length),[k]);if(!u&&y)return o.jsx(ze,{});if(!u)return null;const Be=te.find(D=>D.meta.did===Q);if(te.every(D=>D.status!=="running")&&(te!=null&&te.length))return o.jsx(ye,{children:i("blocklet.publish.allComponentsNotRunning")});const ee=D=>{xe(D)},Ee=e==null?void 0:e.searchParams.get("resourcesTitle"),q1=e==null?void 0:e.searchParams.get("componentsTitle"),ke=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Ee||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:q1||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],e2=ke[Y]||ke[ke.length-1],we=u3[Y];return o.jsxs(p3,{...t,children:[o.jsx(K0,{blocklet:a,release:c,getData:ne,getRelease:B,mode:r,params:u,setParams:f,setParamsErrTip:b,readOnly:F,isPublished:de,loading:y,setLoading:p,initLogoUrl:V,releaseId:G,projectId:l,projectType:fe,resourceComponents:te,resourceComponentsMap:M,resourceRelateComponents:H,resourceItem:Be,saveSelectedEventsRef:L,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(Y0,{steps:ke,viewMode:r==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Y,setActiveStep:Se,projectId:l,resourcesUrlTitle:Ee,componentsUrlTitle:q1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&we!=="introduction"&&o.jsxs(J,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[e2.label,we==="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(k2,{})})})]}),(v||we==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(U0,{projectId:l,setParams:f,setParamsErrTip:b,params:u,componentDid:d,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:F,initLogoUrl:V,setInitLogoUrl:I})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})}),(v||we==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(J0,{loading:y,readOnly:F,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:b})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.resources].label}),o.jsx(z,{display:v||we==="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(Q2,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(u1,{value:"select",disabled:F,control:o.jsx(e0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!d&&o.jsx(I2,{tabs:ce,current:Q,onChange:ee,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(B1,{loading:y,initialResources:R,saveSelectedEventsRef:L,selectedResourceIds:k,setSelectedResourceIds:K,setResourceComponentsMap:q,error:x.blockletResource,app:a,readOnly:F,component:Be,componentDid:d,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...c,id:G}})]}),!u.resourceFromSelect&&o.jsx(F1,{app:a,readOnly:F,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:b})]})})}),v&&o.jsx(J,{variant:"h6",fontWeight:"bold",mt:5,children:ke[f0.blocklets].label}),(v||we==="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(L1,{projectType:fe,disabled:y||F,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:H,dependentComponentsMode:E})})})}),!v&&we==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(t1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:b,readOnly:F})})]})]})]})]})}U1.propTypes={initUrl:h.object};U1.defaultProps={initUrl:null};const p3=ae.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,j as c,P as f,a1 as d}from"./index-
|
|
1
|
+
import{r as v,j as c,P as f,a1 as d}from"./index-CQ5dtdkj.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});var s=o.default=void 0;m(v);var n=c;function m(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),r.push.apply(r,a)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(a){y(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function y(e,t,r){return t=g(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e){var t=j(e,"string");return typeof t=="symbol"?t:String(t)}function j(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i=function(t){return(0,n.jsxs)("svg",u(u({},t),{},{children:[(0,n.jsx)("path",{d:"M24.604 2.263L28.524 0H42.79v41.862H28.79a1 1 0 0 1-.5-.134l-15.103-8.72V8.854l1.817-1.05 3.2 1.848-1.817 1.05V31.16l12.993 7.502H39.59V3.2H29.38l-1.576.91-3.2-1.847z"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.402 31.16V10.701L13.409 3.2H3.2v35.462h10.21l1.58-.913 3.2 1.847-3.923 2.266H0V0h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z"}),(0,n.jsx)("path",{d:"M138.44 27.684c.192 0 .357.075.496.224l1.344 1.472a9.584 9.584 0 0 1-3.44 2.576c-1.344.608-2.965.912-4.864.912-1.664 0-3.173-.288-4.528-.864a10.056 10.056 0 0 1-3.456-2.416c-.949-1.035-1.685-2.272-2.208-3.712-.523-1.44-.784-3.024-.784-4.752 0-1.728.272-3.312.816-4.752.555-1.44 1.328-2.677 2.32-3.712a10.444 10.444 0 0 1 3.552-2.416c1.387-.576 2.917-.864 4.592-.864 1.632 0 3.083.267 4.352.8a10.973 10.973 0 0 1 3.312 2.128l-1.12 1.584a.936.936 0 0 1-.288.288.742.742 0 0 1-.432.112c-.203 0-.443-.101-.72-.304a8.802 8.802 0 0 0-1.072-.672c-.437-.256-.981-.485-1.632-.688-.651-.203-1.461-.304-2.432-.304-1.141 0-2.187.203-3.136.608a6.885 6.885 0 0 0-2.464 1.728c-.683.747-1.216 1.67-1.6 2.768-.373 1.088-.56 2.32-.56 3.696 0 1.397.197 2.64.592 3.728.395 1.088.939 2.01 1.632 2.768a6.914 6.914 0 0 0 2.448 1.728 7.764 7.764 0 0 0 3.04.592c.661 0 1.253-.037 1.776-.112a7.843 7.843 0 0 0 1.456-.368c.448-.16.869-.363 1.264-.608a8.89 8.89 0 0 0 1.168-.912c.085-.075.176-.133.272-.176a.616.616 0 0 1 .304-.08zM149.68 16.1c1.195 0 2.272.197 3.232.592a6.54 6.54 0 0 1 2.464 1.68c.683.725 1.205 1.605 1.568 2.64.363 1.024.544 2.176.544 3.456 0 1.28-.181 2.437-.544 3.472-.363 1.035-.885 1.915-1.568 2.64a6.795 6.795 0 0 1-2.464 1.68c-.96.384-2.037.576-3.232.576-1.205 0-2.293-.192-3.264-.576a6.987 6.987 0 0 1-2.464-1.68c-.683-.725-1.211-1.605-1.584-2.64-.363-1.035-.544-2.192-.544-3.472 0-1.28.181-2.432.544-3.456.373-1.035.901-1.915 1.584-2.64a6.717 6.717 0 0 1 2.464-1.68c.971-.395 2.059-.592 3.264-.592zm0 14.304c1.536 0 2.683-.517 3.44-1.552.757-1.035 1.136-2.49 1.136-4.368 0-1.877-.379-3.333-1.136-4.368-.757-1.045-1.904-1.568-3.44-1.568-1.557 0-2.72.523-3.488 1.568-.757 1.035-1.136 2.49-1.136 4.368 0 1.877.379 3.333 1.136 4.368.768 1.035 1.931 1.552 3.488 1.552zM163.899 18.612c.352-.373.72-.715 1.104-1.024a6.73 6.73 0 0 1 1.216-.784 6.195 6.195 0 0 1 1.392-.512 6.442 6.442 0 0 1 1.6-.192c.896 0 1.68.15 2.352.448.682.299 1.253.72 1.712 1.264.458.533.805 1.179 1.04 1.936.234.757.352 1.595.352 2.512v10.352h-3.136V22.26c0-1.163-.267-2.064-.8-2.704-.534-.65-1.35-.976-2.448-.976-.8 0-1.552.192-2.256.576a7.38 7.38 0 0 0-1.936 1.536v11.92h-3.12V16.356h1.872c.437 0 .709.208.816.624l.24 1.632zM181.805 18.612c.352-.373.72-.715 1.104-1.024a6.73 6.73 0 0 1 1.216-.784 6.195 6.195 0 0 1 1.392-.512 6.448 6.448 0 0 1 1.6-.192c.896 0 1.68.15 2.352.448a4.63 4.63 0 0 1 1.712 1.264c.459.533.805 1.179 1.04 1.936.235.757.352 1.595.352 2.512v10.352h-3.136V22.26c0-1.163-.267-2.064-.8-2.704-.533-.65-1.349-.976-2.448-.976-.8 0-1.552.192-2.256.576a7.396 7.396 0 0 0-1.936 1.536v11.92h-3.12V16.356h1.872c.437 0 .709.208.816.624l.24 1.632zM207.551 22.676c0-.619-.09-1.19-.272-1.712a3.77 3.77 0 0 0-.768-1.36 3.521 3.521 0 0 0-1.248-.896c-.49-.213-1.056-.32-1.696-.32-1.312 0-2.346.379-3.104 1.136-.746.757-1.221 1.808-1.424 3.152h8.512zm2.576 7.616a6.311 6.311 0 0 1-1.328 1.168 7.926 7.926 0 0 1-1.6.784 9.664 9.664 0 0 1-1.76.448c-.597.096-1.189.144-1.776.144-1.12 0-2.16-.187-3.12-.56a7.159 7.159 0 0 1-2.48-1.664c-.693-.736-1.237-1.643-1.632-2.72-.384-1.088-.576-2.336-.576-3.744 0-1.13.176-2.181.528-3.152a7.67 7.67 0 0 1 1.504-2.56 7.064 7.064 0 0 1 2.416-1.712c.95-.416 2.016-.624 3.2-.624.992 0 1.904.165 2.736.496.843.32 1.568.79 2.176 1.408.608.619 1.083 1.381 1.424 2.288.352.907.528 1.941.528 3.104 0 .48-.053.805-.16.976-.106.16-.304.24-.592.24h-10.656c.032.97.171 1.819.416 2.544.246.715.582 1.312 1.008 1.792.438.48.955.837 1.552 1.072.598.235 1.264.352 2 .352.694 0 1.291-.08 1.792-.24.512-.16.95-.33 1.312-.512.374-.192.683-.368.928-.528.256-.16.48-.24.672-.24.256 0 .454.096.592.288l.896 1.152zM225.113 19.396a1.836 1.836 0 0 1-.288.288c-.086.064-.214.096-.384.096-.171 0-.352-.064-.544-.192a4.872 4.872 0 0 0-.704-.432 5.21 5.21 0 0 0-1.024-.432c-.395-.139-.886-.208-1.472-.208-.768 0-1.446.139-2.032.416a3.972 3.972 0 0 0-1.472 1.184c-.384.512-.678 1.136-.88 1.872-.203.736-.304 1.563-.304 2.48 0 .95.106 1.797.32 2.544.213.736.517 1.36.912 1.872.394.501.874.885 1.44 1.152a4.522 4.522 0 0 0 1.888.384c.672 0 1.226-.08 1.664-.24.437-.17.8-.352 1.088-.544.288-.192.528-.368.72-.528.192-.17.389-.256.592-.256.256 0 .453.096.592.288l.896 1.152a5.966 5.966 0 0 1-1.264 1.168c-.459.32-.95.581-1.472.784a8.34 8.34 0 0 1-1.648.448c-.566.096-1.142.144-1.728.144a7.25 7.25 0 0 1-2.848-.56 6.52 6.52 0 0 1-2.288-1.632c-.64-.715-1.147-1.59-1.52-2.624-.374-1.045-.56-2.23-.56-3.552 0-1.205.165-2.32.496-3.344.341-1.024.837-1.904 1.488-2.64a6.821 6.821 0 0 1 2.432-1.744c.96-.427 2.058-.64 3.296-.64 1.162 0 2.186.187 3.072.56a7.514 7.514 0 0 1 2.368 1.584l-.832 1.152zM234.121 32.868c-1.312 0-2.325-.368-3.04-1.104-.704-.736-1.056-1.787-1.056-3.152v-9.728h-1.888a.701.701 0 0 1-.464-.16c-.117-.117-.176-.288-.176-.512v-1.264l2.64-.368.704-4.848a.738.738 0 0 1 .24-.416.724.724 0 0 1 .48-.16h1.584v5.456h4.608v2.272h-4.608v9.52c0 .64.155 1.12.464 1.44.32.31.726.464 1.216.464.288 0 .534-.037.736-.112a3.27 3.27 0 0 0 .544-.24c.15-.096.278-.181.384-.256a.521.521 0 0 1 .288-.112c.107 0 .187.027.24.08a.694.694 0 0 1 .192.224l.928 1.504c-.512.47-1.12.832-1.824 1.088a6.362 6.362 0 0 1-2.192.384z"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.815 33.284V9H70.66a6.259 6.259 0 0 1 5.823 6.243v11.783a6.258 6.258 0 0 1-6.258 6.258h-12.41zM84.56 9h-3.335v24.321h3.335V9zM61.15 29.95V12.32h9.075a2.923 2.923 0 0 1 2.923 2.923v11.783a2.923 2.923 0 0 1-2.923 2.923H61.15zM89.243 9v24.284h12.409a6.258 6.258 0 0 0 6.259-6.258V15.243A6.259 6.259 0 0 0 102.087 9H89.243zm22.912 5.636h3.728v3.728h-3.728v-3.729zm3.728 9.321h-3.728v3.729h3.728v-3.729zM92.578 12.32v17.63h9.074a2.924 2.924 0 0 0 2.924-2.924V15.243a2.924 2.924 0 0 0-2.924-2.923h-9.074z"})]}))};i.defaultProps={width:"239",height:"42",viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};i.displayName="connect-logo";s=o.default=i;function p({children:e,...t}){return c.jsxs(d,{color:"did",variant:"contained",...t,children:[c.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),c.jsx(s,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}p.propTypes={children:f.any};p.defaultProps={children:""};export{p as C};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as q}from"./lottie-
|
|
1
|
+
import{l as q}from"./lottie-DadbWVpc.js";import{r as D,eC as z}from"./index-CQ5dtdkj.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,o,b=[],s=!0,A=!1;try{if(c=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);s=!0);}catch(g){A=!0,u=g}finally{try{if(!s&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var ie=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],oe=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,o=e.initialSegment,b=e.onComplete,s=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,ie),P=D.useState(!1),d=Z(P,2),C=d[0],I=d[1],i=D.useRef(),v=D.useRef(null),H=function(){var a;(a=i.current)===null||a===void 0||a.play()},M=function(){var a;(a=i.current)===null||a===void 0||a.stop()},F=function(){var a;(a=i.current)===null||a===void 0||a.pause()},V=function(a){var f;(f=i.current)===null||f===void 0||f.setSpeed(a)},N=function(a,f){var m;(m=i.current)===null||m===void 0||m.goToAndPlay(a,f)},B=function(a,f){var m;(m=i.current)===null||m===void 0||m.goToAndStop(a,f)},$=function(a){var f;(f=i.current)===null||f===void 0||f.setDirection(a)},k=function(a,f){var m;(m=i.current)===null||m===void 0||m.playSegments(a,f)},W=function(a){var f;(f=i.current)===null||f===void 0||f.setSubframe(a)},K=function(a){var f;return(f=i.current)===null||f===void 0?void 0:f.getDuration(a)},U=function(){var a;(a=i.current)===null||a===void 0||a.destroy(),i.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f;if(v.current){(f=i.current)===null||f===void 0||f.destroy();var m=T(T(T({},e),a),{},{container:v.current});return i.current=q.loadAnimation(m),I(!!i.current),function(){var R;(R=i.current)===null||R===void 0||R.destroy(),i.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){i.current&&(i.current.autoplay=!!c)},[c]),D.useEffect(function(){if(i.current){if(!o){i.current.resetSegments(!0);return}!Array.isArray(o)||!o.length||((i.current.currentRawFrame<o[0]||i.current.currentRawFrame>o[1])&&(i.current.currentRawFrame=o[0]),i.current.setSegment(o[0],o[1]))}},[o]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:s},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var f=a.map(function(m){var R;return(R=i.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var _;(_=i.current)===null||_===void 0||_.removeEventListener(m.name,m.handler)}});return function(){f.forEach(function(m){return m()})}}},[b,s,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",T({style:r,ref:v},p));return{View:Y,play:H,stop:M,pause:F,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:i.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,o=n.width,b=n.height,s=(e-c)/o,A=(r-u)/b;return{x:s,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var o=r.current;if(!(!o||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(o),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
|
|
3
3
|
n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},s=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(o,S,p);S=P.x,p=P.y}var d=c.find(function(i){var v=i.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(d){if(d.type==="seek"&&d.position&&Array.isArray(d.position.x)&&Array.isArray(d.position.y)&&d.frames.length===2){var C=(S-d.position.x[0])/(d.position.x[1]-d.position.x[0]),I=(p-d.position.y[0])/(d.position.y[1]-d.position.y[0]);n.playSegments(d.frames,!0),n.goToAndStop(Math.ceil((C+I)/2*(d.frames[1]-d.frames[0])),!0)}d.type==="loop"&&n.playSegments(d.frames,!0),d.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(d.frames)),d.type==="stop"&&n.goToAndStop(d.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return o.addEventListener("mousemove",O),o.addEventListener("mouseout",w),function(){o.removeEventListener("mousemove",O),o.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return s()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,o=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),o},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,o=e.interactivity,b=x(e,fe),s=oe(b,c),A=s.View,g=s.play,O=s.stop,w=s.pause,h=s.setSpeed,l=s.goToAndStop,L=s.goToAndPlay,S=s.setDirection,p=s.playSegments,P=s.setSubframe,d=s.getDuration,C=s.destroy,I=s.animationContainerRef,i=s.animationLoaded,v=s.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:d,destroy:C,animationContainerRef:I,animationLoaded:i,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:d,destroy:C,animationContainerRef:I,animationLoaded:i,animationItem:v},actions:(n=o==null?void 0:o.actions)!==null&&n!==void 0?n:[],mode:(u=o==null?void 0:o.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,oe as useLottie,de as useLottieInteractivity};
|