@abtnode/webapp 1.17.4-beta-20251206-111557-41b8d449 → 1.17.5-beta-20251208-123021-e8c53f96
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-AIDIzsfb.js → AdapterDayjs-D92-n47b.js} +1 -1
- package/dist/assets/{Add-l7OvfXrD.js → Add-Dv85KL5N.js} +1 -1
- package/dist/assets/ArrowDropDown-CPeg07nO.js +1 -0
- package/dist/assets/{Autocomplete-Bme-ElpV.js → Autocomplete-DVV2RD2A.js} +1 -1
- package/dist/assets/{Breadcrumbs-Bf0qzrkp.js → Breadcrumbs-C7NX6NEA.js} +1 -1
- package/dist/assets/{ButtonGroup-CMlvIctd.js → ButtonGroup-C6xSllEr.js} +1 -1
- package/dist/assets/{CSSTransition-Cf_KzaPo.js → CSSTransition-BnYuNWzI.js} +1 -1
- package/dist/assets/{CallMerge-DaaiIZ0e.js → CallMerge-DYEM4wZM.js} +1 -1
- package/dist/assets/{CardContent-gyrk9EIw.js → CardContent-cV0ZtLFb.js} +1 -1
- package/dist/assets/{ChevronLeft-OivB2aTv.js → ChevronLeft-DaNTS9Ry.js} +1 -1
- package/dist/assets/{ChevronRight-CV3PmYHH.js → ChevronRight-DMRng8w4.js} +1 -1
- package/dist/assets/{Clear-Cz6Yzx0g.js → Clear-DYWNGGPP.js} +1 -1
- package/dist/assets/{DeleteOutline-DmEDUBgP.js → DeleteOutline-C9hdvFLW.js} +1 -1
- package/dist/assets/{Done-BuJjZzMV.js → Done-CEq9fQ91.js} +1 -1
- package/dist/assets/{Edit-HxzEBQ9h.js → Edit-T_ynXw3J.js} +1 -1
- package/dist/assets/{ErrorOutline-CUOja7My.js → ErrorOutline-CQZdYJL-.js} +1 -1
- package/dist/assets/{FilterList-xUYmSJ-Y.js → FilterList-C0g86vDh.js} +1 -1
- package/dist/assets/{Google-cG0hx3oK.js → Google-sh3pICro.js} +1 -1
- package/dist/assets/{HelpOutline-DapRasSH.js → HelpOutline-CDfUVKlB.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-9mIUY7eq.js → KeyboardArrowDown-BCCwKNMP.js} +1 -1
- package/dist/assets/{Launch-DITLracb.js → Launch-Cy-Ri5E0.js} +1 -1
- package/dist/assets/{Link-DGt16osR.js → Link-LRqXezP_.js} +1 -1
- package/dist/assets/{ListItemButton-Cs40YHcx.js → ListItemButton-D_BFfEfg.js} +1 -1
- package/dist/assets/{ListSubheader-l4UAKUMT.js → ListSubheader-DVUYAhXC.js} +1 -1
- package/dist/assets/{LoadingButton-D6uT1qbm.js → LoadingButton--tsix-yw.js} +1 -1
- package/dist/assets/{MoreVert-BUlWqUnK.js → MoreVert-D2cSYolp.js} +1 -1
- package/dist/assets/{OpenInNew-CCi7ydva.js → OpenInNew-KWw6IL4k.js} +1 -1
- package/dist/assets/{Refresh-CGgBW-me.js → Refresh-DWTzO6Zf.js} +1 -1
- package/dist/assets/{Search-3L2yy5pr.js → Search-soT1P5WL.js} +1 -1
- package/dist/assets/{Stepper-D4Zig93k.js → Stepper-CO2wnCjY.js} +1 -1
- package/dist/assets/{Switch-B-AVsYNw.js → Switch-CYCG_kxE.js} +1 -1
- package/dist/assets/{TableSearch-CAaRXXpO.js → TableSearch-BJJrOkE2.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-uvIn6Jyh.js → ToggleButtonGroup-Dl-zl-V4.js} +1 -1
- package/dist/assets/{UnfoldMore-DcBVcc2h.js → UnfoldMore-XLA7xpTo.js} +1 -1
- package/dist/assets/{Verified-BpzZH8QJ.js → Verified-Blm2AEgo.js} +1 -1
- package/dist/assets/{VerifiedUser-B-ONuNVC.js → VerifiedUser-DitkeanA.js} +1 -1
- package/dist/assets/{ViewList-CvnWfuPG.js → ViewList-dS2IrLuW.js} +1 -1
- package/dist/assets/{_createAggregator-CqUOxBsA.js → _createAggregator-CQmKIqh9.js} +1 -1
- package/dist/assets/{actions-Dv4j7XcE.js → actions-C_YtyiJN.js} +1 -1
- package/dist/assets/{actions-DVOuh-Fv.js → actions-CqTr_UpD.js} +1 -1
- package/dist/assets/{agreement-ttzsGTtZ.js → agreement-CB8zAClF.js} +1 -1
- package/dist/assets/api-gDzILycU.js +1 -0
- package/dist/assets/{appearance-BoEskUU3.js → appearance-CvBqnNxC.js} +1 -1
- package/dist/assets/{audit-logs-BjJ1_rVq.js → audit-logs-DG20CWcK.js} +1 -1
- package/dist/assets/{base-chart-AQkuFrPC.js → base-chart-hRqEcUf1.js} +1 -1
- package/dist/assets/{blocklet-D2MB-zOx.js → blocklet-4xcBoALi.js} +1 -1
- package/dist/assets/{chain-l1zX37z1.js → chain-4NohS0Y9.js} +1 -1
- package/dist/assets/{click-to-copy-D16LYOaz.js → click-to-copy-Xg1hTHwq.js} +1 -1
- package/dist/assets/cloneDeep-o7Kp18y-.js +1 -0
- package/dist/assets/{collapse-DjVUQHBf.js → collapse-CvIW0hIW.js} +1 -1
- package/dist/assets/{config-navigation-D5cL0ut2.js → config-navigation-BHLHrDuf.js} +3 -3
- package/dist/assets/{connect-to-MJFTP0S_.js → connect-to-BzOsNzCo.js} +1 -1
- package/dist/assets/{cssMode-Fsxj3561.js → cssMode-CtAuRBnQ.js} +1 -1
- package/dist/assets/{delete-confirm-xUATcCih.js → delete-confirm-CmK028cX.js} +1 -1
- package/dist/assets/{depsEqual-BNz3Z5UN.js → depsEqual-D4SkOvpW.js} +1 -1
- package/dist/assets/{detail-cazmKFj_.js → detail-39U2ZB1M.js} +3 -3
- package/dist/assets/{domains-vCwCURM3.js → domains-D2j6_7aU.js} +1 -1
- package/dist/assets/{download-O9kMYIC6.js → download-fdrmqknu.js} +1 -1
- package/dist/assets/{edit.svg-B0aHUSZw.js → edit.svg-BCm3ag4u.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-B1_0wYNC.js +1 -0
- package/dist/assets/engine-D2zNg6-2.js +1 -0
- package/dist/assets/{freemarker2-DajhvZDQ.js → freemarker2-CTfgMDhs.js} +1 -1
- package/dist/assets/{get-safe-url-B_yWzv49.js → get-safe-url-nXPF2sGJ.js} +1 -1
- package/dist/assets/getValidReactChildren-CIqQKAkN.js +1 -0
- package/dist/assets/{graphqlMode-DQTpyvXV.js → graphqlMode-B6W6zwCs.js} +2 -2
- package/dist/assets/{handlebars-CFycpwy_.js → handlebars-DOdON862.js} +1 -1
- package/dist/assets/{html-fOaqMnCB.js → html-DEp9zO-t.js} +1 -1
- package/dist/assets/{html-title-xzTyg8m0.js → html-title-D-skaBwb.js} +1 -1
- package/dist/assets/{htmlMode-DwojGB9N.js → htmlMode-BsvwfKqY.js} +1 -1
- package/dist/assets/{iframe-DhbAf7eB.js → iframe-DyfK1MII.js} +1 -1
- package/dist/assets/{index-Bvn9twlG.js → index-3WfGtOlv.js} +1 -1
- package/dist/assets/{index-XgkYfld7.js → index-AqKhw9Wu.js} +3 -3
- package/dist/assets/{index-CEPQQlo6.js → index-B1omHpBR.js} +1 -1
- package/dist/assets/{index-DvBW_mZc.js → index-B9vFJyc6.js} +1 -1
- package/dist/assets/{index-yORTeDE5.js → index-BAeHHGc5.js} +1 -1
- package/dist/assets/{index-Cacyj92F.js → index-BFwfrWj_.js} +1 -1
- package/dist/assets/{index-kFk_mggT.js → index-BHRDAZr5.js} +1 -1
- package/dist/assets/{index-CprJrzzj.js → index-BKYNnQgG.js} +1 -1
- package/dist/assets/{index-jIRER_d6.js → index-BR2CcckZ.js} +1 -1
- package/dist/assets/{index-CBrQ9aZ7.js → index-Beqyq0Xy.js} +1 -1
- package/dist/assets/{index-CGtaecKe.js → index-Bmeli3vt.js} +1 -1
- package/dist/assets/{index-DBOqxRpP.js → index-BoBukMl6.js} +1 -1
- package/dist/assets/{index-B-V1EiVF.js → index-Boc_ElPU.js} +1 -1
- package/dist/assets/{index-DcXoiIcd.js → index-Bpl7ZPdw.js} +1 -1
- package/dist/assets/{index-BCEB7zAW.js → index-BqOHFDpP.js} +1 -1
- package/dist/assets/{index-BACYRg7R.js → index-BsFiddFP.js} +9 -9
- package/dist/assets/{index-KR6tqxjN.js → index-Bzt3kp1o.js} +1 -1
- package/dist/assets/{index-BhmdgQ6h.js → index-C1FfiSCs.js} +1 -1
- package/dist/assets/{index-iLcm3xJO.js → index-C3owZL72.js} +1 -1
- package/dist/assets/{index-BlnAC-LC.js → index-C9N-dK-U.js} +1 -1
- package/dist/assets/{index-BzMgQhvT.js → index-CAfX9jEw.js} +1 -1
- package/dist/assets/{index-DkBdKcP-.js → index-CB9i2iit.js} +1 -1
- package/dist/assets/{index-BI2RNyn2.js → index-CEA-JNUf.js} +1 -1
- package/dist/assets/{index-BbWPK5o6.js → index-CFPB3xkO.js} +1 -1
- package/dist/assets/{index-BsntE0No.js → index-CJ-WZj-1.js} +1 -1
- package/dist/assets/{index-Cl5G4tna.js → index-CO1fNIoe.js} +3 -3
- package/dist/assets/{index-i28M3WTw.js → index-CSmLj9hN.js} +1 -1
- package/dist/assets/{index-4yUut_bV.js → index-CVvQ2yKp.js} +1 -1
- package/dist/assets/index-CpC6KyFR.js +1 -0
- package/dist/assets/{index-CO0vAndr.js → index-D0Nij003.js} +1 -1
- package/dist/assets/{index-CPLXcmCK.js → index-D9OyVcfq.js} +3 -3
- package/dist/assets/{index-BFqAcspj.js → index-DCo3tzgk.js} +2 -2
- package/dist/assets/{index-hu34K3US.js → index-DIdPY5JS.js} +1 -1
- package/dist/assets/{index-BZw-IddS.js → index-DLm3d5Lz.js} +1 -1
- package/dist/assets/{index-CCv_8omK.js → index-DaEjX2SO.js} +5 -5
- package/dist/assets/{index-DeYmBhXX.js → index-DeOpdMmq.js} +1 -1
- package/dist/assets/{index-BddlETK4.js → index-DfJQllIT.js} +1 -1
- package/dist/assets/{index-B_8MhQGp.js → index-DikEqQbY.js} +3 -3
- package/dist/assets/{index-BftkyDmu.js → index-DrkFgZdM.js} +1 -1
- package/dist/assets/{index-g_RqxcM4.js → index-DyCZ__uc.js} +1 -1
- package/dist/assets/{index-BEOeUot7.js → index-JD_f3m8u.js} +1 -1
- package/dist/assets/{index-COT6fHf0.js → index-RqR7C4_G.js} +1 -1
- package/dist/assets/{index-aZqjDrOh.js → index-T2sa7QI9.js} +1 -1
- package/dist/assets/{index-4-FW3N_0.js → index-Uf4kWlzq.js} +1 -1
- package/dist/assets/{index-gqKcev8E.js → index-ZtBV9VDq.js} +1 -1
- package/dist/assets/{index-0EXUatvL.js → index-xhxy4seW.js} +1 -1
- package/dist/assets/{index.esm-Bsyk9Gld.js → index.esm-Di7pxRR7.js} +1 -1
- package/dist/assets/{install-from-url-4VtQ9_35.js → install-from-url-BYJQqH88.js} +1 -1
- package/dist/assets/{invitation-B5QYli1h.js → invitation-DhpFShM_.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-RoIvuAJE.js → is-path-prefix-equal-jo7g0Qmd.js} +1 -1
- package/dist/assets/{item-CjFxs-Zt.js → item-D6K3xZvf.js} +1 -1
- package/dist/assets/{javascript-luLw15rJ.js → javascript-DcFlp6iK.js} +1 -1
- package/dist/assets/{jsonMode-Cxdqt0IL.js → jsonMode-RPWtRIbN.js} +1 -1
- package/dist/assets/{liquid-D1qp1ZF3.js → liquid-Dd2yvvP7.js} +1 -1
- package/dist/assets/{list-header-D-U957cP.js → list-header-BEqD50lj.js} +1 -1
- package/dist/assets/{lock.svg-Dz9J-uBq.js → lock.svg-CqbkAjfs.js} +1 -1
- package/dist/assets/{log--2ZY9nHz.js → log-CJyQvDex.js} +1 -1
- package/dist/assets/{lottie-react.esm-C6caiayN.js → lottie-react.esm-CkMUkUNW.js} +1 -1
- package/dist/assets/{mdx-Dzy-X9qt.js → mdx-BD-ePdgm.js} +1 -1
- package/dist/assets/{memory-r4Kexlry.js → memory-C2g1lVx4.js} +1 -1
- package/dist/assets/{metric-BTKuNvY9.js → metric-Ce6h_fps.js} +1 -1
- package/dist/assets/omit-dFmEevUc.js +1 -0
- package/dist/assets/{overview-CFHOUNfH.js → overview-DIJq7smI.js} +1 -1
- package/dist/assets/{permission-RtK6f5af.js → permission-DHDlX-2p.js} +1 -1
- package/dist/assets/{preference-C7Ge_XOi.js → preference-BFNujwfR.js} +3 -3
- package/dist/assets/{python-hpNfnPxJ.js → python-CSfuDNWh.js} +1 -1
- package/dist/assets/{raf-schd.esm-rR8pKw9W.js → raf-schd.esm-C7cnOwIv.js} +1 -1
- package/dist/assets/{razor-BI0kEBq5.js → razor-PrxsK0Yf.js} +1 -1
- package/dist/assets/{rotate-session-key-B6NXbgEc.js → rotate-session-key-DlCO0JRQ.js} +1 -1
- package/dist/assets/{runtime-CVAdQ8wh.js → runtime-DGTHh6A9.js} +1 -1
- package/dist/assets/schema-CEPuPgwv.js +1 -0
- package/dist/assets/sdk-D8tCPukn.js +1 -0
- package/dist/assets/{service-Cy6pWzv_.js → service-Bh0rr8zW.js} +1 -1
- package/dist/assets/{shorten-label-CvhqR616.js → shorten-label-BS4FNgmI.js} +1 -1
- package/dist/assets/{simple-select-Dqs9YolY.js → simple-select-Dkbl-a1m.js} +1 -1
- package/dist/assets/{spaces-Dif7Qa2a.js → spaces-BTKqW9YY.js} +1 -1
- package/dist/assets/{status-DIqT0--1.js → status-DTDPbaoZ.js} +1 -1
- package/dist/assets/{status-Dcx3B-gc.js → status-Dgr7tZJl.js} +1 -1
- package/dist/assets/{switch-control-BLvkR0UT.js → switch-control-bRPrVj4O.js} +1 -1
- package/dist/assets/{table-icons-DHCKcouf.js → table-icons-DaKDKKxZ.js} +1 -1
- package/dist/assets/{team-BV9bl_r7.js → team-DdhNY9E2.js} +1 -1
- package/dist/assets/{toLower-CL0ukT8_.js → toLower-DC-Tk5Hb.js} +1 -1
- package/dist/assets/toUpper-DglD32bj.js +1 -0
- package/dist/assets/{traffic-DrN7qkrg.js → traffic-9tAQAbVA.js} +1 -1
- package/dist/assets/{tsMode-Bqd_EuMj.js → tsMode-B19hnwr8.js} +1 -1
- package/dist/assets/{typescript-BVOjm5kD.js → typescript-C9cjacUF.js} +1 -1
- package/dist/assets/{url-evaluation-B5iexDQo.js → url-evaluation-Dm_mNoMs.js} +1 -1
- package/dist/assets/{url-join-DGMfgD17.js → url-join-BgacTiZS.js} +1 -1
- package/dist/assets/{use-mobile-DvM8SqYH.js → use-mobile-CWB6Jtv1.js} +1 -1
- package/dist/assets/{use-mobile-DyKd7giP.js → use-mobile-D6E5km4P.js} +1 -1
- package/dist/assets/{useAsync-DRXRxEMN.js → useAsync-CyivJzD4.js} +1 -1
- package/dist/assets/{useAsyncRetry-l2Si2r3C.js → useAsyncRetry-BDLoOcvn.js} +1 -1
- package/dist/assets/{useLocalStorage-CbBU4OS9.js → useLocalStorage-Df3_jlsm.js} +1 -1
- package/dist/assets/{useThemeProps-CRd6upHX.js → useThemeProps-R3T9xrvH.js} +1 -1
- package/dist/assets/{util-CziUIk8v.js → util-BDvErAjW.js} +1 -1
- package/dist/assets/{wait-container-CCe_xsZw.js → wait-container-B1wIefva.js} +1 -1
- package/dist/assets/{without-wallet-DcI5W8cf.js → without-wallet-DQfnDo2u.js} +1 -1
- package/dist/assets/wrap-locale-l_P1jXYo.js +1 -0
- package/dist/assets/{xml-86YzaLiM.js → xml-a8bUYHho.js} +1 -1
- package/dist/assets/{yaml-hqPmcqsD.js → yaml-Cp0Ib5KC.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-Br_oPfQI.js +0 -1
- package/dist/assets/api-CWyPHkC_.js +0 -1
- package/dist/assets/cloneDeep-BOd1J0Sv.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-CdT-VIlA.js +0 -1
- package/dist/assets/engine-7ix2eBzw.js +0 -1
- package/dist/assets/getValidReactChildren-BQH98pcn.js +0 -1
- package/dist/assets/index-BiAAgnpw.js +0 -1
- package/dist/assets/omit-BwCXmJ0x.js +0 -1
- package/dist/assets/schema-Dsc1QRMh.js +0 -1
- package/dist/assets/sdk-BJ8ul4G_.js +0 -1
- package/dist/assets/toUpper-CcZcHFDe.js +0 -1
- package/dist/assets/wrap-locale-B1uKF2jP.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bo as gt,r as g,bE as J,bg as H,H as q,aH as D,g as xt,o as d,h as ee,au as bt,O as jt,K as C,T as U,V as Q,eO as Fe,P as Pe,ik as Ye,bk as Te,aV as Ie,U as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,at as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,ag as pe,G as Ue,av as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,Q as Ot,S as Lt,R as $e,it as kt,a4 as Ft}from"./index-CCv_8omK.js";import{d as Pt,H as at,g as _t}from"./index-4-FW3N_0.js";import{R as _e,S as Bt}from"./actions-DVOuh-Fv.js";import{B as zt}from"./index-BsntE0No.js";import{S as me}from"./shorten-label-CvhqR616.js";import{v as ot}from"./index-BCEB7zAW.js";import{T as Wt}from"./html-title-xzTyg8m0.js";import{R as Mt}from"./Refresh-CGgBW-me.js";import{D as Kt,g as Ht}from"./traffic-DrN7qkrg.js";import{u as qt}from"./use-mobile-DvM8SqYH.js";import"./FilterList-xUYmSJ-Y.js";import"./CSSTransition-Cf_KzaPo.js";import"./emotion-cache.browser.esm-CdT-VIlA.js";import"./index-hu34K3US.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BNz3Z5UN.js";import"./index-DkBdKcP-.js";import"./TableSearch-CAaRXXpO.js";import"./Search-3L2yy5pr.js";import"./Clear-Cz6Yzx0g.js";import"./MoreVert-BUlWqUnK.js";import"./useLocalStorage-CbBU4OS9.js";import"./url-evaluation-B5iexDQo.js";import"./get-safe-url-B_yWzv49.js";import"./ButtonGroup-CMlvIctd.js";import"./getValidReactChildren-BQH98pcn.js";import"./permission-RtK6f5af.js";import"./index.esm-Bsyk9Gld.js";import"./collapse-DjVUQHBf.js";import"./blocklet-D2MB-zOx.js";import"./Switch-B-AVsYNw.js";import"./iframe-DhbAf7eB.js";import"./ChevronLeft-OivB2aTv.js";import"./ChevronRight-CV3PmYHH.js";import"./index-DBii9-f-.js";import"./base-chart-AQkuFrPC.js";import"./index-CEPQQlo6.js";import"./AdapterDayjs-AIDIzsfb.js";import"./useThemeProps-CRd6upHX.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=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"})),$t=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:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},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 Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(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:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}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},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(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})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,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:o,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:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{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:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{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:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=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",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{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:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{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:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{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"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.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:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
1
|
+
import{aF as Ge,j as e,bo as gt,r as g,bE as J,bg as H,H as q,aH as D,g as xt,o as d,h as ee,au as bt,O as jt,K as C,T as U,V as Q,eO as Fe,P as Pe,ik as Ye,bk as Te,aV as Ie,U as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,at as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,ag as pe,G as Ue,av as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,Q as Ot,S as Lt,R as $e,it as kt,a4 as Ft}from"./index-DaEjX2SO.js";import{d as Pt,H as at,g as _t}from"./index-Uf4kWlzq.js";import{R as _e,S as Bt}from"./actions-CqTr_UpD.js";import{B as zt}from"./index-CJ-WZj-1.js";import{S as me}from"./shorten-label-BS4FNgmI.js";import{v as ot}from"./index-BqOHFDpP.js";import{T as Wt}from"./html-title-D-skaBwb.js";import{R as Mt}from"./Refresh-DWTzO6Zf.js";import{D as Kt,g as Ht}from"./traffic-9tAQAbVA.js";import{u as qt}from"./use-mobile-CWB6Jtv1.js";import"./FilterList-C0g86vDh.js";import"./CSSTransition-BnYuNWzI.js";import"./emotion-cache.browser.esm-B1_0wYNC.js";import"./index-DIdPY5JS.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D4SkOvpW.js";import"./index-CB9i2iit.js";import"./TableSearch-BJJrOkE2.js";import"./Search-soT1P5WL.js";import"./Clear-DYWNGGPP.js";import"./MoreVert-D2cSYolp.js";import"./useLocalStorage-Df3_jlsm.js";import"./url-evaluation-Dm_mNoMs.js";import"./get-safe-url-nXPF2sGJ.js";import"./ButtonGroup-C6xSllEr.js";import"./getValidReactChildren-CIqQKAkN.js";import"./permission-DHDlX-2p.js";import"./index.esm-Di7pxRR7.js";import"./collapse-CvIW0hIW.js";import"./blocklet-4xcBoALi.js";import"./Switch-CYCG_kxE.js";import"./iframe-DyfK1MII.js";import"./ChevronLeft-DaNTS9Ry.js";import"./ChevronRight-DMRng8w4.js";import"./index-DBii9-f-.js";import"./base-chart-hRqEcUf1.js";import"./index-B1omHpBR.js";import"./AdapterDayjs-D92-n47b.js";import"./useThemeProps-R3T9xrvH.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=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"})),$t=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:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},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 Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(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:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}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},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(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})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,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:o,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:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{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:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{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:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=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",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{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:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{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:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{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"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.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:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as G,j as e,r as b,aW as V,cB as Le,T as N,O as K,o as y,V as F,bf as ie,b9 as je,K as g,N as oe,W as J,eO as ve,fJ as be,bE as Nt,bv as Lt,bw as Bt,bx as Mt,aO as Be,aP as $t,$ as H,s as W,bo as A,cw as le,C as O,X as Ke,au as Ot,dm as Et,bg as Ze,bh as _t,aH as U,H as z,bF as X,go as qt,gp as Ht,i as Wt,v as B,b as Ut,a3 as Q,t as E,R as ce,a4 as q,aS as ae,Y as ne,F as Je,ad as Ce,be as Qe,gq as Vt,q as Gt,fn as Yt,Q as Xe,ff as et,bj as tt,g as Kt,D as Zt,ca as st,aV as Jt,U as Qt,bB as Xt,E as es,gr as Me,fH as ts,gs as ss,S as rs}from"./index-CCv_8omK.js";import{H as Se,g as ns}from"./index-4-FW3N_0.js";import{T as as}from"./html-title-xzTyg8m0.js";import{u as M}from"./team-BV9bl_r7.js";import{U as os}from"./ua-parser-DP5omx3I.js";import{u as is}from"./use-mobile-DvM8SqYH.js";import{v as se}from"./index-DcXoiIcd.js";import{w as Y,P as rt}from"./permission-RtK6f5af.js";import{C as ls}from"./Google-cG0hx3oK.js";import{u as cs}from"./blocklet-D2MB-zOx.js";import{A as we}from"./Add-l7OvfXrD.js";import{y as Te}from"./index-DkBdKcP-.js";import{e as pe}from"./edit.svg-B0aHUSZw.js";import{M as nt}from"./TableSearch-CAaRXXpO.js";import{L as at}from"./list-header-D-U957cP.js";import{g as ds}from"./chain-l1zX37z1.js";import{T as ot,a as re}from"./ToggleButtonGroup-uvIn6Jyh.js";import{C as ps}from"./lock.svg-Dz9J-uBq.js";const us=G(e.jsx("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"})),$e=G(e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})),it=G(e.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),me=G(e.jsx("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),ms=G(e.jsx("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"})),fs=G(e.jsx("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"})),xs=G(e.jsx("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"})),fe=G(e.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"})),ue=s=>b.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},b.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));function hs(s){return!s||typeof s!="string"?"break-all":s.includes(" ")?"break-word":"break-all"}function lt({logo:s="",name:n="",description:l="",size:p=40,variant:c="rounded",sx:u={},className:f="",logoName:a="",tooltip:d=null}){const r={width:p,height:p,...u},o=typeof n=="string"?n:s,i=e.jsxs(V,{direction:"row",spacing:1,className:`info-card-wrapper ${f}`,sx:{alignItems:"center",cursor:d?"pointer":"default"},children:[s?e.jsx(Le,{src:s,alt:a??o,variant:c,sx:r}):e.jsx(Le,{variant:c,sx:r,children:o?.slice(0,1)}),e.jsxs(V,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",wordBreak:hs(n),minWidth:{xs:100,sm:140}},children:[e.jsx(N,{variant:"body1",component:"div",sx:{color:"text.primary"},children:n}),l&&e.jsx(N,{variant:"subtitle1",sx:{color:"text.secondary"},children:l})]})]});return d?e.jsx(K,{title:d,placement:"top-start",slotProps:{tooltip:{sx:{bgcolor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff",color:t=>t.palette.mode==="dark"?"#ffffff":t.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:i}):i}lt.propTypes={logo:y.string,name:y.oneOfType([y.string,y.node]).isRequired,description:y.oneOfType([y.string,y.node]),size:y.oneOfType([y.number,y.string]),variant:y.oneOf(["square","rounded","circular"]),sx:y.object,className:y.string,logoName:y.string,tooltip:y.oneOfType([y.string,y.node])};function gs(s){try{if(!s.trim())return{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}};const l=new os(s).getResult();let p="";const c=s.split(/\s+/).find(d=>d.startsWith("arcwallet"));if(c){const d=c.split("/");d.length>1&&Be.coerce(d[1])&&(p=Be.coerce(d[1]).version)}const u=(()=>{const{type:d="",model:r=""}=l.device;return d==="mobile"?{icon:e.jsx(fs,{fontSize:"small"}),text:r||"Mobile Device"}:d==="tablet"?{icon:e.jsx(xs,{fontSize:"small"}),text:r||"Tablet"}:{icon:e.jsx(ms,{fontSize:"small"}),text:r||"Desktop"}})(),f=(()=>{const{name:d="",version:r=""}=l.os;return d.toLowerCase().includes("mac")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("ios")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("android")?{icon:e.jsx(us,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("windows")?{icon:e.jsx(me,{fontSize:"small"}),text:`${d} ${r}`}:{icon:null,text:d?`${d} ${r}`:"Unknown OS"}})(),a=(()=>{const{name:d="",version:r=""}=l.browser;return{icon:e.jsx(fe,{fontSize:"small"}),text:d?`${d} ${r}`:"Unknown Browser"}})();return{device:u,os:f,browser:a,...p?{walletVersion:{icon:null,text:p}}:{}}}catch(n){return console.error("Error parsing user agent:",n),{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}}}}function ct({ua:s}){const n=gs(s);return e.jsx(V,{spacing:1,children:Object.entries(n).map(([l,{icon:p,text:c}])=>e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:p}),e.jsx(N,{variant:"body2",sx:{display:"flex"},children:c})]},l))})}ct.propTypes={ua:y.string.isRequired};const dt=()=>{const{t:s}=F(),n={$all:s("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:n,formatRoleName:p=>{const c=(p||"").toLowerCase();return c.startsWith("$")?n[c]||c.slice(1):n[c]||c}}},ys=(s,n=!1)=>{const l=n?1:.6;switch(s){case"owner":return`rgba(232, 222, 255, ${l})`;case"admin":return`rgba(227, 242, 253, ${l})`;case"member":return`rgba(232, 245, 233, ${l})`;case"guest":return`rgba(245, 245, 245, ${l})`;default:return`rgba(245, 245, 245, ${l})`}},js=je(ve)(({role:s})=>({backgroundColor:ys(s.toLowerCase()),color:"#000000"})),vs=s=>{switch(s){case"valid":return n=>n.palette.success.light;case"expired":return n=>n.palette.text.disabled;case"revoked":return n=>n.palette.error.light;default:return n=>n.palette.warning.light}},bs=je(ve)(({theme:s,status:n})=>({backgroundColor:vs(n)(s),color:"#FFFFFF"}));function pt({did:s}){return e.jsx(J,{size:14,responsive:!1,compact:!0,copyable:!1,did:s})}pt.propTypes={did:y.string.isRequired};function ut({timestamp:s,locale:n}){return e.jsx(g,{sx:{minWidth:"100px"},children:e.jsx(oe,{value:s,locale:n})})}ut.propTypes={timestamp:y.number.isRequired,locale:y.string.isRequired};function mt({name:s="",role:n}){const{formatRoleName:l}=dt();return e.jsx(js,{label:l(s||n),size:"small",role:s||n,sx:{borderRadius:1}})}mt.propTypes={role:y.string.isRequired,name:y.string};function ft({status:s}){const{t:n}=F();return e.jsx(bs,{label:n(`team.passport.statusMap.${s}`),size:"small",status:s,sx:{borderRadius:1}})}ft.propTypes={status:y.string.isRequired};function xt({source:s}){const{t:n}=F();return s?n(`team.passport.sourceMaps.${s}`):"-"}xt.propTypes={source:y.string.isRequired};function ht({user:s,size:n="default",tooltip:l=!1,inService:p=!1}){const{teamDid:c}=M(),u=ie.useMemo(()=>be(s.avatar,c,p),[s.avatar,c,p]),f=ie.useMemo(()=>e.jsx(J,{did:s?.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[s?.did]),a=Nt(()=>({...s,avatar:u}),[s,u]);return n==="small"?e.jsx(lt,{variant:"circular",logo:u,name:e.jsx(N,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:s.fullName||s.email}),...n==="small"?{tooltip:l?e.jsx(J,{did:s?.did}):!1,size:24}:{description:f,size:36}}):e.jsx(Lt,{user:a,avatarSize:n==="small"?24:36,cardType:Mt.Detailed,infoType:Bt.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})}ht.propTypes={user:y.object.isRequired,size:y.string,tooltip:y.bool,inService:y.bool};const Cs=ie.memo(ht),Ss=s=>e.jsx(pt,{did:s}),Ie=(s,n)=>e.jsx(mt,{name:s,role:n}),Re=s=>e.jsx(ft,{status:s}),gt=(s,n)=>e.jsx(ut,{timestamp:s,locale:n}),de=s=>e.jsx(xt,{source:s}),De=(s,n=!1)=>e.jsx(Cs,{user:s,inService:n}),ws=s=>e.jsx(ct,{ua:s}),Oe="info";function yt({createPassportSvg:s,passport:n,onCancel:l,onSwitchPassport:p=()=>{}}){const{t:c}=F(),u=$t({tab:Oe}),f={info:{label:c("common.basicInfo"),value:Oe,component:()=>e.jsx(jt,{passport:n,createPassportSvg:s})},logs:{label:c("common.logs"),value:"logs",component:()=>e.jsx(Ct,{passport:n})},related:{label:c("team.passport.related"),value:"related",component:()=>e.jsx(St,{passport:n,onSwitchPassport:p})}},a=Object.values(f).map(({label:o,value:i})=>({label:o,value:i})).filter(o=>o.value==="related"?n.parentDid:!0),d=f[u.tab]||f.info,r=o=>{u.tab=o};return e.jsx(H,{title:c("common.passport"),onClose:l,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ts,{children:[e.jsx(g,{className:"tabs",children:e.jsx(as,{tabs:a,current:u.tab,onChange:r,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(d.component,{})})]})})}yt.propTypes={createPassportSvg:y.func.isRequired,passport:y.object.isRequired,onCancel:y.func.isRequired,onSwitchPassport:y.func};const Ts=W(g)`
|
|
1
|
+
import{aF as G,j as e,r as b,aW as V,cB as Le,T as N,O as K,o as y,V as F,bf as ie,b9 as je,K as g,N as oe,W as J,eO as ve,fJ as be,bE as Nt,bv as Lt,bw as Bt,bx as Mt,aO as Be,aP as $t,$ as H,s as W,bo as A,cw as le,C as O,X as Ke,au as Ot,dm as Et,bg as Ze,bh as _t,aH as U,H as z,bF as X,go as qt,gp as Ht,i as Wt,v as B,b as Ut,a3 as Q,t as E,R as ce,a4 as q,aS as ae,Y as ne,F as Je,ad as Ce,be as Qe,gq as Vt,q as Gt,fn as Yt,Q as Xe,ff as et,bj as tt,g as Kt,D as Zt,ca as st,aV as Jt,U as Qt,bB as Xt,E as es,gr as Me,fH as ts,gs as ss,S as rs}from"./index-DaEjX2SO.js";import{H as Se,g as ns}from"./index-Uf4kWlzq.js";import{T as as}from"./html-title-D-skaBwb.js";import{u as M}from"./team-DdhNY9E2.js";import{U as os}from"./ua-parser-DP5omx3I.js";import{u as is}from"./use-mobile-CWB6Jtv1.js";import{v as se}from"./index-Bpl7ZPdw.js";import{w as Y,P as rt}from"./permission-DHDlX-2p.js";import{C as ls}from"./Google-sh3pICro.js";import{u as cs}from"./blocklet-4xcBoALi.js";import{A as we}from"./Add-Dv85KL5N.js";import{y as Te}from"./index-CB9i2iit.js";import{e as pe}from"./edit.svg-BCm3ag4u.js";import{M as nt}from"./TableSearch-BJJrOkE2.js";import{L as at}from"./list-header-BEqD50lj.js";import{g as ds}from"./chain-4NohS0Y9.js";import{T as ot,a as re}from"./ToggleButtonGroup-Dl-zl-V4.js";import{C as ps}from"./lock.svg-CqbkAjfs.js";const us=G(e.jsx("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"})),$e=G(e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})),it=G(e.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),me=G(e.jsx("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),ms=G(e.jsx("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"})),fs=G(e.jsx("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"})),xs=G(e.jsx("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"})),fe=G(e.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"})),ue=s=>b.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},b.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));function hs(s){return!s||typeof s!="string"?"break-all":s.includes(" ")?"break-word":"break-all"}function lt({logo:s="",name:n="",description:l="",size:p=40,variant:c="rounded",sx:u={},className:f="",logoName:a="",tooltip:d=null}){const r={width:p,height:p,...u},o=typeof n=="string"?n:s,i=e.jsxs(V,{direction:"row",spacing:1,className:`info-card-wrapper ${f}`,sx:{alignItems:"center",cursor:d?"pointer":"default"},children:[s?e.jsx(Le,{src:s,alt:a??o,variant:c,sx:r}):e.jsx(Le,{variant:c,sx:r,children:o?.slice(0,1)}),e.jsxs(V,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",wordBreak:hs(n),minWidth:{xs:100,sm:140}},children:[e.jsx(N,{variant:"body1",component:"div",sx:{color:"text.primary"},children:n}),l&&e.jsx(N,{variant:"subtitle1",sx:{color:"text.secondary"},children:l})]})]});return d?e.jsx(K,{title:d,placement:"top-start",slotProps:{tooltip:{sx:{bgcolor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff",color:t=>t.palette.mode==="dark"?"#ffffff":t.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:i}):i}lt.propTypes={logo:y.string,name:y.oneOfType([y.string,y.node]).isRequired,description:y.oneOfType([y.string,y.node]),size:y.oneOfType([y.number,y.string]),variant:y.oneOf(["square","rounded","circular"]),sx:y.object,className:y.string,logoName:y.string,tooltip:y.oneOfType([y.string,y.node])};function gs(s){try{if(!s.trim())return{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}};const l=new os(s).getResult();let p="";const c=s.split(/\s+/).find(d=>d.startsWith("arcwallet"));if(c){const d=c.split("/");d.length>1&&Be.coerce(d[1])&&(p=Be.coerce(d[1]).version)}const u=(()=>{const{type:d="",model:r=""}=l.device;return d==="mobile"?{icon:e.jsx(fs,{fontSize:"small"}),text:r||"Mobile Device"}:d==="tablet"?{icon:e.jsx(xs,{fontSize:"small"}),text:r||"Tablet"}:{icon:e.jsx(ms,{fontSize:"small"}),text:r||"Desktop"}})(),f=(()=>{const{name:d="",version:r=""}=l.os;return d.toLowerCase().includes("mac")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("ios")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("android")?{icon:e.jsx(us,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("windows")?{icon:e.jsx(me,{fontSize:"small"}),text:`${d} ${r}`}:{icon:null,text:d?`${d} ${r}`:"Unknown OS"}})(),a=(()=>{const{name:d="",version:r=""}=l.browser;return{icon:e.jsx(fe,{fontSize:"small"}),text:d?`${d} ${r}`:"Unknown Browser"}})();return{device:u,os:f,browser:a,...p?{walletVersion:{icon:null,text:p}}:{}}}catch(n){return console.error("Error parsing user agent:",n),{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}}}}function ct({ua:s}){const n=gs(s);return e.jsx(V,{spacing:1,children:Object.entries(n).map(([l,{icon:p,text:c}])=>e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:p}),e.jsx(N,{variant:"body2",sx:{display:"flex"},children:c})]},l))})}ct.propTypes={ua:y.string.isRequired};const dt=()=>{const{t:s}=F(),n={$all:s("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:n,formatRoleName:p=>{const c=(p||"").toLowerCase();return c.startsWith("$")?n[c]||c.slice(1):n[c]||c}}},ys=(s,n=!1)=>{const l=n?1:.6;switch(s){case"owner":return`rgba(232, 222, 255, ${l})`;case"admin":return`rgba(227, 242, 253, ${l})`;case"member":return`rgba(232, 245, 233, ${l})`;case"guest":return`rgba(245, 245, 245, ${l})`;default:return`rgba(245, 245, 245, ${l})`}},js=je(ve)(({role:s})=>({backgroundColor:ys(s.toLowerCase()),color:"#000000"})),vs=s=>{switch(s){case"valid":return n=>n.palette.success.light;case"expired":return n=>n.palette.text.disabled;case"revoked":return n=>n.palette.error.light;default:return n=>n.palette.warning.light}},bs=je(ve)(({theme:s,status:n})=>({backgroundColor:vs(n)(s),color:"#FFFFFF"}));function pt({did:s}){return e.jsx(J,{size:14,responsive:!1,compact:!0,copyable:!1,did:s})}pt.propTypes={did:y.string.isRequired};function ut({timestamp:s,locale:n}){return e.jsx(g,{sx:{minWidth:"100px"},children:e.jsx(oe,{value:s,locale:n})})}ut.propTypes={timestamp:y.number.isRequired,locale:y.string.isRequired};function mt({name:s="",role:n}){const{formatRoleName:l}=dt();return e.jsx(js,{label:l(s||n),size:"small",role:s||n,sx:{borderRadius:1}})}mt.propTypes={role:y.string.isRequired,name:y.string};function ft({status:s}){const{t:n}=F();return e.jsx(bs,{label:n(`team.passport.statusMap.${s}`),size:"small",status:s,sx:{borderRadius:1}})}ft.propTypes={status:y.string.isRequired};function xt({source:s}){const{t:n}=F();return s?n(`team.passport.sourceMaps.${s}`):"-"}xt.propTypes={source:y.string.isRequired};function ht({user:s,size:n="default",tooltip:l=!1,inService:p=!1}){const{teamDid:c}=M(),u=ie.useMemo(()=>be(s.avatar,c,p),[s.avatar,c,p]),f=ie.useMemo(()=>e.jsx(J,{did:s?.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[s?.did]),a=Nt(()=>({...s,avatar:u}),[s,u]);return n==="small"?e.jsx(lt,{variant:"circular",logo:u,name:e.jsx(N,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:s.fullName||s.email}),...n==="small"?{tooltip:l?e.jsx(J,{did:s?.did}):!1,size:24}:{description:f,size:36}}):e.jsx(Lt,{user:a,avatarSize:n==="small"?24:36,cardType:Mt.Detailed,infoType:Bt.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})}ht.propTypes={user:y.object.isRequired,size:y.string,tooltip:y.bool,inService:y.bool};const Cs=ie.memo(ht),Ss=s=>e.jsx(pt,{did:s}),Ie=(s,n)=>e.jsx(mt,{name:s,role:n}),Re=s=>e.jsx(ft,{status:s}),gt=(s,n)=>e.jsx(ut,{timestamp:s,locale:n}),de=s=>e.jsx(xt,{source:s}),De=(s,n=!1)=>e.jsx(Cs,{user:s,inService:n}),ws=s=>e.jsx(ct,{ua:s}),Oe="info";function yt({createPassportSvg:s,passport:n,onCancel:l,onSwitchPassport:p=()=>{}}){const{t:c}=F(),u=$t({tab:Oe}),f={info:{label:c("common.basicInfo"),value:Oe,component:()=>e.jsx(jt,{passport:n,createPassportSvg:s})},logs:{label:c("common.logs"),value:"logs",component:()=>e.jsx(Ct,{passport:n})},related:{label:c("team.passport.related"),value:"related",component:()=>e.jsx(St,{passport:n,onSwitchPassport:p})}},a=Object.values(f).map(({label:o,value:i})=>({label:o,value:i})).filter(o=>o.value==="related"?n.parentDid:!0),d=f[u.tab]||f.info,r=o=>{u.tab=o};return e.jsx(H,{title:c("common.passport"),onClose:l,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ts,{children:[e.jsx(g,{className:"tabs",children:e.jsx(as,{tabs:a,current:u.tab,onChange:r,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(d.component,{})})]})})}yt.propTypes={createPassportSvg:y.func.isRequired,passport:y.object.isRequired,onCancel:y.func.isRequired,onSwitchPassport:y.func};const Ts=W(g)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|