@abtnode/webapp 1.16.52-beta-20250912-112002-e3499e9c → 1.16.52-beta-20250917-070942-7ee57044
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-DBb6evn-.js → AdapterDayjs-DarkZR9j.js} +1 -1
- package/dist/assets/{Add-Nm-0HQuZ.js → Add-BsCasUcs.js} +1 -1
- package/dist/assets/ArrowDropDown-BbXAaeVr.js +1 -0
- package/dist/assets/{Autocomplete-Bxg_V7oZ.js → Autocomplete-DjYVg0xw.js} +1 -1
- package/dist/assets/{Breadcrumbs-BstonFkA.js → Breadcrumbs-vVVRZsjN.js} +1 -1
- package/dist/assets/{ButtonGroup-BdiA1ieO.js → ButtonGroup-CF6fFlve.js} +1 -1
- package/dist/assets/{CSSTransition-BNoCWHCT.js → CSSTransition-DSxV7K4V.js} +1 -1
- package/dist/assets/{CallMerge-3ONMFKaC.js → CallMerge-odntUl5s.js} +1 -1
- package/dist/assets/{CardContent-Bf9xFcVF.js → CardContent-Bx23N-y1.js} +1 -1
- package/dist/assets/{ChevronLeft-BcYwe1Np.js → ChevronLeft-DneAQDKO.js} +1 -1
- package/dist/assets/{ChevronRight-D-piYz4L.js → ChevronRight-C_XYjhxd.js} +1 -1
- package/dist/assets/{Clear-Byq43mbH.js → Clear-dbJWv3QG.js} +1 -1
- package/dist/assets/{DeleteOutline--HOjaz49.js → DeleteOutline-BQGJu1ed.js} +1 -1
- package/dist/assets/{Done-DUEpKVRM.js → Done-BjzLVAB9.js} +1 -1
- package/dist/assets/{Edit-BvYCDhH_.js → Edit-CbphF2M-.js} +1 -1
- package/dist/assets/{ErrorOutline-BC1DA45P.js → ErrorOutline-BL3sEekq.js} +1 -1
- package/dist/assets/{FilterList-C4BaYlJk.js → FilterList-DgzeYNjK.js} +1 -1
- package/dist/assets/{Google-BTtWuSai.js → Google-BklBOHcq.js} +1 -1
- package/dist/assets/{HelpOutline-CxFR9PYg.js → HelpOutline-B9rq5AT4.js} +1 -1
- package/dist/assets/{Launch-DdOm8awH.js → Launch-D-Zf7oaA.js} +1 -1
- package/dist/assets/{Link-BXILtS1X.js → Link-Lf9shwST.js} +1 -1
- package/dist/assets/{ListItemButton-B252NuSM.js → ListItemButton-CBCcz25V.js} +1 -1
- package/dist/assets/{ListSubheader-CjR9d2qi.js → ListSubheader-BYRJFOMa.js} +1 -1
- package/dist/assets/{LoadingButton-CCFZxRBF.js → LoadingButton-B2KbS3tl.js} +1 -1
- package/dist/assets/{MoreVert-DpOqnc7J.js → MoreVert-B0v12xlt.js} +1 -1
- package/dist/assets/{OpenInNew-YONC4zqV.js → OpenInNew-DpFE4qHg.js} +1 -1
- package/dist/assets/{Refresh-B_CqSdgJ.js → Refresh-DYNB8V6v.js} +1 -1
- package/dist/assets/{Search-ChuYh2xV.js → Search-TKSWz34N.js} +1 -1
- package/dist/assets/{Stepper-Cz4zGS1X.js → Stepper-C1wqVhiQ.js} +1 -1
- package/dist/assets/{Switch-Crle-Atf.js → Switch-p1fa_uPC.js} +1 -1
- package/dist/assets/{TableSearch-DLAP28ea.js → TableSearch-DH2QxdMb.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CNBxuavk.js → ToggleButtonGroup-BtechD_B.js} +1 -1
- package/dist/assets/{Verified-BoP0hME9.js → Verified-zfe6nsBp.js} +1 -1
- package/dist/assets/{VerifiedUser-DRi8NOWE.js → VerifiedUser-2_jqMje1.js} +1 -1
- package/dist/assets/{ViewList-skvvV5Bw.js → ViewList-5h6twi3p.js} +1 -1
- package/dist/assets/{_createAggregator-DUVOYxGS.js → _createAggregator-BRC6hvO7.js} +1 -1
- package/dist/assets/{actions-CKEgNOLf.js → actions-D8IVwECn.js} +1 -1
- package/dist/assets/{actions-BuX32_FY.js → actions-DwZg2R6k.js} +1 -1
- package/dist/assets/{agreement-BZ_yiLzn.js → agreement-BPDJWeCJ.js} +1 -1
- package/dist/assets/api-TFCv4qOf.js +1 -0
- package/dist/assets/{appearance-_yT5hZvM.js → appearance-BiVRoiwT.js} +1 -1
- package/dist/assets/{audit-logs-KO9TwNQH.js → audit-logs-BQFBhT5n.js} +1 -1
- package/dist/assets/{base-chart-DyplmUQs.js → base-chart-Zi8pdr17.js} +1 -1
- package/dist/assets/{blocklet-BepSnsS4.js → blocklet-C03sDJ1i.js} +1 -1
- package/dist/assets/{chain-DVuB4tA_.js → chain-CKxf9AdU.js} +1 -1
- package/dist/assets/{click-to-copy-Dlvnt0pX.js → click-to-copy-OQVm3W8D.js} +1 -1
- package/dist/assets/client-1fyhaZ1u.js +1 -0
- package/dist/assets/cloneDeep-DiUBoCJs.js +1 -0
- package/dist/assets/{collapse-GWSPzyG0.js → collapse-CmEfNn01.js} +1 -1
- package/dist/assets/{config-navigation-BgpPfoeH.js → config-navigation-BUpRpuRp.js} +3 -3
- package/dist/assets/{connect-to-BkIz4VkQ.js → connect-to-Ccnb4QWA.js} +1 -1
- package/dist/assets/{cssMode-BqE7jz26.js → cssMode-BDx-0Yhk.js} +1 -1
- package/dist/assets/{delete-confirm-DKFeNts9.js → delete-confirm-B4ZWgco3.js} +1 -1
- package/dist/assets/{depsEqual-CHzTtbxB.js → depsEqual-DUSDIMu_.js} +1 -1
- package/dist/assets/{detail-CGtu6Fih.js → detail-DD7Yilol.js} +3 -3
- package/dist/assets/{domains-BsDpjUcO.js → domains-tnLuDLA-.js} +1 -1
- package/dist/assets/{download-D3Q64sHV.js → download-DHO_qxiG.js} +1 -1
- package/dist/assets/{edit.svg-CP6Zg7Yn.js → edit.svg-CaGUvrvT.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-DzLuQ31t.js +1 -0
- package/dist/assets/engine-BTmStHRK.js +1 -0
- package/dist/assets/{freemarker2-BKjZrsKk.js → freemarker2-CvE_6GlU.js} +1 -1
- package/dist/assets/{get-safe-url-CeZ-qdMI.js → get-safe-url-DL1Ksc1t.js} +1 -1
- package/dist/assets/getValidReactChildren-DV_bKjsu.js +1 -0
- package/dist/assets/{graphqlMode-CjoWUMen.js → graphqlMode-DgW4p_1y.js} +2 -2
- package/dist/assets/{handlebars-D4VqTBV0.js → handlebars-B0Tsx3G2.js} +1 -1
- package/dist/assets/{html-B8-39ONg.js → html-DPsrcobJ.js} +1 -1
- package/dist/assets/{html-title-C3ppIMLo.js → html-title-CLvLOLbR.js} +1 -1
- package/dist/assets/{htmlMode-D_hkL8Y2.js → htmlMode-C2oN13HO.js} +1 -1
- package/dist/assets/{iframe-DM7J9bTw.js → iframe-CujpH5O-.js} +1 -1
- package/dist/assets/{index-Y8s37NGw.js → index-BDnrYBbd.js} +3 -3
- package/dist/assets/{index-Df57ynzL.js → index-BFj_BZkU.js} +1 -1
- package/dist/assets/{index-DPmW2bpf.js → index-BGsVf6ce.js} +1 -1
- package/dist/assets/{index-CMVWYlSS.js → index-BPByI5gc.js} +1 -1
- package/dist/assets/{index-5gNwXWqN.js → index-BbhrM_fS.js} +2 -2
- package/dist/assets/{index-CsOqGkqk.js → index-Bc-kttJk.js} +1 -1
- package/dist/assets/{index-BAAuc8Ew.js → index-BpHIZRoQ.js} +1 -1
- package/dist/assets/{index-Cm_b8Flm.js → index-BwFgT4f9.js} +1 -1
- package/dist/assets/{index-DVdNmG_a.js → index-BwW-ib72.js} +1 -1
- package/dist/assets/index-BzS7dp1G.js +1 -0
- package/dist/assets/{index-CMiO509B.js → index-C0GpgF9K.js} +1 -1
- package/dist/assets/{index-DqaIgRms.js → index-CGv5PXND.js} +1 -1
- package/dist/assets/{index-B523Fc-A.js → index-CIs0ueGA.js} +1 -1
- package/dist/assets/{index-CZ5i5rS1.js → index-CMwvr3Aw.js} +1 -1
- package/dist/assets/index-CT2y-lAr.js +113 -0
- package/dist/assets/{index-BMi9AMJp.js → index-CW58JS3K.js} +3 -3
- package/dist/assets/{index-BP72zVCn.js → index-CvrjkLlP.js} +1 -1
- package/dist/assets/{index-pMmJD7z1.js → index-CzpTfDdp.js} +1 -1
- package/dist/assets/{index-W5g_UdBK.js → index-D1rBdThL.js} +1 -1
- package/dist/assets/{index-CDkQEmRV.js → index-DCnEvnl6.js} +1 -1
- package/dist/assets/{index-CJibx1Df.js → index-DEhIkivP.js} +1 -1
- package/dist/assets/{index-CMdMKHT-.js → index-DFduzc0K.js} +1 -1
- package/dist/assets/{index-BIGIUdm6.js → index-DIyvBU1o.js} +1 -1
- package/dist/assets/{index-BKIOscQx.js → index-DL6_plGD.js} +3 -3
- package/dist/assets/{index-DBNKdMXE.js → index-DOu4zwZ4.js} +1 -1
- package/dist/assets/{index-BWUXmF_b.js → index-DPBo5dxQ.js} +1 -1
- package/dist/assets/{index-N_dMIDHu.js → index-DPXRDGCk.js} +3 -3
- package/dist/assets/{index-CkhY2Lmw.js → index-DVDt5rkZ.js} +1 -1
- package/dist/assets/{index-BHgqx3Bf.js → index-Dk3siGj5.js} +1 -1
- package/dist/assets/{index-Ckq9RC5w.js → index-DoLLHsgg.js} +1 -1
- package/dist/assets/{index-CbxASA_d.js → index-Dor9E-YG.js} +1 -1
- package/dist/assets/{index-DCzzBd8S.js → index-DzXOEuwn.js} +1 -1
- package/dist/assets/{index-D6Bc5817.js → index-IE_xZtXx.js} +1 -1
- package/dist/assets/{index-BW_rM4QF.js → index-KQW85_sG.js} +1 -1
- package/dist/assets/{index-BLgY_oUv.js → index-MlQbgg84.js} +1 -1
- package/dist/assets/{index-BrBU-Wb1.js → index-NuBAdQKe.js} +1 -1
- package/dist/assets/{index-D_7bRoL6.js → index-PGkZ-p10.js} +9 -9
- package/dist/assets/{index-DmygiZZZ.js → index-TIc9HsMr.js} +1 -1
- package/dist/assets/{index-DChw5H1T.js → index-Xwhm3Zp4.js} +1 -1
- package/dist/assets/{index-Bze2XJej.js → index-gyjan-8E.js} +1 -1
- package/dist/assets/{index-C_D_tHqD.js → index-hv--3OFd.js} +1 -1
- package/dist/assets/{index-IQ4l9n87.js → index-i6PKUbUv.js} +1 -1
- package/dist/assets/{index-BfhNDOKb.js → index-tJqcQJw8.js} +3 -3
- package/dist/assets/{index-DOtgCqEJ.js → index-uvPvZoSt.js} +1 -1
- package/dist/assets/{index-xRdNYj3Y.js → index-xP3FaEcA.js} +1 -1
- package/dist/assets/{index.esm-Dw_hd_87.js → index.esm-DEWYqPkv.js} +1 -1
- package/dist/assets/{install-from-url-Bpdo5qyj.js → install-from-url-R3-z-Na6.js} +1 -1
- package/dist/assets/{invitation-B6dzYchJ.js → invitation-DnVLx9Vx.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-Dn6RdM0h.js → is-path-prefix-equal-D8k2SijE.js} +1 -1
- package/dist/assets/{item-D5ZMqtgb.js → item-MmXt9J3K.js} +1 -1
- package/dist/assets/{javascript-C8s58XIY.js → javascript-BlyEC1iq.js} +1 -1
- package/dist/assets/{jsonMode-C-4795UU.js → jsonMode-CCzgkgmt.js} +1 -1
- package/dist/assets/{liquid-D2J66XKV.js → liquid-BAEm0H2r.js} +1 -1
- package/dist/assets/{list-header-CFZOSvq3.js → list-header-Crj7BNKL.js} +1 -1
- package/dist/assets/{log-yl39q8DG.js → log-DhVLnKso.js} +1 -1
- package/dist/assets/{lottie-react.esm-CnRZInLM.js → lottie-react.esm-DvvAHvj1.js} +1 -1
- package/dist/assets/{mdx-MSPpP7ua.js → mdx-BamtHgoS.js} +1 -1
- package/dist/assets/{memory-CFbb1yLg.js → memory-CFo0vaiY.js} +1 -1
- package/dist/assets/{metric-C6uV3sSt.js → metric-K7UZeWUX.js} +1 -1
- package/dist/assets/omit-Dd3E6q9F.js +1 -0
- package/dist/assets/{overview-D9CJCKo4.js → overview-HLtH-yCi.js} +1 -1
- package/dist/assets/{permission-CuYYFZUe.js → permission-BdpMR93f.js} +1 -1
- package/dist/assets/{preference-BhbUFlGi.js → preference-Lv54_1NQ.js} +3 -3
- package/dist/assets/{python-Bi74UQqJ.js → python-amBHGt1r.js} +1 -1
- package/dist/assets/{raf-schd.esm-D8Vex_N6.js → raf-schd.esm-CLovL9Is.js} +1 -1
- package/dist/assets/{razor-BNEB2ebt.js → razor-BkTz5FTM.js} +1 -1
- package/dist/assets/{rotate-session-key-BigP7BdT.js → rotate-session-key-BQCEdH4H.js} +1 -1
- package/dist/assets/{runtime-DA9Ph33k.js → runtime-BGo7IAbs.js} +1 -1
- package/dist/assets/schema-wSADEA-R.js +1 -0
- package/dist/assets/sdk-Cav0C3IX.js +1 -0
- package/dist/assets/{service-DJ9FK5Z8.js → service-Bz07Hd--.js} +1 -1
- package/dist/assets/{shorten-label-I7a7Yc81.js → shorten-label-L8CW1JMg.js} +1 -1
- package/dist/assets/{simple-select-D8O8cMQI.js → simple-select-CEHYECyj.js} +1 -1
- package/dist/assets/{spaces-3NySh_Ui.js → spaces-zGV6wwqp.js} +1 -1
- package/dist/assets/{status-H7hmMAu_.js → status-BQ8pfSo7.js} +1 -1
- package/dist/assets/{status-DGaB5Gxo.js → status-vgu2kfq8.js} +1 -1
- package/dist/assets/{switch-control-DyLDeFlC.js → switch-control-CLcUFpZi.js} +1 -1
- package/dist/assets/{table-icons-CNuBC9wj.js → table-icons-PFo7EdLg.js} +1 -1
- package/dist/assets/{team-BWxrfrQj.js → team-DV-g0zdM.js} +1 -1
- package/dist/assets/{toLower-BfB-naRV.js → toLower-DPcdQ2gg.js} +1 -1
- package/dist/assets/toUpper-DFzZf5e9.js +1 -0
- package/dist/assets/{traffic-DT04Pgrf.js → traffic-CsK46tzJ.js} +1 -1
- package/dist/assets/{tsMode-wBsww3Iu.js → tsMode-CuWtRqWJ.js} +1 -1
- package/dist/assets/{typescript-DAIALUV4.js → typescript-DJDXMz0W.js} +1 -1
- package/dist/assets/{url-evaluation-CcNC2lNq.js → url-evaluation-DWvC8Wb1.js} +1 -1
- package/dist/assets/{url-join-C5AKaybv.js → url-join-DekEkeTk.js} +1 -1
- package/dist/assets/{use-mobile-BRBCmVs9.js → use-mobile-CnqtSdkW.js} +1 -1
- package/dist/assets/{use-mobile-CcfXCkk-.js → use-mobile-TlnW5eR4.js} +1 -1
- package/dist/assets/{useAsync--QPFKBLV.js → useAsync-VFQB7kMj.js} +1 -1
- package/dist/assets/{useAsyncRetry-Bi3SSYuy.js → useAsyncRetry-F-WE12rr.js} +1 -1
- package/dist/assets/{useLocalStorage-BjelqNo4.js → useLocalStorage-DnHseBMC.js} +1 -1
- package/dist/assets/{useThemeProps-CDjgUo9Q.js → useThemeProps-C2xCEKGa.js} +1 -1
- package/dist/assets/{util-D_DYnrMU.js → util-C1MSkSwp.js} +1 -1
- package/dist/assets/{wait-container-DziRccnR.js → wait-container-C6RHwOqU.js} +1 -1
- package/dist/assets/{without-wallet-hJBDzVPX.js → without-wallet-CavlEQVy.js} +1 -1
- package/dist/assets/{wrap-locale-D2-3jOqy.js → wrap-locale-DSFFbKk8.js} +1 -1
- package/dist/assets/{xml-Dc8XYvWA.js → xml-eGuTgAY9.js} +1 -1
- package/dist/assets/{yaml-BszAyour.js → yaml-1CNB3lwQ.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-BNqJf_bc.js +0 -1
- package/dist/assets/api-CbSTXzd2.js +0 -1
- package/dist/assets/client-CCDZmJKo.js +0 -1
- package/dist/assets/cloneDeep-DibIRTK6.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-BEoMbinK.js +0 -1
- package/dist/assets/engine-pg2hdUxK.js +0 -1
- package/dist/assets/getValidReactChildren-BTX2zlcG.js +0 -1
- package/dist/assets/index-BhzOVGum.js +0 -113
- package/dist/assets/index-biZUNG--.js +0 -1
- package/dist/assets/omit-D2kGKV7Z.js +0 -1
- package/dist/assets/schema-DTT2Joc8.js +0 -1
- package/dist/assets/sdk-DclzsH0U.js +0 -1
- package/dist/assets/toUpper-Cs1mef-p.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dG as C,r as o,U as d,j as e,dH as c,b5 as b,dI as I,bu as E,dJ as z,dd as u,dK as A}from"./index-
|
|
1
|
+
import{dG as C,r as o,U as d,j as e,dH as c,b5 as b,dI as I,bu as E,dJ as z,dd as u,dK as A}from"./index-tJqcQJw8.js";import{B as L}from"./ButtonGroup-CF6fFlve.js";function P({...r}){const{size:p="medium",color:i="primary",menu:a=[],children:s=null,variant:m="contained",onClick:x=C,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},M=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:m,size:p,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(b,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(I,{children:e.jsx(E,{onClickAway:k,children:e.jsx(z,{onClick:M,children:g})})})})]})}P.Item=d;const v=u(L)`
|
|
2
2
|
> .MuiButtonBase-root:last-of-type {
|
|
3
3
|
min-width: 2em;
|
|
4
4
|
padding-left: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,g as n,j as t,s as r}from"./index-
|
|
1
|
+
import{r as o,g as n,j as t,s as r}from"./index-tJqcQJw8.js";import{p as a}from"./index-Dk3siGj5.js";function c(){const{t:s}=o.useContext(n);return t.jsx(e,{style:{paddingTop:"25vh"},children:t.jsx(a,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const e=r.main``;export{c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-BfhNDOKb.js";import{T as ut}from"./html-title-C3ppIMLo.js";import{u as L}from"./blocklet-BepSnsS4.js";import{u as mt}from"./use-mobile-CcfXCkk-.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-BkIz4VkQ.js";import"./index-BW_rM4QF.js";import"./index-BojVbZw0.js";import"./api-CbSTXzd2.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-3NySh_Ui.js";import{v as Rt}from"./index-Bze2XJej.js";import{E as zt}from"./index-Cm_b8Flm.js";import{H as vt}from"./HelpOutline-CxFR9PYg.js";import{H as Pt}from"./index-DCzzBd8S.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-CKEgNOLf.js";import{D as Lt}from"./DeleteOutline--HOjaz49.js";import{g as ke}from"./get-safe-url-CeZ-qdMI.js";import{S as Ot}from"./switch-control-DyLDeFlC.js";import{L as je}from"./list-header-CFZOSvq3.js";import"./OpenInNew-YONC4zqV.js";import"./ButtonGroup-BdiA1ieO.js";import"./getValidReactChildren-BTX2zlcG.js";import"./FilterList-C4BaYlJk.js";import"./CSSTransition-BNoCWHCT.js";import"./emotion-cache.browser.esm-BEoMbinK.js";import"./index-C_D_tHqD.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CHzTtbxB.js";import"./index-CMVWYlSS.js";import"./TableSearch-DLAP28ea.js";import"./Search-ChuYh2xV.js";import"./Clear-Byq43mbH.js";import"./MoreVert-DpOqnc7J.js";import"./useLocalStorage-BjelqNo4.js";import"./url-evaluation-CcNC2lNq.js";import"./permission-CuYYFZUe.js";import"./Switch-Crle-Atf.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-tJqcQJw8.js";import{T as ut}from"./html-title-CLvLOLbR.js";import{u as L}from"./blocklet-C03sDJ1i.js";import{u as mt}from"./use-mobile-TlnW5eR4.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-Ccnb4QWA.js";import"./index-KQW85_sG.js";import"./index-BojVbZw0.js";import"./api-TFCv4qOf.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-zGV6wwqp.js";import{v as Rt}from"./index-gyjan-8E.js";import{E as zt}from"./index-BwFgT4f9.js";import{H as vt}from"./HelpOutline-B9rq5AT4.js";import{H as Pt}from"./index-DzXOEuwn.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-D8IVwECn.js";import{D as Lt}from"./DeleteOutline-BQGJu1ed.js";import{g as ke}from"./get-safe-url-DL1Ksc1t.js";import{S as Ot}from"./switch-control-CLcUFpZi.js";import{L as je}from"./list-header-Crj7BNKL.js";import"./OpenInNew-DpFE4qHg.js";import"./ButtonGroup-CF6fFlve.js";import"./getValidReactChildren-DV_bKjsu.js";import"./FilterList-DgzeYNjK.js";import"./CSSTransition-DSxV7K4V.js";import"./emotion-cache.browser.esm-DzLuQ31t.js";import"./index-hv--3OFd.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DUSDIMu_.js";import"./index-BPByI5gc.js";import"./TableSearch-DH2QxdMb.js";import"./Search-TKSWz34N.js";import"./Clear-dbJWv3QG.js";import"./MoreVert-B0v12xlt.js";import"./useLocalStorage-DnHseBMC.js";import"./url-evaluation-DWvC8Wb1.js";import"./permission-BdpMR93f.js";import"./Switch-p1fa_uPC.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ue({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Le.propTypes={metadata:m.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(U,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(U,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):q(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|