@abtnode/webapp 1.16.52-beta-20250908-085420-224a58fa → 1.16.52-beta-20250911-023851-d988be85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-V5c9VE3t.js → AdapterDayjs-DYEBhhQV.js} +1 -1
- package/dist/assets/{Add-C983Xxy8.js → Add-CH4q_X39.js} +1 -1
- package/dist/assets/ArrowDropDown-BMnba6Vw.js +1 -0
- package/dist/assets/{Autocomplete-DjqVsFBO.js → Autocomplete-D0g_jxM8.js} +1 -1
- package/dist/assets/{Breadcrumbs-DUWbDe8e.js → Breadcrumbs-CADowlon.js} +1 -1
- package/dist/assets/{ButtonGroup-Cl7gTm9Q.js → ButtonGroup-CSxIJOY5.js} +1 -1
- package/dist/assets/{CSSTransition-BCxZd18L.js → CSSTransition-CDcifbyC.js} +1 -1
- package/dist/assets/{CallMerge-B1r_cCj4.js → CallMerge-Bu57BhBb.js} +1 -1
- package/dist/assets/{CardContent-Dbzg5wyq.js → CardContent-BXfiG3ck.js} +1 -1
- package/dist/assets/{ChevronLeft-ax3UHigO.js → ChevronLeft-CL9U9Ud2.js} +1 -1
- package/dist/assets/{ChevronRight-CqlYVEsM.js → ChevronRight-Bc6eTl0w.js} +1 -1
- package/dist/assets/{Clear-C1ky0VqG.js → Clear-Dwp04hnZ.js} +1 -1
- package/dist/assets/{DeleteOutline-DdUUeo5n.js → DeleteOutline-CIdo_KSP.js} +1 -1
- package/dist/assets/{Done-DueUo9UO.js → Done-CrprtcbS.js} +1 -1
- package/dist/assets/{Edit-YsW7O5r6.js → Edit-BF520bmv.js} +1 -1
- package/dist/assets/{ErrorOutline-EfUNg4qf.js → ErrorOutline-CMjv_M5Z.js} +1 -1
- package/dist/assets/{FilterList-CXwHvN0d.js → FilterList-C18CrBe9.js} +1 -1
- package/dist/assets/{Google-lTUwsqy9.js → Google-skK3_8TA.js} +1 -1
- package/dist/assets/{HelpOutline-BCw-yQQi.js → HelpOutline-DBf34kya.js} +1 -1
- package/dist/assets/{Launch-B7x9htxW.js → Launch-BxgDQBBH.js} +1 -1
- package/dist/assets/{Link-BaMGrObG.js → Link-C5eJ_71C.js} +1 -1
- package/dist/assets/{ListItemButton-DsaQ2Wd9.js → ListItemButton-C_ORHHRF.js} +1 -1
- package/dist/assets/{ListSubheader-BErtdoID.js → ListSubheader-B-HKDAjF.js} +1 -1
- package/dist/assets/{LoadingButton-DT5VrroN.js → LoadingButton-8qaRpQto.js} +1 -1
- package/dist/assets/{MoreVert-CScSHXZ3.js → MoreVert-CHcg5zqX.js} +1 -1
- package/dist/assets/{OpenInNew-RSqDXAHN.js → OpenInNew-f4_gudHi.js} +1 -1
- package/dist/assets/{Refresh-DW9dbJxn.js → Refresh-CrnWNNC-.js} +1 -1
- package/dist/assets/{Search-CDkaJ72m.js → Search-CKP7F1ON.js} +1 -1
- package/dist/assets/{Stepper-BWPy-rcR.js → Stepper-M_-BBKKX.js} +1 -1
- package/dist/assets/{Switch-BRtydIan.js → Switch-HHgrswMy.js} +1 -1
- package/dist/assets/{TableSearch-BpVsXhRC.js → TableSearch-BOHK_oe9.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-C9wDNGvb.js → ToggleButtonGroup-CMp7F25J.js} +1 -1
- package/dist/assets/{Verified-RAhSnU3J.js → Verified-6eCsFC48.js} +1 -1
- package/dist/assets/{VerifiedUser-DOBjtgbs.js → VerifiedUser-PMYsirAs.js} +1 -1
- package/dist/assets/{ViewList-CdMuVm-B.js → ViewList-CRhDTczf.js} +1 -1
- package/dist/assets/{_createAggregator-Jctvqw53.js → _createAggregator-SgttUPFo.js} +1 -1
- package/dist/assets/{actions-CZfqqh6l.js → actions-2Eezqpj7.js} +1 -1
- package/dist/assets/{actions-CVRAzq1M.js → actions-Dbq5WW4S.js} +1 -1
- package/dist/assets/{agreement-BFlXBhVm.js → agreement-BLQTYZdW.js} +1 -1
- package/dist/assets/api-DBAdcY7Y.js +1 -0
- package/dist/assets/{appearance-Dj_6VXq4.js → appearance-D3gkkd22.js} +1 -1
- package/dist/assets/{ar-CPI6kJBB.js → ar-DGfbWcRb.js} +1 -1
- package/dist/assets/{audit-logs-CjR_kNDs.js → audit-logs-vgB1SsOY.js} +1 -1
- package/dist/assets/{base-chart-DB0C03Fr.js → base-chart-C2D8ik1f.js} +1 -1
- package/dist/assets/{blocklet-CdpF9xGA.js → blocklet-BsrHxy7u.js} +1 -1
- package/dist/assets/{chain-DhrkyUZN.js → chain-zv9j2aZo.js} +1 -1
- package/dist/assets/{click-to-copy-Dl43DhC6.js → click-to-copy-kcafHn28.js} +1 -1
- package/dist/assets/client-5CKy_FgU.js +1 -0
- package/dist/assets/cloneDeep-DcXoweHd.js +1 -0
- package/dist/assets/{collapse-8CbQrzXn.js → collapse-ovihQ28h.js} +1 -1
- package/dist/assets/{config-navigation-CBk_ykp5.js → config-navigation-N5qV7Fks.js} +3 -3
- package/dist/assets/{connect-to-ClpTOWYj.js → connect-to-uq35os4q.js} +1 -1
- package/dist/assets/{cssMode-49iKtPO9.js → cssMode-Cj52fvE3.js} +1 -1
- package/dist/assets/{de-DXdF82Jr.js → de-DGZI-Bsh.js} +1 -1
- package/dist/assets/{delete-confirm-VJtte6ge.js → delete-confirm-CpB84VZ0.js} +1 -1
- package/dist/assets/{depsEqual-C2ZOCVCb.js → depsEqual-BFSrxEra.js} +1 -1
- package/dist/assets/{detail-CS8Ne5ku.js → detail-BFn3VOS0.js} +3 -3
- package/dist/assets/{domains-DtvRW9cp.js → domains-BWq1GF6C.js} +1 -1
- package/dist/assets/{download-Bwwfqm7S.js → download-CDOf0EfG.js} +1 -1
- package/dist/assets/{edit.svg-DKSrjOQe.js → edit.svg-906tK9QW.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-iSeSOev6.js +1 -0
- package/dist/assets/engine-C3JOecTH.js +1 -0
- package/dist/assets/{es-Cdb297yS.js → es-CMwFpp7C.js} +1 -1
- package/dist/assets/{fr-CQValz_y.js → fr-eKsI9Vcp.js} +1 -1
- package/dist/assets/{freemarker2-C8jlw7rV.js → freemarker2-CI8rbROc.js} +1 -1
- package/dist/assets/{get-safe-url-DpaJjz3Y.js → get-safe-url-sCysExm8.js} +1 -1
- package/dist/assets/getValidReactChildren-CYitcrPj.js +1 -0
- package/dist/assets/{graphqlMode-CAZr8ov7.js → graphqlMode-Wr_t4KNM.js} +2 -2
- package/dist/assets/{handlebars-DnqqoaJC.js → handlebars-iMVlzGUo.js} +1 -1
- package/dist/assets/{hi-CAensap9.js → hi-C0JqybmN.js} +1 -1
- package/dist/assets/{html-XDnjykJP.js → html-C-Go3G0L.js} +1 -1
- package/dist/assets/{html-title-O-KFEc2K.js → html-title-DO6a4GD4.js} +1 -1
- package/dist/assets/{htmlMode-CSp7N_Hl.js → htmlMode-Cm08-VyM.js} +1 -1
- package/dist/assets/{id-6AFgcYKj.js → id-DHF6PX-M.js} +1 -1
- package/dist/assets/{iframe-CqfQkE2b.js → iframe-DFHa3Bnb.js} +1 -1
- package/dist/assets/{index-ffZ5tAUV.js → index-1BK-QAlz.js} +1 -1
- package/dist/assets/{index-Brbh8hNL.js → index-B3YqdyEK.js} +1 -1
- package/dist/assets/{index-sw8QTVdD.js → index-B4bGqzxK.js} +1 -1
- package/dist/assets/{index-rkMUe7P2.js → index-B4vMGi5W.js} +34 -34
- package/dist/assets/{index-CZp4WEvN.js → index-B8u66ccG.js} +1 -1
- package/dist/assets/{index-BJiaIlPd.js → index-BDITCvGb.js} +2 -2
- package/dist/assets/{index-DVlZpADE.js → index-BH5WCEko.js} +3 -3
- package/dist/assets/{index-8xiSTm96.js → index-BODLs31o.js} +1 -1
- package/dist/assets/{index-pvy0YsL_.js → index-BS9HZZVH.js} +1 -1
- package/dist/assets/{index-wADZnfqx.js → index-BYzl7XqB.js} +3 -3
- package/dist/assets/{index-CudWnmhY.js → index-BZespPOM.js} +114 -114
- package/dist/assets/index-BjY-2jMh.js +1 -0
- package/dist/assets/{index-CVM433pe.js → index-BjuLdQVZ.js} +9 -9
- package/dist/assets/{index-DxO18c3G.js → index-BrUET_T1.js} +1 -1
- package/dist/assets/{index-C0sgd4sF.js → index-C5z5DKmO.js} +1 -1
- package/dist/assets/{index-CbFs9VSg.js → index-C6y2gpuw.js} +1 -1
- package/dist/assets/{index-B_vpfqW-.js → index-CEQiFStS.js} +1 -1
- package/dist/assets/{index-CMZu5CPN.js → index-CMXHP3Fr.js} +1 -1
- package/dist/assets/{index-1OplZ9Cs.js → index-CZUd3jtW.js} +1 -1
- package/dist/assets/{index-BCTM1q6x.js → index-CpD4AFpD.js} +1 -1
- package/dist/assets/{index-BGGMir5f.js → index-CuqMV1UW.js} +1 -1
- package/dist/assets/{index-hDQKXm0Z.js → index-D7mWhhL7.js} +1 -1
- package/dist/assets/{index-CC-Z_CHg.js → index-D9h0eQcv.js} +3 -3
- package/dist/assets/{index-LeZ1xWOy.js → index-DCGA-YsH.js} +1 -1
- package/dist/assets/{index-DP6YKY8s.js → index-DQgHQ6dL.js} +1 -1
- package/dist/assets/{index-C7hkvuAb.js → index-DVZ3NSkf.js} +1 -1
- package/dist/assets/{index-3zHU6JJe.js → index-DXEh1jiR.js} +1 -1
- package/dist/assets/{index-D35PF0Gr.js → index-DXl9XsWD.js} +3 -3
- package/dist/assets/{index-DsWFyc_U.js → index-DYOkPaFV.js} +1 -1
- package/dist/assets/index-DfgKFBPH.js +1 -0
- package/dist/assets/{index-DjjlF8Uq.js → index-DiCVibNz.js} +1 -1
- package/dist/assets/{index-B4Gkg81f.js → index-DrnQFJwP.js} +1 -1
- package/dist/assets/{index-BrRuUuJz.js → index-DsI-Hfrs.js} +1 -1
- package/dist/assets/{index-BX41ZANp.js → index-DupGsKcv.js} +1 -1
- package/dist/assets/{index-CuSrEgwV.js → index-DxNIolzq.js} +1 -1
- package/dist/assets/{index-cbnPwsDp.js → index-KmXKa6Be.js} +1 -1
- package/dist/assets/{index-Dbm8Ypfm.js → index-P8aCGwoo.js} +1 -1
- package/dist/assets/{index-DHAPwvfJ.js → index-RQQTqxfN.js} +1 -1
- package/dist/assets/{index-DG2qSdjX.js → index-ZeIO5IuM.js} +1 -1
- package/dist/assets/{index-D08FjEOR.js → index-_THgpMLM.js} +1 -1
- package/dist/assets/{index-BJ3YeDHo.js → index-evzTfnIa.js} +1 -1
- package/dist/assets/{index-D-2FHFCU.js → index-kUTsa4kZ.js} +1 -1
- package/dist/assets/{index-CKv5JG58.js → index-nc2KpcRW.js} +1 -1
- package/dist/assets/{index-U-ssUBBR.js → index-oUplCnvc.js} +1 -1
- package/dist/assets/{index-BTiudSd3.js → index-p0X9z0NX.js} +1 -1
- package/dist/assets/{index.esm-WKN691rM.js → index.esm-BbJ-E9Fa.js} +1 -1
- package/dist/assets/{install-from-url-BSerDRve.js → install-from-url-Bk783uEF.js} +1 -1
- package/dist/assets/{invitation-BDy1RCkL.js → invitation-CgI4Dbb4.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BeCWfmHv.js → is-path-prefix-equal-ZK7BEh7c.js} +1 -1
- package/dist/assets/{item-BnxCdJvP.js → item-B8R6funP.js} +1 -1
- package/dist/assets/{ja-D59y1sZ9.js → ja-c-6MaUg1.js} +1 -1
- package/dist/assets/{javascript-Dl1WHFka.js → javascript-DPcGRbsg.js} +1 -1
- package/dist/assets/{jsonMode-DFD4Racx.js → jsonMode-CLaPuwNA.js} +1 -1
- package/dist/assets/{ko-DlSyClni.js → ko-CTFi4Ndk.js} +1 -1
- package/dist/assets/{liquid-BrE-9dRX.js → liquid-GlbruXjj.js} +1 -1
- package/dist/assets/{list-header-Dkv0GpZF.js → list-header-DiNsae5e.js} +1 -1
- package/dist/assets/{log-Bh5tmtoN.js → log-DPAr_4bY.js} +1 -1
- package/dist/assets/{lottie-react.esm-BgtTbJVU.js → lottie-react.esm-h_4W5Zme.js} +1 -1
- package/dist/assets/{mdx-I6c8I074.js → mdx-R7Gw0e8c.js} +1 -1
- package/dist/assets/{memory-C95aAZUz.js → memory-D_JtngVx.js} +1 -1
- package/dist/assets/{metric-DL6papJ0.js → metric-Bc6fYrFn.js} +1 -1
- package/dist/assets/omit-CGWF9ryF.js +1 -0
- package/dist/assets/{overview-BizXKx3f.js → overview-CjRsK1A7.js} +1 -1
- package/dist/assets/{permission-D6gXDcTa.js → permission-CPkOJvoL.js} +1 -1
- package/dist/assets/{preference-DjNHH5W9.js → preference-4Mq3esV_.js} +3 -3
- package/dist/assets/{pt-C_3CX1PR.js → pt-QkdDdQuw.js} +1 -1
- package/dist/assets/{python-C_tQHhFN.js → python-40JujDw-.js} +1 -1
- package/dist/assets/{raf-schd.esm-CetBDte5.js → raf-schd.esm-3D6HsxHD.js} +1 -1
- package/dist/assets/{razor-D37BWXT_.js → razor-BAd0Omh-.js} +1 -1
- package/dist/assets/{rotate-session-key-B8PMc0wh.js → rotate-session-key-CDkb7ngK.js} +1 -1
- package/dist/assets/{ru-FBGLUlo5.js → ru-swMH4bvc.js} +1 -1
- package/dist/assets/{runtime-s20locNX.js → runtime-Bj_39GyC.js} +1 -1
- package/dist/assets/schema-DSWvVRaK.js +1 -0
- package/dist/assets/sdk-Bal0rRpE.js +1 -0
- package/dist/assets/{service-UYFODNIY.js → service-CpOHU6Jn.js} +1 -1
- package/dist/assets/{shorten-label-k-tK1TOo.js → shorten-label-C9bzM76F.js} +1 -1
- package/dist/assets/{simple-select-CErMpi--.js → simple-select-BjcK9LP5.js} +1 -1
- package/dist/assets/{spaces-BsTM83wK.js → spaces-DhOd7qI3.js} +1 -1
- package/dist/assets/{status-BDdsaRDY.js → status-CinggnF7.js} +1 -1
- package/dist/assets/{status-BvjQPj2z.js → status-DV5gY90N.js} +1 -1
- package/dist/assets/{switch-control-DKCRS-8f.js → switch-control-Baw4DU9M.js} +1 -1
- package/dist/assets/{table-icons-CWA0F6JZ.js → table-icons-DnTt_sYt.js} +1 -1
- package/dist/assets/{team-BDaMVhz3.js → team-DXepnqEQ.js} +1 -1
- package/dist/assets/{th-DmSMYMH5.js → th-DuqieD90.js} +1 -1
- package/dist/assets/{toLower-Bn0a2lun.js → toLower-sG3-5d0I.js} +1 -1
- package/dist/assets/toUpper-B0rGF93a.js +1 -0
- package/dist/assets/{traffic-CrMw3w94.js → traffic-Btn2g9IR.js} +1 -1
- package/dist/assets/{tsMode-CAsGXutI.js → tsMode-surYJ6gN.js} +1 -1
- package/dist/assets/{typescript-NFZNJJb7.js → typescript-DiA-QugC.js} +1 -1
- package/dist/assets/{url-evaluation-BriA-wER.js → url-evaluation-0Ld63BSR.js} +1 -1
- package/dist/assets/{url-join-CwRQ_rqX.js → url-join-z6NqiL_x.js} +1 -1
- package/dist/assets/{use-mobile-Bhmm_iaP.js → use-mobile-DSjc2B3Z.js} +1 -1
- package/dist/assets/{use-mobile-ByZ7-kMP.js → use-mobile-xfMBWCKy.js} +1 -1
- package/dist/assets/{useAsync-7auGlLYi.js → useAsync-Don_4RdT.js} +1 -1
- package/dist/assets/{useAsyncRetry-CcMPXJZK.js → useAsyncRetry-C4MBFyoW.js} +1 -1
- package/dist/assets/{useLocalStorage-C7P_-Tkf.js → useLocalStorage-BATGmdsj.js} +1 -1
- package/dist/assets/{useThemeProps-C0qH78Uf.js → useThemeProps-xtuvHn9l.js} +1 -1
- package/dist/assets/{util-BL8HXMf5.js → util-DVhqJIPT.js} +1 -1
- package/dist/assets/{vi-CjDg6MoB.js → vi-42QzvOuM.js} +1 -1
- package/dist/assets/{wait-container-BNhoJ1du.js → wait-container-CTtcVDoi.js} +1 -1
- package/dist/assets/{without-wallet-vbeo4KSB.js → without-wallet-CzH45fgt.js} +1 -1
- package/dist/assets/wrap-locale-BJifboM0.js +1 -0
- package/dist/assets/{xml-DMeNyU1M.js → xml-BbkowpKa.js} +1 -1
- package/dist/assets/{yaml-B-AuvoWD.js → yaml-CJM62-eu.js} +1 -1
- package/dist/assets/{zh-DaR6QxjC.js → zh-C-k4DKK-.js} +1 -1
- package/dist/assets/{zh-tw-DaxtX1HY.js → zh-tw-Dxa4oubT.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-BGdQ_v7I.js +0 -1
- package/dist/assets/api-pS-YWf8k.js +0 -1
- package/dist/assets/client-BL3hKpCx.js +0 -1
- package/dist/assets/cloneDeep-BPHeHKzF.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-C9Oo18CI.js +0 -1
- package/dist/assets/engine-BCeC1m92.js +0 -1
- package/dist/assets/getValidReactChildren-CKPRpUiq.js +0 -1
- package/dist/assets/index-BeI9Ztw4.js +0 -1
- package/dist/assets/index-CJpAfjZ_.js +0 -1
- package/dist/assets/omit-BOD0k9KL.js +0 -1
- package/dist/assets/schema-CLaP5-a_.js +0 -1
- package/dist/assets/sdk-BTJAZwu4.js +0 -1
- package/dist/assets/toUpper-BMEJ2_h2.js +0 -1
- package/dist/assets/wrap-locale-BPy7dVTr.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as U,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ih as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ii as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as Ue,av as vt,ij as Ct,ik as Nt,$ as nt,il as wt,im as Rt,io as Tt,ip as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,iq as Lt,a4 as kt}from"./index-CudWnmhY.js";import{d as Ft,H as at,g as Pt}from"./index-BGGMir5f.js";import{R as _e,S as _t}from"./actions-CVRAzq1M.js";import{B as Bt}from"./index-BeI9Ztw4.js";import{S as me}from"./shorten-label-k-tK1TOo.js";import{v as ot}from"./index-BTiudSd3.js";import{T as zt}from"./html-title-O-KFEc2K.js";import{R as Wt}from"./Refresh-DW9dbJxn.js";import{D as Mt,g as Ht}from"./traffic-CrMw3w94.js";import{u as Kt}from"./use-mobile-ByZ7-kMP.js";import"./FilterList-CXwHvN0d.js";import"./CSSTransition-BCxZd18L.js";import"./emotion-cache.browser.esm-C9Oo18CI.js";import"./index-pvy0YsL_.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C2ZOCVCb.js";import"./index-cbnPwsDp.js";import"./TableSearch-BpVsXhRC.js";import"./Search-CDkaJ72m.js";import"./Clear-C1ky0VqG.js";import"./MoreVert-CScSHXZ3.js";import"./useLocalStorage-C7P_-Tkf.js";import"./url-evaluation-BriA-wER.js";import"./get-safe-url-DpaJjz3Y.js";import"./ButtonGroup-Cl7gTm9Q.js";import"./getValidReactChildren-CKPRpUiq.js";import"./permission-D6gXDcTa.js";import"./index.esm-WKN691rM.js";import"./collapse-8CbQrzXn.js";import"./blocklet-CdpF9xGA.js";import"./Switch-BRtydIan.js";import"./iframe-CqfQkE2b.js";import"./ChevronLeft-ax3UHigO.js";import"./ChevronRight-CqlYVEsM.js";import"./index-DBii9-f-.js";import"./base-chart-DB0C03Fr.js";import"./index-LeZ1xWOy.js";import"./AdapterDayjs-V5c9VE3t.js";import"./useThemeProps-C0qH78Uf.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.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"})),Ut=Ge(e.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"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(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},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const H=await oe(c,o.receiver);await be(1),q({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){U.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
1
|
+
import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as U,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ih as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ii as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as Ue,av as vt,ij as Ct,ik as Nt,$ as nt,il as wt,im as Rt,io as Tt,ip as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,iq as Lt,a4 as kt}from"./index-BZespPOM.js";import{d as Ft,H as at,g as Pt}from"./index-CuqMV1UW.js";import{R as _e,S as _t}from"./actions-Dbq5WW4S.js";import{B as Bt}from"./index-DfgKFBPH.js";import{S as me}from"./shorten-label-C9bzM76F.js";import{v as ot}from"./index-p0X9z0NX.js";import{T as zt}from"./html-title-DO6a4GD4.js";import{R as Wt}from"./Refresh-CrnWNNC-.js";import{D as Mt,g as Ht}from"./traffic-Btn2g9IR.js";import{u as Kt}from"./use-mobile-xfMBWCKy.js";import"./FilterList-C18CrBe9.js";import"./CSSTransition-CDcifbyC.js";import"./emotion-cache.browser.esm-iSeSOev6.js";import"./index-BS9HZZVH.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BFSrxEra.js";import"./index-KmXKa6Be.js";import"./TableSearch-BOHK_oe9.js";import"./Search-CKP7F1ON.js";import"./Clear-Dwp04hnZ.js";import"./MoreVert-CHcg5zqX.js";import"./useLocalStorage-BATGmdsj.js";import"./url-evaluation-0Ld63BSR.js";import"./get-safe-url-sCysExm8.js";import"./ButtonGroup-CSxIJOY5.js";import"./getValidReactChildren-CYitcrPj.js";import"./permission-CPkOJvoL.js";import"./index.esm-BbJ-E9Fa.js";import"./collapse-ovihQ28h.js";import"./blocklet-BsrHxy7u.js";import"./Switch-HHgrswMy.js";import"./iframe-DFHa3Bnb.js";import"./ChevronLeft-CL9U9Ud2.js";import"./ChevronRight-Bc6eTl0w.js";import"./index-DBii9-f-.js";import"./base-chart-C2D8ik1f.js";import"./index-DCGA-YsH.js";import"./AdapterDayjs-DYEBhhQV.js";import"./useThemeProps-xtuvHn9l.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.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"})),Ut=Ge(e.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"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(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},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const H=await oe(c,o.receiver);await be(1),q({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){U.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{aG as qe,j as e,dr as js,gv as ws,it as _s,m as ce,bn as ye,N as O,az as je,H as V,o as g,f as gt,r as R,g as we,bA as st,b as Ce,J as ee,X as Bn,bz as ft,Y as xe,iu as Ss,t as ve,s as oe,a4 as me,aV as oo,T as le,$ as Yt,dG as mt,y as ke,b8 as Es,bE as ks,E as H,b1 as Rs,gi as Ts,gj as Ps,C as be,f4 as so,hv as qn,x as Is,ax as Gt,w as Ds,iv as Bs,iw as Os,v as Be,ix as Us,Z as Ns,a0 as Ls,iy as io,bo as ao,U as Ne,f6 as As,f1 as Ms,aB as zs,aC as qs,bk as Fs,aD as $s,aE as fe,aO as Ws,cN as Hs,S as Gs,eN as or,bi as Ks,h as Vs,dv as It,iz as Ys,g1 as lo,iA as Zs,iB as Qs,ey as pe,iC as co,dE as Xs,gM as Js,h9 as ei,fR as ti,iD as ni,cE as sr,hq as Fn,av as ri,dH as Zt,dn as Me,bq as oi,br as ir,z as uo,cq as si,G as ze,aP as ar,fO as po,cr as Ke,h5 as ii,by as kt,hy as ai,fl as lr,bg as li,L as xt,F as fo,bm as ci,_ as di,O as Rt,aZ as $n,iE as ui,a_ as Le,aA as cr,cL as pi,ad as it,aM as mo,bS as Wn,cw as fi,iF as mi,b9 as hi,A as ho,aU as On,p as gi,aS as ut,P as un,W as xi,bB as go,aJ as yi,bt as vi,aR as Ci,fc as dr,iG as ur,gF as pr,V as fr,cK as bi,gD as ji,bR as wi,iH as _i}from"./index-CudWnmhY.js";import{y as Si}from"./index-cbnPwsDp.js";import{a as Ei,c as ki,d as Ri,u as Hn,R as Ti}from"./actions-CVRAzq1M.js";import{S as Pi}from"./switch-control-DKCRS-8f.js";import{u as De}from"./blocklet-CdpF9xGA.js";import{P as Un,w as Qt}from"./permission-D6gXDcTa.js";import{E as xo}from"./Edit-YsW7O5r6.js";import{T as Ii,M as Di,t as Bi}from"./table-icons-CWA0F6JZ.js";import{s as Oi,F as yo,L as Ui,I as Ni,a as Tt,S as Li,B as Ai}from"./preference-DjNHH5W9.js";import{C as mr}from"./click-to-copy-Dl43DhC6.js";import{v as pn}from"./index-DsWFyc_U.js";import{A as Mi}from"./Add-C983Xxy8.js";import{A as Xt}from"./Link-BaMGrObG.js";import{C as zi,c as qi,b as Fi,f as vo,A as $i,_ as Wi,a as Hi,e as Gi,d as Co,s as Ki,L as Vi,u as Yi,g as Zi,S as Qi}from"./item-BnxCdJvP.js";import{T as Xi,L as Ji,a as Nn,u as hr,W as ea,P as ta}from"./index-B4Gkg81f.js";import{e as bo}from"./engine-BCeC1m92.js";import{u as na,C as ra,D as oa,a as sa,b as ia}from"./connect-to-ClpTOWYj.js";import{C as aa,u as la,A as ca}from"./agreement-BFlXBhVm.js";import{A as da,a as ua,b as pa,c as fa,R as ot,S as dt}from"./collapse-8CbQrzXn.js";import{D as jo}from"./Done-DueUo9UO.js";import{C as ma,a as ha}from"./Google-lTUwsqy9.js";import{I as wo,f as ga,a as xa,B as ya}from"./install-from-url-BSerDRve.js";import{a as gr}from"./api-pS-YWf8k.js";import{v as _o,e as va,a as Kt}from"./util-BL8HXMf5.js";import{u as So}from"./use-mobile-ByZ7-kMP.js";import{A as Ca}from"./ArrowDropDown-BGdQ_v7I.js";import{u as ba}from"./useLocalStorage-C7P_-Tkf.js";import{r as Jt}from"./index-8xiSTm96.js";import{b as en}from"./without-wallet-vbeo4KSB.js";import{E as Eo}from"./ErrorOutline-EfUNg4qf.js";import{H as ja}from"./HelpOutline-BCw-yQQi.js";import{D as tn,W as ht,R as wa,a as xr}from"./url-evaluation-BriA-wER.js";import{L as ko}from"./Launch-B7x9htxW.js";import{D as _a}from"./delete-confirm-VJtte6ge.js";import{B as Ro}from"./status-BDdsaRDY.js";import{A as To}from"./actions-CZfqqh6l.js";import{v as fn}from"./index-BTiudSd3.js";import{t as Sa}from"./toUpper-BMEJ2_h2.js";import{S as Ea}from"./Switch-BRtydIan.js";import{a as ka}from"./team-BDaMVhz3.js";import"./MoreVert-CScSHXZ3.js";import"./get-safe-url-DpaJjz3Y.js";import"./ButtonGroup-Cl7gTm9Q.js";import"./getValidReactChildren-CKPRpUiq.js";import"./FilterList-CXwHvN0d.js";import"./CSSTransition-BCxZd18L.js";import"./emotion-cache.browser.esm-C9Oo18CI.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-CetBDte5.js";import"./redux-DfszZyTl.js";import"./useThemeProps-C0qH78Uf.js";import"./html-title-O-KFEc2K.js";import"./Clear-C1ky0VqG.js";import"./ChevronRight-CqlYVEsM.js";import"./ChevronLeft-ax3UHigO.js";import"./Search-CDkaJ72m.js";import"./omit-BOD0k9KL.js";import"./edit.svg-DKSrjOQe.js";import"./index-CZp4WEvN.js";import"./iframe-CqfQkE2b.js";import"./Verified-RAhSnU3J.js";import"./Autocomplete-DjqVsFBO.js";import"./ListSubheader-BErtdoID.js";import"./VerifiedUser-DOBjtgbs.js";import"./DeleteOutline-DdUUeo5n.js";import"./url-join-CwRQ_rqX.js";import"./index-BojVbZw0.js";import"./spaces-BsTM83wK.js";import"./OpenInNew-RSqDXAHN.js";import"./index-DRYJ0xIl.js";import"./index-CbFs9VSg.js";import"./decode-DPztD6kB.js";import"./cloneDeep-BPHeHKzF.js";import"./ListItemButton-DsaQ2Wd9.js";import"./Stepper-BWPy-rcR.js";import"./is-path-prefix-equal-BeCWfmHv.js";const Ra=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ta=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Po=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Pa=qe(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Io=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Ia=qe(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Da=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Ba=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Oa=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function yr(t,r){var n={};return r=js(r),ws(t,function(i,a,s){_s(n,a,r(i,a,s))}),n}function Do({children:t=null,...r}){const{t:n}=ce(),{api:i}=ye(),{blocklet:a}=De(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),V.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){V.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(je,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Pi,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Do.propTypes={children:g.any};function vr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Ua={...yr(Bi,vr),...yr(Ei,vr)},Na=(t,r)=>{let{description:n}=t;return(Object.values(Ce.CHAIN_PROP_MAP).includes(t.key)||ee.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},mn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,Cr=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),hn=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Bo({blocklet:t,ancestors:r=[]}){const n=ye(),{palette:i}=gt(),{inService:a}=n,{t:s}=R.useContext(we),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>V.success(s("blocklet.config.changedTip")),d=o=>mn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,b)=>{if(!o.key.trim()||!o.value.trim()){V.error(s("blocklet.config.environment.keyValueRequired")),b();return}if(Cr(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),b();return}o.custom=hn(o.key);try{const T=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),y=(o,h)=>new Promise(async(b,T)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){V.error(s("blocklet.config.environment.keyValueRequired")),T();return}if(Cr(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),T();return}if(o.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Ss(o);if(M){V.error(M),T();return}}const E=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),T();return}E.push({key:h.key,custom:hn(o.key)})}try{const M=await n.api.configBlocklet({input:{did:m,configs:E}});c(M.blocklet),b()}catch(M){V.error(xe(M)),T()}}),p=o=>new Promise(async(h,b)=>{if(o.required){V.error(s("blocklet.config.environment.deleteForbidden")),b();return}if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),b();return}try{const T=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:hn(o.key)}]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),C=(t.configs||[]).filter(o=>!Ce.BLOCKLET_CONFIGURABLE_KEY[o.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ee.getSharedConfigObj(r[0],t),x=ee.getComponentMissingConfigs(t,r[0]),_=C.map(o=>({...o,value:Object.values(Ce.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),w=_.some(o=>o.key&&o.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(mr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsx(br,{children:e.jsx(ve,{fullWidth:!0,size:"small",value:Oi.escapeTag(h),onChange:E=>T(E.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(mr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsxs(br,{children:[e.jsx(ve,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:E=>T(E.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Na(b,s)]})}}];return e.jsxs(La,{children:[!!x.length&&e.jsx(Bn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),w&&e.jsx(Bn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Ii,{className:"config-table",children:e.jsx(Di,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Ua,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:_,editable:o?S:{}})})})]})}Bo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const La=oe.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DXl9XsWD.js","./index-BZespPOM.js","./index-DGkT7afN.css","./url-join-z6NqiL_x.js","./index-BODLs31o.js","./_createAggregator-SgttUPFo.js","./depsEqual-BFSrxEra.js","./index-B8u66ccG.js","./index-DRYJ0xIl.js","./toUpper-B0rGF93a.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aG as qe,j as e,dr as js,gv as ws,it as _s,m as ce,bn as ye,N as O,az as je,H as V,o as g,f as gt,r as R,g as we,bA as st,b as Ce,J as ee,X as Bn,bz as ft,Y as xe,iu as Ss,t as ve,s as oe,a4 as me,aV as oo,T as le,$ as Yt,dG as mt,y as ke,b8 as Es,bE as ks,E as H,b1 as Rs,gi as Ts,gj as Ps,C as be,f4 as so,hv as qn,x as Is,ax as Gt,w as Ds,iv as Bs,iw as Os,v as Be,ix as Us,Z as Ns,a0 as Ls,iy as io,bo as ao,U as Ne,f6 as As,f1 as Ms,aB as zs,aC as qs,bk as Fs,aD as $s,aE as fe,aO as Ws,cN as Hs,S as Gs,eN as or,bi as Ks,h as Vs,dv as It,iz as Ys,g1 as lo,iA as Zs,iB as Qs,ey as pe,iC as co,dE as Xs,gM as Js,h9 as ei,fR as ti,iD as ni,cE as sr,hq as Fn,av as ri,dH as Zt,dn as Me,bq as oi,br as ir,z as uo,cq as si,G as ze,aP as ar,fO as po,cr as Ke,h5 as ii,by as kt,hy as ai,fl as lr,bg as li,L as xt,F as fo,bm as ci,_ as di,O as Rt,aZ as $n,iE as ui,a_ as Le,aA as cr,cL as pi,ad as it,aM as mo,bS as Wn,cw as fi,iF as mi,b9 as hi,A as ho,aU as On,p as gi,aS as ut,P as un,W as xi,bB as go,aJ as yi,bt as vi,aR as Ci,fc as dr,iG as ur,gF as pr,V as fr,cK as bi,gD as ji,bR as wi,iH as _i}from"./index-BZespPOM.js";import{y as Si}from"./index-KmXKa6Be.js";import{a as Ei,c as ki,d as Ri,u as Hn,R as Ti}from"./actions-Dbq5WW4S.js";import{S as Pi}from"./switch-control-Baw4DU9M.js";import{u as De}from"./blocklet-BsrHxy7u.js";import{P as Un,w as Qt}from"./permission-CPkOJvoL.js";import{E as xo}from"./Edit-BF520bmv.js";import{T as Ii,M as Di,t as Bi}from"./table-icons-DnTt_sYt.js";import{s as Oi,F as yo,L as Ui,I as Ni,a as Tt,S as Li,B as Ai}from"./preference-4Mq3esV_.js";import{C as mr}from"./click-to-copy-kcafHn28.js";import{v as pn}from"./index-DYOkPaFV.js";import{A as Mi}from"./Add-CH4q_X39.js";import{A as Xt}from"./Link-C5eJ_71C.js";import{C as zi,c as qi,b as Fi,f as vo,A as $i,_ as Wi,a as Hi,e as Gi,d as Co,s as Ki,L as Vi,u as Yi,g as Zi,S as Qi}from"./item-B8R6funP.js";import{T as Xi,L as Ji,a as Nn,u as hr,W as ea,P as ta}from"./index-DrnQFJwP.js";import{e as bo}from"./engine-C3JOecTH.js";import{u as na,C as ra,D as oa,a as sa,b as ia}from"./connect-to-uq35os4q.js";import{C as aa,u as la,A as ca}from"./agreement-BLQTYZdW.js";import{A as da,a as ua,b as pa,c as fa,R as ot,S as dt}from"./collapse-ovihQ28h.js";import{D as jo}from"./Done-CrprtcbS.js";import{C as ma,a as ha}from"./Google-skK3_8TA.js";import{I as wo,f as ga,a as xa,B as ya}from"./install-from-url-Bk783uEF.js";import{a as gr}from"./api-DBAdcY7Y.js";import{v as _o,e as va,a as Kt}from"./util-DVhqJIPT.js";import{u as So}from"./use-mobile-xfMBWCKy.js";import{A as Ca}from"./ArrowDropDown-BMnba6Vw.js";import{u as ba}from"./useLocalStorage-BATGmdsj.js";import{r as Jt}from"./index-BODLs31o.js";import{b as en}from"./without-wallet-CzH45fgt.js";import{E as Eo}from"./ErrorOutline-CMjv_M5Z.js";import{H as ja}from"./HelpOutline-DBf34kya.js";import{D as tn,W as ht,R as wa,a as xr}from"./url-evaluation-0Ld63BSR.js";import{L as ko}from"./Launch-BxgDQBBH.js";import{D as _a}from"./delete-confirm-CpB84VZ0.js";import{B as Ro}from"./status-CinggnF7.js";import{A as To}from"./actions-2Eezqpj7.js";import{v as fn}from"./index-p0X9z0NX.js";import{t as Sa}from"./toUpper-B0rGF93a.js";import{S as Ea}from"./Switch-HHgrswMy.js";import{a as ka}from"./team-DXepnqEQ.js";import"./MoreVert-CHcg5zqX.js";import"./get-safe-url-sCysExm8.js";import"./ButtonGroup-CSxIJOY5.js";import"./getValidReactChildren-CYitcrPj.js";import"./FilterList-C18CrBe9.js";import"./CSSTransition-CDcifbyC.js";import"./emotion-cache.browser.esm-iSeSOev6.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-3D6HsxHD.js";import"./redux-DfszZyTl.js";import"./useThemeProps-xtuvHn9l.js";import"./html-title-DO6a4GD4.js";import"./Clear-Dwp04hnZ.js";import"./ChevronRight-Bc6eTl0w.js";import"./ChevronLeft-CL9U9Ud2.js";import"./Search-CKP7F1ON.js";import"./omit-CGWF9ryF.js";import"./edit.svg-906tK9QW.js";import"./index-B8u66ccG.js";import"./iframe-DFHa3Bnb.js";import"./Verified-6eCsFC48.js";import"./Autocomplete-D0g_jxM8.js";import"./ListSubheader-B-HKDAjF.js";import"./VerifiedUser-PMYsirAs.js";import"./DeleteOutline-CIdo_KSP.js";import"./url-join-z6NqiL_x.js";import"./index-BojVbZw0.js";import"./spaces-DhOd7qI3.js";import"./OpenInNew-f4_gudHi.js";import"./index-DRYJ0xIl.js";import"./index-C6y2gpuw.js";import"./decode-DPztD6kB.js";import"./cloneDeep-DcXoweHd.js";import"./ListItemButton-C_ORHHRF.js";import"./Stepper-M_-BBKKX.js";import"./is-path-prefix-equal-ZK7BEh7c.js";const Ra=qe(e.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ta=qe(e.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Po=qe(e.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Pa=qe(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Io=qe(e.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Ia=qe(e.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Da=qe(e.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Ba=qe(e.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Oa=qe(e.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function yr(t,r){var n={};return r=js(r),ws(t,function(i,a,s){_s(n,a,r(i,a,s))}),n}function Do({children:t=null,...r}){const{t:n}=ce(),{api:i}=ye(),{blocklet:a}=De(),s=a?.settings?.autoCheckUpdate,m=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!s?.enabled;await m({enabled:l}),V.success(n(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){V.error(l.message)}},d=!!s?.enabled;return e.jsxs(O,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t,e.jsx(je,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Pi,{checked:d,onChange:c,name:"enableWelcomePage",style:{...r.style,zoom:.8}})})})]})}Do.propTypes={children:g.any};function vr(t){function r({sx:n,...i}){return e.jsx(t,{...i,sx:{color:"text.primary",...n}})}return r}const Ua={...yr(Bi,vr),...yr(Ei,vr)},Na=(t,r)=>{let{description:n}=t;return(Object.values(Ce.CHAIN_PROP_MAP).includes(t.key)||ee.isEnvShareable(t))&&(n?n=`${n} (${r("blocklet.config.sharedToAllComponents")})`:n=r("blocklet.config.sharedToAllComponents")),n&&e.jsx("div",{style:{marginLeft:12},children:n})},mn=(t,r,n=[])=>!n?.length&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!r.meta.environments.find(i=>i.name===t.key)&&r.children.every(i=>!i.meta.environments.find(a=>a.name===t.key))?!0:t.custom,Cr=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),hn=t=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Bo({blocklet:t,ancestors:r=[]}){const n=ye(),{palette:i}=gt(),{inService:a}=n,{t:s}=R.useContext(we),m=[...r.map(o=>o.meta.did),t.meta.did],c=()=>V.success(s("blocklet.config.changedTip")),d=o=>mn(o,t,r);if(st(t.status)||t.status==="unknown"&&st(t.status))return null;const l=o=>new Promise(async(h,b)=>{if(!o.key.trim()||!o.value.trim()){V.error(s("blocklet.config.environment.keyValueRequired")),b();return}if(Cr(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),b();return}o.custom=hn(o.key);try{const T=await n.api.configBlocklet({input:{did:m,configs:[o]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),y=(o,h)=>new Promise(async(b,T)=>{if(o.required&&(!o.key.trim()||!o.value.trim())){V.error(s("blocklet.config.environment.keyValueRequired")),T();return}if(Cr(o.key)===!1){V.error(s("blocklet.config.environment.invalidKey")),T();return}if(o.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=Ss(o);if(M){V.error(M),T();return}}const E=[{...o,value:o.secure&&o.value==="__encrypted__"?"":o.value}];if(o.key!==h.key){if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),T();return}E.push({key:h.key,custom:hn(o.key)})}try{const M=await n.api.configBlocklet({input:{did:m,configs:E}});c(M.blocklet),b()}catch(M){V.error(xe(M)),T()}}),p=o=>new Promise(async(h,b)=>{if(o.required){V.error(s("blocklet.config.environment.deleteForbidden")),b();return}if(!mn(o,t,r)){V.error("Only key of custom env can be changed"),b();return}try{const T=await n.api.configBlocklet({input:{did:m,configs:[{key:o.key,custom:hn(o.key)}]}});c(T.blocklet),h()}catch(T){V.error(xe(T)),b()}}),C=(t.configs||[]).filter(o=>!Ce.BLOCKLET_CONFIGURABLE_KEY[o.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(o.key)),f=ee.getSharedConfigObj(r[0],t),x=ee.getComponentMissingConfigs(t,r[0]),_=C.map(o=>({...o,value:Object.values(Ce.CHAIN_PROP_MAP).includes(o.key)&&Object.keys(f).includes(o.key)?f[o.key]:f[o.key]||o.value})),w=_.some(o=>o.key&&o.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:o=>e.jsx(mr,{value:o.value,style:{color:o.required&&!o.value?i.error.main:i.text.primary,fontWeight:o.required?"bold":"normal"},children:o.key}),editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsx(br,{children:e.jsx(ve,{fullWidth:!0,size:"small",value:Oi.escapeTag(h),onChange:E=>T(E.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:o=>o.value?o.secure?"******":e.jsx(mr,{unstyled:!0,value:o.value,style:{wordBreak:"break-all"},children:o.value}):null,editComponent:o=>{const{value:h,rowData:b,onChange:T}=o;return e.jsxs(br,{children:[e.jsx(ve,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:E=>T(E.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Na(b,s)]})}}];return e.jsxs(La,{children:[!!x.length&&e.jsx(Bn,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),w&&e.jsx(Bn,{severity:"info",children:s("blocklet.config.environment.tip")}),e.jsx(Un,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:o=>e.jsx(Ii,{className:"config-table",children:e.jsx(Di,{title:e.jsx(O,{sx:{fontWeight:"bold"},children:s("common.environments")}),columns:u(),icons:Ua,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:_,editable:o?S:{}})})})]})}Bo.propTypes={blocklet:g.object.isRequired,ancestors:g.array};const La=oe.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -66,7 +66,7 @@ import{aG as qe,j as e,dr as js,gv as ws,it as _s,m as ce,bn as ye,N as O,az as
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,Ma=R.lazy(()=>ks(()=>import("./index-
|
|
69
|
+
`,Ma=R.lazy(()=>ks(()=>import("./index-DXl9XsWD.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(t=>({default:t.Uploader}))),za="/blocklet/component/upload",jr=[".html",".htm",".tgz",".zip"],qa=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||H.MAX_UPLOAD_FILE_SIZE,Fa=qa*1024*1024;function Oo({did:t,prefix:r,headers:n=()=>({}),onUploaded:i=mt,open:a=!1,onClose:s=mt}){const{t:m,locale:c}=ce(),d=R.useRef(null),l=R.useCallback(y=>{const{status:p,data:C}=y;if(p===200){i(C);return}V.error(m("blocklet.component.addComponentTip.uploadFailed"))},[i,m]);return R.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),e.jsx($a,{id:`component-uploader-${t}`,children:e.jsx(Ma,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:s,installerProps:{disabled:!0},apiPathProps:{uploader:ke(r,za,t),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:jr,maxFileSize:Fa,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:m("blocklet.component.addComponentTip.allowedFileTypes",{types:jr.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${t}`)}Oo.propTypes={did:g.string.isRequired,prefix:g.string.isRequired,open:g.bool,headers:g.func,onUploaded:g.func,onClose:g.func};const $a=Es(O)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cE as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cR as qm,be as JL,r as QL}from"./index-
|
|
1
|
+
import{cE as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cR as qm,be as JL,r as QL}from"./index-BZespPOM.js";/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-CudWnmhY.js";import{T as ut}from"./html-title-O-KFEc2K.js";import{u as L}from"./blocklet-CdpF9xGA.js";import{u as mt}from"./use-mobile-ByZ7-kMP.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-ClpTOWYj.js";import"./index-DsWFyc_U.js";import"./index-BojVbZw0.js";import"./api-pS-YWf8k.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-BsTM83wK.js";import{v as Rt}from"./index-BTiudSd3.js";import{E as zt}from"./index-LeZ1xWOy.js";import{H as vt}from"./HelpOutline-BCw-yQQi.js";import{H as Pt}from"./index-BGGMir5f.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-CVRAzq1M.js";import{D as Lt}from"./DeleteOutline-DdUUeo5n.js";import{g as ke}from"./get-safe-url-DpaJjz3Y.js";import{S as Ot}from"./switch-control-DKCRS-8f.js";import{L as je}from"./list-header-Dkv0GpZF.js";import"./OpenInNew-RSqDXAHN.js";import"./ButtonGroup-Cl7gTm9Q.js";import"./getValidReactChildren-CKPRpUiq.js";import"./FilterList-CXwHvN0d.js";import"./CSSTransition-BCxZd18L.js";import"./emotion-cache.browser.esm-C9Oo18CI.js";import"./index-pvy0YsL_.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C2ZOCVCb.js";import"./index-cbnPwsDp.js";import"./TableSearch-BpVsXhRC.js";import"./Search-CDkaJ72m.js";import"./Clear-C1ky0VqG.js";import"./MoreVert-CScSHXZ3.js";import"./useLocalStorage-C7P_-Tkf.js";import"./url-evaluation-BriA-wER.js";import"./permission-D6gXDcTa.js";import"./Switch-BRtydIan.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-BZespPOM.js";import{T as ut}from"./html-title-DO6a4GD4.js";import{u as L}from"./blocklet-BsrHxy7u.js";import{u as mt}from"./use-mobile-xfMBWCKy.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-uq35os4q.js";import"./index-DYOkPaFV.js";import"./index-BojVbZw0.js";import"./api-DBAdcY7Y.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-DhOd7qI3.js";import{v as Rt}from"./index-p0X9z0NX.js";import{E as zt}from"./index-DCGA-YsH.js";import{H as vt}from"./HelpOutline-DBf34kya.js";import{H as Pt}from"./index-CuqMV1UW.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-Dbq5WW4S.js";import{D as Lt}from"./DeleteOutline-CIdo_KSP.js";import{g as ke}from"./get-safe-url-sCysExm8.js";import{S as Ot}from"./switch-control-Baw4DU9M.js";import{L as je}from"./list-header-DiNsae5e.js";import"./OpenInNew-f4_gudHi.js";import"./ButtonGroup-CSxIJOY5.js";import"./getValidReactChildren-CYitcrPj.js";import"./FilterList-C18CrBe9.js";import"./CSSTransition-CDcifbyC.js";import"./emotion-cache.browser.esm-iSeSOev6.js";import"./index-BS9HZZVH.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BFSrxEra.js";import"./index-KmXKa6Be.js";import"./TableSearch-BOHK_oe9.js";import"./Search-CKP7F1ON.js";import"./Clear-Dwp04hnZ.js";import"./MoreVert-CHcg5zqX.js";import"./useLocalStorage-BATGmdsj.js";import"./url-evaluation-0Ld63BSR.js";import"./permission-CPkOJvoL.js";import"./Switch-HHgrswMy.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ue({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Le.propTypes={metadata:m.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(U,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(U,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):q(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as de,j as e,hg as Ps,hh as Ts,bL as Es,r as L,s as ve,N as A,f4 as wt,t as U,eN as ht,a4 as ne,C as Ee,bi as zt,dK as Is,o as T,hi as Ds,b2 as Bt,cw as Ls,cP as qs,dn as Ms,T as K,dF as at,bn as re,bz as ft,g as ue,hj as zs,bA as mt,b as W,bg as X,dH as Q,H as Z,aV as ie,m as ae,n as Ht,q as Bs,w as Nt,ad as Hs,J as Ft,ga as Ns,hk as Fs,au as Zs,aU as G,V as Te,$ as ke,D as Vs,X as Us,v as se,Y as it,hl as Ws,hm as Js,ez as Ks,eB as Gs,I as je,E as J,hn as Ys,cX as kt,W as Xs,fl as Zt,az as ee,aR as St,ho as Qs,f8 as Re,cr as I,by as ge,aE as te,Q as Y,aP as ye,hp as qe,a2 as er,hq as Je,c2 as Ce,eC as tr,hr as sr,dG as ce,f as $e,y as Vt,bv as ot,O as rr,cD as Ut,g9 as nr,fO as Ze,hs as ar,b9 as ir,L as or,cq as ze,aK as He,ht as lr,U as cr,ag as Ct,a3 as Wt,bj as Ne,hu as Jt,b6 as dr,gz as we,f9 as Kt,cV as Gt,B as ur,b5 as Rt,fa as hr,ff as fr,G as Ke,M as mr,bt as pr}from"./index-CudWnmhY.js";import{F as gr,a as yr,s as vr,L as _e,S as xr,B as br}from"./preference-DjNHH5W9.js";import{N as $t}from"./ChevronRight-CqlYVEsM.js";import{T as Fe}from"./html-title-O-KFEc2K.js";import{w as Ie,P as jr}from"./permission-D6gXDcTa.js";import{u as pt}from"./index-CJpAfjZ_.js";import{D as _r}from"./Done-DueUo9UO.js";import{R as wr,S as M}from"./collapse-8CbQrzXn.js";import{A as kr,a as At}from"./Autocomplete-DjqVsFBO.js";import{C as Sr,R as Cr,S as Rr,P as $r}from"./rotate-session-key-B8PMc0wh.js";import{u as oe}from"./blocklet-CdpF9xGA.js";import{C as Ar}from"./click-to-copy-Dl43DhC6.js";import{u as Ve}from"./team-BDaMVhz3.js";import{v as Yt}from"./index-BTiudSd3.js";import{g as Or}from"./chain-DhrkyUZN.js";import{V as Pr,d as Tr}from"./status-BvjQPj2z.js";import{S as pe}from"./Switch-BRtydIan.js";import{B as Er}from"./index-BeI9Ztw4.js";import{y as Ir}from"./index-cbnPwsDp.js";import{I as Dr,J as Lr,K as qr,L as Mr}from"./index-pvy0YsL_.js";import{u as xe,C as B,b as Ot}from"./index.esm-WKN691rM.js";import{S as Be,u as zr}from"./switch-control-DKCRS-8f.js";import{D as Pt,R as Xt,a as Qt}from"./url-evaluation-BriA-wER.js";import{A as Tt}from"./Add-C983Xxy8.js";import{H as Ue}from"./index-BGGMir5f.js";import{l as Br}from"./index-sw8QTVdD.js";import{u as es}from"./use-mobile-ByZ7-kMP.js";import{S as Ge}from"./simple-select-CErMpi--.js";import{G as Hr}from"./actions-CVRAzq1M.js";import{C as Nr}from"./CardContent-Dbzg5wyq.js";import"./omit-BOD0k9KL.js";import"./index-8xiSTm96.js";import"./edit.svg-DKSrjOQe.js";import"./ArrowDropDown-BGdQ_v7I.js";import"./ButtonGroup-Cl7gTm9Q.js";import"./getValidReactChildren-CKPRpUiq.js";import"./index-CZp4WEvN.js";import"./iframe-CqfQkE2b.js";import"./ListSubheader-BErtdoID.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-EfUNg4qf.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-CXwHvN0d.js";import"./CSSTransition-BCxZd18L.js";import"./emotion-cache.browser.esm-C9Oo18CI.js";import"./depsEqual-C2ZOCVCb.js";import"./TableSearch-BpVsXhRC.js";import"./Search-CDkaJ72m.js";import"./Clear-C1ky0VqG.js";import"./MoreVert-CScSHXZ3.js";import"./useLocalStorage-C7P_-Tkf.js";import"./get-safe-url-DpaJjz3Y.js";const ts=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),lt=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),ss=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,Et=Qr.splice;function en(x,R,$,C){var _=Ts,j=-1,p=R.length,a=x;for(x===R&&(R=Ps(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(a,h,m))>-1;)a!==x&&Et.call(a,m,1),Et.call(x,m,1);return x}function tn(x,R){return x&&x.length&&R&&R.length?en(x,R):x}var sn=Es(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function rs({label:x="",disabled:R=!1,required:$=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:a=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,i]=L.useState(!1),[u,g]=L.useState(!1),[y,k]=L.useState(""),w=L.useRef(null),[d,v]=L.useState(C),[b,S]=L.useState(d),O=L.useMemo(()=>{if(!m)return{};const q={};return m.forEach(z=>{q[z.code]=z}),q},[m]),P=()=>{if(!m)return[];if(!y)return m.map(z=>z.code);const q=new RegExp(y.toLowerCase());return m.filter(z=>{for(let N=0;N<r.length;N++){const V=r[N];if(q.test(z[V]?.toLowerCase()))return!0}return!1}).map(z=>z.code)},D=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),v(C)):(S(b),v(b))}catch{S(d)}finally{g(!1),i(!1)}},E=(q,z)=>{if(!Array.isArray(z)){S([]),_([]);return}const N=z.filter(V=>O[V]);if(!N.length){S([]),_([]);return}S(N),_(N)},H=q=>{q.stopPropagation(),i(!0),setTimeout(()=>{if(w.current){const z=w.current.querySelector("input");z&&z.focus()}},500)},F=n?e.jsx(kr,{ref:w,options:m,value:b,onChange:E,inputValue:y,onInputChange:(q,z)=>{k(z)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:q=>O[q]?.name,renderInput:q=>e.jsx(U,{...q,label:"",placeholder:t}),renderOption:(q,z)=>{const N=b.indexOf(z)!==-1;return L.createElement(nn,{component:"li",...q,key:z},l(O[z]||{}),e.jsx(A,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:o(z,O[z])||O[z]?.name}),e.jsx(A,{component:wt,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx(A,{className:"form-item-input slot",onClick:H,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(q=>m.some(z=>z.code===q)).map(q=>e.jsx(ht,{label:m.find(z=>z.code===q).name,style:{marginRight:8},size:"small"},q))});return e.jsx(gr,{className:"form",style:j,children:e.jsxs(A,{className:"form-item",children:[e.jsxs(A,{className:"form-item-label",children:[x,$&&e.jsx(wr,{})]}),e.jsxs(A,{className:"form-item-body",children:[e.jsx(A,{className:"form-item-input",children:F}),n?e.jsx(A,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ne,{"data-cy":"schema-form-item-confirm",onClick:D,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(_r,{})}),e.jsx(ne,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),i(!1)},disabled:R||u,size:"large",children:e.jsx(wt,{})})]})}):null]}),n&&h&&e.jsx(zt,{children:h})]})})}rs.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=ve.div`
|
|
1
|
+
import{aG as de,j as e,hg as Ps,hh as Ts,bL as Es,r as L,s as ve,N as A,f4 as wt,t as U,eN as ht,a4 as ne,C as Ee,bi as zt,dK as Is,o as T,hi as Ds,b2 as Bt,cw as Ls,cP as qs,dn as Ms,T as K,dF as at,bn as re,bz as ft,g as ue,hj as zs,bA as mt,b as W,bg as X,dH as Q,H as Z,aV as ie,m as ae,n as Ht,q as Bs,w as Nt,ad as Hs,J as Ft,ga as Ns,hk as Fs,au as Zs,aU as G,V as Te,$ as ke,D as Vs,X as Us,v as se,Y as it,hl as Ws,hm as Js,ez as Ks,eB as Gs,I as je,E as J,hn as Ys,cX as kt,W as Xs,fl as Zt,az as ee,aR as St,ho as Qs,f8 as Re,cr as I,by as ge,aE as te,Q as Y,aP as ye,hp as qe,a2 as er,hq as Je,c2 as Ce,eC as tr,hr as sr,dG as ce,f as $e,y as Vt,bv as ot,O as rr,cD as Ut,g9 as nr,fO as Ze,hs as ar,b9 as ir,L as or,cq as ze,aK as He,ht as lr,U as cr,ag as Ct,a3 as Wt,bj as Ne,hu as Jt,b6 as dr,gz as we,f9 as Kt,cV as Gt,B as ur,b5 as Rt,fa as hr,ff as fr,G as Ke,M as mr,bt as pr}from"./index-BZespPOM.js";import{F as gr,a as yr,s as vr,L as _e,S as xr,B as br}from"./preference-4Mq3esV_.js";import{N as $t}from"./ChevronRight-Bc6eTl0w.js";import{T as Fe}from"./html-title-DO6a4GD4.js";import{w as Ie,P as jr}from"./permission-CPkOJvoL.js";import{u as pt}from"./index-BjY-2jMh.js";import{D as _r}from"./Done-CrprtcbS.js";import{R as wr,S as M}from"./collapse-ovihQ28h.js";import{A as kr,a as At}from"./Autocomplete-D0g_jxM8.js";import{C as Sr,R as Cr,S as Rr,P as $r}from"./rotate-session-key-CDkb7ngK.js";import{u as oe}from"./blocklet-BsrHxy7u.js";import{C as Ar}from"./click-to-copy-kcafHn28.js";import{u as Ve}from"./team-DXepnqEQ.js";import{v as Yt}from"./index-p0X9z0NX.js";import{g as Or}from"./chain-zv9j2aZo.js";import{V as Pr,d as Tr}from"./status-DV5gY90N.js";import{S as pe}from"./Switch-HHgrswMy.js";import{B as Er}from"./index-DfgKFBPH.js";import{y as Ir}from"./index-KmXKa6Be.js";import{I as Dr,J as Lr,K as qr,L as Mr}from"./index-BS9HZZVH.js";import{u as xe,C as B,b as Ot}from"./index.esm-BbJ-E9Fa.js";import{S as Be,u as zr}from"./switch-control-Baw4DU9M.js";import{D as Pt,R as Xt,a as Qt}from"./url-evaluation-0Ld63BSR.js";import{A as Tt}from"./Add-CH4q_X39.js";import{H as Ue}from"./index-CuqMV1UW.js";import{l as Br}from"./index-B4bGqzxK.js";import{u as es}from"./use-mobile-xfMBWCKy.js";import{S as Ge}from"./simple-select-BjcK9LP5.js";import{G as Hr}from"./actions-Dbq5WW4S.js";import{C as Nr}from"./CardContent-BXfiG3ck.js";import"./omit-CGWF9ryF.js";import"./index-BODLs31o.js";import"./edit.svg-906tK9QW.js";import"./ArrowDropDown-BMnba6Vw.js";import"./ButtonGroup-CSxIJOY5.js";import"./getValidReactChildren-CYitcrPj.js";import"./index-B8u66ccG.js";import"./iframe-DFHa3Bnb.js";import"./ListSubheader-B-HKDAjF.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-CMjv_M5Z.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-C18CrBe9.js";import"./CSSTransition-CDcifbyC.js";import"./emotion-cache.browser.esm-iSeSOev6.js";import"./depsEqual-BFSrxEra.js";import"./TableSearch-BOHK_oe9.js";import"./Search-CKP7F1ON.js";import"./Clear-Dwp04hnZ.js";import"./MoreVert-CHcg5zqX.js";import"./useLocalStorage-BATGmdsj.js";import"./get-safe-url-sCysExm8.js";const ts=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),lt=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),ss=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,Et=Qr.splice;function en(x,R,$,C){var _=Ts,j=-1,p=R.length,a=x;for(x===R&&(R=Ps(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(a,h,m))>-1;)a!==x&&Et.call(a,m,1),Et.call(x,m,1);return x}function tn(x,R){return x&&x.length&&R&&R.length?en(x,R):x}var sn=Es(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function rs({label:x="",disabled:R=!1,required:$=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:a=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,i]=L.useState(!1),[u,g]=L.useState(!1),[y,k]=L.useState(""),w=L.useRef(null),[d,v]=L.useState(C),[b,S]=L.useState(d),O=L.useMemo(()=>{if(!m)return{};const q={};return m.forEach(z=>{q[z.code]=z}),q},[m]),P=()=>{if(!m)return[];if(!y)return m.map(z=>z.code);const q=new RegExp(y.toLowerCase());return m.filter(z=>{for(let N=0;N<r.length;N++){const V=r[N];if(q.test(z[V]?.toLowerCase()))return!0}return!1}).map(z=>z.code)},D=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),v(C)):(S(b),v(b))}catch{S(d)}finally{g(!1),i(!1)}},E=(q,z)=>{if(!Array.isArray(z)){S([]),_([]);return}const N=z.filter(V=>O[V]);if(!N.length){S([]),_([]);return}S(N),_(N)},H=q=>{q.stopPropagation(),i(!0),setTimeout(()=>{if(w.current){const z=w.current.querySelector("input");z&&z.focus()}},500)},F=n?e.jsx(kr,{ref:w,options:m,value:b,onChange:E,inputValue:y,onInputChange:(q,z)=>{k(z)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:q=>O[q]?.name,renderInput:q=>e.jsx(U,{...q,label:"",placeholder:t}),renderOption:(q,z)=>{const N=b.indexOf(z)!==-1;return L.createElement(nn,{component:"li",...q,key:z},l(O[z]||{}),e.jsx(A,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:o(z,O[z])||O[z]?.name}),e.jsx(A,{component:wt,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx(A,{className:"form-item-input slot",onClick:H,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(q=>m.some(z=>z.code===q)).map(q=>e.jsx(ht,{label:m.find(z=>z.code===q).name,style:{marginRight:8},size:"small"},q))});return e.jsx(gr,{className:"form",style:j,children:e.jsxs(A,{className:"form-item",children:[e.jsxs(A,{className:"form-item-label",children:[x,$&&e.jsx(wr,{})]}),e.jsxs(A,{className:"form-item-body",children:[e.jsx(A,{className:"form-item-input",children:F}),n?e.jsx(A,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ne,{"data-cy":"schema-form-item-confirm",onClick:D,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(_r,{})}),e.jsx(ne,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),i(!1)},disabled:R||u,size:"large",children:e.jsx(wt,{})})]})}):null]}),n&&h&&e.jsx(zt,{children:h})]})})}rs.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=ve.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,u as U,j as e,T as k,be as Q,N as i,s as D,b2 as X,o as l,g as $,i as M,d2 as Y,bk as ee,d as te,Z as re,C as ne,m as se,J as v,a as h,E as L,b,d3 as oe,M as ie,bt as ae,aE as le,d4 as me,G as C,H as R,k as ce,l as ue,A as de,bm as pe}from"./index-
|
|
1
|
+
import{r as a,u as U,j as e,T as k,be as Q,N as i,s as D,b2 as X,o as l,g as $,i as M,d2 as Y,bk as ee,d as te,Z as re,C as ne,m as se,J as v,a as h,E as L,b,d3 as oe,M as ie,bt as ae,aE as le,d4 as me,G as C,H as R,k as ce,l as ue,A as de,bm as pe}from"./index-BZespPOM.js";import{u as fe,T as xe}from"./html-title-DO6a4GD4.js";import{T as ge}from"./traffic-Btn2g9IR.js";import{H as he}from"./index-CuqMV1UW.js";import{x as V}from"./index-DRYJ0xIl.js";import{C as ye,M as T}from"./memory-D_JtngVx.js";import{C as ve}from"./CardContent-BXfiG3ck.js";import{u as Ce}from"./useLocalStorage-BATGmdsj.js";import{T as je,a as Ie}from"./ToggleButtonGroup-CMp7F25J.js";import"./iframe-DFHa3Bnb.js";import"./ChevronLeft-CL9U9Ud2.js";import"./ChevronRight-Bc6eTl0w.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./base-chart-C2D8ik1f.js";import"./index-DCGA-YsH.js";import"./AdapterDayjs-DYEBhhQV.js";import"./useThemeProps-xtuvHn9l.js";import"./CSSTransition-CDcifbyC.js";import"./visuallyHidden-Dan1xhjv.js";import"./FilterList-C18CrBe9.js";import"./emotion-cache.browser.esm-iSeSOev6.js";import"./index-BS9HZZVH.js";import"./redux-DfszZyTl.js";import"./depsEqual-BFSrxEra.js";import"./index-KmXKa6Be.js";import"./TableSearch-BOHK_oe9.js";import"./Search-CKP7F1ON.js";import"./Clear-Dwp04hnZ.js";import"./MoreVert-CHcg5zqX.js";import"./getValidReactChildren-CYitcrPj.js";const be=o=>a.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...o},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.08295 3.2C2.08295 2.58144 2.58439 2.08 3.20295 2.08H28.8029C29.4215 2.08 29.9229 2.58144 29.9229 3.2V13.44C29.9229 14.0586 29.4215 14.56 28.8029 14.56H3.20295C2.58439 14.56 2.08295 14.0586 2.08295 13.44V3.2ZM4.32295 4.32V12.32H27.6829V4.32H4.32295ZM2.08295 18.56C2.08295 17.9414 2.58439 17.44 3.20295 17.44H28.8029C29.4215 17.44 29.9229 17.9414 29.9229 18.56V28.8C29.9229 29.4186 29.4215 29.92 28.8029 29.92H3.20295C2.58439 29.92 2.08295 29.4186 2.08295 28.8V18.56ZM4.32295 19.68V27.68H27.6829V19.68H4.32295Z",fill:"currentColor"}),a.createElement("path",{d:"M8.96297 7.04001H7.68297C7.51323 7.04001 7.35044 7.10744 7.23042 7.22746C7.1104 7.34748 7.04297 7.51027 7.04297 7.68001V8.96001C7.04297 9.12975 7.1104 9.29253 7.23042 9.41256C7.35044 9.53258 7.51323 9.60001 7.68297 9.60001H8.96297C9.13271 9.60001 9.29549 9.53258 9.41552 9.41256C9.53554 9.29253 9.60297 9.12975 9.60297 8.96001V7.68001C9.60297 7.51027 9.53554 7.34748 9.41552 7.22746C9.29549 7.10744 9.13271 7.04001 8.96297 7.04001ZM8.96297 22.4H7.68297C7.51323 22.4 7.35044 22.4674 7.23042 22.5875C7.1104 22.7075 7.04297 22.8703 7.04297 23.04V24.32C7.04297 24.4897 7.1104 24.6525 7.23042 24.7726C7.35044 24.8926 7.51323 24.96 7.68297 24.96H8.96297C9.13271 24.96 9.29549 24.8926 9.41552 24.7726C9.53554 24.6525 9.60297 24.4897 9.60297 24.32V23.04C9.60297 22.8703 9.53554 22.7075 9.41552 22.5875C9.29549 22.4674 9.13271 22.4 8.96297 22.4ZM14.083 7.04001H12.803C12.6332 7.04001 12.4704 7.10744 12.3504 7.22746C12.2304 7.34748 12.163 7.51027 12.163 7.68001V8.96001C12.163 9.12975 12.2304 9.29253 12.3504 9.41256C12.4704 9.53258 12.6332 9.60001 12.803 9.60001H14.083C14.2527 9.60001 14.4155 9.53258 14.5355 9.41256C14.6555 9.29253 14.723 9.12975 14.723 8.96001V7.68001C14.723 7.51027 14.6555 7.34748 14.5355 7.22746C14.4155 7.10744 14.2527 7.04001 14.083 7.04001ZM14.083 22.4H12.803C12.6332 22.4 12.4704 22.4674 12.3504 22.5875C12.2304 22.7075 12.163 22.8703 12.163 23.04V24.32C12.163 24.4897 12.2304 24.6525 12.3504 24.7726C12.4704 24.8926 12.6332 24.96 12.803 24.96H14.083C14.2527 24.96 14.4155 24.8926 14.5355 24.7726C14.6555 24.6525 14.723 24.4897 14.723 24.32V23.04C14.723 22.8703 14.6555 22.7075 14.5355 22.5875C14.4155 22.4674 14.2527 22.4 14.083 22.4Z",fill:"currentColor"}));function Me(){const{api:o,info:s}=U();return e.jsx(ge,{client:o,did:s.did})}function P({style:o={},title:s=null,value:m=null,graph:c=null,description:p=null,empty:f=null}){return e.jsx(ke,{children:e.jsxs(ve,{style:{...o},children:[e.jsx(k,{sx:{color:"text.secondary",fontSize:14},children:s}),f&&Q.isValidElement(f)?e.jsx(i,{style:{height:150},sx:{color:"text.secondary",display:"flex",justifyContent:"center",alignItems:"center"},children:f}):e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"h5",component:"div",sx:{mt:1},children:m}),c,!!p&&e.jsx(i,{sx:{display:"flex",color:"text.secondary",fontSize:12,marginTop:3},children:p})]})]})})}P.propTypes={style:l.object,title:l.node,value:l.node,graph:l.node,description:l.any,empty:l.node};const ke=D(X)`
|
|
2
2
|
.card-content {
|
|
3
3
|
height: 150px;
|
|
4
4
|
}
|