@abtnode/blocklet-services 1.16.39-beta-20250225-115803-28695007 → 1.16.40-beta-20250227-092112-1815be0a
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/api/index.js +39 -1
- package/api/libs/env.js +2 -0
- package/api/routes/blocklet.js +16 -20
- package/api/routes/user.js +26 -0
- package/api/services/auth/connect/config-vault.js +52 -0
- package/api/services/auth/connect/lost-passport-issue.js +1 -1
- package/api/services/auth/index.js +2 -0
- package/api/util/index.js +1 -0
- package/dist/assets/{Add-BmJKwQyO.js → Add-CehHkXtu.js} +1 -1
- package/dist/assets/{ArrowDropDown-0rZMX37X.js → ArrowDropDown-C9ESZaJj.js} +1 -1
- package/dist/assets/{CheckCircle-Db4MUQqT.js → CheckCircle-Cux_Aj3D.js} +1 -1
- package/dist/assets/{ChevronLeft-y4mI_FZX.js → ChevronLeft-sep8bYo6.js} +1 -1
- package/dist/assets/{ChevronRight-BmoRuC5d.js → ChevronRight-E1JFBSBQ.js} +1 -1
- package/dist/assets/{DeleteOutline-Dk_mx0U9.js → DeleteOutline--b0uhBXu.js} +1 -1
- package/dist/assets/{Done-DAPcWPre.js → Done-Bh7hkuyF.js} +1 -1
- package/dist/assets/{Download-DBtg8_XU.js → Download-DauItc6L.js} +1 -1
- package/dist/assets/{Error-bxhw092Z.js → Error-DHOJb02F.js} +1 -1
- package/dist/assets/{Google-BBRxInBI.js → Google-Dc5CpY7r.js} +1 -1
- package/dist/assets/{InfoOutlined-0ZG65hON.js → InfoOutlined-CaT2OjoW.js} +1 -1
- package/dist/assets/{Launch-B0LQdypi.js → Launch-DLH9cYau.js} +1 -1
- package/dist/assets/{LaunchOutlined-B8xgQQyz.js → LaunchOutlined-CJoRhUht.js} +1 -1
- package/dist/assets/{MoreHoriz-C_pz-iQX.js → MoreHoriz-BdiHG-9g.js} +1 -1
- package/dist/assets/{PlayArrow-BxDb8_fk.js → PlayArrow-D3Xnrt2P.js} +1 -1
- package/dist/assets/{ViewList-Clymz6qO.js → ViewList-vuv6XoB6.js} +1 -1
- package/dist/assets/{access-control-l36Kv1eP.js → access-control-BvYVIpWS.js} +1 -1
- package/dist/assets/{actions-Bg4B90Ng.js → actions-Bejw-e5O.js} +1 -1
- package/dist/assets/add-component-core-RBE5ELHU.js +765 -0
- package/dist/assets/{add-resource-DJDXCNGa.js → add-resource-CDUyyqzt.js} +1 -1
- package/dist/assets/{addon-BMefWj3Y.js → addon-BpqDO9tj.js} +1 -1
- package/dist/assets/{analytics-CGZZCYDW.js → analytics-BJtYxYJj.js} +1 -1
- package/dist/assets/api-CSRyy6oj.js +1 -0
- package/dist/assets/ar-CsSmyJif.js +3 -0
- package/dist/assets/{audit-logs-4T6NVdcs.js → audit-logs-CElQxuBw.js} +1 -1
- package/dist/assets/{base32-CVAoJIo6.js → base32-Dxx2uO-0.js} +1 -1
- package/dist/assets/{branding-BknIP81X.js → branding-Co6nc32C.js} +2 -2
- package/dist/assets/{bundle-avatar-CoNY8eRA.js → bundle-avatar-CKPO4II3.js} +1 -1
- package/dist/assets/{button-CwN4D6jN.js → button-DgAPN-lt.js} +1 -1
- package/dist/assets/{click-to-copy-6ddlB0Mf.js → click-to-copy-SiMa2cN1.js} +1 -1
- package/dist/assets/{cloneDeep-BRiLvZjr.js → cloneDeep-DvDcCvik.js} +1 -1
- package/dist/assets/{complete-CodLsV6Q.js → complete-DmlGFAlQ.js} +1 -1
- package/dist/assets/{component-C6KUjmKu.js → component-DiDY-Kw4.js} +72 -72
- package/dist/assets/{config-DAYU_u5T.js → config-CLiczBaW.js} +1 -1
- package/dist/assets/{config-HWuoTPzE.js → config-Czk-fLJI.js} +1 -1
- package/dist/assets/{config-navigation-zrtX4o4X.js → config-navigation-BB7iqfQe.js} +6 -6
- package/dist/assets/{config-space-XhZzfFlu.js → config-space-DDnvKnd8.js} +1 -1
- package/dist/assets/{confirm-DOiB1azm.js → confirm-0Ay4zz5F.js} +1 -1
- package/dist/assets/{connect-DdcVSk7o.js → connect-COTQTs95.js} +1 -1
- package/dist/assets/{connect-Pr7yPGbr.js → connect-NWnGxDqK.js} +1 -1
- package/dist/assets/{connect-to-CPFzIYRI.js → connect-to-BWm1tQwA.js} +1 -1
- package/dist/assets/{dashboard-69TJZZXf.js → dashboard-Dr8B5iTX.js} +3 -3
- package/dist/assets/de-Ck9YpIMJ.js +3 -0
- package/dist/assets/{delete-confirm-B40sLeZT.js → delete-confirm-CRp06UUb.js} +1 -1
- package/dist/assets/{did-address-CMEabTWK.js → did-address-B8WelYg7.js} +1 -1
- package/dist/assets/{domain-CO__yMfd.js → domain-CjvQEI6b.js} +1 -1
- package/dist/assets/{domain-action-card-IU_piBkf.js → domain-action-card-DjmDH3Uj.js} +1 -1
- package/dist/assets/domains-C7Nqnf0f.js +1 -0
- package/dist/assets/{email-9Wn_1QHa.js → email-DOlX0xe4.js} +1 -1
- package/dist/assets/es-C27J2JeQ.js +3 -0
- package/dist/assets/{exchange-passport-C6ZRYzGg.js → exchange-passport-CoUK8I9Y.js} +1 -1
- package/dist/assets/{form-text-input-DFJ-HY33.js → form-text-input-CIKBwPcu.js} +1 -1
- package/dist/assets/fr-VZUGRssx.js +3 -0
- package/dist/assets/{fuel-CStHTdj2.js → fuel-CIXFsXuA.js} +1 -1
- package/dist/assets/{fullpage-8h94224x.js → fullpage-D6C9sgie.js} +1 -1
- package/dist/assets/{get-safe-url-Dx3fHYdz.js → get-safe-url-CvMgdIsM.js} +1 -1
- package/dist/assets/{get-safe-url-uLL3o3Bz.js → get-safe-url-Cww9J3VK.js} +1 -1
- package/dist/assets/hi-0Dd5nSCH.js +1 -0
- package/dist/assets/{home-Sj7bRyOu.js → home-BcaRSPYx.js} +1 -1
- package/dist/assets/id-DnRIoIgL.js +3 -0
- package/dist/assets/{iframe--xVlWiFx.js → iframe-BeZaO9bZ.js} +1 -1
- package/dist/assets/{index-BbPryvTN.js → index-19jBKgbd.js} +1 -1
- package/dist/assets/{index-B-6lM7Ra.js → index-2YkwBVJx.js} +1 -1
- package/dist/assets/{index-B88z8ae_.js → index-6U1CWqVe.js} +1 -1
- package/dist/assets/{index-DHbUVurK.js → index-BCiJnwmE.js} +1 -1
- package/dist/assets/{index-Dej7O8u1.js → index-BSEUYLtR.js} +3 -3
- package/dist/assets/{index-CaYw_sGg.js → index-BgO4U6d_.js} +1 -1
- package/dist/assets/{index-Bvc1Het2.js → index-C2rpN-Mh.js} +48 -48
- package/dist/assets/{index-DCYfQZQv.js → index-C5E0f4MM.js} +1 -1
- package/dist/assets/{index-BFlzRo9y.js → index-C8diuKw-.js} +1 -1
- package/dist/assets/{index-Chdw3Mm9.js → index-CIovcKjE.js} +11 -11
- package/dist/assets/{index-BuEBzoTv.js → index-COMBNFIf.js} +1 -1
- package/dist/assets/index-CqFqcj_v.js +144 -0
- package/dist/assets/{index-DiBrr7rQ.js → index-D9unNEiC.js} +1 -1
- package/dist/assets/index-DvZ2VDrh.js +104 -0
- package/dist/assets/{index-C2fPoxDR.js → index-ISNTpwcS.js} +1 -1
- package/dist/assets/{index-CLtmZ4Uc.js → index-d-LGBl0-.js} +1 -1
- package/dist/assets/{invitation-Bk4V3npR.js → invitation-CXP1edIt.js} +1 -1
- package/dist/assets/{invite-BUrxUiM4.js → invite-B-tph_rB.js} +1 -1
- package/dist/assets/{issue-passport-LjCBWTLp.js → issue-passport-BUVkg2-O.js} +1 -1
- package/dist/assets/{item-CU8gjQLR.js → item-CuvjqLrq.js} +1 -1
- package/dist/assets/ja-CV7QuyLJ.js +3 -0
- package/dist/assets/ko-Cc-UWhAC.js +3 -0
- package/dist/assets/{layout-DlcnI-bQ.js → layout-DH6138ux.js} +1 -1
- package/dist/assets/{list-C0r8iRRB.js → list-WWP8bcK6.js} +1 -1
- package/dist/assets/{list-header-BxwaCWhi.js → list-header-MogH2bs1.js} +1 -1
- package/dist/assets/localization-D_98hbR7.js +1 -0
- package/dist/assets/{log-DDt6ZHuh.js → log-Bt5p-4Xe.js} +1 -1
- package/dist/assets/{login-BrcbsHWR.js → login-CIIEVvdS.js} +1 -1
- package/dist/assets/{login-oauth-callback-BtiDyMHL.js → login-oauth-callback-DjEWdBzQ.js} +1 -1
- package/dist/assets/{logo-uploader-D4fxXmur.js → logo-uploader-B7U1Vq_i.js} +3 -3
- package/dist/assets/lost-passport-CoAoO7Df.js +168 -0
- package/dist/assets/omit-C3h2fvu1.js +1 -0
- package/dist/assets/{open-window-DnH-0MMu.js → open-window-HNe0hOEj.js} +1 -1
- package/dist/assets/overview-i1NNuzDM.js +12 -0
- package/dist/assets/{page-header-DuudrBOC.js → page-header-DdgQ5XYN.js} +1 -1
- package/dist/assets/{permission-gXouk-B0.js → permission-Yia679mu.js} +1 -1
- package/dist/assets/{preferences-A51J87rf.js → preferences-BBS3DDBv.js} +1 -1
- package/dist/assets/pt-BSP6S8OX.js +1 -0
- package/dist/assets/{publish-resource-NOa9YLAl.js → publish-resource-D_iibuC8.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-BZeJj24u.js → react-beautiful-dnd.esm-DCOKNvGX.js} +1 -1
- package/dist/assets/{relative-time-BCWLhhPH.js → relative-time-Tv8VzuvC.js} +1 -1
- package/dist/assets/ru-6g_ewyGj.js +1 -0
- package/dist/assets/sdk-CLSP2XpB.js +1 -0
- package/dist/assets/{session-BZcdSP0I.js → session-C4pA5XYh.js} +1 -1
- package/dist/assets/{setup-Cpu7J4_y.js → setup-VtCz7ZF5.js} +3 -3
- package/dist/assets/{start-BLOBNJG_.js → start-DyNFzLUm.js} +1 -1
- package/dist/assets/status-EWGG72pb.js +2 -0
- package/dist/assets/{step-actions-CmVVf-zP.js → step-actions-CYRP8hK4.js} +1 -1
- package/dist/assets/{studio-BTdXXP89.js → studio-scrRCunQ.js} +1 -1
- package/dist/assets/{switch-control-CvWGgTqL.js → switch-control-BzT1Su42.js} +1 -1
- package/dist/assets/th-esVTW-ew.js +1 -0
- package/dist/assets/{traffic-BY4t5NK9.js → traffic-CzR0nh2V.js} +3 -3
- package/dist/assets/{transfer-BanXhhLH.js → transfer-CQc79y3K.js} +1 -1
- package/dist/assets/{unsubscribe-moWDAdNt.js → unsubscribe-Bl6Rt5x9.js} +1 -1
- package/dist/assets/{useAsync-CEZQNMFX.js → useAsync-DIcJhKIm.js} +1 -1
- package/dist/assets/{useAsyncRetry-Dgdo-UIp.js → useAsyncRetry-DCwz7CH3.js} +1 -1
- package/dist/assets/{useLocalStorage-W2jFfyW5.js → useLocalStorage-Cd4aCng4.js} +1 -1
- package/dist/assets/user-center-DlCGGhhc.js +71 -0
- package/dist/assets/{util-D7bUyvZo.js → util-AoFN7OG5.js} +1 -1
- package/dist/assets/{util-DSr6HSOc.js → util-qn_aF3F7.js} +1 -1
- package/dist/assets/{vendor-arcblock-CCaRdbCP.js → vendor-arcblock-Cn3IZfUJ.js} +11 -11
- package/dist/assets/{vendor-hooks-ZnvK17j8.js → vendor-hooks-6khEvbqa.js} +1 -1
- package/dist/assets/{vendor-utils-5TjOM6td.js → vendor-utils-CzbloUV0.js} +1 -1
- package/dist/assets/vi-hhbCmVdC.js +1 -0
- package/dist/assets/wrap-locale-DigqkQih.js +1 -0
- package/dist/assets/zh-DhdNY_Mb.js +4 -0
- package/dist/assets/zh-tw-joa-mQa2.js +3 -0
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/package.json +43 -43
- package/dist/assets/Loop-BXX-hAMr.js +0 -1
- package/dist/assets/add-component-core-DIvTbKqk.js +0 -765
- package/dist/assets/api-K65cLqol.js +0 -1
- package/dist/assets/ar-C834W8qI.js +0 -3
- package/dist/assets/de-CFnPquDv.js +0 -3
- package/dist/assets/domains-COuggT-Y.js +0 -1
- package/dist/assets/es-1vhRGejN.js +0 -3
- package/dist/assets/fr-Ns3NPRIk.js +0 -3
- package/dist/assets/hi-ViGzXalB.js +0 -1
- package/dist/assets/id-BLl6P6K2.js +0 -3
- package/dist/assets/index-BqgSchC2.js +0 -144
- package/dist/assets/index-CWXx4nxx.js +0 -104
- package/dist/assets/ja-n4xwdLG4.js +0 -3
- package/dist/assets/keyboard-arrow-down-rounded-DadBVmpO.js +0 -1
- package/dist/assets/ko-Dbj9FZ69.js +0 -3
- package/dist/assets/localization-DV3j9YRu.js +0 -1
- package/dist/assets/lost-passport-DWkyeWzY.js +0 -168
- package/dist/assets/overview-Da2dyzO3.js +0 -12
- package/dist/assets/pt-BhWb_zOM.js +0 -1
- package/dist/assets/ru-CT_fQaXm.js +0 -1
- package/dist/assets/sdk-BwPkyeHJ.js +0 -1
- package/dist/assets/th-0YsGJNSr.js +0 -1
- package/dist/assets/user-center-C6w10W9t.js +0 -71
- package/dist/assets/vi-Bd_aQi4n.js +0 -1
- package/dist/assets/wrap-locale-CQN7rz2k.js +0 -1
- package/dist/assets/zh-BpuBeUbL.js +0 -4
- package/dist/assets/zh-tw-BxRHN771.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b}from"./vendor-react-D-afvo_7.js";import{j as e,E as d,a1 as Pe,R as bt,a4 as jt,T as G,a3 as R,A as Fe,bH as _e,cn as et,cm as Te,aN as Ie,bL as De,x as ye,aj as Ee,a2 as tt,aa as ae,V as nt,bO as Ye,bI as vt,aP as yt,al as Je,co as St}from"./vendor-mui-core-BWT1QT-d.js";import{b as Z,ap as re,z as Ct}from"./vendor-utils-5TjOM6td.js";import{j as V,b as L,ad as Nt,a0 as Be,e as Y,bC as wt,D as st,a3 as Ae,aX as at,aF as be,a8 as Rt,ao as Tt,bl as It}from"./vendor-arcblock-CCaRdbCP.js";import{z as Dt,G as $,m as Et,I as Qe}from"./index-CWXx4nxx.js";import{e as pe,a as Oe}from"./vendor-hooks-ZnvK17j8.js";import{S as ue}from"./shorten-label-CRTt8ftG.js";import{I as it}from"./index-BbPryvTN.js";import{S as At,a as Ot}from"./list-C0r8iRRB.js";import{R as ze}from"./relative-time-BCWLhhPH.js";import{b as We}from"./dashboard-69TJZZXf.js";import{W as Lt}from"./did-address-CMEabTWK.js";import{p as ot}from"./util-D7bUyvZo.js";import{D as kt,g as Pt}from"./traffic-BY4t5NK9.js";import{B as rt}from"./bundle-avatar-CoNY8eRA.js";import{B as Ft}from"./index-DCYfQZQv.js";import"./index-CV3ZYUK0.js";import"./InfoOutlined-0ZG65hON.js";import"./useLocalStorage-W2jFfyW5.js";import"./confirm-DOiB1azm.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-BxDb8_fk.js";import"./get-safe-url-uLL3o3Bz.js";import"./session-BZcdSP0I.js";import"./useAsyncRetry-Dgdo-UIp.js";import"./useAsync-CEZQNMFX.js";import"./useSetState-Crt4S51m.js";import"./base32-CVAoJIo6.js";import"./iframe--xVlWiFx.js";import"./LaunchOutlined-B8xgQQyz.js";import"./ChevronLeft-y4mI_FZX.js";import"./ChevronRight-BmoRuC5d.js";import"./index-BPho8CPY.js";import"./vendor-mui-x-VJmvJUkN.js";const lt=b.createContext({}),{Provider:_t,Consumer:Qn}=lt;function Bt({children:t,blocklet:n=""}){const{api:s,inService:i}=Dt(),[a,l]=b.useState([]),[p,f]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),y=pe(()=>{var j;return(j=n.meta)==null?void 0:j.did},[n]),[S,T]=b.useState([]),N=async({page:j=1,pageSize:v=20,...x}={})=>{if(!y)return[];try{const w={paging:{page:j,pageSize:v},...x,teamDid:y,dateRange:x.dateRange?[$(x.dateRange[0]).toISOString(),$(x.dateRange[1]).toISOString()]:void 0},{dids:M,...B}=w;let K="";M.includes("system")&&(K="system");const _=M.filter(ee=>ee!=="system"),Q=await s.getNotificationSendLog({input:{...B,source:K,componentDids:_}});return l(Q.list),f(Q.paging),Q.list}catch(w){return V.error(w.message),[]}},A=async()=>{const j=await s.getNotificationComponents({input:{teamDid:y}});T(j.componentDids)},P=b.useCallback(j=>{const v=n.children.find(x=>{var w;return((w=x.meta)==null?void 0:w.did)===j});if(v)return v.ancestors=[n],v},[n]),O=async({notificationId:j,receivers:v,channels:x,...w})=>{await s.resendNotification({input:{teamDid:y,notificationId:j,receivers:v,channels:x.map(M=>M==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:M==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:M),...w}})},F=b.useCallback(async j=>(await s.getUser({input:{teamDid:y,user:{did:j}}})).user,[s,y]),I=b.useCallback(async({page:j=1,pageSize:v=20,...x}={})=>{try{const w={paging:{page:j,pageSize:v},...x,userName:x.searchText||"",teamDid:y,dateRange:x.dateRange?[$(x.dateRange[0]).toISOString(),$(x.dateRange[1]).toISOString()]:void 0};return await s.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[s,y]);b.useEffect(()=>{y&&A()},[y]);const U={fetch:N,data:a,paging:p,blocklet:n,getComponent:P,resendNotification:O,getUser:F,componentDids:S,getReceivers:I,inService:i,teamDid:y};return e.jsx(_t,{value:{notificationRecords:U},children:t})}function Me(){const{notificationRecords:t}=b.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const zt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(Nt,{type:zt[t],children:t})}var qe={},Wt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,Mt=Wt(Be()),qt=e;ct=qe.default=(0,Mt.default)((0,qt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var Ke={},Kt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var dt=Ke.default=void 0,Ht=Kt(Be()),$t=e;dt=Ke.default=(0,Ht.default)((0,$t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var He={},Ut=Pe;Object.defineProperty(He,"__esModule",{value:!0});var ut=He.default=void 0,Vt=Ut(Be()),Gt=e;ut=He.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Xt=(t,n,s="")=>{if(!s||!n)return"";switch(s){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return s}};function pt(t,n,s={}){const{status:i,updatedAt:a,reason:l="",channel:p="wallet"}=s,f=a?t("notification.sendStatus.sentTime",{date:Et(a,n)}):"",y=Xt(t,p,l);return i===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:i===L.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"],Ze=["info","success","error","warning"],ft=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.email)==null?void 0:i.enabled},mt=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.pushKit)==null?void 0:i.enabled},Yt=(t,n)=>{const s=Z(n,"extra.notifications.email",!0);return{available:ft(t),enabled:s}},Jt=(t,n)=>{const s=Z(n,"extra.notifications.push",!0);return{available:mt(t),enabled:s}},Qt=t=>({enabled:Z(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:Z(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(n=>{setTimeout(()=>{n()},t*1e3)}),en=(t,n)=>n==="wallet"||n==="webhook"?[{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:n==="pushKit"||n==="email"?[{channel:n,type:"available",pass:t("notification.sendStatus.reason.available",{channel:n}),fail:t("notification.sendStatus.reason.unavailable",{channel:n})},{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:[],xe=(t=[])=>{const n=$().startOf("day");return t.filter(s=>$(s.sendAt).isSame(n,"day")).length},tn=(t,n="")=>{if(n&&ke.includes(n)){const l=`${n}SendRecord`,p=Z(t,l,[]);return xe(p)}const s=Z(t,"webhook",{}),i=Object.keys(s??{})??[];if(n&&i.includes(n)){const l=s[n]??[];return xe(l)}const a={};return ke.forEach(l=>{const p=`${l}SendRecord`,f=Z(t,p,[]),y=xe(f);a[l]=y}),i.length>0&&i.forEach(l=>{const p=s[l]??[],f=xe(p);a[l]=f}),a},je=(t,n,s)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[s].splice(n,1),t},ve=(t,n)=>{if(!Array.isArray(n))throw new Error("filters must be an array");return n.length?!n.includes(t):!1},nn=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>bt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"}},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 J({config:t,enableTooltip:n=!0,showTitle:s=!1,children:i}){const{status:a,title:l="",sentTime:p="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:n?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:p})]}):null,arrow:!0,placement:"top",children:e.jsxs(R,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(R,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(R,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a],style:{opacity:.15}}),e.jsx(R,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:s?l:i})]})})}J.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};J.defaultProps={enableTooltip:!0,showTitle:!1,children:null};le.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};le.defaultProps={onDelete:()=>{}};function le({list:t,label:n,onDelete:s}){const{t:i,locale:a}=Y();return e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[n,": "]}),t.map(l=>{const p=pt(i,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(R,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(J,{config:p,enableTooltip:!1,children:p.title})}),onDelete:f=>s(f,l)},l)})]})}$e.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function $e({filterList:t,onChange:n,index:s,column:i,filterValues:a,label:l,renderLabel:p}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(f=>e.jsx(Ie,{control:e.jsx(De,{checked:t[s].indexOf(f.value??f)>-1,onChange:y=>{const S=[...t];y.target.checked?S[s]=[...S[s],f.value??f]:S[s]=S[s].filter(T=>T!==(f.value??f)),n(S[s],s,i)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:p(f)})},f.value??f))})]})}function Re(t){return e.jsx($e,{...t,renderLabel:n=>e.jsx(J,{enableTooltip:!1,config:{status:n.status},children:n.label})})}oe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function oe({status:t,updatedAt:n,reason:s="",channel:i="wallet",onResend:a}){const{t:l,locale:p}=Y(),f=pt(l,p,{status:t,updatedAt:n,reason:s,channel:i});return e.jsxs(R,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(J,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(ye,{className:"resend-btn",size:"small",startIcon:e.jsx(We,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:n}){const{locale:s}=Y(),i=$().toDate(),[a,l]=b.useState(null),p=b.useCallback(S=>{l(a?null:S.currentTarget)},[a]),f=!!a,y=b.useCallback(S=>{if(!S.startDate||!S.endDate){V.error("Please select a date range");return}if($(S.startDate).isAfter(S.endDate)||!$(S.startDate).isValid()||!$(S.endDate).isValid()){V.error("Invalid date range");return}n([S.startDate,S.endDate]),l(null)},[n]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(ye,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],s)," - ",Qe(t[1],s)]})}),e.jsx(Ee,{open:f,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(kt,{open:!0,maxDate:i,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:Pt(i),onChange:y})})]})}Ve.propTypes={itemComponent:d.elementType.isRequired};function Ve({itemComponent:t,...n}){var a;const{t:s}=Y();return!((a=n==null?void 0:n.filterList)!=null&&a.filter(l=>l.length).length)?null:e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:s("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...n,ItemComponent:t})})]})}function Se({label:t,onDelete:n,canDelete:s=()=>!0,...i}){const a=n&&typeof n=="function"?n:void 0;let l=!0;return s&&typeof s=="function"&&(l=s({label:t,...i})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Se.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Se.defaultProps={canDelete:()=>!0};const sn=[{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}];Ge.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ge.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ge({loading:t=!1,onCancel:n,onConfirm:s}){const{t:i}=Y(),[a,l]=b.useState(sn),[p,f]=b.useState(!0),y=(T,N)=>{N.checked=T.target.checked;const A=a.map(P=>({...P,checked:P.value===N.value?N.checked:P.checked}));l(A)},S=T=>{T.stopPropagation(),s({channels:a.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:p})};return e.jsxs(R,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:i("notification.config")}),e.jsx(R,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:i("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(T=>e.jsx(Ie,{control:e.jsx(De,{checked:T.checked,onChange:N=>y(N,T),name:T.value}),label:T.label},T.value))})]})}),e.jsx(R,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(De,{checked:p,onChange:T=>f(T.target.checked)}),label:i("notification.resendFailedOnly")})})}),e.jsxs(R,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(ye,{onClick:T=>{T.stopPropagation(),n()},color:"inherit",children:i("common.cancel")}),e.jsxs(ye,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),i("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:n,resending:s=!1}){const{t:i,locale:a}=Y(),{getReceivers:l,inService:p,teamDid:f,getUser:y,blocklet:S}=Me(),[T,N]=b.useState(!1),[A,P]=b.useState([]),O=Oe({anchorEl:null,position:null}),F=Oe({anchorEl:null,position:null}),[I,U]=b.useState(null),[j,v]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[x,w]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[M,B]=b.useState([]),K=[{label:i("notification.sendStatus.pending"),value:0,status:"pending"},{label:i("notification.sendStatus.success"),value:1,status:"success"},{label:i("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!T&&t)try{N(!0);const o=await l({notificationId:t,...x}),r=o.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,f,p)}}));P(r),v(o.paging),N(!1)}catch(o){V.error(o.message),N(!1)}};b.useEffect(()=>{_()},[x]);const Q=o=>{o.stopPropagation();const r=o.currentTarget;F.anchorEl=r;const c=r.getBoundingClientRect();F.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ee=o=>o.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Q,children:i("notification.resend")})}):null,Ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:i("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:j.page-1,rowsPerPage:j.pageSize,count:j.total,searchText:x.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:M,onRowSelectionChange:(o,r)=>{B(r.map(c=>c.dataIndex))},customToolbarSelect:ee},we=({page:o,rowsPerPage:r,searchText:c,filterList:C})=>{const[,k=[],H=[],q=[]]=C;x.pageSize!==r?w(W=>({...W,pageSize:r,page:1})):x.page!==o+1?w(W=>({...W,page:o+1})):x.searchText!==c?w(W=>({...W,searchText:c,page:1})):re(k,x.walletSendStatus)?re(H,x.pushKitSendStatus)?re(q,x.emailSendStatus)||w(W=>({...W,emailSendStatus:q,page:1})):w(W=>({...W,pushKitSendStatus:H,page:1})):w(W=>({...W,walletSendStatus:k,page:1}))},me=b.useCallback(async(o,r)=>{if(!r)return!1;const c=await y(r);return c?o==="wallet"?Qt(c):o==="email"?Yt(S,c):o==="pushKit"?Jt(S,c):o==="webhook"?Zt(c):!0:!1},[y,S]),h=b.useCallback(o=>en(i,o),[i]),u=()=>{O.anchorEl=null,O.position=null,U(null)},m=()=>{F.anchorEl=null,F.position=null},g=async(o,r,c=!0,C="")=>{if(!(!r.length||!o.length))try{n(o,r,c,C),F.anchorEl||(await ge(.5),u())}catch(k){console.error("handleResend error",{error:k})}},D=async({channels:o,isResendFailedOnly:r})=>{const c=M.map(C=>A[C].receiver);await g(o,c,r),await ge(.5),m(),B([])},E=async(o,r=[],c=!0)=>{try{await g(["webhook"],[o.receiver],c,r)}catch(C){V.error(C.response?C.response.statusText:C.message)}},z=async(o,r,c,C=[],k=!0)=>{if(o.stopPropagation(),tn(r,c)>=4){V.warning(i("notification.resendLimit"));return}if(!ke.includes(c)){await E(r,C,k);return}if(o){const q=o.currentTarget,W=q.getBoundingClientRect();O.anchorEl=q,O.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}U({channel:c});try{const q=await me(c,r.receiver);await ge(1),U({channel:c,result:q}),(typeof q=="boolean"&&q||Ct(q)&&Object.values(q).every(W=>!!W))&&(await n([c],[r.receiver],k),F.anchorEl||(await ge(.5),u()))}catch(q){V.error(q.message)}},X=o=>{w(r=>({...r,dateRange:o,page:1}))},te=(o,r,c,C)=>{o.stopPropagation();const k=c.filter(H=>H!==r);w(H=>({...H,[C]:k,page:1}))},ie=pe(()=>[{label:i("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:o=>{const{receiverUser:r,receiver:c}=A[o];return r?e.jsxs(R,{"data-cy":`member-name-${r.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(st,{src:`${r.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(ue,{children:r.fullName})]},c):e.jsx(Lt,{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:x.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Wallet",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Wallet",filterList:o,onChange:r,index:c,column:C,filterValues:K})},customBodyRenderLite:o=>{const{walletSendStatus:r,walletSendAt:c,walletSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"wallet",onResend:k=>z(k,A[o],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:r,pushKitSendAt:c,pushKitSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"pushkit",onResend:k=>z(k,A[o],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:x.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Push Kit",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Push Kit",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{emailSendStatus:r,emailSendAt:c,emailSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"email",onResend:k=>z(k,A[o],"email",[],!1)})},filter:!0,filterType:"custom",filterList:x.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Email",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Email",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:r}=A[o];if(!r)return null;const c=Object.entries(r)[0];if(!c)return null;const[C,k]=c,H=k[0];return e.jsx(R,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(R,{className:"webhook-item",fontSize:12,children:[e.jsx(ue,{maxLength:30,children:C},C),e.jsx(oe,{status:H.status,updatedAt:H.sendAt,reason:H.failedReason,channel:"webhook",onResend:q=>z(q,A[o],"webhook",[C],!1)})]},C)})}}},{label:i("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:o=>{const{createdAt:r}=A[o];return e.jsx(ze,{value:r,locale:a,shouldUpdate:!0})}}}],[A,a,x,i]),he=[e.jsx(Ue,{value:x.dateRange,onChange:X},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:T,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:i("common.refresh")},"refresh")];return e.jsx(R,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(on,{children:e.jsxs(nt,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:a,loading:T,columns:ie,data:A,onChange:we,options:Ne,customButtons:he,components:{TableFilterList:o=>e.jsx(Ve,{...o,itemComponent:r=>e.jsx(Se,{...r,canDelete:()=>!1})})}}),O.anchorEl&&e.jsx(Ee,{open:!!O.anchorEl,anchorReference:"anchorPosition",anchorPosition:O.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rn,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(R,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:h(I==null?void 0:I.channel).map(o=>{var k,H;const{type:r,pass:c,fail:C}=o;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[r]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(H=I==null?void 0:I.result)!=null&&H[r]?be.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},r):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:be.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:C})]},r)})})]})}),F.anchorEl&&e.jsx(Ee,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:m,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ge,{loading:s,onCancel:m,onConfirm:D})})]})})})}const an=b.memo(gt),on=ae.div`
|
|
1
|
+
import{r as b}from"./vendor-react-D-afvo_7.js";import{j as e,E as d,a1 as Pe,R as bt,a4 as jt,T as G,a3 as R,A as Fe,bH as _e,cn as et,cm as Te,aN as Ie,bL as De,x as ye,aj as Ee,a2 as tt,aa as ae,V as nt,bO as Ye,bI as vt,aP as yt,al as Je,co as St}from"./vendor-mui-core-BWT1QT-d.js";import{b as Z,aq as re,z as Ct}from"./vendor-utils-CzbloUV0.js";import{j as V,b as L,ad as Nt,a0 as Be,e as Y,bD as wt,D as st,a3 as Ae,aX as at,aF as be,a8 as Rt,ao as Tt,bl as It}from"./vendor-arcblock-Cn3IZfUJ.js";import{z as Dt,G as $,m as Et,I as Qe}from"./index-DvZ2VDrh.js";import{e as pe,a as Oe}from"./vendor-hooks-6khEvbqa.js";import{S as ue}from"./shorten-label-CRTt8ftG.js";import{I as it}from"./index-19jBKgbd.js";import{S as At,a as Ot}from"./list-WWP8bcK6.js";import{R as ze}from"./relative-time-Tv8VzuvC.js";import{b as We}from"./dashboard-Dr8B5iTX.js";import{W as Lt}from"./did-address-B8WelYg7.js";import{p as ot}from"./util-AoFN7OG5.js";import{D as kt,g as Pt}from"./traffic-CzR0nh2V.js";import{B as rt}from"./bundle-avatar-CKPO4II3.js";import{B as Ft}from"./index-C5E0f4MM.js";import"./index-CV3ZYUK0.js";import"./InfoOutlined-CaT2OjoW.js";import"./useLocalStorage-Cd4aCng4.js";import"./confirm-0Ay4zz5F.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-D3Xnrt2P.js";import"./get-safe-url-Cww9J3VK.js";import"./session-C4pA5XYh.js";import"./useAsyncRetry-DCwz7CH3.js";import"./useAsync-DIcJhKIm.js";import"./useSetState-Crt4S51m.js";import"./base32-Dxx2uO-0.js";import"./iframe-BeZaO9bZ.js";import"./LaunchOutlined-CJoRhUht.js";import"./ChevronLeft-sep8bYo6.js";import"./ChevronRight-E1JFBSBQ.js";import"./index-BPho8CPY.js";import"./vendor-mui-x-VJmvJUkN.js";const lt=b.createContext({}),{Provider:_t,Consumer:Qn}=lt;function Bt({children:t,blocklet:n=""}){const{api:s,inService:i}=Dt(),[a,l]=b.useState([]),[p,f]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),y=pe(()=>{var j;return(j=n.meta)==null?void 0:j.did},[n]),[S,T]=b.useState([]),N=async({page:j=1,pageSize:v=20,...x}={})=>{if(!y)return[];try{const w={paging:{page:j,pageSize:v},...x,teamDid:y,dateRange:x.dateRange?[$(x.dateRange[0]).toISOString(),$(x.dateRange[1]).toISOString()]:void 0},{dids:M,...B}=w;let K="";M.includes("system")&&(K="system");const _=M.filter(ee=>ee!=="system"),Q=await s.getNotificationSendLog({input:{...B,source:K,componentDids:_}});return l(Q.list),f(Q.paging),Q.list}catch(w){return V.error(w.message),[]}},A=async()=>{const j=await s.getNotificationComponents({input:{teamDid:y}});T(j.componentDids)},P=b.useCallback(j=>{const v=n.children.find(x=>{var w;return((w=x.meta)==null?void 0:w.did)===j});if(v)return v.ancestors=[n],v},[n]),O=async({notificationId:j,receivers:v,channels:x,...w})=>{await s.resendNotification({input:{teamDid:y,notificationId:j,receivers:v,channels:x.map(M=>M==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:M==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:M),...w}})},F=b.useCallback(async j=>(await s.getUser({input:{teamDid:y,user:{did:j}}})).user,[s,y]),I=b.useCallback(async({page:j=1,pageSize:v=20,...x}={})=>{try{const w={paging:{page:j,pageSize:v},...x,userName:x.searchText||"",teamDid:y,dateRange:x.dateRange?[$(x.dateRange[0]).toISOString(),$(x.dateRange[1]).toISOString()]:void 0};return await s.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[s,y]);b.useEffect(()=>{y&&A()},[y]);const U={fetch:N,data:a,paging:p,blocklet:n,getComponent:P,resendNotification:O,getUser:F,componentDids:S,getReceivers:I,inService:i,teamDid:y};return e.jsx(_t,{value:{notificationRecords:U},children:t})}function Me(){const{notificationRecords:t}=b.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const zt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(Nt,{type:zt[t],children:t})}var qe={},Wt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,Mt=Wt(Be()),qt=e;ct=qe.default=(0,Mt.default)((0,qt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var Ke={},Kt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var dt=Ke.default=void 0,Ht=Kt(Be()),$t=e;dt=Ke.default=(0,Ht.default)((0,$t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var He={},Ut=Pe;Object.defineProperty(He,"__esModule",{value:!0});var ut=He.default=void 0,Vt=Ut(Be()),Gt=e;ut=He.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Xt=(t,n,s="")=>{if(!s||!n)return"";switch(s){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:n});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return s}};function pt(t,n,s={}){const{status:i,updatedAt:a,reason:l="",channel:p="wallet"}=s,f=a?t("notification.sendStatus.sentTime",{date:Et(a,n)}):"",y=Xt(t,p,l);return i===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:i===L.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"],Ze=["info","success","error","warning"],ft=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.email)==null?void 0:i.enabled},mt=t=>{var s,i;const{settings:n}=t;return(i=(s=n==null?void 0:n.notification)==null?void 0:s.pushKit)==null?void 0:i.enabled},Yt=(t,n)=>{const s=Z(n,"extra.notifications.email",!0);return{available:ft(t),enabled:s}},Jt=(t,n)=>{const s=Z(n,"extra.notifications.push",!0);return{available:mt(t),enabled:s}},Qt=t=>({enabled:Z(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:Z(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(n=>{setTimeout(()=>{n()},t*1e3)}),en=(t,n)=>n==="wallet"||n==="webhook"?[{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:n==="pushKit"||n==="email"?[{channel:n,type:"available",pass:t("notification.sendStatus.reason.available",{channel:n}),fail:t("notification.sendStatus.reason.unavailable",{channel:n})},{channel:n,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:n}),fail:t("notification.sendStatus.reason.disabled",{channel:n})}]:[],xe=(t=[])=>{const n=$().startOf("day");return t.filter(s=>$(s.sendAt).isSame(n,"day")).length},tn=(t,n="")=>{if(n&&ke.includes(n)){const l=`${n}SendRecord`,p=Z(t,l,[]);return xe(p)}const s=Z(t,"webhook",{}),i=Object.keys(s??{})??[];if(n&&i.includes(n)){const l=s[n]??[];return xe(l)}const a={};return ke.forEach(l=>{const p=`${l}SendRecord`,f=Z(t,p,[]),y=xe(f);a[l]=y}),i.length>0&&i.forEach(l=>{const p=s[l]??[],f=xe(p);a[l]=f}),a},je=(t,n,s)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[s].splice(n,1),t},ve=(t,n)=>{if(!Array.isArray(n))throw new Error("filters must be an array");return n.length?!n.includes(t):!1},nn=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>bt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"}},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 J({config:t,enableTooltip:n=!0,showTitle:s=!1,children:i}){const{status:a,title:l="",sentTime:p="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:n?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:p})]}):null,arrow:!0,placement:"top",children:e.jsxs(R,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(R,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(R,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a],style:{opacity:.15}}),e.jsx(R,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:s?l:i})]})})}J.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};J.defaultProps={enableTooltip:!0,showTitle:!1,children:null};le.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};le.defaultProps={onDelete:()=>{}};function le({list:t,label:n,onDelete:s}){const{t:i,locale:a}=Y();return e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[n,": "]}),t.map(l=>{const p=pt(i,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(R,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(J,{config:p,enableTooltip:!1,children:p.title})}),onDelete:f=>s(f,l)},l)})]})}$e.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function $e({filterList:t,onChange:n,index:s,column:i,filterValues:a,label:l,renderLabel:p}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(f=>e.jsx(Ie,{control:e.jsx(De,{checked:t[s].indexOf(f.value??f)>-1,onChange:y=>{const S=[...t];y.target.checked?S[s]=[...S[s],f.value??f]:S[s]=S[s].filter(T=>T!==(f.value??f)),n(S[s],s,i)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:p(f)})},f.value??f))})]})}function Re(t){return e.jsx($e,{...t,renderLabel:n=>e.jsx(J,{enableTooltip:!1,config:{status:n.status},children:n.label})})}oe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function oe({status:t,updatedAt:n,reason:s="",channel:i="wallet",onResend:a}){const{t:l,locale:p}=Y(),f=pt(l,p,{status:t,updatedAt:n,reason:s,channel:i});return e.jsxs(R,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(J,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(ye,{className:"resend-btn",size:"small",startIcon:e.jsx(We,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:n}){const{locale:s}=Y(),i=$().toDate(),[a,l]=b.useState(null),p=b.useCallback(S=>{l(a?null:S.currentTarget)},[a]),f=!!a,y=b.useCallback(S=>{if(!S.startDate||!S.endDate){V.error("Please select a date range");return}if($(S.startDate).isAfter(S.endDate)||!$(S.startDate).isValid()||!$(S.endDate).isValid()){V.error("Invalid date range");return}n([S.startDate,S.endDate]),l(null)},[n]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(ye,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],s)," - ",Qe(t[1],s)]})}),e.jsx(Ee,{open:f,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(kt,{open:!0,maxDate:i,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:Pt(i),onChange:y})})]})}Ve.propTypes={itemComponent:d.elementType.isRequired};function Ve({itemComponent:t,...n}){var a;const{t:s}=Y();return!((a=n==null?void 0:n.filterList)!=null&&a.filter(l=>l.length).length)?null:e.jsxs(R,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:s("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...n,ItemComponent:t})})]})}function Se({label:t,onDelete:n,canDelete:s=()=>!0,...i}){const a=n&&typeof n=="function"?n:void 0;let l=!0;return s&&typeof s=="function"&&(l=s({label:t,...i})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Se.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Se.defaultProps={canDelete:()=>!0};const sn=[{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}];Ge.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ge.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ge({loading:t=!1,onCancel:n,onConfirm:s}){const{t:i}=Y(),[a,l]=b.useState(sn),[p,f]=b.useState(!0),y=(T,N)=>{N.checked=T.target.checked;const A=a.map(P=>({...P,checked:P.value===N.value?N.checked:P.checked}));l(A)},S=T=>{T.stopPropagation(),s({channels:a.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:p})};return e.jsxs(R,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:i("notification.config")}),e.jsx(R,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:i("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(T=>e.jsx(Ie,{control:e.jsx(De,{checked:T.checked,onChange:N=>y(N,T),name:T.value}),label:T.label},T.value))})]})}),e.jsx(R,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(De,{checked:p,onChange:T=>f(T.target.checked)}),label:i("notification.resendFailedOnly")})})}),e.jsxs(R,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(ye,{onClick:T=>{T.stopPropagation(),n()},color:"inherit",children:i("common.cancel")}),e.jsxs(ye,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),i("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:n,resending:s=!1}){const{t:i,locale:a}=Y(),{getReceivers:l,inService:p,teamDid:f,getUser:y,blocklet:S}=Me(),[T,N]=b.useState(!1),[A,P]=b.useState([]),O=Oe({anchorEl:null,position:null}),F=Oe({anchorEl:null,position:null}),[I,U]=b.useState(null),[j,v]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[x,w]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[M,B]=b.useState([]),K=[{label:i("notification.sendStatus.pending"),value:0,status:"pending"},{label:i("notification.sendStatus.success"),value:1,status:"success"},{label:i("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!T&&t)try{N(!0);const o=await l({notificationId:t,...x}),r=o.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,f,p)}}));P(r),v(o.paging),N(!1)}catch(o){V.error(o.message),N(!1)}};b.useEffect(()=>{_()},[x]);const Q=o=>{o.stopPropagation();const r=o.currentTarget;F.anchorEl=r;const c=r.getBoundingClientRect();F.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ee=o=>o.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Q,children:i("notification.resend")})}):null,Ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:i("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:j.page-1,rowsPerPage:j.pageSize,count:j.total,searchText:x.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:M,onRowSelectionChange:(o,r)=>{B(r.map(c=>c.dataIndex))},customToolbarSelect:ee},we=({page:o,rowsPerPage:r,searchText:c,filterList:C})=>{const[,k=[],H=[],q=[]]=C;x.pageSize!==r?w(W=>({...W,pageSize:r,page:1})):x.page!==o+1?w(W=>({...W,page:o+1})):x.searchText!==c?w(W=>({...W,searchText:c,page:1})):re(k,x.walletSendStatus)?re(H,x.pushKitSendStatus)?re(q,x.emailSendStatus)||w(W=>({...W,emailSendStatus:q,page:1})):w(W=>({...W,pushKitSendStatus:H,page:1})):w(W=>({...W,walletSendStatus:k,page:1}))},me=b.useCallback(async(o,r)=>{if(!r)return!1;const c=await y(r);return c?o==="wallet"?Qt(c):o==="email"?Yt(S,c):o==="pushKit"?Jt(S,c):o==="webhook"?Zt(c):!0:!1},[y,S]),h=b.useCallback(o=>en(i,o),[i]),u=()=>{O.anchorEl=null,O.position=null,U(null)},m=()=>{F.anchorEl=null,F.position=null},g=async(o,r,c=!0,C="")=>{if(!(!r.length||!o.length))try{n(o,r,c,C),F.anchorEl||(await ge(.5),u())}catch(k){console.error("handleResend error",{error:k})}},D=async({channels:o,isResendFailedOnly:r})=>{const c=M.map(C=>A[C].receiver);await g(o,c,r),await ge(.5),m(),B([])},E=async(o,r=[],c=!0)=>{try{await g(["webhook"],[o.receiver],c,r)}catch(C){V.error(C.response?C.response.statusText:C.message)}},z=async(o,r,c,C=[],k=!0)=>{if(o.stopPropagation(),tn(r,c)>=4){V.warning(i("notification.resendLimit"));return}if(!ke.includes(c)){await E(r,C,k);return}if(o){const q=o.currentTarget,W=q.getBoundingClientRect();O.anchorEl=q,O.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}U({channel:c});try{const q=await me(c,r.receiver);await ge(1),U({channel:c,result:q}),(typeof q=="boolean"&&q||Ct(q)&&Object.values(q).every(W=>!!W))&&(await n([c],[r.receiver],k),F.anchorEl||(await ge(.5),u()))}catch(q){V.error(q.message)}},X=o=>{w(r=>({...r,dateRange:o,page:1}))},te=(o,r,c,C)=>{o.stopPropagation();const k=c.filter(H=>H!==r);w(H=>({...H,[C]:k,page:1}))},ie=pe(()=>[{label:i("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:o=>{const{receiverUser:r,receiver:c}=A[o];return r?e.jsxs(R,{"data-cy":`member-name-${r.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(st,{src:`${r.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(ue,{children:r.fullName})]},c):e.jsx(Lt,{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:x.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Wallet",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Wallet",filterList:o,onChange:r,index:c,column:C,filterValues:K})},customBodyRenderLite:o=>{const{walletSendStatus:r,walletSendAt:c,walletSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"wallet",onResend:k=>z(k,A[o],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:r,pushKitSendAt:c,pushKitSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"pushkit",onResend:k=>z(k,A[o],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:x.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Push Kit",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Push Kit",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{emailSendStatus:r,emailSendAt:c,emailSendFailedReason:C}=A[o];return e.jsx(oe,{status:r,updatedAt:c,reason:C,channel:"email",onResend:k=>z(k,A[o],"email",[],!1)})},filter:!0,filterType:"custom",filterList:x.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(le,{list:o,label:"Email",onDelete:(r,c)=>{r.stopPropagation(),te(r,c,ie[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(o,r,c,C)=>e.jsx(Re,{label:"Email",filterList:o,onChange:r,index:c,column:C,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:r}=A[o];if(!r)return null;const c=Object.entries(r)[0];if(!c)return null;const[C,k]=c,H=k[0];return e.jsx(R,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(R,{className:"webhook-item",fontSize:12,children:[e.jsx(ue,{maxLength:30,children:C},C),e.jsx(oe,{status:H.status,updatedAt:H.sendAt,reason:H.failedReason,channel:"webhook",onResend:q=>z(q,A[o],"webhook",[C],!1)})]},C)})}}},{label:i("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:o=>{const{createdAt:r}=A[o];return e.jsx(ze,{value:r,locale:a,shouldUpdate:!0})}}}],[A,a,x,i]),he=[e.jsx(Ue,{value:x.dateRange,onChange:X},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:T,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:i("common.refresh")},"refresh")];return e.jsx(R,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(on,{children:e.jsxs(nt,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:a,loading:T,columns:ie,data:A,onChange:we,options:Ne,customButtons:he,components:{TableFilterList:o=>e.jsx(Ve,{...o,itemComponent:r=>e.jsx(Se,{...r,canDelete:()=>!1})})}}),O.anchorEl&&e.jsx(Ee,{open:!!O.anchorEl,anchorReference:"anchorPosition",anchorPosition:O.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rn,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(R,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:h(I==null?void 0:I.channel).map(o=>{var k,H;const{type:r,pass:c,fail:C}=o;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[r]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(H=I==null?void 0:I.result)!=null&&H[r]?be.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},r):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:be.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:C})]},r)})})]})}),F.anchorEl&&e.jsx(Ee,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:m,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ge,{loading:s,onCancel:m,onConfirm:D})})]})})})}const an=b.memo(gt),on=ae.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|