@abtnode/blocklet-services 1.16.42-beta-20250412-084444-20b0cf19 → 1.16.42-beta-20250413-121549-22e9a196
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 +32 -2
- package/api/libs/push-kit/index.js +16 -11
- package/api/routes/user-session.js +49 -40
- package/api/routes/user.js +16 -4
- package/api/services/auth/session.js +37 -10
- package/api/util/attach-shared-utils.js +12 -5
- package/dist/assets/{ArrowDropDown-C_E3qkPd.js → ArrowDropDown-a-C4j7Lx.js} +1 -1
- package/dist/assets/{CheckCircle-D7Ntmb2o.js → CheckCircle-CuYzdCtm.js} +1 -1
- package/dist/assets/{ChevronLeft-BIgT65EY.js → ChevronLeft-CnflXey6.js} +1 -1
- package/dist/assets/{ChevronRight-foZmiP4J.js → ChevronRight-DE7hYCb3.js} +1 -1
- package/dist/assets/{Community-Ds1NG5Zj.js → Community-C8NtUXNH.js} +1 -1
- package/dist/assets/{DeleteOutline-CKVA3PXs.js → DeleteOutline-PGhagisl.js} +1 -1
- package/dist/assets/{Done-BDrYSkZM.js → Done-BVaQae1-.js} +1 -1
- package/dist/assets/{Download-BQiSNQBP.js → Download-DNNh4N1T.js} +1 -1
- package/dist/assets/{EditIcon-Bt91o1l6.js → EditIcon-Y1U-3M09.js} +1 -1
- package/dist/assets/{Email-C7SKOpM8.js → Email-BYzCrU9G.js} +1 -1
- package/dist/assets/{Error-CK4gTMoT.js → Error-C4dVUMw4.js} +1 -1
- package/dist/assets/{ExpandLess-1B6PdCYC.js → ExpandLess-Blh1x-4z.js} +1 -1
- package/dist/assets/{Google-DimUFzIe.js → Google-CAujGJ1A.js} +1 -1
- package/dist/assets/{Holiday-Dfj3kBBI.js → Holiday-DxDxhx5X.js} +1 -1
- package/dist/assets/{InfoOutlined-CEHciuDy.js → InfoOutlined-DF9JwavD.js} +1 -1
- package/dist/assets/{Launch-DX76v5dw.js → Launch-gOz_lwLg.js} +1 -1
- package/dist/assets/{LaunchOutlined-CnOQGhu-.js → LaunchOutlined-MbSPR9qn.js} +1 -1
- package/dist/assets/{Location--4ueDivQ.js → Location-CEwgGcA5.js} +1 -1
- package/dist/assets/{LockIcon-B84lMZao.js → LockIcon-D7BH0t_p.js} +1 -1
- package/dist/assets/{Meeting-CVVnP-bH.js → Meeting-BJz5QiFc.js} +1 -1
- package/dist/assets/{MoreHoriz-THEF6D0C.js → MoreHoriz-CGWVyYh4.js} +1 -1
- package/dist/assets/{OffSick-C_2x7yDI.js → OffSick--msvqLGm.js} +1 -1
- package/dist/assets/{Phone-CaKOX2Yu.js → Phone-CDl3oDYG.js} +1 -1
- package/dist/assets/{PlayArrow-DpcMtsY5.js → PlayArrow-CxWt6459.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-5K6WR8Pc.js → QuestionMarkCircle-CPHZnM6u.js} +1 -1
- package/dist/assets/{ServerLogo-C4P-qXGV.js → ServerLogo-vX_nf8Sc.js} +1 -1
- package/dist/assets/{Timezone-Bgwxnj29.js → Timezone-uXi4_8BX.js} +1 -1
- package/dist/assets/{TuneOutlined-DHqZ7jGz.js → TuneOutlined-DcqnBMqE.js} +1 -1
- package/dist/assets/{ViewList-DOu7Co_L.js → ViewList-B6eveRY-.js} +1 -1
- package/dist/assets/{WorkingRemotely-Dm2BOs5c.js → WorkingRemotely-CK4z1-Sd.js} +1 -1
- package/dist/assets/{access-control-wqGz9JCo.js → access-control-Dxyg5dpc.js} +1 -1
- package/dist/assets/{actions-CAL1KFv7.js → actions-BAjt7G_t.js} +1 -1
- package/dist/assets/{add-component-core-DqvSoT6a.js → add-component-core-BXowXTJz.js} +1 -1
- package/dist/assets/{add-resource-DmN1IY_o.js → add-resource-BetUBTvt.js} +1 -1
- package/dist/assets/{addon-D1_etOjl.js → addon-B1aBsfOX.js} +1 -1
- package/dist/assets/{advanced-CzJgEcda.js → advanced-C8t1232G.js} +1 -1
- package/dist/assets/{appearance-Bn0kYJHu.js → appearance-BIOmTg1q.js} +1 -1
- package/dist/assets/{audit-logs-DU66CSpw.js → audit-logs-SSAqJt40.js} +1 -1
- package/dist/assets/{base32-CLGITfm-.js → base32-iVyUiizz.js} +1 -1
- package/dist/assets/{branding-C5rNAfwW.js → branding-BDuOcSfH.js} +1 -1
- package/dist/assets/{branding-CiE421Dn.js → branding-NmIAi0kv.js} +2 -2
- package/dist/assets/{bundle-avatar-vSofRY4G.js → bundle-avatar-DfAWUEqX.js} +1 -1
- package/dist/assets/button-Kk1bqv_H.js +1 -0
- package/dist/assets/{click-to-copy-C9iEVQIO.js → click-to-copy-DCUroWft.js} +1 -1
- package/dist/assets/{complete-BeWyfTmK.js → complete-R99mlHBI.js} +1 -1
- package/dist/assets/{component-CZ948vh4.js → component-By64LaLD.js} +1 -1
- package/dist/assets/{config-DzZULB-q.js → config-BHBxeyYh.js} +1 -1
- package/dist/assets/{config-CFbM7U_5.js → config-BvNNOdw8.js} +1 -1
- package/dist/assets/config-navigation-CPd_4svD.js +26 -0
- package/dist/assets/{config-space-Drp9NI7a.js → config-space-BgWEAM0m.js} +1 -1
- package/dist/assets/{confirm-B9OqaJpT.js → confirm-92J4n1RP.js} +1 -1
- package/dist/assets/{connect-CpUC5BAX.js → connect-Bq-p3hnS.js} +1 -1
- package/dist/assets/connect-D20f2K4u.js +5 -0
- package/dist/assets/{connect-to-BasQxweP.js → connect-to-bQVCrkhh.js} +1 -1
- package/dist/assets/{content-layout-Bs-vdQ_U.js → content-layout-CFHoSupA.js} +1 -1
- package/dist/assets/{dashboard-BYUKOMAe.js → dashboard-BgQFc2Pc.js} +11 -11
- package/dist/assets/{delete-confirm-CM4f-ajO.js → delete-confirm-AkwIQ5yF.js} +1 -1
- package/dist/assets/{did-address-B_VfxEC5.js → did-address-D4v6iN2l.js} +1 -1
- package/dist/assets/domain-CBdLs2D9.js +9 -0
- package/dist/assets/{domain-action-card-pHkmKFE3.js → domain-action-card-DN3KjFwP.js} +2 -2
- package/dist/assets/domains-CMJbalsn.js +1 -0
- package/dist/assets/{email-C5iUsSjP.js → email-JviRloBo.js} +1 -1
- package/dist/assets/{empty-spinner-Cia24BVr.js → empty-spinner-DlzuJxRt.js} +1 -1
- package/dist/assets/{exchange-passport-CyGvLDal.js → exchange-passport-3aXbJr-q.js} +1 -1
- package/dist/assets/{fuel-C5H_z1Ay.js → fuel-DOs3bqYm.js} +1 -1
- package/dist/assets/{get-safe-url-BOY9UAaI.js → get-safe-url-CWgEUVPT.js} +1 -1
- package/dist/assets/{get-safe-url-D_Puq_oh.js → get-safe-url-eATw6wn7.js} +1 -1
- package/dist/assets/{home-CjHQSa_8.js → home-a0RwGUp7.js} +1 -1
- package/dist/assets/{iframe-BhRKCdFb.js → iframe-DVBEjxC1.js} +1 -1
- package/dist/assets/{index-Kaq7tC6c.js → index-3q6oLa2e.js} +1 -1
- package/dist/assets/{index-C5lvlGzp.js → index-BBl5mftj.js} +3 -3
- package/dist/assets/{index-d34Q6nXR.js → index-BGeUo-5w.js} +1 -1
- package/dist/assets/{index-Cp_gD4ZQ.js → index-BJYrBMyS.js} +1 -1
- package/dist/assets/{index-B8FtPEFx.js → index-BVOsgGKh.js} +1 -1
- package/dist/assets/{index-DUU3hQpo.js → index-BxTrfRkG.js} +1 -1
- package/dist/assets/index-C3-7zmeY.js +346 -0
- package/dist/assets/{index-BTOIZL6e.js → index-CCwUSMuP.js} +1 -1
- package/dist/assets/{index-CjmXl7jW.js → index-CwdXL2a0.js} +1 -1
- package/dist/assets/{index-Ctl8J5Z5.js → index-DBLdE2lQ.js} +1 -1
- package/dist/assets/{index-CVIeQOoE.js → index-DQIxR9j5.js} +1 -1
- package/dist/assets/index-DWuuU3ta.js +113 -0
- package/dist/assets/{index-Cuoxr9xB.js → index-DjIOxw8x.js} +1 -1
- package/dist/assets/{index-CYAgDp3G.js → index-DrUxhMM5.js} +1 -1
- package/dist/assets/index-K5iSHoYm.js +224 -0
- package/dist/assets/{index-DR9nQ2tJ.js → index-KLUHbsxg.js} +1 -1
- package/dist/assets/{index-BYsXlcQC.js → index-MqiIu4kd.js} +1 -1
- package/dist/assets/{index-BjYech25.js → index-Th4BUzmb.js} +23 -23
- package/dist/assets/{index-Du2DtxVt.js → index-VvWvVQT8.js} +1 -1
- package/dist/assets/{index-DkZfhapD.js → index-sv3a1ZUw.js} +1 -1
- package/dist/assets/{invitation-C9hFp_wD.js → invitation-CwtXOXZc.js} +4 -4
- package/dist/assets/{invite-CzfqL5Tx.js → invite-CMj5995Z.js} +1 -1
- package/dist/assets/{issue-passport-D3F63x7z.js → issue-passport-DtEbcgX6.js} +1 -1
- package/dist/assets/{item-C_TigVeC.js → item-zVdGBfMR.js} +1 -1
- package/dist/assets/{landing-page-B5nKEn_3.js → landing-page-BM1TmagN.js} +1 -1
- package/dist/assets/{launch-result-message-C0Ao1hE-.js → launch-result-message-DOa3SWMR.js} +1 -1
- package/dist/assets/{layout-D5ALyxXA.js → layout-DCzN0ui5.js} +1 -1
- package/dist/assets/{list-DuzdV0Wa.js → list-BuXPrN1N.js} +8 -8
- package/dist/assets/{list-header-BibBP5t1.js → list-header-BLGbkNad.js} +1 -1
- package/dist/assets/localization-qd6O0FX9.js +1 -0
- package/dist/assets/{log-Dg8IZoeo.js → log-C0ajhie8.js} +1 -1
- package/dist/assets/{logger-Bd77RetM.js → logger-D6n4nbwy.js} +1 -1
- package/dist/assets/{login-B9XiO8eS.js → login-f1AXbIm0.js} +1 -1
- package/dist/assets/{login-oauth-callback-5AlLzjZ2.js → login-oauth-callback-C5CFUlUR.js} +1 -1
- package/dist/assets/{logo-uploader-ChABQ_cS.js → logo-uploader-DbAVW3BS.js} +3 -3
- package/dist/assets/{lost-passport-gGzRW--h.js → lost-passport-Dlmv8D-L.js} +2 -2
- package/dist/assets/{open-window-CX_mRFPs.js → open-window-DskgWqba.js} +1 -1
- package/dist/assets/{overview-ClfPLbRa.js → overview-DY9-9zrL.js} +1 -1
- package/dist/assets/{page-header-DWf5vODI.js → page-header-XbzfRkA7.js} +1 -1
- package/dist/assets/{permission-CmHMB8NK.js → permission-Bi46fqEy.js} +1 -1
- package/dist/assets/{preferences-COMN8FgJ.js → preferences-DPpwnIAs.js} +1 -1
- package/dist/assets/{profile-embed-Crj1xM6Z.js → profile-embed-DV5vno0C.js} +1 -1
- package/dist/assets/publish-resource-z2_THSz6.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-B3HYEQUw.js → react-beautiful-dnd.esm-B68lWn23.js} +1 -1
- package/dist/assets/{relative-time-CE47D6s7.js → relative-time-BeR_4mfM.js} +1 -1
- package/dist/assets/{runtime-CdKbOwQM.js → runtime-D6tESY33.js} +1 -1
- package/dist/assets/sdk-DNr-nKBq.js +1 -0
- package/dist/assets/{security-DmjkCoJ_.js → security-DmR541pi.js} +1 -1
- package/dist/assets/{session-0rF5SuCk.js → session-CJFbMNLl.js} +1 -1
- package/dist/assets/setup-BSsqBrsc.js +19 -0
- package/dist/assets/{shorten-label-DDBwv81M.js → shorten-label-BuH-7PI8.js} +1 -1
- package/dist/assets/{simple-select-vCKkiHhG.js → simple-select-DHvjqsw4.js} +1 -1
- package/dist/assets/{slicedToArray-Da5X2Yv5.js → slicedToArray-C0MW3KIe.js} +1 -1
- package/dist/assets/{spaces-CyFGYf34.js → spaces-gLUqr6Uq.js} +1 -1
- package/dist/assets/{start-CwSXw9Xs.js → start-XbVMHGiE.js} +1 -1
- package/dist/assets/{status-CgfGREVl.js → status-DmyvEkKL.js} +1 -1
- package/dist/assets/{step-actions-BNW8I1sI.js → step-actions-brdohYRv.js} +1 -1
- package/dist/assets/{studio-cLKWVbyy.js → studio-DJeZlIfF.js} +1 -1
- package/dist/assets/{switch-control-DpvMHPLC.js → switch-control-Br1YNOSB.js} +1 -1
- package/dist/assets/{traffic-ChJb5Oyl.js → traffic-LuIcK-L1.js} +1 -1
- package/dist/assets/{transfer-BHifjdxl.js → transfer-DboKwiA_.js} +1 -1
- package/dist/assets/{unsubscribe-CcyOqX8E.js → unsubscribe-C9k_L3g5.js} +1 -1
- package/dist/assets/{use-mobile-DjnNmGRG.js → use-mobile-C98e2dYy.js} +1 -1
- package/dist/assets/{use-mobile-DpXDDjat.js → use-mobile-CqLLcWbr.js} +1 -1
- package/dist/assets/useAsync-BxB2TpDl.js +1 -0
- package/dist/assets/useAsync-L7_fHBH5.js +1 -0
- package/dist/assets/useAsyncRetry-CEouAsle.js +7 -0
- package/dist/assets/{useLocalStorage-Cq9THoCr.js → useLocalStorage-0mjZfnua.js} +1 -1
- package/dist/assets/user-center-BaKv3X4J.js +77 -0
- package/dist/assets/{util-1n1Ulk5w.js → util-DLK92HF8.js} +1 -1
- package/dist/assets/{util-BmbbisPE.js → util-YnaMqM3B.js} +1 -1
- package/dist/assets/{vendor-arcblock-V3HYELzG.js → vendor-arcblock-DPMnO1AO.js} +83 -83
- package/dist/assets/{vendor-mui-core-1jJmAutq.js → vendor-mui-core-x3zpe_j_.js} +1 -1
- package/dist/assets/{vendor-mui-x-CPwlD3uT.js → vendor-mui-x-CPOc4sOK.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-DEbq97Xz.js → vendor-ux-did-connect-B1u6nvmg.js} +7 -7
- package/dist/assets/{wrap-locale-5LSB6OAr.js → wrap-locale-m_NRjq-h.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/package.json +30 -30
- package/dist/assets/button-BSJ2z68-.js +0 -1
- package/dist/assets/config-navigation-hrdLDyFZ.js +0 -26
- package/dist/assets/connect-0zFqdTRm.js +0 -5
- package/dist/assets/domain-D0xqhxvZ.js +0 -9
- package/dist/assets/domains-BrNRyjCn.js +0 -1
- package/dist/assets/index-Bee_YcJC.js +0 -113
- package/dist/assets/index-D3YZfNxX.js +0 -5
- package/dist/assets/index-DFoYVoMG.js +0 -346
- package/dist/assets/index-Dzvf3kMf.js +0 -220
- package/dist/assets/localization-WUgLuLwU.js +0 -1
- package/dist/assets/publish-resource-C6TOyrHC.js +0 -1
- package/dist/assets/sdk-j4w1A_X4.js +0 -1
- package/dist/assets/setup-DLCw2h80.js +0 -19
- package/dist/assets/useAsync-BENTIUEf.js +0 -1
- package/dist/assets/useAsyncRetry-DSYkC9r5.js +0 -7
- package/dist/assets/user-center-DfDG_giT.js +0 -77
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as r,a3 as f,T as y,E as h,aa as x}from"./vendor-mui-core-1jJmAutq.js";import"./vendor-react-DEoibe3W.js";import{y as g}from"./vendor-utils-C3FZIS9A.js";import{_ as w}from"./useAsync-BENTIUEf.js";import{u as C,aN as T,C as i,a_ as j,Y as k,am as v}from"./vendor-ux-did-connect-DEbq97Xz.js";import{u as P,s as S}from"./index-BjYech25.js";import"./vendor-hooks-DN4nZ7TU.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-V3HYELzG.js";function U({children:p}){const{t:n,locale:u}=C(),{api:c,session:o}=P(),{encryptKey:l,decrypt:m}=T(),s=w(async()=>{var t;const e=new URL(window.location.href);e.pathname=g(((t=window==null?void 0:window.env)==null?void 0:t.apiPrefix)??"/","/api/did/setup/token"),e.searchParams.set("_ek_",l);const{data:a}=await c.get(e.href);return a}),d=async e=>{const a=Array.isArray(e)?e.find(t=>t.sessionToken):e;S(m(a.sessionToken));try{await o.refresh()}catch(t){k.error(t.message)}};return!s.value||s.loading||o.loading?r.jsx(i,{relative:"parent",children:r.jsx(f,{})}):o.user?p:s.error?r.jsx(i,{relative:"parent",children:r.jsx(y,{children:s.error.message})}):r.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,action:"pre-setup",checkFn:c.get,checkTimeout:10*60*1e3,webWalletUrl:j(),onSuccess:d,locale:u,messages:{title:n("setup.connect.title"),scan:n("setup.connect.scan"),confirm:n("setup.connect.confirm"),success:n("setup.connect.success")},extraParams:{setup:!0,nw:s.value.url}})}U.propTypes={children:h.any.isRequired};const _=x(v)`
|
|
2
|
-
.action-info-desc {
|
|
3
|
-
padding: 0 72px;
|
|
4
|
-
}
|
|
5
|
-
`;export{U as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as o,a4 as i,E as h,aa as C}from"./vendor-mui-core-1jJmAutq.js";import{n as k,f as B,ad as w,d as x}from"./index-BjYech25.js";import{D as E,a as I,b}from"./domain-action-card-pHkmKFE3.js";import{a$ as T}from"./vendor-ux-did-connect-DEbq97Xz.js";import{P as A}from"./page-header-DWf5vODI.js";import{r}from"./vendor-react-DEoibe3W.js";import{_ as L}from"./useSetState-CWq0AVWn.js";import{S as D}from"./button-BSJ2z68-.js";import{S as W}from"./layout-D5ALyxXA.js";import{S as $}from"./step-actions-BNW8I1sI.js";import"./vendor-arcblock-V3HYELzG.js";import"./vendor-utils-C3FZIS9A.js";import"./vendor-hooks-DN4nZ7TU.js";import"./lottie-web-jYmAQWuC.js";import"./ExpandLess-1B6PdCYC.js";import"./permission-CmHMB8NK.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-DSYkC9r5.js";import"./useAsync-BENTIUEf.js";import"./confirm-B9OqaJpT.js";import"./format-error-BrmqJs5a.js";import"./actions-CAL1KFv7.js";import"./MoreHoriz-THEF6D0C.js";import"./delete-confirm-CM4f-ajO.js";import"./click-to-copy-C9iEVQIO.js";import"./shorten-label-DDBwv81M.js";import"./util-BmbbisPE.js";import"./InfoOutlined-CEHciuDy.js";import"./index-Du2DtxVt.js";import"./CheckCircle-D7Ntmb2o.js";import"./content-layout-Bs-vdQ_U.js";import"./use-mobile-DjnNmGRG.js";function d({onNext:s,onPrevious:S}){var u,f;const{t:n}=r.useContext(T),[j,p]=r.useState(!1),{blocklet:e}=k(),[l,y]=r.useState(""),P=(((e==null?void 0:e.site)||{}).domainAliases||[]).map(t=>B.replaceSlotToIp(t.value,l)),[a,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=(f=(u=e.environments)==null?void 0:u.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:f.value,v=P.find(t=>w.isDidDomain(t));return r.useEffect(()=>{x.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{y(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(_,{children:[o.jsx(i,{className:"header",children:o.jsx(A,{title:n("setup.domain.title"),subTitle:n("setup.domain.subTitle"),onClickBack:S})}),o.jsxs(i,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o.jsx(i,{display:"inline",children:`${n("setup.domain.buyOrConnect")} (${n("common.optional")})`})}),o.jsx(i,{mt:1,children:o.jsx(I,{blocklet:e,bugDidDomainProps:{appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:v,currentIp:l,inBlockletSetup:!0,shouldCheckDomain:!0,resolveDomain:t=>x.get(`/dns-resolve?hostname=${t}`),onInputDomain:t=>{m({domain:t.domain,type:t.type}),p(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const g={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};m(g),s()},onError:p}})})]}),o.jsxs(i,{children:[o.jsx(i,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o.jsx(i,{display:"inline",children:n("setup.domain.skipDescription")})}),o.jsx(i,{mt:1,children:o.jsx(b,{inSetup:!0,showAllDomains:!0})})]})]}),o.jsx($,{mt:8,disabled:!!a.addDomainState.text,blocklet:e,onStartNow:()=>s("complete"),children:a.domain?o.jsx(D,{variant:"contained",loading:!!a.addDomainState.text,disabled:j||!!a.addDomainState.text||!a.domain,onClick:()=>s(),children:a.addDomainState.text||n("setup.continue")}):o.jsx(D,{variant:"contained",disabled:!!a.addDomainState.text,onClick:()=>s(),children:n("setup.continue")})})]})}function Dt(s){return o.jsx(E,{children:o.jsx(d,{...s})})}d.propTypes={onNext:h.func,onPrevious:h.func};d.defaultProps={onNext:()=>{},onPrevious:()=>{}};const _=C(W)`
|
|
2
|
-
height: 100%;
|
|
3
|
-
overflow-y: hidden;
|
|
4
|
-
|
|
5
|
-
.form {
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
}
|
|
9
|
-
`;export{Dt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m}from"./vendor-react-DEoibe3W.js";import{u as a}from"./vendor-ux-did-connect-DEbq97Xz.js";import{C as p,z as n,I as l,f as c}from"./index-BjYech25.js";import{a as u,b as x}from"./domain-action-card-pHkmKFE3.js";import{j as t,a4 as f,ae as d,ad as h}from"./vendor-mui-core-1jJmAutq.js";import"./vendor-utils-C3FZIS9A.js";import"./vendor-hooks-DN4nZ7TU.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-V3HYELzG.js";import"./ExpandLess-1B6PdCYC.js";import"./permission-CmHMB8NK.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-DSYkC9r5.js";import"./useAsync-BENTIUEf.js";import"./confirm-B9OqaJpT.js";import"./format-error-BrmqJs5a.js";import"./actions-CAL1KFv7.js";import"./MoreHoriz-THEF6D0C.js";import"./delete-confirm-CM4f-ajO.js";import"./click-to-copy-C9iEVQIO.js";import"./shorten-label-DDBwv81M.js";import"./util-BmbbisPE.js";import"./useSetState-CWq0AVWn.js";import"./InfoOutlined-CEHciuDy.js";import"./index-Du2DtxVt.js";import"./CheckCircle-D7Ntmb2o.js";function j(){const{blocklet:o}=p(),{inService:i}=n(),{t:s}=a(),e=m.useMemo(()=>{let r=!0;return l(o)&&(r=r&&i),r},[i,o]);return t.jsxs(f,{component:d,sx:{maxWidth:820},gap:3,children:[t.jsxs(t.Fragment,{children:[c.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:s("blocklet.router.noRunning")}),e&&t.jsx(u,{blocklet:o})]}),t.jsx(x,{showAllDomains:!0})]})}j.propTypes={};export{j as default};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,E as d,a2 as Pe,a5 as vt,T as Y,a4 as w,A as ke,bn as _e,cd as et,bM as Re,br as Te,bN as Ie,x as je,b2 as De,a3 as tt,aa as oe,W as st,bf as Xe,bq as jt,bm as yt,ak as Je,bU as St}from"./vendor-mui-core-1jJmAutq.js";import{c as ne,av as le,A as Ct}from"./vendor-utils-C3FZIS9A.js";import{Y as G,p as k,b3 as Nt,r as Fe,f as wt,u as X,bL as Rt,X as nt,B as Ee,a5 as at,bh as xe,ak as Tt,aq as It,bJ as Dt}from"./vendor-ux-did-connect-DEbq97Xz.js";import{z as Et,t as $,l as At,G as Qe}from"./index-BjYech25.js";import{f as ee,a as Ae}from"./vendor-hooks-DN4nZ7TU.js";import{S as pe}from"./shorten-label-DDBwv81M.js";import{I as it}from"./index-Du2DtxVt.js";import{A as Lt,S as Ot,a as Pt,b as kt}from"./list-DuzdV0Wa.js";import{R as Be}from"./relative-time-CE47D6s7.js";import{b as ze}from"./dashboard-BYUKOMAe.js";import{W as _t}from"./did-address-B_VfxEC5.js";import{p as ot}from"./util-1n1Ulk5w.js";import{D as Ft,g as Bt}from"./traffic-ChJb5Oyl.js";import{i as zt,B as Wt}from"./index-Cp_gD4ZQ.js";import{B as rt}from"./bundle-avatar-vSofRY4G.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-V3HYELzG.js";import"./index-Cuoxr9xB.js";import"./InfoOutlined-CEHciuDy.js";import"./CheckCircle-D7Ntmb2o.js";import"./useLocalStorage-Cq9THoCr.js";import"./confirm-B9OqaJpT.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DpcMtsY5.js";import"./get-safe-url-D_Puq_oh.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-DSYkC9r5.js";import"./useAsync-BENTIUEf.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DjnNmGRG.js";import"./base32-CLGITfm-.js";import"./iframe-BhRKCdFb.js";import"./LaunchOutlined-CnOQGhu-.js";import"./ChevronLeft-BIgT65EY.js";import"./ChevronRight-foZmiP4J.js";import"./index-DkZfhapD.js";import"./vendor-mui-x-CPwlD3uT.js";const lt=j.createContext({}),{Provider:Mt,Consumer:an}=lt;function qt({children:t,blocklet:s=""}){const{api:n,inService:o}=Et(),[i,r]=j.useState([]),[x,u]=j.useState({total:0,pageSize:20,pageCount:0,page:1}),b=ee(()=>{var D;return(D=s.meta)==null?void 0:D.did},[s]),[S,C]=j.useState([]),N=async({page:D=1,pageSize:O=20,...m}={})=>{if(!b)return[];try{const g={paging:{page:D,pageSize:O},...m,teamDid:b,dateRange:m.dateRange?[$(m.dateRange[0]).toISOString(),$(m.dateRange[1]).toISOString()]:void 0},{dids:L,...Q}=g;let K="";L.includes("system")&&(K="system");const J=L.filter(Z=>Z!=="system"),F=await n.getNotificationSendLog({input:{...Q,source:K,componentDids:J}});return r(F.list),u(F.paging),F.list}catch(g){return G.error(g.message),[]}},E=async()=>{const D=await n.getNotificationComponents({input:{teamDid:b}});C(D.componentDids)},z=j.useCallback(D=>{const O=s.children.find(m=>{var g;return((g=m.meta)==null?void 0:g.did)===D});if(O)return O.ancestors=[s],O},[s]),A=async({notificationId:D,receivers:O,channels:m,...g})=>{await n.resendNotification({input:{teamDid:b,notificationId:D,receivers:O,channels:m.map(L=>L==="wallet"?k.NOTIFICATION_SEND_CHANNEL.WALLET:L==="pushKit"?k.NOTIFICATION_SEND_CHANNEL.PUSH:L),...g}})},P=j.useCallback(async D=>(await n.getUser({input:{teamDid:b,user:{did:D}}})).user,[n,b]),I=j.useCallback(async({page:D=1,pageSize:O=20,...m}={})=>{try{const g={paging:{page:D,pageSize:O},...m,userName:m.searchText||"",teamDid:b,dateRange:m.dateRange?[$(m.dateRange[0]).toISOString(),$(m.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:g})}catch(g){throw G.error(g.message),g}},[n,b]);j.useEffect(()=>{b&&E()},[b]);const W={fetch:N,data:i,paging:x,blocklet:s,getComponent:z,resendNotification:A,getUser:P,componentDids:S,getReceivers:I,inService:o,teamDid:b};return e.jsx(Mt,{value:{notificationRecords:W},children:t})}function We(){const{notificationRecords:t}=j.useContext(lt);return t}fe.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Kt={info:"primary",success:"success",error:"error",warning:"warning"};function fe({severity:t="info"}){return e.jsx(Nt,{type:Kt[t],children:t})}var Me={},Ht=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ht(Fe()),Ut=e;ct=Me.default=(0,$t.default)((0,Ut.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Vt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Gt=Vt(Fe()),Yt=e;dt=qe.default=(0,Gt.default)((0,Yt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Xt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Jt=Xt(Fe()),Qt=e;ut=Ke.default=(0,Jt.default)((0,Qt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Zt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case k.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case k.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:o,updatedAt:i,reason:r="",channel:x="wallet"}=n,u=i?t("notification.sendStatus.sentTime",{date:At(i,s)}):"",b=Zt(t,x,r);return o===k.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:b}:o===k.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:b,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Oe=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},mt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},es=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ts=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ss=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),ns=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),he=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),as=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ge=(t=[])=>{const s=$().startOf("day");return t.filter(n=>$(n.sendAt).isSame(s,"day")).length},is=(t,s="")=>{if(s&&Oe.includes(s)){const r=`${s}SendRecord`,x=ne(t,r,[]);return ge(x)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const r=n[s]??[];return ge(r)}const i={};return Oe.forEach(r=>{const x=`${r}SendRecord`,u=ne(t,x,[]),b=ge(u);i[r]=b}),o.length>0&&o.forEach(r=>{const x=n[r]??[],u=ge(x);i[r]=u}),i},be=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},os=t=>{switch(t){case k.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case k.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case k.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case k.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:i,title:r="",sentTime:x="",reason:u=""}=t,b=[r,u].filter(Boolean).join(", ");return e.jsx(vt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:b}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(w,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(w,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(w,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[i],style:{opacity:.15}}),e.jsx(w,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[i]})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?r:o})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};te.defaultProps={enableTooltip:!0,showTitle:!1,children:null};ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};ce.defaultProps={onDelete:()=>{}};function ce({list:t,label:s,onDelete:n}){const{t:o,locale:i}=X();return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Y,{children:[s,": "]}),t.map(r=>{const x=pt(o,i,{status:r});return e.jsx(ke,{size:"small",label:e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,r)},r)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:o,filterValues:i,label:r,renderLabel:x}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:r}),e.jsx(Re,{row:!0,children:i.map(u=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:b=>{const S=[...t];b.target.checked?S[n]=[...S[n],u.value??u]:S[n]=S[n].filter(C=>C!==(u.value??u)),s(S[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}re.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function re({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:i}){const{t:r,locale:x}=X(),u=pt(r,x,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(te,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(je,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:r("notification.resend")})]})}$e.propTypes={value:d.array.isRequired,onChange:d.func};function $e({value:t,onChange:s}){const{locale:n}=X(),o=$().toDate(),[i,r]=j.useState(null),x=j.useCallback(S=>{r(i?null:S.currentTarget)},[i]),u=!!i,b=j.useCallback(S=>{if(!S.startDate||!S.endDate){G.error("Please select a date range");return}if($(S.startDate).isAfter(S.endDate)||!$(S.startDate).isValid()||!$(S.endDate).isValid()){G.error("Invalid date range");return}s([S.startDate,S.endDate]),r(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(je,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(De,{open:u,anchorEl:i,onClose:()=>{r(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ft,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(o),onChange:b})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var i;const{t:n}=X();return!((i=s==null?void 0:s.filterList)!=null&&i.filter(r=>r.length).length)?null:e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Rt.TableFilterList,{...s,ItemComponent:t})})]})}function ye({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const i=s&&typeof s=="function"?s:void 0;let r=!0;return n&&typeof n=="function"&&(r=n({label:t,...o})),e.jsx(ke,{label:t,variant:"outlined",...i&&r?{onDelete:i}:{}})}ye.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};ye.defaultProps={canDelete:()=>!0};const rs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[i,r]=j.useState(rs),[x,u]=j.useState(!0),b=(C,N)=>{N.checked=C.target.checked;const E=i.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));r(E)},S=C=>{C.stopPropagation(),n({channels:i.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:x})};return e.jsxs(w,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(w,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(C=>e.jsx(Te,{control:e.jsx(Ie,{checked:C.checked,onChange:N=>b(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(w,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:x,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(w,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(je,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(je,{onClick:S,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:i}=X(),{getReceivers:r,inService:x,teamDid:u,getUser:b,blocklet:S}=We(),[C,N]=j.useState(!1),[E,z]=j.useState([]),A=Ae({anchorEl:null,position:null}),P=Ae({anchorEl:null,position:null}),[I,W]=j.useState(null),[D,O]=j.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,g]=j.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[L,Q]=j.useState([]),K=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],J=async()=>{if(!C&&t)try{N(!0);const a=await r({notificationId:t,...m}),l=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));z(l),O(a.paging),N(!1)}catch(a){G.error(a.message),N(!1)}};j.useEffect(()=>{J()},[m]);const F=a=>{a.stopPropagation();const l=a.currentTarget;P.anchorEl=l;const c=l.getBoundingClientRect();P.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},Z=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ee,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:o("notification.resend")})}):null,M={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:L,onRowSelectionChange:(a,l)=>{Q(l.map(c=>c.dataIndex))},customToolbarSelect:Z},Ce=({page:a,rowsPerPage:l,searchText:c,filterList:y})=>{const[,_=[],H=[],q=[]]=y;m.pageSize!==l?g(B=>({...B,pageSize:l,page:1})):m.page!==a+1?g(B=>({...B,page:a+1})):m.searchText!==c?g(B=>({...B,searchText:c,page:1})):le(_,m.walletSendStatus)?le(H,m.pushKitSendStatus)?le(q,m.emailSendStatus)||g(B=>({...B,emailSendStatus:q,page:1})):g(B=>({...B,pushKitSendStatus:H,page:1})):g(B=>({...B,walletSendStatus:_,page:1}))},Ne=j.useCallback(async(a,l)=>{if(!l)return!1;const c=await b(l);return c?a==="wallet"?ss(c):a==="email"?es(S,c):a==="pushKit"?ts(S,c):a==="webhook"?ns(c):!0:!1},[b,S]),me=j.useCallback(a=>as(o,a),[o]),f=()=>{A.anchorEl=null,A.position=null,W(null)},p=()=>{P.anchorEl=null,P.position=null},h=async(a,l,c=!0,y="")=>{if(!(!l.length||!a.length))try{s(a,l,c,y),P.anchorEl||(await he(.5),f())}catch(_){console.error("handleResend error",{error:_})}},v=async({channels:a,isResendFailedOnly:l})=>{const c=L.map(y=>E[y].receiver);await h(a,c,l),await he(.5),p(),Q([])},T=async(a,l=[],c=!0)=>{try{await h(["webhook"],[a.receiver],c,l)}catch(y){G.error(y.response?y.response.statusText:y.message)}},R=async(a,l,c,y=[],_=!0)=>{if(a.stopPropagation(),is(l,c)>=4){G.warning(o("notification.resendLimit"));return}if(!Oe.includes(c)){await T(l,y,_);return}if(a){const q=a.currentTarget,B=q.getBoundingClientRect();A.anchorEl=q,A.position={top:B.top+window.scrollY,left:B.left+window.scrollX}}W({channel:c});try{const q=await Ne(c,l.receiver);await he(1),W({channel:c,result:q}),(typeof q=="boolean"&&q||Ct(q)&&Object.values(q).every(B=>!!B))&&(await s([c],[l.receiver],_),P.anchorEl||(await he(.5),f()))}catch(q){G.error(q.message)}},U=a=>{g(l=>({...l,dateRange:a,page:1}))},V=(a,l,c,y)=>{a.stopPropagation();const _=c.filter(H=>H!==l);g(H=>({...H,[y]:_,page:1}))},se=ee(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:l,receiver:c}=E[a];return l?e.jsxs(w,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(pe,{children:l.fullName})]},c):e.jsx(_t,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[1].options.filterList,"walletSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:l,index:c,column:y,filterValues:K})},customBodyRenderLite:a=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"wallet",onResend:_=>R(_,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"pushkit",onResend:_=>R(_,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[2].options.filterList,"pushKitSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:l,index:c,column:y,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(re,{status:l,updatedAt:c,reason:y,channel:"email",onResend:_=>R(_,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(ce,{list:a,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),V(l,c,se[3].options.filterList,"emailSendStatus")}}),update:be},filterOptions:{names:K,fullWidth:!0,logic:ve,display:(a,l,c,y)=>e.jsx(we,{label:"Email",filterList:a,onChange:l,index:c,column:y,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:l}=E[a];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[y,_]=c,H=_[0];return e.jsx(w,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(w,{className:"webhook-item",fontSize:12,children:[e.jsx(pe,{maxLength:30,children:y},y),e.jsx(re,{status:H.status,updatedAt:H.sendAt,reason:H.failedReason,channel:"webhook",onResend:q=>R(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:l}=E[a];return e.jsx(Be,{value:l,locale:i,shouldUpdate:!0})}}}],[E,i,m,o]),Ye=[e.jsx($e,{value:m.dateRange,onChange:U},"date-picker"),e.jsx(Ee,{variant:"contained",size:"small",color:"primary",loading:C,startIcon:e.jsx(ut,{}),onClick:()=>J(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(w,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(cs,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:i,loading:C,columns:se,data:E,onChange:Ce,options:M,customButtons:Ye,components:{TableFilterList:a=>e.jsx(Ue,{...a,itemComponent:l=>e.jsx(ye,{...l,canDelete:()=>!1})})}}),A.anchorEl&&e.jsx(De,{open:!!A.anchorEl,anchorReference:"anchorPosition",anchorPosition:A.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ds,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(w,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:me(I==null?void 0:I.channel).map(a=>{var _,H;const{type:l,pass:c,fail:y}=a;return!(I!=null&&I.result)||(_=I==null?void 0:I.result)!=null&&_[l]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(H=I==null?void 0:I.result)!=null&&H[l]?xe.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:xe.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Y,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:xe.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:y})]},l)})})]})}),P.anchorEl&&e.jsx(De,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:v})})]})})})}const ls=j.memo(gt),cs=oe.div`
|
|
2
|
-
td.MuiTableCell-footer {
|
|
3
|
-
border: none !important;
|
|
4
|
-
}
|
|
5
|
-
.sent-status-cell {
|
|
6
|
-
.resend-btn {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
&:hover {
|
|
10
|
-
.resend-btn {
|
|
11
|
-
display: flex;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`,ds=oe.div`
|
|
16
|
-
padding: 8px 16px;
|
|
17
|
-
.check-title {
|
|
18
|
-
font-weight: 500;
|
|
19
|
-
margin-bottom: 8px;
|
|
20
|
-
&::first-letter {
|
|
21
|
-
text-transform: uppercase;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.check-item {
|
|
25
|
-
svg {
|
|
26
|
-
font-size: 16px;
|
|
27
|
-
}
|
|
28
|
-
font-size: 12px;
|
|
29
|
-
}
|
|
30
|
-
`,de=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function us(t){const{wallet:s,push:n,email:o,webhook:i}=t;return[{name:"Wallet",value:e.jsx(ae,{item:s})},{name:"Push",value:e.jsx(ae,{item:n})},{name:"Email",value:e.jsx(ae,{item:o})},...i.total>0?[{name:"Webhook",value:e.jsx(ae,{item:i,isWebhook:!0})}]:[]]}function ps(t,s,n){const{wallet:o,push:i,email:r,webhook:x}=t;return[{name:"Wallet",value:e.jsx(ie,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.WALLET,item:o,onResend:s})},{name:"Push",value:e.jsx(ie,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ie,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.EMAIL,item:r,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(ie,{loading:n,channel:k.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Se.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Se.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ae.propTypes={item:d.object.isRequired,isWebhook:d.bool};ae.defaultProps={isWebhook:!1};function ae({item:t,isWebhook:s=!1}){const{t:n}=X(),o=s?t.success.length:t.success,i=t.total,r=o===i?"success":"failed";return e.jsx(w,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(w,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(te,{config:{status:r},enableTooltip:!1,children:[de(o)," / ",de(i)," ",n("notification.sendStatus.success")]})})})}ie.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};ie.defaultProps={isWebhook:!1,channel:k.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function ie({channel:t,item:s,isWebhook:n=!1,onResend:o,loading:i}){const{t:r}=X(),{success:x,failed:u,pending:b}=s,S=os(t),C=n?x.length:x,N=n?u.length:u,E=n?b.length:b,z=async W=>{W.stopPropagation();const D=n?[...new Set([...x,...u].map(O=>O))]:[];await o([t],[],!0,D)},A=C+N,P=A>0?C/A*100:0,I=A>0?N/A*100:0;return e.jsxs(fs,{successRatio:P,failedRatio:I,children:[e.jsxs(Y,{variant:"h6",children:[S," (",s.total,")"]}),e.jsxs(Y,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Le.success,fontWeight:600,fontSize:24},children:de(C)}),e.jsx("small",{style:{paddingLeft:4},children:r("notification.sendStatus.success")})]}),e.jsxs(w,{className:"unsent-area",children:[e.jsxs(w,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[de(N)," ",r("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[de(E)," ",r("notification.sendStatus.pending")]})]}),N>0&&e.jsx(w,{className:"resend-btn",children:e.jsx(Ee,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:z,children:r("notification.resend")})})]})]})}function Se({statistics:t,mode:s="simple",onResend:n,resending:o}){const i=ee(()=>s==="simple"?us(t):ps(t,n,o),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(r=>e.jsx(it,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:r.name,children:r.value},r.name))}):e.jsx(Xe,{container:!0,spacing:2,children:i.map(r=>e.jsx(Xe,{item:!0,md:4,sm:6,xs:12,children:r.value},r.name))})}const fs=oe(w)`
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
align-items: flex-start;
|
|
34
|
-
padding: 16px;
|
|
35
|
-
border-radius: 8px;
|
|
36
|
-
background: ${({successRatio:t,failedRatio:s})=>t===0&&s===0?"#eff3fa":`linear-gradient(to right, #dafee7 ${t}%, #fef2f2 ${t}%)`};
|
|
37
|
-
transition: 'background 0.5s ease',
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
.unsent-area {
|
|
40
|
-
width: 100%;
|
|
41
|
-
position: relative;
|
|
42
|
-
.resend-btn {
|
|
43
|
-
position: absolute;
|
|
44
|
-
right: 0;
|
|
45
|
-
bottom: 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`;xt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function xt({notification:t,onCancel:s=()=>{},blocklet:n,tab:o="info"}){const{t:i,locale:r}=X(),{getComponent:x,resendNotification:u}=We(),[b,S]=j.useState(!1),C=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),N=Ae({tab:o||"info"}),E=j.useCallback(async(g,L,Q=!0,K=[])=>{var Z;if(!g.length||!t.id)return;const J=L.length>0?L:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(M=>M.receiver);if(!J.length)return;let F=[...g];if(F.includes(k.NOTIFICATION_SEND_CHANNEL.PUSH)&&!mt(n)&&(G.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),F=F.filter(M=>M!==k.NOTIFICATION_SEND_CHANNEL.PUSH)),F.includes(k.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ft(n)&&(G.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),F=F.filter(M=>M!==k.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!F.length)try{S(!0),await u({notificationId:t.id,receivers:J,channels:F,resendFailedOnly:Q,...F.includes("webhook")&&K.length?{webhookUrls:K}:{}}),G.success("Message has been sent!")}catch(M){console.error("handleResend error",{error:M}),G.error(M.response?M.response.statusText:M.message)}finally{S(!1)}},[n,t.id,t==null?void 0:t.receivers,u,i]),z=ee(()=>zt(t),[t]),A=ee(()=>z?t==null?void 0:t.actorInfo:[],[t]),P=ee(()=>{var g;return(n==null?void 0:n.did)||((g=n==null?void 0:n.meta)==null?void 0:g.did)||""},[n]);function I(){return[{name:i("notification.from"),value:z?e.jsx(Lt,{actors:A,teamDid:P,size:32,showName:!0}):e.jsx(Ot,{size:32,blocklet:C,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(pe,{maxLength:50,children:t.title})},{name:i("notification.body"),value:z?e.jsx(Pt,{notification:t,blocklet:n}):e.jsx(kt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(fe,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(Be,{value:t.createdAt,locale:r,shouldUpdate:!0})}].map(L=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:L.name,children:L.value},L.name))}const W={info:{label:i("common.basicInfo"),value:"info",component:I},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},D=Object.values(W).map(({label:g,value:L})=>({label:g,value:L})),O=W[N.tab]||W.info,m=g=>{N.tab=g};return e.jsx(Tt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{N.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(hs,{children:[e.jsx(w,{mx:3,className:"tabs",children:e.jsx(It,{tabs:D,current:N.tab,onChange:m,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[N.tab==="receivers"&&e.jsx(ls,{notificationId:t.id,resending:b,handleResend:E}),N.tab==="statistics"&&e.jsx(Se,{statistics:t.statistics,mode:"detail",resending:b,onResend:E}),N.tab==="info"&&e.jsx(O.component,{})]})]})})}const ms=j.memo(xt),hs=oe.div`
|
|
49
|
-
& > .notification-row {
|
|
50
|
-
padding: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.tabs {
|
|
54
|
-
margin: 0;
|
|
55
|
-
}
|
|
56
|
-
.body {
|
|
57
|
-
margin-top: 16px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.channel-item {
|
|
61
|
-
display: flex;
|
|
62
|
-
padding: 4px;
|
|
63
|
-
justify-content: flex-start;
|
|
64
|
-
align-items: center;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
> p {
|
|
67
|
-
font-size: 15px;
|
|
68
|
-
}
|
|
69
|
-
.resend-btn {
|
|
70
|
-
svg {
|
|
71
|
-
font-size: 16px;
|
|
72
|
-
}
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
font-size: 12px;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
&.disabled {
|
|
78
|
-
cursor: not-allowed;
|
|
79
|
-
color: ${xe.text.disabled};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`;ue.propTypes={blocklet:d.object,label:d.string};ue.defaultProps={blocklet:null,label:""};const gs=oe.div`
|
|
84
|
-
display: flex;
|
|
85
|
-
justify-items: flex-start;
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: 8px;
|
|
88
|
-
.name {
|
|
89
|
-
display: block;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
white-space: nowrap;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
text-overflow: ellipsis;
|
|
94
|
-
}
|
|
95
|
-
`;function ue({blocklet:t,label:s}){var n;return e.jsx(gs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ge.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ge.defaultProps={onDelete:()=>{}};function Ge({list:t,label:s,onDelete:n}){return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Y,{children:[s,": "]}),t.map(o=>e.jsx(ke,{size:"small",label:e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(fe,{severity:o})}),onDelete:i=>n(i,o)},o))]})}function xs(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(fe,{severity:s})})}function bs({customTableButtons:t}){var me;const{t:s,locale:n}=X(),[o,i]=j.useState(!1),{data:r,paging:x,blocklet:u,fetch:b,getComponent:S,componentDids:C,inService:N,teamDid:E}=We(),z=j.useRef(null),[A,P]=j.useState(null),[I,W]=j.useState("info"),D=`notification-records-${(me=u.meta)==null?void 0:me.did}`,O=Dt(D),[m,g]=j.useState({pageSize:O.rowsPerPage||10,page:O.page?O.page+1:1,dids:O.dids||[],dateRange:O.dateRange||[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),L=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var v;const h=p.did||((v=p.meta)==null?void 0:v.did);C.includes(h)&&(p.ancestors=[u],f.push(p))}),f},[C,u]),Q=j.useCallback(async()=>{try{i(!0),await b(m),i(!1)}finally{i(!1)}},[b,m]);j.useEffect(()=>{Q()},[]),j.useEffect(()=>{const f=setInterval(()=>{document.visibilityState==="visible"&&b(m).then(p=>{const h=p.find(v=>v.id===(A==null?void 0:A.id));A&&h&&P({...h})})},3e3);return()=>clearInterval(f)},[m,A]);const K=(f,p,h,v)=>{f.stopPropagation();const T=h.filter(R=>R!==p);g(R=>({...R,[v]:T,page:1}))},J=({page:f,rowsPerPage:p,filterList:h})=>{const[v=[],,,,T=[]]=h;m.pageSize!==p?g(R=>({...R,pageSize:p,page:1})):m.page!==f+1?g(R=>({...R,page:f+1})):le(m.dids,v)?le(m.severities,T)||g(R=>({...R,severities:T,page:1})):g(R=>({...R,dids:v,page:1}))},F=j.useCallback(()=>{P(null),W("info")},[]),Z=j.useCallback(()=>{b(m)},[b,m]),M=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,h)=>{var T;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${h}`);const v=L.find(R=>{var V;return(R.did||((V=R.meta)==null?void 0:V.did))===p});return e.jsx(ue,{blocklet:v,label:(v==null?void 0:v.title)||((T=v==null?void 0:v.meta)==null?void 0:T.title)},p)}),update:(f,p,h)=>(f[h].splice(p,1),f)},filterOptions:{names:L,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,h,v)=>e.jsxs(_e,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(yt,{multiple:!0,value:f[h],renderValue:T=>e.jsx(w,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(R=>{var V;if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const U=L.find(se=>{var a;return(se.did||((a=se.meta)==null?void 0:a.did))===R});return e.jsx(ue,{blocklet:U,label:(U==null?void 0:U.title)||((V=U==null?void 0:U.meta)==null?void 0:V.title)},R)})}),onChange:T=>{f[h]=T.target.value,p(f[h],h,v)},children:[e.jsx(Je,{value:"system",children:s("notification.system")}),L.map(T=>{var U,V;const R=T.did||((U=T.meta)==null?void 0:U.did);return e.jsx(Je,{value:R,children:e.jsx(ue,{blocklet:T,label:T.title||((V=T.meta)==null?void 0:V.title)})},R)})]})]})},customBodyRenderLite:f=>{var v,T;const p=r[f],h=S(p.componentDid);return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[h?e.jsx(rt,{size:32,blocklet:h,ancestors:h.ancestors??[]}):e.jsx(Wt,{blocklet:u,size:32}),e.jsx(pe,{maxLength:50,children:((v=h==null?void 0:h.meta)==null?void 0:v.title)||((T=u==null?void 0:u.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const p=r[f],{receivers:h}=p;return e.jsx(St,{total:h.length,renderSurplus:v=>v<100?e.jsxs("span",{children:["+",v]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:v=>{v.stopPropagation(),P(p),W("receivers")},children:h.map(v=>{const{receiverUser:T}=v,R=ot(T.avatar,E,N);return e.jsx(nt,{alt:T.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:v.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},v.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=r[f];return e.jsx(w,{onClick:h=>{h.stopPropagation(),P(p),W("statistics")},children:e.jsx(Se,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=r[f];return e.jsx(pe,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=r[f];return e.jsx(fe,{severity:p.severity})},filter:!0,filterType:"custom",filterList:m.severities??[],customFilterListOptions:{render:f=>e.jsx(Ge,{list:f,label:s("notification.severity"),onDelete:(p,h)=>{p.stopPropagation(),K(p,h,M[4].options.filterList,"severities")}}),update:be},filterOptions:{names:Ze,fullWidth:!0,logic:ve,display:(f,p,h,v)=>e.jsx(xs,{label:s("notification.severity"),filterList:f,onChange:p,index:h,column:v,filterValues:Ze})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=r[f];return e.jsx(Be,{value:p,locale:n,shouldUpdate:!0})}}}],Ce=f=>{g(p=>({...p,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(w,{ref:z,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(vs,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:o,locale:n,columns:M,data:r,durable:D,onChange:J,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...O,onRowClick:(f,{dataIndex:p})=>{P(r[p])}},customPreButtons:[e.jsx($e,{value:m.dateRange,onChange:Ce})],customButtons:Ne,components:{TableFilterList:f=>e.jsx(Ue,{...f,itemComponent:p=>e.jsx(ye,{...p,canDelete:h=>{var T;const v=(T=h==null?void 0:h.columnNames)==null?void 0:T[(h==null?void 0:h.index)||0];return(v==null?void 0:v.name)==="sender"}})})}})})}),A&&e.jsx(ms,{refresh:Z,onCancel:F,notification:A,blocklet:u,tab:I})]})}const vs=oe.div`
|
|
96
|
-
td.MuiTableCell-footer {
|
|
97
|
-
border: none !important;
|
|
98
|
-
}
|
|
99
|
-
.sent-status-cell {
|
|
100
|
-
.resend-btn {
|
|
101
|
-
display: none;
|
|
102
|
-
}
|
|
103
|
-
&:hover {
|
|
104
|
-
.resend-btn {
|
|
105
|
-
display: flex;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.custom-toobar-btns {
|
|
111
|
-
gap: 4px;
|
|
112
|
-
}
|
|
113
|
-
`;bt.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};bt.defaultProps={customTableButtons:[]};function bt({blocklet:t={},customTableButtons:s}){return e.jsx(qt,{blocklet:t,children:e.jsx(bs,{customTableButtons:s})})}export{bt as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{g as w}from"./vendor-react-DEoibe3W.js";import{ab as b}from"./index-BjYech25.js";var x=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;const r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))};const m=b,E=/\s+at.*(?:\(|\s)(.*)\)?/,$=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,j=typeof m.homedir>"u"?"":m.homedir();var v=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
|
|
2
|
-
`).filter(e=>{const r=e.match(E);if(r===null||!r[1])return!0;const a=r[1];return a.includes(".app/Contents/Resources/electron.asar")||a.includes(".app/Contents/Resources/default_app.asar")?!1:!$.test(a)}).filter(e=>e.trim()!=="").map(e=>t.pretty?e.replace(E,(r,a)=>r.replace(a,a.replace(j,"~"))):e).join(`
|
|
3
|
-
`));const A=x,S=v,I=n=>n.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let k=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let e=t.map(r=>typeof r.stack=="string"?I(S(r.stack)):String(r)).join(`
|
|
4
|
-
`);e=`
|
|
5
|
-
`+A(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var T=k;const R=T;var C=async(n,t,{concurrency:e=1/0,stopOnError:r=!0}={})=>new Promise((a,f)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===1/0)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);const c=[],l=[],h=n[Symbol.iterator]();let g=!1,u=!1,i=0,d=0;const p=()=>{if(g)return;const o=h.next(),y=d;if(d++,o.done){u=!0,i===0&&(!r&&l.length!==0?f(new R(l)):a(c));return}i++,(async()=>{try{const s=await o.value;c[y]=await t(s,y),i--,p()}catch(s){r?(g=!0,f(s)):(l.push(s),i--,p())}})()};for(let o=0;o<e&&(p(),!u);o++);});const M=C;var _=(n,t)=>M(n,e=>e(),t);const O=w(_);export{O as p};
|