@abtnode/blocklet-services 1.16.42-beta-20250403-230303-c167c6a1 → 1.16.42-beta-20250407-225010-b71aee89
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/dist/assets/{ArrowDropDown-ptWD82T6.js → ArrowDropDown-CIcX9so8.js} +1 -1
- package/dist/assets/{CheckCircle-Btm_ouu-.js → CheckCircle-BBenFQEZ.js} +1 -1
- package/dist/assets/{ChevronLeft-Dlcukg5b.js → ChevronLeft-XZDsaitS.js} +1 -1
- package/dist/assets/{ChevronRight-Dum8C8k7.js → ChevronRight-DfhN5qTp.js} +1 -1
- package/dist/assets/{Community-BuDGbplJ.js → Community-BKnwgGcO.js} +1 -1
- package/dist/assets/{DeleteOutline-qIhkqz9A.js → DeleteOutline-DVPNhMfh.js} +1 -1
- package/dist/assets/{Done-CxsGHhW2.js → Done-Bu72PctM.js} +1 -1
- package/dist/assets/{Download-DtSKdPMo.js → Download-CDVTENqI.js} +1 -1
- package/dist/assets/{EditIcon-BOKrjkh4.js → EditIcon-Bww8_WRx.js} +1 -1
- package/dist/assets/{Email-D1oAzxhZ.js → Email-C6-GXQIV.js} +1 -1
- package/dist/assets/{Error-yZoplO-q.js → Error-CDj0R4_e.js} +1 -1
- package/dist/assets/{ExpandLess-DN5VsSyP.js → ExpandLess-Dt46nF0t.js} +1 -1
- package/dist/assets/{Google-Drf-_CBl.js → Google-BxEqzKy9.js} +4 -4
- package/dist/assets/{Holiday-CGw5hZXz.js → Holiday-BSfwdA-4.js} +1 -1
- package/dist/assets/{InfoOutlined-CLOzYFOV.js → InfoOutlined-Cga_EIiY.js} +1 -1
- package/dist/assets/{Launch-BtdPv0ms.js → Launch-hbSlZ0zw.js} +1 -1
- package/dist/assets/{LaunchOutlined-Bxfn3D1k.js → LaunchOutlined-FPKJQ1Ta.js} +1 -1
- package/dist/assets/{Location-BNMzVuhr.js → Location-CT1S5M1P.js} +1 -1
- package/dist/assets/{LockIcon-D-N7I3eV.js → LockIcon-kY343jXt.js} +1 -1
- package/dist/assets/{Meeting-CHDEMp94.js → Meeting-PVrGyQbK.js} +1 -1
- package/dist/assets/{MoreHoriz-Ecf_Y2c5.js → MoreHoriz-CiMTPRBH.js} +1 -1
- package/dist/assets/{OffSick-s49E5S0C.js → OffSick-DD3oLLQu.js} +1 -1
- package/dist/assets/{Phone-B7KVJqdR.js → Phone-BcpEH3XZ.js} +1 -1
- package/dist/assets/{PlayArrow-C5Hul3eK.js → PlayArrow-CTZ2QlWx.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-D9Nr1DvN.js → QuestionMarkCircle-BHP2onYz.js} +1 -1
- package/dist/assets/{ServerLogo-CJ7KvDlS.js → ServerLogo-Bi89KNz4.js} +1 -1
- package/dist/assets/{Timezone-fKWN5g03.js → Timezone-Ce85fX7w.js} +1 -1
- package/dist/assets/{TuneOutlined-CIVU5KTm.js → TuneOutlined-BVx9kD7P.js} +1 -1
- package/dist/assets/{ViewList-DQNBBLS5.js → ViewList-Rdv91ijz.js} +1 -1
- package/dist/assets/{WorkingRemotely-8AJSfiNI.js → WorkingRemotely-DfgJTsRm.js} +1 -1
- package/dist/assets/{access-control-5GyLuYd7.js → access-control-DIB0l-By.js} +1 -1
- package/dist/assets/{actions-BK1Ssw2h.js → actions-DVfOVgcp.js} +1 -1
- package/dist/assets/{add-component-core-Bm9enQVM.js → add-component-core-DSdpBuMr.js} +18 -18
- package/dist/assets/add-resource-5o2RNaPF.js +1 -0
- package/dist/assets/{addon-Dfs1zul7.js → addon-dV77wOE-.js} +1 -1
- package/dist/assets/advanced-CFO-aSdn.js +48 -0
- package/dist/assets/api-DlN8K5Jg.js +1 -0
- package/dist/assets/{appearance-_saX27MM.js → appearance-CwPgZYso.js} +1 -1
- package/dist/assets/ar-688M-cDq.js +3 -0
- package/dist/assets/{audit-logs-C8OHcyQY.js → audit-logs-KSW08v3I.js} +3 -3
- package/dist/assets/{base32-DY8fPTYx.js → base32-CHVLLVvB.js} +1 -1
- package/dist/assets/branding-CLAD8tdh.js +40 -0
- package/dist/assets/{branding-DelDZvig.js → branding-DhLT2YMD.js} +3 -3
- package/dist/assets/{bundle-avatar-CxGKqpL1.js → bundle-avatar-M5Q9uUXI.js} +1 -1
- package/dist/assets/button-CYnp_Qaz.js +1 -0
- package/dist/assets/{click-to-copy-BuZpdwN0.js → click-to-copy-BNduK3fH.js} +1 -1
- package/dist/assets/cloneDeep-C7Ok409J.js +1 -0
- package/dist/assets/{complete-CIxsaCVT.js → complete-DJSclA46.js} +2 -2
- package/dist/assets/{component-vibwLNji.js → component-hYTDZZQj.js} +43 -14
- package/dist/assets/{config-BbT0ik5t.js → config-C3f0MD_t.js} +2 -2
- package/dist/assets/{config-Bl-eQAj5.js → config-Dtwn5KYi.js} +1 -1
- package/dist/assets/config-navigation-DwvqZIBO.js +26 -0
- package/dist/assets/config-space-DTf04Wry.js +1 -0
- package/dist/assets/{confirm-BzL9LNyf.js → confirm-CNuH6roP.js} +1 -1
- package/dist/assets/{connect-CzcOswsI.js → connect-BDr_Gx2R.js} +1 -1
- package/dist/assets/{connect-Czr8O47H.js → connect-DvwRLgOt.js} +1 -1
- package/dist/assets/{connect-to-LVtY3yeI.js → connect-to-CjH0XryZ.js} +1 -1
- package/dist/assets/{content-layout-CcLv-R_J.js → content-layout-uPtoKIAs.js} +1 -1
- package/dist/assets/{dashboard-BuFzcMGR.js → dashboard-BHZa3hQc.js} +13 -13
- package/dist/assets/de-dAK4siFW.js +3 -0
- package/dist/assets/{delete-confirm-Bg3_0xz8.js → delete-confirm-BfORBhBM.js} +1 -1
- package/dist/assets/{did-address-Dn6n8fAo.js → did-address-Cv_JswP5.js} +1 -1
- package/dist/assets/domain-DWwdnNBG.js +9 -0
- package/dist/assets/{domain-action-card-B6WSK3W9.js → domain-action-card-meLakQUW.js} +2 -2
- package/dist/assets/domains-CImsNo9g.js +1 -0
- package/dist/assets/{email-qq2sglAS.js → email-CKzdoxYN.js} +2 -2
- package/dist/assets/empty-spinner-CoimPnT0.js +1 -0
- package/dist/assets/es-DScgwpYm.js +3 -0
- package/dist/assets/exchange-passport-DAeESSDh.js +1 -0
- package/dist/assets/fr-BBQTxbA5.js +3 -0
- package/dist/assets/{fuel-DVzKzmYw.js → fuel-CuUL8831.js} +1 -1
- package/dist/assets/{get-safe-url-CA3J0_99.js → get-safe-url-B0p0Sl-_.js} +1 -1
- package/dist/assets/{get-safe-url-DnmtzIqo.js → get-safe-url-DBsoYX8R.js} +1 -1
- package/dist/assets/hi-Bw7OKUaN.js +1 -0
- package/dist/assets/{home--ykFBnb1.js → home-DOEBAXN2.js} +1 -1
- package/dist/assets/id-CKyyz3c3.js +3 -0
- package/dist/assets/{iframe-B5D34SYo.js → iframe-DAyXsLzg.js} +1 -1
- package/dist/assets/index-B807M2aG.js +104 -0
- package/dist/assets/{index-B8T_6tqA.js → index-B9lZsGBd.js} +1 -1
- package/dist/assets/{index-ndYC_y0r.js → index-BLw2eGtC.js} +1 -1
- package/dist/assets/{index-dCzPMsw6.js → index-BUyQJBqs.js} +1 -1
- package/dist/assets/{index-BByO9801.js → index-BYC998Xz.js} +1 -1
- package/dist/assets/{index-Da6LyIoG.js → index-C-E-0SKx.js} +1 -1
- package/dist/assets/{index-Dy3LPNyS.js → index-C25BetgU.js} +41 -41
- package/dist/assets/index-C6lqMXey.js +4 -0
- package/dist/assets/{index-CBhHQMgh.js → index-CDJctLrv.js} +1 -1
- package/dist/assets/{index-C6eHDaxg.js → index-CKPz-pPM.js} +11 -11
- package/dist/assets/{index-J5kmwEca.js → index-CKv9guDo.js} +1 -1
- package/dist/assets/index-CcaiJtLN.js +1 -0
- package/dist/assets/{index-BqIq9Uma.js → index-DOs1L1ra.js} +2 -2
- package/dist/assets/index-DdmAJNiO.js +1 -0
- package/dist/assets/{index-B1UWfhev.js → index-Dfr3DMin.js} +3 -3
- package/dist/assets/{index-L3MBVAcg.js → index-DvDiL1rm.js} +1 -1
- package/dist/assets/{index-CytYWl7a.js → index-FSFiVOxc.js} +2 -2
- package/dist/assets/{index-DOdTZRA4.js → index-KitP7-Wr.js} +2 -2
- package/dist/assets/{index-vxB3STPb.js → index-Q-TPSg8z.js} +2 -2
- package/dist/assets/{index-y6Dw39ly.js → index-mgIOs8VZ.js} +9 -9
- package/dist/assets/{index-VUi6PKrJ.js → index-nHbtopN7.js} +1 -1
- package/dist/assets/index-tQVGuuqb.js +1 -0
- package/dist/assets/{index-BDliasS9.js → index-yITXWC4f.js} +4 -4
- package/dist/assets/{invitation-Cp6DuOW5.js → invitation-oQFbgqmc.js} +5 -5
- package/dist/assets/invite-C8NmnFRt.js +1 -0
- package/dist/assets/{issue-passport-Bu5NvC_2.js → issue-passport-CI5Xh6r4.js} +1 -1
- package/dist/assets/{item-ClBhYYKW.js → item-ClKcCtfn.js} +1 -1
- package/dist/assets/ja-C9-S8RGg.js +3 -0
- package/dist/assets/ko-B7Et6Phj.js +3 -0
- package/dist/assets/{landing-page-BfVl47YO.js → landing-page-B6GPz-DA.js} +1 -1
- package/dist/assets/{launch-result-message-BP5yMmIB.js → launch-result-message-DvcvHHH1.js} +1 -1
- package/dist/assets/{layout-D5G7Z8Ws.js → layout-Csi8ctLm.js} +1 -1
- package/dist/assets/list-YnPbGaT0.js +212 -0
- package/dist/assets/{list-header-Cip98Afo.js → list-header-DvakxkxK.js} +1 -1
- package/dist/assets/localization-Da3qFRTd.js +1 -0
- package/dist/assets/{log-_cZt5s1j.js → log-Ci4E8sta.js} +1 -1
- package/dist/assets/{login-Bd9eibzl.js → login-CcWVKG5Z.js} +1 -1
- package/dist/assets/{login-oauth-callback-Buv0sriC.js → login-oauth-callback-Obvjcq-B.js} +1 -1
- package/dist/assets/{logo-uploader-DGn3pkYl.js → logo-uploader-Bzv9V3Oi.js} +3 -3
- package/dist/assets/{lost-passport-BplwQoPb.js → lost-passport-l2lvndlJ.js} +3 -3
- package/dist/assets/{omit-DYK_TtPQ.js → omit-r8RGw6zD.js} +1 -1
- package/dist/assets/{open-window-3TWqcI62.js → open-window-BSZzCk0O.js} +1 -1
- package/dist/assets/overview-DiGDuD4t.js +85 -0
- package/dist/assets/{page-header-FKKsPnE9.js → page-header-BbutANxz.js} +1 -1
- package/dist/assets/{permission-Dd3ufGD-.js → permission-D7sDivJU.js} +1 -1
- package/dist/assets/preferences-Cr9xOl3Y.js +1 -0
- package/dist/assets/profile-embed-IW6vPild.js +1 -0
- package/dist/assets/pt-BYJAg1Zs.js +1 -0
- package/dist/assets/publish-resource-CbZMKYge.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DxmtDCVc.js → react-beautiful-dnd.esm-ONm9Sfm9.js} +15 -15
- package/dist/assets/{relative-time-Bp0EO1aU.js → relative-time-CYLhl1Uq.js} +1 -1
- package/dist/assets/ru-DUqsqieR.js +1 -0
- package/dist/assets/{runtime-DCHSigWq.js → runtime-BNcJSpUq.js} +1 -1
- package/dist/assets/sdk-DJ0rC1b9.js +1 -0
- package/dist/assets/{security-Ba0U57n2.js → security-BSuYGS-B.js} +4 -4
- package/dist/assets/session-D21Dok5b.js +1 -0
- package/dist/assets/setup-Cxloh4_L.js +19 -0
- package/dist/assets/{shorten-label-BcXnCxH2.js → shorten-label-C642GTxb.js} +1 -1
- package/dist/assets/{simple-select-D7qC2duk.js → simple-select-i-SepLIh.js} +1 -1
- package/dist/assets/{slicedToArray-CG0jVe85.js → slicedToArray-B6WXjdrb.js} +1 -1
- package/dist/assets/spaces-CJLlwQgN.js +1 -0
- package/dist/assets/{start-kkjng8Di.js → start-D-20SLK1.js} +1 -1
- package/dist/assets/{status-Bcehte3I.js → status-CfViuB-l.js} +1 -1
- package/dist/assets/{step-actions-CAn2VbnK.js → step-actions-Bc67QQmH.js} +1 -1
- package/dist/assets/{studio-Dnzc2A5y.js → studio-D6is1ZB_.js} +1 -1
- package/dist/assets/{switch-control-DZceCxwF.js → switch-control-CHr40nyS.js} +1 -1
- package/dist/assets/th-BIzIDice.js +1 -0
- package/dist/assets/{traffic-BbJxF2T-.js → traffic-AQfvgHlv.js} +1 -1
- package/dist/assets/{transfer-j5hCBx8d.js → transfer-vSwyd50v.js} +1 -1
- package/dist/assets/{unsubscribe-DJgSmFME.js → unsubscribe-CjL4fZfX.js} +1 -1
- package/dist/assets/{use-mobile-DNsgYi-4.js → use-mobile-B_Gqv6b6.js} +1 -1
- package/dist/assets/{use-mobile-DVecy9Ks.js → use-mobile-DudfIz3d.js} +1 -1
- package/dist/assets/{useAsync-Bia14KO2.js → useAsync-BmuLIImU.js} +1 -1
- package/dist/assets/{useAsyncRetry-C-QH3IsB.js → useAsyncRetry-CwtLImQi.js} +1 -1
- package/dist/assets/{useLocalStorage-BQFZ73WZ.js → useLocalStorage-Bip9kD-Q.js} +1 -1
- package/dist/assets/user-center-JLwNTZCR.js +77 -0
- package/dist/assets/{util-WwcocPP-.js → util-MwMuX2uT.js} +1 -1
- package/dist/assets/{util-C9Xcu_Dq.js → util-kcEqeshx.js} +1 -1
- package/dist/assets/{vendor-arcblock-B7hyNlnQ.js → vendor-arcblock-DV12D9BN.js} +81 -82
- package/dist/assets/{vendor-hooks-DnflU2EL.js → vendor-hooks-DtYI0-rF.js} +1 -1
- package/dist/assets/{vendor-mui-core-BL-xsBvI.js → vendor-mui-core-C-PhacC8.js} +33 -33
- package/dist/assets/{vendor-mui-x-BmOE-0pQ.js → vendor-mui-x-BiTj3AZC.js} +1 -1
- package/dist/assets/vendor-utils-CRBr0QUY.js +11 -0
- package/dist/assets/vendor-ux-did-connect-BihFfRkM.js +1841 -0
- package/dist/assets/{vi-PQuaKyKY.js → vi-DQnObbNS.js} +1 -1
- package/dist/assets/wrap-locale-CyOb_Hyf.js +1 -0
- package/dist/assets/zh-DQI8vsAI.js +4 -0
- package/dist/assets/zh-tw-DqaJtqXb.js +3 -0
- package/dist/index.html +6 -6
- package/dist/service-worker.js +1 -1
- package/package.json +34 -34
- package/dist/assets/add-resource-Cqmj5BBD.js +0 -1
- package/dist/assets/advanced-MSBu-f81.js +0 -49
- package/dist/assets/api-DeTTY4rz.js +0 -1
- package/dist/assets/ar-Bd3GUoqC.js +0 -3
- package/dist/assets/branding-CanOP0qb.js +0 -40
- package/dist/assets/button-GsH-bz74.js +0 -1
- package/dist/assets/config-navigation-Dw7tct52.js +0 -29
- package/dist/assets/config-space-D3pvjnQx.js +0 -1
- package/dist/assets/de-4RuZHBym.js +0 -3
- package/dist/assets/domain-C_0cRyXj.js +0 -9
- package/dist/assets/domains-BQtz7ONz.js +0 -1
- package/dist/assets/es-DPG1emNh.js +0 -3
- package/dist/assets/exchange-passport-CfAHAVKI.js +0 -1
- package/dist/assets/fr-u7MDLCDo.js +0 -3
- package/dist/assets/hi-DS9ZR9W2.js +0 -1
- package/dist/assets/id-C459Zhwd.js +0 -3
- package/dist/assets/index-BPS0iHSZ.js +0 -4
- package/dist/assets/index-BQLZ0lsX.js +0 -1
- package/dist/assets/index-BWpwjp4L.js +0 -104
- package/dist/assets/index-CClhZ8rs.js +0 -1
- package/dist/assets/index-D8CNdALX.js +0 -2
- package/dist/assets/index-ItdGu4Wh.js +0 -2
- package/dist/assets/invite-DjADjbzm.js +0 -1
- package/dist/assets/ja-B5tIV7r-.js +0 -3
- package/dist/assets/ko-CL3JJCJN.js +0 -3
- package/dist/assets/list-CjtRvxdF.js +0 -211
- package/dist/assets/localization-Tn68766t.js +0 -1
- package/dist/assets/overview-CJ3muOc6.js +0 -84
- package/dist/assets/preferences-D4OSAVTW.js +0 -1
- package/dist/assets/profile-embed--1Je95gw.js +0 -1
- package/dist/assets/pt-CYRkKZmh.js +0 -1
- package/dist/assets/publish-resource-B4kuEUIu.js +0 -1
- package/dist/assets/ru-Dzg-gLvu.js +0 -1
- package/dist/assets/sdk-B4tneH2b.js +0 -1
- package/dist/assets/session-BXc0WNE7.js +0 -1
- package/dist/assets/setup-bc5fgvzY.js +0 -19
- package/dist/assets/th-CevmRMq6.js +0 -1
- package/dist/assets/user-center-BZ0ZkNAA.js +0 -67
- package/dist/assets/vendor-utils-Cs6ARqvU.js +0 -11
- package/dist/assets/vendor-ux-did-connect-CWUKGZcn.js +0 -1843
- package/dist/assets/wrap-locale-DyRnlWyZ.js +0 -1
- package/dist/assets/zh-BBkG8qYp.js +0 -4
- package/dist/assets/zh-tw-BHJNqYL0.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Pe,R as vt,a5 as jt,T as Y,a4 as w,A as Fe,bl as ke,ca as et,bL as Re,bp as Te,bM as Ie,x as je,b2 as De,a3 as tt,aa as oe,W as st,bf as Xe,bo as yt,bk as St,ak as Je,bR as Ct}from"./vendor-mui-core-BL-xsBvI.js";import{c as ne,au as le,A as Nt}from"./vendor-utils-Cs6ARqvU.js";import{W as G,m as F,bn as wt,r as _e,u as X,c2 as Rt,V as nt,B as Ee,a3 as at,bE as xe,aG as Tt,aM as It,b$ as Dt}from"./vendor-ux-did-connect-CWUKGZcn.js";import{A as Et,v as H,m as At,I as Qe}from"./index-BWpwjp4L.js";import{f as ee,a as Ae}from"./vendor-hooks-DnflU2EL.js";import{S as pe}from"./shorten-label-BcXnCxH2.js";import{I as it}from"./index-VUi6PKrJ.js";import{A as Lt,S as Ot,a as Pt,b as Ft}from"./list-CjtRvxdF.js";import{R as Be}from"./relative-time-Bp0EO1aU.js";import{b as ze}from"./dashboard-BuFzcMGR.js";import{W as kt}from"./did-address-Dn6n8fAo.js";import{p as ot}from"./util-WwcocPP-.js";import{D as _t,g as Bt}from"./traffic-BbJxF2T-.js";import{i as zt,B as Wt}from"./index-ItdGu4Wh.js";import{B as rt}from"./bundle-avatar-CxGKqpL1.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-B7hyNlnQ.js";import"./index-BByO9801.js";import"./InfoOutlined-CLOzYFOV.js";import"./CheckCircle-Btm_ouu-.js";import"./useLocalStorage-BQFZ73WZ.js";import"./confirm-BzL9LNyf.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-C5Hul3eK.js";import"./get-safe-url-CA3J0_99.js";import"./session-BXc0WNE7.js";import"./useAsyncRetry-C-QH3IsB.js";import"./useAsync-Bia14KO2.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-DNsgYi-4.js";import"./base32-DY8fPTYx.js";import"./iframe-B5D34SYo.js";import"./LaunchOutlined-Bxfn3D1k.js";import"./ChevronLeft-Dlcukg5b.js";import"./ChevronRight-Dum8C8k7.js";import"./index-CBhHQMgh.js";import"./vendor-mui-x-BmOE-0pQ.js";const lt=j.createContext({}),{Provider:Mt,Consumer:an}=lt;function qt({children:t,blocklet:s=""}){const{api:n,inService:o}=Et(),[i,r]=j.useState([]),[x,u]=j.useState({total:0,pageSize:20,pageCount:0,page:1}),b=ee(()=>{var D;return(D=s.meta)==null?void 0:D.did},[s]),[S,C]=j.useState([]),N=async({page:D=1,pageSize:O=20,...m}={})=>{if(!b)return[];try{const g={paging:{page:D,pageSize:O},...m,teamDid:b,dateRange:m.dateRange?[H(m.dateRange[0]).toISOString(),H(m.dateRange[1]).toISOString()]:void 0},{dids:L,...Q}=g;let K="";L.includes("system")&&(K="system");const J=L.filter(Z=>Z!=="system"),_=await n.getNotificationSendLog({input:{...Q,source:K,componentDids:J}});return r(_.list),u(_.paging),_.list}catch(g){return G.error(g.message),[]}},E=async()=>{const D=await n.getNotificationComponents({input:{teamDid:b}});C(D.componentDids)},z=j.useCallback(D=>{const O=s.children.find(m=>{var g;return((g=m.meta)==null?void 0:g.did)===D});if(O)return O.ancestors=[s],O},[s]),A=async({notificationId:D,receivers:O,channels:m,...g})=>{await n.resendNotification({input:{teamDid:b,notificationId:D,receivers:O,channels:m.map(L=>L==="wallet"?F.NOTIFICATION_SEND_CHANNEL.WALLET:L==="pushKit"?F.NOTIFICATION_SEND_CHANNEL.PUSH:L),...g}})},P=j.useCallback(async D=>(await n.getUser({input:{teamDid:b,user:{did:D}}})).user,[n,b]),I=j.useCallback(async({page:D=1,pageSize:O=20,...m}={})=>{try{const g={paging:{page:D,pageSize:O},...m,userName:m.searchText||"",teamDid:b,dateRange:m.dateRange?[H(m.dateRange[0]).toISOString(),H(m.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:g})}catch(g){throw G.error(g.message),g}},[n,b]);j.useEffect(()=>{b&&E()},[b]);const W={fetch:N,data:i,paging:x,blocklet:s,getComponent:z,resendNotification:A,getUser:P,componentDids:S,getReceivers:I,inService:o,teamDid:b};return e.jsx(Mt,{value:{notificationRecords:W},children:t})}function We(){const{notificationRecords:t}=j.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Kt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(wt,{type:Kt[t],children:t})}var Me={},$t=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,Ht=$t(_e()),Ut=e;ct=Me.default=(0,Ht.default)((0,Ut.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Vt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Gt=Vt(_e()),Yt=e;dt=qe.default=(0,Gt.default)((0,Yt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Xt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Jt=Xt(_e()),Qt=e;ut=Ke.default=(0,Jt.default)((0,Qt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Zt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case F.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:o,updatedAt:i,reason:r="",channel:x="wallet"}=n,u=i?t("notification.sendStatus.sentTime",{date:At(i,s)}):"",b=Zt(t,x,r);return o===F.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:b}:o===F.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:b,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Oe=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},mt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},es=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ts=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ss=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),ns=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),he=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),as=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ge=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},is=(t,s="")=>{if(s&&Oe.includes(s)){const r=`${s}SendRecord`,x=ne(t,r,[]);return ge(x)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const r=n[s]??[];return ge(r)}const i={};return Oe.forEach(r=>{const x=`${r}SendRecord`,u=ne(t,x,[]),b=ge(u);i[r]=b}),o.length>0&&o.forEach(r=>{const x=n[r]??[],u=ge(x);i[r]=u}),i},be=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},os=t=>{switch(t){case F.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case F.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case F.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case F.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>vt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:"#F4F4F5"},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:i,title:r="",sentTime:x="",reason:u=""}=t,b=[r,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:b}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(w,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(w,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(w,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[i],style:{opacity:.15}}),e.jsx(w,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[i]})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?r:o})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};te.defaultProps={enableTooltip:!0,showTitle:!1,children:null};ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};ce.defaultProps={onDelete:()=>{}};function ce({list:t,label:s,onDelete:n}){const{t:o,locale:i}=X();return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Y,{children:[s,": "]}),t.map(r=>{const x=pt(o,i,{status:r});return e.jsx(Fe,{size:"small",label:e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,r)},r)})]})}$e.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function $e({filterList:t,onChange:s,index:n,column:o,filterValues:i,label:r,renderLabel:x}){return e.jsxs(ke,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:r}),e.jsx(Re,{row:!0,children:i.map(u=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:b=>{const S=[...t];b.target.checked?S[n]=[...S[n],u.value??u]:S[n]=S[n].filter(C=>C!==(u.value??u)),s(S[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}re.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function re({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:i}){const{t:r,locale:x}=X(),u=pt(r,x,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(te,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(je,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:r("notification.resend")})]})}He.propTypes={value:d.array.isRequired,onChange:d.func};function He({value:t,onChange:s}){const{locale:n}=X(),o=H().toDate(),[i,r]=j.useState(null),x=j.useCallback(S=>{r(i?null:S.currentTarget)},[i]),u=!!i,b=j.useCallback(S=>{if(!S.startDate||!S.endDate){G.error("Please select a date range");return}if(H(S.startDate).isAfter(S.endDate)||!H(S.startDate).isValid()||!H(S.endDate).isValid()){G.error("Invalid date range");return}s([S.startDate,S.endDate]),r(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(je,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(De,{open:u,anchorEl:i,onClose:()=>{r(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(_t,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(o),onChange:b})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var i;const{t:n}=X();return!((i=s==null?void 0:s.filterList)!=null&&i.filter(r=>r.length).length)?null:e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Rt.TableFilterList,{...s,ItemComponent:t})})]})}function ye({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const i=s&&typeof s=="function"?s:void 0;let r=!0;return n&&typeof n=="function"&&(r=n({label:t,...o})),e.jsx(Fe,{label:t,variant:"outlined",...i&&r?{onDelete:i}:{}})}ye.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};ye.defaultProps={canDelete:()=>!0};const rs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[i,r]=j.useState(rs),[x,u]=j.useState(!0),b=(C,N)=>{N.checked=C.target.checked;const E=i.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));r(E)},S=C=>{C.stopPropagation(),n({channels:i.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:x})};return e.jsxs(w,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(w,{className:"choose-channel",children:e.jsxs(ke,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(C=>e.jsx(Te,{control:e.jsx(Ie,{checked:C.checked,onChange:N=>b(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(w,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:x,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(w,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(je,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(je,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:i}=X(),{getReceivers:r,inService:x,teamDid:u,getUser:b,blocklet:S}=We(),[C,N]=j.useState(!1),[E,z]=j.useState([]),A=Ae({anchorEl:null,position:null}),P=Ae({anchorEl:null,position:null}),[I,W]=j.useState(null),[D,O]=j.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,g]=j.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[L,Q]=j.useState([]),K=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],J=async()=>{if(!C&&t)try{N(!0);const a=await r({notificationId:t,...m}),l=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));z(l),O(a.paging),N(!1)}catch(a){G.error(a.message),N(!1)}};j.useEffect(()=>{J()},[m]);const _=a=>{a.stopPropagation();const l=a.currentTarget;P.anchorEl=l;const c=l.getBoundingClientRect();P.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},Z=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ee,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:o("notification.resend")})}):null,M={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:L,onRowSelectionChange:(a,l)=>{Q(l.map(c=>c.dataIndex))},customToolbarSelect:Z},Ce=({page:a,rowsPerPage:l,searchText:c,filterList:y})=>{const[,k=[],$=[],q=[]]=y;m.pageSize!==l?g(B=>({...B,pageSize:l,page:1})):m.page!==a+1?g(B=>({...B,page:a+1})):m.searchText!==c?g(B=>({...B,searchText:c,page:1})):le(k,m.walletSendStatus)?le($,m.pushKitSendStatus)?le(q,m.emailSendStatus)||g(B=>({...B,emailSendStatus:q,page:1})):g(B=>({...B,pushKitSendStatus:$,page:1})):g(B=>({...B,walletSendStatus:k,page:1}))},Ne=j.useCallback(async(a,l)=>{if(!l)return!1;const c=await b(l);return c?a==="wallet"?ss(c):a==="email"?es(S,c):a==="pushKit"?ts(S,c):a==="webhook"?ns(c):!0:!1},[b,S]),me=j.useCallback(a=>as(o,a),[o]),f=()=>{A.anchorEl=null,A.position=null,W(null)},p=()=>{P.anchorEl=null,P.position=null},h=async(a,l,c=!0,y="")=>{if(!(!l.length||!a.length))try{s(a,l,c,y),P.anchorEl||(await he(.5),f())}catch(k){console.error("handleResend error",{error:k})}},v=async({channels:a,isResendFailedOnly:l})=>{const c=L.map(y=>E[y].receiver);await h(a,c,l),await he(.5),p(),Q([])},T=async(a,l=[],c=!0)=>{try{await h(["webhook"],[a.receiver],c,l)}catch(y){G.error(y.response?y.response.statusText:y.message)}},R=async(a,l,c,y=[],k=!0)=>{if(a.stopPropagation(),is(l,c)>=4){G.warning(o("notification.resendLimit"));return}if(!Oe.includes(c)){await T(l,y,k);return}if(a){const q=a.currentTarget,B=q.getBoundingClientRect();A.anchorEl=q,A.position={top:B.top+window.scrollY,left:B.left+window.scrollX}}W({channel:c});try{const q=await Ne(c,l.receiver);await he(1),W({channel:c,result:q}),(typeof q=="boolean"&&q||Nt(q)&&Object.values(q).every(B=>!!B))&&(await s([c],[l.receiver],k),P.anchorEl||(await he(.5),f()))}catch(q){G.error(q.message)}},U=a=>{g(l=>({...l,dateRange:a,page:1}))},V=(a,l,c,y)=>{a.stopPropagation();const k=c.filter($=>$!==l);g($=>({...$,[y]:k,page:1}))},se=ee(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:l,receiver:c}=E[a];return l?e.jsxs(w,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(pe,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[1].options.filterList,"walletSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:l,index:c,column:y,filterValues:K})},customBodyRenderLite:a=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"wallet",onResend:k=>R(k,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"pushkit",onResend:k=>R(k,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[2].options.filterList,"pushKitSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:l,index:c,column:y,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"email",onResend:k=>R(k,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[3].options.filterList,"emailSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Email",filterList:a,onChange:l,index:c,column:y,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:l}=E[a];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[y,k]=c,$=k[0];return e.jsx(w,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(w,{className:"webhook-item",fontSize:12,children:[e.jsx(pe,{maxLength:30,children:y},y),e.jsx(re,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:q=>R(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:l}=E[a];return e.jsx(Be,{value:l,locale:i,shouldUpdate:!0})}}}],[E,i,m,o]),Ye=[e.jsx(He,{value:m.dateRange,onChange:U},"date-picker"),e.jsx(Ee,{variant:"contained",size:"small",color:"primary",loading:C,startIcon:e.jsx(ut,{}),onClick:()=>J(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(w,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(cs,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:i,loading:C,columns:se,data:E,onChange:Ce,options:M,customButtons:Ye,components:{TableFilterList:a=>e.jsx(Ue,{...a,itemComponent:l=>e.jsx(ye,{...l,canDelete:()=>!1})})}}),A.anchorEl&&e.jsx(De,{open:!!A.anchorEl,anchorReference:"anchorPosition",anchorPosition:A.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ds,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(w,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:me(I==null?void 0:I.channel).map(a=>{var k,$;const{type:l,pass:c,fail:y}=a;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[l]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=I==null?void 0:I.result)!=null&&$[l]?xe.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:xe.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Y,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:xe.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:y})]},l)})})]})}),P.anchorEl&&e.jsx(De,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:v})})]})})})}const ls=j.memo(gt),cs=oe.div`
|
|
1
|
+
import{r as j}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Pe,R as vt,a5 as jt,T as Y,a4 as w,A as Fe,bl as ke,cc as et,bL as Re,bp as Te,bM as Ie,x as je,b2 as De,a3 as tt,aa as oe,W as st,bf as Xe,bo as yt,bk as St,ak as Je,bT as Ct}from"./vendor-mui-core-C-PhacC8.js";import{c as ne,au as le,A as Nt}from"./vendor-utils-CRBr0QUY.js";import{V as G,m as F,b1 as wt,r as _e,u as X,bJ as Rt,U as nt,B as Ee,a2 as at,bh as xe,aj as Tt,ap as It,bG as Dt}from"./vendor-ux-did-connect-BihFfRkM.js";import{A as Et,v as $,m as At,I as Qe}from"./index-B807M2aG.js";import{f as ee,a as Ae}from"./vendor-hooks-DtYI0-rF.js";import{S as pe}from"./shorten-label-C642GTxb.js";import{I as it}from"./index-nHbtopN7.js";import{A as Lt,S as Ot,a as Pt,b as Ft}from"./list-YnPbGaT0.js";import{R as Be}from"./relative-time-CYLhl1Uq.js";import{b as ze}from"./dashboard-BHZa3hQc.js";import{W as kt}from"./did-address-Cv_JswP5.js";import{p as ot}from"./util-MwMuX2uT.js";import{D as _t,g as Bt}from"./traffic-AQfvgHlv.js";import{i as zt,B as Wt}from"./index-tQVGuuqb.js";import{B as rt}from"./bundle-avatar-M5Q9uUXI.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-DV12D9BN.js";import"./index-BYC998Xz.js";import"./InfoOutlined-Cga_EIiY.js";import"./CheckCircle-BBenFQEZ.js";import"./useLocalStorage-Bip9kD-Q.js";import"./confirm-CNuH6roP.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-CTZ2QlWx.js";import"./get-safe-url-DBsoYX8R.js";import"./session-D21Dok5b.js";import"./useAsyncRetry-CwtLImQi.js";import"./useAsync-BmuLIImU.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-DudfIz3d.js";import"./base32-CHVLLVvB.js";import"./iframe-DAyXsLzg.js";import"./LaunchOutlined-FPKJQ1Ta.js";import"./ChevronLeft-XZDsaitS.js";import"./ChevronRight-DfhN5qTp.js";import"./index-CDJctLrv.js";import"./vendor-mui-x-BiTj3AZC.js";const lt=j.createContext({}),{Provider:Mt,Consumer:an}=lt;function qt({children:t,blocklet:s=""}){const{api:n,inService:o}=Et(),[i,r]=j.useState([]),[x,u]=j.useState({total:0,pageSize:20,pageCount:0,page:1}),b=ee(()=>{var D;return(D=s.meta)==null?void 0:D.did},[s]),[S,C]=j.useState([]),N=async({page:D=1,pageSize:O=20,...m}={})=>{if(!b)return[];try{const g={paging:{page:D,pageSize:O},...m,teamDid:b,dateRange:m.dateRange?[$(m.dateRange[0]).toISOString(),$(m.dateRange[1]).toISOString()]:void 0},{dids:L,...Q}=g;let K="";L.includes("system")&&(K="system");const J=L.filter(Z=>Z!=="system"),_=await n.getNotificationSendLog({input:{...Q,source:K,componentDids:J}});return r(_.list),u(_.paging),_.list}catch(g){return G.error(g.message),[]}},E=async()=>{const D=await n.getNotificationComponents({input:{teamDid:b}});C(D.componentDids)},z=j.useCallback(D=>{const O=s.children.find(m=>{var g;return((g=m.meta)==null?void 0:g.did)===D});if(O)return O.ancestors=[s],O},[s]),A=async({notificationId:D,receivers:O,channels:m,...g})=>{await n.resendNotification({input:{teamDid:b,notificationId:D,receivers:O,channels:m.map(L=>L==="wallet"?F.NOTIFICATION_SEND_CHANNEL.WALLET:L==="pushKit"?F.NOTIFICATION_SEND_CHANNEL.PUSH:L),...g}})},P=j.useCallback(async D=>(await n.getUser({input:{teamDid:b,user:{did:D}}})).user,[n,b]),I=j.useCallback(async({page:D=1,pageSize:O=20,...m}={})=>{try{const g={paging:{page:D,pageSize:O},...m,userName:m.searchText||"",teamDid:b,dateRange:m.dateRange?[$(m.dateRange[0]).toISOString(),$(m.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:g})}catch(g){throw G.error(g.message),g}},[n,b]);j.useEffect(()=>{b&&E()},[b]);const W={fetch:N,data:i,paging:x,blocklet:s,getComponent:z,resendNotification:A,getUser:P,componentDids:S,getReceivers:I,inService:o,teamDid:b};return e.jsx(Mt,{value:{notificationRecords:W},children:t})}function We(){const{notificationRecords:t}=j.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Kt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(wt,{type:Kt[t],children:t})}var Me={},Ht=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ht(_e()),Ut=e;ct=Me.default=(0,$t.default)((0,Ut.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Vt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Gt=Vt(_e()),Yt=e;dt=qe.default=(0,Gt.default)((0,Yt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Xt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Jt=Xt(_e()),Qt=e;ut=Ke.default=(0,Jt.default)((0,Qt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Zt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case F.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:o,updatedAt:i,reason:r="",channel:x="wallet"}=n,u=i?t("notification.sendStatus.sentTime",{date:At(i,s)}):"",b=Zt(t,x,r);return o===F.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:b}:o===F.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:b,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Oe=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},mt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},es=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ts=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ss=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),ns=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),he=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),as=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ge=(t=[])=>{const s=$().startOf("day");return t.filter(n=>$(n.sendAt).isSame(s,"day")).length},is=(t,s="")=>{if(s&&Oe.includes(s)){const r=`${s}SendRecord`,x=ne(t,r,[]);return ge(x)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const r=n[s]??[];return ge(r)}const i={};return Oe.forEach(r=>{const x=`${r}SendRecord`,u=ne(t,x,[]),b=ge(u);i[r]=b}),o.length>0&&o.forEach(r=>{const x=n[r]??[],u=ge(x);i[r]=u}),i},be=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},os=t=>{switch(t){case F.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case F.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case F.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case F.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>vt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:"#F4F4F5"},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:i,title:r="",sentTime:x="",reason:u=""}=t,b=[r,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:b}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(w,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(w,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(w,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[i],style:{opacity:.15}}),e.jsx(w,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[i]})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?r:o})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};te.defaultProps={enableTooltip:!0,showTitle:!1,children:null};ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};ce.defaultProps={onDelete:()=>{}};function ce({list:t,label:s,onDelete:n}){const{t:o,locale:i}=X();return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Y,{children:[s,": "]}),t.map(r=>{const x=pt(o,i,{status:r});return e.jsx(Fe,{size:"small",label:e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,r)},r)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:o,filterValues:i,label:r,renderLabel:x}){return e.jsxs(ke,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:r}),e.jsx(Re,{row:!0,children:i.map(u=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:b=>{const S=[...t];b.target.checked?S[n]=[...S[n],u.value??u]:S[n]=S[n].filter(C=>C!==(u.value??u)),s(S[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}re.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function re({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:i}){const{t:r,locale:x}=X(),u=pt(r,x,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(te,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(je,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:r("notification.resend")})]})}$e.propTypes={value:d.array.isRequired,onChange:d.func};function $e({value:t,onChange:s}){const{locale:n}=X(),o=$().toDate(),[i,r]=j.useState(null),x=j.useCallback(S=>{r(i?null:S.currentTarget)},[i]),u=!!i,b=j.useCallback(S=>{if(!S.startDate||!S.endDate){G.error("Please select a date range");return}if($(S.startDate).isAfter(S.endDate)||!$(S.startDate).isValid()||!$(S.endDate).isValid()){G.error("Invalid date range");return}s([S.startDate,S.endDate]),r(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(je,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(De,{open:u,anchorEl:i,onClose:()=>{r(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(_t,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(o),onChange:b})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var i;const{t:n}=X();return!((i=s==null?void 0:s.filterList)!=null&&i.filter(r=>r.length).length)?null:e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Rt.TableFilterList,{...s,ItemComponent:t})})]})}function ye({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const i=s&&typeof s=="function"?s:void 0;let r=!0;return n&&typeof n=="function"&&(r=n({label:t,...o})),e.jsx(Fe,{label:t,variant:"outlined",...i&&r?{onDelete:i}:{}})}ye.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};ye.defaultProps={canDelete:()=>!0};const rs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[i,r]=j.useState(rs),[x,u]=j.useState(!0),b=(C,N)=>{N.checked=C.target.checked;const E=i.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));r(E)},S=C=>{C.stopPropagation(),n({channels:i.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:x})};return e.jsxs(w,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(w,{className:"choose-channel",children:e.jsxs(ke,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(C=>e.jsx(Te,{control:e.jsx(Ie,{checked:C.checked,onChange:N=>b(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(w,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:x,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(w,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(je,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(je,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:i}=X(),{getReceivers:r,inService:x,teamDid:u,getUser:b,blocklet:S}=We(),[C,N]=j.useState(!1),[E,z]=j.useState([]),A=Ae({anchorEl:null,position:null}),P=Ae({anchorEl:null,position:null}),[I,W]=j.useState(null),[D,O]=j.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,g]=j.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[L,Q]=j.useState([]),K=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],J=async()=>{if(!C&&t)try{N(!0);const a=await r({notificationId:t,...m}),l=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));z(l),O(a.paging),N(!1)}catch(a){G.error(a.message),N(!1)}};j.useEffect(()=>{J()},[m]);const _=a=>{a.stopPropagation();const l=a.currentTarget;P.anchorEl=l;const c=l.getBoundingClientRect();P.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},Z=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ee,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:o("notification.resend")})}):null,M={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:L,onRowSelectionChange:(a,l)=>{Q(l.map(c=>c.dataIndex))},customToolbarSelect:Z},Ce=({page:a,rowsPerPage:l,searchText:c,filterList:y})=>{const[,k=[],H=[],q=[]]=y;m.pageSize!==l?g(B=>({...B,pageSize:l,page:1})):m.page!==a+1?g(B=>({...B,page:a+1})):m.searchText!==c?g(B=>({...B,searchText:c,page:1})):le(k,m.walletSendStatus)?le(H,m.pushKitSendStatus)?le(q,m.emailSendStatus)||g(B=>({...B,emailSendStatus:q,page:1})):g(B=>({...B,pushKitSendStatus:H,page:1})):g(B=>({...B,walletSendStatus:k,page:1}))},Ne=j.useCallback(async(a,l)=>{if(!l)return!1;const c=await b(l);return c?a==="wallet"?ss(c):a==="email"?es(S,c):a==="pushKit"?ts(S,c):a==="webhook"?ns(c):!0:!1},[b,S]),me=j.useCallback(a=>as(o,a),[o]),f=()=>{A.anchorEl=null,A.position=null,W(null)},p=()=>{P.anchorEl=null,P.position=null},h=async(a,l,c=!0,y="")=>{if(!(!l.length||!a.length))try{s(a,l,c,y),P.anchorEl||(await he(.5),f())}catch(k){console.error("handleResend error",{error:k})}},v=async({channels:a,isResendFailedOnly:l})=>{const c=L.map(y=>E[y].receiver);await h(a,c,l),await he(.5),p(),Q([])},T=async(a,l=[],c=!0)=>{try{await h(["webhook"],[a.receiver],c,l)}catch(y){G.error(y.response?y.response.statusText:y.message)}},R=async(a,l,c,y=[],k=!0)=>{if(a.stopPropagation(),is(l,c)>=4){G.warning(o("notification.resendLimit"));return}if(!Oe.includes(c)){await T(l,y,k);return}if(a){const q=a.currentTarget,B=q.getBoundingClientRect();A.anchorEl=q,A.position={top:B.top+window.scrollY,left:B.left+window.scrollX}}W({channel:c});try{const q=await Ne(c,l.receiver);await he(1),W({channel:c,result:q}),(typeof q=="boolean"&&q||Nt(q)&&Object.values(q).every(B=>!!B))&&(await s([c],[l.receiver],k),P.anchorEl||(await he(.5),f()))}catch(q){G.error(q.message)}},U=a=>{g(l=>({...l,dateRange:a,page:1}))},V=(a,l,c,y)=>{a.stopPropagation();const k=c.filter(H=>H!==l);g(H=>({...H,[y]:k,page:1}))},se=ee(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:l,receiver:c}=E[a];return l?e.jsxs(w,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(pe,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[1].options.filterList,"walletSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:l,index:c,column:y,filterValues:K})},customBodyRenderLite:a=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"wallet",onResend:k=>R(k,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"pushkit",onResend:k=>R(k,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[2].options.filterList,"pushKitSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:l,index:c,column:y,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"email",onResend:k=>R(k,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[3].options.filterList,"emailSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Email",filterList:a,onChange:l,index:c,column:y,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:l}=E[a];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[y,k]=c,H=k[0];return e.jsx(w,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(w,{className:"webhook-item",fontSize:12,children:[e.jsx(pe,{maxLength:30,children:y},y),e.jsx(re,{status:H.status,updatedAt:H.sendAt,reason:H.failedReason,channel:"webhook",onResend:q=>R(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:l}=E[a];return e.jsx(Be,{value:l,locale:i,shouldUpdate:!0})}}}],[E,i,m,o]),Ye=[e.jsx($e,{value:m.dateRange,onChange:U},"date-picker"),e.jsx(Ee,{variant:"contained",size:"small",color:"primary",loading:C,startIcon:e.jsx(ut,{}),onClick:()=>J(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(w,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(cs,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:i,loading:C,columns:se,data:E,onChange:Ce,options:M,customButtons:Ye,components:{TableFilterList:a=>e.jsx(Ue,{...a,itemComponent:l=>e.jsx(ye,{...l,canDelete:()=>!1})})}}),A.anchorEl&&e.jsx(De,{open:!!A.anchorEl,anchorReference:"anchorPosition",anchorPosition:A.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ds,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(w,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:me(I==null?void 0:I.channel).map(a=>{var k,H;const{type:l,pass:c,fail:y}=a;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[l]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(H=I==null?void 0:I.result)!=null&&H[l]?xe.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:xe.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Y,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:xe.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:y})]},l)})})]})}),P.anchorEl&&e.jsx(De,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:v})})]})})})}const ls=j.memo(gt),cs=oe.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -92,7 +92,7 @@ import{r as j}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Pe,R a
|
|
|
92
92
|
overflow: hidden;
|
|
93
93
|
text-overflow: ellipsis;
|
|
94
94
|
}
|
|
95
|
-
`;function ue({blocklet:t,label:s}){var n;return e.jsx(gs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ge.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ge.defaultProps={onDelete:()=>{}};function Ge({list:t,label:s,onDelete:n}){return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Y,{children:[s,": "]}),t.map(o=>e.jsx(Fe,{size:"small",label:e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(fe,{severity:o})}),onDelete:i=>n(i,o)},o))]})}function xs(t){return e.jsx(
|
|
95
|
+
`;function ue({blocklet:t,label:s}){var n;return e.jsx(gs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ge.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ge.defaultProps={onDelete:()=>{}};function Ge({list:t,label:s,onDelete:n}){return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Y,{children:[s,": "]}),t.map(o=>e.jsx(Fe,{size:"small",label:e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(fe,{severity:o})}),onDelete:i=>n(i,o)},o))]})}function xs(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(fe,{severity:s})})}function bs({customTableButtons:t}){var me;const{t:s,locale:n}=X(),[o,i]=j.useState(!1),{data:r,paging:x,blocklet:u,fetch:b,getComponent:S,componentDids:C,inService:N,teamDid:E}=We(),z=j.useRef(null),[A,P]=j.useState(null),[I,W]=j.useState("info"),D=`notification-records-${(me=u.meta)==null?void 0:me.did}`,O=Dt(D),[m,g]=j.useState({pageSize:O.rowsPerPage||10,page:O.page?O.page+1:1,dids:O.dids||[],dateRange:O.dateRange||[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),L=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var v;const h=p.did||((v=p.meta)==null?void 0:v.did);C.includes(h)&&(p.ancestors=[u],f.push(p))}),f},[C,u]),Q=j.useCallback(async()=>{try{i(!0),await b(m),i(!1)}finally{i(!1)}},[b,m]);j.useEffect(()=>{Q()},[]),j.useEffect(()=>{const f=setInterval(()=>{document.visibilityState==="visible"&&b(m).then(p=>{const h=p.find(v=>v.id===(A==null?void 0:A.id));A&&h&&P({...h})})},3e3);return()=>clearInterval(f)},[m,A]);const K=(f,p,h,v)=>{f.stopPropagation();const T=h.filter(R=>R!==p);g(R=>({...R,[v]:T,page:1}))},J=({page:f,rowsPerPage:p,filterList:h})=>{const[v=[],,,,T=[]]=h;m.pageSize!==p?g(R=>({...R,pageSize:p,page:1})):m.page!==f+1?g(R=>({...R,page:f+1})):le(m.dids,v)?le(m.severities,T)||g(R=>({...R,severities:T,page:1})):g(R=>({...R,dids:v,page:1}))},_=j.useCallback(()=>{P(null),W("info")},[]),Z=j.useCallback(()=>{b(m)},[b,m]),M=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,h)=>{var T;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${h}`);const v=L.find(R=>{var V;return(R.did||((V=R.meta)==null?void 0:V.did))===p});return e.jsx(ue,{blocklet:v,label:(v==null?void 0:v.title)||((T=v==null?void 0:v.meta)==null?void 0:T.title)},p)}),update:(f,p,h)=>(f[h].splice(p,1),f)},filterOptions:{names:L,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,h,v)=>e.jsxs(ke,{style:{width:"380px"},children:[e.jsx(yt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[h],renderValue:T=>e.jsx(w,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(R=>{var V;if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const U=L.find(se=>{var a;return(se.did||((a=se.meta)==null?void 0:a.did))===R});return e.jsx(ue,{blocklet:U,label:(U==null?void 0:U.title)||((V=U==null?void 0:U.meta)==null?void 0:V.title)},R)})}),onChange:T=>{f[h]=T.target.value,p(f[h],h,v)},children:[e.jsx(Je,{value:"system",children:s("notification.system")}),L.map(T=>{var U,V;const R=T.did||((U=T.meta)==null?void 0:U.did);return e.jsx(Je,{value:R,children:e.jsx(ue,{blocklet:T,label:T.title||((V=T.meta)==null?void 0:V.title)})},R)})]})]})},customBodyRenderLite:f=>{var v,T;const p=r[f],h=S(p.componentDid);return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[h?e.jsx(rt,{size:32,blocklet:h,ancestors:h.ancestors??[]}):e.jsx(Wt,{blocklet:u,size:32}),e.jsx(pe,{maxLength:50,children:((v=h==null?void 0:h.meta)==null?void 0:v.title)||((T=u==null?void 0:u.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const p=r[f],{receivers:h}=p;return e.jsx(Ct,{total:h.length,renderSurplus:v=>v<100?e.jsxs("span",{children:["+",v]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:v=>{v.stopPropagation(),P(p),W("receivers")},children:h.map(v=>{const{receiverUser:T}=v,R=ot(T.avatar,E,N);return e.jsx(nt,{alt:T.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:v.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},v.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=r[f];return e.jsx(w,{onClick:h=>{h.stopPropagation(),P(p),W("statistics")},children:e.jsx(Se,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=r[f];return e.jsx(pe,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=r[f];return e.jsx(fe,{severity:p.severity})},filter:!0,filterType:"custom",filterList:m.severities??[],customFilterListOptions:{render:f=>e.jsx(Ge,{list:f,label:s("notification.severity"),onDelete:(p,h)=>{p.stopPropagation(),K(p,h,M[4].options.filterList,"severities")}}),update:be},filterOptions:{names:Ze,fullWidth:!0,logic:ve,display:(f,p,h,v)=>e.jsx(xs,{label:s("notification.severity"),filterList:f,onChange:p,index:h,column:v,filterValues:Ze})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=r[f];return e.jsx(Be,{value:p,locale:n,shouldUpdate:!0})}}}],Ce=f=>{g(p=>({...p,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(w,{ref:z,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(vs,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-data",verticalKeyWidth:100,loading:o,locale:n,columns:M,data:r,durable:D,onChange:J,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...O,onRowClick:(f,{dataIndex:p})=>{P(r[p])}},customPreButtons:[e.jsx($e,{value:m.dateRange,onChange:Ce})],customButtons:Ne,components:{TableFilterList:f=>e.jsx(Ue,{...f,itemComponent:p=>e.jsx(ye,{...p,canDelete:h=>{var T;const v=(T=h==null?void 0:h.columnNames)==null?void 0:T[(h==null?void 0:h.index)||0];return(v==null?void 0:v.name)==="sender"}})})}})})}),A&&e.jsx(ms,{refresh:Z,onCancel:_,notification:A,blocklet:u,tab:I})]})}const vs=oe.div`
|
|
96
96
|
td.MuiTableCell-footer {
|
|
97
97
|
border: none !important;
|
|
98
98
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as n,a4 as g,b2 as
|
|
1
|
+
import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as n,a4 as g,b2 as A,M as G,I as O,a3 as H,bY as U,aa as Z}from"./vendor-mui-core-C-PhacC8.js";import{aZ as J,aI as Q,d as v}from"./vendor-ux-did-connect-BihFfRkM.js";import{d as ee}from"./Done-Bu72PctM.js";import{C as te}from"./Google-BxEqzKy9.js";import{aa as ne,f as re}from"./index-B807M2aG.js";import{R as oe,F as se,L as ie}from"./logo-uploader-Bzv9V3Oi.js";const S={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function _({editing:r,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return r&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[r]);const k=s=>{p.current=s,a(s)},b=()=>{u(!1),a(p.current)},C=n.jsx(g,{className:"form-item-input slot",px:1,children:n.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&n.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=n.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:b,children:[n.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:n.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),n.jsx(A,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n.jsx(te,{color:o,onChange:s=>k(s.hex)})})]});return r?f:C}_.propTypes=S;function D({editing:r,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,k=d.useRef(a),{t:b}=d.useContext(J),C=s=>{s.key==="Enter"&&c(k.current,"confirm")},f=s=>{k.current=s,c(s)};return r?n.jsx(G,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:C,...m}):n.jsx(g,{px:1,className:"form-item-input slot",children:a||n.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:o||p})})})}D.propTypes=S;D.defaultProps={componentProps:{}};function T({editing:r,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?Q.getPassportColorFromDid(m.appDid):o;return n.jsxs(g,{display:"flex",alignItems:"center",children:[n.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:ne({title:"Owner",issuer:re.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),n.jsx(_,{...u,editing:r,value:r?p:o,onChange:a,componentProps:c})]})}T.propTypes={...S,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};T.defaultProps={};const ae=U`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -8,4 +8,4 @@ import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as n,a4 as g,b2 a
|
|
|
8
8
|
25%, 75% {
|
|
9
9
|
transform: scale(1.1) translateX(3px);
|
|
10
10
|
}
|
|
11
|
-
`,le={input:D,color:_,passport:T,uploader:r=>n.jsx(ie,{...r.componentProps})};function ce(r,{editing:o=!1}){const{componentType:a="input",render:c,renderFormItem:u}=r;return o&&u?u:!o&&c?c:le[a==null?void 0:a.toLowerCase()]}function z({schema:r,loading:o,value:a,defaultValue:c,onChange:u,style:m,disabled:p}){const
|
|
11
|
+
`,le={input:D,color:_,passport:T,uploader:r=>n.jsx(ie,{...r.componentProps})};function ce(r,{editing:o=!1}){const{componentType:a="input",render:c,renderFormItem:u}=r;return o&&u?u:!o&&c?c:le[a==null?void 0:a.toLowerCase()]}function z({schema:r,loading:o,value:a,defaultValue:c,onChange:u,style:m,disabled:p}){const k=Object.prototype.toString.call(a)==="[object Object]",[b,C]=d.useState([]),[f,s]=d.useState(k?a:c),V=d.useMemo(()=>r.length===1,[r]),h=d.useCallback(e=>b.find(t=>t.key===e),[b]);d.useEffect(()=>{var e;V&&((e=r[0])!=null&&e.required)&&C([{key:r[0].key,editing:!0,initialValue:c[r[0].key]}])},[r,V,c]);const I=d.useCallback(e=>{C(t=>t.find(i=>i.key===e.key)?t.map(i=>i.key===e.key?e:{...i}):[e].concat(t))},[]),P=d.useCallback((e,t,x)=>{const{key:i,secure:w}=e,y=h(i)??{...e};y.editing=!0;const R=f[i]!==t;y.edited=t&&y.initialValue!==t,y.initialValue=c[i];const j={...f,[i]:t};R&&s(j),u({[i]:t},{allValues:j,action:x,currentItem:e}),x==="confirm"&&w&&s({...f,[i]:"__encrypted__"}),x==="confirm"&&(y.initialValue=f[i]),["confirm","cancel"].includes(x)&&(y.editing=!1,y.edited=!1),I(y)},[c,f,u,I,h]);function K(e,{editing:t=!1}){const{key:x}=e,i=k?a[x]:f[x];return i==="__encrypted__"?t?"":"******":i}const F=d.useCallback(e=>{const t=h(e.key);t&&P(e,t.initialValue,"cancel")},[h,P]),q=d.useCallback(e=>{const t=h(e.key);!t||!t.edited||(t.shaking=!0,I(t),setTimeout(()=>{t.shaking=!1,I(t)},500))},[h,I]),B=d.useCallback(e=>{const t=h(e.key);!t||!t.edited?F(e):q(e)},[h,q,F]);return n.jsx(de,{className:"form",style:m,children:r==null?void 0:r.map(e=>{const{key:t,description:x,required:i,solo:w=!1,hidden:y=!1,componentProps:L={},skipButtonDisabled:R=!1}=e;if(y)return null;const j=h(t),{editing:E,shaking:M}=j??{},N=K(e,{editing:E}),W=ce(e,{editing:E}),X={inputProps:{"data-cy":"schema-form-item-component"},key:t,description:x,editing:E,value:N,onChange:(Y,$="change")=>P(e,Y,$),componentProps:L,skipButtonDisabled:R,onBlur:()=>B(e)};return n.jsxs(g,{className:"form-item",children:[!w&&n.jsxs(g,{className:"form-item-label",style:{color:i&&!N?"#ff0000":"#333"},children:[x,i&&n.jsx(oe,{})]}),n.jsxs(g,{className:"form-item-body",children:[n.jsx(g,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:w?"center":"left"},style:{cursor:"text"},onClick:()=>{p||j!=null&&j.edited||R||P(e,f[t],"edit")},children:n.jsx(W,{...X})}),!w&&n.jsx(g,{className:"form-item-action",style:{marginLeft:0},children:E?n.jsxs(n.Fragment,{children:[j.edited?n.jsx(O,{"data-cy":"schema-form-item-confirm",onClick:()=>{P(e,N,"confirm")},disabled:p||o,sx:{animation:M?`${ae} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:o?n.jsx(H,{size:24}):n.jsx(ee,{})}):null,n.jsx(O,{"data-cy":"schema-form-item-cancel",onClick:()=>F(e),style:{paddingLeft:j.edited?4:8},disabled:p||o,size:"large",children:n.jsx(v,{})})]}):null})]})]},t)})})}z.propTypes={schema:l.array.isRequired,loading:l.bool,onChange:l.func.isRequired,value:l.object,defaultValue:l.object,style:l.object,disabled:l.bool};z.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const de=Z(se)``;export{z as S};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as e,E as f,aa as Xe,T as B,a3 as F,s as De,a5 as Te,cq as ne,a6 as oe,cr as We,ai as qe,a4 as x,ae as K,cs as we,a2 as ge,ak as H,b3 as V,b4 as G,x as _e,aj as $e,bf as Y}from"./vendor-mui-core-BL-xsBvI.js";import{m as et,i as Oe,f as pe}from"./vendor-hooks-DnflU2EL.js";import{r as g,f as tt}from"./vendor-react-DoD83n6N.js";import{D as P,A as J,v as E,h as N,a0 as st,ac as nt,aw as ot}from"./index-BWpwjp4L.js";import{W as b,u as T,bj as at,m as U,bn as X,a3 as rt,r as xe,bI as it,B as le,aI as ct,C as Ue,aM as lt}from"./vendor-ux-did-connect-CWUKGZcn.js";import{u as dt}from"./use-mobile-DVecy9Ks.js";import{z as W,d as Le,aC as ut,G as pt,D as Me,y as me}from"./vendor-utils-Cs6ARqvU.js";import{v as mt,O as ht,C as ft,P as gt,j as xt,Q as de,t as St}from"./vendor-arcblock-B7hyNlnQ.js";import"./api-DeTTY4rz.js";import{u as Fe,C as jt,D as yt,a as At}from"./connect-to-LVtY3yeI.js";import{g as Ct,a as Bt,b as bt,i as It,c as he,d as vt,e as Et,h as kt,C as Rt,u as Dt}from"./config-space-D3pvjnQx.js";import{f as q}from"./format-error-LAoTjvJe.js";import{I as Tt}from"./index-VUi6PKrJ.js";import{R as wt}from"./index-Da6LyIoG.js";import{d as Ot}from"./MoreHoriz-Ecf_Y2c5.js";import{c as Ut}from"./dashboard-BuFzcMGR.js";import{d as Lt}from"./DeleteOutline-qIhkqz9A.js";import{g as Re}from"./get-safe-url-CA3J0_99.js";import{S as Mt}from"./switch-control-DZceCxwF.js";import{L as fe}from"./list-header-Cip98Afo.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BQFZ73WZ.js";import"./confirm-BzL9LNyf.js";import"./PlayArrow-C5Hul3eK.js";import"./index-ItdGu4Wh.js";import"./session-BXc0WNE7.js";import"./useAsyncRetry-C-QH3IsB.js";import"./useAsync-Bia14KO2.js";import"./InfoOutlined-CLOzYFOV.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-DNsgYi-4.js";async function Ft({blockletDid:t,nodeApi:s,spaceGateways:o}){let n=!1;const r=await Promise.all(o.map(async a=>{let{name:i}=a;const h=await Ct(a.endpoint);return!W(h)&&h!==i&&(i=h,n=!0),{...a,name:i}}));return n&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Pt({refresh:t}={}){var r;const{blocklet:s}=P(),o=(r=s==null?void 0:s.meta)==null?void 0:r.did,{api:n}=J();return et(async()=>{if(!o)return[];const{spaceGateways:a}=await n.getBlockletSpaceGateways({input:{did:o}});return await Ft({blockletDid:o,nodeApi:n,spaceGateways:a})??[]},{refreshDeps:[o,t],onError(a){var i;(i=a==null?void 0:a.message)!=null&&i.includes("not logged")?console.warn(a):(console.error(a),b.error(q(a)))}})}function Pe({deps:t,setLoading:s,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){var j;const{blocklet:n}=P(),[r,a]=g.useState([]),{api:i}=J(),[h,u]=g.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("month").toISOString(),E().endOf("day").toISOString()],[o]),m=Le(async()=>{try{if(s(!0),!n){a([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:n.meta.did,startTime:h,endTime:u}});a(p??[])}catch(p){console.error(p),b.error(q(p))}finally{s(!1)}},1e3);return Oe(async()=>{m()},[(j=n==null?void 0:n.meta)==null?void 0:j.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:s}=Pe(),[o,n]=g.useState({message:"",progress:0,completed:!1}),r=J(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&n(()=>({...i}))},[t]),g.useEffect(()=>{var i;if(s!=null&&s.length&&ut((i=s[0])==null?void 0:i.status)){const[h]=s;n(()=>({message:h.message,progress:h.progress,completed:h.progress>=100}))}},[s]),o}function Nt({deps:t=[],setLoading:s=()=>{}}={}){var h;const{blocklet:o}=P(),[n,r]=g.useState([]),{api:a}=J(),i=g.useCallback(Le(async()=>{var u;if(!a||!((u=o==null?void 0:o.meta)!=null&&u.did)){r([]);return}try{s(!0);const m=E(),j=m.subtract(1,"year"),{summary:p}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:j.toISOString(),endTime:m.toISOString()}});r(Array.isArray(p)?p:[])}catch(m){console.error("Failed to fetch backup summary:",m),b.error(q(m)),r([])}finally{s(!1)}},1e3),[]);return Oe(async()=>(await i(),()=>{i.cancel()}),[(h=o==null?void 0:o.meta)==null?void 0:h.did].concat(t)),{backupSummary:n}}const ze=g.createContext({}),{Provider:Jt,Consumer:Ls}=ze;function Se({children:t}){var ee;const{t:s}=T(),{api:o}=J(),{blocklet:n}=P(),[r,a]=g.useState(),[i,h]=g.useState(!1),{data:u,loading:m,mutate:j}=Pt({refresh:i}),p=pt(u),S=zt({appDid:n==null?void 0:n.appDid}),A=g.useMemo(()=>Bt(n==null?void 0:n.environments),[n==null?void 0:n.environments]),[R,k]=g.useState(!1),{backups:l}=Pe({deps:[S,r],setLoading:k,backupDate:r}),[c,D]=g.useState(!1),{backupSummary:w}=Nt({deps:[c]}),[y,I]=g.useState(u==null?void 0:u.find(d=>d.endpoint===A)),v=(ee=n==null?void 0:n.settings)==null?void 0:ee.autoBackup,C=()=>{h(d=>!d)},O=()=>{D(d=>!d)},M=async d=>{await o.updateAutoBackup({input:{did:n.meta.did,autoBackup:d}})},re=async()=>{await o.abortBlockletBackup({input:{appPid:n.meta.did}})},_=async(d,z)=>{j(L=>{const te=[...L];return te.push({...d,loading:!0}),te}),await Promise.all([o.addBlockletSpaceGateway({input:{did:n.meta.did,spaceGateway:d}}),A!==z&&o.configBlocklet({input:{did:[n.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:z}]}})]),I(d),C()},$=async d=>{d&&(d.endpoint===A&&(await o.configBlocklet({input:{did:[n.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),v!=null&&v.enabled&&await M({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:n.meta.did,spaceGatewayDid:d==null?void 0:d.did}}),j(z=>{const L=[...z];return L.splice(L.indexOf(d),1),L}),I(d),C())},ie=async d=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:n.meta.did,where:{did:d.did},spaceGateway:d}}),A!==d.endpoint&&o.configBlocklet({input:{did:[n.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:d.endpoint}]}})]),b.success(s("storage.spaces.connectedWithName",{name:(d==null?void 0:d.name)??"DID Spaces"})),C()},ce=d=>(d==null?void 0:d.endpoint)===A;return e.jsx(Jt,{value:{spaceGateways:u||[],selectedSpaceGateway:y,addSpaceGateway:_,deleteSpaceGateway:$,updateSpaceGateway:ie,refreshSpaceGateways:C,spaceGatewaysLoading:m,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:ce,updateAutoBackup:M,abortBlockletBackup:re,backupEndpoint:A,backupProgress:S,backups:l,backupSummary:w,refreshBackupSummary:O,setBackupDate:a,backupsLoading:R,autoBackup:v},children:t})}Se.propTypes={children:f.any.isRequired};Se.defaultProps={};function Q(){return g.useContext(ze)}function ae({...t}){const{blocklet:s}=P(),{info:o}=J(),{t:n}=T(),r=Fe({blocklet:s}),a=st(o),{spaceGateways:i,addSpaceGateway:h}=Q(),u={checkFn:Me.create({baseURL:me(window.location.origin,nt())}).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:o.did}},m=async({endpoint:p,name:S,did:A})=>{const R=await bt(p);if(!await It(R)){b.error(n("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(c=>c.endpoint===p)){b.error(n("storage.spaces.gateway.add.duplicate",{name:S}));return}const l={name:S,did:A,url:R,endpoint:p};await h(l,p),b.success(n("storage.spaces.connectedWithName",{name:(l==null?void 0:l.name)??"DID Spaces"}))},j=async({spaceGateway:p})=>{try{await m(p)}catch(S){console.error(S),b.error(q(S))}};return e.jsx(mt,{...t,options:u,onSuccess:j})}ae.propTypes={};ae.defaultProps={};function Ne({...t}){const{t:s}=g.useContext(at),{blocklet:o,loadingDiskInfo:n,actions:r}=P();if(g.useEffect(()=>{r==null||r.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),o.diskInfo){const a=(u,m,j)=>e.jsxs(B,{children:[u," ",e.jsx("strong",{children:m?ot(m):"empty"})]}),i=o.environments.reduce((u,m)=>(u[m.key]=m.value,u),{}),h=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:a(i.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:a(i.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:a(i.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:a(i.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:h.map(u=>e.jsx(Tt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return n?e.jsx(F,{}):e.jsx(B,{children:s("blocklet.diskInfo.empty")})}const Qt=Xe(B)``,Zt=De(({className:t,...s})=>e.jsx(Te,{...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 je({status:t,message:s,createdAt:o}){const{t:n}=T(),r=t===U.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=U.BACKUPS.TIMEOUT_HOURS,a=r&&n("common.timeoutError"),i=t===U.BACKUPS.STATUS.PROGRESS&&!r,h=t===U.BACKUPS.STATUS.SUCCEEDED&&!r;return i?e.jsxs(B,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(F,{sx:{marginRight:"4px"},size:"12px"}),n("common.progress")]}):h?e.jsx(X,{type:"success",children:n("common.succeeded")}):e.jsxs(x,{display:"inline-flex",alignItems:"center",children:[e.jsx(X,{type:"error",children:n("common.failed")})," ",e.jsx(Te,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(we,{children:e.jsx(ft,{style:{width:"24px",height:"24px"},color:"error"})})})]})}je.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};je.defaultProps={message:""};function ye({metadata:t}){const{t:s}=T();if(W(t))return e.jsx(X,{type:"success",children:s("common.succeeded")});const o=t.count||0,n=t.size||0,r=gt(n,{iec:!0}),a=e.jsxs(x,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(B,{variant:"body2",children:[s("common.fileCount"),": ",o]}),e.jsxs(B,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(x,{display:"inline-flex",alignItems:"center",children:[e.jsx(X,{type:"success",children:s("common.succeeded")})," ",e.jsx(Zt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(we,{children:e.jsx(xt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ye.propTypes={metadata:f.object};ye.defaultProps={metadata:{}};function Ae({...t}){const{t:s,locale:o}=T(),{spaceGateways:n,backups:r,setBackupDate:a,backupsLoading:i,backupSummary:h}=Q(),u=ht({key:"lg"}),m=g.useRef(null),j=g.useCallback(l=>{a(l)},[a]),p=g.useMemo(()=>{const l=E().subtract(1,"year"),c=E().add(1,"day"),D=new Map(h.map(y=>[y.date,{date:y.date,successCount:y.successCount,errorCount:y.errorCount}])),w=[];for(let y=l.clone();E(y).isBefore(c);y=y.add(1,"day")){const I=y.format("YYYY-MM-DD");w.push(D.get(I)||{date:I,successCount:0,errorCount:0})}return w},[h]),S=g.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:10},tooltip:{formatter:y=>{const{date:I,successCount:v,errorCount:C}=p[y.dataIndex]||{date:y.data[0],successCount:0,errorCount:0};return[`<div>${s("common.time")}: ${I}</div>`,`<div>${s("common.succeeded")}: ${v}</div>`,`<div>${s("common.failed")}: ${C}</div>`].join(`
|
|
2
|
-
`)},borderWidth:0,padding:[8,10],textStyle:{fontSize:14},extraCssText:"border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);"},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:ne[600]},{min:-9,max:-6,color:ne[500]},{min:-6,max:-3,color:ne[400]},{min:-3,max:-1,color:ne[300]},{min:0,max:0,color:"#ecedf0"},{min:1,max:3,color:oe[300]},{min:3,max:6,color:oe[400]},{min:6,max:9,color:oe[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:oe[600]}],orient:"horizontal",left:"center",bottom:10,itemWidth:12,itemHeight:12,textStyle:{color:"#666",fontSize:12}},calendar:{top:30,left:40,right:5,bottom:20,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:4,borderColor:"#fff",borderRadius:0,color:"#fff"},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:12,fontSize:14,color:"rgb(31, 35, 40)",fontWeight:"400"},monthLabel:{show:!0,nameMap:"cn",align:"left",color:"rgb(31, 35, 40)",fontWeight:"400",fontSize:16,position:"start"},yearLabel:{show:!1},range:[E().subtract(1,"year").format("YYYY-MM-DD"),E().format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:p.map(y=>[y.date,y.errorCount?-y.errorCount:y.successCount]),label:{show:!1},itemStyle:{borderWidth:1.5,borderColor:"#fff",borderRadius:5,color:"#ecedf0"},emphasis:{itemStyle:{borderWidth:2.5,borderColor:We[200],color:"inherit"}}}}),[p,s]);g.useEffect(()=>{m.current&&u&&setTimeout(()=>{m.current.scrollLeft=m.current.scrollWidth},100)},[u,p]);const A=g.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:l=>{var O;const{targetUrl:c,targetName:D,status:w,createdAt:y}=r[l],I=w===U.BACKUPS.STATUS.PROGRESS&&E().diff(y,"hours")>=U.BACKUPS.TIMEOUT_HOURS,v=w===U.BACKUPS.STATUS.SUCCEEDED&&!I,C=D||((O=n.find(M=>c==null?void 0:c.includes(he(M==null?void 0:M.endpoint))))==null?void 0:O.name)||"Unknown DID Space";return v?e.jsx(qe,{fontSize:"16px",href:c,target:"_blank",children:C}):e.jsx(B,{variant:"body1",fontSize:"16px",children:C})}}},{label:s("common.strategy"),name:"strategy",options:{customBodyRender:l=>{const c=s(l===0?"common.auto":"common.manual");return e.jsx(X,{children:c})}}},{label:s("common.startTime"),name:"createdAt",options:{customBodyRender:l=>E(l).format("YYYY-MM-DD HH:mm:ss")}},{label:s("common.endTime"),name:"updatedAt",options:{customBodyRender:l=>W(l)?"":E(l).format("YYYY-MM-DD HH:mm:ss")}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:l=>{const c=(r==null?void 0:r[l])??{},{status:D,message:w,createdAt:y,metadata:I}=c,v=D===U.BACKUPS.STATUS.PROGRESS&&E().diff(y,"hours")>=U.BACKUPS.TIMEOUT_HOURS,C=D===U.BACKUPS.STATUS.PROGRESS&&!v,O=D===U.BACKUPS.STATUS.SUCCEEDED&&!v;return C?e.jsxs(B,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(F,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):O?e.jsx(ye,{metadata:I}):e.jsx(je,{status:D,message:w,createdAt:y})}}}],[r,n,s]),R=g.useMemo(()=>p&&p.length>0,[p]),k=g.useMemo(()=>!(r!=null&&r.length),[r]);return e.jsxs(x,{...t,children:[e.jsx(x,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),R&&e.jsxs(e.Fragment,{children:[e.jsx(x,{ref:m,sx:{overflowX:u?"visible":"hidden",overflowY:"hidden"},children:e.jsx(x,{sx:{minWidth:u?"1600px":"100%",height:"240px"},children:e.jsx(wt,{option:S,style:{height:"100%",width:"100%",padding:"8px"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&j(l.data[0])}}})})}),e.jsx(x,{display:"flex",justifyContent:"flex-end",mr:u?2:5,mb:2,mt:.5,children:e.jsxs(K,{direction:u?"column":"row",spacing:u?2:1,alignItems:"flex-end",width:"100%",justifyContent:u?"flex-start":"flex-end",children:[e.jsxs(K,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(B,{variant:"body2",color:"text.secondary",children:[s("storage.spaces.backup.failed"),":"]}),e.jsx(x,{width:12,height:12,bgcolor:"#8B5000",borderRadius:.5}),e.jsx(x,{width:12,height:12,bgcolor:"#A36200",borderRadius:.5}),e.jsx(x,{width:12,height:12,bgcolor:"#C17700",borderRadius:.5}),e.jsx(x,{width:12,height:12,bgcolor:"#E29000",borderRadius:.5})]}),e.jsxs(K,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(B,{variant:"body2",color:"text.secondary",children:[s("storage.spaces.backup.without"),":"]}),e.jsx(x,{width:12,height:12,bgcolor:"#ecedf0",borderRadius:.5,border:"1px solid #e0e1e4"})]}),e.jsxs(K,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(B,{variant:"body2",color:"text.secondary",children:[s("storage.spaces.backup.succeeded"),":"]}),e.jsx(x,{width:12,height:12,bgcolor:"#9be9a8",borderRadius:.5}),e.jsx(x,{width:12,height:12,bgcolor:"#40c463",borderRadius:.5}),e.jsx(x,{width:12,height:12,bgcolor:"#30a14e",borderRadius:.5}),e.jsx(x,{width:12,height:12,bgcolor:"#216e39",borderRadius:.5})]})]})})]}),k?e.jsx(x,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:s("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:i,data:r,columns:A,emptyNode:s("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1}})]})}Ae.propTypes={};var Je=function(s){return e.jsxs("svg",{...s,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3s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t89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};Je.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Qe(){const{t}=T();return e.jsxs(x,{children:[e.jsxs(x,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(Je,{style:{width:250,height:250}}),e.jsx(B,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.provider")}),e.jsx(ae,{})]}),e.jsx(Ae,{sx:{marginTop:"24px"}}),e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ne,{})]})}Qe.propTypes={};var Ce={},Kt=ge;Object.defineProperty(Ce,"__esModule",{value:!0});var Ze=Ce.default=void 0,Ht=Kt(xe()),Vt=e;Ze=Ce.default=(0,Ht.default)((0,Vt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Be={},Gt=ge;Object.defineProperty(Be,"__esModule",{value:!0});var Ke=Be.default=void 0,Yt=Gt(xe()),Xt=e;Ke=Be.default=(0,Yt.default)((0,Xt.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"}),"ElectricBoltOutlined");var be={},Wt=ge;Object.defineProperty(be,"__esModule",{value:!0});var He=be.default=void 0,qt=Wt(xe()),_t=e;He=be.default=(0,qt.default)((0,_t.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"}),"FolderOutlined");function Ie({spaceGateway:t,onConfirm:s,onCancel:o}){const{t:n}=T(),[r,a]=g.useState(!1),[i,h]=g.useState(!1),u=(p,S)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),a(S)},m=async p=>{try{p==null||p.stopPropagation(),h(!0),await(s==null?void 0:s(t)),a(!1)}catch(S){console.error(S),b.error(`${n("storage.space.gateway.delete.failed")}: ${q(S)}`)}finally{a(!1),h(!1)}},j=p=>{u(p,!1),o==null||o(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(H,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(V,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(G,{style:{color:"red"},children:n("common.delete")})]}),e.jsx(it,{title:n("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:n("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:n("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:m,onCancel:j,children:e.jsx(B,{sx:{wordWrap:"break-word"},children:n("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Ie.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};Ie.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function ve({spaceGateway:t,selected:s,onDelete:o,onConnect:n,enableSwitchToSpace:r,backupInProgress:a,...i}){const{abortBlockletBackup:h}=Q(),[u,m]=g.useState(null),{t:j}=T(),[p,S]=g.useState(!1),A=(l,c)=>{l.stopPropagation(),l.preventDefault(),m(c&&l.currentTarget)},R=async l=>{try{S(!0),A(l,!1),await n(t)}catch(c){console.error(c),b.error(c.message)}finally{S(!1)}},k=async l=>{try{S(!0),A(l,!1),await h()}catch(c){console.error(c),b.error(c.message)}finally{S(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(F,{sx:{ml:1},size:"24px"}):e.jsx(_e,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:l=>A(l,!0),...i,children:e.jsx(Ot,{})}),e.jsxs($e,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:l=>A(l,!1),children:[e.jsxs(H,{onClick:l=>{A(l,!1),window.open(Re(t.endpoint?vt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ze,{fontSize:"small"})}),e.jsx(G,{children:j("common.open")})]}),e.jsxs(H,{onClick:l=>{A(l,!1),window.open(Re(Et(t.endpoint),{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(G,{children:j("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(H,{onClick:R,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ke,{fontSize:"small"})}),e.jsx(G,{children:j("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(H,{onClick:k,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(G,{children:j("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Ie,{spaceGateway:t,onConfirm:async()=>{m(null),await(o==null?void 0:o(t))},onCancel:()=>m(null)})]})]})}ve.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};ve.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};function Ee({spaceGateway:t,spaceStatus:s,selected:o,onConnected:n,onDeleted:r,onBackedUp:a}){const{t:i,locale:h}=T(),{blocklet:u}=P(),{api:m,info:{did:j}}=J(),{appDid:p,appName:S,appDescription:A,scopes:R,appUrl:k,referrer:l}=Fe({blocklet:u}),{backupProgress:c,updateSpaceGateway:D,deleteSpaceGateway:w,refreshBackupSummary:y}=Q(),[I,v]=g.useState(!1),[C,O]=g.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:S},h),scan:i("storage.spaces.authorize.scan",{appName:S},h),confirm:"",success:e.jsx(B,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{O(d=>({...d,open:!1}))}}),M=o&&!I&&s===de.DISCONNECTED,re=o&&!I&&!t.loading&&s===de.CONNECTED,_=o&&I&&s===de.CONNECTED&&(c==null?void 0:c.progress)>=0,$=async()=>{try{if(await kt(t==null?void 0:t.endpoint)){await m.configBlocklet({input:{did:[u.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),b.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),n==null||n(null,t);return}}catch(d){console.error(d),n==null||n(d,t);return}O(d=>({...d,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Me.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:p,appName:S,appDescription:A,scopes:R,appUrl:k,referrer:l,nodeDid:j,spaceDid:t.did}}))},ie=async(d,z)=>{const L=z(d.endpoint),te=he(L),Z=d.space?z(d.space):{};if(t.did&&te!==t.did){O(Ye=>({...Ye,open:!1}));const se=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:Z!=null&&Z.name?Z.name:""});b.error(se),n==null||n(new Error(se),t);return}const ke={...t,name:Z.name??"DID Space",did:Z.did??he(L),endpoint:L};await D(ke),O(se=>({...se,open:!1})),n==null||n(null,ke)},ce=async()=>{try{if(I)return;v(!0),await m.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(d){console.error(d),b.error(d.message),a==null||a(d,t)}finally{v(!0)}},ee=async()=>{try{await w(t),b.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r==null||r(null,t)}catch(d){console.error(d),r==null||r(d,t)}};return g.useEffect(()=>{c!=null&&c.completed?(o&&((c==null?void 0:c.progress)===100?(b.success(i("storage.spaces.backupSuccessfully")),a==null||a(null,t)):c.message&&(a==null||a(new Error(c==null?void 0:c.message),t)),c.progress=0,c.message=""),v(!1),y()):c.progress&&v(!0)},[c]),e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[re&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:i("storage.spaces.strategy.backupNow")}),M&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:$,children:i("storage.spaces.disconnected.reconnectNow")}),_&&e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(F,{variant:"determinate",value:c==null?void 0:c.progress,size:14,sx:{mr:1}}),c==null?void 0:c.progress,"%"]}),e.jsx(ct,{forceConnected:!1,saveConnect:!1,prefix:C.prefix,open:C.open,popup:!0,action:C.action,baseUrl:C.baseUrl,checkFn:C.checkFn,onSuccess:ie,onClose:C.onClose,checkTimeout:C.checkTimeout,extraParams:C.extraParams,messages:C.messages,locale:h},"get-endpoint")]}),e.jsx(ve,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:ee,onConnect:$,enableSwitchToSpace:(c==null?void 0:c.completed)||W(c==null?void 0:c.message),backupInProgress:_})]})}Ee.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};Ee.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ve({...t}){const{t:s}=T(),{autoBackup:o,updateAutoBackup:n}=Q(),r=async()=>{try{const a=!(o!=null&&o.enabled);await n({enabled:a}),b.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){b.error(a.message)}};return e.jsx(Mt,{checked:!!(o!=null&&o.enabled),onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(B,{marginRight:"8px",children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Ve.propTypes={};function $t(){const{t}=T(),{spaceGateways:s,spaceGatewaysLoading:o,spaceGatewayIsSelected:n}=Q(),r=o&&!(s!=null&&s.length),a=({spaceGateway:i,spaceStatus:h,selected:u,refresh:m})=>e.jsx(Ee,{spaceGateway:i,spaceStatus:h,selected:u,onConnected:()=>m(),onBackedUp:j=>j&&m()});return e.jsxs(x,{display:"flex",flexDirection:"column",children:[e.jsx(fe,{sx:{button:{fontSize:"revert",fontWeight:500}},left:e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Ve,{}),e.jsx(ae,{})]})}),e.jsx(x,{mt:2,children:r?e.jsx(x,{display:"flex",justifyContent:"center",children:e.jsx(F,{})}):e.jsx(Y,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(i=>e.jsx(Y,{item:!0,xs:12,md:6,children:e.jsx(St,{endpoint:i.endpoint,selected:n(i),action:a},i.endpoint)}))})})}),e.jsx(Ae,{sx:{marginTop:"24px"}}),e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ne,{})]})}function es(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=Q();return t?e.jsx(Ue,{relative:"parent",children:e.jsx(F,{})}):W(s)?e.jsx(Qe,{}):e.jsx($t,{})}function ts(){return e.jsx(Se,{children:e.jsx(es,{})})}function ss(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:o,hasStorageEndpoint:n,loading:r,storageEndpoint:a}=Dt(),i=pe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ue,{relative:"parent",children:e.jsx(F,{})}):e.jsxs(x,{sx:{maxWidth:"md",position:"relative"},children:[n?e.jsx(jt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(yt,{}),e.jsx(x,{sx:i,children:e.jsx(At,{onConnect:o,storageEndpoint:a})})]})}function ns(){const{t}=T();return e.jsxs(Rt,{children:[e.jsxs(K,{spacing:1,marginBottom:2,children:[e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(B,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(ss,{})]})}function Ge({navOrientation:t,...s}){const{t:o,locale:n}=T(),{blocklet:r}=P(),a=dt({key:"md"}),[i,h]=tt(),u=i.get("tab")||"backup",m=a?"horizontal":t,j=pe(()=>{var c;const k=[{label:o("common.backup"),value:"backup"}],l=(c=r==null?void 0:r.capabilities)==null?void 0:c.didSpace;return(l===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||l===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&k.push({label:o("common.storage"),value:"storage"}),k},[n,m]),S=pe(()=>({backup:e.jsx(ts,{}),storage:e.jsx(ns,{})}))[u],A=k=>{h(l=>(k==="backup"?l.delete("tab"):l.set("tab",k),l))};if(j.length<=1)return e.jsx(ue,{children:S});const R=e.jsx(lt,{tabs:j,current:u,orientation:m,onChange:A,sx:[{borderRight:1,height:"100%",borderColor:"divider"},m==="horizontal"&&{borderRight:0}]});if(m==="vertical")return e.jsx(x,{...s,children:e.jsxs(Y,{container:!0,columnSpacing:4,columns:24,sx:{mt:-1},children:[e.jsx(Y,{item:!0,md:5,lg:4,children:e.jsx(fe,{left:R})}),e.jsx(Y,{item:!0,md:19,lg:20,children:e.jsx(ue,{sx:{mt:1},children:S})})]})});if(m==="horizontal")return e.jsxs(x,{...s,children:[e.jsx(fe,{left:R}),e.jsx(ue,{sx:{mt:2},children:S})]})}Ge.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};Ge.defaultProps={navOrientation:"vertical"};const ue=De(x)`
|
|
1
|
+
import{j as e,E as f,aa as Xe,T as B,a3 as F,s as De,a5 as Te,cs as se,a6 as ne,ct as We,ai as qe,a4 as g,ae as K,cu as we,a2 as fe,ak as H,b3 as V,b4 as G,x as _e,aj as $e,bf as ke}from"./vendor-mui-core-C-PhacC8.js";import{m as et,i as Oe,f as pe}from"./vendor-hooks-DtYI0-rF.js";import{r as x,f as tt}from"./vendor-react-DoD83n6N.js";import{D as P,A as J,v as E,h as N,a0 as st,ac as nt,aw as ot}from"./index-B807M2aG.js";import{V as b,u as T,aZ as at,m as U,b1 as Y,a2 as rt,r as ge,bl as it,B as ce,al as ct,C as Ue,ap as lt}from"./vendor-ux-did-connect-BihFfRkM.js";import{u as dt}from"./use-mobile-B_Gqv6b6.js";import{z as X,d as Le,aC as pt,G as ut,D as Me,y as ue}from"./vendor-utils-CRBr0QUY.js";import{w as mt,P as ht,F as ft,Q as gt,k as xt,T as le,v as St}from"./vendor-arcblock-DV12D9BN.js";import"./api-DlN8K5Jg.js";import{u as Fe,C as jt,D as yt,a as At}from"./connect-to-CjH0XryZ.js";import{b as Ct,c as Bt,d as bt,i as It,e as me,f as vt,h as Et,j as kt}from"./spaces-CJLlwQgN.js";import{f as W}from"./format-error-LAoTjvJe.js";import{I as Rt}from"./index-nHbtopN7.js";import{R as Dt}from"./index-C-E-0SKx.js";import{d as Tt}from"./MoreHoriz-CiMTPRBH.js";import{c as wt}from"./dashboard-BHZa3hQc.js";import{d as Ot}from"./DeleteOutline-DVPNhMfh.js";import{g as Re}from"./get-safe-url-DBsoYX8R.js";import{S as Ut}from"./switch-control-CHr40nyS.js";import{L as he}from"./list-header-DvakxkxK.js";import{C as Lt,u as Mt}from"./config-space-DTf04Wry.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-Bip9kD-Q.js";import"./confirm-CNuH6roP.js";import"./PlayArrow-CTZ2QlWx.js";import"./index-tQVGuuqb.js";import"./session-D21Dok5b.js";import"./useAsyncRetry-CwtLImQi.js";import"./useAsync-BmuLIImU.js";import"./InfoOutlined-Cga_EIiY.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-DudfIz3d.js";async function Ft({blockletDid:t,nodeApi:s,spaceGateways:o}){let n=!1;const r=await Promise.all(o.map(async a=>{let{name:i}=a;const h=await Ct(a.endpoint);return!X(h)&&h!==i&&(i=h,n=!0),{...a,name:i}}));return n&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Pt({refresh:t}={}){var r;const{blocklet:s}=P(),o=(r=s==null?void 0:s.meta)==null?void 0:r.did,{api:n}=J();return et(async()=>{if(!o)return[];const{spaceGateways:a}=await n.getBlockletSpaceGateways({input:{did:o}});return await Ft({blockletDid:o,nodeApi:n,spaceGateways:a})??[]},{refreshDeps:[o,t],onError(a){var i;(i=a==null?void 0:a.message)!=null&&i.includes("not logged")?console.warn(a):(console.error(a),b.error(W(a)))}})}function Pe({deps:t,setLoading:s,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){var j;const{blocklet:n}=P(),[r,a]=x.useState([]),{api:i}=J(),[h,p]=x.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("month").toISOString(),E().endOf("day").toISOString()],[o]),m=Le(async()=>{try{if(s(!0),!n){a([]);return}const{backups:u}=await i.getBlockletBackups({input:{did:n.meta.did,startTime:h,endTime:p}});a(u??[])}catch(u){console.error(u),b.error(W(u))}finally{s(!1)}},1e3);return Oe(async()=>{m()},[(j=n==null?void 0:n.meta)==null?void 0:j.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:s}=Pe(),[o,n]=x.useState({message:"",progress:0,completed:!1}),r=J(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&n(()=>({...i}))},[t]),x.useEffect(()=>{var i;if(s!=null&&s.length&&pt((i=s[0])==null?void 0:i.status)){const[h]=s;n(()=>({message:h.message,progress:h.progress,completed:h.progress>=100}))}},[s]),o}function Nt({deps:t=[],setLoading:s=()=>{}}={}){var h;const{blocklet:o}=P(),[n,r]=x.useState([]),{api:a}=J(),i=x.useCallback(Le(async()=>{var p;if(!a||!((p=o==null?void 0:o.meta)!=null&&p.did)){r([]);return}try{s(!0);const m=E(),j=m.subtract(1,"year"),{summary:u}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:j.toISOString(),endTime:m.toISOString()}});r(Array.isArray(u)?u:[])}catch(m){console.error("Failed to fetch backup summary:",m),b.error(W(m)),r([])}finally{s(!1)}},1e3),[]);return Oe(async()=>(await i(),()=>{i.cancel()}),[(h=o==null?void 0:o.meta)==null?void 0:h.did].concat(t)),{backupSummary:n}}const ze=x.createContext({}),{Provider:Jt,Consumer:Ms}=ze;function xe({children:t}){var $;const{t:s}=T(),{api:o}=J(),{blocklet:n}=P(),[r,a]=x.useState(),[i,h]=x.useState(!1),{data:p,loading:m,mutate:j}=Pt({refresh:i}),u=ut(p),S=zt({appDid:n==null?void 0:n.appDid}),A=x.useMemo(()=>Bt(n==null?void 0:n.environments),[n==null?void 0:n.environments]),[R,k]=x.useState(!1),{backups:l}=Pe({deps:[S,r],setLoading:k,backupDate:r}),[c,D]=x.useState(!1),{backupSummary:w}=Nt({deps:[c]}),[y,I]=x.useState(p==null?void 0:p.find(d=>d.endpoint===A)),v=($=n==null?void 0:n.settings)==null?void 0:$.autoBackup,C=()=>{h(d=>!d)},O=()=>{D(d=>!d)},M=async d=>{await o.updateAutoBackup({input:{did:n.meta.did,autoBackup:d}})},ae=async()=>{await o.abortBlockletBackup({input:{appPid:n.meta.did}})},q=async(d,z)=>{j(L=>{const ee=[...L];return ee.push({...d,loading:!0}),ee}),await Promise.all([o.addBlockletSpaceGateway({input:{did:n.meta.did,spaceGateway:d}}),A!==z&&o.configBlocklet({input:{did:[n.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:z}]}})]),I(d),C()},_=async d=>{d&&(d.endpoint===A&&(await o.configBlocklet({input:{did:[n.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),v!=null&&v.enabled&&await M({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:n.meta.did,spaceGatewayDid:d==null?void 0:d.did}}),j(z=>{const L=[...z];return L.splice(L.indexOf(d),1),L}),I(d),C())},re=async d=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:n.meta.did,where:{did:d.did},spaceGateway:d}}),A!==d.endpoint&&o.configBlocklet({input:{did:[n.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:d.endpoint}]}})]),b.success(s("storage.spaces.connectedWithName",{name:(d==null?void 0:d.name)??"DID Spaces"})),C()},ie=d=>(d==null?void 0:d.endpoint)===A;return e.jsx(Jt,{value:{spaceGateways:p||[],selectedSpaceGateway:y,addSpaceGateway:q,deleteSpaceGateway:_,updateSpaceGateway:re,refreshSpaceGateways:C,spaceGatewaysLoading:m,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:ie,updateAutoBackup:M,abortBlockletBackup:ae,backupEndpoint:A,backupProgress:S,backups:l,backupSummary:w,refreshBackupSummary:O,setBackupDate:a,backupsLoading:R,autoBackup:v},children:t})}xe.propTypes={children:f.any.isRequired};xe.defaultProps={};function Q(){return x.useContext(ze)}function oe({...t}){const{blocklet:s}=P(),{info:o}=J(),{t:n}=T(),r=Fe({blocklet:s}),a=st(o),{spaceGateways:i,addSpaceGateway:h}=Q(),p={checkFn:Me.create({baseURL:ue(window.location.origin,nt())}).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:o.did}},m=async({endpoint:u,name:S,did:A})=>{const R=await bt(u);if(!await It(R)){b.error(n("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(c=>c.endpoint===u)){b.error(n("storage.spaces.gateway.add.duplicate",{name:S}));return}const l={name:S,did:A,url:R,endpoint:u};await h(l,u),b.success(n("storage.spaces.connectedWithName",{name:(l==null?void 0:l.name)??"DID Spaces"}))},j=async({spaceGateway:u})=>{try{await m(u)}catch(S){console.error(S),b.error(W(S))}};return e.jsx(mt,{...t,options:p,onSuccess:j})}oe.propTypes={};oe.defaultProps={};function Ne({...t}){const{t:s}=x.useContext(at),{blocklet:o,loadingDiskInfo:n,actions:r}=P();if(x.useEffect(()=>{r==null||r.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),o.diskInfo){const a=(p,m,j)=>e.jsxs(B,{children:[p," ",e.jsx("strong",{children:m?ot(m):"empty"})]}),i=o.environments.reduce((p,m)=>(p[m.key]=m.value,p),{}),h=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:a(i.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:a(i.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:a(i.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:a(i.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:h.map(p=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:p.name,children:p.value},p.key))})}return n?e.jsx(F,{}):e.jsx(B,{children:s("blocklet.diskInfo.empty")})}const Qt=Xe(B)``,Zt=De(({className:t,...s})=>e.jsx(Te,{...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 Se({status:t,message:s,createdAt:o}){const{t:n}=T(),r=t===U.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=U.BACKUPS.TIMEOUT_HOURS,a=r&&n("common.timeoutError"),i=t===U.BACKUPS.STATUS.PROGRESS&&!r,h=t===U.BACKUPS.STATUS.SUCCEEDED&&!r;return i?e.jsxs(B,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(F,{sx:{marginRight:"4px"},size:"12px"}),n("common.progress")]}):h?e.jsx(Y,{type:"success",children:n("common.succeeded")}):e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(Y,{type:"error",children:n("common.failed")})," ",e.jsx(Te,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(we,{children:e.jsx(ft,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Se.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};Se.defaultProps={message:""};function je({metadata:t}){const{t:s}=T();if(X(t))return e.jsx(Y,{type:"success",children:s("common.succeeded")});const o=t.count||0,n=t.size||0,r=gt(n,{iec:!0}),a=e.jsxs(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(B,{variant:"body2",children:[s("common.fileCount"),": ",o]}),e.jsxs(B,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(Y,{type:"success",children:s("common.succeeded")})," ",e.jsx(Zt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(we,{children:e.jsx(xt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}je.propTypes={metadata:f.object};je.defaultProps={metadata:{}};function ye({...t}){const{t:s,locale:o}=T(),{spaceGateways:n,backups:r,setBackupDate:a,backupsLoading:i,backupSummary:h}=Q(),p=ht({key:"lg"}),m=x.useRef(null),j=x.useCallback(l=>{a(l)},[a]),u=x.useMemo(()=>{const l=E().subtract(1,"year"),c=E().add(1,"day"),D=new Map(h.map(y=>[y.date,{date:y.date,successCount:y.successCount,errorCount:y.errorCount}])),w=[];for(let y=l.clone();E(y).isBefore(c);y=y.add(1,"day")){const I=y.format("YYYY-MM-DD");w.push(D.get(I)||{date:I,successCount:0,errorCount:0})}return w},[h]),S=x.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:10},tooltip:{formatter:y=>{const{date:I,successCount:v,errorCount:C}=u[y.dataIndex]||{date:y.data[0],successCount:0,errorCount:0};return[`<div>${s("common.time")}: ${I}</div>`,`<div>${s("common.succeeded")}: ${v}</div>`,`<div>${s("common.failed")}: ${C}</div>`].join(`
|
|
2
|
+
`)},borderWidth:0,padding:[8,10],textStyle:{fontSize:14},extraCssText:"border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);"},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:se[600]},{min:-9,max:-6,color:se[500]},{min:-6,max:-3,color:se[400]},{min:-3,max:-1,color:se[300]},{min:0,max:0,color:"#ecedf0"},{min:1,max:3,color:ne[300]},{min:3,max:6,color:ne[400]},{min:6,max:9,color:ne[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:ne[600]}],orient:"horizontal",left:"center",bottom:10,itemWidth:12,itemHeight:12,textStyle:{color:"#666",fontSize:12}},calendar:{top:30,left:40,right:5,bottom:20,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:4,borderColor:"#fff",borderRadius:0,color:"#fff"},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:12,fontSize:14,color:"rgb(31, 35, 40)",fontWeight:"400"},monthLabel:{show:!0,nameMap:"cn",align:"left",color:"rgb(31, 35, 40)",fontWeight:"400",fontSize:16,position:"start"},yearLabel:{show:!1},range:[E().subtract(1,"year").format("YYYY-MM-DD"),E().format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:u.map(y=>[y.date,y.errorCount?-y.errorCount:y.successCount]),label:{show:!1},itemStyle:{borderWidth:1.5,borderColor:"#fff",borderRadius:5,color:"#ecedf0"},emphasis:{itemStyle:{borderWidth:2.5,borderColor:We[200],color:"inherit"}}}}),[u,s]);x.useEffect(()=>{m.current&&p&&setTimeout(()=>{m.current.scrollLeft=m.current.scrollWidth},100)},[p,u]);const A=x.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:l=>{var O;const{targetUrl:c,targetName:D,status:w,createdAt:y}=r[l],I=w===U.BACKUPS.STATUS.PROGRESS&&E().diff(y,"hours")>=U.BACKUPS.TIMEOUT_HOURS,v=w===U.BACKUPS.STATUS.SUCCEEDED&&!I,C=D||((O=n.find(M=>c==null?void 0:c.includes(me(M==null?void 0:M.endpoint))))==null?void 0:O.name)||"Unknown DID Space";return v?e.jsx(qe,{fontSize:"16px",href:c,target:"_blank",children:C}):e.jsx(B,{variant:"body1",fontSize:"16px",children:C})}}},{label:s("common.strategy"),name:"strategy",options:{customBodyRender:l=>{const c=s(l===0?"common.auto":"common.manual");return e.jsx(Y,{children:c})}}},{label:s("common.startTime"),name:"createdAt",options:{customBodyRender:l=>E(l).format("YYYY-MM-DD HH:mm:ss")}},{label:s("common.endTime"),name:"updatedAt",options:{customBodyRender:l=>X(l)?"":E(l).format("YYYY-MM-DD HH:mm:ss")}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:l=>{const c=(r==null?void 0:r[l])??{},{status:D,message:w,createdAt:y,metadata:I}=c,v=D===U.BACKUPS.STATUS.PROGRESS&&E().diff(y,"hours")>=U.BACKUPS.TIMEOUT_HOURS,C=D===U.BACKUPS.STATUS.PROGRESS&&!v,O=D===U.BACKUPS.STATUS.SUCCEEDED&&!v;return C?e.jsxs(B,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(F,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):O?e.jsx(je,{metadata:I}):e.jsx(Se,{status:D,message:w,createdAt:y})}}}],[r,n,s]),R=x.useMemo(()=>u&&u.length>0,[u]),k=x.useMemo(()=>!(r!=null&&r.length),[r]);return e.jsxs(g,{...t,children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),R&&e.jsxs(e.Fragment,{children:[e.jsx(g,{ref:m,sx:{overflowX:p?"visible":"hidden",overflowY:"hidden"},children:e.jsx(g,{sx:{minWidth:p?"1600px":"100%",height:"240px"},children:e.jsx(Dt,{option:S,style:{height:"100%",width:"100%",padding:"8px"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&j(l.data[0])}}})})}),e.jsx(g,{display:"flex",justifyContent:"flex-end",mr:p?2:5,mb:2,mt:.5,children:e.jsxs(K,{direction:p?"column":"row",spacing:p?2:1,alignItems:"flex-end",width:"100%",justifyContent:p?"flex-start":"flex-end",children:[e.jsxs(K,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(B,{variant:"body2",color:"text.secondary",children:[s("storage.spaces.backup.failed"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#8B5000",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#A36200",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#C17700",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#E29000",borderRadius:.5})]}),e.jsxs(K,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(B,{variant:"body2",color:"text.secondary",children:[s("storage.spaces.backup.without"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#ecedf0",borderRadius:.5,border:"1px solid #e0e1e4"})]}),e.jsxs(K,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(B,{variant:"body2",color:"text.secondary",children:[s("storage.spaces.backup.succeeded"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#9be9a8",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#40c463",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#30a14e",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#216e39",borderRadius:.5})]})]})})]}),k?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:s("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:i,data:r,columns:A,emptyNode:s("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1}})]})}ye.propTypes={};var Je=function(s){return e.jsxs("svg",{...s,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs1gCtSC4YsjwnY9l1MJYRz1NMk5NAC3MffnLwiHnNH7IoyER5VEI6S4Um++uKyho0BwmD+1rA90yarpO4ZpjLgs8+BTUfU9w+gkwEi6ftxqyB9Wt6IBstE0E8kxJLeKaVhNA/uEwIslv1JmRwcSzAo+URPCF5M8AGzEF8yG+QVBFl53FqhfYqd7/PM6AmJouW4cVge9pZu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v+gDBsggYWWkvLT27f2dhwRULpny5D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};Je.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Qe(){const{t}=T();return e.jsxs(g,{children:[e.jsxs(g,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(Je,{style:{width:250,height:250}}),e.jsx(B,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.provider")}),e.jsx(oe,{})]}),e.jsx(ye,{sx:{marginTop:"24px"}}),e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ne,{})]})}Qe.propTypes={};var Ae={},Kt=fe;Object.defineProperty(Ae,"__esModule",{value:!0});var Ze=Ae.default=void 0,Ht=Kt(ge()),Vt=e;Ze=Ae.default=(0,Ht.default)((0,Vt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ce={},Gt=fe;Object.defineProperty(Ce,"__esModule",{value:!0});var Ke=Ce.default=void 0,Yt=Gt(ge()),Xt=e;Ke=Ce.default=(0,Yt.default)((0,Xt.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"}),"ElectricBoltOutlined");var Be={},Wt=fe;Object.defineProperty(Be,"__esModule",{value:!0});var He=Be.default=void 0,qt=Wt(ge()),_t=e;He=Be.default=(0,qt.default)((0,_t.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"}),"FolderOutlined");function be({spaceGateway:t,onConfirm:s,onCancel:o}){const{t:n}=T(),[r,a]=x.useState(!1),[i,h]=x.useState(!1),p=(u,S)=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),a(S)},m=async u=>{try{u==null||u.stopPropagation(),h(!0),await(s==null?void 0:s(t)),a(!1)}catch(S){console.error(S),b.error(`${n("storage.space.gateway.delete.failed")}: ${W(S)}`)}finally{a(!1),h(!1)}},j=u=>{p(u,!1),o==null||o(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(H,{color:"red",onClick:u=>p(u,!0),children:[e.jsx(V,{style:{minWidth:24,color:"red"},children:e.jsx(Ot,{fontSize:"small"})}),e.jsx(G,{style:{color:"red"},children:n("common.delete")})]}),e.jsx(it,{title:n("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:n("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:n("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:m,onCancel:j,children:e.jsx(B,{sx:{wordWrap:"break-word"},children:n("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}be.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};be.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function Ie({spaceGateway:t,selected:s,onDelete:o,onConnect:n,enableSwitchToSpace:r,backupInProgress:a,...i}){const{abortBlockletBackup:h}=Q(),[p,m]=x.useState(null),{t:j}=T(),[u,S]=x.useState(!1),A=(l,c)=>{l.stopPropagation(),l.preventDefault(),m(c&&l.currentTarget)},R=async l=>{try{S(!0),A(l,!1),await n(t)}catch(c){console.error(c),b.error(c.message)}finally{S(!1)}},k=async l=>{try{S(!0),A(l,!1),await h()}catch(c){console.error(c),b.error(c.message)}finally{S(!1)}};return e.jsxs(e.Fragment,{children:[u||t!=null&&t.loading?e.jsx(F,{sx:{ml:1},size:"24px"}):e.jsx(_e,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:l=>A(l,!0),...i,children:e.jsx(Tt,{})}),e.jsxs($e,{id:"simple-menu",anchorEl:p,keepMounted:!0,open:!!p,onClose:l=>A(l,!1),children:[e.jsxs(H,{onClick:l=>{A(l,!1),window.open(Re(t.endpoint?vt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ze,{fontSize:"small"})}),e.jsx(G,{children:j("common.open")})]}),e.jsxs(H,{onClick:l=>{A(l,!1),window.open(Re(Et(t.endpoint),{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(G,{children:j("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(H,{onClick:R,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ke,{fontSize:"small"})}),e.jsx(G,{children:j("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(H,{onClick:k,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(wt,{fontSize:"small"})}),e.jsx(G,{children:j("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(be,{spaceGateway:t,onConfirm:async()=>{m(null),await(o==null?void 0:o(t))},onCancel:()=>m(null)})]})]})}Ie.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};Ie.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};function ve({spaceGateway:t,spaceStatus:s,selected:o,onConnected:n,onDeleted:r,onBackedUp:a}){const{t:i,locale:h}=T(),{blocklet:p}=P(),{api:m,info:{did:j}}=J(),{appDid:u,appName:S,appDescription:A,scopes:R,appUrl:k,referrer:l}=Fe({blocklet:p}),{backupProgress:c,updateSpaceGateway:D,deleteSpaceGateway:w,refreshBackupSummary:y}=Q(),[I,v]=x.useState(!1),[C,O]=x.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:S},h),scan:i("storage.spaces.authorize.scan",{appName:S},h),confirm:"",success:e.jsx(B,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{O(d=>({...d,open:!1}))}}),M=o&&!I&&s===le.DISCONNECTED,ae=o&&!I&&!t.loading&&s===le.CONNECTED,q=o&&I&&s===le.CONNECTED&&(c==null?void 0:c.progress)>=0,_=async()=>{try{if(await kt(t==null?void 0:t.endpoint)){await m.configBlocklet({input:{did:[p.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),b.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),n==null||n(null,t);return}}catch(d){console.error(d),n==null||n(d,t);return}O(d=>({...d,open:!0,prefix:ue(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Me.create({baseURL:ue(t.url,"space")}).get,extraParams:{appDid:u,appName:S,appDescription:A,scopes:R,appUrl:k,referrer:l,nodeDid:j,spaceDid:t.did}}))},re=async(d,z)=>{const L=z(d.endpoint),ee=me(L),Z=d.space?z(d.space):{};if(t.did&&ee!==t.did){O(Ye=>({...Ye,open:!1}));const te=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:Z!=null&&Z.name?Z.name:""});b.error(te),n==null||n(new Error(te),t);return}const Ee={...t,name:Z.name??"DID Space",did:Z.did??me(L),endpoint:L};await D(Ee),O(te=>({...te,open:!1})),n==null||n(null,Ee)},ie=async()=>{try{if(I)return;v(!0),await m.backupBlocklet({input:{appDid:p.appDid,to:"spaces"}})}catch(d){console.error(d),b.error(d.message),a==null||a(d,t)}finally{v(!0)}},$=async()=>{try{await w(t),b.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r==null||r(null,t)}catch(d){console.error(d),r==null||r(d,t)}};return x.useEffect(()=>{c!=null&&c.completed?(o&&((c==null?void 0:c.progress)===100?(b.success(i("storage.spaces.backupSuccessfully")),a==null||a(null,t)):c.message&&(a==null||a(new Error(c==null?void 0:c.message),t)),c.progress=0,c.message=""),v(!1),y()):c.progress&&v(!0)},[c]),e.jsxs(e.Fragment,{children:[e.jsxs(g,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ae&&e.jsx(ce,{className:"action-btn",variant:"outlined",size:"small",onClick:ie,children:i("storage.spaces.strategy.backupNow")}),M&&e.jsx(ce,{className:"action-btn",variant:"outlined",size:"small",onClick:_,children:i("storage.spaces.disconnected.reconnectNow")}),q&&e.jsxs(ce,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(F,{variant:"determinate",value:c==null?void 0:c.progress,size:14,sx:{mr:1}}),c==null?void 0:c.progress,"%"]}),e.jsx(ct,{forceConnected:!1,saveConnect:!1,prefix:C.prefix,open:C.open,popup:!0,action:C.action,baseUrl:C.baseUrl,checkFn:C.checkFn,onSuccess:re,onClose:C.onClose,checkTimeout:C.checkTimeout,extraParams:C.extraParams,messages:C.messages,locale:h},"get-endpoint")]}),e.jsx(Ie,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:$,onConnect:_,enableSwitchToSpace:(c==null?void 0:c.completed)||X(c==null?void 0:c.message),backupInProgress:q})]})}ve.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};ve.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ve({...t}){const{t:s}=T(),{autoBackup:o,updateAutoBackup:n}=Q(),r=async()=>{try{const a=!(o!=null&&o.enabled);await n({enabled:a}),b.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){b.error(a.message)}};return e.jsx(Ut,{checked:!!(o!=null&&o.enabled),onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(B,{marginRight:"8px",children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Ve.propTypes={};function $t(){const{t}=T(),{spaceGateways:s,spaceGatewaysLoading:o,spaceGatewayIsSelected:n}=Q(),r=o&&!(s!=null&&s.length),a=({spaceGateway:i,spaceStatus:h,selected:p,refresh:m})=>e.jsx(ve,{spaceGateway:i,spaceStatus:h,selected:p,onConnected:()=>m(),onBackedUp:j=>j&&m()});return e.jsxs(g,{display:"flex",flexDirection:"column",children:[e.jsx(he,{sx:{button:{fontSize:"revert",fontWeight:500}},left:e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Ve,{}),e.jsx(oe,{})]})}),e.jsx(g,{mt:2,children:r?e.jsx(g,{display:"flex",justifyContent:"center",children:e.jsx(F,{})}):e.jsx(ke,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(i=>e.jsx(ke,{item:!0,xs:12,md:6,children:e.jsx(St,{endpoint:i.endpoint,selected:n(i),action:a},i.endpoint)}))})})}),e.jsx(ye,{sx:{marginTop:"24px"}}),e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ne,{})]})}function es(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=Q();return t?e.jsx(Ue,{relative:"parent",children:e.jsx(F,{})}):X(s)?e.jsx(Qe,{}):e.jsx($t,{})}function ts(){return e.jsx(xe,{children:e.jsx(es,{})})}function ss(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:o,hasStorageEndpoint:n,loading:r,storageEndpoint:a}=Mt(),i=pe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ue,{relative:"parent",children:e.jsx(F,{})}):e.jsxs(g,{sx:{maxWidth:"md",position:"relative"},children:[n?e.jsx(jt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(yt,{}),e.jsx(g,{sx:i,children:e.jsx(At,{onConnect:o,storageEndpoint:a})})]})}function ns(){const{t}=T();return e.jsxs(Lt,{children:[e.jsxs(K,{spacing:1,marginBottom:2,children:[e.jsx(B,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(B,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(ss,{})]})}function Ge({navOrientation:t,...s}){const{t:o,locale:n}=T(),{blocklet:r}=P(),a=dt({key:"md"}),[i,h]=tt(),p=i.get("tab")||"backup",m=a?"horizontal":t,j=pe(()=>{var c;const k=[{label:o("common.backup"),value:"backup"}],l=(c=r==null?void 0:r.capabilities)==null?void 0:c.didSpace;return(l===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||l===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&k.push({label:o("common.storage"),value:"storage"}),k},[n,m]),S=pe(()=>({backup:e.jsx(ts,{}),storage:e.jsx(ns,{})}))[p],A=k=>{h(l=>(k==="backup"?l.delete("tab"):l.set("tab",k),l))};if(j.length<=1)return e.jsx(de,{children:S});const R=e.jsx(lt,{tabs:j,current:p,orientation:m,onChange:A,sx:[{borderRight:1,height:"100%",borderColor:"divider"},m==="horizontal"&&{borderRight:0}]});if(m==="vertical")return e.jsx(g,{...s,children:e.jsxs(K,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(g,{sx:{flexShrink:0},children:e.jsx(he,{left:R})}),e.jsx(g,{sx:{flexGrow:1,minWidth:0},children:e.jsx(de,{sx:{mt:1},children:S})})]})});if(m==="horizontal")return e.jsxs(g,{...s,children:[e.jsx(he,{left:R}),e.jsx(de,{sx:{mt:2},children:S})]})}Ge.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};Ge.defaultProps={navOrientation:"vertical"};const de=De(g)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
5
5
|
overflow: hidden;
|