@abtnode/webapp 1.16.49-beta-20250812-040454-05aece54 → 1.16.49-beta-20250813-141500-f02b41b4
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-Ct0VTXw3.js → AdapterDayjs-BjO18toV.js} +1 -1
- package/dist/assets/{Add-xsnJutmq.js → Add-D7FBmxz9.js} +1 -1
- package/dist/assets/ArrowDropDown-CGRxh8gD.js +1 -0
- package/dist/assets/{Autocomplete-B8LzLUZe.js → Autocomplete-Bj2hcqGf.js} +1 -1
- package/dist/assets/{Breadcrumbs-BDzy2bld.js → Breadcrumbs-DwE835ah.js} +1 -1
- package/dist/assets/{ButtonGroup-2OIq-PXC.js → ButtonGroup-CToFieon.js} +1 -1
- package/dist/assets/{CSSTransition-RdSxc12C.js → CSSTransition-DG0p2bDc.js} +1 -1
- package/dist/assets/{CallMerge-DxChMRnd.js → CallMerge-DDDKPRmO.js} +1 -1
- package/dist/assets/{CardContent-D4kbuto4.js → CardContent-DXBw-i1o.js} +1 -1
- package/dist/assets/{ChevronLeft-KRG-fuZi.js → ChevronLeft-ClJUpIrX.js} +1 -1
- package/dist/assets/{ChevronRight-BmsIaZOg.js → ChevronRight-pNcrG18Z.js} +1 -1
- package/dist/assets/{Clear-ClOZ_U5s.js → Clear-wN_lM9i_.js} +1 -1
- package/dist/assets/{DeleteOutline-D00EO6C8.js → DeleteOutline-0Pjk0X04.js} +1 -1
- package/dist/assets/{Done-BTVTKjDk.js → Done-Bvnq95wW.js} +1 -1
- package/dist/assets/{Edit-DXMp4A9G.js → Edit-CVMHb0TK.js} +1 -1
- package/dist/assets/{ErrorOutline-C6AxgGOX.js → ErrorOutline-B2Mw_vUr.js} +1 -1
- package/dist/assets/{FilterList-TV3SGdIn.js → FilterList-agXhdRax.js} +1 -1
- package/dist/assets/{Google-BuIv4wD3.js → Google-CnSXuxho.js} +1 -1
- package/dist/assets/{HelpOutline-B7Ct-krn.js → HelpOutline-CNZGWmTU.js} +1 -1
- package/dist/assets/{Launch-BvjA_9TZ.js → Launch-CmazaRGZ.js} +1 -1
- package/dist/assets/{Link-Uzugo-zp.js → Link-DxObZpZX.js} +1 -1
- package/dist/assets/{ListItemButton-BBR__ebu.js → ListItemButton-Bk_S-24I.js} +1 -1
- package/dist/assets/{ListSubheader-CW_V4Z24.js → ListSubheader-CjL9mMf3.js} +1 -1
- package/dist/assets/{LoadingButton-Y_0rPcsy.js → LoadingButton-BTTKyDvk.js} +1 -1
- package/dist/assets/{MoreVert-DrzE5AUf.js → MoreVert-CpVaEDbL.js} +1 -1
- package/dist/assets/{OpenInNew-53sNi7bT.js → OpenInNew-zVEoRj2W.js} +1 -1
- package/dist/assets/{Refresh-02-oGzO6.js → Refresh-BZtduSQA.js} +1 -1
- package/dist/assets/{Search-7wyvQCyz.js → Search-C1hYBh2z.js} +1 -1
- package/dist/assets/{Slider-DACfJuWn.js → Slider-D41Gc6DM.js} +1 -1
- package/dist/assets/{Stepper-ZBVUR9pb.js → Stepper-Bax0qACN.js} +1 -1
- package/dist/assets/{Switch-D8Y_AkUP.js → Switch-BA5PH6p0.js} +1 -1
- package/dist/assets/{TableSearch-j7mUrdaA.js → TableSearch-BzANvfKC.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CWiKD-9f.js → ToggleButtonGroup-BzxI_4Ka.js} +1 -1
- package/dist/assets/{Verified-COnwjqrJ.js → Verified-B9q95gmQ.js} +1 -1
- package/dist/assets/{VerifiedUser-DnX0aEPL.js → VerifiedUser-CPgjTUes.js} +1 -1
- package/dist/assets/{ViewList-_K538mHc.js → ViewList-CEZqTkZN.js} +1 -1
- package/dist/assets/{_createAggregator-Dt3Ih0i2.js → _createAggregator-6qCBlT2m.js} +1 -1
- package/dist/assets/{actions-DRuv-pyx.js → actions-CwHV7VOi.js} +1 -1
- package/dist/assets/{actions-Cxap2JOs.js → actions-Lc_gpmy_.js} +1 -1
- package/dist/assets/{agreement-DqRsm6CV.js → agreement-nMH2PwNa.js} +1 -1
- package/dist/assets/api-C4QD0LkR.js +1 -0
- package/dist/assets/{appearance-Bm7cllFQ.js → appearance-wME-EwFf.js} +1 -1
- package/dist/assets/{ar-BrkwppMS.js → ar-RVOyZ73G.js} +1 -1
- package/dist/assets/{audit-logs-ClrCXrBK.js → audit-logs-DQNniPIc.js} +1 -1
- package/dist/assets/{base-chart-vZbN8YRn.js → base-chart-DfzeqYgM.js} +1 -1
- package/dist/assets/{blocklet-CSWEnHbv.js → blocklet-CXBJcwmD.js} +1 -1
- package/dist/assets/chain-0epXNZTv.js +6 -0
- package/dist/assets/{click-to-copy-B94Iq4_S.js → click-to-copy-CCt7i81W.js} +1 -1
- package/dist/assets/client-BriPpb0D.js +1 -0
- package/dist/assets/cloneDeep-DZJaLQYA.js +1 -0
- package/dist/assets/{collapse-Dezh2CAn.js → collapse-UWItJur2.js} +1 -1
- package/dist/assets/{config-navigation-BXm4eTU9.js → config-navigation-D7hjrTsx.js} +3 -3
- package/dist/assets/{connect-to-Dyd-KizX.js → connect-to-DUMdqErZ.js} +1 -1
- package/dist/assets/{cssMode-B6wVTcZ6.js → cssMode-OQuv2wel.js} +1 -1
- package/dist/assets/{de-DjoPhrWS.js → de-BXIXPwxt.js} +1 -1
- package/dist/assets/{delete-confirm-BzjquUay.js → delete-confirm-i_RblorR.js} +1 -1
- package/dist/assets/{depsEqual-DIBRq7Fr.js → depsEqual-CLLXOjvx.js} +1 -1
- package/dist/assets/{detail-DFtAGu9W.js → detail-SmxG2E5W.js} +3 -3
- package/dist/assets/{domains-BKhbtqSe.js → domains-Bxk0d7jT.js} +2 -2
- package/dist/assets/{download-B60HlzLV.js → download-DtuXp01T.js} +12 -12
- package/dist/assets/{edit.svg-Ad7pR1Ko.js → edit.svg-BhSUheUT.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-BE8-ertk.js +1 -0
- package/dist/assets/engine-ByaR-FMJ.js +1 -0
- package/dist/assets/{es-BLM6BW2Z.js → es-DJvu101w.js} +1 -1
- package/dist/assets/{fr-DM9fauTH.js → fr-D9eGKSnG.js} +1 -1
- package/dist/assets/{freemarker2-sCWMHP7f.js → freemarker2-CSRF4Izm.js} +1 -1
- package/dist/assets/{get-safe-url-CXm2qbfD.js → get-safe-url-CO9heLC_.js} +1 -1
- package/dist/assets/getValidReactChildren-yMK1JaZz.js +1 -0
- package/dist/assets/{graphqlMode-NDLjYpwF.js → graphqlMode-Y3Syqq4-.js} +2 -2
- package/dist/assets/{handlebars-D5m3wM2h.js → handlebars-C5wgXGwl.js} +1 -1
- package/dist/assets/{hi-DgD0hgry.js → hi-CSHwUi_Z.js} +1 -1
- package/dist/assets/{html-CnanFkII.js → html-_LQ37iNF.js} +1 -1
- package/dist/assets/{html-title-Bv34eYvs.js → html-title-D7IA5_Dw.js} +1 -1
- package/dist/assets/{htmlMode-Dti9PEXK.js → htmlMode-CYNIx1xO.js} +1 -1
- package/dist/assets/{id-DRypmlkS.js → id-Dc-m_i57.js} +1 -1
- package/dist/assets/{iframe-B3SxZf1n.js → iframe-Cmb-t7Zd.js} +1 -1
- package/dist/assets/{index-DpI-XQ1l.js → index-50D2VUJd.js} +1 -1
- package/dist/assets/index-5CUDmo0b.js +11 -0
- package/dist/assets/{index-Blaj76Z0.js → index-7iaj_w93.js} +1 -1
- package/dist/assets/{index-CCbDqQl1.js → index-B4Clf5Is.js} +1 -1
- package/dist/assets/{index-D_KMww7L.js → index-B4M5fNtl.js} +1 -1
- package/dist/assets/{index-20ehiOeZ.js → index-BEosxyQ-.js} +1 -1
- package/dist/assets/{index-DiP98lQ7.js → index-BOJNvmUd.js} +1 -1
- package/dist/assets/{index-Cf_UuTrD.js → index-BQOJioXe.js} +11 -11
- package/dist/assets/{index-CFj27rKT.js → index-BTLRRIeH.js} +9 -9
- package/dist/assets/{index-9ZjKwjlW.js → index-BUYTK_02.js} +1 -1
- package/dist/assets/{index-efuh0Sux.js → index-BZaAN-VG.js} +1 -1
- package/dist/assets/{index-BvA1-xFo.js → index-BmtqDcN9.js} +1 -1
- package/dist/assets/{index-Bls5HB_P.js → index-Bs51pyjo.js} +1 -1
- package/dist/assets/{index-d42V1PV6.js → index-BxSe45Us.js} +1 -1
- package/dist/assets/{index-D4dcj0uz.js → index-C3GHA9Mq.js} +1 -1
- package/dist/assets/{index-B_2YBbna.js → index-C7AV4hRT.js} +1 -1
- package/dist/assets/{index-cjrclHNq.js → index-CAA85gOc.js} +1 -1
- package/dist/assets/{index-C_rTOaKu.js → index-CGgu2xDj.js} +3 -3
- package/dist/assets/index-CMuL6EA4.js +602 -0
- package/dist/assets/{index-DNRbXVNA.js → index-CPZEAvjw.js} +1 -1
- package/dist/assets/index-CR9frGrE.js +1 -0
- package/dist/assets/{index-PBerjRVW.js → index-CaxSNZzZ.js} +1 -1
- package/dist/assets/{index-D2dk65xX.js → index-CqD2fBUt.js} +97 -97
- package/dist/assets/{index-B9Ylk5Gm.js → index-CxHR01Rd.js} +3 -3
- package/dist/assets/{index-CWYVBDEB.js → index-D0H3PjUo.js} +1 -1
- package/dist/assets/{index-Bvj_iHG0.js → index-DBwi0mrP.js} +1 -1
- package/dist/assets/{index-kKVyr3jd.js → index-DDWxd2Ux.js} +1 -1
- package/dist/assets/{index-DFXj2mzy.js → index-DM9qDnRm.js} +1 -1
- package/dist/assets/{index-6PyJTHfC.js → index-DU2ssP7d.js} +3 -3
- package/dist/assets/{index-4YU_ikpW.js → index-DaPV0E1i.js} +1 -1
- package/dist/assets/{index-5QQWHLxz.js → index-DhjgCBSh.js} +1 -1
- package/dist/assets/{index-DBvsoi5Z.js → index-DpQcmMsP.js} +1 -1
- package/dist/assets/{index-DE8jtmRi.js → index-DuvpHuQS.js} +1 -1
- package/dist/assets/{index-BXeAZx39.js → index-DxXsj_BT.js} +1 -1
- package/dist/assets/{index-DHo8_7tw.js → index-DyXybTnU.js} +1 -1
- package/dist/assets/{index-DBGC5o42.js → index-KVQaYJ5Y.js} +1 -1
- package/dist/assets/{index-DiXR_x6S.js → index-OepyDXYU.js} +1 -1
- package/dist/assets/{index-BcnRn-Tc.js → index-S1_KC8Yl.js} +1 -1
- package/dist/assets/{index-k42VQ_AF.js → index-TFXeoKpv.js} +1 -1
- package/dist/assets/{index-DDnvl7tL.js → index-ZZeybSqq.js} +1 -1
- package/dist/assets/{index-HNAwOsYz.js → index-aZuZZsqe.js} +1 -1
- package/dist/assets/{index-JWFVT8uF.js → index-hHL_v0H9.js} +1 -1
- package/dist/assets/{index-B3l3haQa.js → index-kAJasXw_.js} +1 -1
- package/dist/assets/{index-DglyPV4Y.js → index-pskT-PqN.js} +2 -2
- package/dist/assets/{index-D-M7NZke.js → index-qOevQjkj.js} +1 -1
- package/dist/assets/{index.esm-DXYSp_08.js → index.esm-0YKGK8i_.js} +1 -1
- package/dist/assets/{install-from-url-CNnVXR83.js → install-from-url-xkTAZofh.js} +1 -1
- package/dist/assets/{invitation-DOJxBbSJ.js → invitation-COGTm43o.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-DMtF094s.js → is-path-prefix-equal-8gdmSIzT.js} +1 -1
- package/dist/assets/{item-B5y2JEkY.js → item-DVoxQKtM.js} +1 -1
- package/dist/assets/{ja-BgI9SuxS.js → ja-DuWRl1OM.js} +1 -1
- package/dist/assets/{javascript-RMUsL7C4.js → javascript-9DHIuu8w.js} +1 -1
- package/dist/assets/{jsonMode-BdWDqW6d.js → jsonMode-DrQT0Rrg.js} +1 -1
- package/dist/assets/{ko-DxWYUlEG.js → ko-YalU3HfD.js} +1 -1
- package/dist/assets/{liquid-Br_d4nY3.js → liquid-1g4gJZY5.js} +1 -1
- package/dist/assets/{list-header-BKASZXQp.js → list-header-CNhWtGQP.js} +1 -1
- package/dist/assets/{log-DfyebCKD.js → log-Cv5rHloz.js} +1 -1
- package/dist/assets/{lottie-react.esm-DH7e7xCE.js → lottie-react.esm-C6YuAEWV.js} +1 -1
- package/dist/assets/{mdx-BWMokGXT.js → mdx-B-cv_j71.js} +1 -1
- package/dist/assets/{memory-EbVEVJ3v.js → memory-DPkaeOl7.js} +1 -1
- package/dist/assets/{metric-DF4CaZpP.js → metric-CiNgShR5.js} +1 -1
- package/dist/assets/omit-C5UyCO0S.js +1 -0
- package/dist/assets/{overview-Iijq_Ko4.js → overview-BA5biw-O.js} +1 -1
- package/dist/assets/{permission-Br1rNOjb.js → permission-DZQgH-wh.js} +1 -1
- package/dist/assets/{preference-DZ8p0ZAt.js → preference-auzdU7Dy.js} +3 -3
- package/dist/assets/{pt-DeehC2Gk.js → pt-B3IRBzK6.js} +1 -1
- package/dist/assets/{python-Drb_6EJR.js → python-tC148uh2.js} +1 -1
- package/dist/assets/{raf-schd.esm-DBpZPfTe.js → raf-schd.esm-2IIbMYWO.js} +1 -1
- package/dist/assets/{razor-CqhXoL3w.js → razor-DOE4a2El.js} +1 -1
- package/dist/assets/{rotate-session-key-sbLLFax2.js → rotate-session-key-Bdv8tRY6.js} +1 -1
- package/dist/assets/{ru-DGlqMwrt.js → ru-BEEcST35.js} +1 -1
- package/dist/assets/{runtime-Gcr9Fi-g.js → runtime-CQbc5vgt.js} +1 -1
- package/dist/assets/schema-ObohfjTu.js +1 -0
- package/dist/assets/sdk-Yo848YWX.js +1 -0
- package/dist/assets/{service-wMVBEYj5.js → service-mTfNIC7m.js} +1 -1
- package/dist/assets/{shorten-label-COTK-Aqe.js → shorten-label-B8e0Bk0t.js} +1 -1
- package/dist/assets/{simple-select-Jvgt7OyG.js → simple-select-IWkCsCtv.js} +1 -1
- package/dist/assets/{spaces-Ds86J12r.js → spaces-DrkRFkPj.js} +1 -1
- package/dist/assets/{status-CikSPd5y.js → status-BaKGKdEv.js} +1 -1
- package/dist/assets/{status-DSta50m1.js → status-L8y4a0he.js} +1 -1
- package/dist/assets/{switch-control-BcMqvX98.js → switch-control-DzVAWrsU.js} +1 -1
- package/dist/assets/{table-icons-BaaufujD.js → table-icons-CzZoaBLP.js} +1 -1
- package/dist/assets/{team-WiS8_opu.js → team-upwNpr8j.js} +1 -1
- package/dist/assets/{th-DH3YSYWo.js → th-DYSyn_pj.js} +1 -1
- package/dist/assets/{toLower-J-761LZs.js → toLower-By3wiYQ5.js} +1 -1
- package/dist/assets/toUpper-WFb-_EjO.js +1 -0
- package/dist/assets/{traffic-i-oajLGo.js → traffic-oApG71Gy.js} +1 -1
- package/dist/assets/{tsMode-BqPXeNK6.js → tsMode-3JYy3Rny.js} +1 -1
- package/dist/assets/{typescript-BeMpQ1cp.js → typescript-BpFSqCb2.js} +1 -1
- package/dist/assets/{url-evaluation-BHlD72Za.js → url-evaluation-CboxDo9a.js} +1 -1
- package/dist/assets/{url-join-Be8UMYxb.js → url-join-4f83ALpx.js} +1 -1
- package/dist/assets/{use-mobile-DKnUPYLh.js → use-mobile-ByGodlLU.js} +1 -1
- package/dist/assets/{use-mobile-CFKbUUod.js → use-mobile-DHBy85Ov.js} +1 -1
- package/dist/assets/{useAsync-BvyaX1xb.js → useAsync-DAJnGdBq.js} +1 -1
- package/dist/assets/{useAsyncRetry-COLHYiqH.js → useAsyncRetry-BFx8IbqU.js} +1 -1
- package/dist/assets/{useLocalStorage-CcnFSYKq.js → useLocalStorage-4sgI3E92.js} +1 -1
- package/dist/assets/{useThemeProps-12AJ9O-O.js → useThemeProps-ATydoH1u.js} +1 -1
- package/dist/assets/{util-BN8LJS24.js → util-DH4frn9i.js} +1 -1
- package/dist/assets/{vi-B-WRpo9V.js → vi-BvKqvojn.js} +1 -1
- package/dist/assets/{wait-container-BeVXHkhI.js → wait-container-CJvrIzPn.js} +1 -1
- package/dist/assets/{without-wallet-Ciw14vC_.js → without-wallet-BxHS9HA2.js} +1 -1
- package/dist/assets/wrap-locale-C7k7RLj9.js +1 -0
- package/dist/assets/{xml-CPmGSa9a.js → xml-9s8DQRAB.js} +1 -1
- package/dist/assets/{yaml-Bgt1uL1Q.js → yaml-D0a0z0M-.js} +1 -1
- package/dist/assets/{zh-jdBEl5u8.js → zh-BaEjqGHy.js} +1 -1
- package/dist/assets/{zh-tw-2esms75_.js → zh-tw-xcyHbP3V.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-BKRskDGW.js +0 -1
- package/dist/assets/api-CNS9XStH.js +0 -1
- package/dist/assets/chain-DApQ_02_.js +0 -6
- package/dist/assets/client-CRwMqq4a.js +0 -1
- package/dist/assets/cloneDeep-XzHe1lBt.js +0 -1
- package/dist/assets/download-1sZ_L4eJ.css +0 -32
- package/dist/assets/emotion-cache.browser.esm-xd7x6o_F.js +0 -1
- package/dist/assets/engine-6r3-G42f.js +0 -1
- package/dist/assets/getValidReactChildren-Dx-rXSuI.js +0 -1
- package/dist/assets/index-BvZ7ueS0.js +0 -602
- package/dist/assets/index-Djt_Uvu7.js +0 -1
- package/dist/assets/index-DyWKbsNy.js +0 -11
- package/dist/assets/omit-DCOcIQME.js +0 -1
- package/dist/assets/schema-CtGZqsss.js +0 -1
- package/dist/assets/sdk-bmyf6_R7.js +0 -1
- package/dist/assets/toUpper-DndvmnJP.js +0 -1
- package/dist/assets/wrap-locale-B-zny1Rh.js +0 -1
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CGgu2xDj.js","./index-CqD2fBUt.js","./index-DGkT7afN.css","./url-join-4f83ALpx.js","./index-aZuZZsqe.js","./_createAggregator-6qCBlT2m.js","./depsEqual-CLLXOjvx.js","./index-TFXeoKpv.js","./index-DRYJ0xIl.js","./toUpper-WFb-_EjO.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aG as qe,j as e,dr as bs,gs as js,iq as ws,m as ae,bn as ge,N as O,az as Ce,H as Y,o as g,f as gt,r as S,g as be,bA as st,b as ye,J as ne,X as Dn,bz as ft,Y as he,ir as _s,t as xe,s as re,a4 as fe,aV as oo,T as ie,$ as Yt,dG as mt,y as Se,b8 as Ss,bE as Es,E as G,b1 as ks,gf as Rs,gg as Ts,C as ve,f4 as so,ht as Mn,x as Ps,ax as Gt,w as Is,is as Ds,it as Bs,v as Be,iu as Us,Z as Os,a0 as Ns,iv as io,bo as ao,U as Ne,fa as Ls,f1 as As,aB as zs,aC as Ms,bk as qs,aD as Fs,aE as ue,aO as $s,cN as Ws,S as Hs,eN as or,bi as Gs,h as Ks,dv as It,iw as Vs,f_ as lo,ix as Ys,iy as Zs,ey as pe,iz as co,dE as Qs,gJ as Js,h7 as Xs,iA as ei,cE as sr,ho as qn,av as ti,dH as Zt,dn as ze,bq as ni,br as ir,z as ri,cq as oi,G as Me,aP as ar,fL as uo,cr as Ke,h3 as si,by as kt,hw as ii,fp as lr,bg as ai,L as xt,F as po,bm as li,_ as ci,O as Rt,aZ as Fn,iB as di,a_ as Le,aA as cr,cL as ui,ad as it,aM as fo,bS as $n,cw as pi,iC as fi,b9 as mi,A as mo,aU as Bn,p as hi,aS as ut,P as dn,W as gi,bB as ho,aJ as xi,bt as yi,aR as vi,fg as dr,iD as ur,gC as pr,V as fr,cK as Ci,gA as bi,bR as ji,iE as wi}from"./index-CqD2fBUt.js";import{y as _i}from"./index-hHL_v0H9.js";import{a as Si,c as Ei,d as ki,u as Wn,R as Ri}from"./actions-Lc_gpmy_.js";import{S as Ti}from"./switch-control-DzVAWrsU.js";import{u as Ie}from"./blocklet-CXBJcwmD.js";import{P as Un,w as Qt}from"./permission-DZQgH-wh.js";import{E as go}from"./Edit-CVMHb0TK.js";import{T as Pi,M as Ii,t as Di}from"./table-icons-CzZoaBLP.js";import{s as Bi,F as xo,L as Ui,I as Oi,a as Tt,S as Ni,B as Li}from"./preference-auzdU7Dy.js";import{C as mr}from"./click-to-copy-CCt7i81W.js";import{v as un}from"./index-BZaAN-VG.js";import{A as Ai}from"./Add-D7FBmxz9.js";import{A as Jt}from"./Link-DxObZpZX.js";import{C as zi,c as Mi,b as qi,f as yo,A as Fi,_ as $i,a as Wi,e as Hi,d as vo,s as Gi,L as Ki,u as Vi,g as Yi,S as Zi}from"./item-DVoxQKtM.js";import{T as Qi,L as Ji,a as On,u as hr,W as Xi,P as ea}from"./index-BxSe45Us.js";import{e as Co}from"./engine-ByaR-FMJ.js";import{u as ta,C as na,D as ra,a as oa,b as sa}from"./connect-to-DUMdqErZ.js";import{C as ia,u as aa,A as la}from"./agreement-nMH2PwNa.js";import{A as ca,a as da,b as ua,c as pa,R as ot,S as dt}from"./collapse-UWItJur2.js";import{D as bo}from"./Done-Bvnq95wW.js";import{C as fa,a as ma}from"./Google-CnSXuxho.js";import{I as jo,f as ha,a as ga,B as xa}from"./install-from-url-xkTAZofh.js";import{a as gr}from"./api-C4QD0LkR.js";import{v as wo,e as ya,a as Kt}from"./util-DH4frn9i.js";import{u as _o}from"./use-mobile-ByGodlLU.js";import{A as va}from"./ArrowDropDown-CGRxh8gD.js";import{u as Ca}from"./useLocalStorage-4sgI3E92.js";import{r as Xt}from"./index-aZuZZsqe.js";import{b as Hn}from"./without-wallet-BxHS9HA2.js";import{E as So}from"./ErrorOutline-B2Mw_vUr.js";import{H as ba}from"./HelpOutline-CNZGWmTU.js";import{D as en,W as ht,R as ja,a as xr}from"./url-evaluation-CboxDo9a.js";import{L as Eo}from"./Launch-CmazaRGZ.js";import{D as wa}from"./delete-confirm-i_RblorR.js";import{B as ko}from"./status-L8y4a0he.js";import{A as Ro}from"./actions-CwHV7VOi.js";import{v as pn}from"./index-50D2VUJd.js";import{t as _a}from"./toUpper-WFb-_EjO.js";import{S as Sa}from"./Switch-BA5PH6p0.js";import{a as Ea}from"./team-upwNpr8j.js";import"./MoreVert-CpVaEDbL.js";import"./get-safe-url-CO9heLC_.js";import"./ButtonGroup-CToFieon.js";import"./getValidReactChildren-yMK1JaZz.js";import"./FilterList-agXhdRax.js";import"./CSSTransition-DG0p2bDc.js";import"./emotion-cache.browser.esm-BE8-ertk.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-2IIbMYWO.js";import"./redux-DfszZyTl.js";import"./useThemeProps-ATydoH1u.js";import"./html-title-D7IA5_Dw.js";import"./Clear-wN_lM9i_.js";import"./ChevronRight-pNcrG18Z.js";import"./ChevronLeft-ClJUpIrX.js";import"./Search-C1hYBh2z.js";import"./omit-C5UyCO0S.js";import"./edit.svg-BhSUheUT.js";import"./index-TFXeoKpv.js";import"./iframe-Cmb-t7Zd.js";import"./Autocomplete-Bj2hcqGf.js";import"./ListSubheader-CjL9mMf3.js";import"./Verified-B9q95gmQ.js";import"./VerifiedUser-CPgjTUes.js";import"./DeleteOutline-0Pjk0X04.js";import"./url-join-4f83ALpx.js";import"./index-BojVbZw0.js";import"./spaces-DrkRFkPj.js";import"./OpenInNew-zVEoRj2W.js";import"./index-DRYJ0xIl.js";import"./index-BmtqDcN9.js";import"./decode-DPztD6kB.js";import"./cloneDeep-DZJaLQYA.js";import"./ListItemButton-Bk_S-24I.js";import"./Stepper-Bax0qACN.js";import"./is-path-prefix-equal-8gdmSIzT.js";const ka=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ra=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),To=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Ta=qe(e.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"})),Po=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Pa=qe(e.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"})),Ia=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Da=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Ba=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function yr(t,r){var n={};return r=bs(r),js(t,function(i,a,s){ws(n,a,r(i,a,s))}),n}function Io({children:t=null,...r}){const{t:n}=ae(),{api:i}=ge(),{blocklet:a}=Ie(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),Y.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){Y.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(Ce,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ti,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Io.propTypes={children:g.any};function vr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Ua={...yr(Di,vr),...yr(Si,vr)},Oa=(t,r)=>{let{description:n}=t;return(Object.values(ye.CHAIN_PROP_MAP).includes(t.key)||ne.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},fn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,Cr=t=>[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),mn=t=>[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Do({blocklet:t,ancestors:r=[]}){const n=ge(),{palette:i}=gt(),{inService:a}=n,{t:s}=S.useContext(be),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>Y.success(s("blocklet.config.changedTip")),d=o=>fn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,C)=>{if(!o.key.trim()||!o.value.trim()){Y.error(s("blocklet.config.environment.keyValueRequired")),C();return}if(Cr(o.key)===!1){Y.error(s("blocklet.config.environment.invalidKey")),C();return}o.custom=mn(o.key);try{const E=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(E.blocklet),h()}catch(E){Y.error(he(E)),C()}}),y=(o,h)=>new Promise(async(C,E)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){Y.error(s("blocklet.config.environment.keyValueRequired")),E();return}if(Cr(o.key)===!1){Y.error(s("blocklet.config.environment.invalidKey")),E();return}if(o.key===ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const z=_s(o);if(z){Y.error(z),E();return}}const _=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!fn(o,t,r)){Y.error("Only key of custom env can be changed"),E();return}_.push({key:h.key,custom:mn(o.key)})}try{const z=await n.api.configBlocklet({input:{did:m,configs:_}});c(z.blocklet),C()}catch(z){Y.error(he(z)),E()}}),p=o=>new Promise(async(h,C)=>{if(o.required){Y.error(s("blocklet.config.environment.deleteForbidden")),C();return}if(!fn(o,t,r)){Y.error("Only key of custom env can be changed"),C();return}try{const E=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:mn(o.key)}]}});c(E.blocklet),h()}catch(E){Y.error(he(E)),C()}}),v=(t.configs||[]).filter(o=>!ye.BLOCKLET_CONFIGURABLE_KEY[o.key]||[ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ne.getSharedConfigObj(r[0],t),x=ne.getComponentMissingConfigs(t,r[0]),w=v.map(o=>({...o,value:Object.values(ye.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),b=w.some(o=>o.key&&o.key.startsWith("BWA_")),k={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(mr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:C,onChange:E}=o;return e.jsx(br,{children:e.jsx(xe,{fullWidth:!0,size:"small",value:Bi.escapeTag(h),onChange:_=>E(_.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(C)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(mr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:C,onChange:E}=o;return e.jsxs(br,{children:[e.jsx(xe,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:_=>E(_.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Oa(C,s)]})}}];return e.jsxs(Na,{children:[!!x.length&&e.jsx(Dn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),b&&e.jsx(Dn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Pi,{className:"config-table",children:e.jsx(Ii,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Ua,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:w,editable:o?k:{}})})})]})}Do.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const Na=re.div`
|
|
3
|
+
.config-table {
|
|
4
|
+
margin-bottom: 24px;
|
|
5
|
+
position: relative;
|
|
6
|
+
.hide-control {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 10px;
|
|
9
|
+
left: 200px;
|
|
10
|
+
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
11
|
+
left: 160px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.MuiToolbar-root {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MuiTableRow-head {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.hide-header {
|
|
24
|
+
.MuiToolbar-root {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.accordion {
|
|
31
|
+
margin-bottom: 16px;
|
|
32
|
+
&:last-of-type {
|
|
33
|
+
margin-bottom: 0;
|
|
34
|
+
}
|
|
35
|
+
padding: 8px 0 8px 0px;
|
|
36
|
+
&.MuiAccordion-root {
|
|
37
|
+
background: transparent;
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
border: 1px solid #ddd;
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
&::before,
|
|
42
|
+
&::after {
|
|
43
|
+
height: 0;
|
|
44
|
+
}
|
|
45
|
+
.MuiAccordionSummary-root {
|
|
46
|
+
padding-left: 0;
|
|
47
|
+
}
|
|
48
|
+
.accordion-title {
|
|
49
|
+
font-weight: bold;
|
|
50
|
+
padding-left: 16px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,br=re.div`
|
|
55
|
+
height: 60px;
|
|
56
|
+
`;function Gn({open:t=!1,onClose:r=null,hiddenChildren:n=!1,blocklet:i,ancestors:a=[],children:s=null}){const[m,c]=S.useState(!1),{t:d}=ae(),l=d("environmentFor",{name:ne.getDisplayName(i,!0)});if(st(i.status)||i.status==="unknown"&&st(i.status))return null;const y=()=>{r?.(),c(!1)},p=f=>{f.stopPropagation(),c(!0)};let v=null;return n||(v=typeof s=="function"?s({open:p}):e.jsx(fe,{onClick:p,"data-cy":"action-config-component",children:e.jsx(go,{})})),e.jsxs(e.Fragment,{children:[v,(t||m)&&e.jsx(La,{open:!0,fullWidth:!0,maxWidth:"md",title:l,onClose:y,PaperProps:{style:{minHeight:"auto",backgroundImage:"none"}},children:e.jsxs(oo,{sx:{gap:0},children:[e.jsx(ie,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:d("description.environment",{name:ne.getDisplayName(i,!0)})}),e.jsx(Do,{blocklet:i,ancestors:a})]})})]})}Gn.propTypes={blocklet:g.object.isRequired,ancestors:g.array,children:g.any,open:g.bool,onClose:g.func,hiddenChildren:g.bool};const La=re(Yt)`
|
|
57
|
+
.MuiDialogContent-root {
|
|
58
|
+
padding-top: 0;
|
|
59
|
+
padding-bottom: 24px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.MuiToolbar-root {
|
|
63
|
+
padding-right: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ux-dialog_closeButton {
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
`,Aa=S.lazy(()=>Es(()=>import("./index-CGgu2xDj.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(t=>({default:t.Uploader}))),za="/blocklet/component/upload",jr=[".html",".htm",".tgz",".zip"],Ma=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||G.MAX_UPLOAD_FILE_SIZE,qa=Ma*1024*1024;function Bo({did:t,prefix:r,headers:n=()=>({}),onUploaded:i=mt,open:a=!1,onClose:s=mt}){const{t:m,locale:c}=ae(),d=S.useRef(null),l=S.useCallback(y=>{const{status:p,data:v}=y;if(p===200){i(v);return}Y.error(m("blocklet.component.addComponentTip.uploadFailed"))},[i,m]);return S.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),e.jsx(Fa,{id:`component-uploader-${t}`,children:e.jsx(Aa,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:s,installerProps:{disabled:!0},apiPathProps:{uploader:Se(r,za,t),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:jr,maxFileSize:qa,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:m("blocklet.component.addComponentTip.allowedFileTypes",{types:jr.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${t}`)}Bo.propTypes={did:g.string.isRequired,prefix:g.string.isRequired,open:g.bool,headers:g.func,onUploaded:g.func,onClose:g.func};const Fa=Ss(O)`
|
|
70
|
+
.uploader-wrapper {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
position: relative;
|
|
73
|
+
font-size: 0px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
&.enabled {
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
&::after {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
&.enabled::after {
|
|
82
|
+
display: block;
|
|
83
|
+
opacity: 1;
|
|
84
|
+
position: absolute;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
background: rgba(0, 0, 0, 0.3);
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
height: 2.2em;
|
|
90
|
+
color: white;
|
|
91
|
+
text-align: center;
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
line-height: 2em;
|
|
94
|
+
transition: opacity 0.3s ease;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`,Kn={description:g.string,editing:g.bool,onChange:g.func,required:g.bool,value:g.any,componentProps:g.object,render:g.func,renderFormItem:g.func};function Vn({editing:t,value:r,onChange:n}){const[i,a]=S.useState(!1),s=S.useRef(),m=S.useRef(r);S.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{a(!0)},50)),()=>{clearTimeout(p)}},[t]);const c=p=>{m.current=p,n(p)},d=()=>{a(!1),n(m.current)},l=e.jsx(O,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[r,r!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:r,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),y=e.jsxs(O,{onKeyDown:d,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(O,{onClick:()=>a(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:s,style:{flexShrink:0,marginLeft:"8px",backgroundColor:r,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:r==="auto"?"default":"pointer"}})}),e.jsx(ks,{open:i,anchorEl:s.current,onClose:()=>a(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(fa,{color:r,onChange:p=>c(p.hex)})})]});return t?y:l}Vn.propTypes=Kn;function Uo({editing:t,description:r,value:n,onChange:i,componentProps:a={},...s}){const{placeholder:m}=a,c=S.useRef(n),{t:d}=S.useContext(be),l=p=>{p.key==="Enter"&&i(c.current,"confirm")},y=p=>{c.current=p,i(p)};return t?e.jsx(xe,{style:{flex:1},fullWidth:!0,value:n,onChange:p=>{p.persist(),y(p.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:r||m,onKeyDown:l,...s}):e.jsx(O,{className:"form-item-input slot",sx:{px:1},children:n||e.jsx("span",{className:"placeholder",children:d("common.requiredInputPlaceholder",{name:r||m})})})}Uo.propTypes=Kn;function Oo({editing:t,value:r,onChange:n,componentProps:i,...a}){const{blocklet:s}=i,m=r==="auto"?Rs(s.appDid):r;return e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ts({title:"Owner",issuer:ne.getDisplayName(s),issuerDid:s.appDid,ownerName:"Your Name",ownerDid:s.appDid,preferredColor:r||"auto"})}}),e.jsx(Vn,{...a,editing:t,value:t?m:r,onChange:n,componentProps:i})]})}Oo.propTypes={...Kn,componentProps:g.shape({blocklet:g.object.isRequired}).isRequired};const $a=Mn`
|
|
98
|
+
0%, 100% {
|
|
99
|
+
transform: scale(1) translateX(0);
|
|
100
|
+
}
|
|
101
|
+
50% {
|
|
102
|
+
transform: scale(1.05) translateX(-3px);
|
|
103
|
+
}
|
|
104
|
+
25%, 75% {
|
|
105
|
+
transform: scale(1.1) translateX(3px);
|
|
106
|
+
}
|
|
107
|
+
`,Wa={input:Uo,color:Vn,passport:Oo,uploader:t=>e.jsx(Ui,{...t.componentProps})};function Ha(t,{editing:r=!1}){const{componentType:n="input",render:i,renderFormItem:a}=t;return r&&a?a:!r&&i?i:Wa[n?.toLowerCase()]}Yn.propTypes={item:g.object.isRequired,findEditingItem:g.func.isRequired,getItemValue:g.func.isRequired,onFormItemChange:g.func.isRequired,onFocusOut:g.func.isRequired,disabled:g.bool,loading:g.bool,onCancel:g.func,formValues:g.object.isRequired};function Yn({item:t,findEditingItem:r,getItemValue:n,onFormItemChange:i,onFocusOut:a,disabled:s=!1,loading:m=!1,onCancel:c=()=>{},formValues:d}){const{key:l,description:y,required:p,solo:v=!1,hidden:f=!1,componentProps:x={},skipButtonDisabled:w=!1}=t;if(f)return null;const b=r(l),{editing:k,shaking:u}=b??{},o=n(t,{editing:k}),h=Ha(t,{editing:k}),C={inputProps:{"data-cy":"schema-form-item-component"},key:l,description:y,editing:k,value:o,onChange:(E,_="change")=>i(t,E,_),componentProps:x,skipButtonDisabled:w,onBlur:()=>a(t)};return t.componentType==="collapse"&&t.children?.length>0?e.jsxs(ca,{children:[e.jsx(da,{expandIcon:e.jsx(ua,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:t.description}),e.jsx(pa,{children:t.children.map(E=>e.jsx(Yn,{item:E,findEditingItem:r,getItemValue:n,onFormItemChange:i,onFocusOut:a,formValues:d,disabled:s,loading:m,onCancel:c},E.key))})]}):e.jsxs(O,{className:"form-item",children:[!v&&e.jsxs(O,{className:"form-item-label",sx:{color:p&&!o?"error.main":"text.secondary"},children:[y,p&&e.jsx(ot,{})]}),e.jsxs(O,{className:"form-item-body",children:[e.jsx(O,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:v?"center":"left"},style:{cursor:"text"},onClick:()=>{s||b?.edited||w||i(t,d[l],"edit")},children:e.jsx(h,{...C})}),!v&&e.jsx(O,{className:"form-item-action",style:{marginLeft:0},children:k?e.jsxs(e.Fragment,{children:[b.edited?e.jsx(fe,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(t,o,"confirm")},disabled:s||m,sx:{animation:u?`${$a} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:m?e.jsx(ve,{size:24}):e.jsx(bo,{})}):null,e.jsx(fe,{"data-cy":"schema-form-item-cancel",onClick:()=>c(t),style:{paddingLeft:b.edited?4:8},disabled:s||m,size:"large",children:e.jsx(so,{})})]}):null})]})]},l)}function No({schema:t,loading:r=!1,value:n=void 0,defaultValue:i={},onChange:a,style:s={},disabled:m=!1}){const c=Object.prototype.toString.call(n)==="[object Object]",[d,l]=S.useState([]),[y,p]=S.useState(c?n:i),v=S.useMemo(()=>t.length===1,[t]),f=S.useCallback(h=>d.find(C=>C.key===h),[d]);S.useEffect(()=>{v&&t[0]?.required&&l([{key:t[0].key,editing:!0,initialValue:i[t[0].key]}])},[t,v,i]);const x=S.useCallback(h=>{l(C=>C.find(_=>_.key===h.key)?C.map(_=>_.key===h.key?h:{..._}):[h].concat(C))},[]),w=S.useCallback((h,C,E)=>{const{key:_,secure:z}=h,F=f(_)??{...h};F.editing=!0;const U=y[_]!==C;F.edited=C&&F.initialValue!==C,F.initialValue=i[_];const B={...y,[_]:C};U&&p(B),a({[_]:C},{allValues:B,action:E,currentItem:h}),E==="confirm"&&z&&p({...y,[_]:"__encrypted__"}),E==="confirm"&&(F.initialValue=y[_]),["confirm","cancel"].includes(E)&&(F.editing=!1,F.edited=!1),x(F)},[i,y,a,x,f]),b=S.useCallback((h,{editing:C=!1})=>{const{key:E}=h,_=c?n[E]:y[E];return _==="__encrypted__"?C?"":"******":_},[c,n,y]),k=S.useCallback(h=>{const C=f(h.key);C&&w(h,C.initialValue,"cancel")},[f,w]),u=S.useCallback(h=>{const C=f(h.key);!C||!C.edited||(C.shaking=!0,x(C),setTimeout(()=>{C.shaking=!1,x(C)},500))},[f,x]),o=S.useCallback(h=>{const C=f(h.key);!C||!C.edited?k(h):u(h)},[f,u,k]);return e.jsx(Ga,{className:"form",style:s,children:t?.map(h=>{const{hidden:C=!1}=h;return C?null:e.jsx(Yn,{item:h,findEditingItem:f,getItemValue:b,onFormItemChange:w,onFocusOut:o,formValues:y,disabled:m,loading:r,onCancel:k})})})}No.propTypes={schema:g.array.isRequired,loading:g.bool,onChange:g.func.isRequired,value:g.object,defaultValue:g.object,style:g.object,disabled:g.bool};const Ga=re(xo)``;function Lo({meta:t,onCancel:r,mode:n,handlePaySuccess:i=()=>{}}){const{t:a,locale:s}=ae(),{info:m}=ge(),c=Ps(m),[d,l]=S.useState(null),y=new URL(t?.registryUrl).origin,p=ne.getDisplayName({meta:t}),v=async(x,w)=>{const b=({downloadTokenList:o})=>{i({downloadTokenList:o})},k=o=>{Y.error(o),r(o)};function u(o){return Bs(()=>gr.get(o).then(async({data:h})=>{const C=h?.downloadTokenList;if(h.status==="succeed"){if(C&&C.length)await b({downloadTokenList:C});else return await k(a("blocklet.component.missDownloadTokenTip")),!0;return!0}return h.status==="error"?(console.error("vc error: ",h),await k(h?.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&d){const{statusUrl:o}=Ds(d);await u(o)}else await b({downloadTokenList:x.downloadTokenList&&w(x.downloadTokenList)})};if(S.useEffect(()=>{if(n==="purchase"){const x=new URL(y);x.pathname="/api/did/verify-purchase-blocklet/token",x.searchParams.set("serverDid",m.did),x.searchParams.set("blockletDid",t?.did);try{gr.get(x.href).then(({data:w})=>{const b=`${w.url}`;l(b)})}catch(w){console.error("get next workflow url error: ",w)}}return()=>{l(null)}},[n]),n==="purchase"&&!d)return"";const f={verify:{action:"verify-purchase-blocklet",checkFn:Gt.create({baseURL:y}).get,extraParams:{serverDid:m.did,blockletDid:t?.did},messages:{title:a("store.purchase.verify.auth.title",{name:p}),scan:a("store.purchase.verify.auth.scan"),confirm:a("store.purchase.verify.auth.confirm"),success:a("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Gt.create({baseURL:Se(y,"/store")}).get,extraParams:{factory:t.nftFactory,nw:d},messages:{title:a("store.purchase.auth.title",{name:p}),scan:a("store.purchase.auth.scan"),confirm:a("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:a("store.purchase.auth.success")}),e.jsx("p",{children:a("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Is,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:y,onSuccess:v,cancelWhenScanned:r,onClose:r,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...f[n]})}Lo.propTypes={...Mi,handlePaySuccess:g.func,mode:g.oneOf(["verify","purchase"]).isRequired};function Ao({ref:t=null,mode:r,...n}){const[i,a]=S.useState(r!=="both"?r:"verify"),[s,m]=S.useState(r!=="both"?2:1),c=l=>{l!==i&&a(l)},d=()=>{i&&s!==2&&m(2)};return S.useImperativeHandle(t,()=>({onNext:d,getCurrentStep:()=>s})),s===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(zi,{action:i,onNext:null,onSelect:c})}):e.jsx(Lo,{...n,mode:i})}Ao.propTypes={mode:g.oneOf(["both","verify","purchase"]).isRequired,ref:g.any};function Ka({...t}){return e.jsx(Be,{className:"bottom-button",variant:"contained",color:"primary",...t})}function zo({blocklet:t=null,onStartNow:r=()=>{},children:n=null,disabled:i=!1}){const{t:a}=ae(),s=_o();return!t||Us(t.meta)?e.jsx(Va,{children:n}):e.jsxs(Ya,{isMobile:s,children:[e.jsx(Ka,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>r(),children:a("setup.startNow")}),e.jsx(O,{sx:{display:"flex",alignItems:"center"},children:n})]})}zo.propTypes={blocklet:g.object,onStartNow:g.func,children:g.any,disabled:g.bool};const Va=re(O)`
|
|
108
|
+
width: 100%;
|
|
109
|
+
margin-top: auto;
|
|
110
|
+
padding-top: 24px;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
.bottom-button {
|
|
115
|
+
min-width: 200px;
|
|
116
|
+
}
|
|
117
|
+
${t=>t.theme.breakpoints.down("md")} {
|
|
118
|
+
.bottom-button {
|
|
119
|
+
width: 100%;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`,Ya=re(O)`
|
|
123
|
+
padding-top: 24px;
|
|
124
|
+
margin-top: auto;
|
|
125
|
+
width: 100%;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
.start-now {
|
|
130
|
+
min-width: 140px;
|
|
131
|
+
}
|
|
132
|
+
.bottom-button {
|
|
133
|
+
min-width: 120px;
|
|
134
|
+
}
|
|
135
|
+
${t=>t.theme.breakpoints.down("lg")} {
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
${t=>t.theme.breakpoints.down("md")} {
|
|
140
|
+
.start-now {
|
|
141
|
+
min-width: inherit;
|
|
142
|
+
}
|
|
143
|
+
.bottom-button {
|
|
144
|
+
min-width: 100px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${t=>t.isMobile} {
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
gap: '32px',
|
|
151
|
+
}}
|
|
152
|
+
`;function Mo({blockletMeta:t,onEndpointUpdate:r=()=>{}}){const n=_o(),{blocklet:i}=Ie(),{updateSpaceGateway:a,loading:s,hasStorageEndpoint:m}=ta();return S.useEffect(()=>{r?.()},[i]),s?e.jsx(Os,{relative:"parent",children:e.jsx(ve,{})}):e.jsxs(Za,{children:[e.jsx(O,{sx:{width:n?"360px":"720px"},children:m?e.jsx(na,{}):e.jsx(ra,{})}),t?.capabilities?.didSpace==="required"&&e.jsx(zo,{mt:8,children:e.jsx(oa,{onConnect:a})})]})}Mo.propTypes={blockletMeta:g.any.isRequired,onEndpointUpdate:Ns.func};const Za=re(ia)`
|
|
153
|
+
height: 100%;
|
|
154
|
+
overflow-y: auto;
|
|
155
|
+
padding-bottom: 32px;
|
|
156
|
+
overflow-x: hidden;
|
|
157
|
+
`;function qo({onChange:t=()=>{},loading:r=!1,children:n,extra:i="",stores:a=[],storageKey:s=""}){const{t:m}=ae(),{info:c,inService:d}=ge(),{blocklet:l}=Ie(),[y,p]=S.useState(!1),v=S.useRef(null),[f,x]=S.useState(),[w,b]=Ca(s||"tmp"),[k,u]=s?[w,b]:[f,x],{storeList:o,teamDid:h}=io({fromBlocklet:d,blocklet:l,nodeInfo:c}),C=ao([...a.map(_=>({..._,protected:!0})),...o],"url"),E=k&&C.find(_=>k===_.url)||C[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Qa,{children:[e.jsx(Be,{ref:v,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(va,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:e.jsx(ie,{color:"primary",children:E.name})}),e.jsx(ie,{color:"primary",children:i})]}),e.jsxs(xe,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:m("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:E,autoFocus:!0,onChange:_=>{const z=_.target.value;u(z.url),t(z)},style:{display:"none"},margin:"normal",slotProps:{select:{open:y,MenuProps:{anchorEl:v.current},renderValue:_=>_?.name,onClose:()=>{p(!1)}}},children:[C?.map(_=>e.jsx(Ne,{sx:{width:"400px",maxWidth:"90vw"},value:_,"data-cy":_.url,children:e.jsx(qi,{teamDid:h,store:_,onDelete:()=>{k===_.url&&u(C[0]?.url)}})},_.url)),!yo.isInServerlessMode(c)&&e.jsx(Fi,{disabled:r,storeList:C,teamDid:h,onAdd:_=>{u(_)}})]}),n({currentRegistry:E})]})}qo.propTypes={onChange:g.func,loading:g.bool,children:g.any.isRequired,extra:g.node,storageKey:g.string,stores:g.arrayOf(g.shape({name:g.string.isRequired,url:g.string.isRequired}))};const Qa=re.div`
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
align-items: center;
|
|
161
|
+
margin-bottom: 16px;
|
|
162
|
+
|
|
163
|
+
span {
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
color: ${t=>t.theme.palette.text.primary};
|
|
166
|
+
// font-weight: bold;
|
|
167
|
+
}
|
|
168
|
+
`,Ja={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"/>'},Xa={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>'},el={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"/>'},tl=(t,r)=>Se(r,`/blocklets/${t.did}`),wr=({blocklet:t,attribute:r,value:n})=>t._formatted?t._formatted[r]:n,nl=t=>t.inStore&&ne.isFreeBlocklet(t)===!1;function Fo({blocklet:t,blocklets:r=[],handleButtonClick:n=null,endpoint:i="",serverVersion:a=""}){const{t:s}=ae();let m=Se(i,Fs(t.did,t.logo||""));try{const b=new URL(m);b.searchParams.set("v",t.version||+new Date),m=b.href}catch{}const[c,d]=S.useState(!1),l=async()=>{try{d(!0),await n({meta:t,registryUrl:i,blocklets:r})}catch(b){Y.error(b.message)}finally{d(!1)}},{blocklet:y}=Ie(),p=()=>(y?.children||[]).find(u=>u.meta.bundleDid===t.did).meta.version,f=(()=>{const b=(y?.children||[]).find(k=>k.meta.bundleDid===t.did);if(b){try{const k=b.meta.version,u=t.version;if($s.gt(u,k))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),x=t.requirements?.server,w=[];return f==="upgrade"?w.push({key:"upgrade",icon:e.jsx(ue,{icon:el,color:"success.light",width:20,height:20},"version"),title:`${p()} -> ${t.version}`,align:"right",color:"success.light",maxWidth:300,text:e.jsx(O,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):f==="disable"?w.push({key:"disable",icon:e.jsx(ue,{icon:Ja,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):nl(t)&&w.push({key:"purchase",icon:e.jsx(ue,{icon:Xa,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),e.jsx(rl,{title:wr({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:wr({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?m:"",version:t.version,onButtonClick:null,"data-cy":"install-blocklet",sx:f!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:f==="disable"?void 0:l,icons:t.docker?.image?[{key:"docker",icon:e.jsx(O,{sx:{display:"flex",color:"primary.main"},children:e.jsx(ue,{icon:vo})}),title:s("blocklet.dockerImage")}]:[],official:t.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:t.stats.downloads,status:w,button:e.jsx(Wi,{serverVersion:a,requirementVersion:x,size:"small",children:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Hi,{children:e.jsx(Be,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:b=>{b.preventDefault(),b.stopPropagation();const k=tl(t,i);k&&window.open(k,"_blank","noopener,noreferrer")},children:s("common.detail")},t.did)})})})})}Fo.propTypes={blocklet:g.object.isRequired,blocklets:g.array,handleButtonClick:g.func,endpoint:g.string,serverVersion:g.string};function $o({handleButtonClick:t=null,handleSearchSelect:r=null,storeUrl:n,handleBlockletRender:i=null,extraFilter:a=void 0,serverVersion:s="",resourceType:m="",resourceDid:c="",showResourcesSwitch:d=!0,showCategory:l=!0,compact:y=!1,...p}){const v=gt(),{locale:f}=ae(),[x,w]=S.useState(!1),[b,k]=S.useState({}),u=C=>{k(C)},o=n,h=S.useMemo(()=>Ls(v,{palette:{background:{default:v.palette.background.paper}}}),[v]);return S.useEffect(()=>{k({showResources:!0,resourceType:m,resourceDid:c})},[o,m,c]),S.useEffect(()=>{w(!0),k({showResources:!0,resourceType:m,resourceDid:c})},[]),e.jsx(As,{theme:h,children:e.jsx(zs,{FallbackComponent:Ms,resetKeys:[o],children:e.jsxs(O,{...p,sx:qs({overflow:"auto",".title-bar + div":{height:"unset"}},p.sx),children:[x&&e.jsx($i,{showCategory:l,showResourcesSwitch:d,blockletRender:C=>{const E={...C,handleButtonClick:t,endpoint:o};return i({...C,defaultRender:e.jsx(Fo,{...E})})},compact:y,minItemWidth:300,baseSearch:!0,endpoint:o,locale:f,onFilterChange:u,onSearchSelect:r,filters:b,extraFilter:a,serverVersion:s,fetchCategoryDelay:500}),e.jsx(O,{sx:{mt:2},children:" "})]})})})}$o.propTypes={storeUrl:g.string.isRequired,handleButtonClick:g.func,handleSearchSelect:g.func,handleBlockletRender:g.func,extraFilter:g.func,serverVersion:g.string,resourceType:g.string,resourceDid:g.string,showResourcesSwitch:g.bool,showCategory:g.bool,compact:g.bool};const rl=re(Gi)`
|
|
169
|
+
.ms-highlight {
|
|
170
|
+
color: ${t=>t.theme.palette.primary.main};
|
|
171
|
+
}
|
|
172
|
+
`;function Wo({ref:t=null,meta:r=null,isMobile:n,onStepChange:i}){const a=gt(),{steps:s,activeStep:m,setActiveStepByKey:c,setActiveStepByIndex:d}=Qi(),{t:l,locale:y}=ae(),p=s[m];return S.useEffect(()=>{i(m)},[i,m]),S.useImperativeHandle(t,()=>({setActiveStepByKey:c,setActiveStepByIndex:d})),e.jsx(sl,{component:"div",className:n?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:e.jsx(Ji,{locale:y,blockletMeta:{title:" ",...r},pcWidth:"100%",pcHeight:"100%",logoUrl:r&&r.logo&&r.registryUrl?Ws({did:r.did,version:r.version,baseUrl:r.registryUrl,logoPath:r.logo}):null,theme:a,stepTip:l("blocklet.component.add"),children:e.jsx(ol,{children:typeof p?.body=="function"?p.body():p?.body})})})}Wo.propTypes={ref:g.any,meta:g.any,onStepChange:g.func.isRequired,isMobile:g.bool.isRequired};const _r=t=>t.isMobile?`
|
|
173
|
+
height: calc(100vh - 56px - 64px - 48px);
|
|
174
|
+
`:"",ol=re.div`
|
|
175
|
+
width: 100%;
|
|
176
|
+
height: 100%;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
justify-content: flex-start;
|
|
180
|
+
align-items: flex-start;
|
|
181
|
+
|
|
182
|
+
.bottom-button {
|
|
183
|
+
min-width: 200px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// blocklet-select-side
|
|
187
|
+
aside {
|
|
188
|
+
width: 140px;
|
|
189
|
+
}
|
|
190
|
+
`,sl=re(O)`
|
|
191
|
+
${({className:t})=>t==="mobileStyle"?`
|
|
192
|
+
& > div{
|
|
193
|
+
height: 100%;
|
|
194
|
+
}
|
|
195
|
+
.root-header {
|
|
196
|
+
.app-name-content {
|
|
197
|
+
display: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// content-panel
|
|
202
|
+
.root-header + div{
|
|
203
|
+
padding-top: 0;
|
|
204
|
+
position: relative;
|
|
205
|
+
& > div {
|
|
206
|
+
padding-top: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
header + div {
|
|
211
|
+
padding-top: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
header {
|
|
215
|
+
.header-title {
|
|
216
|
+
margin-left: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.header-title-name {
|
|
220
|
+
max-width: 100% !important;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
.app-content {
|
|
224
|
+
padding: 0!important;
|
|
225
|
+
}
|
|
226
|
+
`:`
|
|
227
|
+
position: relative;
|
|
228
|
+
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
229
|
+
width: 100%;
|
|
230
|
+
height: 100%;
|
|
231
|
+
border-radius: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.root-header {
|
|
235
|
+
z-index: auto !important;
|
|
236
|
+
position: fixed !important;
|
|
237
|
+
}
|
|
238
|
+
& > div {
|
|
239
|
+
height: 100%;
|
|
240
|
+
width: 100%;
|
|
241
|
+
max-width: 100%;
|
|
242
|
+
& > div {
|
|
243
|
+
max-height: unset !important;
|
|
244
|
+
max-width: 100%;
|
|
245
|
+
& > div {
|
|
246
|
+
// left-panel
|
|
247
|
+
&:first-of-type {
|
|
248
|
+
padding: 0;
|
|
249
|
+
width: 20%;
|
|
250
|
+
min-width: 180px;
|
|
251
|
+
|
|
252
|
+
& > div:first-of-type {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
// step
|
|
256
|
+
& > div:last-child {
|
|
257
|
+
// margin-top: 32px;
|
|
258
|
+
margin-top: 0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// right-panel
|
|
262
|
+
&:last-child {
|
|
263
|
+
padding-top: 0;
|
|
264
|
+
padding-right: 0px;
|
|
265
|
+
overflow-y: hidden;
|
|
266
|
+
.app-content {
|
|
267
|
+
padding: 0 0 24px 0;
|
|
268
|
+
}
|
|
269
|
+
.button-container {
|
|
270
|
+
padding-right: 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
`}
|
|
278
|
+
|
|
279
|
+
& .ll-container {
|
|
280
|
+
background: ${({theme:t})=>t.palette.background.paper};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
& .app-overview {
|
|
284
|
+
margin-left: 0 !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
& .flex-justify-center {
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
& .flex-align-center {
|
|
293
|
+
display: flex;
|
|
294
|
+
height: 100%;
|
|
295
|
+
align-items: center;
|
|
296
|
+
${t=>_r(t)}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
& .agreement-wrapper {
|
|
300
|
+
${t=>_r(t)}
|
|
301
|
+
max-height: 60vh;
|
|
302
|
+
.eula-trigger {
|
|
303
|
+
padding-right: 0;
|
|
304
|
+
}
|
|
305
|
+
.next-button {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
& .connect {
|
|
311
|
+
background: white;
|
|
312
|
+
}
|
|
313
|
+
`,il=Mn`
|
|
314
|
+
0%, 100% {
|
|
315
|
+
transform: scale(1) translateX(0);
|
|
316
|
+
}
|
|
317
|
+
50% {
|
|
318
|
+
transform: scale(1.05) translateX(-3px);
|
|
319
|
+
}
|
|
320
|
+
25%, 75% {
|
|
321
|
+
transform: scale(1.1) translateX(3px);
|
|
322
|
+
}
|
|
323
|
+
`;function Dt({src:t,alt:r,size:n=20}){return e.jsx("img",{src:t,alt:r,style:{width:n,height:n,display:"block",objectFit:"contain",borderRadius:"2px",flexShrink:0},onError:i=>{i.target.style.display="none"}})}Dt.propTypes={src:g.string.isRequired,alt:g.string.isRequired,size:g.number};const al=48,ll=8,Sr={PaperProps:{style:{maxHeight:al*4.5+ll,width:250}}},cl=(t,r,n)=>({fontWeight:r.indexOf(t)===-1?n.typography.fontWeightRegular:n.typography.fontWeightMedium});function Ho({label:t="",disabled:r=!1,required:n=!1,initialValue:i="",onChange:a=()=>{},sx:s={},onSubmit:m=()=>{},triggers:c=[],options:d=[],formatterBeforeSubmit:l=w=>w.join(","),helperText:y="",config:p={},directEditing:v=!1,searchable:f=!0,...x}){const w=gt(),[b,k]=S.useState(v),[u,o]=S.useState(!1),[h,C]=S.useState(""),{multiple:E=!1,labelField:_="name",valueField:z="code"}=p,[F,R]=S.useState(i),[U,B]=S.useState(F),[N,$]=S.useState(!1),[H,K]=S.useState(!1),V=S.useCallback(()=>{K(!0),setTimeout(()=>{K(!1)},500)},[]),M=async()=>{o(!0);try{await m(typeof l=="function"&&E?l(U):U)===!1?B(F):(B(U),R(U),$(!1))}catch{B(F)}finally{o(!1),k(!1)}},T=S.useCallback(()=>{v&&!r&&!u&&M(),N&&V(),!N&&!r&&!u&&(k(!1),$(!1))},[v,r,u,N,V]);S.useEffect(()=>{const j=i;j!==F&&(R(j),B(j),$(!1))},[i,F]);const q=d.filter(j=>{if(!h)return!0;const P=h.toLowerCase();return j[_]?.toLowerCase().includes(P)||j[z]?.toLowerCase().includes(P)}),I=j=>{let{value:P}=j.target;E&&(P=typeof P=="string"?P.split(","):P),$(P!==U),B(P),a(P)},D=b||v?e.jsxs(Hs,{value:U,onChange:I,fullWidth:!0,multiple:E,variant:"outlined",margin:"dense",onBlur:T,disabled:r,renderValue:j=>{if(E)return e.jsx(O,{sx:{display:"flex",flexWrap:"wrap"},children:j.filter(L=>d.some(X=>X[z]===L)).map(L=>e.jsx(or,{label:d.find(X=>X[z]===L)[_],style:{marginRight:8},size:"small"},L))});if(!j)return null;const P=d.find(L=>L[z]===j);return e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[P?.logo&&e.jsx(Dt,{src:P.logo,alt:P[_],size:20}),e.jsx("span",{children:P?P[_]:""})]})},MenuProps:{...Sr,PaperProps:{...Sr.PaperProps}},error:!!y,...x,children:[f?e.jsx(O,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:e.jsx(xe,{size:"small",placeholder:"Search...",value:h,onChange:j=>C(j.target.value),onClick:j=>j.stopPropagation(),onKeyDown:j=>j.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,q.map(j=>e.jsx(Ne,{value:j[z],style:cl(j[z],U,w),children:e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[j.logo&&e.jsx(Dt,{src:j.logo,alt:j[_],size:20}),e.jsx("span",{children:j[_]})]})},j[z]))]}):e.jsx(O,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{r||k(!0)},children:E?U.filter(j=>d.some(P=>P[z]===j)).map(j=>e.jsx(or,{label:d.find(P=>P[z]===j)[_],style:{marginRight:8},size:"small"},j)):U&&d.some(j=>j[z]===U)&&e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const j=d.find(P=>P[z]===U);return j?.logo?e.jsx(Dt,{src:j.logo,alt:j[_],size:20}):null})(),e.jsx("span",{children:d.find(j=>j[z]===U)[_]})]})});return e.jsx(xo,{className:"form",sx:s,children:e.jsxs(O,{className:"form-item",children:[e.jsxs(O,{className:"form-item-label",children:[t,n&&e.jsx(ot,{})]}),e.jsxs(O,{className:"form-item-body",children:[e.jsx(O,{className:"form-item-input",children:D}),e.jsx(O,{className:"form-item-action",style:!b||v?{marginLeft:0}:{},children:b&&!v?e.jsxs(e.Fragment,{children:[N?e.jsx(fe,{"data-cy":"schema-form-item-confirm",onClick:M,disabled:r||u,sx:{animation:H?`${il} 0.5s linear`:"none"},size:"large",children:u?e.jsx(ve,{size:24}):e.jsx(bo,{})}):null,e.jsx(fe,{"data-cy":"schema-form-item-cancel",onClick:()=>{B(F),k(!1)},disabled:r||u,size:"large",children:e.jsx(so,{})})]}):e.jsx(O,{children:c.length?e.jsx(Oi,{triggers:c,disabled:r}):null})})]}),b&&y&&e.jsx(Gs,{error:!0,children:y})]})})}Ho.propTypes={sx:g.object,onSubmit:g.func,onChange:g.func,label:g.string,initialValue:g.string,required:g.bool,disabled:g.bool,triggers:g.array,options:g.array,helperText:g.string,formatterBeforeSubmit:g.func,config:g.object,directEditing:g.bool,searchable:g.bool};const He={};function dl(t){He[t]&&(clearTimeout(He[t]),delete He[t])}async function ul(t,{interval:r=1e3,maxDuration:n=120*1e3,intervalFirst:i=4e3,timerKey:a=""}){He[a]&&clearTimeout(He[a]),await new Promise(c=>setTimeout(c,i));const s=Date.now(),m=async(c,d)=>{try{const l=await t();c(l)}catch(l){Date.now()-s>n?d(l):a?He[a]=setTimeout(()=>m(c,d),r):setTimeout(()=>m(c,d),r)}};return new Promise(m)}function pl(t,{did:r,refresh:n,t:i,providerName:a,values:s,timerKey:m}){return ul(async()=>{const{blocklet:c}=await t.getBlocklet({input:{did:r}}),d=Ks(c,"settings.aigne",{}),{url:l,key:y,provider:p}=d||{},{key:v}=s;if(p==="aigneHub"){if(!l||!y)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));if(v&&v===y)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));await n(),clearTimeout(He[`connect-aigne-${r}`])}else{if(!v||v!==y)throw new Error(i("setting.aigne.connectTimeOut",{provider:a}));await n(),clearTimeout(He[`connect-aigne-${r}`])}},{timerKey:m,maxDuration:3*60*1e3})}var _e={},Bt={exports:{}},Ut={exports:{}},fl=Ut.exports,Er;function Ue(){return Er||(Er=1,function(t,r){(function(n,i){t.exports=i()})(fl,function(){var n=n||function(i,a){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof It<"u"&&It.crypto&&(s=It.crypto),!s&&typeof Vs=="function")try{s=lo()}catch{}var m=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function u(){}return function(o){var h;return u.prototype=o,h=new u,u.prototype=null,h}}(),d={},l=d.lib={},y=l.Base=function(){return{extend:function(u){var o=c(this);return u&&o.mixIn(u),(!o.hasOwnProperty("init")||this.init===o.init)&&(o.init=function(){o.$super.init.apply(this,arguments)}),o.init.prototype=o,o.$super=this,o},create:function(){var u=this.extend();return u.init.apply(u,arguments),u},init:function(){},mixIn:function(u){for(var o in u)u.hasOwnProperty(o)&&(this[o]=u[o]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=l.WordArray=y.extend({init:function(u,o){u=this.words=u||[],o!=a?this.sigBytes=o:this.sigBytes=u.length*4},toString:function(u){return(u||f).stringify(this)},concat:function(u){var o=this.words,h=u.words,C=this.sigBytes,E=u.sigBytes;if(this.clamp(),C%4)for(var _=0;_<E;_++){var z=h[_>>>2]>>>24-_%4*8&255;o[C+_>>>2]|=z<<24-(C+_)%4*8}else for(var F=0;F<E;F+=4)o[C+F>>>2]=h[F>>>2];return this.sigBytes+=E,this},clamp:function(){var u=this.words,o=this.sigBytes;u[o>>>2]&=4294967295<<32-o%4*8,u.length=i.ceil(o/4)},clone:function(){var u=y.clone.call(this);return u.words=this.words.slice(0),u},random:function(u){for(var o=[],h=0;h<u;h+=4)o.push(m());return new p.init(o,u)}}),v=d.enc={},f=v.Hex={stringify:function(u){for(var o=u.words,h=u.sigBytes,C=[],E=0;E<h;E++){var _=o[E>>>2]>>>24-E%4*8&255;C.push((_>>>4).toString(16)),C.push((_&15).toString(16))}return C.join("")},parse:function(u){for(var o=u.length,h=[],C=0;C<o;C+=2)h[C>>>3]|=parseInt(u.substr(C,2),16)<<24-C%8*4;return new p.init(h,o/2)}},x=v.Latin1={stringify:function(u){for(var o=u.words,h=u.sigBytes,C=[],E=0;E<h;E++){var _=o[E>>>2]>>>24-E%4*8&255;C.push(String.fromCharCode(_))}return C.join("")},parse:function(u){for(var o=u.length,h=[],C=0;C<o;C++)h[C>>>2]|=(u.charCodeAt(C)&255)<<24-C%4*8;return new p.init(h,o)}},w=v.Utf8={stringify:function(u){try{return decodeURIComponent(escape(x.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(u){return x.parse(unescape(encodeURIComponent(u)))}},b=l.BufferedBlockAlgorithm=y.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(u){typeof u=="string"&&(u=w.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var o,h=this._data,C=h.words,E=h.sigBytes,_=this.blockSize,z=_*4,F=E/z;u?F=i.ceil(F):F=i.max((F|0)-this._minBufferSize,0);var R=F*_,U=i.min(R*4,E);if(R){for(var B=0;B<R;B+=_)this._doProcessBlock(C,B);o=C.splice(0,R),h.sigBytes-=U}return new p.init(o,U)},clone:function(){var u=y.clone.call(this);return u._data=this._data.clone(),u},_minBufferSize:0});l.Hasher=b.extend({cfg:y.extend(),init:function(u){this.cfg=this.cfg.extend(u),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(u){return this._append(u),this._process(),this},finalize:function(u){u&&this._append(u);var o=this._doFinalize();return o},blockSize:16,_createHelper:function(u){return function(o,h){return new u.init(h).finalize(o)}},_createHmacHelper:function(u){return function(o,h){return new k.HMAC.init(u,h).finalize(o)}}});var k=d.algo={};return d}(Math);return n})}(Ut)),Ut.exports}var Ot={exports:{}},ml=Ot.exports,kr;function Go(){return kr||(kr=1,function(t,r){(function(n,i){t.exports=i(Ue())})(ml,function(n){return function(){var i=n,a=i.lib,s=a.WordArray,m=i.enc;m.Base64={stringify:function(d){var l=d.words,y=d.sigBytes,p=this._map;d.clamp();for(var v=[],f=0;f<y;f+=3)for(var x=l[f>>>2]>>>24-f%4*8&255,w=l[f+1>>>2]>>>24-(f+1)%4*8&255,b=l[f+2>>>2]>>>24-(f+2)%4*8&255,k=x<<16|w<<8|b,u=0;u<4&&f+u*.75<y;u++)v.push(p.charAt(k>>>6*(3-u)&63));var o=p.charAt(64);if(o)for(;v.length%4;)v.push(o);return v.join("")},parse:function(d){var l=d.length,y=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v<y.length;v++)p[y.charCodeAt(v)]=v}var f=y.charAt(64);if(f){var x=d.indexOf(f);x!==-1&&(l=x)}return c(d,l,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(d,l,y){for(var p=[],v=0,f=0;f<l;f++)if(f%4){var x=y[d.charCodeAt(f-1)]<<f%4*2,w=y[d.charCodeAt(f)]>>>6-f%4*2,b=x|w;p[v>>>2]|=b<<24-v%4*8,v++}return s.create(p,v)}}(),n.enc.Base64})}(Ot)),Ot.exports}var Nt={exports:{}},hl=Nt.exports,Rr;function gl(){return Rr||(Rr=1,function(t,r){(function(n,i){t.exports=i(Ue())})(hl,function(n){return function(i){var a=n,s=a.lib,m=s.WordArray,c=s.Hasher,d=a.algo,l=[];(function(){for(var w=0;w<64;w++)l[w]=i.abs(i.sin(w+1))*4294967296|0})();var y=d.MD5=c.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(w,b){for(var k=0;k<16;k++){var u=b+k,o=w[u];w[u]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360}var h=this._hash.words,C=w[b+0],E=w[b+1],_=w[b+2],z=w[b+3],F=w[b+4],R=w[b+5],U=w[b+6],B=w[b+7],N=w[b+8],$=w[b+9],H=w[b+10],K=w[b+11],V=w[b+12],M=w[b+13],T=w[b+14],q=w[b+15],I=h[0],D=h[1],j=h[2],P=h[3];I=p(I,D,j,P,C,7,l[0]),P=p(P,I,D,j,E,12,l[1]),j=p(j,P,I,D,_,17,l[2]),D=p(D,j,P,I,z,22,l[3]),I=p(I,D,j,P,F,7,l[4]),P=p(P,I,D,j,R,12,l[5]),j=p(j,P,I,D,U,17,l[6]),D=p(D,j,P,I,B,22,l[7]),I=p(I,D,j,P,N,7,l[8]),P=p(P,I,D,j,$,12,l[9]),j=p(j,P,I,D,H,17,l[10]),D=p(D,j,P,I,K,22,l[11]),I=p(I,D,j,P,V,7,l[12]),P=p(P,I,D,j,M,12,l[13]),j=p(j,P,I,D,T,17,l[14]),D=p(D,j,P,I,q,22,l[15]),I=v(I,D,j,P,E,5,l[16]),P=v(P,I,D,j,U,9,l[17]),j=v(j,P,I,D,K,14,l[18]),D=v(D,j,P,I,C,20,l[19]),I=v(I,D,j,P,R,5,l[20]),P=v(P,I,D,j,H,9,l[21]),j=v(j,P,I,D,q,14,l[22]),D=v(D,j,P,I,F,20,l[23]),I=v(I,D,j,P,$,5,l[24]),P=v(P,I,D,j,T,9,l[25]),j=v(j,P,I,D,z,14,l[26]),D=v(D,j,P,I,N,20,l[27]),I=v(I,D,j,P,M,5,l[28]),P=v(P,I,D,j,_,9,l[29]),j=v(j,P,I,D,B,14,l[30]),D=v(D,j,P,I,V,20,l[31]),I=f(I,D,j,P,R,4,l[32]),P=f(P,I,D,j,N,11,l[33]),j=f(j,P,I,D,K,16,l[34]),D=f(D,j,P,I,T,23,l[35]),I=f(I,D,j,P,E,4,l[36]),P=f(P,I,D,j,F,11,l[37]),j=f(j,P,I,D,B,16,l[38]),D=f(D,j,P,I,H,23,l[39]),I=f(I,D,j,P,M,4,l[40]),P=f(P,I,D,j,C,11,l[41]),j=f(j,P,I,D,z,16,l[42]),D=f(D,j,P,I,U,23,l[43]),I=f(I,D,j,P,$,4,l[44]),P=f(P,I,D,j,V,11,l[45]),j=f(j,P,I,D,q,16,l[46]),D=f(D,j,P,I,_,23,l[47]),I=x(I,D,j,P,C,6,l[48]),P=x(P,I,D,j,B,10,l[49]),j=x(j,P,I,D,T,15,l[50]),D=x(D,j,P,I,R,21,l[51]),I=x(I,D,j,P,V,6,l[52]),P=x(P,I,D,j,z,10,l[53]),j=x(j,P,I,D,H,15,l[54]),D=x(D,j,P,I,E,21,l[55]),I=x(I,D,j,P,N,6,l[56]),P=x(P,I,D,j,q,10,l[57]),j=x(j,P,I,D,U,15,l[58]),D=x(D,j,P,I,M,21,l[59]),I=x(I,D,j,P,F,6,l[60]),P=x(P,I,D,j,K,10,l[61]),j=x(j,P,I,D,_,15,l[62]),D=x(D,j,P,I,$,21,l[63]),h[0]=h[0]+I|0,h[1]=h[1]+D|0,h[2]=h[2]+j|0,h[3]=h[3]+P|0},_doFinalize:function(){var w=this._data,b=w.words,k=this._nDataBytes*8,u=w.sigBytes*8;b[u>>>5]|=128<<24-u%32;var o=i.floor(k/4294967296),h=k;b[(u+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,b[(u+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,w.sigBytes=(b.length+1)*4,this._process();for(var C=this._hash,E=C.words,_=0;_<4;_++){var z=E[_];E[_]=(z<<8|z>>>24)&16711935|(z<<24|z>>>8)&4278255360}return C},clone:function(){var w=c.clone.call(this);return w._hash=this._hash.clone(),w}});function p(w,b,k,u,o,h,C){var E=w+(b&k|~b&u)+o+C;return(E<<h|E>>>32-h)+b}function v(w,b,k,u,o,h,C){var E=w+(b&u|k&~u)+o+C;return(E<<h|E>>>32-h)+b}function f(w,b,k,u,o,h,C){var E=w+(b^k^u)+o+C;return(E<<h|E>>>32-h)+b}function x(w,b,k,u,o,h,C){var E=w+(k^(b|~u))+o+C;return(E<<h|E>>>32-h)+b}a.MD5=c._createHelper(y),a.HmacMD5=c._createHmacHelper(y)}(Math),n.MD5})}(Nt)),Nt.exports}var Lt={exports:{}},At={exports:{}},xl=At.exports,Tr;function yl(){return Tr||(Tr=1,function(t,r){(function(n,i){t.exports=i(Ue())})(xl,function(n){return function(){var i=n,a=i.lib,s=a.WordArray,m=a.Hasher,c=i.algo,d=[],l=c.SHA1=m.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(y,p){for(var v=this._hash.words,f=v[0],x=v[1],w=v[2],b=v[3],k=v[4],u=0;u<80;u++){if(u<16)d[u]=y[p+u]|0;else{var o=d[u-3]^d[u-8]^d[u-14]^d[u-16];d[u]=o<<1|o>>>31}var h=(f<<5|f>>>27)+k+d[u];u<20?h+=(x&w|~x&b)+1518500249:u<40?h+=(x^w^b)+1859775393:u<60?h+=(x&w|x&b|w&b)-1894007588:h+=(x^w^b)-899497514,k=b,b=w,w=x<<30|x>>>2,x=f,f=h}v[0]=v[0]+f|0,v[1]=v[1]+x|0,v[2]=v[2]+w|0,v[3]=v[3]+b|0,v[4]=v[4]+k|0},_doFinalize:function(){var y=this._data,p=y.words,v=this._nDataBytes*8,f=y.sigBytes*8;return p[f>>>5]|=128<<24-f%32,p[(f+64>>>9<<4)+14]=Math.floor(v/4294967296),p[(f+64>>>9<<4)+15]=v,y.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var y=m.clone.call(this);return y._hash=this._hash.clone(),y}});i.SHA1=m._createHelper(l),i.HmacSHA1=m._createHmacHelper(l)}(),n.SHA1})}(At)),At.exports}var zt={exports:{}},vl=zt.exports,Pr;function Cl(){return Pr||(Pr=1,function(t,r){(function(n,i){t.exports=i(Ue())})(vl,function(n){(function(){var i=n,a=i.lib,s=a.Base,m=i.enc,c=m.Utf8,d=i.algo;d.HMAC=s.extend({init:function(l,y){l=this._hasher=new l.init,typeof y=="string"&&(y=c.parse(y));var p=l.blockSize,v=p*4;y.sigBytes>v&&(y=l.finalize(y)),y.clamp();for(var f=this._oKey=y.clone(),x=this._iKey=y.clone(),w=f.words,b=x.words,k=0;k<p;k++)w[k]^=1549556828,b[k]^=909522486;f.sigBytes=x.sigBytes=v,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var y=this._hasher,p=y.finalize(l);y.reset();var v=y.finalize(this._oKey.clone().concat(p));return v}})})()})}(zt)),zt.exports}var bl=Lt.exports,Ir;function Ko(){return Ir||(Ir=1,function(t,r){(function(n,i,a){t.exports=i(Ue(),yl(),Cl())})(bl,function(n){return function(){var i=n,a=i.lib,s=a.Base,m=a.WordArray,c=i.algo,d=c.MD5,l=c.EvpKDF=s.extend({cfg:s.extend({keySize:128/32,hasher:d,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,p){for(var v,f=this.cfg,x=f.hasher.create(),w=m.create(),b=w.words,k=f.keySize,u=f.iterations;b.length<k;){v&&x.update(v),v=x.update(y).finalize(p),x.reset();for(var o=1;o<u;o++)v=x.finalize(v),x.reset();w.concat(v)}return w.sigBytes=k*4,w}});i.EvpKDF=function(y,p,v){return l.create(v).compute(y,p)}}(),n.EvpKDF})}(Lt)),Lt.exports}var Mt={exports:{}},jl=Mt.exports,Dr;function wl(){return Dr||(Dr=1,function(t,r){(function(n,i,a){t.exports=i(Ue(),Ko())})(jl,function(n){n.lib.Cipher||function(i){var a=n,s=a.lib,m=s.Base,c=s.WordArray,d=s.BufferedBlockAlgorithm,l=a.enc;l.Utf8;var y=l.Base64,p=a.algo,v=p.EvpKDF,f=s.Cipher=d.extend({cfg:m.extend(),createEncryptor:function(R,U){return this.create(this._ENC_XFORM_MODE,R,U)},createDecryptor:function(R,U){return this.create(this._DEC_XFORM_MODE,R,U)},init:function(R,U,B){this.cfg=this.cfg.extend(B),this._xformMode=R,this._key=U,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(R){return this._append(R),this._process()},finalize:function(R){R&&this._append(R);var U=this._doFinalize();return U},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function R(U){return typeof U=="string"?F:E}return function(U){return{encrypt:function(B,N,$){return R(N).encrypt(U,B,N,$)},decrypt:function(B,N,$){return R(N).decrypt(U,B,N,$)}}}}()});s.StreamCipher=f.extend({_doFinalize:function(){var R=this._process(!0);return R},blockSize:1});var x=a.mode={},w=s.BlockCipherMode=m.extend({createEncryptor:function(R,U){return this.Encryptor.create(R,U)},createDecryptor:function(R,U){return this.Decryptor.create(R,U)},init:function(R,U){this._cipher=R,this._iv=U}}),b=x.CBC=function(){var R=w.extend();R.Encryptor=R.extend({processBlock:function(B,N){var $=this._cipher,H=$.blockSize;U.call(this,B,N,H),$.encryptBlock(B,N),this._prevBlock=B.slice(N,N+H)}}),R.Decryptor=R.extend({processBlock:function(B,N){var $=this._cipher,H=$.blockSize,K=B.slice(N,N+H);$.decryptBlock(B,N),U.call(this,B,N,H),this._prevBlock=K}});function U(B,N,$){var H,K=this._iv;K?(H=K,this._iv=i):H=this._prevBlock;for(var V=0;V<$;V++)B[N+V]^=H[V]}return R}(),k=a.pad={},u=k.Pkcs7={pad:function(R,U){for(var B=U*4,N=B-R.sigBytes%B,$=N<<24|N<<16|N<<8|N,H=[],K=0;K<N;K+=4)H.push($);var V=c.create(H,N);R.concat(V)},unpad:function(R){var U=R.words[R.sigBytes-1>>>2]&255;R.sigBytes-=U}};s.BlockCipher=f.extend({cfg:f.cfg.extend({mode:b,padding:u}),reset:function(){var R;f.reset.call(this);var U=this.cfg,B=U.iv,N=U.mode;this._xformMode==this._ENC_XFORM_MODE?R=N.createEncryptor:(R=N.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==R?this._mode.init(this,B&&B.words):(this._mode=R.call(N,this,B&&B.words),this._mode.__creator=R)},_doProcessBlock:function(R,U){this._mode.processBlock(R,U)},_doFinalize:function(){var R,U=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(U.pad(this._data,this.blockSize),R=this._process(!0)):(R=this._process(!0),U.unpad(R)),R},blockSize:128/32});var o=s.CipherParams=m.extend({init:function(R){this.mixIn(R)},toString:function(R){return(R||this.formatter).stringify(this)}}),h=a.format={},C=h.OpenSSL={stringify:function(R){var U,B=R.ciphertext,N=R.salt;return N?U=c.create([1398893684,1701076831]).concat(N).concat(B):U=B,U.toString(y)},parse:function(R){var U,B=y.parse(R),N=B.words;return N[0]==1398893684&&N[1]==1701076831&&(U=c.create(N.slice(2,4)),N.splice(0,4),B.sigBytes-=16),o.create({ciphertext:B,salt:U})}},E=s.SerializableCipher=m.extend({cfg:m.extend({format:C}),encrypt:function(R,U,B,N){N=this.cfg.extend(N);var $=R.createEncryptor(B,N),H=$.finalize(U),K=$.cfg;return o.create({ciphertext:H,key:B,iv:K.iv,algorithm:R,mode:K.mode,padding:K.padding,blockSize:R.blockSize,formatter:N.format})},decrypt:function(R,U,B,N){N=this.cfg.extend(N),U=this._parse(U,N.format);var $=R.createDecryptor(B,N).finalize(U.ciphertext);return $},_parse:function(R,U){return typeof R=="string"?U.parse(R,this):R}}),_=a.kdf={},z=_.OpenSSL={execute:function(R,U,B,N,$){if(N||(N=c.random(64/8)),$)var H=v.create({keySize:U+B,hasher:$}).compute(R,N);else var H=v.create({keySize:U+B}).compute(R,N);var K=c.create(H.words.slice(U),B*4);return H.sigBytes=U*4,o.create({key:H,iv:K,salt:N})}},F=s.PasswordBasedCipher=E.extend({cfg:E.cfg.extend({kdf:z}),encrypt:function(R,U,B,N){N=this.cfg.extend(N);var $=N.kdf.execute(B,R.keySize,R.ivSize,N.salt,N.hasher);N.iv=$.iv;var H=E.encrypt.call(this,R,U,$.key,N);return H.mixIn($),H},decrypt:function(R,U,B,N){N=this.cfg.extend(N),U=this._parse(U,N.format);var $=N.kdf.execute(B,R.keySize,R.ivSize,U.salt,N.hasher);N.iv=$.iv;var H=E.decrypt.call(this,R,U,$.key,N);return H}})}()})}(Mt)),Mt.exports}var _l=Bt.exports,Br;function Sl(){return Br||(Br=1,function(t,r){(function(n,i,a){t.exports=i(Ue(),Go(),gl(),Ko(),wl())})(_l,function(n){return function(){var i=n,a=i.lib,s=a.BlockCipher,m=i.algo,c=[],d=[],l=[],y=[],p=[],v=[],f=[],x=[],w=[],b=[];(function(){for(var o=[],h=0;h<256;h++)h<128?o[h]=h<<1:o[h]=h<<1^283;for(var C=0,E=0,h=0;h<256;h++){var _=E^E<<1^E<<2^E<<3^E<<4;_=_>>>8^_&255^99,c[C]=_,d[_]=C;var z=o[C],F=o[z],R=o[F],U=o[_]*257^_*16843008;l[C]=U<<24|U>>>8,y[C]=U<<16|U>>>16,p[C]=U<<8|U>>>24,v[C]=U;var U=R*16843009^F*65537^z*257^C*16843008;f[_]=U<<24|U>>>8,x[_]=U<<16|U>>>16,w[_]=U<<8|U>>>24,b[_]=U,C?(C=z^o[o[o[R^z]]],E^=o[o[E]]):C=E=1}})();var k=[0,1,2,4,8,16,32,64,128,27,54],u=m.AES=s.extend({_doReset:function(){var o;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var h=this._keyPriorReset=this._key,C=h.words,E=h.sigBytes/4,_=this._nRounds=E+6,z=(_+1)*4,F=this._keySchedule=[],R=0;R<z;R++)R<E?F[R]=C[R]:(o=F[R-1],R%E?E>6&&R%E==4&&(o=c[o>>>24]<<24|c[o>>>16&255]<<16|c[o>>>8&255]<<8|c[o&255]):(o=o<<8|o>>>24,o=c[o>>>24]<<24|c[o>>>16&255]<<16|c[o>>>8&255]<<8|c[o&255],o^=k[R/E|0]<<24),F[R]=F[R-E]^o);for(var U=this._invKeySchedule=[],B=0;B<z;B++){var R=z-B;if(B%4)var o=F[R];else var o=F[R-4];B<4||R<=4?U[B]=o:U[B]=f[c[o>>>24]]^x[c[o>>>16&255]]^w[c[o>>>8&255]]^b[c[o&255]]}}},encryptBlock:function(o,h){this._doCryptBlock(o,h,this._keySchedule,l,y,p,v,c)},decryptBlock:function(o,h){var C=o[h+1];o[h+1]=o[h+3],o[h+3]=C,this._doCryptBlock(o,h,this._invKeySchedule,f,x,w,b,d);var C=o[h+1];o[h+1]=o[h+3],o[h+3]=C},_doCryptBlock:function(o,h,C,E,_,z,F,R){for(var U=this._nRounds,B=o[h]^C[0],N=o[h+1]^C[1],$=o[h+2]^C[2],H=o[h+3]^C[3],K=4,V=1;V<U;V++){var M=E[B>>>24]^_[N>>>16&255]^z[$>>>8&255]^F[H&255]^C[K++],T=E[N>>>24]^_[$>>>16&255]^z[H>>>8&255]^F[B&255]^C[K++],q=E[$>>>24]^_[H>>>16&255]^z[B>>>8&255]^F[N&255]^C[K++],I=E[H>>>24]^_[B>>>16&255]^z[N>>>8&255]^F[$&255]^C[K++];B=M,N=T,$=q,H=I}var M=(R[B>>>24]<<24|R[N>>>16&255]<<16|R[$>>>8&255]<<8|R[H&255])^C[K++],T=(R[N>>>24]<<24|R[$>>>16&255]<<16|R[H>>>8&255]<<8|R[B&255])^C[K++],q=(R[$>>>24]<<24|R[H>>>16&255]<<16|R[B>>>8&255]<<8|R[N&255])^C[K++],I=(R[H>>>24]<<24|R[B>>>16&255]<<16|R[N>>>8&255]<<8|R[$&255])^C[K++];o[h]=M,o[h+1]=T,o[h+2]=q,o[h+3]=I},keySize:256/32});i.AES=s._createHelper(u)}(),n.AES})}(Bt)),Bt.exports}var qt={exports:{}},El=qt.exports,Ur;function kl(){return Ur||(Ur=1,function(t,r){(function(n,i){t.exports=i(Ue())})(El,function(n){return n.enc.Latin1})}(qt)),qt.exports}var Ft={exports:{}},Rl=Ft.exports,Or;function Tl(){return Or||(Or=1,function(t,r){(function(n,i){t.exports=i(Ue())})(Rl,function(n){return n.enc.Utf8})}(Ft)),Ft.exports}var $t={exports:{}},Pl=$t.exports,Nr;function Il(){return Nr||(Nr=1,function(t,r){(function(n,i){t.exports=i(Ue())})(Pl,function(n){return function(){var i=n,a=i.lib,s=a.WordArray,m=i.enc;m.Utf16=m.Utf16BE={stringify:function(d){for(var l=d.words,y=d.sigBytes,p=[],v=0;v<y;v+=2){var f=l[v>>>2]>>>16-v%4*8&65535;p.push(String.fromCharCode(f))}return p.join("")},parse:function(d){for(var l=d.length,y=[],p=0;p<l;p++)y[p>>>1]|=d.charCodeAt(p)<<16-p%2*16;return s.create(y,l*2)}},m.Utf16LE={stringify:function(d){for(var l=d.words,y=d.sigBytes,p=[],v=0;v<y;v+=2){var f=c(l[v>>>2]>>>16-v%4*8&65535);p.push(String.fromCharCode(f))}return p.join("")},parse:function(d){for(var l=d.length,y=[],p=0;p<l;p++)y[p>>>1]|=c(d.charCodeAt(p)<<16-p%2*16);return s.create(y,l*2)}};function c(d){return d<<8&4278255360|d>>>8&16711935}}(),n.enc.Utf16})}($t)),$t.exports}var Wt={exports:{}},Dl=Wt.exports,Lr;function Bl(){return Lr||(Lr=1,function(t,r){(function(n,i){t.exports=i(Ue())})(Dl,function(n){return n.enc.Hex})}(Wt)),Wt.exports}var tt={},Ar;function Ul(){if(Ar)return tt;Ar=1;var t=tt&&tt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(tt,"__esModule",{value:!0});const r=t(Ys());return tt.default=r.default.create("encrypt","decrypt"),tt}var zr;function Ol(){if(zr)return _e;zr=1;var t=_e&&_e.__createBinding||(Object.create?function(f,x,w,b){b===void 0&&(b=w);var k=Object.getOwnPropertyDescriptor(x,w);(!k||("get"in k?!x.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return x[w]}}),Object.defineProperty(f,b,k)}:function(f,x,w,b){b===void 0&&(b=w),f[b]=x[w]}),r=_e&&_e.__setModuleDefault||(Object.create?function(f,x){Object.defineProperty(f,"default",{enumerable:!0,value:x})}:function(f,x){f.default=x}),n=_e&&_e.__importStar||function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var w in f)w!=="default"&&Object.prototype.hasOwnProperty.call(f,w)&&t(x,f,w);return r(x,f),x},i=_e&&_e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(_e,"__esModule",{value:!0}),_e.AesCrypter=void 0;const a=n(Sl()),s=i(kl()),m=i(Tl()),c=i(Il()),d=i(Go()),l=i(Bl()),y=i(Ul()),p={latin1:s.default,utf8:m.default,hex:l.default,utf16:c.default,base64:d.default};class v extends y.default{encrypt(x,w){const b=typeof x=="string"?x:JSON.stringify(x);return a.encrypt(b,w).toString()}decrypt(x,w,b="utf8"){return a.decrypt(x,w).toString(p[b])}}return _e.AesCrypter=v,_e.default=new v,_e}const Nl=!0,Ll=">= 8",Al=">= 0.5 && < 0.9.7",zl=!0,Ml=!0,ql=">= 0.5",Fl=!0,$l=!0,Wl=!0,Hl=">= 1 && < 8",Gl="< 8",Kl=!0,Vl=[">= 14.17 && < 15",">= 15.1"],Yl=!0,Zl=">= 0.7.12",Ql=!0,Jl="< 6",Xl=!0,ec=">= 0.11.1",tc=">= 0.11.1",nc=">= 0.11.1",rc=">= 0.11.1",oc=">= 0.11.1",sc=">= 0.11.1",ic=!0,ac=">= 8.8",lc=!0,cc=">= 8",dc="< 8",uc=!0,pc=!0,fc=!0,mc=!0,hc=">= 8.5",gc=">= 1",xc=">= 0.5",yc=!0,vc=!0,Cc=!0,bc=">= 0.11.5 && < 3",jc=">= 0.9.4",wc=">= 0.9.4",_c=">= 1.4.1",Sc=">= 0.9.4",Ec=">= 0.9.4",kc=">= 0.9.4",Rc=!0,Tc=!0,Pc=[">= 0.4 && < 0.7",">= 0.8"],Ic=!0,Dc=">= 0.11.13",Bc=">= 0.11.3 && < 10",Uc=">= 0.11.3",Oc=!0,Nc=">= 10",Lc=!0,Ac=!0,zc=!0,Mc=">= 1",qc=!0,Fc=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],$c=">= 11.7",Wc=">= 0.5",Hc={assert:Nl,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:Ll,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:Al,buffer:zl,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:Ml,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:ql,"node:cluster":[">= 14.18 && < 15",">= 16"],console:Fl,"node:console":[">= 14.18 && < 15",">= 16"],constants:$l,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:Wl,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:Hl,_debugger:Gl,dgram:Kl,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Vl,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:Yl,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:Zl,"node:domain":[">= 14.18 && < 15",">= 16"],events:Ql,"node:events":[">= 14.18 && < 15",">= 16"],freelist:Jl,fs:Xl,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:ec,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:tc,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:nc,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:rc,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:oc,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:sc,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:ic,"node:http":[">= 14.18 && < 15",">= 16"],http2:ac,"node:http2":[">= 14.18 && < 15",">= 16"],https:lc,"node:https":[">= 14.18 && < 15",">= 16"],inspector:cc,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:dc,module:uc,"node:module":[">= 14.18 && < 15",">= 16"],net:pc,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:fc,"node:os":[">= 14.18 && < 15",">= 16"],path:mc,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:hc,"node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:gc,"node:process":[">= 14.18 && < 15",">= 16"],punycode:xc,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:yc,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:vc,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:Cc,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:bc,_stream_duplex:jc,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:wc,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:_c,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:Sc,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:Ec,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:kc,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:Rc,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:Tc,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:Pc,"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:Ic,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:Dc,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:Bc,_tls_wrap:Uc,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:Oc,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:Nc,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:Lc,"node:tty":[">= 14.18 && < 15",">= 16"],url:Ac,"node:url":[">= 14.18 && < 15",">= 16"],util:zc,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:Mc,"node:v8":[">= 14.18 && < 15",">= 16"],vm:qc,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:Fc,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:$c,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:Wc,"node:zlib":[">= 14.18 && < 15",">= 16"]};var hn,Mr;function Gc(){if(Mr)return hn;Mr=1;var t=Zs();function r(s,m){for(var c=s.split("."),d=m.split(" "),l=d.length>1?d[0]:"=",y=(d.length>1?d[1]:d[0]).split("."),p=0;p<3;++p){var v=parseInt(c[p]||0,10),f=parseInt(y[p]||0,10);if(v!==f)return l==="<"?v<f:l===">="?v>=f:!1}return l===">="}function n(s,m){var c=m.split(/ ?&& ?/);if(c.length===0)return!1;for(var d=0;d<c.length;++d)if(!r(s,c[d]))return!1;return!0}function i(s,m){if(typeof m=="boolean")return m;var c=typeof s>"u"?pe.versions&&pe.versions.node:s;if(typeof c!="string")throw new TypeError(typeof s>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(m&&typeof m=="object"){for(var d=0;d<m.length;++d)if(n(c,m[d]))return!0;return!1}return n(c,m)}var a=Hc;return hn=function(m,c){return t(a,m)&&i(c,a[m])},hn}var gn,qr;function Kc(){if(qr)return gn;qr=1;var t={},r=co();return gn=r.homedir||function(){var i=t.HOME,a=t.LOGNAME||t.USER||t.LNAME||t.USERNAME;return pe.platform==="win32"?t.USERPROFILE||t.HOMEDRIVE+t.HOMEPATH||i||null:pe.platform==="darwin"?i||(a?"/Users/"+a:null):pe.platform==="linux"?i||(pe.getuid()===0?"/root":a?"/home/"+a:null):i||null},gn}var xn,Fr;function Vc(){return Fr||(Fr=1,xn=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(n,i){return i};var r=new Error().stack;return Error.prepareStackTrace=t,r[2].getFileName()}),xn}var nt={exports:{}},$r;function Yc(){if($r)return nt.exports;$r=1;var t=pe.platform==="win32",r=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};function i(c){return r.exec(c).slice(1)}n.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=i(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0]===d[1]?d[0]:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}};var a=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,s={};function m(c){return a.exec(c).slice(1)}return s.parse=function(c){if(typeof c!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var d=m(c);if(!d||d.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:d[1],dir:d[0].slice(0,-1),base:d[2],ext:d[4],name:d[3]}},t?nt.exports=n.parse:nt.exports=s.parse,nt.exports.posix=s.parse,nt.exports.win32=n.parse,nt.exports}var yn,Wr;function Zc(){if(Wr)return yn;Wr=1;var t=Xt(),r=t.parse||Yc(),n=function(a,s){var m="/";/^([A-Za-z]:)/.test(a)?m="":/^\\\\/.test(a)&&(m="\\\\");for(var c=[a],d=r(a);d.dir!==c[c.length-1];)c.push(d.dir),d=r(d.dir);return c.reduce(function(l,y){return l.concat(s.map(function(p){return t.resolve(m,y,p)}))},[])};return yn=function(a,s,m){var c=s&&s.moduleDirectory?[].concat(s.moduleDirectory):["node_modules"];if(s&&typeof s.paths=="function")return s.paths(m,a,function(){return n(a,c)},s);var d=n(a,c);return s&&s.paths?d.concat(s.paths):d},yn}var vn,Hr;function Qc(){return Hr||(Hr=1,vn=function(t,r){return r||{}}),vn}var Cn,Gr;function Jc(){if(Gr)return Cn;Gr=1;var t=Gc(),r=Hn,n=Xt(),i=Kc(),a=Vc(),s=Zc(),m=Qc(),c=pe.platform!=="win32"&&r.realpathSync&&typeof r.realpathSync.native=="function"?r.realpathSync.native:r.realpathSync,d=i(),l=function(){return[n.join(d,".node_modules"),n.join(d,".node_libraries")]},y=function(k){try{var u=r.statSync(k,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!u&&(u.isFile()||u.isFIFO())},p=function(k){try{var u=r.statSync(k,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!u&&u.isDirectory()},v=function(k){try{return c(k)}catch(u){if(u.code!=="ENOENT")throw u}return k},f=function(k,u,o){return o&&o.preserveSymlinks===!1?k(u):u},x=function(k,u){var o=k(u);try{var h=JSON.parse(o);return h}catch{}},w=function(k,u,o){for(var h=s(u,o,k),C=0;C<h.length;C++)h[C]=n.join(h[C],k);return h};return Cn=function(k,u){if(typeof k!="string")throw new TypeError("Path must be a string.");var o=m(k,u),h=o.isFile||y,C=o.readFileSync||r.readFileSync,E=o.isDirectory||p,_=o.realpathSync||v,z=o.readPackageSync||x;if(o.readFileSync&&o.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var F=o.packageIterator,R=o.extensions||[".js"],U=o.includeCoreModules!==!1,B=o.basedir||n.dirname(a()),N=o.filename||B;o.paths=o.paths||l();var $=f(_,n.resolve(B),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(k)){var H=n.resolve($,k);(k==="."||k===".."||k.slice(-1)==="/")&&(H+="/");var K=T(H)||I(H);if(K)return f(_,K,o)}else{if(U&&t(k))return k;var V=D(k,$);if(V)return f(_,V,o)}var M=new Error("Cannot find module '"+k+"' from '"+N+"'");throw M.code="MODULE_NOT_FOUND",M;function T(j){var P=q(n.dirname(j));if(P&&P.dir&&P.pkg&&o.pathFilter){var L=n.relative(P.dir,j),X=o.pathFilter(P.pkg,j,L);X&&(j=n.resolve(P.dir,X))}if(h(j))return j;for(var J=0;J<R.length;J++){var Z=j+R[J];if(h(Z))return Z}}function q(j){if(!(j===""||j==="/")&&!(pe.platform==="win32"&&/^\w:[/\\]*$/.test(j))&&!/[/\\]node_modules[/\\]*$/.test(j)){var P=n.join(f(_,j,o),"package.json");if(!h(P))return q(n.dirname(j));var L=z(C,P);return L&&o.packageFilter&&(L=o.packageFilter(L,j)),{pkg:L,dir:j}}}function I(j){var P=n.join(f(_,j,o),"/package.json");if(h(P)){try{var L=z(C,P)}catch{}if(L&&o.packageFilter&&(L=o.packageFilter(L,j)),L&&L.main){if(typeof L.main!="string"){var X=new TypeError("package “"+L.name+"” `main` must be a string");throw X.code="INVALID_PACKAGE_MAIN",X}(L.main==="."||L.main==="./")&&(L.main="index");try{var J=T(n.resolve(j,L.main));if(J)return J;var Z=I(n.resolve(j,L.main));if(Z)return Z}catch{}}}return T(n.join(j,"/index"))}function D(j,P){for(var L=function(){return w(j,P,o)},X=F?F(j,P,L,o):L(),J=0;J<X.length;J++){var Z=X[J];if(E(n.dirname(Z))){var ce=T(Z);if(ce)return ce;var oe=I(Z);if(oe)return oe}}}},Cn}var bn,Kr;function Xc(){return Kr||(Kr=1,bn=Jc()),bn}var jn,Vr;function ed(){if(Vr)return jn;Vr=1;var t={};jn=a,a.sync=s;var r=Hn;function n(m,c){var d=c.pathExt!==void 0?c.pathExt:t.PATHEXT;if(!d||(d=d.split(";"),d.indexOf("")!==-1))return!0;for(var l=0;l<d.length;l++){var y=d[l].toLowerCase();if(y&&m.substr(-y.length).toLowerCase()===y)return!0}return!1}function i(m,c,d){return!m.isSymbolicLink()&&!m.isFile()?!1:n(c,d)}function a(m,c,d){r.stat(m,function(l,y){d(l,l?!1:i(y,m,c))})}function s(m,c){return i(r.statSync(m),m,c)}return jn}var wn,Yr;function td(){if(Yr)return wn;Yr=1,wn=r,r.sync=n;var t=Hn;function r(s,m,c){t.stat(s,function(d,l){c(d,d?!1:i(l,m))})}function n(s,m){return i(t.statSync(s),m)}function i(s,m){return s.isFile()&&a(s,m)}function a(s,m){var c=s.mode,d=s.uid,l=s.gid,y=m.uid!==void 0?m.uid:pe.getuid&&pe.getuid(),p=m.gid!==void 0?m.gid:pe.getgid&&pe.getgid(),v=parseInt("100",8),f=parseInt("010",8),x=parseInt("001",8),w=v|f,b=c&x||c&f&&l===p||c&v&&d===y||c&w&&y===0;return b}return wn}var _n,Zr;function nd(){if(Zr)return _n;Zr=1;var t;pe.platform==="win32"||It.TESTING_WINDOWS?t=ed():t=td(),_n=r,r.sync=n;function r(i,a,s){if(typeof a=="function"&&(s=a,a={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(m,c){r(i,a||{},function(d,l){d?c(d):m(l)})})}t(i,a||{},function(m,c){m&&(m.code==="EACCES"||a&&a.ignoreErrors)&&(m=null,c=!1),s(m,c)})}function n(i,a){try{return t.sync(i,a||{})}catch(s){if(a&&a.ignoreErrors||s.code==="EACCES")return!1;throw s}}return _n}var Sn,Qr;function rd(){if(Qr)return Sn;Qr=1;var t={};const r=pe.platform==="win32"||t.OSTYPE==="cygwin"||t.OSTYPE==="msys",n=Xt(),i=r?";":":",a=nd(),s=l=>Object.assign(new Error(`not found: ${l}`),{code:"ENOENT"}),m=(l,y)=>{const p=y.colon||i,v=l.match(/\//)||r&&l.match(/\\/)?[""]:[...r?[pe.cwd()]:[],...(y.path||t.PATH||"").split(p)],f=r?y.pathExt||t.PATHEXT||".EXE;.CMD;.BAT;.COM":"",x=r?f.split(p):[""];return r&&l.indexOf(".")!==-1&&x[0]!==""&&x.unshift(""),{pathEnv:v,pathExt:x,pathExtExe:f}},c=(l,y,p)=>{typeof y=="function"&&(p=y,y={}),y||(y={});const{pathEnv:v,pathExt:f,pathExtExe:x}=m(l,y),w=[],b=u=>new Promise((o,h)=>{if(u===v.length)return y.all&&w.length?o(w):h(s(l));const C=v[u],E=/^".*"$/.test(C)?C.slice(1,-1):C,_=n.join(E,l),z=!E&&/^\.[\\\/]/.test(l)?l.slice(0,2)+_:_;o(k(z,u,0))}),k=(u,o,h)=>new Promise((C,E)=>{if(h===f.length)return C(b(o+1));const _=f[h];a(u+_,{pathExt:x},(z,F)=>{if(!z&&F)if(y.all)w.push(u+_);else return C(u+_);return C(k(u,o,h+1))})});return p?b(0).then(u=>p(null,u),p):b(0)},d=(l,y)=>{y=y||{};const{pathEnv:p,pathExt:v,pathExtExe:f}=m(l,y),x=[];for(let w=0;w<p.length;w++){const b=p[w],k=/^".*"$/.test(b)?b.slice(1,-1):b,u=n.join(k,l),o=!k&&/^\.[\\\/]/.test(l)?l.slice(0,2)+u:u;for(let h=0;h<v.length;h++){const C=o+v[h];try{if(a.sync(C,{pathExt:f}))if(y.all)x.push(C);else return C}catch{}}}if(y.all&&x.length)return x;if(y.nothrow)return null;throw s(l)};return Sn=c,c.sync=d,Sn}var En,Jr;function od(){if(Jr)return En;Jr=1;function t(r){if(!(typeof r>"u"))return JSON.parse(JSON.stringify(r))}return En=t,En}var kn,Xr;function sd(){if(Xr)return kn;Xr=1;var t={};const{BLOCKLET_MODES:r}=Qs(),n=lo(),i=Ol().default,a=Js(),s=ei,{dirname:m,join:c,sep:d}=Xt(),l=Xc(),{tmpdir:y,homedir:p}=co(),v=rd(),{withHttps:f,withHttp:x}=Xs(),w=od(),b=(M,T,q)=>i.encrypt(M,n.pbkdf2Sync(q,T,256,32,"sha512").toString("hex")),k=(M,T,q)=>i.decrypt(M,n.pbkdf2Sync(q,T,256,32,"sha512").toString("hex")),u=(M,T=!0)=>{let q=M;return Array.isArray(q)&&q.every(I=>I.originFileObj&&I.url)&&(q=q.map(I=>I.url),q.length===1&&([q]=q)),T&&q&&typeof q=="object"&&(q=JSON.stringify(q)),q&&typeof q=="string"&&(q=q.replace(/(\r\n|\n|\r)/gm," ")),q},o=M=>M.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),h=M=>o(sr.from(M).toString("base64")),C=M=>(M+"===".slice((M.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),E=M=>new Uint8Array(sr.from(C(M),"base64")),_="v21.6.0",z=()=>a.gte(pe.version,_),F=()=>{try{return l("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function R(M){try{return v.sync(M)}catch{return null}}const U=(M,T=!0)=>{const q=t.NODE_OPTIONS??"";if(q.includes("--experimental-permission")||q.includes("--permission")||q.includes("--allow-fs-read")||q.includes("--allow-fs-write")||q.includes("--allow-addons")||q.includes("--allow-child-process")||q.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:q}),new Error("process.env.NODE_OPTIONS should not include --experimental-permission or --permission or --allow-fs-read or --allow-fs-write or --allow-addons or --allow-child-process or --allow-worker");if(!M)throw new Error("blocklet is not defined");if(q.includes("ms-vscode.js-debug/src/bootloader.js")&&(M.mode===r.DEVELOPMENT||M.environmentObj.BLOCKLET_MODE===r.DEVELOPMENT))return q;const I=[q].filter(J=>!!J&&J!=="undefined");if(!z()||!T)return I.join(" ").trim();const D=F(),j=R("meilisearch"),P="/data/bin/meilisearch",L=R("blocklet"),X=[t.XDG_DATA_HOME?c(t.XDG_DATA_HOME,"pnpm/global/"):"",t.PNPM_HOME?c(t.PNPM_HOME,"global/"):""];return I.push("--permission",...[M.environmentObj.BLOCKLET_DATA_DIR,M.environmentObj.BLOCKLET_APP_DIR,M.environmentObj.BLOCKLET_LOG_DIR,M.environmentObj.BLOCKLET_CACHE_DIR,M.environmentObj.BLOCKLET_APP_DATA_DIR?c(M.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",y()].filter(Boolean).map(J=>`--allow-fs-write=${c(J,"/*")}`),"--allow-addons","--allow-child-process"),M.mode===r.DEVELOPMENT||M.environmentObj.BLOCKLET_MODE===r.DEVELOPMENT?(I.push("--allow-worker","--allow-fs-read=*"),I.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`)):I.push(...[M.environmentObj.BLOCKLET_LOG_DIR,M.environmentObj.BLOCKLET_CACHE_DIR,M.environmentObj.BLOCKLET_APP_DATA_DIR,m(m(M.environmentObj.BLOCKLET_APP_DIR)),D&&m(m(m(m(D)))),L,j,P,m(m(pe.execPath)),pe.cwd(),y(),c(p(),".cursor-server"),"/Applications/Cursor.app",...X].filter(Boolean).filter(J=>J!==d).map(J=>`--allow-fs-read=${c(J,"/*")}`)),s(I).join(" ").trim()},B={crossOriginEmbedderPolicy:!1,crossOriginOpenerPolicy:!1,crossOriginResourcePolicy:!1,originAgentCluster:!1,strictTransportSecurity:!0,xContentTypeOptions:!0,xDnsPrefetchControl:!1,xDownloadOptions:!1,xPermittedCrossDomainPolicies:!1,contentSecurityPolicy:!1,referrerPolicy:!1,xFrameOptions:!1,xPoweredBy:!0,xXssProtection:!1};function N(M,T,q){const I=w(M[T]||[]);return I.push(...q),[...new Set(I)]}async function $(M,{node:T,blocklet:q,trustedDomains:I=[]}){if(!M?.contentSecurityPolicy?.directives)return M;const D=w(M);D.contentSecurityPolicy.directives["default-src"]=N(D.contentSecurityPolicy.directives,"default-src",["'self'"]);const j=await T.getNodeInfo({useCache:!0});let P=await T.getBlockletDomainAliases({blocklet:q,nodeInfo:j});return P=(P||[]).map(L=>L.value),D.contentSecurityPolicy.directives["connect-src"]=N(D.contentSecurityPolicy.directives,"connect-src",["'self'",...P.filter(L=>L).map(L=>`http://${L}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),D.contentSecurityPolicy.directives["script-src"]=N(D.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),D.contentSecurityPolicy.directives["frame-src"]=N(D.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com"]),D.contentSecurityPolicy.directives["frame-ancestors"]=N(D.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(q.settings.userSpaceHosts||[]).map(L=>`https://${L}`),...I.filter(Boolean).map(L=>`http://${L}`)]),D}async function H(M,{node:T,blocklet:q}){const I=w(M);if(I?.origin?.smart){const D=[];D.push(...I.origin?.value||[]);const j=await T.getNodeInfo({useCache:!0});let P=await T.getBlockletDomainAliases({blocklet:q,nodeInfo:j});P=(P||[]).map(Z=>Z.value),D.push(...P.map(Z=>f(Z)),...P.map(Z=>x(Z)));const X=((q.settings.federated||{})?.sites||[]).filter(Z=>Z?.isMaster!==!1||Z.status==="approved"),J=[];for(const Z of X)J.push(new URL(Z.appUrl).hostname),J.push(...Z.aliasDomain||[]);D.push(...J.map(Z=>f(Z)),...J.map(Z=>x(Z))),I.origin.value=[...new Set(D)]}return I}function K(M){const T=w(M);for(const q of Object.keys(T))T[q]=T[q]?.value??T[q];return T}function V(M){const T=w(M);for(const q of Object.keys(T))T[q]=T[q]?.override??!1;return T}return kn={encrypt:b,decrypt:k,formatEnv:u,encodeEncryptionKey:h,decodeEncryptionKey:E,canUseFileSystemIsolateApi:z,getSecurityNodeOptions:U,patchResponseHeader:$,patchCors:H,cleanConfigOverride:K,keepConfigOverride:V,DEFAULT_HELMET_CONFIG:B,SAFE_NODE_VERSION:_},kn}var Vo=sd();const Rn=(t,r)=>t&&Vo.encrypt(t,r||G.AIGNE_CONFIG_ENCRYPT_SALT,""),Tn=(t,r)=>t&&Vo.decrypt(t,r||G.AIGNE_CONFIG_ENCRYPT_SALT,""),pt=t=>t==="aigneHub",Ht=t=>t==="bedrock",id=t=>{const r=["provider","model"];if(qn(t))return[...r,"key"];const{provider:n}=t;let i=r;return pt(n)?i=[...r,"key","url"]:Ht(n)?i=[...r,"accessKeyId","secretAccessKey"]:i=[...r,"key"],i.filter(a=>!t[a])},eo=t=>{if(qn(t)||t==="")return"0";const r=typeof t=="string"?parseFloat(t):t;if(Number.isNaN(r))return"0";if(typeof Intl<"u"&&Intl.NumberFormat)return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}).format(r);const n=r.toFixed(2).split("."),i=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=parseFloat(n[1])>0?`.${n[1]}`:"";return`${i}${a}`},ad=t=>[{provider:"aigneHub",name:"AIGNE Hub",baseURL:"https://hub.aigne.io",logo:t?.imgPrefix?Se(t.imgPrefix,"/aigne-hub.jpg"):"/aigne-hub.jpg",documentation:"https://hub.aigne.io/docs",models:[]}],Vt="z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",ld=async t=>{const r=new URL(t);if(typeof window<"u"&&r.origin===window.location.origin)return Yo();const n=Se(r.origin,"__blocklet__.js?type=json"),i=await Gt.get(n).then(m=>m.data);if((i?.componentId||"").split("/").pop()===Vt)return Se(r.origin,i.prefix||"/");const s=(i?.componentMountPoints||[]).find(m=>m?.did===Vt);return s?Se(r.origin,s.mountPoint):t},Yo=()=>{var t,r,n,i;if(typeof window>"u")return"";const a=((t=window.blocklet)===null||t===void 0?void 0:t.prefix)||"/",s=(r=window.location)===null||r===void 0?void 0:r.origin;if((((n=window.blocklet)===null||n===void 0?void 0:n.componentId)||"").split("/").pop()===Vt)return Se(s,a);const c=(((i=window.blocklet)===null||i===void 0?void 0:i.componentMountPoints)||[]).find(d=>d?.did===Vt);return c?Se(s,c.mountPoint):Se(s,a)};async function cd({baseUrl:t="",accessKey:r=""}){let n=Yo();const i=typeof window<"u";try{if(t){const a=new URL(t);(!i||i&&a.origin!==window.location.origin)&&(n=await ld(t))}}catch(a){throw console.warn("Failed to parse baseUrl:",a),new Error(`Failed to parse baseUrl: ${he(a)}`)}if(!n||!r)throw new Error("baseUrl or accessKey is not set");return Gt.get(Se(n,"/api/user/info"),{headers:{Authorization:`Bearer ${r}`}}).then(a=>a.data)}const tn=re.div`
|
|
324
|
+
min-height: ${({minHeight:t})=>t==="none"?"auto":`${t||160}px`};
|
|
325
|
+
height: ${({height:t,minHeight:r})=>t==="none"?"auto":`${t||r||160}px`};
|
|
326
|
+
padding: ${({theme:t})=>t.spacing(2)};
|
|
327
|
+
border-radius: ${({theme:t})=>t.shape.borderRadius}px;
|
|
328
|
+
border: 1px solid;
|
|
329
|
+
border-color: ${({theme:t})=>t.palette.divider};
|
|
330
|
+
background-color: ${({theme:t})=>t.palette.background.paper};
|
|
331
|
+
box-shadow: ${({theme:t})=>t.shadows[1]};
|
|
332
|
+
`,dd={loading:g.bool,authLoading:g.bool,disconnectLoading:g.bool,connecting:g.bool},Nn=re(Zt)`
|
|
333
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
334
|
+
font-weight: 500;
|
|
335
|
+
border-color: ${({theme:t})=>t.palette.grey[300]};
|
|
336
|
+
line-height: 1.5;
|
|
337
|
+
&:hover {
|
|
338
|
+
background-color: ${({theme:t})=>ti(t.palette.primary.main,.1)};
|
|
339
|
+
}
|
|
340
|
+
`;function Zo({loading:t=!1,user:r=null,switchUser:n=mt,connecting:i=!1,url:a=""}){const{t:s}=S.useContext(be);return!r&&!t?null:e.jsx(tn,{children:t?e.jsxs(O,{sx:{display:"flex",justifyContent:"center",alignItems:"flex-start",gap:2,height:"100%"},children:[e.jsx(ze,{variant:"circular",width:48,height:48}),e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:1,width:"100%"},children:[e.jsx(ze,{variant:"rounded",sx:{width:"80%",height:20}}),e.jsx(ze,{variant:"rounded",sx:{width:"40%",height:20}}),e.jsx(ze,{variant:"rounded",sx:{width:"30%",height:20}}),e.jsx(ze,{variant:"rounded",sx:{width:"60%",height:20}})]})]}):e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%"},children:[e.jsx(ni,{size:"large",showDid:!0,showHoverCard:!0,user:r,avatarProps:{size:48},infoType:ir.Minimal,popupInfoType:ir.Basic,sx:{border:"none",p:0},onAvatarClick:()=>{a&&window.open(ri(Se(a,G.WELLKNOWN_BLOCKLET_USER_PATH),{did:r.did}),"_blank")}}),e.jsx(O,{children:e.jsx(Nn,{variant:"outlined",disabled:i,startIcon:i?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(ue,{style:{fontSize:16},icon:"tabler:switch-horizontal"}),onClick:n,children:s("setting.aigne.switchUser")})})]})})}Zo.propTypes={loading:g.bool,user:g.object,switchUser:g.func,url:g.string,...dd};function Qo({loading:t=!1,credit:r=null,connecting:n=!1,onRefresh:i=()=>{},refreshing:a=!1}){const{t:s}=S.useContext(be),m=Mn`
|
|
341
|
+
from {
|
|
342
|
+
transform: rotate(0deg);
|
|
343
|
+
}
|
|
344
|
+
to {
|
|
345
|
+
transform: rotate(360deg);
|
|
346
|
+
}
|
|
347
|
+
`,c=S.useMemo(()=>!r?.enableCredit,[r]),d=S.useMemo(()=>Number(r?.creditBalance?.balance)<=0&&Number(r?.creditBalance?.pendingCredit)>0,[r]);if(!r&&!t)return null;const{creditBalance:l,profileLink:y="",paymentLink:p=""}=r||{};return e.jsx(tn,{children:t?e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[e.jsxs(O,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[e.jsx(ze,{variant:"rounded",sx:{width:"80%",height:20}}),e.jsx(ze,{variant:"rounded",sx:{width:"50%",height:20}})]}),e.jsxs(O,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[e.jsx(ze,{variant:"rounded",sx:{width:"100%",height:20}}),e.jsx(ze,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):e.jsxs(O,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[e.jsx(ie,{variant:"body1",children:"AIGNE Hub Credits"}),e.jsxs(ie,{variant:"h2",sx:{color:!c&&d?"error.main":"text.primary"},children:[e.jsx("span",{children:c?s("setting.aigne.infinite"):d?`- ${eo(l?.pendingCredit)}`:eo(l.balance)}),e.jsx(Ce,{title:s("common.refresh"),children:e.jsx(Ra,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${m} 1s linear infinite`:"none"},onClick:i})})]})]}),c?null:e.jsxs(O,{sx:{width:"100%",display:"flex",gap:1},children:[e.jsx(Nn,{fullWidth:!0,variant:"outlined",disabled:n,onClick:()=>{p&&window.open(p,"_blank")},startIcon:e.jsx(ue,{style:{fontSize:16},icon:"tabler:credit-card"}),children:s("setting.aigne.addCredits")}),e.jsx(Nn,{fullWidth:!0,disabled:n,onClick:()=>{y&&window.open(y,"_blank")},variant:"outlined",startIcon:e.jsx(ue,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:s("setting.aigne.transaction")})]})]})})}Qo.propTypes={loading:g.bool,credit:g.object,connecting:g.bool,onRefresh:g.func,refreshing:g.bool};function Jo({url:t,apiKey:r,switchUser:n=mt,connecting:i=!1}){const{t:a}=S.useContext(be),[s,m]=S.useState(!1),{data:c,loading:d,error:l,refresh:y}=oi(()=>cd({baseUrl:t,accessKey:r}),{ready:!!(t&&r),refreshDeps:[t,r],onSuccess:()=>{m(!1)},onError:()=>{m(!1)}}),p=S.useCallback(()=>{d||s||(m(!0),y())},[y,d,s]);return l?null:e.jsxs(O,{children:[e.jsx(ie,{variant:"h5",sx:{fontSize:18,mb:2},children:a("setting.aigne.account")}),e.jsxs(Me,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[e.jsx(Me,{size:{xs:12,md:6},children:e.jsx(Zo,{loading:d&&!s,user:c?.user,switchUser:n,connecting:i,url:t})}),e.jsx(Me,{size:{xs:12,md:6},children:e.jsx(Qo,{refreshing:s,loading:d&&!s,credit:c,connecting:i,onRefresh:p})})]})]})}Jo.propTypes={url:g.string.isRequired,apiKey:g.string.isRequired,connecting:g.bool,switchUser:g.func};function Xo({url:t,providerName:r,disconnect:n=mt,disabled:i=!1,loading:a=!1,validationResult:s=""}){const{t:m}=S.useContext(be),c=S.useMemo(()=>s&&s!=="success",[s]);return e.jsx(tn,{minHeight:80,height:"none",children:e.jsxs(O,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?e.jsx(Ce,{title:s,children:e.jsx(So,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):e.jsx(To,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),e.jsxs(O,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[e.jsxs(O,{children:[e.jsx(ie,{variant:"h5",sx:{fontSize:18},children:c?m("setting.aigne.testFailed"):m("setting.aigne.connected",{provider:r})}),e.jsxs(ie,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[m("setting.aigne.baseUrl",{provider:r}),": ",t]})]}),e.jsx(Zt,{variant:"outlined",color:"error",startIcon:a?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(Ki,{}),onClick:n,disabled:i||a,sx:{lineHeight:1.5},children:m("setting.aigne.disconnect")})]})]})})}Xo.propTypes={url:g.string.isRequired,providerName:g.string.isRequired,disabled:g.bool,disconnect:g.func,loading:g.bool,validationResult:g.string};function rt({desc:t,docLink:r=null,provider:n="",orientation:i="vertical"}){const{t:a}=S.useContext(be);return e.jsxs(ie,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...i==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:t,children:[t,r&&e.jsx(Ce,{title:e.jsxs(e.Fragment,{children:[a("setting.aigne.desc.docLink"),r&&e.jsxs(e.Fragment,{children:[":"," ",e.jsx(xt,{href:r,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:n||"documentation"})]})]}),arrow:!0,children:e.jsx(ba,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const Pn={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};rt.propTypes={desc:g.string.isRequired,docLink:g.string,provider:g.string,orientation:g.oneOf(["vertical","horizontal"])};function es({orientation:t="vertical",hideDivider:r=!1,source:n="dashboard",forceValidate:i=!1},a){const[s,m]=S.useState(!1),[c,d]=S.useState(!1),[l,y]=S.useState(!1),[p,v]=S.useState(!1),{t:f}=S.useContext(be),x=ge(),{api:w}=x,{did:b,blocklet:k,actions:u}=Ie(),[o,h]=S.useState(!1),C=ar({...Pn}),E=ar({loading:!1,success:!1}),{confirmApi:_,confirmHolder:z}=uo(),F=S.useMemo(()=>`connect-aigne-${b}`,[b]),R=ad(x),U=Vi({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),B=S.useMemo(()=>s||c||l||E.loading,[s,c,l,E.loading]),N=Ke(A=>R.find(ee=>ee.provider===A)),$=Ke(A=>N(A)?.models||[]);si(()=>{F&&dl(F)});const H=Ke(A=>{if(A)return A;const ee=R[0]?.provider;return $(ee)[0]?.name||"auto"}),K=Ke(()=>{Object.keys(Pn).forEach(A=>{C[A]=Pn[A]})}),V=kt(()=>{const{aigne:A={}}=k?.settings||{};return A},[k]),M=kt(()=>{const A={...V},ee=A?.provider||R[0]?.provider,te=N(ee),me=pt(ee),vt=Ht(ee);return{...A,url:A?.url||me&&te?.baseURL||"",provider:ee,model:H(A?.model),key:Tn(A?.key,b),accessKeyId:vt?Tn(A?.accessKeyId,b):A?.accessKeyId,secretAccessKey:vt?Tn(A?.secretAccessKey,b):A?.secretAccessKey}},[k,N,H]),[T,q]=S.useState(M);S.useEffect(()=>{q(M)},[M]);const I=S.useMemo(()=>T?.url&&T?.key&&T?.provider==="aigneHub",[T]),D=kt(()=>N(T.provider)?.name||T.provider,[T,N]),j=S.useMemo(()=>id(T),[T]),P=kt(()=>N(T.provider)?.documentation||"",[T,N]),L=async()=>{try{m(!0);const A=new Set(["running","error"]),ee=k.children.filter(te=>A.has(te.status)).map(te=>te.meta.did);await w.restartBlocklet({input:{did:b,componentDids:ee}}),u.refreshBlocklet()}catch(A){console.error("error",A),Y.error(he(A))}finally{m(!1)}},X=(A=!0)=>{if(n!=="setup")return new Promise(ee=>{_.open({title:f("setting.aigne.restart.title"),content:A?f("setting.aigne.restart.connectedContent",{provider:D}):f("setting.aigne.restart.notConnectedContent",{provider:D}),confirmButtonText:f("setting.aigne.restart.confirm"),cancelButtonText:f("setting.aigne.restart.cancel"),onConfirm(te){te(),L(),ee(!0)},onCancel(){ee(!1)}})})},J=Ke(()=>new Promise(A=>{_.open({title:f("setting.aigne.revokeUrlAuthTitle",{url:f("setting.aigne.baseUrl",{provider:D})}),content:f("setting.aigne.revokeUrlAuth",{url:f("setting.aigne.baseUrl",{provider:D})}),confirmButtonText:f("common.confirm"),cancelButtonText:f("common.cancel"),onConfirm(ee){ee(),A(!0)},onCancel(){A(!1)}})})),Z=async(A,ee)=>{const te={};if(q({...T,[A]:ee}),A==="provider"){const me=$(ee);me.length>0&&(te.model=me[0].name),te.key=""}return I&&A==="url"&&ee!==T.url&&(await J()?(te.key="",te.validationResult=""):te.url=T.url),setTimeout(()=>{q({...T,[A]:ee,...te})},100),h(!0),!0},ce=S.useMemo(()=>T.provider,[T.provider]),oe=Ke(A=>ii(A)?"":f("setting.aigne.invalidUrl",{provider:D})),De=(A=[])=>{const ee=j.filter(me=>!A.includes(me));if(ee.length)return ee.forEach(me=>{C[me]="required"}),!ee.includes("url")&&pt(T.provider)&&(C.url=oe(T.url)),!1;const te=pt(T.provider)&&oe(T.url);return te?(C.url=te,!1):!0},Ee=async()=>{try{y(!0),await w.disconnectToAigne({input:{did:b,url:T.url,key:T.key}}),h(!1),Y.success(f("setting.aigne.disconnectSuccess")),setTimeout(()=>{X(!1)},300)}catch(A){console.error("disconnect error:",A),Y.error(he(A)||f("setting.aigne.disconnectFailed"))}finally{y(!1)}},je=()=>{_.open({title:f("setting.aigne.disconnect"),content:f("setting.aigne.disconnectConfirm"),confirmButtonText:f("setting.aigne.disconnect"),cancelButtonText:f("common.cancel"),onConfirm(A){A(),Ee()}})},le=async()=>{if(!De())return;K();const A={...T,model:"auto",key:Rn(T.key,b)};Ht(A.provider)?(A.key="",T.accessKeyId&&(A.accessKeyId=Rn(T.accessKeyId,b)),T.secretAccessKey&&(A.secretAccessKey=Rn(T.secretAccessKey,b))):(A.accessKeyId="",A.secretAccessKey="");const ee=await w.updateBlockletSettings({input:{did:b,aigne:A}});return u.refreshBlocklet(),ee},Ve=async()=>{try{if(!o&&!i)return;m(!0);const A=await le();return A?(h(!1),Y.success(f("oauth.saveSuccess")),A):void 0}catch(A){throw console.error("error",A),Y.error(he(A)||f("setting.aigne.failed")),A}finally{m(!1)}},Ye=async(A=!1)=>{C.testConnection="";try{if(E.loading=!0,!A&&(await le())?.code!=="ok")return;await w.verifyAigneConnection({input:{did:b}}),Y.success(f("setting.aigne.testSuccess",{provider:D})),E.success=!0}catch(ee){throw console.error("error",ee),C.testConnection=ee.message,Y.error(f("setting.aigne.testFailed")),ee}finally{E.loading=!1,u.refreshBlocklet()}},at=async()=>{try{await pl(w,{did:b,refresh:u.refreshBlocklet,t:f,providerName:D,timerKey:F,values:{...V}}).catch(A=>{throw console.error("waitGetConnectedAigne error",A),Y.error(he(A)),A}).then(()=>Ye(!0).catch(A=>{throw console.error("onVerifyConnection error",A),A})),X(!0)}catch(A){console.error("error",A)}finally{h(!1)}},Ze=()=>{De(["key"])&&(K(),U(async(A,ee)=>{try{d(!0);const te=await w.connectToAigne({input:{did:b,baseUrl:T.url||new URL(window.location.origin).origin,provider:T.provider,model:"auto"}});if(!te?.url){Y.error("failed to connect to endpoint");return}ee(te.url),await at(),d(!1)}catch(te){const me=he(te);Y.error(me),d(!1)}}))};S.useImperativeHandle(a,()=>({onSubmit:Ve,loading:s||c||l})),$(ce);const Qe=ce==="aigneHub",rn=()=>{v(!p)},we=A=>{A.preventDefault()},yt=S.useMemo(()=>C.url==="required"?f("common.requiredErrorText",{name:f("setting.aigne.baseUrl",{provider:D})}):C.url?C.url:C.key==="required"?f("setting.aigne.apiKeyNotAuthorized",{provider:D}):"",[C.url,C.key,f,D]);return e.jsxs(ud,{source:n,children:[e.jsx(O,{sx:{mb:3},children:e.jsx(ie,{variant:"body2",color:"text.primary",sx:{lineHeight:1.6,"& a":{color:"primary.main"}},dangerouslySetInnerHTML:{__html:f("setting.aigne.configDesc",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}})}),e.jsx(ie,{variant:"h5",sx:{fontSize:18},children:f("setting.aigne.authorizeAigneHub",{name:D})}),I&&T.validationResult?e.jsx(Xo,{url:T.url,providerName:D,disconnect:je,validationResult:T.validationResult,disabled:B,loading:l}):e.jsx(tn,{height:"none",minHeight:"none",children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[e.jsx(dt,{orientation:t,title:f("setting.aigne.baseUrl",{provider:D}),required:pt(T.provider),desc:e.jsx(rt,{desc:f("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:e.jsx(Tt,{disabled:B,initialValue:T.url||"",directEditing:!0,onSubmit:A=>{Z("url",A)},autoFocus:!1,errorTips:yt,InputProps:I?{endAdornment:e.jsx(lr,{position:"end",children:E.loading||c?e.jsx(ve,{size:16}):e.jsxs(e.Fragment,{children:[T.validationResult==="success"?e.jsx(Ce,{title:f("setting.aigne.testSuccess",{provider:D}),children:e.jsx(To,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,T.validationResult&&T.validationResult!=="success"?e.jsx(Ce,{title:T.validationResult,children:e.jsx(So,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,T.validationResult?null:e.jsx(fe,{"aria-label":"test connection",onClick:Ye,edge:"end",children:E.loading?e.jsx(ve,{size:16}):e.jsx(Ce,{title:f("setting.aigne.testConnection",{provider:D}),children:e.jsx(ue,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),e.jsx(Zt,{variant:"contained",onClick:Ze,startIcon:c?e.jsx(ve,{size:16,sx:{mr:1}}):e.jsx(Jt,{}),disabled:B||!T.url,sx:{flexShrink:0},children:f("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),e.jsxs(Me,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[e.jsx(Me,{size:{xs:12,md:4},children:e.jsx(dt,{orientation:t,title:f("setting.aigne.modelAdapter"),required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.modelAdapter")}),children:e.jsx(Ho,{disabled:B,options:R,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:T.provider,directEditing:!0,searchable:!1,helperText:C.provider==="required"?f("common.requiredErrorText",{name:f("setting.aigne.modelAdapter")}):C.provider,onChange:A=>Z("provider",A)})})}),null,Qe?null:e.jsx(e.Fragment,{children:Ht(T.provider)?e.jsxs(e.Fragment,{children:[e.jsx(dt,{orientation:t,title:"Access Key ID",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.accessKeyId"),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.accessKeyId||"",type:p?"text":"password",onChange:A=>Z("accessKeyId",A),directEditing:!0,autoFocus:!1})}),!r&&e.jsx(O,{className:"config-form",component:ai,sx:{my:3}}),e.jsx(dt,{orientation:t,title:"Secret Access Key",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.secretAccessKey"),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.secretAccessKey||"",type:p?"text":"password",onChange:A=>Z("secretAccessKey",A),directEditing:!0,autoFocus:!1})})]}):e.jsx(dt,{orientation:t,title:"API Key",required:!0,desc:e.jsx(rt,{desc:f("setting.aigne.desc.key",{provider:D}),docLink:P,provider:D}),children:e.jsx(Tt,{disabled:B,initialValue:T.key||"",type:p?"text":"password",onChange:A=>Z("key",A),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:e.jsx(lr,{position:"end",children:e.jsx(fe,{"aria-label":"toggle password visibility",onClick:rn,onMouseDown:we,edge:"end",children:p?e.jsx(Da,{}):e.jsx(Ba,{})})})}})})})]}),I&&T.validationResult==="success"?e.jsx(Jo,{switchUser:Ze,url:T.url||"",apiKey:T.key||"",connecting:c||l}):null,n!=="setup"&&e.jsxs(ie,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",f("setting.aigne.description",{name:ne.getDisplayName(k,!0)})]}),z]})}es.propTypes={orientation:g.oneOf(["vertical","horizontal"]),hideDivider:g.bool,source:g.oneOf(["dashboard","setup"]),forceValidate:g.bool};const ud=re.div`
|
|
348
|
+
max-width: 920px;
|
|
349
|
+
display: flex;
|
|
350
|
+
flex-direction: column;
|
|
351
|
+
gap: 16px;
|
|
352
|
+
.section-title {
|
|
353
|
+
line-height: 1.2 !important;
|
|
354
|
+
font-weight: ${({source:t})=>t==="setup"?"400":"500"};
|
|
355
|
+
color: ${({theme:t,source:r})=>r==="setup"?t.palette.text.secondary:t.palette.text.primary};
|
|
356
|
+
font-size: ${({source:t})=>t==="setup"?"14px":"16px"};
|
|
357
|
+
}
|
|
358
|
+
.section-left {
|
|
359
|
+
width: 100%;
|
|
360
|
+
}
|
|
361
|
+
.form-item {
|
|
362
|
+
margin-bottom: 0 !important;
|
|
363
|
+
margin-top: 0 !important;
|
|
364
|
+
}
|
|
365
|
+
`,pd=S.forwardRef(es),fd=(t,r)=>(t?.children||[]).find(n=>n.mountPoint===r)?.meta,md=t=>t.inStore&&ne.isFreeBlocklet(t)===!1,hd=t=>[ye.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,ye.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(t?.capabilities?.didSpace),In=t=>t?.configs?.find(r=>r.key===ye.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,gd=t=>(t.environments||[]).some(r=>r.required),to=(t,r)=>t?.some(n=>n.required&&!r[n.key]),xd=({params:t,blocklet:r,t:n})=>{const i=t.title||t.name;return i?(r?.children||[]).find(s=>s.meta.bundleDid===t.bundleDid)?n("blocklet.component.upgradeNext",{name:i}):n("blocklet.component.addNext",{name:i}):n("common.next")},no=({componentDid:t,timeout:r=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:n},"*")},r)};function ts({onClose:t=()=>{},mode:r="normal",stores:n=[],resourceType:i="",resourceDid:a="",storageKey:s="",inDialog:m=!0,selectedMeta:c=null,storeUrl:d="",showResourcesSwitch:l=!0,showFromUrl:y=!0,enableRunBackground:p=!0,showCategory:v=!0,installFromUrlParams:f=null}){const{t:x,locale:w}=ae(),[b,k]=S.useState(!1),[u,o]=S.useState(null),[h,C]=S.useState(""),[E,_]=S.useState(""),{api:z,ws:{useSubscription:F},inService:R,info:U}=ge(),{blocklet:B,actions:{refreshBlocklet:N}}=Ie(),[$,H]=S.useState(null),[K,V]=S.useState(!1),M={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[T,q]=S.useState(M),[I,D]=S.useState(0),j=S.useRef({}),P=S.useRef({}),L=S.useRef({}),X=po(W=>W.breakpoints.down("md")),J=li(),[Z,ce]=S.useState(!0),{meta:oe}=j.current,De=aa(oe),Ee=S.useRef(!1),je=S.useRef(null),le=W=>q(Q=>({...Q,...W}));S.useEffect(()=>{if(T.pathPrefix){const{errMsg:W}=ee({...T,pathPrefix:T.pathPrefix,locale:w});C(W)}},[T.pathPrefix]),S.useEffect(()=>{I===0&&q(M)},[I]);const Ve=()=>{const W=In(B)??"";le({didSpaceEndpoint:W})},Ye=()=>j?.current?.meta?ne.getDisplayName(j.current):"",at=()=>{k(!1),q({}),Ee.current=!1,j.current={},t()},Ze=W=>{const Q=se=>{le({installResultProps:{variant:"error",title:Ye(),subTitle:W,footer:e.jsx(Be,{className:"bottom-button",disabled:se,"data-cy":"retry-install-component",onClick:async()=>{Q(!0),await A(j.current.installInput)},children:e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[se&&e.jsx(ve,{size:16,style:{marginRight:8}}),x("common.retry")]})})}})};Q()},Qe=W=>Q=>{(Q?.meta?.did||Q?.meta)===B?.meta?.did&&W(Q)},rn=()=>{no({timeout:0,componentDid:J.componentDid,manual:!0}),at(),setTimeout(()=>{const W=document.getElementsByClassName("dashboard-main")[0];W&&(W.scrollTop=W.scrollHeight)},200)};F(ye.BlockletEvents.componentInstalled,Qe(()=>{le({installResultProps:{variant:"success",title:Ye(),subTitle:x("blocklet.component.installSuccessTip")}}),no({componentDid:J.componentDid})}),[B?.meta?.did]),F(ye.BlockletEvents.statusChange,Qe(()=>{const W=In(B);le(Q=>({...Q,didSpaceEndpoint:W}))}),[B?.meta?.did]),F(ye.BlockletEvents.downloadFailed,Qe(()=>{Ee.current=!1,Ze(x("blocklet.component.installComponentError"))}),[B?.meta?.did]),F(ye.BlockletEvents.installFailed,Qe(()=>{Ee.current=!1,Ze(x("blocklet.component.installComponentError"))}),[B?.meta?.did]);const we=[],yt=W=>(B?.children||[]).find(Q=>Q.meta.did===W),A=async W=>{Ee.current=!0;const{pathPrefix:Q,bundleDid:se,title:de,componentName:Te="",componentDid:Fe=""}=T,Ge=j.current?.meta||{},{configs:Je=[],registryUrl:Oe,inStore:Xe,inputUrl:lt,dist:sn}=Ge,Ct=j.current?.downloadTokenList,bt=lt||(Xe?cr(Oe,se,sn):"");k(!0);const ke={rootDid:B.meta.did,url:bt,mountPoint:Q?Le(Q):`/${Le(Ge.title||Ge.name)}`,title:de,name:Te,did:T.isUpload&&T.upgradeDid?T.upgradeDid:Fe,dist:{tarball:"",integrity:""},onlyRequired:!Z,...T.hasEnvironmentsStep&&Je.length>0?{configs:Je.map(Ae=>({...Ae,value:T.configsValue[Ae.key]||""}))}:{},...Ct?{downloadTokenList:Ct}:{},...W};try{if(await z.installComponent({input:ke}),Oe){const{teamDid:Ae,storeList:$e}=io({fromBlocklet:R,nodeInfo:U,blocklet:B}),{isNew:ct,decoded:jt}=ui(Oe,$e);ct&&await z.addBlockletStore({input:{teamDid:Ae,url:jt}})}le({installResultProps:{}}),N({showError:!1,attachRuntimeInfo:!1})}catch(Ae){const $e=he(Ae);Y.error($e),console.error("installComponent error: ",Ae),Ze($e)}finally{k(!1),j.current.installInput=ke}},ee=W=>{const Q=wo({params:{...W,did:W.bundleDid},blocklets:[B],blocklet:B,locale:w,isUpload:T.isUpload});let se=Q;const de=fd(B,T.pathPrefix);if(Q==="overwrite"&&de&&de.did!==W.bundleDid?(le({upgradeDid:de.did}),se=""):(le({upgradeDid:""}),se=Q),se){const Te=yt(W.bundleDid),Fe=ya({params:{...W,did:W.bundleDid},blocklet:B});if(Te&&Te.mountPoint===Fe)return{errMsg:""}}return{errMsg:se}},te=async W=>{const{errMsg:Q}=ee({...T,locale:w});C(Q),I===we.length-2&&!Ee.current&&await A(W),P.current?.setActiveStepByIndex?.(se=>se+1)},me=()=>{P.current?.setActiveStepByIndex?.(W=>W-1)},vt=()=>{const{pathPrefix:W,bundleDid:Q,title:se,componentName:de="",componentDid:Te=""}=T,{meta:Fe={}}=j.current||{},{registryUrl:Ge,inStore:Je,inputUrl:Oe,dist:Xe}=Fe,lt=Je?cr(Ge,Q,Xe):Oe;H({meta:Fe,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:W,url:lt,title:se,name:de,did:Te}})},nr=W=>{V(!1),le({purchaseResultProps:{variant:"error",title:Ye(),subTitle:W,style:{paddingTop:120},footer:e.jsx(Be,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{le({purchaseResultProps:{}})},children:x("common.retry")})}})},hs=({downloadTokenList:W})=>{j.current.downloadTokenList=W,V(!1),te()},on=({chooseParams:W=j.current,componentDid:Q,isInit:se=!1,isUpload:de=!1})=>{const{meta:Te,registryUrl:Fe,inStore:Ge,inputUrl:Je}=W,{did:Oe,title:Xe,name:lt}=Te,sn=(B.settings?.children||[]).filter(Pe=>Pe.status==="deleted"&&Pe.meta.bundleDid===Oe),Ct=Q||"",bt=Te.environments?.map(Pe=>{const{name:an,validation:wt,..._t}=Pe,ln={validation:qn(wt)?"":wt};return{..._t,key:an,...ln}});j.current={...W,meta:{...Te,configs:bt,registryUrl:Fe,inStore:Ge,inputUrl:Je}};let ke={};if(se){const Pe=[B],an=bt||[],wt=[],_t=ao(di([...an,...wt]),"key").filter(et=>!!et.key).sort((et,St)=>et.required&&!St.required?-1:St.required&&!et.required?1:0),ln=ne.getSharedConfigObj(Pe[0],{configs:_t}),cn={},rr=_t.map(et=>{const{default:St,key:Et,...Cs}=et;return cn[Et]=ln[Et]||St,{...Cs,key:Et,hidden:!!ye.BLOCKLET_CONFIGURABLE_KEY[Et]}});ke={...ke,configsList:rr,configsValue:cn,hasMissRequiredConfigs:to(rr,cn)}}const Ae=B.children.some(Pe=>Pe.mountPoint==="/"),$e=sn.find(Pe=>Pe.meta.bundleDid===Oe),ct=B.children.find(Pe=>Pe.meta.bundleDid===Oe);ke.title=Xe||"",$e?ke={...ke,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:ct?ke={...ke,pathPrefix:ct.mountPoint||"",componentName:ct.meta.name,hasEnvironmentsStep:!1}:ke={...ke,pathPrefix:Ae?`/${Le(Xe)||Le(lt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:j.current.meta?.environments?.length>0};const jt=md(j.current.meta),ys=hd(j.current.meta),vs=In(B);le({bundleDid:Oe,componentDid:Ct,...ke,hasRequiredEnvironments:gd(j.current.meta),requirePurchase:jt,didSpaceIsRequiredSetup:ys,didSpaceEndpoint:vs,isUpload:de}),se&&jt&&vt()},gs=async()=>{if(!je.current.loading)try{k(!0),await je.current.onSubmit()&&te()}catch(W){console.error("error",W)}finally{k(!1)}};S.useEffect(()=>{if(!c&&!f?.meta||I!==0||!B)return;const{meta:W,inputUrl:Q="",inStore:se=!0,registryUrl:de="",isUpload:Te=!1}=f||{};on({chooseParams:{blocklets:[c||W],meta:c||W,registryUrl:de||d||c.homepage,inStore:se,inputUrl:Q},isInit:!0,isUpload:Te}),le({showFromUrlDialog:!1}),te()},[c,I,B,f]),we.push({key:"selectComponent",name:x("blocklet.component.selectComponent"),body:e.jsxs(We,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[y&&T.showFromUrlDialog&&e.jsx(jo,{mode:"component",onCancel:()=>{le({showFromUrlDialog:!1})},onSuccess:({meta:W,inputUrl:Q,inStore:se,registryUrl:de})=>{on({chooseParams:{meta:W,inputUrl:Q,inStore:se,registryUrl:de},isInit:!0}),le({showFromUrlDialog:!1}),te()},handleText:{title:x("blocklet.component.addComponentTip.fromUrl"),confirm:x("blocklet.component.choose")}}),e.jsx(qo,{stores:n,extra:yo.isInServerlessMode(U)?null:y?e.jsxs(Be,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{le({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Jt,{style:{fontSize:20,marginRight:4}}),x("blocklet.component.addComponentTip.fromUrl")]}):null,loading:b,onChange:()=>{q({}),j.current={}},storageKey:s,children:({currentRegistry:W})=>e.jsx($o,{showResourcesSwitch:l,showCategory:v,serverVersion:U?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:W.url,resourceType:i,resourceDid:a,handleButtonClick:Q=>{on({chooseParams:{...Q,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:Q,defaultRender:se})=>{const de=T?.bundleDid&&T?.bundleDid===Q?.did;return e.jsxs(vd,{children:[e.jsx(O,{className:de?"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",...de?{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:se}),de&&e.jsx(O,{className:"check-container",children:e.jsx(ci,{className:"check-icon"})})]})}})})]}),cancel:r==="embed"?void 0:x("common.cancel"),confirm:xd({params:T,blocklet:B,t:x}),onCancel:at,onConfirm:()=>{te()}}),we.push({key:"agreement",name:x("launchBlocklet.introduction"),body:e.jsxs(We,{component:"div",className:"agreement-wrapper",children:[e.jsx(On,{title:x("launchBlocklet.introduction"),subTitle:x("blocklet.component.addComponentTip.introduction")}),oe?e.jsx(la,{meta:oe,onClickNext:te,installRelated:Z,onChangeInstallRelated:ce,handleDescEle:e.jsx("p",{children:x("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:x("common.pre"),disabled:!De,confirm:x(De?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?at:me,onConfirm:()=>{V(!1),te()}}),oe&&T.requirePurchase&&we.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[x("common.verifyNFT"),e.jsx(ot,{})]}),body:e.jsxs(We,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(L.current?.getCurrentStep?.()===2||K)&&e.jsx(Pt,{title:x("common.verifyNFT"),subTitle:x("blocklet.component.addComponentTip.verifyNFT")}),Rt(T.purchaseResultProps)?$&&e.jsx(Ao,{ref:L,meta:$.meta,mode:T.componentDid?"verify":"both",onCancel:nr,installOpts:$.installOpts,handlePaySuccess:hs}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(hr,{...T.purchaseResultProps})})]}),disabled:L.current?.getCurrentStep?.()===2||K,cancel:x("common.pre"),confirm:x("common.next"),onConfirm:()=>{typeof L.current.onNext=="function"&&(L.current.onNext(),V(!0))},onCancel:()=>{me()}}),ne.hasStartEngine(oe)&&Co.hasMountPoint(oe)?we.push({key:"config",name:x("common.config"),error:h,body:e.jsxs(We,{component:"div",children:[e.jsx(Pt,{title:x("common.config"),subTitle:x("blocklet.component.addComponentTip.config")}),e.jsx(xe,{label:x("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:E||x("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:T.pathPrefix,onChange:W=>{const Q=W.target.value;le({pathPrefix:Q}),_(x("common.slugifyHint",{value:Fn(Q)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!h&&e.jsx(Dn,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:me,onConfirm:()=>{te()}}):oe&&(T.pathPrefix=oe.interfaces?.[0]?.path||`/${oe.did}`),oe&&oe?.requirements?.aigne&&we.push({key:"aigne",name:e.jsxs(ie,{component:"div",title:x("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[x("setting.aigne.config")," ",e.jsx(ot,{})]}),body:()=>e.jsxs(We,{component:"div",className:"aigne-config-wrapper",children:[e.jsx(On,{title:x("setting.aigne.config")}),e.jsx(O,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:e.jsx(pd,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:je})})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:()=>{je.current.loading||me()},onConfirm:gs,loading:b||je.current?.loading,disabled:b||je.current?.loading}),oe&&T?.hasEnvironmentsStep&&we.push({key:"environment",name:e.jsxs(e.Fragment,{children:[x("common.environment")," ",T.hasRequiredEnvironments&&e.jsx(ot,{})]}),disabled:!!u||T?.hasMissRequiredConfigs,body:()=>e.jsxs(We,{component:"div",style:{overflowY:"auto"},children:[e.jsx(Pt,{title:x("common.environment"),subTitle:x("blocklet.component.addComponentTip.environment")}),e.jsx(No,{style:{marginTop:-12,width:"100%"},schema:T.configsList,defaultValue:T.configsValue,onChange:(W,{action:Q,currentItem:se,allValues:de})=>{Q==="confirm"&&le({hasMissRequiredConfigs:to(T.configsList,de),configsValue:de}),Q==="edit"?o(se):["cancel","confirm"].includes(Q)&&o(null)}})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:me,onConfirm:te}),oe&&T?.didSpaceIsRequiredSetup&&we.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[x("blocklet.component.didSpaceConfig")," ",T.didSpaceIsRequiredSetup==="required"&&e.jsx(ot,{})]}),disabled:T?.didSpaceIsRequiredSetup&&!T.didSpaceEndpoint,body:()=>e.jsx(sa,{children:e.jsxs(We,{component:"div",children:[e.jsx(Pt,{title:x("blocklet.component.didSpaceConfig"),subTitle:x("blocklet.component.didSpaceConfigTip")}),e.jsx(O,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(Mo,{blockletMeta:j.current.meta,onNext:()=>{te()},onEndpointUpdate:Ve})})]})}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:me,onConfirm:te}),we.push({key:"install",name:yt(oe?.did)?x("common.upgrade"):x("common.install"),disabled:p?!1:Rt(T.installResultProps),loading:p?!1:Rt(T.installResultProps),body:e.jsx(We,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Rt(T.installResultProps)?e.jsx(Xi,{message:e.jsx(Cd,{children:x(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(hr,{...T.installResultProps})})}),confirm:x("common.complete"),onConfirm:rn});const Re=we[I]||{},xs=()=>b||Re.error||!T.bundleDid?!0:I>1?!T.pathPrefix:!1;return B?e.jsxs(yd,{sx:m?{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:[e.jsx(ea,{steps:we,mode:"memory",children:e.jsx(Wo,{ref:P,meta:oe,isMobile:X,onStepChange:W=>{D(W)}})}),e.jsxs(O,{className:"action-bar",children:[Re.cancel&&e.jsx(Be,{onClick:W=>{W.stopPropagation(),Re.onCancel()},disabled:I===we.length-2&&b,color:"inherit",children:Re.cancel||x("common.cancel")}),Re.confirm&&e.jsx(Be,{onClick:W=>{W.stopPropagation(),Re.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:b||(typeof Re.disabled=="boolean"?Re.disabled:xs()),variant:"contained",autoFocus:!0,title:Re.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(O,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Re.loading=="boolean"?Re.loading:b)&&e.jsx(ve,{style:{marginRight:8},size:16}),e.jsx(O,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Re.confirm})]})})]})]}):null}ts.propTypes={onClose:g.func,mode:g.oneOf(["normal","embed"]),inDialog:g.bool,stores:g.arrayOf(g.string),storeUrl:g.string,resourceType:g.string,resourceDid:g.string,storageKey:g.string,selectedMeta:g.object,showResourcesSwitch:g.bool,showFromUrl:g.bool,enableRunBackground:g.bool,showCategory:g.bool,installFromUrlParams:g.object};const yd=re(O)`
|
|
366
|
+
.action-bar {
|
|
367
|
+
display: flex;
|
|
368
|
+
justify-content: flex-end;
|
|
369
|
+
position: sticky;
|
|
370
|
+
bottom: 0;
|
|
371
|
+
padding-top: 16px;
|
|
372
|
+
z-index: 100;
|
|
373
|
+
width: 100%;
|
|
374
|
+
background: ${({theme:t})=>t.palette.background.paper};
|
|
375
|
+
border-top: '1px solid';
|
|
376
|
+
border-color: ${({theme:t})=>t.palette.divider};
|
|
377
|
+
}
|
|
378
|
+
`,We=re(ie)`
|
|
379
|
+
width: 100%;
|
|
380
|
+
height: 100%;
|
|
381
|
+
`,Pt=re(On)`
|
|
382
|
+
margin-bottom: 24px;
|
|
383
|
+
`,vd=re.div`
|
|
384
|
+
position: relative;
|
|
385
|
+
|
|
386
|
+
.choose-blocklet {
|
|
387
|
+
background-color: rgb(236, 251, 253);
|
|
388
|
+
border-color: rgb(236, 251, 253);
|
|
389
|
+
border-radius: 8px;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.check-container {
|
|
393
|
+
position: absolute;
|
|
394
|
+
right: 0;
|
|
395
|
+
bottom: 0;
|
|
396
|
+
display: flex;
|
|
397
|
+
justify-content: flex-end;
|
|
398
|
+
align-items: flex-end;
|
|
399
|
+
width: 30px;
|
|
400
|
+
height: 30px;
|
|
401
|
+
border-radius: 0 0 8px 0;
|
|
402
|
+
color: ${t=>t.theme.palette.common.white};
|
|
403
|
+
overflow: hidden;
|
|
404
|
+
transition: all ease 0.3s;
|
|
405
|
+
&:after {
|
|
406
|
+
position: absolute;
|
|
407
|
+
z-index: 0;
|
|
408
|
+
display: block;
|
|
409
|
+
width: 0;
|
|
410
|
+
height: 0;
|
|
411
|
+
border-top: transparent solid 15px;
|
|
412
|
+
border-left: transparent solid 15px;
|
|
413
|
+
border-bottom: ${t=>t.theme.palette.primary.main} solid 15px;
|
|
414
|
+
border-right: ${t=>t.theme.palette.primary.main} solid 15px;
|
|
415
|
+
transition: all ease 0.1s;
|
|
416
|
+
content: '';
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.check-icon {
|
|
420
|
+
position: relative;
|
|
421
|
+
z-index: 2;
|
|
422
|
+
margin: 0 1px 1px 0;
|
|
423
|
+
font-size: 16px;
|
|
424
|
+
transition: all ease 0.2s;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
`,Cd=re.div`
|
|
428
|
+
color: ${t=>t.theme.palette.primary.main};
|
|
429
|
+
.msg-before {
|
|
430
|
+
display: inline-block;
|
|
431
|
+
color: #aaa;
|
|
432
|
+
font-size: 14px;
|
|
433
|
+
margin-right: 6px;
|
|
434
|
+
}
|
|
435
|
+
`;function Zn({blocklet:t,showDialog:r,setShowDialog:n,selectedMeta:i=null,showFromUrl:a=!0,installFromUrlParams:s=null}){const{t:m}=ae(),c=po(y=>y.breakpoints.down("md")),{inService:d}=ge(),l=()=>{n(!1)};return r?e.jsx(bd,{title:m("blocklet.component.addWithName",{name:ne.getDisplayName(t)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(y,p)=>{p!=="backdropClick"&&l()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:e.jsx(ts,{selectedMeta:i,onClose:l,storageKey:d?Yi:Zi,showFromUrl:a,installFromUrlParams:s})}):null}Zn.propTypes={selectedMeta:g.object,showDialog:g.bool.isRequired,setShowDialog:g.func.isRequired,blocklet:g.object.isRequired,showFromUrl:g.bool,installFromUrlParams:g.object};const bd=re(Yt)`
|
|
436
|
+
.ux-dialog_header {
|
|
437
|
+
background-color: ${({theme:t})=>t.palette.background.paper};
|
|
438
|
+
}
|
|
439
|
+
.MuiDialogContent-root {
|
|
440
|
+
background-color: ${({theme:t})=>t.palette.background.paper};
|
|
441
|
+
}
|
|
442
|
+
`;function ns({blocklet:t,children:r=null,disabled:n=!1}){const{t:i}=ae(),[a,s]=S.useState(!1),[m,c]=S.useState({show:!1,params:null}),[d,l]=S.useState({show:!1,params:null}),{getSessionInHeader:y,prefix:p}=ge(),v=h=>{h.stopPropagation(),s(!0)},f=S.useCallback(()=>{c(h=>({...h,show:!0}))},[]),x=S.useCallback((h=!1)=>{c(h?{params:null,show:!1}:C=>({...C,show:!1}))},[]),w=S.useCallback(()=>{l({params:null,show:!0})},[]),b=S.useCallback(h=>{l({params:{...h,inStore:!1,isUpload:!0},show:!1}),h.meta&&s(!0)},[]),k=S.useCallback((h=!1)=>{l(h?{params:null,show:!1}:C=>({...C,show:!1}))},[]),u=S.useCallback(h=>{s(h),h||(x(!0),k(!0))},[x,k]),o=S.useMemo(()=>[e.jsxs(un.Item,{"data-cy":"add-component-from-url",onClick:f,style:{fontSize:14,color:"primary.main"},children:[e.jsx(Jt,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url"),e.jsxs(un.Item,{"data-cy":"add-component-from-upload",onClick:w,style:{fontSize:14,color:"primary.main"},children:[e.jsx(Ia,{style:{fontSize:16,marginRight:4}}),i("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[w,f,i]);return e.jsxs(e.Fragment,{children:[typeof r=="function"?r({open:v}):e.jsxs(un,{onClick:v,disabled:n,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:o,children:[e.jsx(Ai,{style:{fontSize:"1.3em",marginRight:4}}),i("blocklet.component.add")]}),e.jsx(Zn,{showDialog:a,setShowDialog:u,blocklet:t,selectedMeta:m.params?.meta||d.params?.meta||null,installFromUrlParams:m.params||d.params,showFromUrl:!1}),m.show?e.jsx(jo,{mode:"component",onCancel:x,onSuccess:({meta:h,inputUrl:C,inStore:E,registryUrl:_})=>{c({show:!1,params:{meta:h,inputUrl:C,inStore:E,registryUrl:_}}),s(!0)},handleText:{title:i("blocklet.component.addComponentTip.fromUrl"),confirm:i("blocklet.component.choose")}}):null,e.jsx(Bo,{open:d.show,did:t.meta.did,prefix:p,headers:y,onUploaded:b,onClose:k})]})}ns.propTypes={children:g.any,blocklet:g.object.isRequired,disabled:g.bool};const jd=t=>t.children.filter(r=>r.meta.interfaces.find(n=>n.type===ye.BLOCKLET_INTERFACE_TYPE_WEB));function Qn({params:t={},setParams:r=()=>{},setError:n=()=>{},serviceTypes:i=[{name:"Redirect",value:G.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:G.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:G.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:G.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:G.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:a}=ae(),{blocklet:s}=Ie(),m=s.meta.did,c=jd(s),[d,l]=S.useState([]),y={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return S.useEffect(()=>{if(t.type===G.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const p=c.find(x=>x.meta.did===t.componentId),v=ne.findWebInterface(p.meta),f=(Array.isArray(v?.pageGroups)?v.pageGroups:[]).map(x=>({value:x,label:`${x} pages`}));f.length&&f.unshift({value:"",label:"All pages"}),l(f),t.pageGroup&&f.find(x=>x.value===t.pageGroup)===!1&&r({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(xe,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:p=>{n(""),r({...t,type:p.target.value,did:p.target.value===G.ROUTING_RULE_TYPES.BLOCKLET?m:"",__disableConfirm:!1})},style:{marginBottom:32},slotProps:{select:{}},children:i.map(({name:p,value:v})=>e.jsx(Ne,{value:v,children:p},v))}),t.type===G.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(xe,{select:!0,label:a("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:p=>r({...t,redirectCode:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:Object.keys(y).map(p=>e.jsx(Ne,{value:p,children:`${y[p]} - ${p}`},p))},"redirectCode"),e.jsx(xe,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:t.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{r({...t,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?n(""):n(a("router.validation.redirectUrlRequired"))},slotProps:{htmlInput:{"data-cy":"redirect-url-input"}}},"redirectUrl")],t.type===G.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(xe,{select:!0,label:a("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:p=>{r({...t,componentId:p.target.value})},style:{marginBottom:32},slotProps:{select:{}},children:c.map(p=>e.jsx(Ne,{value:p.meta.did,selected:p.meta.did===t.componentId,children:ne.getDisplayName(p,!0)},p.meta.did))},"componentId"),d.length?e.jsx(xe,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{r({...t,pageGroup:p.target.value})},slotProps:{select:{}},children:d.map(p=>e.jsx(Ne,{value:p.value,selected:p.value===t.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),t.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(xe,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const v=p.target.value.trim();r({...t,url:p.target.value,__disableConfirm:!v}),n(v?"":a("router.validation.rewriteUrlRequired"))}},"url"),t.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(xe,{select:!0,label:a("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:p=>r({...t,responseType:p.target.value}),style:{marginBottom:32},slotProps:{select:{}},children:G.ROUTING_RESPONSE_TYPES.map(p=>e.jsx(Ne,{value:p.value,children:p.text},p.value))},"responseType"),e.jsx(xe,{label:a("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:a("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const v=p.target.value.trim();r({...t,responseBody:p.target.value,__disableConfirm:!v}),n(v?"":a("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Qn.propTypes={params:g.object,serviceTypes:g.array,setParams:g.func,setError:g.func};function rs({children:t=null,hiddenChildren:r=!1,open:n=!1,onClose:i=null}){const{t:a}=ae(),{api:s}=ge(),{blocklet:m}=Ie(),[c,d]=S.useState(!1),[l,y]=S.useState(!1),p=m.meta.did,v=m.site.id,f=()=>{i?.(),d(!1),y(!1)},x=async u=>{try{const o=await Kt(u,a);if(o)throw o;d(!0);const h={from:{pathPrefix:Le(u.pathPrefix)},to:{type:u.type}};u.type===G.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url.trim(),h.to.redirectCode=u.redirectCode),u.type===G.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le(u.url)),u.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(h.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await s.addRoutingRule({input:{id:v,rule:h,teamDid:p}}),i?.()}catch(o){Y.error(o.message)}finally{d(!1),y(!1)}},w={title:a("router.rule.add.title"),description:(u,o,h)=>{const C=E=>{if(h(null),Kt(E,a)){o({...E,__disableConfirm:!0});return}o({...E})};return e.jsxs(ie,{component:"div",children:[e.jsx(xe,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.pathPrefixHint||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:E=>{let _=!1;const z=wo({params:{...u,pathPrefix:E.target.value},blocklets:[m]});h(z),u.type===G.ROUTING_RULE_TYPES.BLOCKLET&&z&&(_=!0),u.type===G.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(_=!0),u.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(_=!0),u.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(_=!0),E.target.value.trim()||(_=!0,h(a("router.validation.pathPrefixRequired"))),_||h("");const F=a("common.slugifyHint",{value:Fn(E.target.value)});o({...u,pathPrefix:E.target.value,pathPrefixHint:F,__disableConfirm:_})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),e.jsx(Qn,{params:u,setParams:C,setError:h})]})},confirm:a("router.rule.add.confirm"),cancel:a("common.cancel"),params:{did:"",pathPrefix:"",type:G.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:x,onCancel:f},b=u=>{u.stopPropagation(),y(!0)};let k=null;return r||(k=typeof t=="function"?t({open:b}):e.jsxs(Ne,{onClick:b,className:"rule-action","data-cy":"action-add-rule",children:[c?e.jsx(ve,{size:16}):e.jsx(Jt,{style:{fontSize:18,marginRight:5}}),a("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[k,(n||l)&&e.jsx(it,{title:w.title,description:w.description,confirm:w.confirm,cancel:w.cancel,params:w.params,onConfirm:w.onConfirm,onCancel:w.onCancel,color:"primary"})]})}rs.propTypes={children:g.any,onClose:g.func,hiddenChildren:g.bool,open:g.bool};function nn({depth:t=1,className:r=""}){return e.jsx(O,{className:r,sx:{ml:Math.max((t-1)*2,0),borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}nn.propTypes={depth:g.number,className:g.string};function os({id:t,from:r,children:n=null}){const{t:i}=ae(),{api:a}=ge(),{blocklet:s}=Ie(),[m,c]=S.useState(!1),[d,l]=S.useState(null),y=s.meta.did,p=s.site.id,v=r.pathPrefix,f=()=>{c(!1),l(null)},x=async()=>{c(!0);try{await a.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:y}})}catch(k){Y.error(k.message)}finally{l(null),c(!1)}},w={keyName:v,title:i("router.rule.delete.title"),description:i("router.rule.delete.description",{name:`<b>${v}</b>`}),confirmPlaceholder:i("router.rule.delete.confirm_desc",{name:v}),confirm:i("common.delConfirm"),cancel:i("router.rule.delete.cancel"),onConfirm:x,onCancel:f},b=k=>{k.stopPropagation(),l(w)};return e.jsxs(e.Fragment,{children:[typeof n=="function"?n({loading:m,open:b}):e.jsxs(Ne,{onClick:b,className:"rule-action","data-cy":"action-delete-rule",children:[m?e.jsx(ve,{size:16}):e.jsx(en,{style:{fontSize:18,marginRight:5}}),i("router.rule.delete.title")]}),d&&e.jsx(wa,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}os.propTypes={id:g.string.isRequired,from:g.object.isRequired,children:g.any};function ss({id:t,from:r,to:n,children:i=null}){const{t:a}=ae(),{api:s}=ge(),{blocklet:m}=Ie(),[c,d]=S.useState(!1),[l,y]=S.useState(null),p=m.meta.did,v=m.site.id,f=r.pathPrefix,x=()=>{d(!1),y(null)},w=async u=>{try{const o=await Kt(u,a);if(o)throw o;d(!0);const h={id:t,from:{pathPrefix:Le(u.pathPrefix)},to:{type:u.type}};u.type===G.ROUTING_RULE_TYPES.REDIRECT&&(h.to.url=u.url,h.to.redirectCode=u.redirectCode),u.type===G.ROUTING_RULE_TYPES.COMPONENT&&(h.to.did=p,h.to.componentId=u.componentId,h.to.pageGroup=u.pageGroup),u.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(h.to.url=Le(u.url)),u.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(h.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await s.updateRoutingRule({input:{id:v,rule:h,teamDid:p}})}catch(o){Y.error(o.message)}finally{d(!1),y(null)}},b={title:a("router.rule.update.title"),description:(u,o,h)=>{const C=E=>{if(Kt(E,a)){o({...E,__disableConfirm:!0});return}o({...E})};return e.jsxs(ie,{component:"div",children:[e.jsx(xe,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:u.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:E=>{let _=!1;u.type===G.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(_=!0),u.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(_=!0),u.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(_=!0),E.target.value.trim()||(_=!0,h(a("router.validation.pathPrefixRequired"))),_||h("");const z=a("common.slugifyHint",{value:Fn(E.target.value)});o({...u,pathPrefix:E.target.value,helperText:z,__disableConfirm:_})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),e.jsx(Qn,{params:u,setParams:C,setError:h})]})},confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:n.did||"",pathPrefix:f==="/"?f:f.replace(/^\/+/,"").replace(/\/+$/,""),type:n.type||G.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:n.redirectCode||302,componentId:n.componentId||"",pageGroup:n.pageGroup||"",url:n.url||"",responseType:n.response?.contentType||"",responseBody:(n.response?.body||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:w,onCancel:x},k=u=>{u.stopPropagation(),y(b)};return e.jsxs(e.Fragment,{children:[typeof i=="function"?i({loading:c,open:k}):e.jsxs(Ne,{onClick:k,className:"rule-action","data-cy":"action-update-rule",children:[c?e.jsx(ve,{size:16}):e.jsx(go,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),l&&e.jsx(it,{title:l.title,description:l.description,confirm:l.confirm,color:l.color,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}ss.propTypes={id:g.string.isRequired,from:g.object.isRequired,to:g.object.isRequired,children:g.any};function is({from:t,isProtected:r=!1,...n}){const{locale:i}=ae(),{blocklet:a,recommendedDomain:s}=Ie(),m=fo(s,t.pathPrefix,$n(a,i));return e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(O,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:m,rel:"noopener noreferrer",title:m,children:e.jsx(fe,{size:"small",children:e.jsx(Eo,{})})}),e.jsx(ss,{...n,isProtected:r,from:t,children:({open:c})=>e.jsx(fe,{size:"small",onClick:c,disabled:r,"data-cy":"action-update-rule",children:e.jsx(Ni,{})})}),e.jsx(os,{...n,isProtected:r,from:t,children:({open:c})=>e.jsx(fe,{size:"small",onClick:c,disabled:r,"data-cy":"action-delete-rule",children:e.jsx(en,{})})})]})}is.propTypes={isProtected:g.bool};function as({group:t,...r}){return t?e.jsx(ht,{type:"reverse",...r,children:t}):null}as.propTypes={group:g.string.isRequired};function Ln({domain:t,isHttps:r=!1,toUrl:n}){const i=r?"https":"http";let a=n;return mi(a)||(a=`${i}://${t}${n}`),e.jsx(xt,{href:a,target:"_blank",style:{fontSize:14},underline:"hover",children:n},a)}Ln.propTypes={domain:g.string.isRequired,toUrl:g.string.isRequired,isHttps:g.bool};function Jn({hasPermission:t=!1}){const{t:r,locale:n}=ae(),i=gt(),{blocklet:a,recommendedDomain:s}=Ie();return a.site.rules.filter(c=>c.to.type!==G.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let d=null,l=null;c.to.type===G.ROUTING_RULE_TYPES.NONE?d="404":c.to.type===G.ROUTING_RULE_TYPES.REDIRECT?d=c.to.redirectCode:c.to.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE?d="R":c.to.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE?d=e.jsx(Ta,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===G.ROUTING_RULE_TYPES.COMPONENT&&(l=a.children.find(p=>p.meta.did===c.to.componentId),d="C");const y=c.isProtected?e.jsx(Ce,{title:r("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx(fe,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(ma,{style:{fill:i.palette.text.disabled}})})})}):e.jsx(is,{...c});return[e.jsxs(O,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(O,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[e.jsx(O,{className:"component-item__indent",sx:{width:28}}),typeof d=="object"?d:e.jsx(pi,{children:d}),e.jsxs(O,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(O,{style:{color:"text.primary",fontSize:16},children:[c.to.type===G.ROUTING_RULE_TYPES.NONE&&r("common.page404"),c.to.type===G.ROUTING_RULE_TYPES.REDIRECT&&r("common.redirect"),c.to.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&r("common.rewrite"),c.to.type===G.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&G.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===G.ROUTING_RULE_TYPES.COMPONENT&&ne.getDisplayName(l,!0)]}),e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===G.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(Ln,{domain:s,toUrl:c.to.url}),c.to.type===G.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(Ln,{domain:s,toUrl:c.to.url}),c.to.type===G.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(as,{group:c.to.pageGroup})]})]})]}),e.jsx(O,{sx:{px:2,alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:e.jsx(xt,{href:fo(s,c.from.pathPrefix,$n(a,n)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:fi(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),e.jsx(O,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:y})},"actions")]},"rule"),e.jsx(nn,{},"divider")]})}Jn.propTypes={hasPermission:g.bool};const wd=Qt(Jn,"mutate_blocklets"),_d=Qt(Jn,"",ft);function Sd(t){const{inService:r}=ge();return r?e.jsx(_d,{...t}):e.jsx(wd,{...t})}function Ed(t,r){const n=S.useRef(r);S.useEffect(()=>{const i=a=>n.current(a.detail);return window.addEventListener(t,i),()=>window.removeEventListener(t,i)},[t])}function kd(t){const r=mo(),{t:n}=ae(),i=()=>{const a=new URLSearchParams(window.location.search);a.get("checkUpdate")&&(a.delete("checkUpdate"),r(a.toString()),t(),Y.success(n("notification.checkingForUpdates")))};S.useEffect(i,[]),Ed("checkUpdate",i)}function Rd({blocklet:t,scrollToComponent:r}={blocklet:null,scrollToComponent:!1}){const n=mo(),{t:i}=ae(),a=S.useRef(null),s=S.useMemo(()=>{if(!t||!t.optionalComponents)return null;const m=new URLSearchParams(window.location.search),c=m.get("install-component");if(c){a.current=c,m.delete("install-component"),n(m.toString());const d=t.optionalComponents.find(y=>y.meta.did===c);if(!d)return Y.success(i("notification.installComponentError",{did:c})),null;const{meta:l}=d;if(r){const y=document.getElementById(`optional-component-${c}`),p=document.querySelector(".dashboard-main");if(y){const v=y.getBoundingClientRect(),f=p.getBoundingClientRect();p.scrollTo({top:v.top-f.top+p.scrollTop,behavior:"smooth"})}}return l}return null},[t,n,i,r]);return S.useEffect(()=>{a.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},window.blocklet?.appUrl)},[t]),s}function Xn({open:t=!1,onClose:r=null,blocklet:n,ancestors:i=[]}){const{t:a}=ae(),s=[...(i||[]).map(l=>l?.meta?.did||""),n?.meta?.did||""].filter(Boolean).join("/"),m=a("preferencesFor",{name:ne.getDisplayName(n,!0)}),c=S.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(st(n.status)||n.status==="unknown"&&st(n.status))return null;const d=()=>{r?.()};return e.jsx(Td,{open:t,fullWidth:!0,maxWidth:"md",title:m,onClose:d,PaperProps:{style:{minHeight:"500px"}},children:e.jsxs(oo,{sx:{gap:1},children:[e.jsx(ie,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:a("description.preferences",{name:ne.getDisplayName(n,!0)})}),e.jsx(Li,{id:s,styles:c})]})})}Xn.propTypes={blocklet:g.object.isRequired,ancestors:g.array,open:g.bool,onClose:g.func};const Td=re(Yt)`
|
|
443
|
+
.MuiDialogContent-root {
|
|
444
|
+
padding-top: 0;
|
|
445
|
+
padding-bottom: 24px;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.MuiToolbar-root {
|
|
449
|
+
padding-right: 0;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.ux-dialog_closeButton {
|
|
453
|
+
margin: 0;
|
|
454
|
+
}
|
|
455
|
+
`;function ls({component:t,remove:r=async()=>{},disabled:n=!1,tip:i="",showConfirm:a=!1,hideBtn:s=!1,onCancel:m=()=>{}}){const{t:c}=S.useContext(be),[d,l]=S.useState(!1),[y,p]=S.useState(null),v=async k=>{l(!0),await r(k.component,k.removeType),l(!1),p(null)},f=n||d,x=()=>{p({title:`${c("common.delete")} ${t.meta.title||t.meta.name}`,description:(k,u)=>e.jsxs(ie,{component:"div",children:[e.jsx(ie,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),e.jsxs(ja,{name:"removeType",value:k.removeType,onChange:o=>u({...k,removeType:o.target.value}),children:[e.jsx(Bn,{value:"keepData",control:e.jsx(xr,{}),label:c("blocklet.action.removeComponentKeepData")}),e.jsx(Bn,{value:"complete",control:e.jsx(xr,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:v,onCancel:()=>{p(null),m()}})};S.useEffect(()=>{a?x():(l(!1),p(null))},[a]);const w=e.jsx(Pd,{size:"small",disabled:f,onClick:()=>x,"data-cy":"delete-component-btn",children:e.jsx(en,{disabled:f})}),b=e.jsx(Ce,{title:i||c("common.delete"),children:e.jsx("span",{children:w})});return e.jsxs(e.Fragment,{children:[!s&&b,y&&e.jsx(it,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}ls.propTypes={component:g.object.isRequired,remove:g.func,onCancel:g.func,disabled:g.bool,showConfirm:g.bool,hideBtn:g.bool,tip:g.string};const Pd=re(fe)`
|
|
456
|
+
&.Mui-disabled {
|
|
457
|
+
opacity: 0.5;
|
|
458
|
+
}
|
|
459
|
+
`;function cs({component:t,onStart:r=async()=>{},onStop:n=async()=>{},disabled:i=!1,tip:a=""}){const{t:s}=S.useContext(be),[m,c]=S.useState(!1),[d,l]=S.useState(),y=async()=>{c(!0);try{await r(t)}catch(b){Y.error(b.message)}c(!1)},p=async()=>{c(!0);try{await n(t)}catch(b){Y.error(b.message)}c(!1)},v=i||m,f=["starting","running","stopping"].includes(t.status),x=f?Ei:ki,w=e.jsx(Id,{disabled:v,size:"small",onClick:()=>{f?l({title:`${s("common.stop")} ${t?.meta?.title}`,description:s("blocklet.action.stopComponentDescription"),confirm:s("blocklet.action.confirmStop"),cancel:s("common.cancel"),onConfirm:()=>(l(null),p()),onCancel:()=>l(null)}):y()},"data-cy":`${f?"stop":"start"}-component-btn`,children:e.jsx(x,{disabled:v,fontSize:"small"})});return[e.jsx(Ce,{title:a||s(`common.${f?"stop":"start"}`),children:e.jsx("span",{children:w})},"btn"),d&&e.jsx(it,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel},"connect")]}cs.propTypes={component:g.object.isRequired,onStart:g.func,onStop:g.func,disabled:g.bool,tip:g.string};const Id=re(fe)`
|
|
460
|
+
&.Mui-disabled {
|
|
461
|
+
opacity: 0.5;
|
|
462
|
+
}
|
|
463
|
+
`;function ds({sourceInfo:t={},blocklet:r={}}){const{t:n}=S.useContext(be);let{source:i}=t;return i==="registry"&&(i="Blocklet Store"),e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(hi,{type:"success",children:_a(i)},"source"),t.source==="registry"&&e.jsx(xt,{href:Se(t.deployedFrom,"blocklets",r?.meta?.bundleDid||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:n("blocklet.overview.viewInStore")})]})}ds.propTypes={sourceInfo:g.shape({source:g.string,deployedFrom:g.string}),blocklet:g.object};function er({blocklet:t,checkUpgrade:r=!1,hasPermission:n=!1,...i}){const{api:a}=ge(),{t:s}=S.useContext(be),[m,c]=S.useState(!1),[d,l]=S.useState(""),[y,p]=S.useState(null),[v,f]=S.useState(null);S.useEffect(()=>{p(null),r&&(t.mode,ye.BLOCKLET_MODES.DEVELOPMENT)},[t,r]);const x=()=>{c(!1),f(null)},w=async()=>{c(!0);try{const k={did:t.meta.did,version:y.version,storeUrl:y.registryUrl||""};await ut(2e3),await a.upgradeBlocklet({input:k})}catch(k){Y.error(`Blocklet upgrade failed: ${he(k)}`)}finally{c(!1),f(null)}},b={title:`${s("common.upgrade")} ${s("common.blocklet")} ${ne.getDisplayName(t)}`,description:s("blocklet.action.upgradeDescription"),confirm:s("blocklet.action.confirmUpgrade"),cancel:s("common.cancel"),onConfirm:w,onCancel:x};return n&&y&&!ne.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(ht,{...i,children:t.meta.version}),e.jsx(Ce,{title:s("common.updateAvailable",{version:y.version}),children:e.jsx(fe,{size:"small",style:{marginLeft:8},disabled:m,onClick:()=>f(b),children:m?e.jsx(ve,{size:16}):e.jsx(ka,{style:{fontSize:16,color:"red"}})})}),!!d&&e.jsx(Y,{variant:"error",message:d,onClose:()=>l("")}),v&&e.jsx(it,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):e.jsx(ht,{...i,children:t.meta.version})}er.propTypes={blocklet:g.object.isRequired,checkUpgrade:g.bool,hasPermission:g.bool};const Dd=Qt(er,"mutate_blocklets"),Bd=Qt(er,"",ft);function Ud(t){const{inService:r}=ge();return r?e.jsx(Bd,{...t}):e.jsx(Dd,{...t})}const Od=t=>!t?.meta?.group,Nd=(t,r)=>t?[{name:r("common.name"),value:t.displayName},{name:r("common.description"),value:t.description},{name:r("common.version"),value:e.jsx(ht,{children:t.version})}]:[],Ld=t=>{const{source:r,deployedFrom:n,bundleSource:i}=t;if(r)return{source:r,deployedFrom:n};if(!i)return{source:"upload",deployedFrom:n};if(i.url){const a=n||Array.isArray(i.url)?i.url[0]:i.url;return{source:"url",deployedFrom:a,link:a}}if(i.store){const a=n||Array.isArray(i.store)?i.store[0]:i.store;return{source:"registry",deployedFrom:a,link:a}}return{}},Ad=(t,r)=>{const n=t.split("/").slice(1);let i=r,a=0;const s=[];for(;i&&a<n.length;){const m=i.children.find(c=>c.meta.did===n[a]);i=m,a++,m&&s.push(m.meta.title)}return s.join(" / ")};function us({blocklet:t,depth:r=0,componentInfo:n=null,app:i=null,onClose:a}){const{t:s,locale:m}=S.useContext(be),{deletingBlocklets:c}=Wn();let{status:d}=t;r===1&&c.includes(t.meta.did)&&(d="deleting");const l=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),y=f=>f.map(x=>x.name===s("common.did")||x.name===s("blocklet.appId")?e.jsx(pn,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):e.jsx(pn,{valueComponent:"div",nameWidth:120,name:x.name,children:x.link?e.jsx(xt,{href:x.link,target:"_blank",className:"page-link",underline:"hover",children:x.value}):x.value},x.name)),p=n?Ld(n):{},v=n?[{name:s("common.name"),value:ne.getDisplayName(n,!0)},{name:s("common.version"),value:e.jsx(Ud,{blocklet:n,checkUpgrade:!1})},{name:s("common.status"),value:e.jsx(ko,{isResource:Od(t),status:d,source:n.source,progress:t.progress})},t.status==="running"?{name:s("blocklet.startedAt"),value:t.startedAt?e.jsx(dn,{value:t.startedAt,type:"all",locale:m}):"-"}:null,t.status!=="running"?{name:s("blocklet.stoppedAt"),value:t.stoppedAt?e.jsx(dn,{value:t.stoppedAt,type:"all",locale:m}):"-"}:null,t.installedAt?{name:s("blocklet.installedAt"),value:t.installedAt?e.jsx(dn,{value:t.installedAt,type:"all",locale:m}):"-"}:null,ne.hasStartEngine(t.meta)?{name:s("common.mountPoint"),value:l}:null,n.meta.group?{name:s("common.group"),value:e.jsx(ht,{type:"success",children:n.meta.group})}:null,{name:s("blocklet.overview.source"),value:e.jsx(ds,{sourceInfo:p,blocklet:t})},{name:s("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-",link:p.link??""},{name:s("common.did"),value:e.jsx(gi,{did:n.meta.did,showQrcode:!0})},{name:s("common.author"),value:n.meta.owner?e.jsx(ga,{owner:n.meta.owner,locale:m}):ha.formatPerson(n.meta.author)},{name:s("common.engine"),value:Nd(n.engine,s).map(({name:f,value:x})=>e.jsx(pn,{style:{marginBottom:4},nameWidth:120,name:f,children:x},f))},t.dependents?.length?{name:s("common.dependents"),value:e.jsx(O,{children:t.dependents.map(f=>e.jsx(O,{children:`${Ad(f.id,i)} ${f.required?`(${s("common.required")})`:""}`},f.id))})}:null,t.meta.resources?.length?{name:s("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return n?e.jsx(Yt,{open:!0,title:s("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{a(null)},children:e.jsx(O,{sx:{paddingBottom:1.5},children:y(v)},"dialog-wrapper")},"base-info-dialog"):null}us.propTypes={blocklet:g.object.isRequired,depth:g.number,app:g.object,componentInfo:g.object,onClose:g.func.isRequired};re(ho)`
|
|
464
|
+
.BaseBadge-badge {
|
|
465
|
+
top: ${t=>t.top*8||6}px;
|
|
466
|
+
right: ${t=>t.right*8||6}px;
|
|
467
|
+
}
|
|
468
|
+
`;re(O)`
|
|
469
|
+
.component-header {
|
|
470
|
+
display: flex;
|
|
471
|
+
align-items: center;
|
|
472
|
+
align-items: flex-end;
|
|
473
|
+
cursor: pointer;
|
|
474
|
+
}
|
|
475
|
+
.component-name {
|
|
476
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
477
|
+
font-size: 16px;
|
|
478
|
+
}
|
|
479
|
+
.component-version {
|
|
480
|
+
color: ${({theme:t})=>t.palette.grey[400]};
|
|
481
|
+
font-size: 12px;
|
|
482
|
+
margin-left: 4px;
|
|
483
|
+
transform: translateY(-1px);
|
|
484
|
+
}
|
|
485
|
+
`;function ps({blocklet:t,ancestors:r,mountPoint:n,href:i}){const[a,s]=S.useState(!1),[m,c]=S.useState(!1),[d,l]=S.useState(!1),[y,p]=S.useState(n),{api:v}=ge(),f=!r.length,x=f?t.meta.did:r.map(_=>_.meta.did)[0],{t:w}=ae(),{confirmApi:b,confirmHolder:k}=uo();S.useEffect(()=>{c(!1),s(!1),l(!1)},[n]);const u=()=>{s(!1),c(!1),p(n)},o=async()=>{l(!0),s(!1);try{const _={rootDid:x,mountPoint:Le(y)};f||(_.did=t.meta.did),await v.updateComponentMountPoint({input:_})}catch(_){throw _.message=he(_),Y.error(_.message),_}finally{u()}},h=Ke(()=>{b.open({title:w("common.noticeTitle"),content:e.jsxs(O,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[e.jsx(ie,{sx:{mb:1.5},children:w("blocklet.mountPoint.description1")}),e.jsx(ie,{component:"li",children:w("blocklet.mountPoint.case1")}),e.jsx(ie,{component:"li",children:w("blocklet.mountPoint.case2")}),e.jsx(ie,{sx:{mt:1.5},children:w("blocklet.mountPoint.description2")})]}),confirmButtonText:w("common.confirm"),cancelButtonText:w("common.cancel"),async onConfirm(_){await o(),_()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),C=_=>{_?.preventDefault(),Le(y)!==n?h():c(!1)},E=m?e.jsxs(O,{sx:{ml:1},children:[e.jsx(fe,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"data-cy":"edit-mount-point-submit",onClick:C,children:e.jsx(O,{component:ue,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx(fe,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:u,children:e.jsx(O,{component:ue,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx(fe,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:()=>c(!0),children:e.jsx(O,{component:ue,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:a?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(O,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[k,m?e.jsx("form",{onSubmit:C,children:e.jsx(xe,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:y,onChange:_=>p(_.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:n})}):e.jsx(O,{component:"a",target:"_blank",href:i,rel:"noopener noreferrer",title:i,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:e.jsx(O,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:xi(n)})}),d?e.jsx(ve,{size:20,sx:{ml:1}}):E]},n)}ps.propTypes={mountPoint:g.string.isRequired,href:g.string.isRequired,blocklet:g.object.isRequired,ancestors:g.array.isRequired};const zd=t=>!t?.meta?.group,ro=(t,r)=>{const n=t.split("/").slice(1);let i=r,a=0;const s=[];for(;i&&a<n.length;){const m=i.children.find(c=>c.meta.did===n[a]);i=m,a++,m&&s.push(m.meta.title)}return s.join(" / ")};function An({blocklet:t,ancestors:r=[],depth:n=0,onRemove:i=()=>{},onStart:a=()=>{},onStop:s=()=>{},onRestart:m=()=>{},getComponentUrl:c=()=>window.location.origin,app:d=null}){const{t:l}=S.useContext(be),[y,p]=S.useState(),[v,f]=S.useState(!1),[x,w]=S.useState(!1),[b,k]=S.useState(null),{info:u}=ge(),[o,h]=S.useState(!1),[C,E]=S.useState(!1),{deletingBlocklets:_}=Wn();let{status:z}=t;n===1&&_.includes(t.meta.did)&&(z="deleting");const F=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),R=c(F),U=ne.isInProgress(d.status),B=ne.isInProgress(t.status);let N="";if(U||B||n===1&&_.includes(t.meta.did))N=l("blocklet.component.tip.stopBlocklet");else if(t.dependents?.length){const V=t.dependents.filter(M=>M.required);if(V.length){const M=V.map(T=>ro(T.id,d));N=l("blocklet.component.tip.requiredBy",{name:M.join(", ")})}}const $=async(...V)=>{w(!0);try{await i(...V)}catch{}w(!1),f(!1)},{usingDocker:H,usingIsolation:K}=S.useMemo(()=>{if(!t.meta.group||t.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const V=!!u?.enableDocker||window.blocklet?.enableDocker,M=[...d.configs,...t.configs].find(I=>I.key==="SKIP_DOCKER"&&I.value),T=[...d.configs,...t.configs].find(I=>I.key==="USE_DOCKER"&&I.value),q=[...d.configs,...t.configs].find(I=>I.key==="SKIP_DOCKER_NETWORK"&&I.value);return{usingDocker:V?!M:!!T,usingIsolation:V&&!q&&(u?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[t.configs,u?.enableDocker,u?.enableDockerNetwork,d.configs,t.meta.group]);return e.jsxs(e.Fragment,{children:[e.jsxs(tr,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(O,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(yi,{blocklet:t,ancestors:r}),e.jsxs(O,{sx:{ml:"16px",minWidth:0},children:[e.jsxs(O,{className:"component-header",onClick:()=>p(t),children:[e.jsx(O,{className:"component-name",children:ne.getDisplayName(t,!0)}),e.jsx(O,{className:"component-version",children:t?.meta?.version})]}),e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:.5},children:[z!=="unknown"&&e.jsx(ko,{style:{whiteSpace:"nowrap"},status:z,source:t.source,progress:t.progress}),e.jsx(xa,{style:{whiteSpace:"nowrap"},mode:t.mode||""}),t.mode!=="development"&&H&&e.jsx(Ce,{title:l("blocklet.usingDocker"),children:e.jsx(O,{sx:{display:"flex",color:"primary.main",ml:1},children:e.jsx(ue,{icon:vo})})}),t.mode!=="development"&&K&&e.jsx(Ce,{title:l("blocklet.usingIsolation"),children:e.jsx(O,{sx:{display:"flex",color:"primary.main",ml:1},children:e.jsx(ue,{icon:"streamline:network"})})}),!!t.dependents?.length&&e.jsx(Ce,{title:[`${l("common.dependents")}: `,t.dependents.map(V=>e.jsx(O,{sx:{pl:1},children:`${ro(V.id,d)} ${V.required?`(${l("common.required")})`:""}`},V.id))],children:e.jsx(O,{sx:{display:"flex",color:"primary.main",ml:1},children:e.jsx(ue,{icon:"octicon:package-dependents-16"})})})]})]})]},t),Co.hasMountPoint(t.meta)&&e.jsx(ps,{blocklet:t,ancestors:r,mountPoint:F,href:R},F),e.jsx("div",{style:{flex:1}}),e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[ne.hasStartEngine(t.meta)&&e.jsx(Ce,{title:l("common.visit"),children:e.jsx(O,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:R,rel:"noopener noreferrer",children:e.jsx(fe,{size:"small",children:e.jsx(Eo,{fontSize:"small"})})})}),e.jsx(cs,{blocklet:d,component:t,onStart:a,onStop:s,disabled:!["starting","stopping"].includes(d.status)&&ne.isInProgress(d.status)}),e.jsx(fe,{size:"small",onClick:()=>E(!0),disabled:U||B,children:e.jsx(Po,{fontSize:"small"})}),e.jsx(zn,{color:"error",badgeContent:"",variant:"dot",invisible:!ne.getComponentMissingConfigs(t,r[0]).length,children:e.jsx(Ro,{"data-cy":"component-actions",actions:[ne.hasStartEngine(t.meta)||zd(t)?{icon:e.jsx(vi,{}),text:l("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(Ri,{}),text:l("common.restart"),onClick:()=>{k({title:`${l("common.restart")} ${t.meta.title}`,description:l("blocklet.action.restartDescription"),confirm:l("blocklet.action.confirmRestart"),cancel:l("common.cancel"),onConfirm:async()=>{w(!0),await m(t),w(!1),k(null)},onCancel:()=>k(null)})},disabled:x||U||B||t.status!=="running"},{icon:e.jsx(en,{}),text:l("common.delete"),onClick:()=>{f(!0)},disabled:U||B||!!N,tip:N},{separator:!0},{icon:e.jsx(ue,{icon:"mdi:variable"}),onClick:()=>{h(!0)},text:e.jsx(zn,{color:"error",badgeContent:"",variant:"dot",invisible:!ne.getComponentMissingConfigs(t,r[0]).length,children:e.jsx(O,{sx:{width:"100%"},children:l("common.environments")})}),disabled:U||B}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(nn,{},"line"),e.jsx(us,{componentInfo:y,onClose:p,blocklet:t,app:d,depth:n}),e.jsx(ls,{blocklet:d,component:t,remove:$,onCancel:()=>f(!1),hideBtn:!0,showConfirm:v},"delete-component"),b&&e.jsx(it,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel},"confirm-setting"),o&&e.jsx(Gn,{open:!0,hiddenChildren:!0,onClose:()=>h(!1),blocklet:t,ancestors:r}),C&&e.jsx(Xn,{open:!0,onClose:()=>E(!1),blocklet:t,ancestors:r})]})}An.propTypes={blocklet:g.object.isRequired,ancestors:g.array,depth:g.number,onRemove:g.func,onStart:g.func,onStop:g.func,onRestart:g.func,getComponentUrl:g.func,app:g.object};const zn=re(ho)`
|
|
486
|
+
.BaseBadge-badge {
|
|
487
|
+
top: ${t=>t.top*8||6}px;
|
|
488
|
+
right: ${t=>t.right*8||6}px;
|
|
489
|
+
}
|
|
490
|
+
`,tr=re(O)`
|
|
491
|
+
&:hover {
|
|
492
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
493
|
+
}
|
|
494
|
+
.component-header {
|
|
495
|
+
display: flex;
|
|
496
|
+
align-items: center;
|
|
497
|
+
align-items: flex-end;
|
|
498
|
+
cursor: pointer;
|
|
499
|
+
}
|
|
500
|
+
.component-name {
|
|
501
|
+
min-width: 0;
|
|
502
|
+
overflow: hidden;
|
|
503
|
+
text-overflow: ellipsis;
|
|
504
|
+
white-space: nowrap;
|
|
505
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
506
|
+
font-size: 16px;
|
|
507
|
+
}
|
|
508
|
+
.component-version {
|
|
509
|
+
color: ${({theme:t})=>t.palette.text.secondary};
|
|
510
|
+
font-size: 12px;
|
|
511
|
+
margin-left: 4px;
|
|
512
|
+
transform: translateY(-1px);
|
|
513
|
+
}
|
|
514
|
+
`;function fs({meta:t,dependencies:r=[],logoUrl:n="",setInstallComponentMeta:i}){const a=ge(),{t:s}=ae(),m=()=>{i(t)},c=40;return e.jsxs(Md,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:n,onError:()=>`${a.imgPrefix}/blocklet.png`,alt:t.title,style:{width:c,height:c}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(Ce,{title:[`${s("common.dependents")}: `,r.map(d=>e.jsx(O,{sx:{pl:1},children:`${d.parentTitle} ${d.required?`(${s("common.required")})`:""}`},d.parentName+d.mount_point))],children:e.jsx(O,{sx:{display:"flex",color:"primary.main",ml:1},children:e.jsx(ue,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(O,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:e.jsx(Zt,{onClick:m,startIcon:e.jsx(ue,{icon:"ph:download-simple-bold"}),children:s("common.install")})})]}),e.jsx(nn,{class:"line"},"line")]})}fs.propTypes={meta:g.object.isRequired,logoUrl:g.string,setInstallComponentMeta:g.func.isRequired,dependencies:g.arrayOf(g.shape({parentDid:g.string,parentName:g.string,parentPoint:g.string,required:g.bool}))};const Md=re(tr)`
|
|
515
|
+
.line {
|
|
516
|
+
opacity: 0.5;
|
|
517
|
+
}
|
|
518
|
+
.cell {
|
|
519
|
+
display: flex;
|
|
520
|
+
width: 100%;
|
|
521
|
+
flex-direction: row;
|
|
522
|
+
align-items: center;
|
|
523
|
+
justify-content: flex-start;
|
|
524
|
+
padding-top: 16px;
|
|
525
|
+
padding-bottom: 16px;
|
|
526
|
+
}
|
|
527
|
+
.component-left {
|
|
528
|
+
display: flex;
|
|
529
|
+
flex-direction: row;
|
|
530
|
+
justify-content: flex-start;
|
|
531
|
+
align-items: center;
|
|
532
|
+
min-width: 0;
|
|
533
|
+
}
|
|
534
|
+
.component-logo {
|
|
535
|
+
width: 40px;
|
|
536
|
+
margin-left: 16px;
|
|
537
|
+
opacity: 0.5;
|
|
538
|
+
border-radius: 10px;
|
|
539
|
+
overflow: hidden;
|
|
540
|
+
}
|
|
541
|
+
.component-header {
|
|
542
|
+
flex: 1;
|
|
543
|
+
min-width: 0;
|
|
544
|
+
opacity: 0.5;
|
|
545
|
+
margin-left: 12px;
|
|
546
|
+
display: flex;
|
|
547
|
+
align-items: center;
|
|
548
|
+
align-items: flex-end;
|
|
549
|
+
cursor: pointer;
|
|
550
|
+
}
|
|
551
|
+
.component-name {
|
|
552
|
+
flex: 1;
|
|
553
|
+
opacity: 0.5;
|
|
554
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
555
|
+
font-size: 16px;
|
|
556
|
+
}
|
|
557
|
+
.component-version {
|
|
558
|
+
opacity: 0.8;
|
|
559
|
+
color: ${({theme:t})=>t.palette.grey[400]};
|
|
560
|
+
font-size: 12px;
|
|
561
|
+
margin-left: 4px;
|
|
562
|
+
transform: translateY(-1px);
|
|
563
|
+
}
|
|
564
|
+
`;function ms({blocklet:t,onUpdate:r=()=>{},getComponentUrl:n=()=>window.location.origin,...i}){const{t:a}=S.useContext(be),{api:s,inService:m,info:c}=ge(),{addDeletingDid:d,removeDeletingDid:l,matchDeletingDid:y}=Wn(),[p,v]=S.useState(!1),[f,x]=S.useState(null),[w,b]=S.useState(null),[k,u]=S.useState(!1),[o,h]=S.useState(!1),[C,E]=S.useState(!1),[_,z]=S.useState(!1),[F,R]=S.useState(null),U=t&&t.structVersion!==G.APP_STRUCT_VERSION,[B,N]=S.useState(!1),$=[...t.children];t.meta.group!=="gateway"&&$.unshift(t),y($.map(L=>L.meta.did));const H=async()=>{if(!p){v(!0);try{const{updateId:L,updateList:X}=(await s.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(v(!1),!L){Y.info(a("blocklet.component.noUpdate"));return}const J=[];ne.forEachChildSync(t,(ce,{id:oe,ancestors:De})=>{const Ee=X.find(je=>je.id===oe);if(Ee){const je=De.slice(1).concat(ce).map(Ve=>Ve.meta.title||Ve.meta.name).join(" / "),le=(De[1]||ce).meta.did;J.push({groupId:le,name:je,version:ce.meta.version,newVersion:Ee.meta.version})}});const Z={};J.forEach(ce=>{Z[ce.groupId]?ce.disabled=!0:Z[ce.groupId]=!0}),x({params:{updateId:L},list:J,checks:Z,hasChecks:!0})}catch(L){v(!1),Y.error(he(L))}}},K=async()=>{if(!p)try{v(!0);const L=Object.keys(f.checks).filter(J=>f.checks[J]),X={updateId:f.params.updateId,rootDid:t.meta.did,selectedComponents:L};await s.upgradeComponents({input:X}),v(!1),x(null),N(null)}catch(L){v(!1),Y.error(he(L))}},V=async(L,X)=>{d(L.meta.did);try{await s.deleteComponent({input:{did:L.meta.did,keepData:X==="keepData",rootDid:t.meta.did}}),await ut(800)}catch(J){Y.error(he(J)),l(L.meta.did)}},M=async L=>{try{await s.startBlocklet({input:{did:t.meta.did,componentDids:[L.meta.did]}}),await ut(800)}catch(X){Y.error(he(X))}},T=async L=>{try{await s.stopBlocklet({input:{did:t.meta.did,componentDids:[L.meta.did]}}),await ut(800)}catch(X){Y.error(he(X))}},q=async L=>{try{await s.restartBlocklet({input:{did:t.meta.did,componentDids:[L.meta.did]}}),await ut(800)}catch(X){Y.error(he(X))}},I=(L,X)=>{const{checked:J}=L.target;x(Z=>{const ce=Object.entries(Z.checks).reduce((De,[Ee,je])=>(De[Ee]=X===Ee||X==="all"?J:je,De),{}),oe=Object.values(ce).includes(!0);return{...Z,checks:ce,hasChecks:oe}})},D=S.useMemo(()=>f?.list.filter(L=>!L.disabled).every(L=>f.checks[L.groupId]),[f]);kd(H);const j=Rd({blocklet:t,scrollToComponent:!0}),P=F||j;return e.jsxs(qd,{component:"div",...i,onUpdate:r,children:[e.jsxs(Fd,{display:"flex",children:[e.jsxs($d,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[$?.length?`${a("common.components")} (${$.length})`:`${a("common.components")}`,!U&&e.jsx(Un,{permission:m?"":"mutate_blocklets",role:m?ft:[],children:e.jsx(Io,{children:e.jsx(zn,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!B,children:e.jsxs(Be,{disabled:p||ne.isInProgress(t.status),onClick:()=>{H()},"data-cy":"check-for-updates",children:[e.jsx(O,{sx:{ml:.5,mr:.5,display:"flex"},children:p?e.jsx(ve,{size:16}):e.jsx(Pa,{style:{fontSize:"1em"}})}),a("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Un,{permission:m?"":"mutate_blocklets",role:m?ft:[],children:e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!U&&e.jsx(ns,{blocklet:t,serverVersion:c.version,disabled:p||ne.isInProgress(t.status)}),e.jsx(Ro,{"data-cy":"component-actions",actions:[{icon:e.jsx(ue,{icon:"fluent:link-20-filled"}),onClick:()=>h(!0),text:a("router.rule.add.title"),disabled:p||ne.isInProgress(t.status)},...U?[]:[{icon:e.jsx(ue,{icon:"mdi:variable"}),onClick:()=>{E(!0)},text:a("common.environments")},{icon:e.jsx(Po,{}),onClick:()=>{z(!0)},text:a("common.preferences")}]].filter(Boolean)})]})})]}),$?.length?e.jsxs(e.Fragment,{children:[e.jsxs(O,{sx:{mt:2},children:[t.meta.group!=="gateway"&&e.jsx(An,{blocklet:t,app:t,onRemove:V,onStart:M,onStop:T,onRestart:q,getComponentUrl:n},`0-${t.meta.did}`),t.children.map(L=>e.jsx(An,{depth:1,blocklet:L,ancestors:[t],app:t,onRemove:V,onStart:M,onStop:T,onRestart:q,getComponentUrl:n},`1-${L.meta.did}`))]},`top-blocklet-${t.meta.did}`),t.optionalComponents?.map(L=>e.jsx(tr,{children:e.jsx(fs,{setInstallComponentMeta:R,...L})},L.meta.did))]}):e.jsx(O,{sx:{mt:8},children:e.jsx(_i,{children:a("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(O,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(Sd,{})}),!!f&&e.jsx(dr,{open:!0,fullWidth:!0,children:e.jsxs(O,{sx:{paddingY:1.5},children:[e.jsx(ur,{children:a("blocklet.component.updateTitle")}),e.jsxs(O,{component:pr,sx:{py:4},children:[f.list.filter(L=>!L.disabled).length>1&&e.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(fr,{checked:D,onChange:L=>I(L,"all")}),e.jsx(O,{children:a(D?"common.unselectAll":"common.selectAll")})]}),f.list.map(L=>e.jsxs(O,{sx:{display:"flex",alignItems:"center",mb:1},children:[e.jsx(fr,{checked:f.checks[L.groupId],onChange:X=>I(X,L.groupId),style:{marginLeft:L.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:L.disabled}),e.jsxs(O,{sx:{flexGrow:1},children:[e.jsx(O,{xs:8,sx:{pt:1},children:L.name}),L.version&&e.jsxs(Me,{container:!0,spacing:2,sx:{fontSize:"h6.fontSize",alignItems:"center"},children:[e.jsx(Me,{size:3,children:L.version}),e.jsx(Me,{size:1,children:e.jsx(Ci,{style:{fontSize:"0.9em"}})}),e.jsx(Me,{size:3,children:e.jsx(O,{sx:{color:"secondary.main"},children:L.newVersion})})]})]},`${L.name}-${L.newVersion}`)]},L.name))]}),e.jsxs(bi,{style:{padding:"8px 24px 24px"},children:[e.jsx(Be,{onClick:()=>{x(null)},children:a("common.cancel")}),e.jsxs(Be,{onClick:L=>{L.stopPropagation(),K()},color:"primary",disabled:p||!f.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(ve,{size:16}),a("common.update")]})]})]})}),!!w&&e.jsx(dr,{open:!0,fullWidth:!0,onClose:()=>b(!1),children:e.jsxs(O,{sx:{paddingY:1.5},children:[e.jsx(ur,{children:a("common.configuration")}),e.jsx(pr,{children:e.jsx(O,{sx:{py:2},children:e.jsx(Bn,{control:e.jsx(Sa,{checked:k,onChange:L=>u(!!L.target.checked)}),label:a("blocklet.component.showContainer")})})})]})}),e.jsx(Zn,{selectedMeta:P,blocklet:t,showDialog:!!P,setShowDialog:()=>R(null)}),o&&e.jsx(rs,{hiddenChildren:!0,open:!0,onClose:()=>h(!1)}),C&&e.jsx(Gn,{open:!0,onClose:()=>E(!1),hiddenChildren:!0,blocklet:t,ancestors:[]}),_&&e.jsx(Xn,{open:!0,onClose:()=>z(!1),blocklet:t,ancestors:[]})]})}ms.propTypes={blocklet:g.object.isRequired,onUpdate:g.func,getComponentUrl:g.func};const qd=re.div`
|
|
565
|
+
.title {
|
|
566
|
+
font-size: 1.2rem;
|
|
567
|
+
font-weight: bold;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@keyframes showDelay {
|
|
571
|
+
0% {
|
|
572
|
+
opacity: 0;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
100% {
|
|
576
|
+
opacity: 1;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.component-item {
|
|
581
|
+
animation: showDelay 0.75s ease 1;
|
|
582
|
+
}
|
|
583
|
+
`,Fd=re(O)`
|
|
584
|
+
${t=>t.theme.breakpoints.up("sm")} {
|
|
585
|
+
flex-direction: row;
|
|
586
|
+
justify-content: space-between;
|
|
587
|
+
align-items: center;
|
|
588
|
+
}
|
|
589
|
+
${t=>t.theme.breakpoints.down("sm")} {
|
|
590
|
+
flex-direction: column;
|
|
591
|
+
justify-content: flex-end;
|
|
592
|
+
align-items: flex-end;
|
|
593
|
+
.sm-hide-icon > svg {
|
|
594
|
+
display: none;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
`,$d=re(O)`
|
|
598
|
+
${t=>t.theme.breakpoints.down("sm")} {
|
|
599
|
+
width: 100%;
|
|
600
|
+
justify-content: space-between;
|
|
601
|
+
}
|
|
602
|
+
`;function fp(t){const{locale:r}=S.useContext(be),{blocklet:n,recommendedDomain:i}=Ea(),a=s=>ji({blocklet:n,domain:{value:i||`${wi.encode(n.appPid)}.${G.DEFAULT_DID_DOMAIN}`},mountPoint:s,params:$n(n,r)});return e.jsx(ms,{blocklet:n,getComponentUrl:a,...t})}export{fp as default};
|