@abtnode/blocklet-services 1.16.33-beta-20241105-141729-e4608175 → 1.16.33-beta-20241107-065332-b20666d2
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/README.md +11 -0
- package/api/routes/federated.js +1 -0
- package/dist/assets/{Add-C5wKbObL.js → Add-D1b24h2C.js} +1 -1
- package/dist/assets/{Alert-ClGA4UON.js → Alert-BQX_mYKK.js} +1 -1
- package/dist/assets/{ArrowDropDown-CK-CyRRv.js → ArrowDropDown-CtY4f_6-.js} +1 -1
- package/dist/assets/{Autocomplete-BM34aepT.js → Autocomplete-B8Nz_Pg9.js} +1 -1
- package/dist/assets/{Avatar-DyK43nCT.js → Avatar-CZVIW9W4.js} +1 -1
- package/dist/assets/{ButtonGroup-DaL5PyR4.js → ButtonGroup-NJAfDniA.js} +1 -1
- package/dist/assets/{CSSTransition-BzIdiTxk.js → CSSTransition-DPu7hVaF.js} +1 -1
- package/dist/assets/{CheckCircle-C-BzX2wx.js → CheckCircle-ClSMXBOP.js} +1 -1
- package/dist/assets/{ChevronLeft-DdnDWw3p.js → ChevronLeft-DgAFm-Gf.js} +1 -1
- package/dist/assets/{ChevronRight-B_bmxWe_.js → ChevronRight-CSSyqQil.js} +1 -1
- package/dist/assets/{Close-da9E5C6C.js → Close-B0nabKwE.js} +1 -1
- package/dist/assets/{Delete-4PM7zdFM.js → Delete-B8S8LZmV.js} +1 -1
- package/dist/assets/{DeleteOutline-23K5_ksg.js → DeleteOutline-GMT7pXpg.js} +1 -1
- package/dist/assets/{DialogContentText-BAHpbVEb.js → DialogContentText-y_0HIwxq.js} +1 -1
- package/dist/assets/{Done-CKRWemQO.js → Done-dTmNtnR9.js} +1 -1
- package/dist/assets/{Download-B85Kmt1U.js → Download-CAOtDt4Y.js} +1 -1
- package/dist/assets/{EditIcon-DSJg9xra.js → EditIcon-9Iv4a6S6.js} +1 -1
- package/dist/assets/{Error-Dln9la_X.js → Error-crhyvWwD.js} +1 -1
- package/dist/assets/{ExpandMore-CtG_bAfW.js → ExpandMore-BeTREEh4.js} +1 -1
- package/dist/assets/{FormControl-BL0Z1NSB.js → FormControl-BgufkNqy.js} +1 -1
- package/dist/assets/{FormControlLabel-DoWNBwBW.js → FormControlLabel-BGYw4cxF.js} +1 -1
- package/dist/assets/{FormGroup-QLbY_ga6.js → FormGroup-ftMzhStq.js} +1 -1
- package/dist/assets/{Google-BvcdqOgK.js → Google-CUxk9zex.js} +1 -1
- package/dist/assets/{Grid-CK8YVFLA.js → Grid-ByEv6TKi.js} +1 -1
- package/dist/assets/{HelpOutline-Dl-B0PLa.js → HelpOutline-gqc5t8GX.js} +1 -1
- package/dist/assets/{Hidden-vR0aN6pm.js → Hidden-D2bPVc-Z.js} +1 -1
- package/dist/assets/{InfoOutlined-B6NUfTCa.js → InfoOutlined-CO_EvieX.js} +1 -1
- package/dist/assets/{InputAdornment-DZGc8E9Q.js → InputAdornment-xdqfqU-t.js} +1 -1
- package/dist/assets/{LastPage-DGe9hoEM.js → LastPage-LleEi5ij.js} +1 -1
- package/dist/assets/{Launch-BpxAI4bs.js → Launch-cEuhc1Jw.js} +1 -1
- package/dist/assets/{LaunchOutlined-C6MUvhkl.js → LaunchOutlined-CCsKompg.js} +1 -1
- package/dist/assets/{Link-t0X_2s8f.js → Link-BnwyStJD.js} +1 -1
- package/dist/assets/{ListItemButton-BeEwzuuE.js → ListItemButton-BqEaHAjp.js} +1 -1
- package/dist/assets/{ListSubheader-CinvXrOQ.js → ListSubheader-PoABAZS8.js} +1 -1
- package/dist/assets/{LoadingButton-Bzaa_ly6.js → LoadingButton-_e9ZmSts.js} +1 -1
- package/dist/assets/{LockIcon-DeDWbkGd.js → LockIcon-BWxqR8Xa.js} +1 -1
- package/dist/assets/{Loop-DH3EwgSL.js → Loop-C1LJP15T.js} +1 -1
- package/dist/assets/{MarkEmailRead-CwoBeL2i.js → MarkEmailRead--oLpgRuK.js} +1 -1
- package/dist/assets/{Menu-D_GBf1CB.js → Menu-C6ClxI8R.js} +1 -1
- package/dist/assets/{MoreHoriz-Qd-pbYq_.js → MoreHoriz-35xRvcur.js} +1 -1
- package/dist/assets/{MoreVert-Dy3B-4PZ.js → MoreVert-3qdVPLsP.js} +1 -1
- package/dist/assets/{OpenInNew-sKjipJwH.js → OpenInNew-DTWztApy.js} +1 -1
- package/dist/assets/{Pagination-BSPBQ0Um.js → Pagination-Byqc1LFt.js} +1 -1
- package/dist/assets/{PlayArrow-DC_oyUb1.js → PlayArrow-Cm-QOoAu.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-C8r6Lbfw.js → QuestionMarkCircle-d1Ebd_H9.js} +1 -1
- package/dist/assets/{RadioGroup-MJhlZ4ZH.js → RadioGroup-Cni7TXcD.js} +1 -1
- package/dist/assets/{Search-CefeP42d.js → Search-jkInhIDL.js} +1 -1
- package/dist/assets/{Select-Bjc5h4TG.js → Select-DpoUFNPr.js} +1 -1
- package/dist/assets/{ServerLogo-B27SaIJw.js → ServerLogo-YXLt5ISs.js} +1 -1
- package/dist/assets/{Skeleton-B-YzpOQg.js → Skeleton-CwJc9kSo.js} +1 -1
- package/dist/assets/{Slider-DEZGhcr8.js → Slider-OczkbKo7.js} +1 -1
- package/dist/assets/{Stack-RoMZEEMb.js → Stack-tyHLs2nq.js} +1 -1
- package/dist/assets/{Stepper-D8zaVBG6.js → Stepper-DOTgGwGo.js} +1 -1
- package/dist/assets/{TextField-OMWgqDee.js → TextField-ExXHASMC.js} +1 -1
- package/dist/assets/{Toolbar-CZhQZvMx.js → Toolbar-B24K0pP-.js} +1 -1
- package/dist/assets/{ViewColumn-CWRGm9xJ.js → ViewColumn-WqJnmiSU.js} +1 -1
- package/dist/assets/{ViewList-B4FFgNBd.js → ViewList-D6RnIIAe.js} +1 -1
- package/dist/assets/{_createAggregator-C7QUEqHM.js → _createAggregator-CSHIra2n.js} +1 -1
- package/dist/assets/{access-control-BhAuSTlj.js → access-control-CDT_Qjlo.js} +1 -1
- package/dist/assets/{actions-VMZ5WmkG.js → actions-LaK2FbCC.js} +1 -1
- package/dist/assets/{add-component-core-BMEBzsmZ.js → add-component-core-BjyU3n3N.js} +8 -8
- package/dist/assets/add-resource-BGaKRgvh.js +1 -0
- package/dist/assets/{addon-DLwkn9N6.js → addon-BSIcb_bw.js} +1 -1
- package/dist/assets/{analytics-Dm4wPEYQ.js → analytics-Cngi1VA7.js} +8 -8
- package/dist/assets/api-WvnjspXU.js +1 -0
- package/dist/assets/{ar-DwhokVLj.js → ar-C78wXjK2.js} +1 -1
- package/dist/assets/{audit-logs-tj7WeyYy.js → audit-logs-D4W2vZGJ.js} +1 -1
- package/dist/assets/{base32-D9mDcD23.js → base32-CG6eSal8.js} +1 -1
- package/dist/assets/branding-DLypGD3X.js +37 -0
- package/dist/assets/{bundle-avatar-Co5kQjOo.js → bundle-avatar-C8-NjDQW.js} +1 -1
- package/dist/assets/{button-Ee_XPt6g.js → button-DkuvN0wn.js} +1 -1
- package/dist/assets/{click-to-copy-CQnFaSnp.js → click-to-copy-Dzo_hSC7.js} +1 -1
- package/dist/assets/{complete-CeSbBm-e.js → complete-yykC_TCD.js} +1 -1
- package/dist/assets/{component-DJBS5Xx8.js → component-DpbEJTFD.js} +1 -1
- package/dist/assets/{config-C_hl3G_R.js → config-CcNVBsZ2.js} +1 -1
- package/dist/assets/{config-B6t74tHt.js → config-Dq8WqIIS.js} +1 -1
- package/dist/assets/{config-navigation-CHtqAvRz.js → config-navigation-BAUysRmy.js} +1 -1
- package/dist/assets/{confirm-Ddpyr19d.js → confirm-Bst90PE4.js} +1 -1
- package/dist/assets/{connect-6xrInacS.js → connect-C3TLeSd2.js} +1 -1
- package/dist/assets/{connect-Ewc4HyYb.js → connect-CXUPCbFy.js} +1 -1
- package/dist/assets/{connect-to-qDn2VlTy.js → connect-to-DRlYmNA0.js} +1 -1
- package/dist/assets/{content-layout-BBKVUucZ.js → content-layout-3ZZR8o8W.js} +1 -1
- package/dist/assets/{dashboard-BijWBRYU.js → dashboard-BFXPVlTr.js} +3 -3
- package/dist/assets/{de-CS8qZeoq.js → de-DQ8SQ6Hy.js} +1 -1
- package/dist/assets/{deprecate-D8ZVXehA.js → deprecate-zRAAntjP.js} +1 -1
- package/dist/assets/{did-address-CM_8YqbE.js → did-address-C5wbfJu1.js} +1 -1
- package/dist/assets/{domain-list-CxPS6rQ4.js → domain-list-B3STE3xp.js} +1 -1
- package/dist/assets/{domain-DyBbgSJm.js → domain-wTx2ySbZ.js} +1 -1
- package/dist/assets/{email-DxESpXcD.js → email-jFdVx0rF.js} +3 -3
- package/dist/assets/emotion-cache.browser.esm-DUnD1U-l.js +1 -0
- package/dist/assets/{es-xG0Pi6Vu.js → es-CyBN_iEY.js} +1 -1
- package/dist/assets/{exchange-passport-CnSh9yXL.js → exchange-passport-BhyGCja3.js} +1 -1
- package/dist/assets/{fallback-DtXRUNR6.js → fallback-DYm2eQ_8.js} +1 -1
- package/dist/assets/{form-text-input-CQCcTHWQ.js → form-text-input-CqR55KJe.js} +1 -1
- package/dist/assets/{format-error-BXpFpsa-.js → format-error-zcoEKeqV.js} +1 -1
- package/dist/assets/{fr-D_NT6aZ9.js → fr-CwEK7z3p.js} +1 -1
- package/dist/assets/{fuel-D6j74EMR.js → fuel-DvClmssM.js} +1 -1
- package/dist/assets/{fullpage-CKQTBOZk.js → fullpage-Co_e0e0B.js} +1 -1
- package/dist/assets/{hi-gQURTn8d.js → hi-CZoxQZ3r.js} +1 -1
- package/dist/assets/{home-CcjOthQO.js → home-BWkkUB7W.js} +1 -1
- package/dist/assets/{id-CS1bsZtf.js → id-CEtjLsgM.js} +1 -1
- package/dist/assets/{iframe-DRVFH0tr.js → iframe-CxEHSM2a.js} +1 -1
- package/dist/assets/{index-4Vv_xV1i.js → index-31nbUtvf.js} +1 -1
- package/dist/assets/{index-SC5yW-Mc.js → index-B4WeaDPZ.js} +1 -1
- package/dist/assets/{index-BACiBg8Z.js → index-B7WSZrX4.js} +3 -3
- package/dist/assets/{index-Cfu_bVRF.js → index-BGYwRIJ2.js} +4 -4
- package/dist/assets/{index-DaPfZep1.js → index-BVjelVjV.js} +1 -1
- package/dist/assets/{index-BtEigcbe.js → index-BWka1Lo8.js} +3 -3
- package/dist/assets/{index-C97ospTS.js → index-BaHNGoYq.js} +1 -1
- package/dist/assets/{index-ClAQ2Uji.js → index-BoYQxNvz.js} +1 -1
- package/dist/assets/{index-DOT9KoXF.js → index-Bt4_QNc0.js} +1 -1
- package/dist/assets/{index-Dc2ybf4C.js → index-BwVo4eBB.js} +1 -1
- package/dist/assets/{index-Hnm-O5Pq.js → index-CLDXLIWr.js} +1 -1
- package/dist/assets/{index-DsUB0er-.js → index-CMaQNm5I.js} +1 -1
- package/dist/assets/{index-BCox7gnS.js → index-CN-LUXv5.js} +1 -1
- package/dist/assets/{index-B463Qwek.js → index-CQjjZ9D3.js} +1 -1
- package/dist/assets/{index-DZ8uRrow.js → index-CWk3DsIq.js} +1 -1
- package/dist/assets/{index-Dd9xMZEz.js → index-Cpcj45rd.js} +4 -4
- package/dist/assets/{index-C3SoKjGs.js → index-CqU3uv11.js} +1 -1
- package/dist/assets/{index-o33Ww9sw.js → index-D1GHK31x.js} +1 -1
- package/dist/assets/{index-D7yWEAeI.js → index-D9JHIwyT.js} +1 -1
- package/dist/assets/{index-CrRL_dto.js → index-DBKQXsCe.js} +1 -1
- package/dist/assets/{index-DNivnwSJ.js → index-DJVbN6XR.js} +1 -1
- package/dist/assets/{index-DYz2g4w3.js → index-DQQ_S9kF.js} +1 -1
- package/dist/assets/{index-gZFJJRf-.js → index-DaeMoett.js} +1 -1
- package/dist/assets/{index-DyVo1ugh.js → index-DbHZUu86.js} +1 -1
- package/dist/assets/{index-CjgG9Mbh.js → index-Do-0aath.js} +1 -1
- package/dist/assets/{index-D8wC9WED.js → index-DpxcwASI.js} +1 -1
- package/dist/assets/{index-CN4Xbxs7.js → index-Dr2Mtdy2.js} +1 -1
- package/dist/assets/{index-Bn4Oin82.js → index-Iilpb1w3.js} +1 -1
- package/dist/assets/{index-D9Zhhq53.js → index-LH7XB4c1.js} +1 -1
- package/dist/assets/{index-CJ5QOKhK.js → index-NBbc-nqN.js} +1 -1
- package/dist/assets/{index-gK8L4BFM.js → index-O1LdcLGJ.js} +1 -1
- package/dist/assets/{index-Ca4BjHEM.js → index-jt9tbPDg.js} +1 -1
- package/dist/assets/{index-CPpIB55-.js → index-jzqdpu4B.js} +1 -1
- package/dist/assets/{index-e9epohgt.js → index-xn1-iBAc.js} +1 -1
- package/dist/assets/{invitation-BuZJIYwW.js → invitation-DDU-JTPq.js} +1 -1
- package/dist/assets/{invite-1m2hy3gm.js → invite-CXprXS6i.js} +1 -1
- package/dist/assets/{isEmail-BAm7AH0D.js → isEmail-Cq5ywVNL.js} +1 -1
- package/dist/assets/{issue-passport-C9U5xfNL.js → issue-passport-Dx8J7LJs.js} +1 -1
- package/dist/assets/{item-CjjCUl_D.js → item-1n-Obvap.js} +1 -1
- package/dist/assets/{ja-dRhtFh3i.js → ja-COJhuCqY.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-cqAVaHSM.js → jss-plugin-props-sort.esm-BFA_sJBd.js} +1 -1
- package/dist/assets/{ko-Bf5brKj6.js → ko-BGk_oSHx.js} +1 -1
- package/dist/assets/{launch-result-message-Qy-17kk4.js → launch-result-message-BKX39E3Q.js} +1 -1
- package/dist/assets/{layout-BVjKi-WC.js → layout-2ilZJfm5.js} +1 -1
- package/dist/assets/{list-header-DBu1NCpW.js → list-header-DEuvOwZm.js} +1 -1
- package/dist/assets/localization-DmADe8nj.js +1 -0
- package/dist/assets/{log-2ZwvZtYm.js → log-DmSR12UC.js} +1 -1
- package/dist/assets/{login-DvR8ldSJ.js → login-DJyrnkUG.js} +1 -1
- package/dist/assets/{login-oauth-callback-C6I5hp6o.js → login-oauth-callback-BVzGAgBu.js} +1 -1
- package/dist/assets/{logo-uploader-lnCRmGXJ.js → logo-uploader-BZLXFEM6.js} +3 -3
- package/dist/assets/{lost-passport-CSsACZsq.js → lost-passport-CsA6xO2h.js} +3 -3
- package/dist/assets/{lottie-react.esm-Bx5n1m-Y.js → lottie-react.esm-CbkKea8x.js} +1 -1
- package/dist/assets/{notifications-K6SumKc_.js → notifications-BD-_TAYM.js} +1 -1
- package/dist/assets/{open-window-BnMY49qX.js → open-window-CgI-G8RY.js} +1 -1
- package/dist/assets/{overview-4Pt-umR4.js → overview-D7Ba5KkA.js} +1 -1
- package/dist/assets/{page-header-CA8Xsarf.js → page-header-BztuQfIc.js} +1 -1
- package/dist/assets/{permission-sAUmNkv7.js → permission-B7T41iuZ.js} +1 -1
- package/dist/assets/{preferences-BPOKtF4g.js → preferences-CGUMh_y3.js} +1 -1
- package/dist/assets/{pt-DT1ewc-i.js → pt-hoTFzj_f.js} +1 -1
- package/dist/assets/publish-resource-CxT2YQfV.js +1 -0
- package/dist/assets/{raf-schd.esm-W-ZrlqpH.js → raf-schd.esm-DQpWk2ID.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-BJ9lX_Fr.js → react-beautiful-dnd.esm-Bg00PgH1.js} +1 -1
- package/dist/assets/refType-BLddy3qS.js +1 -0
- package/dist/assets/{resource-dialog-BBl_2osk.js → resource-dialog-oLWtjFw9.js} +1 -1
- package/dist/assets/{ru-Bu6fUIp5.js → ru-GY38BU_Y.js} +1 -1
- package/dist/assets/sdk-CaGwd5_2.js +1 -0
- package/dist/assets/{selector-CFf3nrir.js → selector-D75xbVNs.js} +1 -1
- package/dist/assets/session-DSFe9JNg.js +1 -0
- package/dist/assets/{setup-Ct1D13HF.js → setup-GMy_zhkY.js} +3 -3
- package/dist/assets/{shorten-label-DN0jrUac.js → shorten-label-95kRH9My.js} +1 -1
- package/dist/assets/{simple-select-DqaWmnN5.js → simple-select-BDtYVNDo.js} +1 -1
- package/dist/assets/{slicedToArray-BS60JB66.js → slicedToArray-CnAQRO6y.js} +1 -1
- package/dist/assets/{spaces-CjgOPbG0.js → spaces-Bh7-Ra1u.js} +1 -1
- package/dist/assets/{start-BUk3sbrk.js → start-Dx-J9oZM.js} +1 -1
- package/dist/assets/{step-actions-BPWhLbiR.js → step-actions-DHGDcg4f.js} +1 -1
- package/dist/assets/{studio-CW5QJoGv.js → studio-BFAhRQYo.js} +1 -1
- package/dist/assets/{switch-control-Cnbl4Wu3.js → switch-control-DMZxmV5h.js} +1 -1
- package/dist/assets/{th-Dc8W01H6.js → th-SRt9Aure.js} +1 -1
- package/dist/assets/{toUpper-CFi1Iac7.js → toUpper-C6Pk29N9.js} +1 -1
- package/dist/assets/{transfer-Bx_nNEq4.js → transfer-D7vWdeJz.js} +1 -1
- package/dist/assets/{trim-CHiTHOIA.js → trim-CoIWX0qj.js} +1 -1
- package/dist/assets/{uniqBy-BjgLQRCz.js → uniqBy-BCr2VIxS.js} +1 -1
- package/dist/assets/{unsubscribe-k6GIH3_j.js → unsubscribe-MpT91ec7.js} +1 -1
- package/dist/assets/{url-join-UZSSoHtH.js → url-join-BHr3fLxq.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-hKOuN39m.js → use-blocklet-info-for-connect-did-spaces-CS77R_yG.js} +1 -1
- package/dist/assets/{use-mobile-BTgMVFAs.js → use-mobile-BNHy4X3p.js} +1 -1
- package/dist/assets/{use-mobile-C1IcwqDn.js → use-mobile-xkdfJLrW.js} +1 -1
- package/dist/assets/{useAsync-D_MoHBEg.js → useAsync-BkL7KkDp.js} +1 -1
- package/dist/assets/{useFormControl-CZU39P72.js → useFormControl-DmdM9XjQ.js} +1 -1
- package/dist/assets/{useLocalStorage-DoUDAxJV.js → useLocalStorage-CQXvDKwD.js} +1 -1
- package/dist/assets/{useSetState-l_4RfoXS.js → useSetState-CvxpkYB6.js} +1 -1
- package/dist/assets/{useSlot-CHjJ1PGq.js → useSlot-C0VaVKX8.js} +1 -1
- package/dist/assets/{useSlotProps-DCQA4xi9.js → useSlotProps-D25PFONA.js} +1 -1
- package/dist/assets/{useThemeProps-BuwBKLg_.js → useThemeProps-C9REtDKX.js} +1 -1
- package/dist/assets/{user-center-C-BWN4ab.js → user-center-BlJ8ubre.js} +1 -1
- package/dist/assets/{user-sessions-zHLfn0TD.js → user-sessions-p5w4GorO.js} +1 -1
- package/dist/assets/util-CRpGHFlb.js +1 -0
- package/dist/assets/{vi-CO4j8X-h.js → vi-DJ6rWAfj.js} +1 -1
- package/dist/assets/wrap-locale-Cml2-uON.js +1 -0
- package/dist/assets/{zh-D3BaPKV5.js → zh-DCTfg4U1.js} +1 -1
- package/dist/assets/{zh-tw-18T4kLe_.js → zh-tw-Cd2Czsn6.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +19 -19
- package/dist/assets/add-resource-RNKWAHa3.js +0 -1
- package/dist/assets/api-J-ppmLLo.js +0 -1
- package/dist/assets/branding-D-eSt-2j.js +0 -37
- package/dist/assets/emotion-cache.browser.esm-DWAkeLNM.js +0 -1
- package/dist/assets/localization-Duro2u0E.js +0 -1
- package/dist/assets/publish-resource-VECs77eT.js +0 -1
- package/dist/assets/refType-BsYuCgz-.js +0 -1
- package/dist/assets/sdk-DponvxD9.js +0 -1
- package/dist/assets/session-5TSm9LWM.js +0 -1
- package/dist/assets/util-DvRWTmoo.js +0 -1
- package/dist/assets/wrap-locale-D0E4_sSR.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
var Cd=Object.defineProperty;var kd=(i,e,t)=>e in i?Cd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var xe=(i,e,t)=>kd(i,typeof e!="symbol"?e+"":e,t);import{av as Ed,j as ve,b9 as ht,iR as Td,db as Ac,iS as Dd,iT as Od,eF as Rc,f2 as Vn,eX as jt,is as Rs,P as U,r as ie,co as Er,cD as Tr,n as Ad,eJ as Uc,gj as Rd,a5 as Ic,Q as Ud,al as Id,a1 as Md,iU as Dr,U as Bd,fn as Or,c1 as Ar,eH as Nd,B as Us,aE as jd,T as Ld,cs as zd,iV as $d,iW as qd,cq as Hd}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BWka1Lo8.js","assets/index-Cpcj45rd.js","assets/index-D8NuaJ66.css","assets/Grid-ByEv6TKi.js","assets/TextField-ExXHASMC.js","assets/FormControl-BgufkNqy.js","assets/useFormControl-DmdM9XjQ.js","assets/Select-DpoUFNPr.js","assets/RadioGroup-Cni7TXcD.js","assets/FormControlLabel-BGYw4cxF.js","assets/Stack-tyHLs2nq.js","assets/FormGroup-ftMzhStq.js","assets/Slider-OczkbKo7.js","assets/Skeleton-CwJc9kSo.js","assets/Close-B0nabKwE.js","assets/url-join-BHr3fLxq.js","assets/index-CWk3DsIq.js","assets/_createAggregator-CSHIra2n.js","assets/index-BoYQxNvz.js","assets/index-DbHZUu86.js","assets/index-DBKQXsCe.js","assets/fallback-DYm2eQ_8.js","assets/index-CLDXLIWr.js","assets/Menu-C6ClxI8R.js","assets/Toolbar-B24K0pP-.js","assets/Hidden-D2bPVc-Z.js","assets/index-jt9tbPDg.js","assets/MoreVert-3qdVPLsP.js","assets/ListItemButton-BqEaHAjp.js","assets/selector-D75xbVNs.js","assets/ExpandMore-BeTREEh4.js","assets/Avatar-CZVIW9W4.js","assets/useSlot-C0VaVKX8.js","assets/resource-dialog-oLWtjFw9.js","assets/index-NBbc-nqN.js","assets/emotion-cache.browser.esm-DUnD1U-l.js","assets/index-Dr2Mtdy2.js","assets/OpenInNew-DTWztApy.js","assets/index-DaeMoett.js","assets/Link-BnwyStJD.js","assets/HelpOutline-gqc5t8GX.js","assets/index-D9JHIwyT.js","assets/ButtonGroup-NJAfDniA.js","assets/DialogContentText-y_0HIwxq.js","assets/index-B4WeaDPZ.js","assets/index-DQQ_S9kF.js","assets/index-CqU3uv11.js","assets/index-DJVbN6XR.js","assets/useThemeProps-C9REtDKX.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-CQjjZ9D3.js","assets/redux-CluOqhW1.js","assets/ViewColumn-WqJnmiSU.js","assets/Delete-B8S8LZmV.js","assets/LastPage-LleEi5ij.js","assets/Search-jkInhIDL.js","assets/deprecate-zRAAntjP.js","assets/uniqBy-BCr2VIxS.js","assets/toUpper-C6Pk29N9.js","assets/purify.es-Bq0E5Q3l.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Cd=Object.defineProperty;var kd=(i,e,t)=>e in i?Cd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var xe=(i,e,t)=>kd(i,typeof e!="symbol"?e+"":e,t);import{av as Ed,j as ve,b9 as ht,iR as Td,db as Ac,iS as Dd,iT as Od,eF as Rc,f2 as Vn,eX as jt,is as Rs,P as U,r as ie,co as Er,cD as Tr,n as Ad,eJ as Uc,gj as Rd,a5 as Ic,Q as Ud,al as Id,a1 as Md,iU as Dr,U as Bd,fn as Or,c1 as Ar,eH as Nd,B as Us,aE as jd,T as Ld,cs as zd,iV as $d,iW as qd,cq as Hd}from"./index-Cpcj45rd.js";import{j as Pn}from"./url-join-BHr3fLxq.js";import{p as Wd}from"./index-CWk3DsIq.js";import{_ as Vd,u as Gd}from"./_createAggregator-CSHIra2n.js";import{a as Xd}from"./index-BoYQxNvz.js";import{c as Ee}from"./index-DbHZUu86.js";import"./index-DBKQXsCe.js";import"./index-jt9tbPDg.js";import{W as Kd}from"./resource-dialog-oLWtjFw9.js";import"./index-B4WeaDPZ.js";import"./index-DQQ_S9kF.js";import"./fallback-DYm2eQ_8.js";import"./index-CqU3uv11.js";import"./index-DJVbN6XR.js";import{w as Yd}from"./deprecate-zRAAntjP.js";import{u as Mc}from"./uniqBy-BCr2VIxS.js";import{t as Qd}from"./toUpper-C6Pk29N9.js";import{p as Rr}from"./purify.es-Bq0E5Q3l.js";const Jd=Ed(ve.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 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 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");var Zd=Td,eh=Vd,th=eh(function(i,e,t){Zd(i,t,e)}),ih=th;const Bc=ht(ih);function qa(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var ah=0;function Nc(i){return"__private_"+ah+++"_"+i}function nh(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
|
|
3
3
|
* Takes a string with placeholder variables like `%{smart_count} file selected`
|
|
4
4
|
* and replaces it with values from options `{smart_count: 5}`
|
|
5
5
|
*
|
|
@@ -52,5 +52,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
52
52
|
<div class="uppy-ProviderBrowserItem-inner uploaded-add-item">
|
|
53
53
|
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="#ffffff"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>
|
|
54
54
|
</div>
|
|
55
|
-
`,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));xe(this,"convertImgToObject",Rs(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(u=>u.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=md(s.originalname),[".mp4",".webm"].find(u=>{var d;return(d=a.src)==null?void 0:d.endsWith(u)})){const u=document.createElement("video");u.src=a.src,u.width=a.width,u.height=a.height,u.autoplay=!0,u.setAttribute("playsinline","playsinline"),u.muted=!0,u.loop=!0,u.style="pointer-events: none;",o.appendChild(u)}else{const u=document.createElement("object");u.data=n,u.type=s.mimetype||"image/png",u.alt=s.originalname,u.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",u.loading="lazy",o.appendChild(u)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));xe(this,"resetState",()=>{this.uploadedAPIData={...Pc},this.uploaded.setPluginState({...Fc}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...Pc},this.addUploadItemFlag=!0,this.icon=()=>pe("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[pe("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),pe("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),pe("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),pe("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),pe("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new qo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...Fc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const Cc={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},kc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},fd={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},M0={...fd,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class B0 extends fe{constructor(t,a){super(t,a);xe(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await Ai.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=Mc([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=Ua(s,0,0,dt);return n=Ua(s,400,0,dt),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});xe(this,"resetState",()=>{this.apiData={...Cc},this.resources.setPluginState({...kc})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Cc},this.icon=()=>pe("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[pe("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),pe("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),pe("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),pe("div",{id:"resources",className:"uploaded",children:[pe("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>pe("button",{style:this.apiData.componentDid===a.did?M0:fd,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Qd(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new qo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...kc}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("resources:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var N0=Rd();const j0=ht(N0);var Ae=Uint8Array,yi=Uint16Array,L0=Int32Array,gd=new Ae([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vd=new Ae([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),z0=new Ae([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bd=function(i,e){for(var t=new yi(31),a=0;a<31;++a)t[a]=e+=1<<i[a-1];for(var n=new L0(t[30]),a=1;a<30;++a)for(var s=t[a];s<t[a+1];++s)n[s]=s-t[a]<<5|a;return{b:t,r:n}},yd=bd(gd,2),xd=yd.b,$0=yd.r;xd[28]=258,$0[258]=28;var q0=bd(vd,0),H0=q0.b,Oo=new yi(32768);for(var J=0;J<32768;++J){var Ot=(J&43690)>>1|(J&21845)<<1;Ot=(Ot&52428)>>2|(Ot&13107)<<2,Ot=(Ot&61680)>>4|(Ot&3855)<<4,Oo[J]=((Ot&65280)>>8|(Ot&255)<<8)>>1}var ba=function(i,e,t){for(var a=i.length,n=0,s=new yi(e);n<a;++n)i[n]&&++s[i[n]-1];var o=new yi(e);for(n=1;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;var r;if(t){r=new yi(1<<e);var l=15-e;for(n=0;n<a;++n)if(i[n])for(var u=n<<4|i[n],d=e-i[n],c=o[i[n]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)r[Oo[c]>>l]=u}else for(r=new yi(a),n=0;n<a;++n)i[n]&&(r[n]=Oo[o[i[n]-1]++]>>15-i[n]);return r},$a=new Ae(288);for(var J=0;J<144;++J)$a[J]=8;for(var J=144;J<256;++J)$a[J]=9;for(var J=256;J<280;++J)$a[J]=7;for(var J=280;J<288;++J)$a[J]=8;var wd=new Ae(32);for(var J=0;J<32;++J)wd[J]=5;var W0=ba($a,9,1),V0=ba(wd,5,1),Ts=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},Xe=function(i,e,t){var a=e/8|0;return(i[a]|i[a+1]<<8)>>(e&7)&t},Ds=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},G0=function(i){return(i+7)/8|0},wr=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new Ae(i.subarray(e,t))},X0=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],we=function(i,e,t){var a=new Error(e||X0[i]);if(a.code=i,Error.captureStackTrace&&Error.captureStackTrace(a,we),!t)throw a;return a},_r=function(i,e,t,a){var n=i.length,s=a?a.length:0;if(!n||e.f&&!e.l)return t||new Ae(0);var o=!t,r=o||e.i!=2,l=e.i;o&&(t=new Ae(n*3));var u=function(zt){var Ri=t.length;if(zt>Ri){var mt=new Ae(Math.max(Ri*2,zt));mt.set(t),t=mt}},d=e.f||0,c=e.p||0,h=e.b||0,m=e.l,v=e.d,P=e.m,f=e.n,b=n*8;do{if(!m){d=Xe(i,c,1);var S=Xe(i,c+1,3);if(c+=3,S)if(S==1)m=W0,v=V0,P=9,f=5;else if(S==2){var _=Xe(i,c,31)+257,F=Xe(i,c+10,15)+4,A=_+Xe(i,c+5,31)+1;c+=14;for(var R=new Ae(A),j=new Ae(19),N=0;N<F;++N)j[z0[N]]=Xe(i,c+N*3,7);c+=F*3;for(var X=Ts(j),W=(1<<X)-1,$=ba(j,X,1),N=0;N<A;){var q=$[Xe(i,c,W)];c+=q&15;var x=q>>4;if(x<16)R[N++]=x;else{var w=0,g=0;for(x==16?(g=3+Xe(i,c,3),c+=2,w=R[N-1]):x==17?(g=3+Xe(i,c,7),c+=3):x==18&&(g=11+Xe(i,c,127),c+=7);g--;)R[N++]=w}}var y=R.subarray(0,_),C=R.subarray(_);P=Ts(y),f=Ts(C),m=ba(y,P,1),v=ba(C,f,1)}else we(1);else{var x=G0(c)+4,T=i[x-4]|i[x-3]<<8,E=x+T;if(E>n){l&&we(0);break}r&&u(h+T),t.set(i.subarray(x,E),h),e.b=h+=T,e.p=c=E*8,e.f=d;continue}if(c>b){l&&we(0);break}}r&&u(h+131072);for(var O=(1<<P)-1,D=(1<<f)-1,k=c;;k=c){var w=m[Ds(i,c)&O],M=w>>4;if(c+=w&15,c>b){l&&we(0);break}if(w||we(2),M<256)t[h++]=M;else if(M==256){k=c,m=null;break}else{var L=M-254;if(M>264){var N=M-257,V=gd[N];L=Xe(i,c,(1<<V)-1)+xd[N],c+=V}var H=v[Ds(i,c)&D],K=H>>4;H||we(3),c+=H&15;var C=H0[K];if(K>3){var V=vd[K];C+=Ds(i,c)&(1<<V)-1,c+=V}if(c>b){l&&we(0);break}r&&u(h+131072);var Se=h+L;if(h<C){var Lt=s-C,Wn=Math.min(C,Se);for(Lt+h<0&&we(3);h<Wn;++h)t[h]=a[Lt+h]}for(;h<Se;++h)t[h]=t[h-C]}}e.l=m,e.p=k,e.b=h,e.f=d,m&&(d=1,e.m=P,e.d=v,e.n=f)}while(!d);return h!=t.length&&o?wr(t,0,h):t.subarray(0,h)},K0=new Ae(0),st=function(i,e){return i[e]|i[e+1]<<8},et=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},Os=function(i,e){return et(i,e)+et(i,e+4)*4294967296},Y0=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&we(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var a=(e>>3&1)+(e>>4&1);a>0;a-=!i[t++]);return t+(e&2)},Q0=function(i){var e=i.length;return(i[e-4]|i[e-3]<<8|i[e-2]<<16|i[e-1]<<24)>>>0},J0=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&we(6,"invalid zlib data"),(i[1]>>5&1)==+!e&&we(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function _d(i,e){return _r(i,{i:2},e&&e.out,e&&e.dictionary)}function Z0(i,e){var t=Y0(i);return t+8>i.length&&we(6,"invalid gzip data"),_r(i.subarray(t,-8),{i:2},e&&e.out||new Ae(Q0(i)),e&&e.dictionary)}function e1(i,e){return _r(i.subarray(J0(i,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function As(i,e){return i[0]==31&&i[1]==139&&i[2]==8?Z0(i,e):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?_d(i,e):e1(i,e)}var Ao=typeof TextDecoder<"u"&&new TextDecoder,t1=0;try{Ao.decode(K0,{stream:!0}),t1=1}catch{}var i1=function(i){for(var e="",t=0;;){var a=i[t++],n=(a>127)+(a>223)+(a>239);if(t+n>i.length)return{s:e,r:wr(i,t-1)};n?n==3?(a=((a&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):n&1?e+=String.fromCharCode((a&31)<<6|i[t++]&63):e+=String.fromCharCode((a&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(a)}};function a1(i,e){if(e){for(var t="",a=0;a<i.length;a+=16384)t+=String.fromCharCode.apply(null,i.subarray(a,a+16384));return t}else{if(Ao)return Ao.decode(i);var n=i1(i),s=n.s,t=n.r;return t.length&&we(8),s}}var n1=function(i,e){return e+30+st(i,e+26)+st(i,e+28)},s1=function(i,e,t){var a=st(i,e+28),n=a1(i.subarray(e+46,e+46+a),!(st(i,e+8)&2048)),s=e+46+a,o=et(i,e+20),r=t&&o==4294967295?o1(i,s):[o,et(i,e+24),et(i,e+42)],l=r[0],u=r[1],d=r[2];return[st(i,e+10),l,u,n,s+st(i,e+30)+st(i,e+32),d]},o1=function(i,e){for(;st(i,e)!=1;e+=4+st(i,e+2));return[Os(i,e+12),Os(i,e+4),Os(i,e+20)]};function r1(i,e){for(var t={},a=i.length-22;et(i,a)!=101010256;--a)(!a||i.length-a>65558)&&we(13);var n=st(i,a+8);if(!n)return{};var s=et(i,a+16),o=s==4294967295||n==65535;if(o){var r=et(i,a-12);o=et(i,r)==101075792,o&&(n=et(i,r+32),s=et(i,r+48))}for(var l=e&&e.filter,u=0;u<n;++u){var d=s1(i,s,o),c=d[0],h=d[1],m=d[2],v=d[3],P=d[4],f=d[5],b=n1(i,f);s=P,(!l||l({name:v,size:h,originalSize:m,compression:c}))&&(c?c==8?t[v]=_d(i.subarray(b,b+h),{out:new Ae(m)}):we(14,"unknown compression type "+c):t[v]=wr(i,b,b+h))}return t}const ln={zip:r1,gz:As,tgz:As,deflate:As};class l1 extends fe{constructor(t,a){super(t,{...{},...a});xe(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,r=s.slice(0,o),l=j0.createHash("md5").update(await r.text()).digest("hex"),u=Si(n),d=`${l}${u?`.${u}`:""}`;this.uppy.setFileState(a,{hashFileName:d})}});xe(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{relativePath:s,name:o},hashFileName:r}=n,l=s||o||r;this.uppy.setFileMeta(a,{relativePath:l,name:l})}});xe(this,"preventXssAttack",async t=>{var s;const{id:a}=t,n=this.uppy.getFile(a);if(n){const{name:o,meta:r}=this.uppy.getFile(a),l=Rr.sanitize(o);if(o!==l){const u=Si(n),d=l.endsWith(`.${u}`)?l:`${l}.${u}`;this.uppy.setFileState(a,{name:d,meta:{...r,name:d,filename:d}})}if((s=n.type)!=null&&s.includes("image/svg")){const{data:u,name:d,type:c}=this.uppy.getFile(a),h=await u.text(),m=Rr.sanitize(h,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["use"]});if(h!==m){const v=new Blob([m],{type:c}),P=ko(v,d);this.uppy.setFileState(a,{...this.uppy.getFile(a),data:P})}}}});xe(this,"preventZipBombAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);try{if(n&&ln[n.extension]){const{data:s}=n,o=ln[n.extension](new Uint8Array(await s.arrayBuffer()));let r=0;const l=(d,c)=>(r++,Object.entries(d instanceof Uint8Array?{[c||n.name]:d}:d).reduce((h,[m,v])=>{const P=h+v.byteLength;if(r>=5||P>n.size*100)throw console.error("Zip bomb detected, please check your file",{maxDepth:r,baseAcc:P,fileSize:n.size}),new Error("Zip bomb detected, please check your file");const f=ot.extension(ot.lookup(m));if(ln[f]){const b=ln[f](v);return P+l(b,m)}return P},0)),u=l(o);if(console.info(n.name,{totalUnzippedSize:u,maxDepth:r,zippedSize:n.size}),u>n.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}});xe(this,"validateImagesRespectCropperOptions",async()=>this.uppy.getFiles().reduce(async(t,a)=>{var P,f,b;await t;const{id:n}=a;let s=this.uppy.getFile(n);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(n)),!((P=this.opts.cropperOptions)!=null&&P.aspectRatio)||!((f=s==null?void 0:s.type)!=null&&f.includes("image"))||(b=s.type)!=null&&b.includes("image/svg"))return Promise.resolve();const{aspectRatio:o}=this.opts.cropperOptions,r=this.uppy.getPlugin("ImageEditor"),l=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+n).querySelector("img"),u=l==null?void 0:l.naturalWidth,d=l==null?void 0:l.naturalHeight,c=Number(u/d).toFixed(2),h=Number(o).toFixed(2);if(c===h)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),r.parent.openFileEditor(s);const v=this.i18n("aspectRatioMessage",{imageAspectRatio:c,aspectRatio:h});return this.uppy.info({message:v,details:v}),new Promise((S,x)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{S()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve()));xe(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.preventXssAttack(t),await this.preventZipBombAttack(t),await this.setMetaData(t)});xe(this,"tryDownloadRemoteFile",async t=>{var T,E;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:u,isLoading:d,remote:c,meta:h,errorCount:m=0}=t,v=!d&&r,P=`uploader:${u}:downloaded`,f=Si(t),b=(T=n==null?void 0:n.split("?"))==null?void 0:T[0],x=(()=>{const _=["jpg","jpeg"];return _.includes(f)&&_.some(F=>b==null?void 0:b.endsWith(F))?!0:b==null?void 0:b.endsWith(f)})()?b:`${b}${f?`.${f}`:""}`;if(v){const _=cd(s||((E=c==null?void 0:c.body)==null?void 0:E.url));if(m>=3)throw new Error("Download remote file failure");this.uppy.setFileState(u,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await yr.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:_}}).then(F=>F==null?void 0:F.data).then(async F=>{const A=ko(F,x);this.uppy.setFileState(u,{name:x,extension:f,type:a,data:A,preview:s||Co(A),source:o,size:A.size,isDownloading:!1,isRemote:!1,meta:{...h,name:x,filename:x}}),this.uppy.getFile(u),this.uppy.emit(P,u)}).catch(async F=>{console.error("Axios download remote file error: ",F),this.uppy.setFileState(u,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(u))})}else l&&await(async()=>new Promise(F=>{this.uppy.once(P,async()=>{F()})}))()});xe(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:Co(s)})},o.indexOf("gif")>-1?1e3:0)}});xe(this,"prepareUpload",async t=>{await this.validateImagesRespectCropperOptions();const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"PrepareUpload",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}class c1 extends fe{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>pe("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:pe("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[pe("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),pe("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return pe("div",{id:"ai-image",className:"ai-image",children:pe("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const u1="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",p1=ie.lazy(()=>Ic(()=>import("./index-BtEigcbe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]))),Ec="uploader-container",cn="uploader-dashboard",Fi=localStorage.getItem("uppy_debug"),d1=()=>Fo.get("x-csrf-token")?{"x-csrf-token":Fo.get("x-csrf-token")}:{},h1=i=>{var c;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a,resourcesProps:n,imageEditorProps:s={},theme:o}=i,{companionUrl:r}=xr(e),l=d1(),u=async h=>(await Ai.post("/api/image/generations",h)).data,d={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:Cp,options:{quality:1,...s},alwayUse:!0},(Fi||Pi()&&t.Uploaded&&!Eo())&&{id:"Uploaded",plugin:I0,options:{params:a==null?void 0:a.params}},(Fi||Pi()&&t.Resources&&!Eo())&&{id:"Resources",plugin:B0,options:{params:n==null?void 0:n.params}},Pi()&&ud()&&t.AIImage&&{id:"AIImage",plugin:c1,options:{companionUrl:r,companionHeaders:l},onShowPanel:h=>{function m(){setTimeout(()=>{var P,f;const v=document.getElementById("ai-image");v?qd(v).render(ve.jsx(p1,{theme:o,api:u,restrictions:d,i18n:(f=(P=h.current)==null?void 0:P.getUploader())==null?void 0:f.i18n,onSelect:b=>{const S=h.current.getUploader();S==null||S.emit("ai-image:selected",b),b.forEach(({src:x,alt:T},E)=>{const _=R=>(R==null?void 0:R.length)>16?`${R==null?void 0:R.slice(0,8)}...${R==null?void 0:R.slice(-4)}`:R,F=`${_(T)||_(x)}.png`,A={name:F,type:"image/png",data:ld(x,F),source:"AIImage",isRemote:!1};S==null||S.addFile(A)})}})):m()},100)}m()}},{id:"Url",plugin:Ba,options:{companionUrl:r,companionHeaders:l}},{id:"Webcam",plugin:ou,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((c=window==null?void 0:window.blocklet)!=null&&c.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:Cu,options:{companionUrl:r,companionHeaders:l,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:l1,options:{companionUrl:r,companionHeaders:l,cropperOptions:(s==null?void 0:s.cropperOptions)||null},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Yo,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function Sr(i){const{id:e,plugins:t,locale:a,onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:u,pluginList:d,restrictions:c,onChange:h,initialFiles:m}=i,v=Bc(d,"id"),{uploaderUrl:P}=xr(r);let f=new Io({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Fi||""),locale:ed[a||"en"],onBeforeFileAdded:(x,T)=>{if(Object.hasOwn(T,x.id))return!1;const E=!!ot.extension(x.type),_=ot.lookup(x.name)||"";if(!E&&_&&_!==x.type){const F=Si(x);F&&(x.extension=F),x.type=_}return x},...o,restrictions:c}).use(Zp,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(x,T){var X,W;const{hashFileName:E,id:_,meta:F}=T,A=((X=f.getFile(_))==null?void 0:X.mockResponse)||null;x.getMethod()==="PATCH"&&A&&(x.send=()=>A);const R=Si(T);x.setHeader("x-uploader-file-name",`${E}`),x.setHeader("x-uploader-file-id",`${_}`),x.setHeader("x-uploader-file-ext",`${R}`),x.setHeader("x-uploader-base-url",new URL(x.getURL()).pathname),x.setHeader("x-uploader-endpoint-url",P),x.setHeader("x-uploader-metadata",JSON.stringify(F,($,q)=>typeof q=="string"?encodeURIComponent(q):q));const j=Fo.get("x-csrf-token");j&&x.setHeader("x-csrf-token",j);const N=(window==null?void 0:window.uploaderComponentId)||((W=window==null?void 0:window.blocklet)==null?void 0:W.componentId);N&&x.setHeader("x-component-did",(N||"").split("/").pop())},onAfterResponse:async(x,T)=>{const E={},_=x.getUnderlyingObject();try{_.response&&(E.data=JSON.parse(_.response))}catch{E.data={}}E.method=x.getMethod().toUpperCase(),E.url=x.getURL(),E.status=_.status,E.headers={...x._headers};const F=_.getAllResponseHeaders();F&&F.split(`\r
|
|
55
|
+
`,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));xe(this,"convertImgToObject",Rs(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(u=>u.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=md(s.originalname),[".mp4",".webm"].find(u=>{var d;return(d=a.src)==null?void 0:d.endsWith(u)})){const u=document.createElement("video");u.src=a.src,u.width=a.width,u.height=a.height,u.autoplay=!0,u.setAttribute("playsinline","playsinline"),u.muted=!0,u.loop=!0,u.style="pointer-events: none;",o.appendChild(u)}else{const u=document.createElement("object");u.data=n,u.type=s.mimetype||"image/png",u.alt=s.originalname,u.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",u.loading="lazy",o.appendChild(u)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));xe(this,"resetState",()=>{this.uploadedAPIData={...Pc},this.uploaded.setPluginState({...Fc}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...Pc},this.addUploadItemFlag=!0,this.icon=()=>pe("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[pe("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),pe("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),pe("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),pe("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),pe("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new qo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...Fc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const Cc={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},kc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},fd={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},M0={...fd,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class B0 extends fe{constructor(t,a){super(t,a);xe(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await Ai.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=Mc([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=Ua(s,0,0,dt);return n=Ua(s,400,0,dt),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});xe(this,"resetState",()=>{this.apiData={...Cc},this.resources.setPluginState({...kc})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Cc},this.icon=()=>pe("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[pe("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),pe("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),pe("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),pe("div",{id:"resources",className:"uploaded",children:[pe("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>pe("button",{style:this.apiData.componentDid===a.did?M0:fd,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Qd(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new qo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...kc}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("resources:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var N0=Rd();const j0=ht(N0);var Ae=Uint8Array,yi=Uint16Array,L0=Int32Array,gd=new Ae([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vd=new Ae([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),z0=new Ae([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bd=function(i,e){for(var t=new yi(31),a=0;a<31;++a)t[a]=e+=1<<i[a-1];for(var n=new L0(t[30]),a=1;a<30;++a)for(var s=t[a];s<t[a+1];++s)n[s]=s-t[a]<<5|a;return{b:t,r:n}},yd=bd(gd,2),xd=yd.b,$0=yd.r;xd[28]=258,$0[258]=28;var q0=bd(vd,0),H0=q0.b,Oo=new yi(32768);for(var J=0;J<32768;++J){var Ot=(J&43690)>>1|(J&21845)<<1;Ot=(Ot&52428)>>2|(Ot&13107)<<2,Ot=(Ot&61680)>>4|(Ot&3855)<<4,Oo[J]=((Ot&65280)>>8|(Ot&255)<<8)>>1}var ba=function(i,e,t){for(var a=i.length,n=0,s=new yi(e);n<a;++n)i[n]&&++s[i[n]-1];var o=new yi(e);for(n=1;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;var r;if(t){r=new yi(1<<e);var l=15-e;for(n=0;n<a;++n)if(i[n])for(var u=n<<4|i[n],d=e-i[n],c=o[i[n]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)r[Oo[c]>>l]=u}else for(r=new yi(a),n=0;n<a;++n)i[n]&&(r[n]=Oo[o[i[n]-1]++]>>15-i[n]);return r},$a=new Ae(288);for(var J=0;J<144;++J)$a[J]=8;for(var J=144;J<256;++J)$a[J]=9;for(var J=256;J<280;++J)$a[J]=7;for(var J=280;J<288;++J)$a[J]=8;var wd=new Ae(32);for(var J=0;J<32;++J)wd[J]=5;var W0=ba($a,9,1),V0=ba(wd,5,1),Ts=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},Xe=function(i,e,t){var a=e/8|0;return(i[a]|i[a+1]<<8)>>(e&7)&t},Ds=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},G0=function(i){return(i+7)/8|0},wr=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new Ae(i.subarray(e,t))},X0=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],we=function(i,e,t){var a=new Error(e||X0[i]);if(a.code=i,Error.captureStackTrace&&Error.captureStackTrace(a,we),!t)throw a;return a},_r=function(i,e,t,a){var n=i.length,s=a?a.length:0;if(!n||e.f&&!e.l)return t||new Ae(0);var o=!t,r=o||e.i!=2,l=e.i;o&&(t=new Ae(n*3));var u=function(zt){var Ri=t.length;if(zt>Ri){var mt=new Ae(Math.max(Ri*2,zt));mt.set(t),t=mt}},d=e.f||0,c=e.p||0,h=e.b||0,m=e.l,v=e.d,P=e.m,f=e.n,b=n*8;do{if(!m){d=Xe(i,c,1);var S=Xe(i,c+1,3);if(c+=3,S)if(S==1)m=W0,v=V0,P=9,f=5;else if(S==2){var _=Xe(i,c,31)+257,F=Xe(i,c+10,15)+4,A=_+Xe(i,c+5,31)+1;c+=14;for(var R=new Ae(A),j=new Ae(19),N=0;N<F;++N)j[z0[N]]=Xe(i,c+N*3,7);c+=F*3;for(var X=Ts(j),W=(1<<X)-1,$=ba(j,X,1),N=0;N<A;){var q=$[Xe(i,c,W)];c+=q&15;var x=q>>4;if(x<16)R[N++]=x;else{var w=0,g=0;for(x==16?(g=3+Xe(i,c,3),c+=2,w=R[N-1]):x==17?(g=3+Xe(i,c,7),c+=3):x==18&&(g=11+Xe(i,c,127),c+=7);g--;)R[N++]=w}}var y=R.subarray(0,_),C=R.subarray(_);P=Ts(y),f=Ts(C),m=ba(y,P,1),v=ba(C,f,1)}else we(1);else{var x=G0(c)+4,T=i[x-4]|i[x-3]<<8,E=x+T;if(E>n){l&&we(0);break}r&&u(h+T),t.set(i.subarray(x,E),h),e.b=h+=T,e.p=c=E*8,e.f=d;continue}if(c>b){l&&we(0);break}}r&&u(h+131072);for(var O=(1<<P)-1,D=(1<<f)-1,k=c;;k=c){var w=m[Ds(i,c)&O],M=w>>4;if(c+=w&15,c>b){l&&we(0);break}if(w||we(2),M<256)t[h++]=M;else if(M==256){k=c,m=null;break}else{var L=M-254;if(M>264){var N=M-257,V=gd[N];L=Xe(i,c,(1<<V)-1)+xd[N],c+=V}var H=v[Ds(i,c)&D],K=H>>4;H||we(3),c+=H&15;var C=H0[K];if(K>3){var V=vd[K];C+=Ds(i,c)&(1<<V)-1,c+=V}if(c>b){l&&we(0);break}r&&u(h+131072);var Se=h+L;if(h<C){var Lt=s-C,Wn=Math.min(C,Se);for(Lt+h<0&&we(3);h<Wn;++h)t[h]=a[Lt+h]}for(;h<Se;++h)t[h]=t[h-C]}}e.l=m,e.p=k,e.b=h,e.f=d,m&&(d=1,e.m=P,e.d=v,e.n=f)}while(!d);return h!=t.length&&o?wr(t,0,h):t.subarray(0,h)},K0=new Ae(0),st=function(i,e){return i[e]|i[e+1]<<8},et=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},Os=function(i,e){return et(i,e)+et(i,e+4)*4294967296},Y0=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&we(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var a=(e>>3&1)+(e>>4&1);a>0;a-=!i[t++]);return t+(e&2)},Q0=function(i){var e=i.length;return(i[e-4]|i[e-3]<<8|i[e-2]<<16|i[e-1]<<24)>>>0},J0=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&we(6,"invalid zlib data"),(i[1]>>5&1)==+!e&&we(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function _d(i,e){return _r(i,{i:2},e&&e.out,e&&e.dictionary)}function Z0(i,e){var t=Y0(i);return t+8>i.length&&we(6,"invalid gzip data"),_r(i.subarray(t,-8),{i:2},e&&e.out||new Ae(Q0(i)),e&&e.dictionary)}function e1(i,e){return _r(i.subarray(J0(i,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function As(i,e){return i[0]==31&&i[1]==139&&i[2]==8?Z0(i,e):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?_d(i,e):e1(i,e)}var Ao=typeof TextDecoder<"u"&&new TextDecoder,t1=0;try{Ao.decode(K0,{stream:!0}),t1=1}catch{}var i1=function(i){for(var e="",t=0;;){var a=i[t++],n=(a>127)+(a>223)+(a>239);if(t+n>i.length)return{s:e,r:wr(i,t-1)};n?n==3?(a=((a&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):n&1?e+=String.fromCharCode((a&31)<<6|i[t++]&63):e+=String.fromCharCode((a&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(a)}};function a1(i,e){if(e){for(var t="",a=0;a<i.length;a+=16384)t+=String.fromCharCode.apply(null,i.subarray(a,a+16384));return t}else{if(Ao)return Ao.decode(i);var n=i1(i),s=n.s,t=n.r;return t.length&&we(8),s}}var n1=function(i,e){return e+30+st(i,e+26)+st(i,e+28)},s1=function(i,e,t){var a=st(i,e+28),n=a1(i.subarray(e+46,e+46+a),!(st(i,e+8)&2048)),s=e+46+a,o=et(i,e+20),r=t&&o==4294967295?o1(i,s):[o,et(i,e+24),et(i,e+42)],l=r[0],u=r[1],d=r[2];return[st(i,e+10),l,u,n,s+st(i,e+30)+st(i,e+32),d]},o1=function(i,e){for(;st(i,e)!=1;e+=4+st(i,e+2));return[Os(i,e+12),Os(i,e+4),Os(i,e+20)]};function r1(i,e){for(var t={},a=i.length-22;et(i,a)!=101010256;--a)(!a||i.length-a>65558)&&we(13);var n=st(i,a+8);if(!n)return{};var s=et(i,a+16),o=s==4294967295||n==65535;if(o){var r=et(i,a-12);o=et(i,r)==101075792,o&&(n=et(i,r+32),s=et(i,r+48))}for(var l=e&&e.filter,u=0;u<n;++u){var d=s1(i,s,o),c=d[0],h=d[1],m=d[2],v=d[3],P=d[4],f=d[5],b=n1(i,f);s=P,(!l||l({name:v,size:h,originalSize:m,compression:c}))&&(c?c==8?t[v]=_d(i.subarray(b,b+h),{out:new Ae(m)}):we(14,"unknown compression type "+c):t[v]=wr(i,b,b+h))}return t}const ln={zip:r1,gz:As,tgz:As,deflate:As};class l1 extends fe{constructor(t,a){super(t,{...{},...a});xe(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,r=s.slice(0,o),l=j0.createHash("md5").update(await r.text()).digest("hex"),u=Si(n),d=`${l}${u?`.${u}`:""}`;this.uppy.setFileState(a,{hashFileName:d})}});xe(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{relativePath:s,name:o},hashFileName:r}=n,l=s||o||r;this.uppy.setFileMeta(a,{relativePath:l,name:l})}});xe(this,"preventXssAttack",async t=>{var s;const{id:a}=t,n=this.uppy.getFile(a);if(n){const{name:o,meta:r}=this.uppy.getFile(a),l=Rr.sanitize(o);if(o!==l){const u=Si(n),d=l.endsWith(`.${u}`)?l:`${l}.${u}`;this.uppy.setFileState(a,{name:d,meta:{...r,name:d,filename:d}})}if((s=n.type)!=null&&s.includes("image/svg")){const{data:u,name:d,type:c}=this.uppy.getFile(a),h=await u.text(),m=Rr.sanitize(h,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["use"]});if(h!==m){const v=new Blob([m],{type:c}),P=ko(v,d);this.uppy.setFileState(a,{...this.uppy.getFile(a),data:P})}}}});xe(this,"preventZipBombAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);try{if(n&&ln[n.extension]){const{data:s}=n,o=ln[n.extension](new Uint8Array(await s.arrayBuffer()));let r=0;const l=(d,c)=>(r++,Object.entries(d instanceof Uint8Array?{[c||n.name]:d}:d).reduce((h,[m,v])=>{const P=h+v.byteLength;if(r>=5||P>n.size*100)throw console.error("Zip bomb detected, please check your file",{maxDepth:r,baseAcc:P,fileSize:n.size}),new Error("Zip bomb detected, please check your file");const f=ot.extension(ot.lookup(m));if(ln[f]){const b=ln[f](v);return P+l(b,m)}return P},0)),u=l(o);if(console.info(n.name,{totalUnzippedSize:u,maxDepth:r,zippedSize:n.size}),u>n.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}});xe(this,"validateImagesRespectCropperOptions",async()=>this.uppy.getFiles().reduce(async(t,a)=>{var P,f,b;await t;const{id:n}=a;let s=this.uppy.getFile(n);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(n)),!((P=this.opts.cropperOptions)!=null&&P.aspectRatio)||!((f=s==null?void 0:s.type)!=null&&f.includes("image"))||(b=s.type)!=null&&b.includes("image/svg"))return Promise.resolve();const{aspectRatio:o}=this.opts.cropperOptions,r=this.uppy.getPlugin("ImageEditor"),l=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+n).querySelector("img"),u=l==null?void 0:l.naturalWidth,d=l==null?void 0:l.naturalHeight,c=Number(u/d).toFixed(2),h=Number(o).toFixed(2);if(c===h)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),r.parent.openFileEditor(s);const v=this.i18n("aspectRatioMessage",{imageAspectRatio:c,aspectRatio:h});return this.uppy.info({message:v,details:v}),new Promise((S,x)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{S()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve()));xe(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.preventXssAttack(t),await this.preventZipBombAttack(t),await this.setMetaData(t)});xe(this,"tryDownloadRemoteFile",async t=>{var T,E;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:u,isLoading:d,remote:c,meta:h,errorCount:m=0}=t,v=!d&&r,P=`uploader:${u}:downloaded`,f=Si(t),b=(T=n==null?void 0:n.split("?"))==null?void 0:T[0],x=(()=>{const _=["jpg","jpeg"];return _.includes(f)&&_.some(F=>b==null?void 0:b.endsWith(F))?!0:b==null?void 0:b.endsWith(f)})()?b:`${b}${f?`.${f}`:""}`;if(v){const _=cd(s||((E=c==null?void 0:c.body)==null?void 0:E.url));if(m>=3)throw new Error("Download remote file failure");this.uppy.setFileState(u,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await yr.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:_}}).then(F=>F==null?void 0:F.data).then(async F=>{const A=ko(F,x);this.uppy.setFileState(u,{name:x,extension:f,type:a,data:A,preview:s||Co(A),source:o,size:A.size,isDownloading:!1,isRemote:!1,meta:{...h,name:x,filename:x}}),this.uppy.getFile(u),this.uppy.emit(P,u)}).catch(async F=>{console.error("Axios download remote file error: ",F),this.uppy.setFileState(u,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(u))})}else l&&await(async()=>new Promise(F=>{this.uppy.once(P,async()=>{F()})}))()});xe(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:Co(s)})},o.indexOf("gif")>-1?1e3:0)}});xe(this,"prepareUpload",async t=>{await this.validateImagesRespectCropperOptions();const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"PrepareUpload",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}class c1 extends fe{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>pe("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:pe("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[pe("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),pe("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return pe("div",{id:"ai-image",className:"ai-image",children:pe("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const u1="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",p1=ie.lazy(()=>Ic(()=>import("./index-BWka1Lo8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]))),Ec="uploader-container",cn="uploader-dashboard",Fi=localStorage.getItem("uppy_debug"),d1=()=>Fo.get("x-csrf-token")?{"x-csrf-token":Fo.get("x-csrf-token")}:{},h1=i=>{var c;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a,resourcesProps:n,imageEditorProps:s={},theme:o}=i,{companionUrl:r}=xr(e),l=d1(),u=async h=>(await Ai.post("/api/image/generations",h)).data,d={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:Cp,options:{quality:1,...s},alwayUse:!0},(Fi||Pi()&&t.Uploaded&&!Eo())&&{id:"Uploaded",plugin:I0,options:{params:a==null?void 0:a.params}},(Fi||Pi()&&t.Resources&&!Eo())&&{id:"Resources",plugin:B0,options:{params:n==null?void 0:n.params}},Pi()&&ud()&&t.AIImage&&{id:"AIImage",plugin:c1,options:{companionUrl:r,companionHeaders:l},onShowPanel:h=>{function m(){setTimeout(()=>{var P,f;const v=document.getElementById("ai-image");v?qd(v).render(ve.jsx(p1,{theme:o,api:u,restrictions:d,i18n:(f=(P=h.current)==null?void 0:P.getUploader())==null?void 0:f.i18n,onSelect:b=>{const S=h.current.getUploader();S==null||S.emit("ai-image:selected",b),b.forEach(({src:x,alt:T},E)=>{const _=R=>(R==null?void 0:R.length)>16?`${R==null?void 0:R.slice(0,8)}...${R==null?void 0:R.slice(-4)}`:R,F=`${_(T)||_(x)}.png`,A={name:F,type:"image/png",data:ld(x,F),source:"AIImage",isRemote:!1};S==null||S.addFile(A)})}})):m()},100)}m()}},{id:"Url",plugin:Ba,options:{companionUrl:r,companionHeaders:l}},{id:"Webcam",plugin:ou,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((c=window==null?void 0:window.blocklet)!=null&&c.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:Cu,options:{companionUrl:r,companionHeaders:l,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:l1,options:{companionUrl:r,companionHeaders:l,cropperOptions:(s==null?void 0:s.cropperOptions)||null},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Yo,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function Sr(i){const{id:e,plugins:t,locale:a,onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:u,pluginList:d,restrictions:c,onChange:h,initialFiles:m}=i,v=Bc(d,"id"),{uploaderUrl:P}=xr(r);let f=new Io({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Fi||""),locale:ed[a||"en"],onBeforeFileAdded:(x,T)=>{if(Object.hasOwn(T,x.id))return!1;const E=!!ot.extension(x.type),_=ot.lookup(x.name)||"";if(!E&&_&&_!==x.type){const F=Si(x);F&&(x.extension=F),x.type=_}return x},...o,restrictions:c}).use(Zp,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(x,T){var X,W;const{hashFileName:E,id:_,meta:F}=T,A=((X=f.getFile(_))==null?void 0:X.mockResponse)||null;x.getMethod()==="PATCH"&&A&&(x.send=()=>A);const R=Si(T);x.setHeader("x-uploader-file-name",`${E}`),x.setHeader("x-uploader-file-id",`${_}`),x.setHeader("x-uploader-file-ext",`${R}`),x.setHeader("x-uploader-base-url",new URL(x.getURL()).pathname),x.setHeader("x-uploader-endpoint-url",P),x.setHeader("x-uploader-metadata",JSON.stringify(F,($,q)=>typeof q=="string"?encodeURIComponent(q):q));const j=Fo.get("x-csrf-token");j&&x.setHeader("x-csrf-token",j);const N=(window==null?void 0:window.uploaderComponentId)||((W=window==null?void 0:window.blocklet)==null?void 0:W.componentId);N&&x.setHeader("x-component-did",(N||"").split("/").pop())},onAfterResponse:async(x,T)=>{const E={},_=x.getUnderlyingObject();try{_.response&&(E.data=JSON.parse(_.response))}catch{E.data={}}E.method=x.getMethod().toUpperCase(),E.url=x.getURL(),E.status=_.status,E.headers={...x._headers};const F=_.getAllResponseHeaders();F&&F.split(`\r
|
|
56
56
|
`).forEach(X=>{const[W,$]=X.split(": ");W&&$&&(E.headers[W]=$)});const A=f.getFile(E.headers["x-uploader-file-id"]);if(x.getMethod()==="PATCH"&&A.mockResponse)return;if(["PATCH","POST"].includes(E.method)&&[200,500].includes(E.status)){const N=[!0,"true"].includes(E.headers["x-uploader-file-exist"]),X=dd(E.url,E.headers["x-uploader-file-name"]);E.file=A,E.uploadURL=X;const W={uploadURL:X,...E};f.setFileState(A.id,{responseResult:W}),N&&A&&(E.method==="POST"&&f.setFileState(A.id,{mockResponse:T}),f.emit("upload-success",f.getFile(A.id),{...W,body:E.data}),f.emit("postprocess-complete",f.getFile(A.id)),f.calculateTotalProgress()),E.status===200&&(await(s==null?void 0:s(E)),f.emitUploadSuccess(A,E))}n&&await(n==null?void 0:n(_));const R=f.getState().totalProgress===100,j=f.getFiles().every(N=>N.source==="DropTarget");R&&j&&f.close()},...l});const b=({fileIDs:x,id:T})=>{x.forEach(E=>{f.setFileState(E,{uploadID:T})})};f.off("upload",b),f.on("upload",b);const S=x=>{typeof h=="function"&&h(x,f.getFiles())};return f.off("file-added",S),f.on("file-added",S),f.off("file-removed-success",S),f.on("file-removed-success",S),u&&f.use(up,{target:document.body,onDrop:x=>{var T;(T=f==null?void 0:f.open)==null||T.call(f)},...u}),t==null||t.forEach(x=>{if(x){const{plugin:T,options:E}=v[x]||{};T&&f.use(T,E)}}),hd(f),m&&(m==null?void 0:m.length)>0&&f.addFiles(m),f}const Ro=ie.forwardRef((i,e)=>{var N,X,W,$,q,w,g,y,C,O,D;const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,...i==null?void 0:i.apiPathProps},a=ie.useRef(null),n=Ud({open:!1,uppy:null,availablePluginMap:{},restrictions:{}}),s=Id(),o=h1({...i,apiPathProps:t,availablePluginMap:n.availablePluginMap,restrictions:n.restrictions,theme:s}),{plugins:r=o.map(k=>k.id),id:l="Uploader",popup:u=!1,uploadedProps:d,resourcesProps:c,onOpen:h,onClose:m,locale:v,installerProps:P}=i,f=Bc(o,"id"),b=Md(k=>{var M;return(M=k==null?void 0:k.breakpoints)==null?void 0:M.down("md")}),S=Dr([...r,...o.filter(k=>k.alwayUse).map(k=>k.id)]),{loading:x}=Bd(async()=>{var M,L,V,H,K;let k=Or((M=i==null?void 0:i.coreProps)==null?void 0:M.restrictions)?{}:Ar((L=i==null?void 0:i.coreProps)==null?void 0:L.restrictions);if(Pi())try{await Ai.get("/api/uploader/status").then(({data:Se})=>{var Lt;n.availablePluginMap=Se.availablePluginMap,!t.disableMediaKitPrefix&&Or((Lt=i==null?void 0:i.coreProps)==null?void 0:Lt.restrictions)&&(k=Se.restrictions||{})})}catch{}!((V=k==null?void 0:k.allowedFileTypes)!=null&&V.length)&&(k!=null&&k.allowedFileExts)&&(k.allowedFileTypes=Dr((K=(H=(typeof(k==null?void 0:k.allowedFileExts)=="string"?k==null?void 0:k.allowedFileExts.split(","):k==null?void 0:k.allowedFileExts)||[])==null?void 0:H.map(Se=>ot.lookup((Se==null?void 0:Se.replaceAll(" ",""))||"")))==null?void 0:K.filter(Se=>Se)),delete k.allowedFileExts),k.maxFileSize&&typeof k.maxFileSize=="string"&&(k.maxFileSize=Q.parseSize(k.maxFileSize,{iec:!1})||void 0),n.restrictions=Ar(k)},{refreshDeps:[JSON.stringify({apiPathProps:t,restrictionsProps:(N=i==null?void 0:i.coreProps)==null?void 0:N.restrictions})]});Gd("esc",k=>{n.open&&(k.stopPropagation(),k.preventDefault(),F())},{useCapture:!0}),ie.useEffect(()=>{pd(t),n.uppy=Sr({...i,id:l,plugins:S,apiPathProps:t,pluginList:o,restrictions:n.restrictions}),n.uppy.open=_,n.uppy.close=F,n.uppy.openPlugin=T;const k=V=>{const{onShowPanel:H}=f[V];H==null||H(e)};n.uppy.off("dashboard:show-panel",k),n.uppy.on("dashboard:show-panel",k);const M=(V,H,K,Se)=>{var zt,Ri;const Lt=V.map(mt=>{var Fr,Cr,kr;const Pd={name:mt.id||((kr=(Cr=(Fr=mt.fileUrl)==null?void 0:Fr.split("/"))==null?void 0:Cr.slice(-1))==null?void 0:kr[0]),type:mt.mimetype||ot.lookup(mt.fileUrl),data:"",preview:mt.fileUrl,source:Se,isRemote:!0},Fd=H.uppy.addFile(Pd);return{...mt,uppyFile:H.uppy.getFile(Fd)}}),Wn=`${Se.toLowerCase()}Props`;(Ri=(zt=K[Wn])==null?void 0:zt.onSelectedFiles)==null||Ri.call(zt,Lt)};[{name:"Uploaded",event:"uploaded:selected"},{name:"Resources",event:"resources:selected"}].forEach(({name:V,event:H})=>{S.includes(V)&&(n.uppy.off(H),n.uppy.on(H,K=>M(K,n,i,V)))})},[JSON.stringify({id:l,plugins:S,apiPathProps:t,locale:v,restrictions:n.restrictions,theme:s})]);function T(k){var M,L,V;if(k=k.replace(/\s/g,""),["MyDevice",...S].map(H=>H.toLowerCase()).includes(k.toLowerCase())){let H=`div[data-uppy-acquirer-id="${k}"] > button`;(V=(L=(M=document==null?void 0:document.getElementById(cn))==null?void 0:M.querySelector(H))==null?void 0:L.click)==null||V.call(L)}}const E=ie.useCallback(k=>{Fi&&a.current&&!a.current.contains(k.target)&&console.info("debug focus",a.current,k.target)},[]);function _(k){var L,V,H,K;n.open=!0,k&&setTimeout(()=>{T(k)},200),n.uppy.emitOpen(),h==null||h(),(V=(L=document.activeElement)==null?void 0:L.blur)==null||V.call(L);const M=n.uppy.getPlugin(cn).el;(H=M==null?void 0:M.focus)==null||H.call(M),(K=M==null?void 0:M.click)==null||K.call(M),Fi&&u&&(document.addEventListener("mousedown",E),document.addEventListener("touchstart",E))}function F(){var k;(k=n.uppy.getPlugin(cn))==null||k.hideAllPanels(),n.open=!1,n.uppy.emitClose(),m==null||m(),setTimeout(()=>{n.uppy.getState().totalProgress===100&&(n.uppy.setState({files:{},currentUploads:{}}),n.uppy.calculateTotalProgress())},500),Fi&&u&&(document.removeEventListener("mousedown",E),document.removeEventListener("touchstart",E))}ie.useImperativeHandle(e,()=>({getUploader:()=>n.uppy,open:_,close:F}));const A=u?$d:ie.Fragment,R=u?{sx:{zIndex:99999999999,background:"rgba(0,0,0,0.5)","& > *":{display:n.open?"block":"none"},...(X=i==null?void 0:i.wrapperProps)==null?void 0:X.sx},invisible:!0,open:n.open,onClick:k=>{document.activeElement===document.body&&(k.stopPropagation(),F())},...i.wrapperProps}:{...i.wrapperProps},j=b?"42px":"40px";return ve.jsx(A,{...R,children:ve.jsxs(Kd,{onClose:F,did:u1,disabled:!n.open,...P,children:[ve.jsx(Nd,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),ve.jsxs(Us,{className:"uploader-container",ref:a,id:Ec,onClick:k=>k.stopPropagation(),sx:{position:"relative",width:b?"90vw":720,".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{background:"repeating-conic-gradient(#bdbdbd33 0 25%,#fff 0 50%) 50%/16px 16px !important"},".uploaded-add-item":{background:"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:"rgba(0,0,0,0.13)"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{background:"#fff",height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}},"& .uppy-Dashboard-browse, & .uppy-DashboardContent-addMore, & .uppy-DashboardContent-back, & .uppy-StatusBar-actionBtn--done, & .uppy-DashboardContent-save, & .uppy-StatusBar-actionBtn--upload":{color:`${($=(W=s==null?void 0:s.palette)==null?void 0:W.primary)==null?void 0:$.main}`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{color:`${(w=(q=s==null?void 0:s.palette)==null?void 0:q.primary)==null?void 0:w.main}`,filter:"brightness(1.2)"}},"& .uppy-c-btn-primary":{backgroundColor:`${(y=(g=s==null?void 0:s.palette)==null?void 0:g.primary)==null?void 0:y.main} !important`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{backgroundColor:`${(O=(C=s==null?void 0:s.palette)==null?void 0:C.primary)==null?void 0:O.main} !important`,filter:"brightness(1.2)"}}},children:[u&&ve.jsx(jd,{"aria-label":"close",onClick:F,sx:{color:"#fafafa",position:"absolute",...b?{bottom:`calc(0px - ${j} - 16px)`,left:`calc(50vw - ${j} - 8px)`}:{right:`calc(0px - ${j} - 16px)`,top:-12}},children:ve.jsx(Jd,{sx:{fontSize:j}})}),x&&ve.jsxs(Us,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",zIndex:99999999999,flexDirection:"column",background:"rgba(256, 256, 256, 0.2)",backdropFilter:"blur(4px)",borderRadius:1,pointerEvents:"none"},children:[ve.jsx(R0,{size:32}),ve.jsx(Ld,{variant:"body2",color:"primary",sx:{mt:1.5,fontWeight:"bold"},children:zd(ed,`${v}.strings.loadingStatus`)})]}),n.uppy&&ve.jsx(ep,{inline:!0,target:`#${Ec}`,id:cn,uppy:n.uppy,plugins:S,fileManagerSelectionType:((D=n.restrictions)==null?void 0:D.maxNumberOfFiles)===1?"files":"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,note:"",doneButtonHandler:F,...i.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}),m1=Object.freeze(Object.defineProperty({__proto__:null,Uploader:Ro,default:Ro,initUploader:Sr},Symbol.toStringTag,{value:"Module"})),Tc=ie.lazy(()=>Ic(()=>Promise.resolve().then(()=>m1),void 0).then(i=>({default:i.Uploader}))),Pr=ie.createContext(null);function Sd(){const i=ie.useContext(Pr);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function f1({onChange:i,children:e,...t}){const a=Sd(),n=()=>{var o;const s=(o=a==null?void 0:a.current)==null?void 0:o.getUploader();s==null||s.open(),i&&s.onceUploadSuccess((...r)=>{i(...r)})};return ve.jsx(Us,{onClick:n,...t,children:e})}function g1({children:i,popup:e,...t}){const a=ie.useRef(null),n=ie.useMemo(()=>e?Hd.createPortal(ve.jsx(Tc,{ref:a,popup:!0,...t},"uploader"),document.body):ve.jsx(Tc,{ref:a,popup:!1,...t},"uploader"),[a,e,t]);return ve.jsxs(Pr.Provider,{value:a,children:[i,n]})}const z1=Object.freeze(Object.defineProperty({__proto__:null,CLOSE:Sn,OPEN:_n,UPLOADER_UPLOAD_SUCCESS:To,Uploader:Ro,UploaderContext:Pr,UploaderProvider:g1,UploaderTrigger:f1,api:yr,base64ToFile:ld,blobToFile:ko,createImageUrl:Ua,getAIKitComponent:ud,getDownloadUrl:cd,getExt:Si,getMediaKitComponent:Pi,getObjectURL:Co,getUploaderEndpoint:xr,getUrl:dd,initUploader:Sr,initUppy:hd,isBlob:rd,isMediaKit:Eo,mediaKitApi:Ai,mediaKitMountPoint:dt,parseStringToDot:md,get prefixPath(){return Nt},setPrefixPath:pd,useUploaderContext:Sd},Symbol.toStringTag,{value:"Module"}));export{ud as g,z1 as i,Bc as k};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as we,aG as $e,aH as Fe,T as K,r as R,aK as g1,aN as u2,aO as Ue,aP as qe,cY as p2,fK as s1,Z as ke,$ as Ie,a1 as We,B as y,P as h,G as J,e as b1,u as te,aR as Re,a_ as Ne,bz as r1,a3 as t1,L as pe,bL as b0,a as ge,aE as be,N as h2,t as F,a0 as ce,dG as f2,ac as ze,c as he,I as x2,bW as j1,cj as j0,cM as m2,cV as He,cW as w0,al as v2,da as g2,cQ as Qe,bF as ie,c4 as Ye,fw as b2,aa as Y1,fL as j2,b as ne,n as o1,bo as R0,el as C0,ak as w1,bp as y0,cA as z0,aV as Oe,aU as w2,bh as Me,a5 as S0,fM as Z1,fj as Le,bm as R2,aw as k0,c3 as C2,l as y2,aD as z2,as as S2,at as c1}from"./index-Dd9xMZEz.js";import{d as R1}from"./Add-C5wKbObL.js";import{d as I0,a as k2}from"./Delete-4PM7zdFM.js";import{d as I2}from"./Error-Dln9la_X.js";import{D as C1}from"./index-DNivnwSJ.js";import{T as M0,b as M2}from"./index-4Vv_xV1i.js";import{C as y1}from"./confirm-Ddpyr19d.js";import{u as i1}from"./session-5TSm9LWM.js";import{W as e0}from"./did-address-CM_8YqbE.js";import{E as Ge,D as P2,C as L2,P as T2}from"./react-beautiful-dnd.esm-BJ9lX_Fr.js";import{B as z1}from"./bundle-avatar-Co5kQjOo.js";import{S as je}from"./shorten-label-DN0jrUac.js";import{A as P0}from"./Avatar-DyK43nCT.js";import{d as D2}from"./Download-B85Kmt1U.js";import{d as N2}from"./QuestionMarkCircle-C8r6Lbfw.js";import{b as V2,c as t0,T as _2}from"./index-SC5yW-Mc.js";import{_ as Pe}from"./useSetState-l_4RfoXS.js";import{c as S1}from"./index-DyVo1ugh.js";import{C as h1,L as E2}from"./MoreVert-Dy3B-4PZ.js";import{A as L0}from"./Alert-ClGA4UON.js";import{p as l1}from"./index-CjgG9Mbh.js";import"./api-J-ppmLLo.js";import{i as B2}from"./index-gZFJJRf-.js";import{d as A2}from"./ExpandMore-CtG_bAfW.js";import{d as O2}from"./ChevronRight-B_bmxWe_.js";import{d as H2}from"./OpenInNew-sKjipJwH.js";import{u as T0}from"./useThemeProps-BuwBKLg_.js";import{F as f1}from"./FormControlLabel-DoWNBwBW.js";import{u as $2}from"./useSlotProps-DCQA4xi9.js";import{d as F2}from"./DeleteOutline-23K5_ksg.js";import{c as U2,A as D0,u as q2,S as W2,U as G2}from"./item-CjjCUl_D.js";import{d as K2}from"./ArrowDropDown-CK-CyRRv.js";import{f as De}from"./format-error-BXpFpsa-.js";import{B as x1}from"./ButtonGroup-DaL5PyR4.js";import{T as Te}from"./TextField-OMWgqDee.js";import{I as k1}from"./InputAdornment-DZGc8E9Q.js";import{S as Be}from"./Stack-RoMZEEMb.js";import{C as X2}from"./click-to-copy-CQnFaSnp.js";import{d as J2}from"./Launch-BpxAI4bs.js";import{S as o0}from"./index-C3SoKjGs.js";import{M as Q2}from"./index-CPpIB55-.js";import{p as Y2}from"./purify.es-Bq0E5Q3l.js";import{r as Z2}from"./index-C97ospTS.js";import{d as et}from"./Done-CKRWemQO.js";import{c as N0,d as V0,b as tt,S as ot,a as lt}from"./Stepper-D8zaVBG6.js";import{R as nt,a as l0}from"./RadioGroup-MJhlZ4ZH.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-DWAkeLNM.js";import"./index-B463Qwek.js";import"./redux-CluOqhW1.js";import"./ViewColumn-CWRGm9xJ.js";import"./FormControl-BL0Z1NSB.js";import"./useFormControl-CZU39P72.js";import"./FormGroup-QLbY_ga6.js";import"./Grid-CK8YVFLA.js";import"./Select-Bjc5h4TG.js";import"./LastPage-DGe9hoEM.js";import"./Toolbar-CZhQZvMx.js";import"./Search-CefeP42d.js";import"./index-DYz2g4w3.js";import"./DialogContentText-BAHpbVEb.js";import"./Link-t0X_2s8f.js";import"./raf-schd.esm-W-ZrlqpH.js";import"./useSlot-CHjJ1PGq.js";import"./jss-plugin-props-sort.esm-cqAVaHSM.js";const st=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),rt=["slots","slotProps"],it=se(g0)(({theme:e})=>H({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":H({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":H({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:Q1(e.palette.grey[200],.12)}:{backgroundColor:Q1(e.palette.grey[600],.12)})})),at=se(st)({width:24,height:16});function ct(e){const{slots:t={},slotProps:l={}}=e,s=we(e,rt),r=e;return o.jsx("li",{children:o.jsx(it,H({focusRipple:!0},s,{ownerState:r,children:o.jsx(at,H({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function dt(e){return Fe("MuiBreadcrumbs",e)}const ut=$e("MuiBreadcrumbs",["root","ol","li","separator"]),pt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ht=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},dt,t)},ft=se(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${ut.li}`]:t.li},t.root]})({}),xt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),mt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function vt(e,t,l,s){return e.reduce((r,a,i)=>(i<e.length-1?r=r.concat(a,o.jsx(mt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(a),r),[])}const _0=R.forwardRef(function(t,l){const s=g1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:a,component:i="nav",slots:c={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:z=8,separator:p="/"}=s,d=we(s,pt),[m,b]=R.useState(!1),v=H({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:z,separator:p}),C=ht(v),S=u2({elementType:c.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),D=R.useRef(null),L=I=>{const q=()=>{b(!0);const V=D.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(ct,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:q},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,q)=>o.jsx("li",{className:C.li,children:I},`child-${q}`));return o.jsx(ft,H({ref:l,component:i,color:"text.secondary",className:Ue(C.root,a),ownerState:v},d,{children:o.jsx(xt,{className:C.ol,ref:D,ownerState:v,children:vt(m||z&&P.length<=z?P:L(P),C.separator,p,v)})}))});function gt(e){return Fe("MuiStepButton",e)}const n0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),bt=["children","className","icon","optional"],jt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},gt,t)},wt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${n0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>H({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${n0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),Rt=R.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepButton"}),{children:r,className:a,icon:i,optional:c}=s,u=we(s,bt),{disabled:f,active:x}=R.useContext(N0),{orientation:g}=R.useContext(V0),z=H({},s,{orientation:g}),p=jt(z),d={icon:i,optional:c},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(tt,H({},d,{children:r}));return o.jsx(wt,H({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,a),ref:l,ownerState:z,"aria-current":x?"step":void 0},u,{children:m}))});function Ct(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const yt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],zt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},Ct,t)},St=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>H({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"})),kt=se(s1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),It=R.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepContent"}),{children:r,className:a,TransitionComponent:i=s1,transitionDuration:c="auto",TransitionProps:u}=s,f=we(s,yt);R.useContext(V0);const{active:x,last:g,expanded:z}=R.useContext(N0),p=H({},s,{last:g}),d=zt(p);let m=c;return c==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(St,H({className:Ue(d.root,a),ref:l,ownerState:p},f,{children:o.jsx(kt,H({as:i,in:x||z,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var I1={},Mt=Ie;Object.defineProperty(I1,"__esModule",{value:!0});var E0=I1.default=void 0,Pt=Mt(ke()),Lt=o;E0=I1.default=(0,Pt.default)((0,Lt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var M1={},Tt=Ie;Object.defineProperty(M1,"__esModule",{value:!0});var B0=M1.default=void 0,Dt=Tt(ke()),Nt=o;B0=M1.default=(0,Dt.default)((0,Nt.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 P1={},Vt=Ie;Object.defineProperty(P1,"__esModule",{value:!0});var A0=P1.default=void 0,_t=Vt(ke()),Et=o;A0=P1.default=(0,_t.default)((0,Et.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 L1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[c,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(y,{sx:{display:"flex",flexDirection:"row",color:c?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(y,{children:[o.jsx(je,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(je,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||c?"primary.main":"grey.700"},children:r||"/"})]})]})}L1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function T1({initUrl:e}){const t=b1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:a}=Re(),{api:i}=i1(),[c,u]=R.useState(!0),{blocklet:f}=Ne(),[x,g]=R.useState(null),[z,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=r1(),[b,v]=R.useState(null),C=()=>{a.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const N=(k==null?void 0:k.projects)||[];u(!1),v(N)}).catch(k=>{u(!1),F.error(k.message)})},S=()=>{t(`${J.UNOWNED_DID}/create/none`,{replace:!0})},D=k=>{g(k)},L=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{F.error(k.message),p(!1),g(null)},q=k=>{if(!(k!=null&&k.deleted)){F.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&c)return o.jsx(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ge,{})});if(!b)return null;if(!b.length)return o.jsxs(y,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(y,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(y,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(t1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const N=b[k];return o.jsx(pe,{to:`${N.id}`,children:o.jsx(L1,{did:f.meta.did,projectId:N.id,logo:N.blockletLogo,title:N.blockletTitle,describe:N.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(e0,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(e0,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const N=(f.children||[]).find(T=>T.meta.did===k);return N?o.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:14,blocklet:N,ancestors:[f]}),o.jsx(y,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:N.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(y,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(je,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const N=b[k];return o.jsxs(y,{display:"flex",children:[o.jsx(pe,{to:`${N.id}/new-release/${N.lastReleaseId}`,children:o.jsx(ge,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(be,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!N.lastReleaseId&&o.jsx(ge,{title:s("blocklet.publish.viewLastRelease",{name:N.blockletTitle}),placement:"top",children:o.jsx(be,{color:"secondary","aria-label":"create",children:o.jsx(pe,{style:{display:"flex"},to:`${N.id}/view/${N.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ge,{title:s("blocklet.publish.delete",{name:N.blockletTitle}),placement:"top",children:o.jsx(be,{color:"primary","aria-label":"delete",onClick:()=>D(N),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=z?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:q,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Bt,{children:[o.jsxs(y,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(y,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ge,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(t1,{onClick:S,variant:"contained",children:[o.jsx(R1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(y,{mt:3}),o.jsx(C1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(y1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:L,onCancel:()=>g(null),children:o.jsx(y,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(y,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(K,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}T1.propTypes={initUrl:h.object};T1.defaultProps={initUrl:null};const Bt=ce(y)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B7WSZrX4.js","assets/index-Cpcj45rd.js","assets/index-D8NuaJ66.css","assets/url-join-BHr3fLxq.js","assets/index-CWk3DsIq.js","assets/_createAggregator-CSHIra2n.js","assets/index-BoYQxNvz.js","assets/index-DbHZUu86.js","assets/index-DBKQXsCe.js","assets/fallback-DYm2eQ_8.js","assets/index-CLDXLIWr.js","assets/Menu-C6ClxI8R.js","assets/Toolbar-B24K0pP-.js","assets/Hidden-D2bPVc-Z.js","assets/index-jt9tbPDg.js","assets/MoreVert-3qdVPLsP.js","assets/FormControlLabel-BGYw4cxF.js","assets/useFormControl-DmdM9XjQ.js","assets/Stack-tyHLs2nq.js","assets/ListItemButton-BqEaHAjp.js","assets/selector-D75xbVNs.js","assets/ExpandMore-BeTREEh4.js","assets/Avatar-CZVIW9W4.js","assets/useSlot-C0VaVKX8.js","assets/resource-dialog-oLWtjFw9.js","assets/index-NBbc-nqN.js","assets/emotion-cache.browser.esm-DUnD1U-l.js","assets/index-Dr2Mtdy2.js","assets/OpenInNew-DTWztApy.js","assets/index-DaeMoett.js","assets/Link-BnwyStJD.js","assets/Skeleton-CwJc9kSo.js","assets/HelpOutline-gqc5t8GX.js","assets/index-D9JHIwyT.js","assets/ButtonGroup-NJAfDniA.js","assets/DialogContentText-y_0HIwxq.js","assets/TextField-ExXHASMC.js","assets/FormControl-BgufkNqy.js","assets/Select-DpoUFNPr.js","assets/index-B4WeaDPZ.js","assets/index-DQQ_S9kF.js","assets/index-CqU3uv11.js","assets/index-DJVbN6XR.js","assets/useThemeProps-C9REtDKX.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-CQjjZ9D3.js","assets/redux-CluOqhW1.js","assets/ViewColumn-WqJnmiSU.js","assets/FormGroup-ftMzhStq.js","assets/Grid-ByEv6TKi.js","assets/Delete-B8S8LZmV.js","assets/LastPage-LleEi5ij.js","assets/Search-jkInhIDL.js","assets/deprecate-zRAAntjP.js","assets/uniqBy-BCr2VIxS.js","assets/toUpper-C6Pk29N9.js","assets/purify.es-Bq0E5Q3l.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as we,aG as $e,aH as Fe,T as K,r as R,aK as g1,aN as u2,aO as Ue,aP as qe,cY as p2,fK as s1,Z as ke,$ as Ie,a1 as We,B as y,P as h,G as J,e as b1,u as te,aR as Re,a_ as Ne,bz as r1,a3 as t1,L as pe,bL as b0,a as ge,aE as be,N as h2,t as F,a0 as ce,dG as f2,ac as ze,c as he,I as x2,bW as j1,cj as j0,cM as m2,cV as He,cW as w0,al as v2,da as g2,cQ as Qe,bF as ie,c4 as Ye,fw as b2,aa as Y1,fL as j2,b as ne,n as o1,bo as R0,el as C0,ak as w1,bp as y0,cA as z0,aV as Oe,aU as w2,bh as Me,a5 as S0,fM as Z1,fj as Le,bm as R2,aw as k0,c3 as C2,l as y2,aD as z2,as as S2,at as c1}from"./index-Cpcj45rd.js";import{d as R1}from"./Add-D1b24h2C.js";import{d as I0,a as k2}from"./Delete-B8S8LZmV.js";import{d as I2}from"./Error-crhyvWwD.js";import{D as C1}from"./index-DJVbN6XR.js";import{T as M0,b as M2}from"./index-31nbUtvf.js";import{C as y1}from"./confirm-Bst90PE4.js";import{u as i1}from"./session-DSFe9JNg.js";import{W as e0}from"./did-address-C5wbfJu1.js";import{E as Ge,D as P2,C as L2,P as T2}from"./react-beautiful-dnd.esm-Bg00PgH1.js";import{B as z1}from"./bundle-avatar-C8-NjDQW.js";import{S as je}from"./shorten-label-95kRH9My.js";import{A as P0}from"./Avatar-CZVIW9W4.js";import{d as D2}from"./Download-CAOtDt4Y.js";import{d as N2}from"./QuestionMarkCircle-d1Ebd_H9.js";import{b as V2,c as t0,T as _2}from"./index-B4WeaDPZ.js";import{_ as Pe}from"./useSetState-CvxpkYB6.js";import{c as S1}from"./index-DbHZUu86.js";import{C as h1,L as E2}from"./MoreVert-3qdVPLsP.js";import{A as L0}from"./Alert-BQX_mYKK.js";import{p as l1}from"./index-Do-0aath.js";import"./api-WvnjspXU.js";import{i as B2}from"./index-DaeMoett.js";import{d as A2}from"./ExpandMore-BeTREEh4.js";import{d as O2}from"./ChevronRight-CSSyqQil.js";import{d as H2}from"./OpenInNew-DTWztApy.js";import{u as T0}from"./useThemeProps-C9REtDKX.js";import{F as f1}from"./FormControlLabel-BGYw4cxF.js";import{u as $2}from"./useSlotProps-D25PFONA.js";import{d as F2}from"./DeleteOutline-GMT7pXpg.js";import{c as U2,A as D0,u as q2,S as W2,U as G2}from"./item-1n-Obvap.js";import{d as K2}from"./ArrowDropDown-CtY4f_6-.js";import{f as De}from"./format-error-zcoEKeqV.js";import{B as x1}from"./ButtonGroup-NJAfDniA.js";import{T as Te}from"./TextField-ExXHASMC.js";import{I as k1}from"./InputAdornment-xdqfqU-t.js";import{S as Be}from"./Stack-tyHLs2nq.js";import{C as X2}from"./click-to-copy-Dzo_hSC7.js";import{d as J2}from"./Launch-cEuhc1Jw.js";import{S as o0}from"./index-CqU3uv11.js";import{M as Q2}from"./index-jzqdpu4B.js";import{p as Y2}from"./purify.es-Bq0E5Q3l.js";import{r as Z2}from"./index-BaHNGoYq.js";import{d as et}from"./Done-dTmNtnR9.js";import{c as N0,d as V0,b as tt,S as ot,a as lt}from"./Stepper-DOTgGwGo.js";import{R as nt,a as l0}from"./RadioGroup-Cni7TXcD.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-DUnD1U-l.js";import"./index-CQjjZ9D3.js";import"./redux-CluOqhW1.js";import"./ViewColumn-WqJnmiSU.js";import"./FormControl-BgufkNqy.js";import"./useFormControl-DmdM9XjQ.js";import"./FormGroup-ftMzhStq.js";import"./Grid-ByEv6TKi.js";import"./Select-DpoUFNPr.js";import"./LastPage-LleEi5ij.js";import"./Toolbar-B24K0pP-.js";import"./Search-jkInhIDL.js";import"./index-DQQ_S9kF.js";import"./DialogContentText-y_0HIwxq.js";import"./Link-BnwyStJD.js";import"./raf-schd.esm-DQpWk2ID.js";import"./useSlot-C0VaVKX8.js";import"./jss-plugin-props-sort.esm-BFA_sJBd.js";const st=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),rt=["slots","slotProps"],it=se(g0)(({theme:e})=>H({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":H({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":H({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:Q1(e.palette.grey[200],.12)}:{backgroundColor:Q1(e.palette.grey[600],.12)})})),at=se(st)({width:24,height:16});function ct(e){const{slots:t={},slotProps:l={}}=e,s=we(e,rt),r=e;return o.jsx("li",{children:o.jsx(it,H({focusRipple:!0},s,{ownerState:r,children:o.jsx(at,H({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function dt(e){return Fe("MuiBreadcrumbs",e)}const ut=$e("MuiBreadcrumbs",["root","ol","li","separator"]),pt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ht=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},dt,t)},ft=se(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${ut.li}`]:t.li},t.root]})({}),xt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),mt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function vt(e,t,l,s){return e.reduce((r,a,i)=>(i<e.length-1?r=r.concat(a,o.jsx(mt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(a),r),[])}const _0=R.forwardRef(function(t,l){const s=g1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:a,component:i="nav",slots:c={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:z=8,separator:p="/"}=s,d=we(s,pt),[m,b]=R.useState(!1),v=H({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:z,separator:p}),C=ht(v),S=u2({elementType:c.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),D=R.useRef(null),L=I=>{const q=()=>{b(!0);const V=D.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(ct,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:q},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,q)=>o.jsx("li",{className:C.li,children:I},`child-${q}`));return o.jsx(ft,H({ref:l,component:i,color:"text.secondary",className:Ue(C.root,a),ownerState:v},d,{children:o.jsx(xt,{className:C.ol,ref:D,ownerState:v,children:vt(m||z&&P.length<=z?P:L(P),C.separator,p,v)})}))});function gt(e){return Fe("MuiStepButton",e)}const n0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),bt=["children","className","icon","optional"],jt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},gt,t)},wt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${n0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>H({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${n0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),Rt=R.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepButton"}),{children:r,className:a,icon:i,optional:c}=s,u=we(s,bt),{disabled:f,active:x}=R.useContext(N0),{orientation:g}=R.useContext(V0),z=H({},s,{orientation:g}),p=jt(z),d={icon:i,optional:c},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(tt,H({},d,{children:r}));return o.jsx(wt,H({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,a),ref:l,ownerState:z,"aria-current":x?"step":void 0},u,{children:m}))});function Ct(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const yt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],zt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},Ct,t)},St=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>H({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"})),kt=se(s1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),It=R.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepContent"}),{children:r,className:a,TransitionComponent:i=s1,transitionDuration:c="auto",TransitionProps:u}=s,f=we(s,yt);R.useContext(V0);const{active:x,last:g,expanded:z}=R.useContext(N0),p=H({},s,{last:g}),d=zt(p);let m=c;return c==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(St,H({className:Ue(d.root,a),ref:l,ownerState:p},f,{children:o.jsx(kt,H({as:i,in:x||z,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var I1={},Mt=Ie;Object.defineProperty(I1,"__esModule",{value:!0});var E0=I1.default=void 0,Pt=Mt(ke()),Lt=o;E0=I1.default=(0,Pt.default)((0,Lt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var M1={},Tt=Ie;Object.defineProperty(M1,"__esModule",{value:!0});var B0=M1.default=void 0,Dt=Tt(ke()),Nt=o;B0=M1.default=(0,Dt.default)((0,Nt.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 P1={},Vt=Ie;Object.defineProperty(P1,"__esModule",{value:!0});var A0=P1.default=void 0,_t=Vt(ke()),Et=o;A0=P1.default=(0,_t.default)((0,Et.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 L1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[c,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(y,{sx:{display:"flex",flexDirection:"row",color:c?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(y,{children:[o.jsx(je,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(je,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||c?"primary.main":"grey.700"},children:r||"/"})]})]})}L1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function T1({initUrl:e}){const t=b1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:a}=Re(),{api:i}=i1(),[c,u]=R.useState(!0),{blocklet:f}=Ne(),[x,g]=R.useState(null),[z,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=r1(),[b,v]=R.useState(null),C=()=>{a.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const N=(k==null?void 0:k.projects)||[];u(!1),v(N)}).catch(k=>{u(!1),F.error(k.message)})},S=()=>{t(`${J.UNOWNED_DID}/create/none`,{replace:!0})},D=k=>{g(k)},L=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{F.error(k.message),p(!1),g(null)},q=k=>{if(!(k!=null&&k.deleted)){F.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&c)return o.jsx(y,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ge,{})});if(!b)return null;if(!b.length)return o.jsxs(y,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(y,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(y,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(t1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const N=b[k];return o.jsx(pe,{to:`${N.id}`,children:o.jsx(L1,{did:f.meta.did,projectId:N.id,logo:N.blockletLogo,title:N.blockletTitle,describe:N.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(e0,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(e0,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const N=(f.children||[]).find(T=>T.meta.did===k);return N?o.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:14,blocklet:N,ancestors:[f]}),o.jsx(y,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:N.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(y,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(je,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const N=b[k];return o.jsxs(y,{display:"flex",children:[o.jsx(pe,{to:`${N.id}/new-release/${N.lastReleaseId}`,children:o.jsx(ge,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(be,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!N.lastReleaseId&&o.jsx(ge,{title:s("blocklet.publish.viewLastRelease",{name:N.blockletTitle}),placement:"top",children:o.jsx(be,{color:"secondary","aria-label":"create",children:o.jsx(pe,{style:{display:"flex"},to:`${N.id}/view/${N.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ge,{title:s("blocklet.publish.delete",{name:N.blockletTitle}),placement:"top",children:o.jsx(be,{color:"primary","aria-label":"delete",onClick:()=>D(N),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=z?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:q,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Bt,{children:[o.jsxs(y,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(y,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ge,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(t1,{onClick:S,variant:"contained",children:[o.jsx(R1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(y,{mt:3}),o.jsx(C1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(y1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:L,onCancel:()=>g(null),children:o.jsx(y,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(y,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(K,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}T1.propTypes={initUrl:h.object};T1.defaultProps={initUrl:null};const Bt=ce(y)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as we,aG as $e,aH a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,u0="lastWantToConnectStoreId";function Jl(e){var c,u;const[t,l]=R.useState(null),{session:s}=i1(),r=R.useCallback(f=>{l(f),localStorage.setItem(u0,f==null?void 0:f.id)},[l]),a=R.useMemo(()=>{var z,p,d,m;const f=localStorage.getItem(u0),x=f?(((z=e==null?void 0:e.settings)==null?void 0:z.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==J.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(c=e==null?void 0:e.settings)==null?void 0:c.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||a||{},r]}const p1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){p1[r]&&clearTimeout(p1[r]),await new Promise(c=>setTimeout(c,s));const a=Date.now(),i=async(c,u)=>{try{const f=await e();c(f)}catch(f){Date.now()-a>l?u(f):r?p1[r]=setTimeout(()=>i(c,u),t):setTimeout(()=>i(c,u),t)}};return new Promise(i)}function Ql(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Yl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var a;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((a=r==null?void 0:r.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Zl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,c;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((c=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&c.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,c;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let a=e?((c=l==null?void 0:l.settings)==null?void 0:c.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:a}};function F1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:a,componentDid:i}){var N,T,E;const{t:c}=te(),{session:u}=i1(),{api:f,info:x,inService:g}=Re(),z=Ne(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),D=A=>{l(A),d(!1)},L=()=>{d(!p)},P=A=>{m.current&&m.current.contains(A.target)||d(!1)},I=()=>{v(!0)},q=()=>{v(!1)},V=async()=>{var A;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((A=z==null?void 0:z.actions)==null?void 0:A.refreshBlocklet())}catch(O){F.error(`Remove Blocklet Store Error: ${De(O)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(N=u==null?void 0:u.user)==null?void 0:N.did}),k=(T=e==null?void 0:e.meta)==null?void 0:T.did;return o.jsxs(o.Fragment,{children:[o.jsxs(x1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[a&&o.jsx(o1,{size:14,sx:{mr:.5}}),`${c("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:L,children:o.jsx(K2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:A})=>o.jsx(C0,{...A,style:{transformOrigin:"center top"},children:o.jsx(w1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(O=>{var W;return o.jsxs(Oe,{selected:O.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>D(O),children:[o.jsxs(y,{children:[o.jsx(je,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),o.jsx(je,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),U2({store:O,userDid:(W=u==null?void 0:u.user)==null?void 0:W.did})&&o.jsx(be,{sx:{ml:1},onClick:X=>{X.preventDefault(),X.stopPropagation(),S(O)},children:o.jsx(ie,{icon:"ic:outline-delete"})})]},O.url)}),o.jsx(w2,{}),o.jsxs(Oe,{onClick:I,children:[o.jsx(R1,{font:!0}),o.jsx(K,{variant:"inherit",children:c("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(D0,{hiddenChildren:!0,open:!0,onClose:q,teamDid:k,storeList:M,scope:"studio",onAdd:(E=z==null?void 0:z.actions)==null?void 0:E.refreshBlocklet}),C&&o.jsx(y1,{displayError:!0,title:`${c("common.delete")} ${C.name}`,description:c("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:c("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}F1.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};F1.defaultProps={store:null,blocklet:null};const p0=R.lazy(()=>S0(()=>import("./index-BACiBg8Z.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:a,paramsErrTip:i,setParamsErrTip:c,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:z}){const{t:p}=te(),{api:d}=Re(),m=b1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Jl(s),D=q2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),L=async T=>{const E=setTimeout(()=>{u(!1)},2e4),A=await Yl(d,T);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:z},"*"),m(window.location.pathname.replace(`${J.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){F.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){F.error(p("blocklet.publish.noStoreSelected"));return}const T=Ql();D(async(E,A)=>{var O,W,X;try{const Q=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((W=r==null?void 0:r.blockletComponents)==null?void 0:W.length)>0?"pack":"resource",componentDid:z,messageId:T,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(Q!=null&&Q.url)){F.error("failed to connect to store");return}A(Q.url),L({did:(X=s==null?void 0:s.meta)==null?void 0:X.did,projectId:"",messageId:T})}catch(Q){const re=De(Q);F.error(re),u(!1)}})},I=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,q=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(T=>`${q}/${T}`),k=()=>t?!1:!e||e===J.UNOWNED_DID?(F.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,N=T=>{if(!T.destination)return;const E=Array.from(r.blockletScreenshots),[A]=E.splice(T.source.index,1);E.splice(T.destination.index,0,A),a(O=>({...O,blockletScreenshots:E}))};return o.jsxs(e3,{children:[o.jsx(y,{display:"flex",className:"section",children:o.jsxs(y,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:T=>{c({blockletTitle:""}),a({blockletTitle:T.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===J.UNOWNED_DID&&o.jsx(k1,{position:"end",children:o.jsx(F1,{blocklet:s,store:C,componentDid:z,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===J.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:T=>{c({blockletDescription:""}),a({blockletDescription:T.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(y,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(y,{sx:{flex:1},children:[o.jsxs(y,{display:"flex",children:[o.jsxs(Be,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),o.jsxs(Be,{direction:"column",alignItems:"flex-start",spacing:1,children:[o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]}),variant:"outlined",size:"small"})]})]}),o.jsx(y,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{var T;k()&&((T=b.current)==null||T.open())}})})]}),o.jsxs(y,{display:"flex",mt:3,children:[o.jsxs(Be,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),o.jsxs(Be,{direction:"column",alignItems:"flex-start",spacing:1,children:[o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"16/10"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]}),variant:"outlined",size:"small"})]})]}),o.jsx(P2,{onDragEnd:t?void 0:N,children:o.jsx(L2,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(T,E)=>o.jsxs(y,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:E.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:E.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:T.innerRef,...T.droppableProps,children:[M.map((A,O)=>o.jsx(T2,{draggableId:A,index:O,isDragDisabled:t,children:(W,X)=>o.jsxs(y,{ref:W.innerRef,...W.draggableProps,...W.dragHandleProps,className:"screenshot",sx:{transform:X.isDragging?"scale(1.05)":"none",boxShadow:X.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[o.jsx("img",{alt:"screenshot",src:A}),!t&&o.jsx(be,{className:"action",onClick:()=>{a(Q=>{const re=[...Q.blockletScreenshots];return re.splice(O,1),{...Q,blockletScreenshots:re}})},children:o.jsx(F2,{})})]})},A)),T.placeholder,M.length<5&&o.jsx(y,{sx:{width:240,height:150,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var A;k()&&((A=v.current)==null||A.open())},children:"+"})]})})})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ge,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:T=>{var E;a({blockletLogo:T.data.filename}),g(""),(E=b.current)==null||E.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{width:256,height:256}}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:T=>{var E;a(A=>{var W;const O=A.blockletScreenshots||[];return O.push((W=T.data)==null?void 0:W.filename),{...A,blockletScreenshots:O}}),(E=v.current)==null||E.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:q,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-M.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!0,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/10,initialAspectRatio:16/10,croppedCanvasOptions:{minWidth:640,minHeight:400,width:1120,height:700,maxWidth:1600,maxHeight:1e3}}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const e3=ce.div`
|
|
136
|
+
`,u0="lastWantToConnectStoreId";function Jl(e){var c,u;const[t,l]=R.useState(null),{session:s}=i1(),r=R.useCallback(f=>{l(f),localStorage.setItem(u0,f==null?void 0:f.id)},[l]),a=R.useMemo(()=>{var z,p,d,m;const f=localStorage.getItem(u0),x=f?(((z=e==null?void 0:e.settings)==null?void 0:z.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==J.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(c=e==null?void 0:e.settings)==null?void 0:c.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||a||{},r]}const p1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){p1[r]&&clearTimeout(p1[r]),await new Promise(c=>setTimeout(c,s));const a=Date.now(),i=async(c,u)=>{try{const f=await e();c(f)}catch(f){Date.now()-a>l?u(f):r?p1[r]=setTimeout(()=>i(c,u),t):setTimeout(()=>i(c,u),t)}};return new Promise(i)}function Ql(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Yl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var a;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((a=r==null?void 0:r.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Zl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,c;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((c=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&c.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,c;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let a=e?((c=l==null?void 0:l.settings)==null?void 0:c.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:a}};function F1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:a,componentDid:i}){var N,T,E;const{t:c}=te(),{session:u}=i1(),{api:f,info:x,inService:g}=Re(),z=Ne(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),D=A=>{l(A),d(!1)},L=()=>{d(!p)},P=A=>{m.current&&m.current.contains(A.target)||d(!1)},I=()=>{v(!0)},q=()=>{v(!1)},V=async()=>{var A;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((A=z==null?void 0:z.actions)==null?void 0:A.refreshBlocklet())}catch(O){F.error(`Remove Blocklet Store Error: ${De(O)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(N=u==null?void 0:u.user)==null?void 0:N.did}),k=(T=e==null?void 0:e.meta)==null?void 0:T.did;return o.jsxs(o.Fragment,{children:[o.jsxs(x1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[a&&o.jsx(o1,{size:14,sx:{mr:.5}}),`${c("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:L,children:o.jsx(K2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:A})=>o.jsx(C0,{...A,style:{transformOrigin:"center top"},children:o.jsx(w1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(O=>{var W;return o.jsxs(Oe,{selected:O.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>D(O),children:[o.jsxs(y,{children:[o.jsx(je,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),o.jsx(je,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),U2({store:O,userDid:(W=u==null?void 0:u.user)==null?void 0:W.did})&&o.jsx(be,{sx:{ml:1},onClick:X=>{X.preventDefault(),X.stopPropagation(),S(O)},children:o.jsx(ie,{icon:"ic:outline-delete"})})]},O.url)}),o.jsx(w2,{}),o.jsxs(Oe,{onClick:I,children:[o.jsx(R1,{font:!0}),o.jsx(K,{variant:"inherit",children:c("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(D0,{hiddenChildren:!0,open:!0,onClose:q,teamDid:k,storeList:M,scope:"studio",onAdd:(E=z==null?void 0:z.actions)==null?void 0:E.refreshBlocklet}),C&&o.jsx(y1,{displayError:!0,title:`${c("common.delete")} ${C.name}`,description:c("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:c("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}F1.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};F1.defaultProps={store:null,blocklet:null};const p0=R.lazy(()=>S0(()=>import("./index-B7WSZrX4.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:a,paramsErrTip:i,setParamsErrTip:c,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:z}){const{t:p}=te(),{api:d}=Re(),m=b1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Jl(s),D=q2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),L=async T=>{const E=setTimeout(()=>{u(!1)},2e4),A=await Yl(d,T);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:z},"*"),m(window.location.pathname.replace(`${J.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){F.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){F.error(p("blocklet.publish.noStoreSelected"));return}const T=Ql();D(async(E,A)=>{var O,W,X;try{const Q=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((W=r==null?void 0:r.blockletComponents)==null?void 0:W.length)>0?"pack":"resource",componentDid:z,messageId:T,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(Q!=null&&Q.url)){F.error("failed to connect to store");return}A(Q.url),L({did:(X=s==null?void 0:s.meta)==null?void 0:X.did,projectId:"",messageId:T})}catch(Q){const re=De(Q);F.error(re),u(!1)}})},I=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,q=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(T=>`${q}/${T}`),k=()=>t?!1:!e||e===J.UNOWNED_DID?(F.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,N=T=>{if(!T.destination)return;const E=Array.from(r.blockletScreenshots),[A]=E.splice(T.source.index,1);E.splice(T.destination.index,0,A),a(O=>({...O,blockletScreenshots:E}))};return o.jsxs(e3,{children:[o.jsx(y,{display:"flex",className:"section",children:o.jsxs(y,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:T=>{c({blockletTitle:""}),a({blockletTitle:T.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===J.UNOWNED_DID&&o.jsx(k1,{position:"end",children:o.jsx(F1,{blocklet:s,store:C,componentDid:z,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===J.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:T=>{c({blockletDescription:""}),a({blockletDescription:T.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(y,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(y,{sx:{flex:1},children:[o.jsxs(y,{display:"flex",children:[o.jsxs(Be,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),o.jsxs(Be,{direction:"column",alignItems:"flex-start",spacing:1,children:[o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]}),variant:"outlined",size:"small"})]})]}),o.jsx(y,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{var T;k()&&((T=b.current)==null||T.open())}})})]}),o.jsxs(y,{display:"flex",mt:3,children:[o.jsxs(Be,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),o.jsxs(Be,{direction:"column",alignItems:"flex-start",spacing:1,children:[o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"16/10"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]}),variant:"outlined",size:"small"}),o.jsx(Me,{label:o.jsxs(y,{component:"span",children:[o.jsxs(y,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),o.jsx(y,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]}),variant:"outlined",size:"small"})]})]}),o.jsx(P2,{onDragEnd:t?void 0:N,children:o.jsx(L2,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(T,E)=>o.jsxs(y,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:E.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:E.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:T.innerRef,...T.droppableProps,children:[M.map((A,O)=>o.jsx(T2,{draggableId:A,index:O,isDragDisabled:t,children:(W,X)=>o.jsxs(y,{ref:W.innerRef,...W.draggableProps,...W.dragHandleProps,className:"screenshot",sx:{transform:X.isDragging?"scale(1.05)":"none",boxShadow:X.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[o.jsx("img",{alt:"screenshot",src:A}),!t&&o.jsx(be,{className:"action",onClick:()=>{a(Q=>{const re=[...Q.blockletScreenshots];return re.splice(O,1),{...Q,blockletScreenshots:re}})},children:o.jsx(F2,{})})]})},A)),T.placeholder,M.length<5&&o.jsx(y,{sx:{width:240,height:150,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var A;k()&&((A=v.current)==null||A.open())},children:"+"})]})})})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ge,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:T=>{var E;a({blockletLogo:T.data.filename}),g(""),(E=b.current)==null||E.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{width:256,height:256}}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:T=>{var E;a(A=>{var W;const O=A.blockletScreenshots||[];return O.push((W=T.data)==null?void 0:W.filename),{...A,blockletScreenshots:O}}),(E=v.current)==null||E.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:q,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-M.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/10,initialAspectRatio:16/10,croppedCanvasOptions:{minWidth:640,minHeight:400,width:1120,height:700,maxWidth:1600,maxHeight:1e3}}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const e3=ce.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as we,aG as $e,aH a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function o2({text:e}){return e?o.jsx(Q2,{wrapperElement:{"data-color-mode":"light"},source:Y2.sanitize(e),rehypePlugins:[[Z2,{target:"_blank"}]]}):o.jsx(Se,{Icon:Ke})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:a}){var x;const{t:i}=te(),[c,u]=R.useState(a?"preview":"write"),f=(g,z)=>{u(z)};return o.jsxs(y,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(y,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(K,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(V2,{value:c,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(t0,{value:"write",label:"Write"}),o.jsx(t0,{value:"preview",label:"Preview"})]})]}),o.jsx(y,{display:c==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||a,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:o.jsxs(k1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ze.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ze.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(y,{display:c==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var W1={},d3=Ie;Object.defineProperty(W1,"__esModule",{value:!0});var n2=W1.default=void 0,u3=d3(ke()),f0=o;n2=W1.default=(0,u3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function G1({step:e,ok:t,active:l,error:s}){let r="grey.500",a=e+1;return t&&(a=o.jsx(et,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",a=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(y,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:a})}G1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};G1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:a,paramsErrTip:i,viewMode:c,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},z=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=c||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(y,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(ot,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=a||!a3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=a?"":z(m);return C&&(b.optional=o.jsx(K,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(lt,{children:[o.jsx(Rt,{icon:o.jsx(G1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(K,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(It,{children:[o.jsx(K,{fontSize:12,children:d.description}),!p&&o.jsx(y,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(w1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(K,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const p3=[".zip",".gz"],h3=1024*1024*100,f3=R.lazy(()=>S0(()=>import("./index-BACiBg8Z.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function K1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:a,error:i}){const{t:c}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===J.UNOWNED_DID?(F.error(c("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(y,{sx:{mt:3},children:[o.jsx(K,{gutterBottom:!0,children:c("blocklet.publish.resourceUpload")}),o.jsxs(Be,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(K,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?c("common.change"):c("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ge,{}),children:o.jsx(f3,{ref:u,popup:!0,onUploadFinish:g=>{var z;r({uploadedResource:g.data.filename}),a({blockletResource:""}),(z=u.current)==null||z.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:p3,maxFileSize:h3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(y,{color:"error.main",mt:1,fontSize:14,children:i})]})}K1.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};K1.defaultProps={};function n1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:a}){var c;const{t:i}=te();return o.jsx(y,{display:"flex",mt:3,className:"section",children:o.jsxs(y,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:a||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(k1,{position:"end",children:[((c=t==null?void 0:t.note)==null?void 0:c.length)||0," / ",ze.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ze.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}n1.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};n1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const x3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:24,blocklet:t,ancestors:l}),o.jsx(y,{ml:"4px",className:"text",children:o.jsx(y,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=j1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},m3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function X1({initUrl:e,...t}){var J1;const{projectId:l,mode:s,releaseId:r,componentDid:a=""}=r1(),{t:i}=te(),{blocklet:c}=Ne(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[z,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=Re(),v=We(_=>_.breakpoints.down("md")),[C,S]=R.useState({}),[D,L]=R.useState(!1),P=R.useRef({}),[I,q]=Pe({}),[V,M]=R.useState(""),[k,N]=Pe({}),T=e==null?void 0:e.searchParams.get("dependentComponentsMode"),E=T==="readonly",A=R.useMemo(()=>{const _={};return Object.keys(k).forEach(B=>{const ye=k[B];ye&&ye.forEach(c2=>{_[c2]=!0})}),_},[k]),O=R.useCallback(_=>{E&&f({blockletComponents:[]}),N(_)},[E,N,f]),W=R.useCallback((..._)=>{q(..._),g({blockletResource:""})},[]),X=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Q,re]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const fe=R.useMemo(()=>{var _;return(_=u==null?void 0:u.blockletComponents)!=null&&_.some(B=>B.included)||Object.keys(A).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,A]),de=[],oe=((c==null?void 0:c.children)||[]).filter(_=>{var B;return(B=_.meta.resource)==null?void 0:B.exportApi}).filter(_=>!a||_.meta.did===a);oe.forEach(_=>{x3({tabs:de,blocklet:_,t:i,ancestors:[c]})});const[ee,ae]=R.useState((J1=de[0])==null?void 0:J1.value),xe=!D&&(d==null?void 0:d.status)==="published",Y=xe,me=y2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(B=>{var ye;return{...B,blockletTitle:(B==null?void 0:B.blockletTitle)||e.searchParams.get("title"),blockletDescription:(B==null?void 0:B.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(B==null?void 0:B.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(ye=B==null?void 0:B.blockletComponents)!=null&&ye.length?B==null?void 0:B.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(B==null?void 0:B.note)||e.searchParams.get("note")||"No note"}});const _=e.searchParams.get("resources");try{const B=JSON.parse(_);S(B)}catch{}}),G=async()=>{if(X)try{const _=await b.getRelease({input:{did:c.meta.did,projectId:l,releaseId:X}});if(p(!1),!_.release){F.error("Release not found");return}_.release=r2(_.release),s!=="view"&&(_.release.note=""),f(B=>x0({...B,..._.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(_.release.blockletVersion,"patch"):_.release.blockletVersion},c)),m(_.release)}catch(_){p(!1),F.error(De(_))}},le=async()=>{if(l===J.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){F.error(i("blocklet.publish.errorTip.noDid"));return}try{const B=(await b.getProject({input:{did:c.meta.did,projectId:l}})).project||{};B.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(B.blockletVersion)&&(B.blockletVersion=Le.inc(B.blockletVersion,"patch")):B.blockletVersion="1.0.0";const ye=x0(B,c);f(ye),B.lastReleaseId||me()}catch(_){F.error(De(_))}},$=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!X){F.error("Empty release id");return}await le(),await G();return}await le(),X&&(L(!0),await G())}finally{p(!1)}},[s,X]),Xe=_=>{f({blockletComponents:_})};R.useEffect(()=>{$()},[$]),R.useEffect(()=>{l===J.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&me()},[l,e,s,me]);const _e=R.useMemo(()=>!!Object.keys(I).find(_=>!!I[_].length),[I]);if(!u&&z)return o.jsx(Ge,{});if(!u)return null;const Ee=oe.find(_=>_.meta.did===ee);if(oe.every(_=>_.status!=="running")&&(oe!=null&&oe.length))return o.jsx(Se,{children:i("blocklet.publish.allComponentsNotRunning")});const Je=_=>{ae(_)},U=e==null?void 0:e.searchParams.get("resourcesTitle"),Z=e==null?void 0:e.searchParams.get("componentsTitle"),ue=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:U||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Z||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=ue[Q]||ue[ue.length-1],Ce=m3[Q];return o.jsxs(v3,{...t,children:[o.jsx(t2,{blocklet:c,release:d,getData:$,getRelease:G,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Y,isPublished:xe,loading:z,setLoading:p,initLogoUrl:V,releaseId:X,projectId:l,projectType:fe,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:A,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:D,setReleaseUsedLast:L,setRelease:m}),o.jsxs(y,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(y,{pt:3}),o.jsxs(y,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:ue,loading:z,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Q,setActiveStep:re,projectId:l,resourcesUrlTitle:U,componentsUrlTitle:Z}),o.jsxs(y,{flex:"1",maxWidth:"720px",children:[!v&&Ce!=="introduction"&&o.jsxs(K,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Ce==="branding"&&o.jsx(ge,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(y,{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(N2,{})})})]}),(v||Ce==="branding")&&o.jsx(y,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:a,blocklet:c,initUrl:e,loading:z,setLoading:p,paramsErrTip:x,readOnly:Y,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(y,{flexDirection:"column",children:o.jsx(n1,{loading:z,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Y})}),(v||Ce==="introduction")&&o.jsx(y,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:z,readOnly:Y,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:ue[m0.resources].label}),o.jsx(y,{display:v||Ce==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(y,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(y,{sx:{flex:1},children:[o.jsxs(nt,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!a&&o.jsx(_2,{tabs:de,current:ee,onChange:Je,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx($1,{loading:z,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:W,setResourceComponentsMap:O,error:x.blockletResource,app:c,readOnly:Y,component:Ee,componentDid:a,initUrl:e,params:u,setParams:f,projectId:l===J.UNOWNED_DID?"":l,releaseUsedLast:D,release:{...d,id:X}})]}),!u.resourceFromSelect&&o.jsx(K1,{app:c,readOnly:Y,projectId:l===J.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:ue[m0.blocklets].label}),(v||Ce==="blocklets")&&o.jsx(y,{flexDirection:"column",children:o.jsx(y,{display:"flex",mt:3,className:"section full-width",children:o.jsx(y,{sx:{flex:1},children:o.jsx(V1,{projectType:fe,disabled:z||Y,app:c,value:(u==null?void 0:u.blockletComponents)||[],onChange:Xe,resourceRelateComponents:A,dependentComponentsMode:T})})})}),!v&&Ce==="version"&&o.jsx(y,{flexDirection:"column",children:o.jsx(n1,{loading:z,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Y})})]})]})]})]})}X1.propTypes={initUrl:h.object};X1.defaultProps={initUrl:null};const v3=ce.div`
|
|
181
|
+
`;function o2({text:e}){return e?o.jsx(Q2,{wrapperElement:{"data-color-mode":"light"},source:Y2.sanitize(e),rehypePlugins:[[Z2,{target:"_blank"}]]}):o.jsx(Se,{Icon:Ke})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:a}){var x;const{t:i}=te(),[c,u]=R.useState(a?"preview":"write"),f=(g,z)=>{u(z)};return o.jsxs(y,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(y,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(K,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(V2,{value:c,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(t0,{value:"write",label:"Write"}),o.jsx(t0,{value:"preview",label:"Preview"})]})]}),o.jsx(y,{display:c==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||a,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:o.jsxs(k1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ze.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ze.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(y,{display:c==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var W1={},d3=Ie;Object.defineProperty(W1,"__esModule",{value:!0});var n2=W1.default=void 0,u3=d3(ke()),f0=o;n2=W1.default=(0,u3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function G1({step:e,ok:t,active:l,error:s}){let r="grey.500",a=e+1;return t&&(a=o.jsx(et,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",a=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(y,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:a})}G1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};G1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:a,paramsErrTip:i,viewMode:c,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},z=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=c||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(y,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(ot,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=a||!a3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=a?"":z(m);return C&&(b.optional=o.jsx(K,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(lt,{children:[o.jsx(Rt,{icon:o.jsx(G1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(K,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(It,{children:[o.jsx(K,{fontSize:12,children:d.description}),!p&&o.jsx(y,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(w1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(K,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const p3=[".zip",".gz"],h3=1024*1024*100,f3=R.lazy(()=>S0(()=>import("./index-B7WSZrX4.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function K1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:a,error:i}){const{t:c}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===J.UNOWNED_DID?(F.error(c("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(y,{sx:{mt:3},children:[o.jsx(K,{gutterBottom:!0,children:c("blocklet.publish.resourceUpload")}),o.jsxs(Be,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(K,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?c("common.change"):c("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ge,{}),children:o.jsx(f3,{ref:u,popup:!0,onUploadFinish:g=>{var z;r({uploadedResource:g.data.filename}),a({blockletResource:""}),(z=u.current)==null||z.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:p3,maxFileSize:h3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(y,{color:"error.main",mt:1,fontSize:14,children:i})]})}K1.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};K1.defaultProps={};function n1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:a}){var c;const{t:i}=te();return o.jsx(y,{display:"flex",mt:3,className:"section",children:o.jsxs(y,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:a||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(k1,{position:"end",children:[((c=t==null?void 0:t.note)==null?void 0:c.length)||0," / ",ze.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ze.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}n1.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};n1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const x3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(y,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:24,blocklet:t,ancestors:l}),o.jsx(y,{ml:"4px",className:"text",children:o.jsx(y,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=j1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},m3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function X1({initUrl:e,...t}){var J1;const{projectId:l,mode:s,releaseId:r,componentDid:a=""}=r1(),{t:i}=te(),{blocklet:c}=Ne(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[z,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=Re(),v=We(_=>_.breakpoints.down("md")),[C,S]=R.useState({}),[D,L]=R.useState(!1),P=R.useRef({}),[I,q]=Pe({}),[V,M]=R.useState(""),[k,N]=Pe({}),T=e==null?void 0:e.searchParams.get("dependentComponentsMode"),E=T==="readonly",A=R.useMemo(()=>{const _={};return Object.keys(k).forEach(B=>{const ye=k[B];ye&&ye.forEach(c2=>{_[c2]=!0})}),_},[k]),O=R.useCallback(_=>{E&&f({blockletComponents:[]}),N(_)},[E,N,f]),W=R.useCallback((..._)=>{q(..._),g({blockletResource:""})},[]),X=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Q,re]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const fe=R.useMemo(()=>{var _;return(_=u==null?void 0:u.blockletComponents)!=null&&_.some(B=>B.included)||Object.keys(A).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,A]),de=[],oe=((c==null?void 0:c.children)||[]).filter(_=>{var B;return(B=_.meta.resource)==null?void 0:B.exportApi}).filter(_=>!a||_.meta.did===a);oe.forEach(_=>{x3({tabs:de,blocklet:_,t:i,ancestors:[c]})});const[ee,ae]=R.useState((J1=de[0])==null?void 0:J1.value),xe=!D&&(d==null?void 0:d.status)==="published",Y=xe,me=y2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(B=>{var ye;return{...B,blockletTitle:(B==null?void 0:B.blockletTitle)||e.searchParams.get("title"),blockletDescription:(B==null?void 0:B.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(B==null?void 0:B.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(ye=B==null?void 0:B.blockletComponents)!=null&&ye.length?B==null?void 0:B.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(B==null?void 0:B.note)||e.searchParams.get("note")||"No note"}});const _=e.searchParams.get("resources");try{const B=JSON.parse(_);S(B)}catch{}}),G=async()=>{if(X)try{const _=await b.getRelease({input:{did:c.meta.did,projectId:l,releaseId:X}});if(p(!1),!_.release){F.error("Release not found");return}_.release=r2(_.release),s!=="view"&&(_.release.note=""),f(B=>x0({...B,..._.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(_.release.blockletVersion,"patch"):_.release.blockletVersion},c)),m(_.release)}catch(_){p(!1),F.error(De(_))}},le=async()=>{if(l===J.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){F.error(i("blocklet.publish.errorTip.noDid"));return}try{const B=(await b.getProject({input:{did:c.meta.did,projectId:l}})).project||{};B.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(B.blockletVersion)&&(B.blockletVersion=Le.inc(B.blockletVersion,"patch")):B.blockletVersion="1.0.0";const ye=x0(B,c);f(ye),B.lastReleaseId||me()}catch(_){F.error(De(_))}},$=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!X){F.error("Empty release id");return}await le(),await G();return}await le(),X&&(L(!0),await G())}finally{p(!1)}},[s,X]),Xe=_=>{f({blockletComponents:_})};R.useEffect(()=>{$()},[$]),R.useEffect(()=>{l===J.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&me()},[l,e,s,me]);const _e=R.useMemo(()=>!!Object.keys(I).find(_=>!!I[_].length),[I]);if(!u&&z)return o.jsx(Ge,{});if(!u)return null;const Ee=oe.find(_=>_.meta.did===ee);if(oe.every(_=>_.status!=="running")&&(oe!=null&&oe.length))return o.jsx(Se,{children:i("blocklet.publish.allComponentsNotRunning")});const Je=_=>{ae(_)},U=e==null?void 0:e.searchParams.get("resourcesTitle"),Z=e==null?void 0:e.searchParams.get("componentsTitle"),ue=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:U||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Z||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=ue[Q]||ue[ue.length-1],Ce=m3[Q];return o.jsxs(v3,{...t,children:[o.jsx(t2,{blocklet:c,release:d,getData:$,getRelease:G,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Y,isPublished:xe,loading:z,setLoading:p,initLogoUrl:V,releaseId:X,projectId:l,projectType:fe,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:A,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:D,setReleaseUsedLast:L,setRelease:m}),o.jsxs(y,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(y,{pt:3}),o.jsxs(y,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:ue,loading:z,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Q,setActiveStep:re,projectId:l,resourcesUrlTitle:U,componentsUrlTitle:Z}),o.jsxs(y,{flex:"1",maxWidth:"720px",children:[!v&&Ce!=="introduction"&&o.jsxs(K,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Ce==="branding"&&o.jsx(ge,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(y,{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(N2,{})})})]}),(v||Ce==="branding")&&o.jsx(y,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:a,blocklet:c,initUrl:e,loading:z,setLoading:p,paramsErrTip:x,readOnly:Y,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(y,{flexDirection:"column",children:o.jsx(n1,{loading:z,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Y})}),(v||Ce==="introduction")&&o.jsx(y,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:z,readOnly:Y,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:ue[m0.resources].label}),o.jsx(y,{display:v||Ce==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(y,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(y,{sx:{flex:1},children:[o.jsxs(nt,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!a&&o.jsx(_2,{tabs:de,current:ee,onChange:Je,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx($1,{loading:z,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:W,setResourceComponentsMap:O,error:x.blockletResource,app:c,readOnly:Y,component:Ee,componentDid:a,initUrl:e,params:u,setParams:f,projectId:l===J.UNOWNED_DID?"":l,releaseUsedLast:D,release:{...d,id:X}})]}),!u.resourceFromSelect&&o.jsx(K1,{app:c,readOnly:Y,projectId:l===J.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:ue[m0.blocklets].label}),(v||Ce==="blocklets")&&o.jsx(y,{flexDirection:"column",children:o.jsx(y,{display:"flex",mt:3,className:"section full-width",children:o.jsx(y,{sx:{flex:1},children:o.jsx(V1,{projectType:fe,disabled:z||Y,app:c,value:(u==null?void 0:u.blockletComponents)||[],onChange:Xe,resourceRelateComponents:A,dependentComponentsMode:T})})})}),!v&&Ce==="version"&&o.jsx(y,{flexDirection:"column",children:o.jsx(n1,{loading:z,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Y})})]})]})]})]})}X1.propTypes={initUrl:h.object};X1.defaultProps={initUrl:null};const v3=ce.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,a_ as P,aR as Y,bX as W,j as t,cp as V,bH as q,t as _,ac as ee,cD as te,P as i,b9 as ie,a0 as A,a1 as D,ae as ne,cE as oe,n as S,cF as se,cG as ae,cH as re,cI as le,cJ as ce,T as pe,C as de}from"./index-Dd9xMZEz.js";import{g as he,a as me,b as ue}from"./spaces-CjgOPbG0.js";import{j as fe}from"./url-join-UZSSoHtH.js";import{S as E}from"./Skeleton-B-YzpOQg.js";import{H as ge}from"./Hidden-vR0aN6pm.js";function xe(){const[e,n]=u.useState(null),{blocklet:s}=P();return u.useEffect(()=>{n(he(s))},[s]),{storageEndpoint:e}}const H=u.createContext({}),{Provider:ye,Consumer:Ge}=H;function z({children:e}){const[n,s]=u.useState(!1),[c,p]=u.useState(null),{blocklet:m,actions:{refreshBlocklet:d}}=P(),{storageEndpoint:f}=xe(),{api:b}=Y();W(async()=>{try{if(s(!0),q(f)){p(null);return}const a=await me(f);p(a)}catch(a){console.error(a),_.error(a.message)}finally{s(!1)}},[f]);const l=()=>{p(null),d()},g=async a=>{p(a),await k(a.endpoint),d()},k=async a=>{await b.configBlocklet({input:{did:[m.meta.did],configs:[{key:ee.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:a}]}}),d()};u.useEffect(()=>{async function a(){if(!c)return;const r=await ue(c.endpoint,c.name),x=te(c,{name:r});p(x)}a()},[]);const o=!!(f&&c);return t.jsx(ye,{value:{loading:n,spaceGateway:c,deleteSpaceGateway:l,updateSpaceGateway:g,storageEndpoint:f,settingStorageEndpoint:k,hasStorageEndpoint:o},children:e})}z.propTypes={children:V.node.isRequired};z.defaultProps={};function Ze(){return u.useContext(H)}const X=u.createContext(),{Provider:Ae}=X,N=(e,n,s=window.location.pathname.replace(/\/$/,"/"))=>e?n?e===s:new RegExp(e).test(s):!1;function K({children:e,steps:n,mode:s}){const[c,p]=u.useState("");!c&&n.length&&p(n[0].key);const m=n.map(o=>o.children?[{key:o.key,hasChild:!0},o.children.map(a=>({parentKey:o.key,key:a.key}))]:{key:o.key}).flat(1/0),d=m.filter(o=>!o.hasChild),f=o=>{let a;const r=m.findIndex(h=>h.key===c?(a=h.parentKey,!0):!1);if(a===o)return"current";const x=m.findIndex(h=>h.key===o);if(x!==-1){if(x===r)return"current";if(x<r)return"before"}return"after"};function b(o){p(o)}function l(o){if(typeof o=="function"){const a=o(d.findIndex(r=>r.key===c));p(d[a].key)}else p(d[o].key)}const g=d.findIndex(o=>o.key===c);u.useEffect(()=>{if(s==="history"){let o="";n.some(a=>a.children&&a.children.length?a.children.some(r=>N(r.path,r.exact)?(o=r.key,!0):!1):N(a.path,a.exact)?(o=a.key,!0):!1),o&&p(o)}return()=>{}},[n,s]);const k={steps:n,totalStepsCount:d.length,getStepStatus:f,setActiveStepByKey:b,setActiveStepByIndex:l,activeStep:g,canBackToStep:o=>s==="memory"&&g!==0&&o<g};return t.jsx(Ae,{value:k,children:e})}function R(){return u.useContext(X)}K.propTypes={children:i.any.isRequired,steps:i.array.isRequired,mode:i.string};K.defaultProps={mode:"history"};var be=Object.prototype.hasOwnProperty,ke=Object.prototype.toString;function we(e){if(e==null)return!0;if(typeof e=="boolean")return!1;if(typeof e=="number")return e===0;if(typeof e=="string"||typeof e=="function"||Array.isArray(e))return e.length===0;if(e instanceof Error)return e.message==="";if(e.toString==ke)switch(e.toString()){case"[object File]":case"[object Map]":case"[object Set]":return e.size===0;case"[object Object]":{for(var n in e)if(be.call(e,n))return!1;return!0}}return!1}var Ee=we;const je=ie(Ee),ve="data:image/png;base64,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",C={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},Ce=e=>C[e]?C[e]:C.en,Se=e=>e==="zh"?"启动":"Launching",J=e=>(e==null?void 0:e.title)||(e==null?void 0:e.name)||"";function j({blockletMeta:e,subTitle:n,logoUrl:s,locale:c,navLogo:p,loading:m}){const d=D(k=>k.breakpoints.down("md")),f=d?18:48,b=u.useRef(null),[l,g]=u.useState("");return u.useEffect(()=>{b.current&&b.current.offsetHeight>34&&(l===""?g("middle"):l==="middle"&&g("small"))},[l]),t.jsxs(Be,{className:l==="small"?"center-mode":"",children:[d?t.jsx("div",{className:"app-icon",children:p}):t.jsxs("div",{className:"app-icon",children:[m&&t.jsx(Me,{blockletSize:f,isMobile:d}),!m&&t.jsx(F,{blockletSize:f,logoUrl:s})]}),t.jsxs("div",{className:"header-title",children:[d&&n&&t.jsx("div",{className:"header-title-sub",children:n}),t.jsxs("div",{className:"app-name-content",children:[!d&&t.jsx("div",{className:"launching-context",children:n||Se(c)}),t.jsx("div",{className:`header-title-name ${l==="middle"||l==="small"?"middle-size":""}`,ref:b,children:t.jsx(M,{logoUrl:s,isMobile:d,blockletMeta:e,blockletSize:f,loading:m})})]})]})]})}j.propTypes={blockletMeta:i.object,subTitle:i.any,logoUrl:i.string,locale:i.string,navLogo:i.any,loading:i.bool};j.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function Me({blockletSize:e,isMobile:n}){return n?t.jsx(E,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):t.jsx(E,{variant:"rectangular",width:e,height:e})}function F({logoUrl:e,blockletSize:n}){return t.jsx(ne,{width:n,height:n,src:e,alt:"blocklet icon",fallback:ve,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${e}`)}function M({isMobile:e,logoUrl:n,blockletMeta:s,blockletSize:c,loading:p}){const m=J(s);return p?t.jsx(E,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):je(s)?t.jsx(E,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):e?t.jsxs(Te,{children:[t.jsx(F,{blockletSize:c,logoUrl:n}),t.jsx("span",{className:"ellipsis-title",children:J(s)})]}):t.jsx(Qe,{target:"_blank",href:fe((s==null?void 0:s.registryUrl)||"",`/blocklets/${s==null?void 0:s.did}`),title:m,children:m})}const Te=A.div`
|
|
1
|
+
import{r as u,a_ as P,aR as Y,bX as W,j as t,cp as V,bH as q,t as _,ac as ee,cD as te,P as i,b9 as ie,a0 as A,a1 as D,ae as ne,cE as oe,n as S,cF as se,cG as ae,cH as re,cI as le,cJ as ce,T as pe,C as de}from"./index-Cpcj45rd.js";import{g as he,a as me,b as ue}from"./spaces-Bh7-Ra1u.js";import{j as fe}from"./url-join-BHr3fLxq.js";import{S as E}from"./Skeleton-CwJc9kSo.js";import{H as ge}from"./Hidden-D2bPVc-Z.js";function xe(){const[e,n]=u.useState(null),{blocklet:s}=P();return u.useEffect(()=>{n(he(s))},[s]),{storageEndpoint:e}}const H=u.createContext({}),{Provider:ye,Consumer:Ge}=H;function z({children:e}){const[n,s]=u.useState(!1),[c,p]=u.useState(null),{blocklet:m,actions:{refreshBlocklet:d}}=P(),{storageEndpoint:f}=xe(),{api:b}=Y();W(async()=>{try{if(s(!0),q(f)){p(null);return}const a=await me(f);p(a)}catch(a){console.error(a),_.error(a.message)}finally{s(!1)}},[f]);const l=()=>{p(null),d()},g=async a=>{p(a),await k(a.endpoint),d()},k=async a=>{await b.configBlocklet({input:{did:[m.meta.did],configs:[{key:ee.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:a}]}}),d()};u.useEffect(()=>{async function a(){if(!c)return;const r=await ue(c.endpoint,c.name),x=te(c,{name:r});p(x)}a()},[]);const o=!!(f&&c);return t.jsx(ye,{value:{loading:n,spaceGateway:c,deleteSpaceGateway:l,updateSpaceGateway:g,storageEndpoint:f,settingStorageEndpoint:k,hasStorageEndpoint:o},children:e})}z.propTypes={children:V.node.isRequired};z.defaultProps={};function Ze(){return u.useContext(H)}const X=u.createContext(),{Provider:Ae}=X,N=(e,n,s=window.location.pathname.replace(/\/$/,"/"))=>e?n?e===s:new RegExp(e).test(s):!1;function K({children:e,steps:n,mode:s}){const[c,p]=u.useState("");!c&&n.length&&p(n[0].key);const m=n.map(o=>o.children?[{key:o.key,hasChild:!0},o.children.map(a=>({parentKey:o.key,key:a.key}))]:{key:o.key}).flat(1/0),d=m.filter(o=>!o.hasChild),f=o=>{let a;const r=m.findIndex(h=>h.key===c?(a=h.parentKey,!0):!1);if(a===o)return"current";const x=m.findIndex(h=>h.key===o);if(x!==-1){if(x===r)return"current";if(x<r)return"before"}return"after"};function b(o){p(o)}function l(o){if(typeof o=="function"){const a=o(d.findIndex(r=>r.key===c));p(d[a].key)}else p(d[o].key)}const g=d.findIndex(o=>o.key===c);u.useEffect(()=>{if(s==="history"){let o="";n.some(a=>a.children&&a.children.length?a.children.some(r=>N(r.path,r.exact)?(o=r.key,!0):!1):N(a.path,a.exact)?(o=a.key,!0):!1),o&&p(o)}return()=>{}},[n,s]);const k={steps:n,totalStepsCount:d.length,getStepStatus:f,setActiveStepByKey:b,setActiveStepByIndex:l,activeStep:g,canBackToStep:o=>s==="memory"&&g!==0&&o<g};return t.jsx(Ae,{value:k,children:e})}function R(){return u.useContext(X)}K.propTypes={children:i.any.isRequired,steps:i.array.isRequired,mode:i.string};K.defaultProps={mode:"history"};var be=Object.prototype.hasOwnProperty,ke=Object.prototype.toString;function we(e){if(e==null)return!0;if(typeof e=="boolean")return!1;if(typeof e=="number")return e===0;if(typeof e=="string"||typeof e=="function"||Array.isArray(e))return e.length===0;if(e instanceof Error)return e.message==="";if(e.toString==ke)switch(e.toString()){case"[object File]":case"[object Map]":case"[object Set]":return e.size===0;case"[object Object]":{for(var n in e)if(be.call(e,n))return!1;return!0}}return!1}var Ee=we;const je=ie(Ee),ve="data:image/png;base64,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",C={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},Ce=e=>C[e]?C[e]:C.en,Se=e=>e==="zh"?"启动":"Launching",J=e=>(e==null?void 0:e.title)||(e==null?void 0:e.name)||"";function j({blockletMeta:e,subTitle:n,logoUrl:s,locale:c,navLogo:p,loading:m}){const d=D(k=>k.breakpoints.down("md")),f=d?18:48,b=u.useRef(null),[l,g]=u.useState("");return u.useEffect(()=>{b.current&&b.current.offsetHeight>34&&(l===""?g("middle"):l==="middle"&&g("small"))},[l]),t.jsxs(Be,{className:l==="small"?"center-mode":"",children:[d?t.jsx("div",{className:"app-icon",children:p}):t.jsxs("div",{className:"app-icon",children:[m&&t.jsx(Me,{blockletSize:f,isMobile:d}),!m&&t.jsx(F,{blockletSize:f,logoUrl:s})]}),t.jsxs("div",{className:"header-title",children:[d&&n&&t.jsx("div",{className:"header-title-sub",children:n}),t.jsxs("div",{className:"app-name-content",children:[!d&&t.jsx("div",{className:"launching-context",children:n||Se(c)}),t.jsx("div",{className:`header-title-name ${l==="middle"||l==="small"?"middle-size":""}`,ref:b,children:t.jsx(M,{logoUrl:s,isMobile:d,blockletMeta:e,blockletSize:f,loading:m})})]})]})]})}j.propTypes={blockletMeta:i.object,subTitle:i.any,logoUrl:i.string,locale:i.string,navLogo:i.any,loading:i.bool};j.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function Me({blockletSize:e,isMobile:n}){return n?t.jsx(E,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):t.jsx(E,{variant:"rectangular",width:e,height:e})}function F({logoUrl:e,blockletSize:n}){return t.jsx(ne,{width:n,height:n,src:e,alt:"blocklet icon",fallback:ve,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${e}`)}function M({isMobile:e,logoUrl:n,blockletMeta:s,blockletSize:c,loading:p}){const m=J(s);return p?t.jsx(E,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):je(s)?t.jsx(E,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):e?t.jsxs(Te,{children:[t.jsx(F,{blockletSize:c,logoUrl:n}),t.jsx("span",{className:"ellipsis-title",children:J(s)})]}):t.jsx(Qe,{target:"_blank",href:fe((s==null?void 0:s.registryUrl)||"",`/blocklets/${s==null?void 0:s.did}`),title:m,children:m})}const Te=A.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|