@abtnode/webapp 1.16.45-beta-20250618-073451-6e48fb62 → 1.16.45-beta-20250624-134945-a23c15fc
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-Cf6af3xk.js → AdapterDayjs-cf9EXlHB.js} +1 -1
- package/dist/assets/{Add-BFsFN1Gy.js → Add-ClzfE4cH.js} +1 -1
- package/dist/assets/{ArrowDropDown-CejcJzkX.js → ArrowDropDown-CJ2MJgn5.js} +1 -1
- package/dist/assets/{Autocomplete-PeF181FR.js → Autocomplete-CayznxGz.js} +1 -1
- package/dist/assets/{Breadcrumbs-B6YSRzTf.js → Breadcrumbs-C9QQGBOd.js} +1 -1
- package/dist/assets/{ButtonGroup-BzAT8pGA.js → ButtonGroup-B3J8Qdyl.js} +1 -1
- package/dist/assets/{CSSTransition-Byi2ne4y.js → CSSTransition-Cz8SmnJv.js} +1 -1
- package/dist/assets/{CallMerge-CaTZFXVq.js → CallMerge-B6RVJ3nX.js} +1 -1
- package/dist/assets/{CardContent-Dk0Md6L4.js → CardContent-Cg4RjHpv.js} +1 -1
- package/dist/assets/{ChevronLeft-CDs40tmH.js → ChevronLeft-BNmKlc1J.js} +1 -1
- package/dist/assets/{ChevronRight-CFfmouwT.js → ChevronRight-DRPUyxAK.js} +1 -1
- package/dist/assets/{Clear-CmPKgcDo.js → Clear-C1AC1AtD.js} +1 -1
- package/dist/assets/{Close-C8GsrnLa.js → Close-DRWGcKKl.js} +1 -1
- package/dist/assets/{Community-D1NMDj2P.js → Community-BPBk9hGT.js} +1 -1
- package/dist/assets/{Delete-CiU1bEBu.js → Delete-CcdfJXTL.js} +1 -1
- package/dist/assets/{DeleteOutline-reI_idEa.js → DeleteOutline-US18RBQ-.js} +1 -1
- package/dist/assets/{Done-BFMi5HXU.js → Done-DoaEDHCG.js} +1 -1
- package/dist/assets/{Edit-BvogU5l2.js → Edit-CJQK4atN.js} +1 -1
- package/dist/assets/{ErrorOutline-CLZmnhnI.js → ErrorOutline-CR7yRjZc.js} +1 -1
- package/dist/assets/{HelpOutline-hZN36iob.js → HelpOutline-DIMDDIpO.js} +1 -1
- package/dist/assets/{Holiday-CVr2LMMz.js → Holiday-DwuuABxa.js} +1 -1
- package/dist/assets/{Launch-BVKqak_-.js → Launch-CSu1nrjk.js} +1 -1
- package/dist/assets/{Link-C4o8Tfyg.js → Link-CBIXUB_y.js} +1 -1
- package/dist/assets/{ListItemButton-D2V2qgeT.js → ListItemButton-FKXnIc0i.js} +1 -1
- package/dist/assets/{ListSubheader-BSK-B-Hs.js → ListSubheader-Cawr8223.js} +1 -1
- package/dist/assets/{LoadingButton-VMcNYQ8q.js → LoadingButton-CRKt-OT1.js} +1 -1
- package/dist/assets/{LockIcon-C58tNgx9.js → LockIcon-CnYrREef.js} +1 -1
- package/dist/assets/{Meeting-ocx742Wk.js → Meeting-COxcunCf.js} +1 -1
- package/dist/assets/{MoreHoriz-CPdB-acW.js → MoreHoriz-JIt9gEw_.js} +1 -1
- package/dist/assets/{MoreVert-BZT8paNd.js → MoreVert-CjjkmApl.js} +1 -1
- package/dist/assets/{OffSick-a8D-sUdt.js → OffSick-Dlf0wRCP.js} +1 -1
- package/dist/assets/{OpenInNew-DJsi1NWq.js → OpenInNew-D-RnzHyt.js} +1 -1
- package/dist/assets/{Public-DSbGTo8s.js → Public-DQrPVGw9.js} +1 -1
- package/dist/assets/{Refresh-BK_aBn8t.js → Refresh-g_ze8RC-.js} +1 -1
- package/dist/assets/{SchemaReference.es-BYITplvj.js → SchemaReference.es-Bs4TGph_.js} +1 -1
- package/dist/assets/{Search-DGRuo7t-.js → Search-DmfQzntI.js} +1 -1
- package/dist/assets/{Slider-CS-gjd3v.js → Slider-C7KUHAl4.js} +1 -1
- package/dist/assets/{Stepper-ZCO4EB3o.js → Stepper-ECw_WCHI.js} +1 -1
- package/dist/assets/{Switch-CG3jQlg3.js → Switch-D1aSf0Rk.js} +1 -1
- package/dist/assets/{TableRow-Cyof88VP.js → TableRow-CL8yhyVQ.js} +1 -1
- package/dist/assets/{TableSearch-CxutcmoF.js → TableSearch-CxUE73Wm.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Dldk8U9s.js → ToggleButtonGroup-BADZ1hmi.js} +1 -1
- package/dist/assets/{Verified-DVQjMky2.js → Verified-CoaucJDJ.js} +1 -1
- package/dist/assets/{VerifiedUser-350MitWy.js → VerifiedUser-CGiTKpYb.js} +1 -1
- package/dist/assets/{ViewColumn-BSxTQVZ-.js → ViewColumn-DVO6c2uh.js} +1 -1
- package/dist/assets/{ViewList-BEu0UPsS.js → ViewList-CaLfZh_J.js} +1 -1
- package/dist/assets/{WorkingRemotely-BEw6X98n.js → WorkingRemotely-CIlCJe_n.js} +1 -1
- package/dist/assets/{_createAggregator-Djv2-ovu.js → _createAggregator-DKh4oPcE.js} +1 -1
- package/dist/assets/{actions-LyrEo_Cb.js → actions-D0cYymRM.js} +1 -1
- package/dist/assets/{actions-DNqu-9QQ.js → actions-DMblPsrA.js} +1 -1
- package/dist/assets/{agreement-Cc4wdZqi.js → agreement-CmpcKfmG.js} +1 -1
- package/dist/assets/api-D8CXYVbD.js +1 -0
- package/dist/assets/{appearance-BkddHlmf.js → appearance-CC06pu2W.js} +1 -1
- package/dist/assets/ar-BN95HEFs.js +7 -0
- package/dist/assets/{audit-logs-EkgBhSvA.js → audit-logs-D9nHuKQm.js} +1 -1
- package/dist/assets/{base-chart-C63mtC4Z.js → base-chart-DHzZnb2L.js} +1 -1
- package/dist/assets/{blocklet-BzkaFDNW.js → blocklet-C56CLqfn.js} +1 -1
- package/dist/assets/{brace-fold.es-CyCMNzH4.js → brace-fold.es-WYquVZ0Q.js} +1 -1
- package/dist/assets/{chain-DJhIX7OW.js → chain-DKfcWWlC.js} +1 -1
- package/dist/assets/{click-to-copy-CYaDSQoy.js → click-to-copy-CiS9u8Lz.js} +1 -1
- package/dist/assets/cloneDeep-fDhnQcTQ.js +1 -0
- package/dist/assets/{closebrackets.es-DvIy3kAL.js → closebrackets.es-BTFbO_zS.js} +1 -1
- package/dist/assets/{codemirror.es-BtJVhvPq.js → codemirror.es-bTfvwT0x.js} +1 -1
- package/dist/assets/{collapse-BhbkfN99.js → collapse-De1M4hZU.js} +1 -1
- package/dist/assets/{comment.es-BWJma_ss.js → comment.es-CfIJpCF-.js} +1 -1
- package/dist/assets/{config-navigation-DfmuKS6F.js → config-navigation-NKWvqO8O.js} +3 -3
- package/dist/assets/{connect-to-CorUs381.js → connect-to-B4CwZqBJ.js} +1 -1
- package/dist/assets/de-BmXl3Jnb.js +7 -0
- package/dist/assets/{delete-confirm-D2071wW2.js → delete-confirm-Ca6B5KxO.js} +1 -1
- package/dist/assets/{detail-BgptcQe2.js → detail-B0kwpZJg.js} +3 -3
- package/dist/assets/{dialog.es-DNRuZxpL.js → dialog.es-b4YsH3yO.js} +1 -1
- package/dist/assets/{domains-Dw6WVrfK.js → domains-DfM0llnu.js} +1 -1
- package/dist/assets/{download-mU0RETFZ.js → download-D2RXPhXc.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-CyqIkV2y.js +1 -0
- package/dist/assets/es-C0fHeuzj.js +9 -0
- package/dist/assets/{foldgutter.es-BfaddajE.js → foldgutter.es-Bmzc1lAn.js} +1 -1
- package/dist/assets/fr-CO0NFjy0.js +7 -0
- package/dist/assets/{get-safe-url-COP_ZxQz.js → get-safe-url-Dsy-huUv.js} +1 -1
- package/dist/assets/{get-safe-url-DS1bGOO2.js → get-safe-url-DuYpuHQJ.js} +1 -1
- package/dist/assets/getValidReactChildren-BhCPp8PX.js +1 -0
- package/dist/assets/hi-Cms3dwY-.js +5 -0
- package/dist/assets/{hint.es-DhVyUt1d.js → hint.es-D3enHBIe.js} +1 -1
- package/dist/assets/{hint.es2-uDqXrloM.js → hint.es2-D_8pEhNZ.js} +1 -1
- package/dist/assets/id-Bo8dj7EE.js +7 -0
- package/dist/assets/{iframe-D-LcA3MK.js → iframe-JzwQis4I.js} +1 -1
- package/dist/assets/{index-CdU6oLkY.js → index--aogETCe.js} +1 -1
- package/dist/assets/{index-DOsDgrew.js → index-1fDaH0GR.js} +3 -3
- package/dist/assets/{index-oBJqRsld.js → index-8TfE60DJ.js} +1 -1
- package/dist/assets/{index-qfTOhIhQ.js → index-B8Ac-C82.js} +1 -1
- package/dist/assets/{index-C0dOEsU4.js → index-BOaWHm3y.js} +1 -1
- package/dist/assets/{index-B0UMNJnN.js → index-BR_N19sK.js} +1 -1
- package/dist/assets/{index-BhAPLn1b.js → index-BVHtC5Hk.js} +1 -1
- package/dist/assets/{index-DbTX57bM.js → index-BcLnPbZ_.js} +1 -1
- package/dist/assets/index-Bmgy-F8w.js +550 -0
- package/dist/assets/{index-CeNoqA4g.js → index-Bp85PVE7.js} +1 -1
- package/dist/assets/{index-DU-OQYbG.js → index-Br9fC4wn.js} +1 -1
- package/dist/assets/{index-B8IA5mbU.js → index-BsTEuRio.js} +6 -6
- package/dist/assets/{index-QU1qCf8F.js → index-Bv0UYgtN.js} +1 -1
- package/dist/assets/{index-B-SlNWYL.js → index-BwtBZueg.js} +1 -1
- package/dist/assets/{index-CZ5-hnEn.js → index-C-gpDEaK.js} +1 -1
- package/dist/assets/{index-BIgkt_q9.js → index-C-wwh49Y.js} +1 -1
- package/dist/assets/{index-BZMWcUCX.js → index-C40_ZUH_.js} +1 -1
- package/dist/assets/{index-Cb3Huyfb.js → index-CEkzM2Hy.js} +1 -1
- package/dist/assets/{index-DUIS5TWY.js → index-CEwaV1Oe.js} +1 -1
- package/dist/assets/{index-oc5ucOuy.js → index-CHr_TiKg.js} +1 -1
- package/dist/assets/{index-DVrUurys.js → index-CPkjKWDT.js} +1 -1
- package/dist/assets/{index-C9oR1oH6.js → index-CUf9smnR.js} +1 -1
- package/dist/assets/{index-czhxiIDF.js → index-CbpkZm_D.js} +1 -1
- package/dist/assets/{index-BcbNijWK.js → index-Ci6qo3N4.js} +1 -1
- package/dist/assets/{index-CCINW9gm.js → index-CuCDUbks.js} +3 -3
- package/dist/assets/{index-C9buY914.js → index-D651LXXD.js} +1 -1
- package/dist/assets/{index-CFkoE5Gw.js → index-DJfwuANq.js} +1 -1
- package/dist/assets/{index-C5ZlPR3p.js → index-DPPR0A8j.js} +5 -5
- package/dist/assets/{index-Cy666DOY.js → index-DdKwcnDa.js} +1 -1
- package/dist/assets/{index-P1DlwKGv.js → index-Diry1rOC.js} +1 -1
- package/dist/assets/{index-fHnSssqp.js → index-DmqHgbIB.js} +1 -1
- package/dist/assets/index-DqZUR6e0.js +120 -0
- package/dist/assets/index-DtQb3yWv.js +1 -0
- package/dist/assets/{index-rZ1SBrH_.js → index-DuyB74pI.js} +1 -1
- package/dist/assets/{index-zsz18EZU.js → index-Dy6Ndspk.js} +1 -1
- package/dist/assets/{index-4aFZazff.js → index-DzIW7WPn.js} +1 -1
- package/dist/assets/{index-BRvaeUvs.js → index-QAr8nKeC.js} +3 -3
- package/dist/assets/{index-BblGFvvF.js → index-Xeh4Hy1K.js} +1 -1
- package/dist/assets/{index-BJQjXoNM.js → index-YHRJ5Z9D.js} +1 -1
- package/dist/assets/{index-LcQ1y9fq.js → index-f3wryxsZ.js} +1 -1
- package/dist/assets/{index-5OOYkflw.js → index-hpqdONWL.js} +1 -1
- package/dist/assets/{index-CW7SH6ZA.js → index-mJjX2o0I.js} +1 -1
- package/dist/assets/{index-CHPEHw0Y.js → index-mWC0dxsG.js} +1 -1
- package/dist/assets/{index-BOH-YtOs.js → index-p0Tn5q9W.js} +1 -1
- package/dist/assets/{index-BkRO05--.js → index-pLwCyBIW.js} +1 -1
- package/dist/assets/{index-D6ARqm6f.js → index-qPfSbb8F.js} +1 -1
- package/dist/assets/{index-DNITJyFR.js → index-uhXfBcTY.js} +1 -1
- package/dist/assets/{index.esm-F8b32K2k.js → index.esm-BeKnx9US.js} +1 -1
- package/dist/assets/{info-addon.es-CPDzNYQ-.js → info-addon.es-DcDBZCZ9.js} +1 -1
- package/dist/assets/{info.es-B-z85utp.js → info.es-CMDl0oHG.js} +1 -1
- package/dist/assets/{install-from-url-BNqF6NV-.js → install-from-url-T6jdS-sd.js} +1 -1
- package/dist/assets/{invitation-qmFlHZV_.js → invitation-BQpAoUra.js} +1 -1
- package/dist/assets/is-path-prefix-equal-DAINokq6.js +1 -0
- package/dist/assets/{item-DuGkpxdL.js → item-zzpJhUAv.js} +1 -1
- package/dist/assets/ja-zaAhH8mE.js +9 -0
- package/dist/assets/{javascript.es-DwEw3iuE.js → javascript.es-rVaecCeY.js} +1 -1
- package/dist/assets/{jump-to-line.es-BaO-Qct6.js → jump-to-line.es-fZd9SPeK.js} +1 -1
- package/dist/assets/{jump.es-DEVhkMqg.js → jump.es-C2i0yVn0.js} +1 -1
- package/dist/assets/ko-CoZQ7a7T.js +9 -0
- package/dist/assets/{lint.es-DNf7-y3f.js → lint.es-T7Eyo8Ee.js} +1 -1
- package/dist/assets/{lint.es2-CkGacl6V.js → lint.es2-D9w-DqTv.js} +1 -1
- package/dist/assets/{lint.es3-ddr9rdgz.js → lint.es3-BR3fJTRU.js} +1 -1
- package/dist/assets/{list-header-DL9A5VcR.js → list-header-BHP30ooa.js} +1 -1
- package/dist/assets/{log-JH4lXNVE.js → log-BPS1ovHk.js} +1 -1
- package/dist/assets/{lottie-react.esm-Dr-WheMr.js → lottie-react.esm-BHwF6ttF.js} +1 -1
- package/dist/assets/{matchbrackets.es-XuVMbpLz.js → matchbrackets.es-B45wj5E9.js} +1 -1
- package/dist/assets/{memory-C_p3X92I.js → memory-CNHjW2ab.js} +1 -1
- package/dist/assets/{metric-CB_GPXBA.js → metric-BcRet1lX.js} +1 -1
- package/dist/assets/{mode.es-Dqrxjy1v.js → mode.es-BLJK3yl5.js} +1 -1
- package/dist/assets/{mode.es2-VNAXkQps.js → mode.es2-hlIytxg7.js} +1 -1
- package/dist/assets/{mode.es3-BN6h3Bus.js → mode.es3-CVTYL_Rp.js} +1 -1
- package/dist/assets/omit-Difyap46.js +1 -0
- package/dist/assets/{onlineParser.es-D4el_PBT.js → onlineParser.es-D7LXCAe9.js} +1 -1
- package/dist/assets/{overview-BXzzQmbs.js → overview-Dl1-aEub.js} +1 -1
- package/dist/assets/{permission-JEjDz9i9.js → permission-syQYMJDU.js} +1 -1
- package/dist/assets/{preference-QWJp9UJS.js → preference-Bjp0l-rP.js} +3 -3
- package/dist/assets/pt-D4wJ-rZD.js +5 -0
- package/dist/assets/{raf-schd.esm-D-4-98oh.js → raf-schd.esm-D4X3rkFT.js} +1 -1
- package/dist/assets/refType-Bi7lNIS6.js +1 -0
- package/dist/assets/{resource-dialog-BSxf3l0v.js → resource-dialog-Bj4Rm8z8.js} +4 -4
- package/dist/assets/ru-CmWrzb7M.js +5 -0
- package/dist/assets/{runtime-DFh8uNkc.js → runtime-DHGpU07w.js} +1 -1
- package/dist/assets/sdk--zV5g1Ng.js +1 -0
- package/dist/assets/{search.es-CvgIaw00.js → search.es-DEh8WYav.js} +1 -1
- package/dist/assets/{searchcursor.es-OCU4Stl-.js → searchcursor.es-BHK3Udfj.js} +1 -1
- package/dist/assets/{service-C2aUE-9d.js → service-BLsXGeBF.js} +1 -1
- package/dist/assets/{shorten-label-DEXH98Sk.js → shorten-label-rkbgI37z.js} +1 -1
- package/dist/assets/{show-hint.es-Ddp99Kzq.js → show-hint.es-TLn5XERt.js} +1 -1
- package/dist/assets/{simple-select-DtUilbs1.js → simple-select-CqR13Ja_.js} +1 -1
- package/dist/assets/{spaces-C01mORkW.js → spaces-DLzKX3Ra.js} +1 -1
- package/dist/assets/{status-DaQfjPiw.js → status-CtyoZCac.js} +1 -1
- package/dist/assets/{status-DwmHBBa8.js → status-CyZk73aw.js} +1 -1
- package/dist/assets/{sublime.es-D01aXBye.js → sublime.es-B7ROfjSt.js} +1 -1
- package/dist/assets/{switch-control-BUF_yGeD.js → switch-control-DRItWC8V.js} +1 -1
- package/dist/assets/{table-icons-C5qrNAvA.js → table-icons-CN1Rmj7L.js} +1 -1
- package/dist/assets/{team-BcbX_cMl.js → team-7oU1sdtL.js} +1 -1
- package/dist/assets/th-DkqBkRH_.js +5 -0
- package/dist/assets/{toLower-GSZ9DJJ3.js → toLower-BetQNSka.js} +1 -1
- package/dist/assets/toUpper-CnLEnHph.js +1 -0
- package/dist/assets/{traffic-CTPgH40k.js → traffic-BXrg_wx7.js} +1 -1
- package/dist/assets/{url-evaluation-DmRIkzYe.js → url-evaluation-PNUzVXFG.js} +1 -1
- package/dist/assets/{url-join-BSWLYThb.js → url-join-BT4uwgMW.js} +1 -1
- package/dist/assets/{use-mobile-DU80Jj4U.js → use-mobile-DaylDy56.js} +1 -1
- package/dist/assets/{use-mobile-DxY5BxAJ.js → use-mobile-zJMHEWPE.js} +1 -1
- package/dist/assets/{useAsync-Ct1xKput.js → useAsync-8QQYXZ2o.js} +1 -1
- package/dist/assets/{useAsyncRetry-Bis_hMS7.js → useAsyncRetry-CGk8Cu9u.js} +1 -1
- package/dist/assets/{useLocalStorage-CRy7LFYG.js → useLocalStorage-DdJoK4w7.js} +1 -1
- package/dist/assets/{useThemeProps-C3mE_-3Z.js → useThemeProps-Rte_NmVE.js} +1 -1
- package/dist/assets/{util-Ctz_J-u1.js → util-DlhHM2MK.js} +1 -1
- package/dist/assets/vi-D4Y0EZ10.js +5 -0
- package/dist/assets/{wait-container-Der-CqPb.js → wait-container-BPSvZhQ4.js} +1 -1
- package/dist/assets/{withStyles-DWhl0Lx-.js → withStyles-D2YScWal.js} +1 -1
- package/dist/assets/{without-wallet-Bmmbgqin.js → without-wallet-CXyXy2KB.js} +1 -1
- package/dist/assets/wrap-locale-kaXbWMUB.js +1 -0
- package/dist/assets/{zh-DJTjvgj8.js → zh-CXbCDXZ8.js} +1 -1
- package/dist/assets/zh-tw-DaTNZcVC.js +9 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-CSrxJE-w.js +0 -1
- package/dist/assets/ar-DLXKKOGO.js +0 -7
- package/dist/assets/cloneDeep-C6XYSA9m.js +0 -1
- package/dist/assets/de-CnbmrteH.js +0 -7
- package/dist/assets/emotion-react.browser.esm-CSjORkdU.js +0 -1
- package/dist/assets/es-C7oXJBWv.js +0 -9
- package/dist/assets/fr-DzleTcLj.js +0 -7
- package/dist/assets/getValidReactChildren-CxwCdnNW.js +0 -1
- package/dist/assets/hi-B24wH0bs.js +0 -5
- package/dist/assets/id-BIjW1vW9.js +0 -7
- package/dist/assets/index-DCo8_mUx.js +0 -1
- package/dist/assets/index-DrxRISPM.js +0 -120
- package/dist/assets/index-Dyvb9fH4.js +0 -521
- package/dist/assets/is-path-prefix-equal-lgGkNkcR.js +0 -1
- package/dist/assets/ja-mu0bc5Fx.js +0 -9
- package/dist/assets/ko-CSWdQF8q.js +0 -9
- package/dist/assets/omit-Bc4_KMtF.js +0 -1
- package/dist/assets/pt-Odg8daEV.js +0 -5
- package/dist/assets/refType-Dqlqmha-.js +0 -1
- package/dist/assets/ru-OkiNIvy3.js +0 -5
- package/dist/assets/sdk-DtMj7H7_.js +0 -1
- package/dist/assets/th-esLoaeiE.js +0 -5
- package/dist/assets/toUpper-BPMwwnP-.js +0 -1
- package/dist/assets/vi-BF6u6-98.js +0 -5
- package/dist/assets/wrap-locale-rE7v3anU.js +0 -1
- package/dist/assets/zh-tw-B7cFexwg.js +0 -9
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
import{bX as Mo,j as t,f7 as Ao,hP as qo,l6 as Fo,aQ as Gt,aR as Wt,m as G,br as Q,N as C,aC as xe,P as s,A as L,am as ft,r as m,e as Ce,bF as qe,b as H,J as B,Y as Mt,bE as He,t as X,n as M,Z as ie,l7 as Go,a5 as ee,a_ as uo,k as te,D as ht,b6 as Wo,gO as zo,gP as Vo,e3 as Yo,C as ue,fS as Ko,w as Ho,aA as Wn,x as gt,v as Qo,l8 as Xo,l9 as Zo,B as de,la as Jo,$ as er,a0 as tr,lb as po,bs as mo,V as be,dH as nr,dU as or,aE as rr,aF as sr,hw as ir,aG as ar,aI as J,aT as lr,cR as cr,H as fo,bq as dr,a1 as ur,O as at,aH as ho,b2 as zt,lc as pr,b3 as ye,aD as zn,cP as mr,k4 as fr,F as D,af as Fe,aP as go,bW as Vt,cA as hr,g as xt,ld as gr,be as xr,z as xo,aZ as At,T as yr,aX as Ke,R as Nt,W as Cr,bG as yo,gM as jr,cv as vr,aL as br,bx as Rr,aW as Sr,ep as wr,fY as Vn,le as Yn,hd as Kn,X as Hn,G as lt,cO as Tr,he as Er,bV as Pr,k5 as kr}from"./index-B8IA5mbU.js";import{E as Ir}from"./index-DbTX57bM.js";import{e as _r,f as Ur,g as Dr,u as Yt,a as Nr}from"./actions-DNqu-9QQ.js";import{S as Lr}from"./switch-control-BUF_yGeD.js";import{u as pe}from"./blocklet-BzkaFDNW.js";import{P as qt,w as yt}from"./permission-JEjDz9i9.js";import{d as Co}from"./Edit-BvogU5l2.js";import{T as Br,M as Or,t as $r}from"./table-icons-C5qrNAvA.js";import{s as Mr,R as dt,F as Ar,L as qr,d as Fr,B as Gr}from"./preference-QWJp9UJS.js";import{C as Qn}from"./click-to-copy-CYaDSQoy.js";import{S as Xn}from"./index-BhAPLn1b.js";import{d as Wr}from"./Add-BFsFN1Gy.js";import{c as zr,C as Vr,b as Yr,s as Kt,e as Kr,j as Hr,d as jo,a as Qr,A as Xr,B as Zr,f as Jr,S as es}from"./item-DuGkpxdL.js";import{d as Ht}from"./Link-C4o8Tfyg.js";import{u as ts,a as ns,P as vo,L as Zn,A as os,S as rs}from"./index-oc5ucOuy.js";import{u as ss,C as is,D as as,a as ls,b as cs}from"./connect-to-CorUs381.js";import{C as ds,u as us,A as ps}from"./agreement-Cc4wdZqi.js";import{d as ms}from"./Done-BFMi5HXU.js";import{A as fs,a as hs,d as gs,b as xs}from"./collapse-BhbkfN99.js";import{C as ys,L as Cs}from"./LockIcon-C58tNgx9.js";import{I as bo,a as js,f as vs,B as bs}from"./install-from-url-BNqF6NV-.js";import{a as Jn}from"./api-CSrxJE-w.js";import{v as Ro,e as Rs,a as ut}from"./util-Ctz_J-u1.js";import{u as So}from"./use-mobile-DxY5BxAJ.js";import{d as Ss}from"./ArrowDropDown-CejcJzkX.js";import{_ as ws}from"./useLocalStorage-CRy7LFYG.js";import{d as Ct}from"./Delete-CiU1bEBu.js";import{d as wo}from"./Launch-BVKqak_-.js";import{D as Ts}from"./delete-confirm-D2071wW2.js";import{W as Qe,R as Es,a as eo}from"./url-evaluation-DmRIkzYe.js";import{B as To}from"./status-DwmHBBa8.js";import{A as Eo}from"./actions-LyrEo_Cb.js";import{I as Lt}from"./index-rZ1SBrH_.js";import{t as Ps}from"./toUpper-BPMwwnP-.js";import{S as ks}from"./Switch-CG3jQlg3.js";import{a as Is}from"./team-BcbX_cMl.js";import"./MoreVert-BZT8paNd.js";import"./get-safe-url-COP_ZxQz.js";import"./ButtonGroup-BzAT8pGA.js";import"./getValidReactChildren-CxwCdnNW.js";import"./index-5OOYkflw.js";import"./raf-schd.esm-D-4-98oh.js";import"./index-B0UMNJnN.js";import"./ViewColumn-BSxTQVZ-.js";import"./CSSTransition-Byi2ne4y.js";import"./index-Cy666DOY.js";import"./Clear-CmPKgcDo.js";import"./ChevronRight-CFfmouwT.js";import"./ChevronLeft-CDs40tmH.js";import"./Search-DGRuo7t-.js";import"./omit-Bc4_KMtF.js";import"./index-CFkoE5Gw.js";import"./index-BblGFvvF.js";import"./iframe-D-LcA3MK.js";import"./Autocomplete-PeF181FR.js";import"./ListSubheader-BSK-B-Hs.js";import"./Verified-DVQjMky2.js";import"./VerifiedUser-350MitWy.js";import"./DeleteOutline-reI_idEa.js";import"./url-join-BSWLYThb.js";import"./Close-C8GsrnLa.js";import"./index-fHnSssqp.js";import"./OpenInNew-DJsi1NWq.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-hZN36iob.js";import"./spaces-C01mORkW.js";import"./index-QU1qCf8F.js";import"./cloneDeep-C6XYSA9m.js";import"./without-wallet-Bmmbgqin.js";import"./ListItemButton-D2V2qgeT.js";import"./Stepper-ZCO4EB3o.js";import"./is-path-prefix-equal-lgGkNkcR.js";import"./MoreHoriz-CPdB-acW.js";const _s=Mo(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");function to(e,o){var n={};return o=Ao(o),qo(e,function(a,r,i){Fo(n,r,o(a,r,i))}),n}var Qt={},Us=Wt;Object.defineProperty(Qt,"__esModule",{value:!0});var Po=Qt.default=void 0,Ds=Us(Gt()),Ns=t;Po=Qt.default=(0,Ds.default)((0,Ns.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");var Xt={},Ls=Wt;Object.defineProperty(Xt,"__esModule",{value:!0});var Zt=Xt.default=void 0,Bs=Ls(Gt()),Os=t;Zt=Xt.default=(0,Bs.default)((0,Os.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");function Jt({children:e,...o}){var x;const{t:n}=G(),{api:a}=Q(),{blocklet:r}=pe(),i=(x=r==null?void 0:r.settings)==null?void 0:x.autoCheckUpdate,h=async g=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:g}})},c=async()=>{try{const g=!(i!=null&&i.enabled);await h({enabled:g}),L.success(n(g?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(g){L.error(g.message)}},p=!!(i!=null&&i.enabled);return t.jsxs(C,{display:"flex",flexDirection:"row",alignItems:"center",children:[e,t.jsx(xe,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Lr,{checked:p,onChange:c,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Jt.propTypes={children:s.any};Jt.defaultProps={children:null};function no(e){function o({sx:n,...a}){return t.jsx(e,{...a,sx:{color:"text.primary",...n}})}return o}const $s={...to($r,no),...to(_r,no)},Ms=(e,o)=>{let{description:n}=e;return(Object.values(H.CHAIN_PROP_MAP).includes(e.key)||B.isEnvShareable(e))&&(n?n=`${n} (${o("blocklet.config.sharedToAllComponents")})`:n=o("blocklet.config.sharedToAllComponents")),n&&t.jsx("div",{style:{marginLeft:12},children:n})},Bt=(e,o,n=[])=>!(n!=null&&n.length)&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!o.meta.environments.find(a=>a.name===e.key)&&o.children.every(a=>!a.meta.environments.find(r=>r.name===e.key))?!0:e.custom,oo=e=>[H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),Ot=e=>[H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function en({blocklet:e,ancestors:o}){const n=Q(),{palette:a}=ft(),{inService:r}=n,{t:i}=m.useContext(Ce),h=[...o.map(f=>f.meta.did),e.meta.did],c=()=>L.success(i("blocklet.config.changedTip")),p=f=>Bt(f,e,o);if(qe(e.status)||e.status==="unknown"&&qe(e.status))return null;const x=f=>new Promise(async(u,v)=>{if(!f.key.trim()||!f.value.trim()){L.error(i("blocklet.config.environment.keyValueRequired")),v();return}if(oo(f.key)===!1){L.error(i("blocklet.config.environment.invalidKey")),v();return}f.custom=Ot(f.key);try{const T=await n.api.configBlocklet({input:{did:h,configs:[f]}});c(T.blocklet),u()}catch(T){L.error(ie(T)),v()}}),g=(f,u)=>new Promise(async(v,T)=>{if(f.required&&(!f.key.trim()||!f.value.trim())){L.error(i("blocklet.config.environment.keyValueRequired")),T();return}if(oo(f.key)===!1){L.error(i("blocklet.config.environment.invalidKey")),T();return}if(f.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const N=Go(f);if(N){L.error(N),T();return}}const b=[{...f,value:f.secure&&f.value==="__encrypted__"?"":f.value}];if(f.key!==u.key){if(!Bt(f,e,o)){L.error("Only key of custom env can be changed"),T();return}b.push({key:u.key,custom:Ot(f.key)})}try{const N=await n.api.configBlocklet({input:{did:h,configs:b}});c(N.blocklet),v()}catch(N){L.error(ie(N)),T()}}),l=f=>new Promise(async(u,v)=>{if(f.required){L.error(i("blocklet.config.environment.deleteForbidden")),v();return}if(!Bt(f,e,o)){L.error("Only key of custom env can be changed"),v();return}try{const T=await n.api.configBlocklet({input:{did:h,configs:[{key:f.key,custom:Ot(f.key)}]}});c(T.blocklet),u()}catch(T){L.error(ie(T)),v()}}),R=(e.configs||[]).filter(f=>!H.BLOCKLET_CONFIGURABLE_KEY[f.key]||[H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(f.key)),y=B.getSharedConfigObj(o[0],e),d=B.getComponentMissingConfigs(e,o[0]),w=R.map(f=>({...f,value:Object.values(H.CHAIN_PROP_MAP).includes(f.key)&&Object.keys(y).includes(f.key)?y[f.key]:y[f.key]||f.value})),S=w.some(f=>f.key&&f.key.startsWith("BWA_")),k={onRowAdd:x,onRowUpdate:g,onRowDelete:l,isDeletable:p},j=()=>[{title:i("common.key"),field:"key",initialEditValue:"",width:"30%",render:f=>t.jsx(Qn,{value:f.value,style:{color:f.required&&!f.value?a.error.main:a.text.primary,fontWeight:f.required?"bold":"normal"},children:f.key}),editComponent:f=>{const{value:u,rowData:v,onChange:T}=f;return t.jsx(ro,{children:t.jsx(X,{fullWidth:!0,size:"small",InputProps:{readOnly:p(v)===!1},value:Mr.escapeTag(u),onChange:b=>T(b.target.value),variant:"outlined",label:"Key",placeholder:i("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:i("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:f=>f.value?f.secure?"******":t.jsx(Qn,{unstyled:!0,value:f.value,style:{wordBreak:"break-all"},children:f.value}):null,editComponent:f=>{const{value:u,rowData:v,onChange:T}=f;return t.jsxs(ro,{children:[t.jsx(X,{fullWidth:!0,size:"small",value:u==="__encrypted__"?"":u,onChange:b=>T(b.target.value),variant:"outlined",label:i("common.value"),placeholder:i("blocklet.config.environment.value"),margin:"dense"}),Ms(v,i)]})}}];return t.jsxs(As,{children:[!!d.length&&t.jsx(Mt,{severity:"error",style:{marginTop:24},children:i("blocklet.config.missingRequired")}),S&&t.jsx(Mt,{severity:"info",children:i("blocklet.config.environment.tip")}),t.jsx(qt,{permission:r?"":"mutate_blocklets",role:r?He:[],children:f=>t.jsx(Br,{className:"config-table",children:t.jsx(Or,{title:t.jsx(C,{fontWeight:"bold",children:i("common.environments")}),columns:j(),icons:$s,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:i("common.actions")},body:{emptyDataSourceMessage:i("common.noData")}},data:w,editable:f?k:{}})})})]})}en.propTypes={blocklet:s.object.isRequired,ancestors:s.array};en.defaultProps={ancestors:[]};const As=M.div`
|
|
2
|
-
.config-table {
|
|
3
|
-
margin-bottom: 24px;
|
|
4
|
-
position: relative;
|
|
5
|
-
.hide-control {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 10px;
|
|
8
|
-
left: 200px;
|
|
9
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
10
|
-
left: 160px;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.MuiToolbar-root {
|
|
15
|
-
display: flex;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.MuiTableRow-head {
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&.hide-header {
|
|
23
|
-
.MuiToolbar-root {
|
|
24
|
-
display: none;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.accordion {
|
|
30
|
-
margin-bottom: 16px;
|
|
31
|
-
&:last-of-type {
|
|
32
|
-
margin-bottom: 0;
|
|
33
|
-
}
|
|
34
|
-
padding: 8px 0 8px 0px;
|
|
35
|
-
&.MuiAccordion-root {
|
|
36
|
-
background: transparent;
|
|
37
|
-
box-shadow: none;
|
|
38
|
-
border: 1px solid #ddd;
|
|
39
|
-
border-radius: 4px;
|
|
40
|
-
&::before,
|
|
41
|
-
&::after {
|
|
42
|
-
height: 0;
|
|
43
|
-
}
|
|
44
|
-
.MuiAccordionSummary-root {
|
|
45
|
-
padding-left: 0;
|
|
46
|
-
}
|
|
47
|
-
.accordion-title {
|
|
48
|
-
font-weight: bold;
|
|
49
|
-
padding-left: 16px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`,ro=M.div`
|
|
54
|
-
height: 60px;
|
|
55
|
-
`;function jt({open:e,onClose:o,hiddenChildren:n,blocklet:a,ancestors:r,children:i}){const[h,c]=m.useState(!1),{t:p}=G(),x=p("environmentFor",{name:B.getDisplayName(a,!0)});if(qe(a.status)||a.status==="unknown"&&qe(a.status))return null;const g=()=>{o==null||o(),c(!1)},l=y=>{y.stopPropagation(),c(!0)};let R=null;return n||(R=typeof i=="function"?i({open:l}):t.jsx(ee,{onClick:l,"data-cy":"action-config-component",children:t.jsx(Co,{})})),t.jsxs(t.Fragment,{children:[R,(e||h)&&t.jsx(qs,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:g,PaperProps:{style:{minHeight:"auto",backgroundImage:"none"}},children:t.jsxs(uo,{gap:0,children:[t.jsx(te,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:p("description.environment",{name:B.getDisplayName(a,!0)})}),t.jsx(en,{blocklet:a,ancestors:r})]})})]})}jt.propTypes={blocklet:s.object.isRequired,ancestors:s.array,children:s.any,open:s.bool,onClose:s.func,hiddenChildren:s.bool};jt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const qs=M(ht)`
|
|
56
|
-
.MuiDialogContent-root {
|
|
57
|
-
padding-top: 0;
|
|
58
|
-
padding-bottom: 24px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.MuiToolbar-root {
|
|
62
|
-
padding-right: 0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.ux-dialog_closeButton {
|
|
66
|
-
margin: 0;
|
|
67
|
-
}
|
|
68
|
-
`,tn={description:s.string,editing:s.bool,onChange:s.func,required:s.bool,value:s.any,componentProps:s.object,render:s.func,renderFormItem:s.func};function nn({editing:e,value:o,onChange:n}){const[a,r]=m.useState(!1),i=m.useRef(),h=m.useRef(o);m.useEffect(()=>{let l=null;return e&&(l=setTimeout(()=>{r(!0)},50)),()=>{clearTimeout(l)}},[e]);const c=l=>{h.current=l,n(l)},p=()=>{r(!1),n(h.current)},x=t.jsx(C,{className:"form-item-input slot",px:1,children:t.jsxs(C,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=t.jsxs(C,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:p,children:[t.jsx(C,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:t.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),t.jsx(Wo,{open:a,anchorEl:i.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(ys,{color:o,onChange:l=>c(l.hex)})})]});return e?g:x}nn.propTypes=tn;function on({editing:e,description:o,value:n,onChange:a,componentProps:r,...i}){const{placeholder:h}=r,c=m.useRef(n),{t:p}=m.useContext(Ce),x=l=>{l.key==="Enter"&&a(c.current,"confirm")},g=l=>{c.current=l,a(l)};return e?t.jsx(X,{style:{flex:1},fullWidth:!0,value:n,onChange:l=>{l.persist(),g(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||h,onKeyDown:x,...i}):t.jsx(C,{px:1,className:"form-item-input slot",children:n||t.jsx("span",{className:"placeholder",children:p("common.requiredInputPlaceholder",{name:o||h})})})}on.propTypes=tn;on.defaultProps={componentProps:{}};function rn({editing:e,value:o,onChange:n,componentProps:a,...r}){const{blocklet:i}=a,h=o==="auto"?zo.getPassportColorFromDid(i.appDid):o;return t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Vo({title:"Owner",issuer:B.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),t.jsx(nn,{...r,editing:e,value:e?h:o,onChange:n,componentProps:a})]})}rn.propTypes={...tn,componentProps:s.shape({blocklet:s.object.isRequired}).isRequired};rn.defaultProps={};const Fs=Yo`
|
|
69
|
-
0%, 100% {
|
|
70
|
-
transform: scale(1) translateX(0);
|
|
71
|
-
}
|
|
72
|
-
50% {
|
|
73
|
-
transform: scale(1.05) translateX(-3px);
|
|
74
|
-
}
|
|
75
|
-
25%, 75% {
|
|
76
|
-
transform: scale(1.1) translateX(3px);
|
|
77
|
-
}
|
|
78
|
-
`,Gs={input:on,color:nn,passport:rn,uploader:e=>t.jsx(qr,{...e.componentProps})};function Ws(e,{editing:o=!1}){const{componentType:n="input",render:a,renderFormItem:r}=e;return o&&r?r:!o&&a?a:Gs[n==null?void 0:n.toLowerCase()]}vt.propTypes={item:s.object.isRequired,findEditingItem:s.func.isRequired,getItemValue:s.func.isRequired,onFormItemChange:s.func.isRequired,onFocusOut:s.func.isRequired,disabled:s.bool,loading:s.bool,onCancel:s.func,formValues:s.object.isRequired};vt.defaultProps={disabled:!1,loading:!1,onCancel:()=>{}};function vt({item:e,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,disabled:i,loading:h,onCancel:c,formValues:p}){var T;const{key:x,description:g,required:l,solo:R=!1,hidden:y=!1,componentProps:d={},skipButtonDisabled:w=!1}=e;if(y)return null;const S=o(x),{editing:k,shaking:j}=S??{},f=n(e,{editing:k}),u=Ws(e,{editing:k}),v={inputProps:{"data-cy":"schema-form-item-component"},key:x,description:g,editing:k,value:f,onChange:(b,N="change")=>a(e,b,N),componentProps:d,skipButtonDisabled:w,onBlur:()=>r(e)};return e.componentType==="collapse"&&((T=e.children)==null?void 0:T.length)>0?t.jsxs(fs,{children:[t.jsx(hs,{expandIcon:t.jsx(gs,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(xs,{children:e.children.map(b=>t.jsx(vt,{item:b,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,formValues:p,disabled:i,loading:h,onCancel:c},b.key))})]}):t.jsxs(C,{className:"form-item",children:[!R&&t.jsxs(C,{className:"form-item-label",sx:{color:l&&!f?"error.main":"text.secondary"},children:[g,l&&t.jsx(dt,{})]}),t.jsxs(C,{className:"form-item-body",children:[t.jsx(C,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{i||S!=null&&S.edited||w||a(e,p[x],"edit")},children:t.jsx(u,{...v})}),!R&&t.jsx(C,{className:"form-item-action",style:{marginLeft:0},children:k?t.jsxs(t.Fragment,{children:[S.edited?t.jsx(ee,{"data-cy":"schema-form-item-confirm",onClick:()=>{a(e,f,"confirm")},disabled:i||h,sx:{animation:j?`${Fs} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:h?t.jsx(ue,{size:24}):t.jsx(ms,{})}):null,t.jsx(ee,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:S.edited?4:8},disabled:i||h,size:"large",children:t.jsx(Ko,{})})]}):null})]})]},x)}function sn({schema:e,loading:o,value:n,defaultValue:a,onChange:r,style:i,disabled:h}){const c=Object.prototype.toString.call(n)==="[object Object]",[p,x]=m.useState([]),[g,l]=m.useState(c?n:a),R=m.useMemo(()=>e.length===1,[e]),y=m.useCallback(u=>p.find(v=>v.key===u),[p]);m.useEffect(()=>{var u;R&&((u=e[0])!=null&&u.required)&&x([{key:e[0].key,editing:!0,initialValue:a[e[0].key]}])},[e,R,a]);const d=m.useCallback(u=>{x(v=>v.find(b=>b.key===u.key)?v.map(b=>b.key===u.key?u:{...b}):[u].concat(v))},[]),w=m.useCallback((u,v,T)=>{const{key:b,secure:N}=u,O=y(b)??{...u};O.editing=!0;const Y=g[b]!==v;O.edited=v&&O.initialValue!==v,O.initialValue=a[b];const U={...g,[b]:v};Y&&l(U),r({[b]:v},{allValues:U,action:T,currentItem:u}),T==="confirm"&&N&&l({...g,[b]:"__encrypted__"}),T==="confirm"&&(O.initialValue=g[b]),["confirm","cancel"].includes(T)&&(O.editing=!1,O.edited=!1),d(O)},[a,g,r,d,y]),S=m.useCallback((u,{editing:v=!1})=>{const{key:T}=u,b=c?n[T]:g[T];return b==="__encrypted__"?v?"":"******":b},[c,n,g]),k=m.useCallback(u=>{const v=y(u.key);v&&w(u,v.initialValue,"cancel")},[y,w]),j=m.useCallback(u=>{const v=y(u.key);!v||!v.edited||(v.shaking=!0,d(v),setTimeout(()=>{v.shaking=!1,d(v)},500))},[y,d]),f=m.useCallback(u=>{const v=y(u.key);!v||!v.edited?k(u):j(u)},[y,j,k]);return t.jsx(zs,{className:"form",style:i,children:e==null?void 0:e.map(u=>{const{hidden:v=!1}=u;return v?null:t.jsx(vt,{item:u,findEditingItem:y,getItemValue:S,onFormItemChange:w,onFocusOut:f,formValues:g,disabled:h,loading:o,onCancel:k})})})}sn.propTypes={schema:s.array.isRequired,loading:s.bool,onChange:s.func.isRequired,value:s.object,defaultValue:s.object,style:s.object,disabled:s.bool};sn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const zs=M(Ar)``;function an({meta:e,onCancel:o,mode:n,handlePaySuccess:a}){const{t:r,locale:i}=G(),{info:h}=Q(),c=Ho(h),[p,x]=m.useState(null),g=new URL(e==null?void 0:e.registryUrl).origin,l=B.getDisplayName({meta:e}),R=async(d,w)=>{const S=({downloadTokenList:f})=>{a({downloadTokenList:f})},k=f=>{L.error(f),o(f)};function j(f){return Zo(()=>Jn.get(f).then(async({data:u})=>{const v=u==null?void 0:u.downloadTokenList;if(u.status==="succeed"){if(v&&v.length)await S({downloadTokenList:v});else return await k(r("blocklet.component.missDownloadTokenTip")),!0;return!0}return u.status==="error"?(console.error("vc error: ",u),await k(u==null?void 0:u.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&p){const{statusUrl:f}=Xo(p);await j(f)}else await S({downloadTokenList:d.downloadTokenList&&w(d.downloadTokenList)})};if(m.useEffect(()=>{if(n==="purchase"){const d=new URL(g);d.pathname="/api/did/verify-purchase-blocklet/token",d.searchParams.set("serverDid",h.did),d.searchParams.set("blockletDid",e==null?void 0:e.did);try{Jn.get(d.href).then(({data:w})=>{const S=`${w.url}`;x(S)})}catch(w){console.error("get next workflow url error: ",w)}}return()=>{x(null)}},[n]),n==="purchase"&&!p)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Wn.create({baseURL:g}).get,extraParams:{serverDid:h.did,blockletDid:e==null?void 0:e.did},messages:{title:r("store.purchase.verify.auth.title",{name:l}),scan:r("store.purchase.verify.auth.scan"),confirm:r("store.purchase.verify.auth.confirm"),success:r("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Wn.create({baseURL:gt(g,"/store")}).get,extraParams:{factory:e.nftFactory,nw:p},messages:{title:r("store.purchase.auth.title",{name:l}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:r("store.purchase.auth.success")}),t.jsx("p",{children:r("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return t.jsx(Qo,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:R,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}an.propTypes={...zr,handlePaySuccess:s.func,mode:s.oneOf(["verify","purchase"]).isRequired};an.defaultProps={handlePaySuccess:()=>{}};const ln=m.forwardRef(({mode:e,...o},n)=>{const[a,r]=m.useState(e!=="both"?e:"verify"),[i,h]=m.useState(e!=="both"?2:1),c=x=>{x!==a&&r(x)},p=()=>{a&&i!==2&&h(2)};return m.useImperativeHandle(n,()=>({onNext:p,getCurrentStep:()=>i})),i===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(Vr,{action:a,onNext:null,onSelect:c})}):t.jsx(an,{...o,mode:a})});ln.propTypes={mode:s.oneOf(["both","verify","purchase"]).isRequired,ref:s.any};ln.defaultProps={ref:{}};const Vs=ln;function Ys({...e}){return t.jsx(de,{className:"bottom-button",variant:"contained",color:"primary",...e})}function cn({blocklet:e,onStartNow:o,children:n,disabled:a}){const{t:r}=G(),i=So();return!e||Jo(e.meta)?t.jsx(Ks,{children:n}):t.jsxs(Hs,{isMobile:i,children:[t.jsx(Ys,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:r("setup.startNow")}),t.jsx(C,{display:"flex",alignItems:"center",children:n})]})}cn.propTypes={blocklet:s.object,onStartNow:s.func,children:s.any,disabled:s.bool};cn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Ks=M(C)`
|
|
79
|
-
width: 100%;
|
|
80
|
-
margin-top: auto;
|
|
81
|
-
padding-top: 24px;
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
.bottom-button {
|
|
86
|
-
min-width: 200px;
|
|
87
|
-
}
|
|
88
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
89
|
-
.bottom-button {
|
|
90
|
-
width: 100%;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`,Hs=M(C)`
|
|
94
|
-
padding-top: 24px;
|
|
95
|
-
margin-top: auto;
|
|
96
|
-
width: 100%;
|
|
97
|
-
display: flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
justify-content: space-between;
|
|
100
|
-
.start-now {
|
|
101
|
-
min-width: 140px;
|
|
102
|
-
}
|
|
103
|
-
.bottom-button {
|
|
104
|
-
min-width: 120px;
|
|
105
|
-
}
|
|
106
|
-
${e=>e.theme.breakpoints.down("lg")} {
|
|
107
|
-
width: 100%;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
111
|
-
.start-now {
|
|
112
|
-
min-width: inherit;
|
|
113
|
-
}
|
|
114
|
-
.bottom-button {
|
|
115
|
-
min-width: 100px;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
${e=>e.isMobile} {
|
|
120
|
-
justify-content: space-between;
|
|
121
|
-
gap: '32px',
|
|
122
|
-
}}
|
|
123
|
-
`;function dn({blockletMeta:e,onEndpointUpdate:o}){var c;const n=So(),{blocklet:a}=pe(),{updateSpaceGateway:r,loading:i,hasStorageEndpoint:h}=ss();return m.useEffect(()=>{o==null||o()},[a]),i?t.jsx(er,{relative:"parent",children:t.jsx(ue,{})}):t.jsxs(Qs,{children:[t.jsx(C,{width:n?"360px":"720px",children:h?t.jsx(is,{}):t.jsx(as,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&t.jsx(cn,{mt:8,children:t.jsx(ls,{onConnect:r})})]})}dn.propTypes={blockletMeta:s.any.isRequired,onEndpointUpdate:tr.func};dn.defaultProps={onEndpointUpdate:()=>{}};const Qs=M(ds)`
|
|
124
|
-
height: 100%;
|
|
125
|
-
overflow-y: auto;
|
|
126
|
-
padding-bottom: 32px;
|
|
127
|
-
overflow-x: hidden;
|
|
128
|
-
`;function un({onChange:e,loading:o,children:n,extra:a,stores:r,storageKey:i}){const{t:h}=G(),{info:c,inService:p}=Q(),{blocklet:x}=pe(),[g,l]=m.useState(!1),R=m.useRef(null),[y,d]=m.useState(),[w,S]=ws(i||"tmp"),[k,j]=i?[w,S]:[y,d],{storeList:f,teamDid:u}=po({fromBlocklet:p,blocklet:x,nodeInfo:c}),v=mo([...r.map(b=>({...b,protected:!0})),...f],"url"),T=k&&v.find(b=>k===b.url)||v[0];return t.jsxs(t.Fragment,{children:[t.jsxs(Xs,{children:[t.jsx(de,{ref:R,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(Ss,{color:"primary"}),onClick:()=>{l(!0)},style:{padding:"0 2px"},children:t.jsx(te,{color:"primary",children:T.name})}),t.jsx(te,{color:"primary",children:a})]}),t.jsxs(X,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:h("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:T,autoFocus:!0,onChange:b=>{const N=b.target.value;j(N.url),e(N)},SelectProps:{open:g,MenuProps:{anchorEl:R.current},renderValue:b=>b==null?void 0:b.name,onClose:()=>{l(!1)}},style:{display:"none"},margin:"normal",children:[v==null?void 0:v.map(b=>t.jsx(be,{sx:{width:"400px",maxWidth:"90vw"},value:b,"data-cy":b.url,children:t.jsx(Yr,{teamDid:u,store:b,onDelete:()=>{var N;k===b.url&&j((N=v[0])==null?void 0:N.url)}})},b.url)),!Kt.isInServerlessMode(c)&&t.jsx(Kr,{disabled:o,storeList:v,teamDid:u,onAdd:b=>{j(b)}})]}),n({currentRegistry:T})]})}un.propTypes={onChange:s.func,loading:s.bool,children:s.any.isRequired,extra:s.node,storageKey:s.string,stores:s.arrayOf(s.shape({name:s.string.isRequired,url:s.string.isRequired}))};un.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Xs=M.div`
|
|
129
|
-
display: flex;
|
|
130
|
-
justify-content: space-between;
|
|
131
|
-
align-items: center;
|
|
132
|
-
margin-bottom: 16px;
|
|
133
|
-
|
|
134
|
-
span {
|
|
135
|
-
font-size: 16px;
|
|
136
|
-
color: ${e=>e.theme.palette.text.primary};
|
|
137
|
-
// font-weight: bold;
|
|
138
|
-
}
|
|
139
|
-
`,Zs={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},Js={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},ei={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},ti=(e,o)=>gt(o,`/blocklets/${e.did}`),so=({blocklet:e,attribute:o,value:n})=>e._formatted?e._formatted[o]:n,ni=e=>e.inStore&&B.isFreeBlocklet(e)===!1;function pn({blocklet:e,blocklets:o,handleButtonClick:n,endpoint:a,serverVersion:r}){var S,k;const{t:i}=G();let h=gt(a,ar(e.did,e.logo||""));try{const j=new URL(h);j.searchParams.set("v",e.version||+new Date),h=j.href}catch{}const[c,p]=m.useState(!1),x=async()=>{try{p(!0),await n({meta:e,registryUrl:a,blocklets:o})}catch(j){L.error(j.message)}finally{p(!1)}},{blocklet:g}=pe(),l=()=>((g==null?void 0:g.children)||[]).find(u=>u.meta.bundleDid===e.did).meta.version,y=(()=>{const j=((g==null?void 0:g.children)||[]).find(f=>f.meta.bundleDid===e.did);if(j){try{const f=j.meta.version,u=e.version;if(lr.gt(u,f))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),d=(S=e.requirements)==null?void 0:S.server,w=[];return y==="upgrade"?w.push({key:"upgrade",icon:t.jsx(J,{icon:ei,color:"success.light",width:20,height:20},"version"),title:`${l()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(C,{sx:{fontWeight:"bold"},children:i("blocklet.component.upgradeAvailable")})}):y==="disable"?w.push({key:"disable",icon:t.jsx(J,{icon:Zs,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:i("blocklet.component.installed")}):ni(e)&&w.push({key:"purchase",icon:t.jsx(J,{icon:Js,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:i("blocklet.component.needBuy")}),t.jsx(oi,{title:so({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:so({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?h:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:x,icons:(k=e.docker)!=null&&k.image?[{key:"docker",icon:t.jsx(C,{display:"flex",color:"primary.main",children:t.jsx(J,{icon:jo})}),title:i("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:i("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:w,button:t.jsx(Qr,{serverVersion:r,requirementVersion:d,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Xr,{children:t.jsx(de,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:j=>{j.preventDefault(),j.stopPropagation();const f=ti(e,a);f&&window.open(f,"_blank","noopener,noreferrer")},children:i("common.detail")},e.did)})})})})}pn.propTypes={blocklet:s.object.isRequired,blocklets:s.array,handleButtonClick:s.func,endpoint:s.string,serverVersion:s.string};pn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function mn({handleButtonClick:e,handleSearchSelect:o,storeUrl:n,handleBlockletRender:a,extraFilter:r,serverVersion:i,resourceType:h,resourceDid:c,showResourcesSwitch:p,showCategory:x,compact:g,...l}){const R=ft(),{locale:y}=G(),[d,w]=m.useState(!1),[S,k]=m.useState({}),j=v=>{k(v)},f=n,u=m.useMemo(()=>nr(R,{palette:{background:{default:R.palette.background.paper}}}),[R]);return m.useEffect(()=>{k({showResources:!0,resourceType:h,resourceDid:c})},[f,h,c]),m.useEffect(()=>{w(!0),k({showResources:!0,resourceType:h,resourceDid:c})},[]),t.jsx(or,{theme:u,children:t.jsx(rr,{FallbackComponent:sr,resetKeys:[f],children:t.jsxs(C,{...l,sx:ir({overflow:"auto",".title-bar + div":{height:"unset"}},l.sx),children:[d&&t.jsx(Hr,{showCategory:x,showResourcesSwitch:p,blockletRender:v=>{const T={...v,handleButtonClick:e,endpoint:f};return a({...v,defaultRender:t.jsx(pn,{...T})})},compact:g,minItemWidth:300,baseSearch:!0,endpoint:f,locale:y,onFilterChange:j,onSearchSelect:o,filters:S,extraFilter:r,serverVersion:i,fetchCategoryDelay:500}),t.jsx(C,{sx:{mt:2},children:" "})]})})})}mn.propTypes={storeUrl:s.string.isRequired,handleButtonClick:s.func,handleSearchSelect:s.func,handleBlockletRender:s.func,extraFilter:s.func,serverVersion:s.string,resourceType:s.string,resourceDid:s.string,showResourcesSwitch:s.bool,showCategory:s.bool,compact:s.bool};mn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const oi=M(Zr)`
|
|
140
|
-
.ms-highlight {
|
|
141
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
142
|
-
}
|
|
143
|
-
`,fn=m.forwardRef(({meta:e,isMobile:o,onStepChange:n},a)=>{const r=ft(),{steps:i,activeStep:h,setActiveStepByKey:c,setActiveStepByIndex:p}=ts(),{t:x,locale:g}=G(),l=i[h];return m.useEffect(()=>{n(h)},[n,h]),m.useImperativeHandle(a,()=>({setActiveStepByKey:c,setActiveStepByIndex:p})),t.jsx(si,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:t.jsx(ns,{locale:g,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?cr({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:r,stepTip:x("blocklet.component.add"),children:t.jsx(ri,{children:typeof(l==null?void 0:l.body)=="function"?l.body():l==null?void 0:l.body})})})});fn.propTypes={meta:s.any,onStepChange:s.func.isRequired,isMobile:s.bool.isRequired};fn.defaultProps={meta:null};const io=e=>e.isMobile?`
|
|
144
|
-
height: calc(100vh - 56px - 64px - 48px);
|
|
145
|
-
`:"",ri=M.div`
|
|
146
|
-
width: 100%;
|
|
147
|
-
height: 100%;
|
|
148
|
-
display: flex;
|
|
149
|
-
flex-direction: column;
|
|
150
|
-
justify-content: flex-start;
|
|
151
|
-
align-items: flex-start;
|
|
152
|
-
|
|
153
|
-
.bottom-button {
|
|
154
|
-
min-width: 200px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// blocklet-select-side
|
|
158
|
-
aside {
|
|
159
|
-
width: 140px;
|
|
160
|
-
}
|
|
161
|
-
`,si=M(C)`
|
|
162
|
-
${({className:e})=>e==="mobileStyle"?`
|
|
163
|
-
& > div{
|
|
164
|
-
height: 100%;
|
|
165
|
-
}
|
|
166
|
-
.root-header {
|
|
167
|
-
.app-name-content {
|
|
168
|
-
display: none;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// content-panel
|
|
173
|
-
.root-header + div{
|
|
174
|
-
padding-top: 0;
|
|
175
|
-
position: relative;
|
|
176
|
-
& > div {
|
|
177
|
-
padding-top: 0;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
header + div {
|
|
182
|
-
padding-top: 0;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
header {
|
|
186
|
-
.header-title {
|
|
187
|
-
margin-left: 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.header-title-name {
|
|
191
|
-
max-width: 100% !important;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
.app-content {
|
|
195
|
-
padding: 0!important;
|
|
196
|
-
}
|
|
197
|
-
`:`
|
|
198
|
-
position: relative;
|
|
199
|
-
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
200
|
-
width: 100%;
|
|
201
|
-
height: 100%;
|
|
202
|
-
border-radius: 0;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.root-header {
|
|
206
|
-
z-index: auto !important;
|
|
207
|
-
position: fixed !important;
|
|
208
|
-
}
|
|
209
|
-
& > div {
|
|
210
|
-
height: 100%;
|
|
211
|
-
width: 100%;
|
|
212
|
-
max-width: 100%;
|
|
213
|
-
& > div {
|
|
214
|
-
max-height: unset !important;
|
|
215
|
-
max-width: 100%;
|
|
216
|
-
& > div {
|
|
217
|
-
// left-panel
|
|
218
|
-
&:first-of-type {
|
|
219
|
-
padding: 0;
|
|
220
|
-
width: 20%;
|
|
221
|
-
min-width: 180px;
|
|
222
|
-
|
|
223
|
-
& > div:first-of-type {
|
|
224
|
-
display: none;
|
|
225
|
-
}
|
|
226
|
-
// step
|
|
227
|
-
& > div:last-child {
|
|
228
|
-
// margin-top: 32px;
|
|
229
|
-
margin-top: 0;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
// right-panel
|
|
233
|
-
&:last-child {
|
|
234
|
-
padding-top: 0;
|
|
235
|
-
padding-right: 0px;
|
|
236
|
-
overflow-y: hidden;
|
|
237
|
-
.app-content {
|
|
238
|
-
padding: 0 0 24px 0;
|
|
239
|
-
}
|
|
240
|
-
.button-container {
|
|
241
|
-
padding-right: 0;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
`}
|
|
249
|
-
|
|
250
|
-
& .ll-container {
|
|
251
|
-
background: ${({theme:e})=>e.palette.background.paper};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
& .app-overview {
|
|
255
|
-
margin-left: 0 !important;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
& .flex-justify-center {
|
|
259
|
-
display: flex;
|
|
260
|
-
justify-content: center;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
& .flex-align-center {
|
|
264
|
-
display: flex;
|
|
265
|
-
height: 100%;
|
|
266
|
-
align-items: center;
|
|
267
|
-
${e=>io(e)}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
& .agreement-wrapper {
|
|
271
|
-
${e=>io(e)}
|
|
272
|
-
max-height: 60vh;
|
|
273
|
-
.eula-trigger {
|
|
274
|
-
padding-right: 0;
|
|
275
|
-
}
|
|
276
|
-
.next-button {
|
|
277
|
-
display: none;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
& .connect {
|
|
282
|
-
background: white;
|
|
283
|
-
}
|
|
284
|
-
`,ii=fn,ai=e=>e.inStore&&B.isFreeBlocklet(e)===!1,li=e=>{var o;return[H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=e==null?void 0:e.capabilities)==null?void 0:o.didSpace)},$t=e=>{var o,n;return((n=(o=e==null?void 0:e.configs)==null?void 0:o.find(a=>a.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},ci=e=>(e.environments||[]).some(o=>o.required),ao=(e,o)=>e==null?void 0:e.some(n=>n.required&&!o[n.key]),di=({params:e,blocklet:o,t:n})=>{const a=e.title||e.name;return a?((o==null?void 0:o.children)||[]).find(i=>i.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:a}):n("blocklet.component.addNext",{name:a}):n("common.next")},lo=({componentDid:e,timeout:o=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},o)};function hn({onClose:e,mode:o,stores:n,resourceType:a,resourceDid:r,storageKey:i,inDialog:h,selectedMeta:c,storeUrl:p,showResourcesSwitch:x,showFromUrl:g,enableRunBackground:l,showCategory:R,installFromUrlParams:y}){var Un,Dn,Nn,Ln,Je,Bn,et,On,$n,Mn;const{t:d,locale:w}=G(),[S,k]=m.useState(!1),[j,f]=m.useState(null),[u,v]=m.useState(""),[T,b]=m.useState(""),{api:N,ws:{useSubscription:O},inService:me,info:Y}=Q(),{blocklet:U,actions:{refreshBlocklet:Re}}=pe(),[Z,Ue]=m.useState(null),[De,fe]=m.useState(!1),Se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[I,z]=m.useState(Se),[K,we]=m.useState(0),F=m.useRef({}),je=m.useRef({}),ae=m.useRef({}),E=fo(P=>P.breakpoints.down("md")),V=dr(),[ne,Te]=m.useState(!0),{meta:A}=F.current,Ne=us(A),le=m.useRef(!1),W=P=>z(_=>({..._,...P}));m.useEffect(()=>{if(I.pathPrefix){const{errMsg:P}=_n({...I,pathPrefix:I.pathPrefix,locale:w});v(P)}},[I.pathPrefix]),m.useEffect(()=>{K===0&&z(Se)},[K]);const Pe=()=>{const P=$t(U)??"";W({didSpaceEndpoint:P})},Ge=()=>{var P;return(P=F==null?void 0:F.current)!=null&&P.meta?B.getDisplayName(F.current):""},Le=()=>{k(!1),z({}),le.current=!1,F.current={},e()},Et=P=>{const _=$=>{W({installResultProps:{variant:"error",title:Ge(),subTitle:P,footer:t.jsx(de,{className:"bottom-button",disabled:$,"data-cy":"retry-install-component",onClick:async()=>{_(!0),await In(F.current.installInput)},children:t.jsxs(C,{display:"flex",alignItems:"center",children:[$&&t.jsx(ue,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};_()},Ze=P=>_=>{var $,q;((($=_==null?void 0:_.meta)==null?void 0:$.did)||(_==null?void 0:_.meta))===((q=U==null?void 0:U.meta)==null?void 0:q.did)&&P(_)},Do=()=>{lo({timeout:0,componentDid:V.componentDid,manual:!0}),Le(),setTimeout(()=>{const P=document.getElementsByClassName("dashboard-main")[0];P&&(P.scrollTop=P.scrollHeight)},200)};O(H.BlockletEvents.componentInstalled,Ze(()=>{W({installResultProps:{variant:"success",title:Ge(),subTitle:d("blocklet.component.installSuccessTip")}}),lo({componentDid:V.componentDid})}),[(Un=U==null?void 0:U.meta)==null?void 0:Un.did]),O(H.BlockletEvents.statusChange,Ze(()=>{const P=$t(U);W(_=>({..._,didSpaceEndpoint:P}))}),[(Dn=U==null?void 0:U.meta)==null?void 0:Dn.did]),O(H.BlockletEvents.downloadFailed,Ze(()=>{le.current=!1,Et(d("blocklet.component.installComponentError"))}),[(Nn=U==null?void 0:U.meta)==null?void 0:Nn.did]),O(H.BlockletEvents.installFailed,Ze(()=>{le.current=!1,Et(d("blocklet.component.installComponentError"))}),[(Ln=U==null?void 0:U.meta)==null?void 0:Ln.did]);const ce=[],kn=P=>((U==null?void 0:U.children)||[]).find(_=>_.meta.did===P),In=async P=>{var Oe,$e;le.current=!0;const{pathPrefix:_,bundleDid:$,title:q,componentName:ke="",componentDid:Be=""}=I,Ie=((Oe=F.current)==null?void 0:Oe.meta)||{},{configs:ve=[],registryUrl:Ee,inStore:ze,inputUrl:Ve,dist:kt}=Ie,Ye=($e=F.current)==null?void 0:$e.downloadTokenList,re=Ve||(ze?zn(Ee,$,kt):"");k(!0);const tt={rootDid:U.meta.did,url:re,mountPoint:_?ye(_):`/${ye(Ie.title||Ie.name)}`,title:q,name:ke,did:Be,dist:{tarball:"",integrity:""},onlyRequired:!ne,...I.hasEnvironmentsStep&&ve.length>0?{configs:ve.map(ge=>({...ge,value:I.configsValue[ge.key]||""}))}:{},...Ye?{downloadTokenList:Ye}:{},...P};try{if(await N.installComponent({input:tt}),Ee){const{teamDid:ge,storeList:Me}=po({fromBlocklet:me,nodeInfo:Y,blocklet:U}),{isNew:It,decoded:nt}=mr(Ee,Me);It&&await N.addBlockletStore({input:{teamDid:ge,url:nt}})}W({installResultProps:{}}),Re({showError:!1,attachRuntimeInfo:!1})}catch(ge){const Me=ie(ge);L.error(Me),console.error("installComponent error: ",ge),Et(Me)}finally{k(!1),F.current.installInput=tt}},_n=P=>{const _=Ro({params:{...P,did:P.bundleDid},blocklets:[U],blocklet:U,locale:w});if(_){const $=kn(P.bundleDid),q=Rs({params:{...P,did:P.bundleDid},blocklet:U});if($&&$.mountPoint===q)return{errMsg:""}}return{errMsg:_}},he=async P=>{var $,q;const{errMsg:_}=_n({...I,locale:w});v(_),K===ce.length-2&&!le.current&&await In(P),(q=($=je.current)==null?void 0:$.setActiveStepByIndex)==null||q.call($,ke=>ke+1)},We=()=>{var P,_;(_=(P=je.current)==null?void 0:P.setActiveStepByIndex)==null||_.call(P,$=>$-1)},No=()=>{const{pathPrefix:P,bundleDid:_,title:$,componentName:q="",componentDid:ke=""}=I,{meta:Be={}}=F.current||{},{registryUrl:Ie,inStore:ve,inputUrl:Ee,dist:ze}=Be,Ve=ve?zn(Ie,_,ze):Ee;Ue({meta:Be,installOpts:{type:"component",rootDid:U.meta.did,mountPoint:P,url:Ve,title:$,name:q,did:ke}})},Lo=P=>{fe(!1),W({purchaseResultProps:{variant:"error",title:Ge(),subTitle:P,style:{paddingTop:120},footer:t.jsx(de,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{W({purchaseResultProps:{}})},children:d("common.retry")})}})},Bo=({downloadTokenList:P})=>{F.current.downloadTokenList=P,fe(!1),he()},Pt=({chooseParams:P=F.current,componentDid:_,isInit:$=!1})=>{var nt,An,qn,Fn;const{meta:q,registryUrl:ke,inStore:Be,inputUrl:Ie}=P,{did:ve,title:Ee,name:ze}=q,Ve=(((nt=U.settings)==null?void 0:nt.children)||[]).filter(se=>se.status==="deleted"&&se.meta.bundleDid===ve),kt=_||"",Ye=(An=q.environments)==null?void 0:An.map(se=>{const{name:_t,validation:ot,...rt}=se,Ut={validation:fr(ot)?"":ot};return{...rt,key:_t,...Ut}});F.current={...P,meta:{...q,configs:Ye,registryUrl:ke,inStore:Be,inputUrl:Ie}};let re={};if($){const se=[U],_t=Ye||[],ot=[],rt=mo(pr([..._t,...ot]),"key").filter(Ae=>!!Ae.key).sort((Ae,st)=>Ae.required&&!st.required?-1:st.required&&!Ae.required?1:0),Ut=B.getSharedConfigObj(se[0],{configs:rt}),Dt={},Gn=rt.map(Ae=>{const{default:st,key:it,...$o}=Ae;return Dt[it]=Ut[it]||st,{...$o,key:it,hidden:!!H.BLOCKLET_CONFIGURABLE_KEY[it]}});re={...re,configsList:Gn,configsValue:Dt,hasMissRequiredConfigs:ao(Gn,Dt)}}const tt=U.children.some(se=>se.mountPoint==="/"),Oe=Ve.find(se=>se.meta.bundleDid===ve),$e=U.children.find(se=>se.meta.bundleDid===ve);re.title=Ee||"",Oe?re={...re,pathPrefix:Oe.mountPoint||"",componentName:Oe.meta.name,hasEnvironmentsStep:!1}:$e?re={...re,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:re={...re,pathPrefix:tt?`/${ye(Ee)||ye(ze)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Fn=(qn=F.current.meta)==null?void 0:qn.environments)==null?void 0:Fn.length)>0};const ge=ai(F.current.meta),Me=li(F.current.meta),It=$t(U);W({bundleDid:ve,componentDid:kt,...re,hasRequiredEnvironments:ci(F.current.meta),requirePurchase:ge,didSpaceIsRequiredSetup:Me,didSpaceEndpoint:It}),$&&ge&&No()};m.useEffect(()=>{if(!c&&!(y!=null&&y.meta)||K!==0||!U)return;const{meta:P,inputUrl:_="",inStore:$=!0,registryUrl:q=""}=y||{};Pt({chooseParams:{blocklets:[c||P],meta:c||P,registryUrl:q||p||c.homepage,inStore:$,inputUrl:_},isInit:!0}),W({showFromUrlDialog:!1}),he()},[c,K,U,y]),ce.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:t.jsxs(_e,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[g&&I.showFromUrlDialog&&t.jsx(bo,{mode:"component",onCancel:()=>{W({showFromUrlDialog:!1})},onSuccess:({meta:P,inputUrl:_,inStore:$,registryUrl:q})=>{Pt({chooseParams:{meta:P,inputUrl:_,inStore:$,registryUrl:q},isInit:!0}),W({showFromUrlDialog:!1}),he()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),t.jsx(un,{stores:n,extra:Kt.isInServerlessMode(Y)?null:g?t.jsxs(de,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{W({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Ht,{style:{fontSize:20,marginRight:4}}),d("blocklet.component.addComponentTip.fromUrl")]}):null,loading:S,onChange:()=>{z({}),F.current={}},storageKey:i,children:({currentRegistry:P})=>t.jsx(mn,{showResourcesSwitch:x,showCategory:R,serverVersion:Y==null?void 0:Y.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:P.url,resourceType:a,resourceDid:r,handleButtonClick:_=>{Pt({chooseParams:{..._,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:_,defaultRender:$})=>{const q=(I==null?void 0:I.bundleDid)&&(I==null?void 0:I.bundleDid)===(_==null?void 0:_.did);return t.jsxs(pi,{children:[t.jsx(C,{className:q?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...q?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:$}),q&&t.jsx(C,{className:"check-container",children:t.jsx(ur,{className:"check-icon"})})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:di({params:I,blocklet:U,t:d}),onCancel:Le,onConfirm:()=>{he()}}),ce.push({key:"agreement",name:d("launchBlocklet.introduction"),body:t.jsxs(_e,{component:"div",className:"agreement-wrapper",children:[t.jsx(vo,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),A?t.jsx(ps,{meta:A,onClickNext:he,installRelated:ne,onChangeInstallRelated:Te,handleDescEle:t.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:d("common.pre"),disabled:!Ne,confirm:d(Ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Le:We,onConfirm:()=>{fe(!1),he()}}),A&&I.requirePurchase&&ce.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[d("common.verifyNFT"),t.jsx(dt,{})]}),body:t.jsxs(_e,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Bn=(Je=ae.current)==null?void 0:Je.getCurrentStep)==null?void 0:Bn.call(Je))===2||De)&&t.jsx(ct,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),at(I.purchaseResultProps)?Z&&t.jsx(Vs,{ref:ae,meta:Z.meta,mode:I.componentDid?"verify":"both",onCancel:Lo,installOpts:Z.installOpts,handlePaySuccess:Bo}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(Zn,{...I.purchaseResultProps})})]}),disabled:((On=(et=ae.current)==null?void 0:et.getCurrentStep)==null?void 0:On.call(et))===2||De,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof ae.current.onNext=="function"&&(ae.current.onNext(),fe(!0))},onCancel:()=>{We()}}),B.hasStartEngine(A)&&ho.hasMountPoint(A)?ce.push({key:"config",name:d("common.config"),error:u,body:t.jsxs(_e,{component:"div",children:[t.jsx(ct,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),t.jsx(X,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:T||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:I.pathPrefix,onChange:P=>{const _=P.target.value;W({pathPrefix:_}),b(d("common.slugifyHint",{value:zt(_)}))}}),!!u&&t.jsx(Mt,{severity:"error",style:{width:"100%",marginTop:8},children:u})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:We,onConfirm:()=>{he()}}):A&&(I.pathPrefix=((Mn=($n=A.interfaces)==null?void 0:$n[0])==null?void 0:Mn.path)||`/${A.did}`),A&&(I!=null&&I.hasEnvironmentsStep)&&ce.push({key:"environment",name:t.jsxs(t.Fragment,{children:[d("common.environment")," ",I.hasRequiredEnvironments&&t.jsx(dt,{})]}),disabled:!!j||(I==null?void 0:I.hasMissRequiredConfigs),body:()=>t.jsxs(_e,{component:"div",style:{overflowY:"auto"},children:[t.jsx(ct,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),t.jsx(sn,{style:{marginTop:-12,width:"100%"},schema:I.configsList,defaultValue:I.configsValue,onChange:(P,{action:_,currentItem:$,allValues:q})=>{_==="confirm"&&W({hasMissRequiredConfigs:ao(I.configsList,q),configsValue:q}),_==="edit"?f($):["cancel","confirm"].includes(_)&&f(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:We,onConfirm:he}),A&&(I!=null&&I.didSpaceIsRequiredSetup)&&ce.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",I.didSpaceIsRequiredSetup==="required"&&t.jsx(dt,{})]}),disabled:(I==null?void 0:I.didSpaceIsRequiredSetup)&&!I.didSpaceEndpoint,body:()=>t.jsx(cs,{children:t.jsxs(_e,{component:"div",children:[t.jsx(ct,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),t.jsx(C,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(dn,{blockletMeta:F.current.meta,onNext:()=>{he()},onEndpointUpdate:Pe})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:We,onConfirm:he}),ce.push({key:"install",name:kn(A==null?void 0:A.did)?d("common.upgrade"):d("common.install"),disabled:l?!1:at(I.installResultProps),loading:l?!1:at(I.installResultProps),body:t.jsx(_e,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:at(I.installResultProps)?t.jsx(os,{message:t.jsx(mi,{children:d(l?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(Zn,{...I.installResultProps})})}),confirm:d("common.complete"),onConfirm:Do});const oe=ce[K]||{},Oo=()=>S||oe.error||!I.bundleDid?!0:K>1?!I.pathPrefix:!1;return U?t.jsxs(ui,{sx:h?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(rs,{steps:ce,mode:"memory",children:t.jsx(ii,{ref:je,meta:A,isMobile:E,onStepChange:P=>{we(P)}})}),t.jsxs(C,{className:"action-bar",children:[oe.cancel&&t.jsx(de,{onClick:P=>{P.stopPropagation(),oe.onCancel()},disabled:K===ce.length-2&&S,color:"inherit",children:oe.cancel||d("common.cancel")}),oe.confirm&&t.jsx(de,{onClick:P=>{P.stopPropagation(),oe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:S||(typeof oe.disabled=="boolean"?oe.disabled:Oo()),variant:"contained",autoFocus:!0,title:oe.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(C,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof oe.loading=="boolean"?oe.loading:S)&&t.jsx(ue,{style:{marginRight:8},size:16}),t.jsx(C,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oe.confirm})]})})]})]}):null}hn.propTypes={onClose:s.func,mode:s.oneOf(["normal","embed"]),inDialog:s.bool,stores:s.arrayOf(s.string),storeUrl:s.string,resourceType:s.string,resourceDid:s.string,storageKey:s.string,selectedMeta:s.object,showResourcesSwitch:s.bool,showFromUrl:s.bool,enableRunBackground:s.bool,showCategory:s.bool,installFromUrlParams:s.object};hn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0,installFromUrlParams:null};const ui=M(C)`
|
|
285
|
-
.action-bar {
|
|
286
|
-
display: flex;
|
|
287
|
-
justify-content: flex-end;
|
|
288
|
-
position: sticky;
|
|
289
|
-
bottom: 0;
|
|
290
|
-
padding-top: 16px;
|
|
291
|
-
z-index: 100;
|
|
292
|
-
width: 100%;
|
|
293
|
-
background: ${({theme:e})=>e.palette.background.paper};
|
|
294
|
-
border-top: '1px solid';
|
|
295
|
-
border-color: ${({theme:e})=>e.palette.divider};
|
|
296
|
-
}
|
|
297
|
-
`,_e=M(te)`
|
|
298
|
-
width: 100%;
|
|
299
|
-
height: 100%;
|
|
300
|
-
`,ct=M(vo)`
|
|
301
|
-
margin-bottom: 24px;
|
|
302
|
-
`,pi=M.div`
|
|
303
|
-
position: relative;
|
|
304
|
-
|
|
305
|
-
.choose-blocklet {
|
|
306
|
-
background-color: rgb(236, 251, 253);
|
|
307
|
-
border-color: rgb(236, 251, 253);
|
|
308
|
-
border-radius: 8px;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.check-container {
|
|
312
|
-
position: absolute;
|
|
313
|
-
right: 0;
|
|
314
|
-
bottom: 0;
|
|
315
|
-
display: flex;
|
|
316
|
-
justify-content: flex-end;
|
|
317
|
-
align-items: flex-end;
|
|
318
|
-
width: 30px;
|
|
319
|
-
height: 30px;
|
|
320
|
-
border-radius: 0 0 8px 0;
|
|
321
|
-
color: ${e=>e.theme.palette.common.white};
|
|
322
|
-
overflow: hidden;
|
|
323
|
-
transition: all ease 0.3s;
|
|
324
|
-
&:after {
|
|
325
|
-
position: absolute;
|
|
326
|
-
z-index: 0;
|
|
327
|
-
display: block;
|
|
328
|
-
width: 0;
|
|
329
|
-
height: 0;
|
|
330
|
-
border-top: transparent solid 15px;
|
|
331
|
-
border-left: transparent solid 15px;
|
|
332
|
-
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
333
|
-
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
334
|
-
transition: all ease 0.1s;
|
|
335
|
-
content: '';
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.check-icon {
|
|
339
|
-
position: relative;
|
|
340
|
-
z-index: 2;
|
|
341
|
-
margin: 0 1px 1px 0;
|
|
342
|
-
font-size: 16px;
|
|
343
|
-
transition: all ease 0.2s;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
`,mi=M.div`
|
|
347
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
348
|
-
.msg-before {
|
|
349
|
-
display: inline-block;
|
|
350
|
-
color: #aaa;
|
|
351
|
-
font-size: 14px;
|
|
352
|
-
margin-right: 6px;
|
|
353
|
-
}
|
|
354
|
-
`;function bt({blocklet:e,showDialog:o,setShowDialog:n,selectedMeta:a,showFromUrl:r,installFromUrlParams:i}){const{t:h}=G(),c=fo(g=>g.breakpoints.down("md")),{inService:p}=Q(),x=()=>{n(!1)};return o?t.jsx(fi,{title:h("blocklet.component.addWithName",{name:B.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(g,l)=>{l!=="backdropClick"&&x()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(hn,{selectedMeta:a,onClose:x,storageKey:p?Jr:es,showFromUrl:r,installFromUrlParams:i})}):null}bt.propTypes={selectedMeta:s.object,showDialog:s.bool.isRequired,setShowDialog:s.func.isRequired,blocklet:s.object.isRequired,showFromUrl:s.bool,installFromUrlParams:s.object};bt.defaultProps={selectedMeta:null,showFromUrl:!0,installFromUrlParams:null};const fi=M(ht)`
|
|
355
|
-
.ux-dialog_header {
|
|
356
|
-
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
357
|
-
}
|
|
358
|
-
.MuiDialogContent-root {
|
|
359
|
-
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
360
|
-
}
|
|
361
|
-
`;function gn({blocklet:e,children:o,disabled:n}){var y;const{t:a}=G(),[r,i]=m.useState(!1),[h,c]=m.useState({show:!1,params:null}),{info:p}=Q(),x=d=>{d.stopPropagation(),i(!0)},g=m.useCallback(d=>{i(d),d||c({params:null,show:!1})},[]),l=()=>{c(d=>({...d,show:!0}))},R=m.useMemo(()=>{const d=[];return Kt.isInServerlessMode(p)||d.push(t.jsxs(Xn.Item,{"data-cy":"add-component-from-url",onClick:()=>l(),style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ht,{style:{fontSize:16,marginRight:4}}),a("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url")),d},[p,a]);return t.jsxs(t.Fragment,{children:[typeof o=="function"?o({open:x}):t.jsxs(Xn,{onClick:x,disabled:n,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:R,children:[t.jsx(Wr,{style:{fontSize:"1.3em",marginRight:4}}),a("blocklet.component.add")]}),t.jsx(bt,{showDialog:r,setShowDialog:g,blocklet:e,selectedMeta:((y=h.params)==null?void 0:y.meta)||null,installFromUrlParams:h.params,showFromUrl:!1}),h.show?t.jsx(bo,{mode:"component",onCancel:()=>{c(d=>({...d,show:!1}))},onSuccess:({meta:d,inputUrl:w,inStore:S,registryUrl:k})=>{c({show:!1,params:{meta:d,inputUrl:w,inStore:S,registryUrl:k}}),i(!0)},handleText:{title:a("blocklet.component.addComponentTip.fromUrl"),confirm:a("blocklet.component.choose")}}):null]})}gn.propTypes={children:s.any,blocklet:s.object.isRequired,disabled:s.bool};gn.defaultProps={children:null,disabled:!1};const hi=e=>e.children.filter(o=>o.meta.interfaces.find(n=>n.type===H.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:e,setParams:o,setError:n,serviceTypes:a}){const{t:r}=G(),{blocklet:i}=pe(),h=i.meta.did,c=hi(i),[p,x]=m.useState([]),g={301:r("common.redirectPermanently"),302:r("common.redirectTemporary"),307:r("common.redirectTemporary"),308:r("common.redirectPermanently")};return m.useEffect(()=>{if(e.type===D.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const l=c.find(d=>d.meta.did===e.componentId),R=B.findWebInterface(l.meta),y=(Array.isArray(R==null?void 0:R.pageGroups)?R.pageGroups:[]).map(d=>({value:d,label:`${d} pages`}));y.length&&y.unshift({value:"",label:"All pages"}),x(y),e.pageGroup&&y.find(d=>d.value===e.pageGroup)===!1&&o({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(X,{select:!0,label:r("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:l=>{n(""),o({...e,type:l.target.value,did:l.target.value===D.ROUTING_RULE_TYPES.BLOCKLET?h:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:l,value:R})=>t.jsx(be,{value:R,children:l},R))}),e.type===D.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(X,{select:!0,label:r("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:l=>o({...e,redirectCode:l.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(l=>t.jsx(be,{value:l,children:`${g[l]} - ${l}`},l))},"redirectCode"),t.jsx(X,{label:r("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{o({...e,url:l.target.value,__disableConfirm:!l.target.value.trim()}),l.target.value.trim()?n(""):n(r("router.validation.redirectUrlRequired"))}},"redirectUrl")],e.type===D.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(X,{select:!0,label:r("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:l=>{o({...e,componentId:l.target.value})},style:{marginBottom:32},SelectProps:{},children:c.map(l=>t.jsx(be,{value:l.meta.did,selected:l.meta.did===e.componentId,children:B.getDisplayName(l,!0)},l.meta.did))},"componentId"),p.length?t.jsx(X,{select:!0,label:r("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:r("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:l=>{o({...e,pageGroup:l.target.value})},SelectProps:{},children:p.map(l=>t.jsx(be,{value:l.value,selected:l.value===e.pageGroup,children:l.label},l.label))},"pageGroup"):null].filter(Boolean),e.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(X,{label:r("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{const R=l.target.value.trim();o({...e,url:l.target.value,__disableConfirm:!R}),n(R?"":r("router.validation.rewriteUrlRequired"))}},"url"),e.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(X,{select:!0,label:r("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:l=>o({...e,responseType:l.target.value}),style:{marginBottom:32},SelectProps:{},children:D.ROUTING_RESPONSE_TYPES.map(l=>t.jsx(be,{value:l.value,children:l.text},l.value))},"responseType"),t.jsx(X,{label:r("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:r("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:l=>{const R=l.target.value.trim();o({...e,responseBody:l.target.value,__disableConfirm:!R}),n(R?"":r("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:s.object,serviceTypes:s.array,setParams:s.func,setError:s.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:D.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:D.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:D.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:D.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:D.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function xn({children:e,hiddenChildren:o,open:n,onClose:a}){const{t:r}=G(),{api:i}=Q(),{blocklet:h}=pe(),[c,p]=m.useState(!1),[x,g]=m.useState(!1),l=h.meta.did,R=h.site.id,y=()=>{a==null||a(),p(!1),g(!1)},d=async j=>{try{const f=await ut(j,r);if(f)throw f;p(!0);const u={from:{pathPrefix:ye(j.pathPrefix)},to:{type:j.type}};j.type===D.ROUTING_RULE_TYPES.REDIRECT&&(u.to.url=j.url.trim(),u.to.redirectCode=j.redirectCode),j.type===D.ROUTING_RULE_TYPES.COMPONENT&&(u.to.did=l,u.to.componentId=j.componentId,u.to.pageGroup=j.pageGroup),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(u.to.url=ye(j.url)),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(u.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await i.addRoutingRule({input:{id:R,rule:u,teamDid:l}}),a==null||a()}catch(f){L.error(f.message)}finally{p(!1),g(!1)}},w={title:r("router.rule.add.title"),description:(j,f,u)=>{const v=T=>{if(u(null),ut(T,r)){f({...T,__disableConfirm:!0});return}f({...T})};return t.jsxs(te,{component:"div",children:[t.jsx(X,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:j.pathPrefixHint||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:j.pathPrefix,onChange:T=>{let b=!1;const N=Ro({params:{...j,pathPrefix:T.target.value},blocklets:[h]});u(N),j.type===D.ROUTING_RULE_TYPES.BLOCKLET&&N&&(b=!0),j.type===D.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(b=!0),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(b=!0),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(b=!0),T.target.value.trim()||(b=!0,u(r("router.validation.pathPrefixRequired"))),b||u("");const O=r("common.slugifyHint",{value:zt(T.target.value)});f({...j,pathPrefix:T.target.value,pathPrefixHint:O,__disableConfirm:b})}}),t.jsx(Rt,{params:j,setParams:v,setError:u})]})},confirm:r("router.rule.add.confirm"),cancel:r("common.cancel"),params:{did:"",pathPrefix:"",type:D.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:d,onCancel:y},S=j=>{j.stopPropagation(),g(!0)};let k=null;return o||(k=typeof e=="function"?e({open:S}):t.jsxs(be,{onClick:S,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(ue,{size:16}):t.jsx(Ht,{style:{fontSize:18,marginRight:5}}),r("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[k,(n||x)&&t.jsx(Fe,{title:w.title,description:w.description,confirm:w.confirm,cancel:w.cancel,params:w.params,onConfirm:w.onConfirm,onCancel:w.onCancel,color:"primary"})]})}xn.propTypes={children:s.any,onClose:s.func,hiddenChildren:s.bool,open:s.bool};xn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Xe({depth:e,className:o}){return t.jsx(C,{ml:Math.max((e-1)*2,0),className:o,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Xe.propTypes={depth:s.number,className:s.string};Xe.defaultProps={depth:1,className:""};function yn({id:e,from:o,children:n}){const{t:a}=G(),{api:r}=Q(),{blocklet:i}=pe(),[h,c]=m.useState(!1),[p,x]=m.useState(null),g=i.meta.did,l=i.site.id,R=o.pathPrefix,y=()=>{c(!1),x(null)},d=async()=>{c(!0);try{await r.deleteRoutingRule({input:{id:l,ruleId:e,teamDid:g}})}catch(k){L.error(k.message)}finally{x(null),c(!1)}},w={keyName:R,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${R}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:R}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:d,onCancel:y},S=k=>{k.stopPropagation(),x(w)};return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({loading:h,open:S}):t.jsxs(be,{onClick:S,className:"rule-action","data-cy":"action-delete-rule",children:[h?t.jsx(ue,{size:16}):t.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),p&&t.jsx(Ts,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}yn.propTypes={id:s.string.isRequired,from:s.object.isRequired,children:s.any};yn.defaultProps={children:null};function Cn({id:e,from:o,to:n,children:a}){var j,f;const{t:r}=G(),{api:i}=Q(),{blocklet:h}=pe(),[c,p]=m.useState(!1),[x,g]=m.useState(null),l=h.meta.did,R=h.site.id,y=o.pathPrefix,d=()=>{p(!1),g(null)},w=async u=>{try{const v=await ut(u,r);if(v)throw v;p(!0);const T={id:e,from:{pathPrefix:ye(u.pathPrefix)},to:{type:u.type}};u.type===D.ROUTING_RULE_TYPES.REDIRECT&&(T.to.url=u.url,T.to.redirectCode=u.redirectCode),u.type===D.ROUTING_RULE_TYPES.COMPONENT&&(T.to.did=l,T.to.componentId=u.componentId,T.to.pageGroup=u.pageGroup),u.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(T.to.url=ye(u.url)),u.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(T.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await i.updateRoutingRule({input:{id:R,rule:T,teamDid:l}})}catch(v){L.error(v.message)}finally{p(!1),g(null)}},S={title:r("router.rule.update.title"),description:(u,v,T)=>{const b=N=>{if(ut(N,r)){v({...N,__disableConfirm:!0});return}v({...N})};return t.jsxs(te,{component:"div",children:[t.jsx(X,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:u.helperText||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:N=>{let O=!1;u.type===D.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(O=!0),u.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(O=!0),u.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(O=!0),N.target.value.trim()||(O=!0,T(r("router.validation.pathPrefixRequired"))),O||T("");const me=r("common.slugifyHint",{value:zt(N.target.value)});v({...u,pathPrefix:N.target.value,helperText:me,__disableConfirm:O})}}),t.jsx(Rt,{params:u,setParams:b,setError:T})]})},confirm:r("router.rule.update.confirm"),cancel:r("router.rule.update.cancel"),color:"primary",params:{did:n.did||"",pathPrefix:y==="/"?y:y.replace(/^\/+/,"").replace(/\/+$/,""),type:n.type||D.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:n.redirectCode||302,componentId:n.componentId||"",pageGroup:n.pageGroup||"",url:n.url||"",responseType:((j=n.response)==null?void 0:j.contentType)||"",responseBody:(((f=n.response)==null?void 0:f.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:w,onCancel:d},k=u=>{u.stopPropagation(),g(S)};return t.jsxs(t.Fragment,{children:[typeof a=="function"?a({loading:c,open:k}):t.jsxs(be,{onClick:k,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(ue,{size:16}):t.jsx(Co,{style:{fontSize:18,marginRight:5}}),r("router.rule.update.title")]}),x&&t.jsx(Fe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}Cn.propTypes={id:s.string.isRequired,from:s.object.isRequired,to:s.object.isRequired,children:s.any};Cn.defaultProps={children:null};function jn(e){const{locale:o}=G(),{blocklet:n,recommendedDomain:a}=pe(),r=go(a,e.from.pathPrefix,Vt(n,o));return t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx(C,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:r,rel:"noopener noreferrer",title:r,children:t.jsx(ee,{size:"small",children:t.jsx(wo,{})})}),t.jsx(Cn,{...e,children:({open:i})=>t.jsx(ee,{size:"small",onClick:i,disabled:e.isProtected,"data-cy":"action-update-rule",children:t.jsx(Fr,{})})}),t.jsx(yn,{...e,children:({open:i})=>t.jsx(ee,{size:"small",onClick:i,disabled:e.isProtected,"data-cy":"action-delete-rule",children:t.jsx(Ct,{})})})]})}jn.propTypes={isProtected:s.bool};jn.defaultProps={isProtected:!1};function ko({group:e,...o}){return e?t.jsx(Qe,{type:"reverse",...o,children:e}):null}ko.propTypes={group:s.string.isRequired};function pt({domain:e,isHttps:o,toUrl:n}){const a=o?"https":"http";let r=n;return xr(r)||(r=`${a}://${e}${n}`),t.jsx(xt,{href:r,target:"_blank",style:{fontSize:14},underline:"hover",children:n},r)}pt.propTypes={domain:s.string.isRequired,toUrl:s.string.isRequired,isHttps:s.bool};pt.defaultProps={isHttps:!1};function St({hasPermission:e}){const{t:o,locale:n}=G(),a=ft(),{blocklet:r,recommendedDomain:i}=pe();return r.site.rules.filter(c=>c.to.type!==D.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{var l;let p=null,x=null;c.to.type===D.ROUTING_RULE_TYPES.NONE?p="404":c.to.type===D.ROUTING_RULE_TYPES.REDIRECT?p=c.to.redirectCode:c.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE?p="R":c.to.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE?p=t.jsx(_s,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&(x=r.children.find(R=>R.meta.did===c.to.componentId),p="C");const g=c.isProtected?t.jsx(xe,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(ee,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(Cs,{style:{fill:a.palette.text.disabled}})})})}):t.jsx(jn,{...c});return[t.jsxs(C,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[t.jsxs(C,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[t.jsx(C,{className:"component-item__indent",width:28}),typeof p=="object"?p:t.jsx(hr,{children:p}),t.jsxs(C,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(C,{style:{color:"text.primary",fontSize:16},children:[c.to.type===D.ROUTING_RULE_TYPES.NONE&&o("common.page404"),c.to.type===D.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),c.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),c.to.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((l=D.ROUTING_RESPONSE_TYPES.find(R=>R.value===c.to.response.contentType))==null?void 0:l.text),c.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&B.getDisplayName(x,!0)]}),t.jsxs(C,{display:"flex",alignItems:"center",children:[c.to.type===D.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(pt,{domain:i,toUrl:c.to.url}),c.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(pt,{domain:i,toUrl:c.to.url}),c.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(ko,{group:c.to.pageGroup})]})]})]}),t.jsx(C,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:t.jsx(xt,{href:go(i,c.from.pathPrefix,Vt(r,n)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:gr(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(C,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),t.jsx(Xe,{},"divider")]})}St.propTypes={hasPermission:s.bool};St.defaultProps={hasPermission:!1};const gi=yt(St,"mutate_blocklets"),xi=yt(St,"",He);function yi(e){const{inService:o}=Q();return o?t.jsx(xi,{...e}):t.jsx(gi,{...e})}function Ci(e,o){const n=m.useRef(o);m.useEffect(()=>{const a=r=>n.current(r.detail);return window.addEventListener(e,a),()=>window.removeEventListener(e,a)},[e])}function ji(e){const o=xo(),{t:n}=G(),a=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),o(r.toString()),e(),L.success(n("notification.checkingForUpdates")))};m.useEffect(a,[]),Ci("checkUpdate",a)}function vi({blocklet:e,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const n=xo(),{t:a}=G(),r=m.useRef(null),i=m.useMemo(()=>{if(!e||!e.optionalComponents)return null;const h=new URLSearchParams(window.location.search),c=h.get("install-component");if(c){r.current=c,h.delete("install-component"),n(h.toString());const p=e.optionalComponents.find(g=>g.meta.did===c);if(!p)return L.success(a("notification.installComponentError",{did:c})),null;const{meta:x}=p;if(o){const g=document.getElementById(`optional-component-${c}`),l=document.querySelector(".dashboard-main");if(g){const R=g.getBoundingClientRect(),y=l.getBoundingClientRect();l.scrollTo({top:R.top-y.top+l.scrollTop,behavior:"smooth"})}}return x}return null},[e,n,a,o]);return m.useEffect(()=>{var h;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},(h=window.blocklet)==null?void 0:h.appUrl)},[e]),i}function wt({open:e,onClose:o,blocklet:n,ancestors:a}){var x;const{t:r}=G(),i=[...(a||[]).map(g=>{var l;return((l=g==null?void 0:g.meta)==null?void 0:l.did)||""}),((x=n==null?void 0:n.meta)==null?void 0:x.did)||""].filter(Boolean).join("/"),h=r("preferencesFor",{name:B.getDisplayName(n,!0)}),c=m.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(qe(n.status)||n.status==="unknown"&&qe(n.status))return null;const p=()=>{o==null||o()};return t.jsx(bi,{open:e,fullWidth:!0,maxWidth:"md",title:h,onClose:p,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(uo,{gap:1,children:[t.jsx(te,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:r("description.preferences",{name:B.getDisplayName(n,!0)})}),t.jsx(Gr,{id:i,styles:c})]})})}wt.propTypes={blocklet:s.object.isRequired,ancestors:s.array,open:s.bool,onClose:s.func};wt.defaultProps={ancestors:[],open:!1,onClose:null};const bi=M(ht)`
|
|
362
|
-
.MuiDialogContent-root {
|
|
363
|
-
padding-top: 0;
|
|
364
|
-
padding-bottom: 24px;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.MuiToolbar-root {
|
|
368
|
-
padding-right: 0;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.ux-dialog_closeButton {
|
|
372
|
-
margin: 0;
|
|
373
|
-
}
|
|
374
|
-
`;function vn({component:e,remove:o,disabled:n,tip:a,showConfirm:r,hideBtn:i,onCancel:h}){const{t:c}=m.useContext(Ce),[p,x]=m.useState(!1),[g,l]=m.useState(null),R=async k=>{x(!0),await o(k.component,k.removeType),x(!1),l(null)},y=n||p,d=()=>{l({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(k,j)=>t.jsxs(te,{component:"div",children:[t.jsx(te,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(Es,{name:"removeType",value:k.removeType,onChange:f=>j({...k,removeType:f.target.value}),children:[t.jsx(At,{value:"keepData",control:t.jsx(eo,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(At,{value:"complete",control:t.jsx(eo,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:R,onCancel:()=>{l(null),h()}})};m.useEffect(()=>{r?d():(x(!1),l(null))},[r]);const w=t.jsx(Ri,{size:"small",disabled:y,onClick:()=>d,"data-cy":"delete-component-btn",children:t.jsx(Ct,{disabled:y})}),S=t.jsx(xe,{title:a||c("common.delete"),children:t.jsx("span",{children:w})});return t.jsxs(t.Fragment,{children:[!i&&S,g&&t.jsx(Fe,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}vn.propTypes={component:s.object.isRequired,remove:s.func,onCancel:s.func,disabled:s.bool,showConfirm:s.bool,hideBtn:s.bool,tip:s.string};vn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Ri=M(ee)`
|
|
375
|
-
&.Mui-disabled {
|
|
376
|
-
opacity: 0.5;
|
|
377
|
-
}
|
|
378
|
-
`;function bn({component:e,onStart:o,onStop:n,disabled:a,tip:r}){const{t:i}=m.useContext(Ce),[h,c]=m.useState(!1),[p,x]=m.useState(),g=async()=>{c(!0);try{await o(e)}catch(S){L.error(S.message)}c(!1)},l=async()=>{c(!0);try{await n(e)}catch(S){L.error(S.message)}c(!1)},R=a||h,y=["starting","running","stopping"].includes(e.status),d=y?Ur:Dr,w=t.jsx(Si,{disabled:R,onClick:()=>{var S;y?x({title:`${i("common.stop")} ${(S=e==null?void 0:e.meta)==null?void 0:S.title}`,description:i("blocklet.action.stopComponentDescription"),confirm:i("blocklet.action.confirmStop"),cancel:i("common.cancel"),onConfirm:()=>(x(null),l()),onCancel:()=>x(null)}):g()},"data-cy":`${y?"stop":"start"}-component-btn`,children:t.jsx(d,{disabled:R,fontSize:"small"})});return[t.jsx(xe,{title:r||i(`common.${y?"stop":"start"}`),children:t.jsx("span",{children:w})},"btn"),p&&t.jsx(Fe,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}bn.propTypes={component:s.object.isRequired,onStart:s.func,onStop:s.func,disabled:s.bool,tip:s.string};bn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const Si=M(ee)`
|
|
379
|
-
&.Mui-disabled {
|
|
380
|
-
opacity: 0.5;
|
|
381
|
-
}
|
|
382
|
-
`;function Rn({sourceInfo:e,blocklet:o}){var r;const{t:n}=m.useContext(Ce);let{source:a}=e;return a==="registry"&&(a="Blocklet Store"),t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx(yr,{type:"success",children:Ps(a)},"source"),e.source==="registry"&&t.jsx(xt,{href:gt(e.deployedFrom,"blocklets",((r=o==null?void 0:o.meta)==null?void 0:r.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:n("blocklet.overview.viewInStore")})]})}Rn.propTypes={sourceInfo:s.shape({source:s.string,deployedFrom:s.string}),blocklet:s.object};Rn.defaultProps={sourceInfo:{},blocklet:{}};var Sn={},wi=Wt;Object.defineProperty(Sn,"__esModule",{value:!0});var Io=Sn.default=void 0,Ti=wi(Gt()),Ei=t;Io=Sn.default=(0,Ti.default)((0,Ei.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Tt({blocklet:e,checkUpgrade:o,hasPermission:n,...a}){const{api:r}=Q(),{t:i}=m.useContext(Ce),[h,c]=m.useState(!1),[p,x]=m.useState(""),[g,l]=m.useState(null),[R,y]=m.useState(null);m.useEffect(()=>{l(null),o&&(e.mode,H.BLOCKLET_MODES.DEVELOPMENT)},[e,o]);const d=()=>{c(!1),y(null)},w=async()=>{c(!0);try{const k={did:e.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ke(2e3),await r.upgradeBlocklet({input:k})}catch(k){L.error(`Blocklet upgrade failed: ${ie(k)}`)}finally{c(!1),y(null)}},S={title:`${i("common.upgrade")} ${i("common.blocklet")} ${B.getDisplayName(e)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:w,onCancel:d};return n&&g&&!B.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{...a,children:e.meta.version}),t.jsx(xe,{title:i("common.updateAvailable",{version:g.version}),children:t.jsx(ee,{size:"small",style:{marginLeft:8},disabled:h,onClick:()=>y(S),children:h?t.jsx(ue,{size:16}):t.jsx(Io,{style:{fontSize:16,color:"red"}})})}),!!p&&t.jsx(L,{variant:"error",message:p,onClose:()=>x("")}),R&&t.jsx(Fe,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel})]}):t.jsx(Qe,{...a,children:e.meta.version})}Tt.propTypes={blocklet:s.object.isRequired,checkUpgrade:s.bool,hasPermission:s.bool};Tt.defaultProps={checkUpgrade:!1,hasPermission:!1};const Pi=yt(Tt,"mutate_blocklets"),ki=yt(Tt,"",He);function Ii(e){const{inService:o}=Q();return o?t.jsx(ki,{...e}):t.jsx(Pi,{...e})}const _i=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},Ui=(e,o)=>e?[{name:o("common.name"),value:e.displayName},{name:o("common.description"),value:e.description},{name:o("common.version"),value:t.jsx(Qe,{children:e.version})}]:[],Di=e=>{const{source:o,deployedFrom:n,bundleSource:a}=e;if(o)return{source:o,deployedFrom:n};if(!a)return{source:"upload",deployedFrom:n};if(a.url){const r=n||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:r,link:r}}if(a.store){const r=n||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:r,link:r}}return{}},Ni=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const i=[];for(;a&&r<n.length;){const h=a.children.find(c=>c.meta.did===n[r]);a=h,r++,h&&i.push(h.meta.title)}return i.join(" / ")};function wn({blocklet:e,depth:o,componentInfo:n,app:a,onClose:r}){var y,d;const{t:i,locale:h}=m.useContext(Ce),{deletingBlocklets:c}=Yt();let{status:p}=e;o===1&&c.includes(e.meta.did)&&(p="deleting");const x=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),g=w=>w.map(S=>S.name===i("common.did")||S.name===i("blocklet.appId")?t.jsx(Lt,{valueComponent:"div",nameWidth:120,name:S.name,nameFormatter:()=>S.name,children:S.value},S.name):t.jsx(Lt,{valueComponent:"div",nameWidth:120,name:S.name,children:S.link?t.jsx(xt,{href:S.link,target:"_blank",className:"page-link",underline:"hover",children:S.value}):S.value},S.name)),l=n?Di(n):{},R=n?[{name:i("common.name"),value:B.getDisplayName(n,!0)},{name:i("common.version"),value:t.jsx(Ii,{blocklet:n,checkUpgrade:!1})},{name:i("common.status"),value:t.jsx(To,{isResource:_i(e),status:p,source:n.source,progress:e.progress})},e.status==="running"?{name:i("blocklet.startedAt"),value:e.startedAt?t.jsx(Nt,{value:e.startedAt,type:"all",locale:h}):"-"}:null,e.status!=="running"?{name:i("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(Nt,{value:e.stoppedAt,type:"all",locale:h}):"-"}:null,e.installedAt?{name:i("blocklet.installedAt"),value:e.installedAt?t.jsx(Nt,{value:e.installedAt,type:"all",locale:h}):"-"}:null,B.hasStartEngine(e.meta)?{name:i("common.mountPoint"),value:x}:null,n.meta.group?{name:i("common.group"),value:t.jsx(Qe,{type:"success",children:n.meta.group})}:null,{name:i("blocklet.overview.source"),value:t.jsx(Rn,{sourceInfo:l,blocklet:e})},{name:i("blocklet.overview.deployedFrom"),value:l.deployedFrom||"-",link:l.link??""},{name:i("common.did"),value:t.jsx(Cr,{did:n.meta.did,showQrcode:!0})},{name:i("common.author"),value:n.meta.owner?t.jsx(js,{owner:n.meta.owner,locale:h}):vs.formatPerson(n.meta.author)},{name:i("common.engine"),value:Ui(n.engine,i).map(({name:w,value:S})=>t.jsx(Lt,{style:{marginBottom:4},nameWidth:120,name:w,children:S},w))},(y=e.dependents)!=null&&y.length?{name:i("common.dependents"),value:t.jsx(C,{children:e.dependents.map(w=>t.jsx(C,{children:`${Ni(w.id,a)} ${w.required?`(${i("common.required")})`:""}`},w.id))})}:null,(d=e.meta.resources)!=null&&d.length?{name:i("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return n?t.jsx(ht,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{r(null)},children:t.jsx(C,{paddingBottom:1.5,children:g(R)},"dialog-wrapper")},"base-info-dialog"):null}wn.propTypes={blocklet:s.object.isRequired,depth:s.number,app:s.object,componentInfo:s.object,onClose:s.func.isRequired};wn.defaultProps={depth:0,app:null,componentInfo:null};M(yo)`
|
|
383
|
-
.BaseBadge-badge {
|
|
384
|
-
top: ${e=>e.top*8||6}px;
|
|
385
|
-
right: ${e=>e.right*8||6}px;
|
|
386
|
-
}
|
|
387
|
-
`;M(C)`
|
|
388
|
-
.component-header {
|
|
389
|
-
display: flex;
|
|
390
|
-
align-items: center;
|
|
391
|
-
align-items: flex-end;
|
|
392
|
-
cursor: pointer;
|
|
393
|
-
}
|
|
394
|
-
.component-name {
|
|
395
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
396
|
-
font-size: 16px;
|
|
397
|
-
}
|
|
398
|
-
.component-version {
|
|
399
|
-
color: ${({theme:e})=>e.palette.grey[400]};
|
|
400
|
-
font-size: 12px;
|
|
401
|
-
margin-left: 4px;
|
|
402
|
-
transform: translateY(-1px);
|
|
403
|
-
}
|
|
404
|
-
`;function _o({blocklet:e,ancestors:o,mountPoint:n,href:a}){const[r,i]=m.useState(!1),[h,c]=m.useState(!1),[p,x]=m.useState(!1),[g,l]=m.useState(n),{api:R}=Q(),y=!o.length,d=y?e.meta.did:o.map(b=>b.meta.did)[0],{t:w}=G(),{confirmApi:S,confirmHolder:k}=jr();m.useEffect(()=>{c(!1),i(!1),x(!1)},[n]);const j=()=>{i(!1),c(!1),l(n)},f=async()=>{x(!0),i(!1);try{const b={rootDid:d,mountPoint:ye(g)};y||(b.did=e.meta.did),await R.updateComponentMountPoint({input:b})}catch(b){throw b.message=ie(b),L.error(b.message),b}finally{j()}},u=vr(()=>{S.open({title:w("common.noticeTitle"),content:t.jsxs(C,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(te,{sx:{mb:1.5},children:w("blocklet.mountPoint.description1")}),t.jsx(te,{component:"li",children:w("blocklet.mountPoint.case1")}),t.jsx(te,{component:"li",children:w("blocklet.mountPoint.case2")}),t.jsx(te,{sx:{mt:1.5},children:w("blocklet.mountPoint.description2")})]}),confirmButtonText:w("common.confirm"),cancelButtonText:w("common.cancel"),async onConfirm(b){await f(),b()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),v=b=>{b==null||b.preventDefault(),ye(g)!==n?u():c(!1)},T=h?t.jsxs(C,{sx:{ml:1},children:[t.jsx(ee,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:v,children:t.jsx(C,{component:J,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(ee,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:j,children:t.jsx(C,{component:J,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(ee,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>c(!0),children:t.jsx(C,{component:J,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:r?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(C,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[k,h?t.jsx("form",{onSubmit:v,children:t.jsx(X,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:b=>l(b.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:n})}):t.jsx(C,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:t.jsx(C,{maxWidth:400,sx:{color:"primary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:br(n)})}),p?t.jsx(ue,{size:20,sx:{ml:1}}):T]},n)}_o.propTypes={mountPoint:s.string.isRequired,href:s.string.isRequired,blocklet:s.object.isRequired,ancestors:s.array.isRequired};const Li=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},co=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const i=[];for(;a&&r<n.length;){const h=a.children.find(c=>c.meta.did===n[r]);a=h,r++,h&&i.push(h.meta.title)}return i.join(" / ")};function mt({blocklet:e,ancestors:o,depth:n,onRemove:a,onStart:r,onStop:i,onRestart:h,getComponentUrl:c,app:p}){var fe,Se,I;const{t:x}=m.useContext(Ce),[g,l]=m.useState(),[R,y]=m.useState(!1),[d,w]=m.useState(!1),[S,k]=m.useState(null),{info:j}=Q(),[f,u]=m.useState(!1),[v,T]=m.useState(!1),{deletingBlocklets:b}=Yt();let{status:N}=e;n===1&&b.includes(e.meta.did)&&(N="deleting");const O=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),me=c(O),Y=B.isInProgress(p.status),U=B.isInProgress(e.status);let Re="";if(Y||U||n===1&&b.includes(e.meta.did))Re=x("blocklet.component.tip.stopBlocklet");else if((fe=e.dependents)!=null&&fe.length){const z=e.dependents.filter(K=>K.required);if(z.length){const K=z.map(we=>co(we.id,p));Re=x("blocklet.component.tip.requiredBy",{name:K.join(", ")})}}const Z=async(...z)=>{w(!0);try{await a(...z)}catch{}w(!1),y(!1)},{usingDocker:Ue,usingIsolation:De}=m.useMemo(()=>{var je,ae;if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const z=!!(j!=null&&j.enableDocker)||((je=window.blocklet)==null?void 0:je.enableDocker),K=[...p.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER"&&E.value),we=[...p.configs,...e.configs].find(E=>E.key==="USE_DOCKER"&&E.value),F=[...p.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER_NETWORK"&&E.value);return{usingDocker:z?!K:!!we,usingIsolation:z&&!F&&((j==null?void 0:j.enableDockerNetwork)||((ae=window.blocklet)==null?void 0:ae.enableDockerNetwork))}},[e.configs,j==null?void 0:j.enableDocker,j==null?void 0:j.enableDockerNetwork,p.configs,e.meta.group]);return t.jsxs(t.Fragment,{children:[t.jsxs(Tn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(C,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[t.jsx(Rr,{blocklet:e,ancestors:o}),t.jsxs(C,{ml:"16px",sx:{minWidth:0},children:[t.jsxs(C,{className:"component-header",onClick:()=>l(e),children:[t.jsx(C,{className:"component-name",children:B.getDisplayName(e,!0)}),t.jsx(C,{className:"component-version",children:(Se=e==null?void 0:e.meta)==null?void 0:Se.version})]}),t.jsxs(C,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[N!=="unknown"&&t.jsx(To,{style:{marginLeft:4},status:N,source:e.source,progress:e.progress}),t.jsx(bs,{style:{marginLeft:4},mode:e.mode||""}),e.mode!=="development"&&Ue&&t.jsx(xe,{title:x("blocklet.usingDocker"),children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:jo})})}),e.mode!=="development"&&De&&t.jsx(xe,{title:x("blocklet.usingIsolation"),children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:"streamline:network"})})}),!!((I=e.dependents)!=null&&I.length)&&t.jsx(xe,{title:[`${x("common.dependents")}: `,e.dependents.map(z=>t.jsx(C,{pl:1,children:`${co(z.id,p)} ${z.required?`(${x("common.required")})`:""}`},z.id))],children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:"octicon:package-dependents-16"})})})]})]})]},e),ho.hasMountPoint(e.meta)&&t.jsx(_o,{blocklet:e,ancestors:o,mountPoint:O,href:me},O),t.jsx("div",{style:{flex:1}}),t.jsxs(C,{display:"flex",alignItems:"center",children:[B.hasStartEngine(e.meta)&&t.jsx(xe,{title:x("common.visit"),children:t.jsx(C,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:me,rel:"noopener noreferrer",children:t.jsx(ee,{size:"small",children:t.jsx(wo,{})})})}),t.jsx(bn,{blocklet:p,component:e,onStart:r,onStop:i,disabled:!["starting","stopping"].includes(p.status)&&B.isInProgress(p.status)}),t.jsx(ee,{onClick:()=>T(!0),disabled:Y||U,children:t.jsx(Zt,{fontSize:"small"})}),t.jsx(Ft,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(Eo,{"data-cy":"component-actions",actions:[B.hasStartEngine(e.meta)||Li(e)?{icon:t.jsx(Sr,{}),text:x("common.detail"),onClick:()=>{l(e)}}:null,{icon:t.jsx(Nr,{}),text:x("common.restart"),onClick:()=>{k({title:`${x("common.restart")} ${e.meta.title}`,description:x("blocklet.action.restartDescription"),confirm:x("blocklet.action.confirmRestart"),cancel:x("common.cancel"),onConfirm:async()=>{w(!0),await h(e),w(!1),k(null)},onCancel:()=>k(null)})},disabled:d||Y||U||e.status!=="running"},{icon:t.jsx(Ct,{}),text:x("common.delete"),onClick:()=>{y(!0)},disabled:Y||U||!!Re,tip:Re},{separator:!0},{icon:t.jsx(J,{icon:"mdi:variable"}),onClick:()=>{u(!0)},text:t.jsx(Ft,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(C,{sx:{width:"100%"},children:x("common.environments")})}),disabled:Y||U}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(Xe,{},"line"),t.jsx(wn,{componentInfo:g,onClose:l,blocklet:e,app:p,depth:n}),t.jsx(vn,{blocklet:p,component:e,remove:Z,onCancel:()=>y(!1),hideBtn:!0,showConfirm:R},"delete-component"),S&&t.jsx(Fe,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel},"confirm-setting"),f&&t.jsx(jt,{open:!0,hiddenChildren:!0,onClose:()=>u(!1),blocklet:e,ancestors:o}),v&&t.jsx(wt,{open:!0,onClose:()=>T(!1),blocklet:e,ancestors:o})]})}mt.propTypes={blocklet:s.object.isRequired,ancestors:s.array,depth:s.number,onRemove:s.func,onStart:s.func,onStop:s.func,onRestart:s.func,getComponentUrl:s.func,app:s.object};mt.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const Ft=M(yo)`
|
|
405
|
-
.BaseBadge-badge {
|
|
406
|
-
top: ${e=>e.top*8||6}px;
|
|
407
|
-
right: ${e=>e.right*8||6}px;
|
|
408
|
-
}
|
|
409
|
-
`,Tn=M(C)`
|
|
410
|
-
&:hover {
|
|
411
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
412
|
-
}
|
|
413
|
-
.component-header {
|
|
414
|
-
display: flex;
|
|
415
|
-
align-items: center;
|
|
416
|
-
align-items: flex-end;
|
|
417
|
-
cursor: pointer;
|
|
418
|
-
}
|
|
419
|
-
.component-name {
|
|
420
|
-
min-width: 0;
|
|
421
|
-
overflow: hidden;
|
|
422
|
-
text-overflow: ellipsis;
|
|
423
|
-
white-space: nowrap;
|
|
424
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
425
|
-
font-size: 16px;
|
|
426
|
-
}
|
|
427
|
-
.component-version {
|
|
428
|
-
color: ${({theme:e})=>e.palette.text.secondary};
|
|
429
|
-
font-size: 12px;
|
|
430
|
-
margin-left: 4px;
|
|
431
|
-
transform: translateY(-1px);
|
|
432
|
-
}
|
|
433
|
-
`;function En({meta:e,dependencies:o,logoUrl:n,setInstallComponentMeta:a}){const r=Q(),{t:i}=G(),h=()=>{a(e)},c=40;return t.jsxs(Bi,{id:`optional-component-${e.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("img",{className:"component-logo",src:n,onError:()=>`${r.imgPrefix}/blocklet.png`,alt:e.title,style:{width:c,height:c}}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:e.title}),t.jsx("div",{className:"component-version",children:e.version})]}),t.jsx(xe,{title:[`${i("common.dependents")}: `,o.map(p=>t.jsx(C,{pl:1,children:`${p.parentTitle} ${p.required?`(${i("common.required")})`:""}`},p.parentName+p.mount_point))],children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(C,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(wr,{onClick:h,startIcon:t.jsx(J,{icon:"ph:download-simple-bold"}),children:i("common.install")})})]}),t.jsx(Xe,{class:"line"},"line")]})}En.propTypes={meta:s.object.isRequired,logoUrl:s.string,setInstallComponentMeta:s.func.isRequired,dependencies:s.arrayOf(s.shape({parentDid:s.string,parentName:s.string,parentPoint:s.string,required:s.bool}))};En.defaultProps={logoUrl:"",dependencies:[]};const Bi=M(Tn)`
|
|
434
|
-
.line {
|
|
435
|
-
opacity: 0.5;
|
|
436
|
-
}
|
|
437
|
-
.cell {
|
|
438
|
-
display: flex;
|
|
439
|
-
width: 100%;
|
|
440
|
-
flex-direction: row;
|
|
441
|
-
align-items: center;
|
|
442
|
-
justify-content: flex-start;
|
|
443
|
-
padding-top: 16px;
|
|
444
|
-
padding-bottom: 16px;
|
|
445
|
-
}
|
|
446
|
-
.component-left {
|
|
447
|
-
display: flex;
|
|
448
|
-
flex-direction: row;
|
|
449
|
-
justify-content: flex-start;
|
|
450
|
-
align-items: center;
|
|
451
|
-
min-width: 0;
|
|
452
|
-
}
|
|
453
|
-
.component-logo {
|
|
454
|
-
width: 40px;
|
|
455
|
-
margin-left: 16px;
|
|
456
|
-
opacity: 0.5;
|
|
457
|
-
border-radius: 10px;
|
|
458
|
-
overflow: hidden;
|
|
459
|
-
}
|
|
460
|
-
.component-header {
|
|
461
|
-
flex: 1;
|
|
462
|
-
min-width: 0;
|
|
463
|
-
opacity: 0.5;
|
|
464
|
-
margin-left: 12px;
|
|
465
|
-
display: flex;
|
|
466
|
-
align-items: center;
|
|
467
|
-
align-items: flex-end;
|
|
468
|
-
cursor: pointer;
|
|
469
|
-
}
|
|
470
|
-
.component-name {
|
|
471
|
-
flex: 1;
|
|
472
|
-
opacity: 0.5;
|
|
473
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
474
|
-
font-size: 16px;
|
|
475
|
-
}
|
|
476
|
-
.component-version {
|
|
477
|
-
opacity: 0.8;
|
|
478
|
-
color: ${({theme:e})=>e.palette.grey[400]};
|
|
479
|
-
font-size: 12px;
|
|
480
|
-
margin-left: 4px;
|
|
481
|
-
transform: translateY(-1px);
|
|
482
|
-
}
|
|
483
|
-
`;function Pn({blocklet:e,onUpdate:o,getComponentUrl:n,...a}){var ae;const{t:r}=m.useContext(Ce),{api:i,inService:h,info:c}=Q(),{addDeletingDid:p,removeDeletingDid:x,matchDeletingDid:g}=Yt(),[l,R]=m.useState(!1),[y,d]=m.useState(null),[w,S]=m.useState(null),[k,j]=m.useState(!1),[f,u]=m.useState(!1),[v,T]=m.useState(!1),[b,N]=m.useState(!1),[O,me]=m.useState(null),Y=e&&e.structVersion!==D.APP_STRUCT_VERSION,[U,Re]=m.useState(!1),Z=[...e.children];e.meta.group!=="gateway"&&Z.unshift(e),g(Z.map(E=>E.meta.did));const Ue=async()=>{if(!l){R(!0);try{const{updateId:E,updateList:V}=(await i.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(R(!1),!E){L.info(r("blocklet.component.noUpdate"));return}const ne=[];B.forEachChildSync(e,(A,{id:Ne,ancestors:le})=>{const W=V.find(Pe=>Pe.id===Ne);if(W){const Pe=le.slice(1).concat(A).map(Le=>Le.meta.title||Le.meta.name).join(" / "),Ge=(le[1]||A).meta.did;ne.push({groupId:Ge,name:Pe,version:A.meta.version,newVersion:W.meta.version})}});const Te={};ne.forEach(A=>{Te[A.groupId]?A.disabled=!0:Te[A.groupId]=!0}),d({params:{updateId:E},list:ne,checks:Te,hasChecks:!0})}catch(E){R(!1),L.error(ie(E))}}},De=async()=>{if(!l)try{R(!0);const E=Object.keys(y.checks).filter(ne=>y.checks[ne]),V={updateId:y.params.updateId,rootDid:e.meta.did,selectedComponents:E};await i.upgradeComponents({input:V}),R(!1),d(null),Re(null)}catch(E){R(!1),L.error(ie(E))}},fe=async(E,V)=>{p(E.meta.did);try{await i.deleteComponent({input:{did:E.meta.did,keepData:V==="keepData",rootDid:e.meta.did}}),await Ke(800)}catch(ne){L.error(ie(ne)),x(E.meta.did)}},Se=async E=>{try{await i.startBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},I=async E=>{try{await i.stopBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},z=async E=>{try{await i.restartBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},K=(E,V)=>{const{checked:ne}=E.target;d(Te=>{const A=Object.entries(Te.checks).reduce((le,[W,Pe])=>(le[W]=V===W||V==="all"?ne:Pe,le),{}),Ne=Object.values(A).includes(!0);return{...Te,checks:A,hasChecks:Ne}})},we=m.useMemo(()=>y==null?void 0:y.list.filter(E=>!E.disabled).every(E=>y.checks[E.groupId]),[y]);ji(Ue);const F=vi({blocklet:e,scrollToComponent:!0}),je=O||F;return t.jsxs(Oi,{component:"div",...a,children:[t.jsxs($i,{display:"flex",children:[t.jsxs(Mi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[Z!=null&&Z.length?`${r("common.components")} (${Z.length})`:`${r("common.components")}`,!Y&&t.jsx(qt,{permission:h?"":"mutate_blocklets",role:h?He:[],children:t.jsx(Jt,{children:t.jsx(Ft,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!U,children:t.jsxs(de,{disabled:l||B.isInProgress(e.status),onClick:()=>{Ue()},"data-cy":"check-for-updates",children:[t.jsx(C,{ml:.5,mr:.5,display:"flex",children:l?t.jsx(ue,{size:16}):t.jsx(Po,{style:{fontSize:"1em"}})}),r("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(qt,{permission:h?"":"mutate_blocklets",role:h?He:[],children:t.jsxs(C,{display:"flex",alignItems:"center",children:[!Y&&t.jsx(gn,{blocklet:e,serverVersion:c.version,disabled:l||B.isInProgress(e.status)}),t.jsx(Eo,{"data-cy":"component-actions",actions:[{icon:t.jsx(J,{icon:"fluent:link-20-filled"}),onClick:()=>u(!0),text:r("router.rule.add.title"),disabled:l||B.isInProgress(e.status)},...Y?[]:[{icon:t.jsx(J,{icon:"mdi:variable"}),onClick:()=>{T(!0)},text:r("common.environments")},{icon:t.jsx(Zt,{}),onClick:()=>{N(!0)},text:r("common.preferences")}]].filter(Boolean)})]})})]}),Z!=null&&Z.length?t.jsxs(t.Fragment,{children:[t.jsxs(C,{mt:2,children:[e.meta.group!=="gateway"&&t.jsx(mt,{blocklet:e,app:e,onRemove:fe,onStart:Se,onStop:I,onRestart:z,getComponentUrl:n},`0-${e.meta.did}`),e.children.map(E=>t.jsx(mt,{depth:1,blocklet:E,ancestors:[e],app:e,onRemove:fe,onStart:Se,onStop:I,onRestart:z,getComponentUrl:n},`1-${E.meta.did}`))]},`top-blocklet-${e.meta.did}`),(ae=e.optionalComponents)==null?void 0:ae.map(E=>t.jsx(Tn,{children:t.jsx(En,{setInstallComponentMeta:me,...E})},E.meta.did))]}):t.jsx(C,{mt:8,children:t.jsx(Ir,{children:r("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(C,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(yi,{})}),!!y&&t.jsx(Vn,{open:!0,fullWidth:!0,children:t.jsxs(C,{paddingY:1.5,children:[t.jsx(Yn,{children:r("blocklet.component.updateTitle")}),t.jsxs(C,{component:Kn,py:4,children:[y.list.filter(E=>!E.disabled).length>1&&t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx(Hn,{checked:we,onChange:E=>K(E,"all")}),t.jsx(C,{children:r(we?"common.unselectAll":"common.selectAll")})]}),y.list.map(E=>t.jsxs(C,{display:"flex",alignItems:"center",mb:1,children:[t.jsx(Hn,{checked:y.checks[E.groupId],onChange:V=>K(V,E.groupId),style:{marginLeft:E.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:E.disabled}),t.jsxs(C,{flexGrow:1,children:[t.jsx(C,{pt:1,xs:8,children:E.name}),E.version&&t.jsxs(lt,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[t.jsx(lt,{item:!0,xs:3,children:E.version}),t.jsx(lt,{item:!0,xs:1,children:t.jsx(Tr,{style:{fontSize:"0.9em"}})}),t.jsx(lt,{item:!0,xs:3,children:t.jsx(C,{color:"secondary.main",children:E.newVersion})})]})]},`${E.name}-${E.newVersion}`)]},E.name))]}),t.jsxs(Er,{style:{padding:"8px 24px 24px"},children:[t.jsx(de,{onClick:()=>{d(null)},children:r("common.cancel")}),t.jsxs(de,{onClick:E=>{E.stopPropagation(),De()},color:"primary",disabled:l||!y.hasChecks,variant:"contained",autoFocus:!0,children:[l&&t.jsx(ue,{size:16}),r("common.update")]})]})]})}),!!w&&t.jsx(Vn,{open:!0,fullWidth:!0,onClose:()=>S(!1),children:t.jsxs(C,{paddingY:1.5,children:[t.jsx(Yn,{children:r("common.configuration")}),t.jsx(Kn,{children:t.jsx(C,{py:2,children:t.jsx(At,{control:t.jsx(ks,{checked:k,onChange:E=>j(!!E.target.checked)}),label:r("blocklet.component.showContainer")})})})]})}),t.jsx(bt,{selectedMeta:je,blocklet:e,showDialog:!!je,setShowDialog:()=>me(null)}),f&&t.jsx(xn,{hiddenChildren:!0,open:!0,onClose:()=>u(!1)}),v&&t.jsx(jt,{open:!0,onClose:()=>T(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),b&&t.jsx(wt,{open:!0,onClose:()=>N(!1),blocklet:e,ancestors:[]})]})}Pn.propTypes={blocklet:s.object.isRequired,onUpdate:s.func,getComponentUrl:s.func};Pn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Oi=M.div`
|
|
484
|
-
.title {
|
|
485
|
-
font-size: 1.2rem;
|
|
486
|
-
font-weight: bold;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
@keyframes showDelay {
|
|
490
|
-
0% {
|
|
491
|
-
opacity: 0;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
100% {
|
|
495
|
-
opacity: 1;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
.component-item {
|
|
500
|
-
animation: showDelay 0.75s ease 1;
|
|
501
|
-
}
|
|
502
|
-
`,$i=M(C)`
|
|
503
|
-
${e=>e.theme.breakpoints.up("sm")} {
|
|
504
|
-
flex-direction: row;
|
|
505
|
-
justify-content: space-between;
|
|
506
|
-
align-items: center;
|
|
507
|
-
}
|
|
508
|
-
${e=>e.theme.breakpoints.down("sm")} {
|
|
509
|
-
flex-direction: column;
|
|
510
|
-
justify-content: flex-end;
|
|
511
|
-
align-items: flex-end;
|
|
512
|
-
.sm-hide-icon > svg {
|
|
513
|
-
display: none;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
`,Mi=M(C)`
|
|
517
|
-
${e=>e.theme.breakpoints.down("sm")} {
|
|
518
|
-
width: 100%;
|
|
519
|
-
justify-content: space-between;
|
|
520
|
-
}
|
|
521
|
-
`;function Uo(e){const{locale:o}=m.useContext(Ce),{blocklet:n,recommendedDomain:a}=Is(),r=i=>Pr({blocklet:n,domain:{value:a||`${kr.encode(n.appPid)}.${D.DEFAULT_DID_DOMAIN}`},mountPoint:i,params:Vt(n,o)});return t.jsx(Pn,{blocklet:n,getComponentUrl:r,...e})}Uo.propTypes={};Uo.defaultProps={};export{Uo as default};
|