@abtnode/blocklet-services 1.17.3-beta-20251117-130331-b2ce7065 → 1.17.3-beta-20251118-061144-335cd35d
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/middlewares/verify-sig.js +14 -4
- package/api/services/auth/session.js +1 -1
- package/dist/assets/{AdapterDayjs-CSsn7VEX.js → AdapterDayjs-C8RSaHa0.js} +1 -1
- package/dist/assets/{Google-C-Ei9n0a.js → Google-BT1deiYa.js} +1 -1
- package/dist/assets/{access-control-D0vxk-Ay.js → access-control-Ddnn1J4F.js} +1 -1
- package/dist/assets/{actions-C0hEY5iN.js → actions-DqoNrBDK.js} +1 -1
- package/dist/assets/{add-component-core-7Qng0h9D.js → add-component-core-CZQBpP2b.js} +15 -15
- package/dist/assets/{add-resource-CS6pw4MD.js → add-resource-DUXwdNKB.js} +1 -1
- package/dist/assets/{addon-B5iZc5zB.js → addon-BgN564dt.js} +2 -2
- package/dist/assets/{advanced-QXzUapJI.js → advanced-D9d385yZ.js} +2 -2
- package/dist/assets/{aigne-CviOmneT.js → aigne-BK9oL3LS.js} +1 -1
- package/dist/assets/api-Btn0Tp3W.js +1 -0
- package/dist/assets/{appearance-CkaT_h9I.js → appearance-BLjBQMnd.js} +1 -1
- package/dist/assets/{arrow-down.svg-CDi8ywws.js → arrow-down.svg-Uxqj9Lez.js} +1 -1
- package/dist/assets/{audit-logs-D2VdqDH8.js → audit-logs-B9JmO_5U.js} +2 -2
- package/dist/assets/{authorize-BJr_whxb.js → authorize-BseET0LV.js} +1 -1
- package/dist/assets/{base-chart-BIsPFns6.js → base-chart-C-Raz4Q-.js} +1 -1
- package/dist/assets/{base32-cypJRki8.js → base32-DB18VP05.js} +1 -1
- package/dist/assets/bind-account-DWu2ZbPT.js +1 -0
- package/dist/assets/{branding-wKKLyZjs.js → branding-CPYtF-6a.js} +5 -5
- package/dist/assets/{branding-B7OUNmDC.js → branding-CmMCHUpY.js} +1 -1
- package/dist/assets/branding-DO47QT9Q.js +1 -0
- package/dist/assets/{bundle-avatar-Bft1K1fA.js → bundle-avatar-B9iCn_eS.js} +1 -1
- package/dist/assets/button-Bm6Z4hYZ.js +1 -0
- package/dist/assets/{click-to-copy-Kd1YilQn.js → click-to-copy-CzGMi2Jw.js} +1 -1
- package/dist/assets/{cloneDeep-3LGZOUYL.js → cloneDeep-C6qewg0C.js} +1 -1
- package/dist/assets/{collapse-Cc8IqFzl.js → collapse-BMy0GGFk.js} +1 -1
- package/dist/assets/{complete-FhkNOVEb.js → complete-DFxZ9mZl.js} +1 -1
- package/dist/assets/{component-YEpcN0PM.js → component-CmpGxsIf.js} +2 -2
- package/dist/assets/{config-ABsyghax.js → config-BMeucuGh.js} +1 -1
- package/dist/assets/{config-CfZ5vdbi.js → config-Bg2nv4Ct.js} +5 -5
- package/dist/assets/{config-BH7esTqa.js → config-Dj032f65.js} +1 -1
- package/dist/assets/{config-navigation-C2Cya4Ts.js → config-navigation-Wws6cRZg.js} +2 -2
- package/dist/assets/{config-space-k6_NPjjD.js → config-space-DVbXpK0p.js} +1 -1
- package/dist/assets/{confirm-BWGQvLZx.js → confirm-D_oS4C5N.js} +1 -1
- package/dist/assets/{connect-DohcTFiY.js → connect-BeM9KScn.js} +1 -1
- package/dist/assets/{connect-B1DJAH4e.js → connect-td4SUK2j.js} +1 -1
- package/dist/assets/connect-to-CK_BBgim.js +1 -0
- package/dist/assets/{content-layout-DJL10aJT.js → content-layout-oyz1EqNZ.js} +1 -1
- package/dist/assets/{create-passport-svg-aTWV-cva.js → create-passport-svg-B2TKOs7K.js} +1 -1
- package/dist/assets/createClass-BWB0NSWO.js +1 -0
- package/dist/assets/{dashboard-CuicHcGI.js → dashboard-B59Yx2EA.js} +2 -2
- package/dist/assets/{delete-confirm-DgdA8XR6.js → delete-confirm-DwFvaC6s.js} +1 -1
- package/dist/assets/{did-address-B_YPBiI4.js → did-address-C5FXzeAS.js} +1 -1
- package/dist/assets/domain-Dwzb8N6w.js +9 -0
- package/dist/assets/domain-action-card-CXIxAIsm.js +28 -0
- package/dist/assets/domains-0qUGORQe.js +1 -0
- package/dist/assets/{email-Bn3hPH00.js → email-CDYDF-7u.js} +1 -1
- package/dist/assets/{empty-spinner-Dqkt-AHg.js → empty-spinner-DYOzicuy.js} +1 -1
- package/dist/assets/engine-DXhw4g-J.js +1 -0
- package/dist/assets/{exchange-passport-3kSU2YMT.js → exchange-passport-CoU5Q4QA.js} +1 -1
- package/dist/assets/{form-MjxZB__D.js → form-I14bCwkb.js} +1 -1
- package/dist/assets/{form-text-input-BhAqaNAJ.js → form-text-input-B2T0zM2q.js} +1 -1
- package/dist/assets/{form-wrapper-SZH1FnTd.js → form-wrapper-C8oo_Fdy.js} +1 -1
- package/dist/assets/{fuel-C5ze4Cx7.js → fuel-DlHj4E28.js} +2 -2
- package/dist/assets/{gen-access-key-DKzPF3CU.js → gen-access-key-C54GFXyN.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DTWz63Us.js → gen-simple-access-key-Cgw0gqQM.js} +1 -1
- package/dist/assets/get-safe-url-mKD2PdwN.js +1 -0
- package/dist/assets/{home-Bqn3mvqQ.js → home-D6Wx3vEh.js} +1 -1
- package/dist/assets/{iframe-CxCgprun.js → iframe-fHGifsex.js} +1 -1
- package/dist/assets/{index-BTBrooUu.js → index-B5fUUj0x.js} +1 -1
- package/dist/assets/{index-B_NniBaO.js → index-BJAIYdQp.js} +1 -1
- package/dist/assets/{index-BPKZON9n.js → index-BUTKGY5W.js} +7 -7
- package/dist/assets/{index-CdA2hOvz.js → index-Bdyv52fm.js} +1 -1
- package/dist/assets/{index-Clfe99AI.js → index-Bnv7SivR.js} +1 -1
- package/dist/assets/index-C1cWdBpP.js +120 -0
- package/dist/assets/{index-Dgk0_7wf.js → index-C5hO5d4a.js} +5 -5
- package/dist/assets/{index-C_odLDQq.js → index-CPlFvcnd.js} +13 -13
- package/dist/assets/index-CWemdG9k.js +7 -0
- package/dist/assets/{index-BwSFbkVa.js → index-ChNXm8zt.js} +1 -1
- package/dist/assets/{index-Bero09ZY.js → index-Cq3xfsOS.js} +126 -128
- package/dist/assets/{index-PwQ2doS3.js → index-CsRxFZuh.js} +1 -1
- package/dist/assets/{index-CPJ0NzQN.js → index-Ctf-FbXC.js} +8 -8
- package/dist/assets/{index-D9bRGwyn.js → index-D1c_Zlts.js} +1 -1
- package/dist/assets/{index-CAMegfIe.js → index-D5TNmV3K.js} +1 -1
- package/dist/assets/{index-DlPcYWy3.js → index-DTj7lG0j.js} +1 -1
- package/dist/assets/index-DVBwQI1h.js +6 -0
- package/dist/assets/{index-CNndXmIt.js → index-DVZm1sCw.js} +1 -1
- package/dist/assets/index-DW-pVTUA.js +1 -0
- package/dist/assets/{index-OAcqMuQz.js → index-Dd1dREUL.js} +2 -2
- package/dist/assets/{index-DKuLdlGi.js → index-De-Vgsb6.js} +1 -1
- package/dist/assets/index-DnKyoEA9.js +55 -0
- package/dist/assets/{index-VyLFO7R7.js → index-Mix8V5gr.js} +4 -4
- package/dist/assets/{index-WzLE1u-g.js → index-NomqB6Iy.js} +1 -1
- package/dist/assets/index-S8uuD-j6.js +29 -0
- package/dist/assets/{index-DUJ8lwX7.js → index-Tj1dVBHC.js} +10 -10
- package/dist/assets/index-WsuqXAUT.js +1 -0
- package/dist/assets/{index-BWszlIaS.js → index-ecxGjzSN.js} +2 -2
- package/dist/assets/{index-CI7en2_Z.js → index-j9zHEMDv.js} +2 -2
- package/dist/assets/{index-CWQp0vgv.js → index-nYsahwVM.js} +1 -1
- package/dist/assets/{index-DnJ0ECmd.js → index-phW48DJg.js} +1 -1
- package/dist/assets/{index-CXA6Z-BW.js → index-qme31tNJ.js} +5 -5
- package/dist/assets/{index-BCKWe_QR.js → index-sE6ANlb1.js} +1 -1
- package/dist/assets/{invitation-KNbJYWOf.js → invitation-p9I7Fs_7.js} +2 -2
- package/dist/assets/{invitations-Di31zIeh.js → invitations-BYrxk2XC.js} +1 -1
- package/dist/assets/{invite-Cq1bQR9j.js → invite-DptGZzm9.js} +1 -1
- package/dist/assets/{isURL-RzSyCgzI.js → isURL-DmCvTfVx.js} +2 -2
- package/dist/assets/{issue-passport-DnHvhKR-.js → issue-passport-CeJy-eGP.js} +1 -1
- package/dist/assets/{item-DVQ8TUdv.js → item-D48n_jCS.js} +1 -1
- package/dist/assets/{landing-page-BzztE6uh.js → landing-page-C-nrxraJ.js} +1 -1
- package/dist/assets/{launch-result-message-DZJ76kCs.js → launch-result-message-DWeUg9rM.js} +1 -1
- package/dist/assets/{layout-D4qCeoWb.js → layout-Bu-krdMM.js} +1 -1
- package/dist/assets/{list-BIECWQvk.js → list-Bm-Ae18B.js} +1 -1
- package/dist/assets/list-DTYfy5jI.js +103 -0
- package/dist/assets/{list-header-BNFs7V0b.js → list-header-BE2kzda_.js} +1 -1
- package/dist/assets/localization-BILR5z0M.js +1 -0
- package/dist/assets/{log-Uj0MJfkC.js → log-QCNL7fmO.js} +1 -1
- package/dist/assets/logger-LLowKmBx.js +1 -0
- package/dist/assets/login-CEAH4IAS.js +1 -0
- package/dist/assets/{login-oauth-callback-DB_9NuV_.js → login-oauth-callback-C2H6pyf0.js} +1 -1
- package/dist/assets/{logo-uploader-BaFwvDBA.js → logo-uploader-D9dqlBcG.js} +1 -1
- package/dist/assets/{lost-passport-C2SpMW8x.js → lost-passport-D-HNQTYL.js} +2 -2
- package/dist/assets/{observability-BjKI3tFt.js → observability-Zow0Sv-X.js} +1 -1
- package/dist/assets/{omit-BZEryV5a.js → omit-hhiOJGRf.js} +1 -1
- package/dist/assets/{open-window-CVU9iEs4.js → open-window-DgCyIQ1g.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-CFwnz6K1.js → over-due-invoice-payment-DSTf3GE0.js} +1 -1
- package/dist/assets/{overview-DpyqbS6x.js → overview-ClqTYGzr.js} +2 -2
- package/dist/assets/{page-header-xpG0yfsa.js → page-header-DCvzRay5.js} +1 -1
- package/dist/assets/passport-C04lgrV5.js +1 -0
- package/dist/assets/{passport-item-Af9VCIFW.js → passport-item-BDPJusYi.js} +1 -1
- package/dist/assets/{permission-bm6ygywx.js → permission-CPpfaEat.js} +1 -1
- package/dist/assets/{playground-DKMlueFr.js → playground-CAOOFQT1.js} +1 -1
- package/dist/assets/preferences-D2CWTpgr.js +1 -0
- package/dist/assets/profile-embed-CLHyEYTf.js +1 -0
- package/dist/assets/publish-resource-B1BSffEx.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-aD7p6S7F.js → react-beautiful-dnd.esm-ZwmTP19t.js} +1 -1
- package/dist/assets/{react-stripe.esm-BV6kfV2w.js → react-stripe.esm-Dc9snvfb.js} +1 -1
- package/dist/assets/{required-C9DLcn9T.js → required-BGaDOGrj.js} +1 -1
- package/dist/assets/runtime-AXM1IbpE.js +1 -0
- package/dist/assets/{sanitize-usZAK6S4.js → sanitize-BEqBHa8a.js} +1 -1
- package/dist/assets/sdk-CvRW7Vwp.js +1 -0
- package/dist/assets/{section-MSasF4Cx.js → section-C75bzkkL.js} +1 -1
- package/dist/assets/{security-DbLAyZY0.js → security-BKCc6kr9.js} +1 -1
- package/dist/assets/{session-jDtNo9RS.js → session-BYq9-2GE.js} +1 -1
- package/dist/assets/{setup-C5jTmWDG.js → setup-CdiiCta6.js} +1 -1
- package/dist/assets/{shorten-label-dRmYvYJ7.js → shorten-label-RqvHqcC3.js} +1 -1
- package/dist/assets/{simple-select-CQxVe4SK.js → simple-select-iVD4-YUy.js} +1 -1
- package/dist/assets/{spaces-V5-JD9i7.js → spaces-Bhd_JZon.js} +1 -1
- package/dist/assets/{start-6JVejCmJ.js → start-BXKCBBDg.js} +1 -1
- package/dist/assets/{starting-progress-BYVwnaNc.js → starting-progress-Ls9oWS4w.js} +1 -1
- package/dist/assets/status-Cu5kOgRL.js +1 -0
- package/dist/assets/{step-actions-C1GR4GhW.js → step-actions-sALFE9jn.js} +1 -1
- package/dist/assets/{studio-DmcnkjTl.js → studio-2AfcGI4x.js} +1 -1
- package/dist/assets/{switch-control-CG7qdize.js → switch-control-CLq7MYhJ.js} +1 -1
- package/dist/assets/{table-tips-CdXwFA3X.js → table-tips-DBCvmY1v.js} +1 -1
- package/dist/assets/team-4Qq9vwj5.js +146 -0
- package/dist/assets/traffic-DU_BMQPm.js +1 -0
- package/dist/assets/{transfer-D3XcQgCt.js → transfer-DAvviBGy.js} +1 -1
- package/dist/assets/{unsubscribe-D-eN0zoM.js → unsubscribe-CzukIuIE.js} +1 -1
- package/dist/assets/{use-app-logo-CMlvKxYW.js → use-app-logo-9qTsLgnV.js} +1 -1
- package/dist/assets/{use-mobile-Bjbo_Gou.js → use-mobile-DCNBsOlH.js} +1 -1
- package/dist/assets/{use-mobile-CjZIGfWP.js → use-mobile-maRlSUwU.js} +1 -1
- package/dist/assets/{use-server-logo-uMEEt675.js → use-server-logo-n_aaKVoZ.js} +1 -1
- package/dist/assets/use-window-close-PzHKtiXA.js +1 -0
- package/dist/assets/{useAsync-BT7wPXCF.js → useAsync-BcVLpt2E.js} +1 -1
- package/dist/assets/{useAsync-D25sKCXL.js → useAsync-cZ_FPf9k.js} +1 -1
- package/dist/assets/{useAsyncRetry-D-vTCNcS.js → useAsyncRetry-DwwEjrjs.js} +1 -1
- package/dist/assets/{useLocalStorage-BVI5Gy_v.js → useLocalStorage-CvPFnddH.js} +1 -1
- package/dist/assets/user-center-DynXe12u.js +126 -0
- package/dist/assets/{user-follower-CaGHj3ZA.js → user-follower-Br2H5oAR.js} +1 -1
- package/dist/assets/{util-BsBRHu6F.js → util-4xOccFjr.js} +1 -1
- package/dist/assets/{util-B-6GuSKY.js → util-B1w9UqzK.js} +1 -1
- package/dist/assets/{vendor-arcblock-B0VYnHWE.js → vendor-arcblock-CqplRmyi.js} +114 -115
- package/dist/assets/{vendor-hooks-iFsOjihK.js → vendor-hooks-CjESGRlR.js} +1 -1
- package/dist/assets/{vendor-mui-core-BPcN1m8_.js → vendor-mui-core-CnXrAOs3.js} +1 -1
- package/dist/assets/{vendor-mui-x-DEgOZXst.js → vendor-mui-x-bJ5idfMH.js} +1 -1
- package/dist/assets/vendor-utils-cJEl_UEd.js +213 -0
- package/dist/assets/{vendor-ux-CheVAuK7.js → vendor-ux-5OlTXZBe.js} +10 -10
- package/dist/assets/{wait-connect-DyWyU1dI.js → wait-connect-BA-9v9IK.js} +1 -1
- package/dist/assets/{wizard-CwvOHxpL.js → wizard-B70SUVne.js} +1 -1
- package/dist/assets/{wizard-components-Cu3iAFug.js → wizard-components-Bj1vePv_.js} +1 -1
- package/dist/assets/wrap-locale-CyFByfaX.js +1 -0
- package/dist/assets/{zh-qs5i9EFZ.js → zh-DBbr_lO3.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/api-VWP7Oo6L.js +0 -1
- package/dist/assets/bind-account-BCP_Ypfy.js +0 -1
- package/dist/assets/branding-BDdxk2E2.js +0 -1
- package/dist/assets/button-DAumqZoi.js +0 -1
- package/dist/assets/connect-to-BrFtlkBE.js +0 -1
- package/dist/assets/createClass-sKvm4qit.js +0 -1
- package/dist/assets/domain-BeE_hgxW.js +0 -9
- package/dist/assets/domain-action-card-CBIJJCbh.js +0 -28
- package/dist/assets/domains-DgAenuDY.js +0 -1
- package/dist/assets/engine-DH9sKH0j.js +0 -1
- package/dist/assets/get-safe-url-DEmvtN3J.js +0 -1
- package/dist/assets/index-B3O5tZNc.js +0 -55
- package/dist/assets/index-Bth96Xcv.js +0 -7
- package/dist/assets/index-CZ4Y1y1j.js +0 -120
- package/dist/assets/index-DUiyqDLR.js +0 -30
- package/dist/assets/index-bd0w0UHw.js +0 -6
- package/dist/assets/index-hKD4Miak.js +0 -1
- package/dist/assets/index-vci0NXIe.js +0 -1
- package/dist/assets/list-Dd8HkY3P.js +0 -103
- package/dist/assets/localization-CCBoTGdU.js +0 -1
- package/dist/assets/logger-D-AxDn18.js +0 -1
- package/dist/assets/login-DWAFC8kE.js +0 -1
- package/dist/assets/passport-Bei4Q65O.js +0 -1
- package/dist/assets/preferences-lGhRntFn.js +0 -1
- package/dist/assets/profile-embed-JHxbEwL7.js +0 -1
- package/dist/assets/publish-resource-D19FmjtU.js +0 -1
- package/dist/assets/runtime-Kn_kNxXD.js +0 -1
- package/dist/assets/sdk-C0BAXQzO.js +0 -1
- package/dist/assets/status-C9q9BOVN.js +0 -1
- package/dist/assets/team-PZ1SHeY3.js +0 -146
- package/dist/assets/traffic-Dh35q8G-.js +0 -1
- package/dist/assets/use-window-close-Dmw6cTVQ.js +0 -1
- package/dist/assets/user-center-Cwsrx5yP.js +0 -126
- package/dist/assets/vendor-utils-D6HS5QsS.js +0 -213
- package/dist/assets/wrap-locale-BLNR9__l.js +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{g as Bt,r as v}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as S,z as X,b6 as me,bg as Ke,y as V,am as ut,d7 as Wt,bn as Kt,at as ie,b1 as mt,W as p,T as ee,U as Je,d8 as pt,b5 as qe,a5 as Me,Q as Pe,d9 as Ge,aN as Ue,a6 as ft,D as ht,da as qt,ad as xt,db as Mt,dc as Ut,c2 as st,n as Ht,J as $t,x as Vt,bc as Jt,M as it,cw as Gt,I as Yt,dd as Qt}from"./vendor-mui-core-CnXrAOs3.js";import{A as gt,J as Xt,C as Zt,e as oe,F as en,a3 as je}from"./vendor-utils-cJEl_UEd.js";import{V as te,H as q,n as le,p as tn,j as bt,Q as nn,aD as sn,m as jt,$ as vt,h as yt,aE as ke,b as St,z as an,a2 as rn}from"./vendor-ux-5OlTXZBe.js";import{aJ as on,_ as Ye,ac as Ct,az as wt,K as _e,c as B,a1 as Z,o as ln,aR as at}from"./index-Cq3xfsOS.js";import{g as ye,b as $,a as se}from"./vendor-hooks-CjESGRlR.js";import{u as Rt,C as Y}from"./index.esm-JPZAjt0x.js";import{i as He}from"./isURL-DmCvTfVx.js";import{S as Q}from"./section-C75bzkkL.js";import{A as cn,a as dn,b as un}from"./collapse-BMy0GGFk.js";import{S as Se}from"./shorten-label-RqvHqcC3.js";import{v as Tt}from"./index-DTj7lG0j.js";import{R as Nt,A as mn,S as pn,a as fn,B as hn}from"./list-DTYfy5jI.js";import{j as xn,c as gn,N as bn}from"./team-4Qq9vwj5.js";import{W as jn}from"./did-address-C5FXzeAS.js";import{p as It}from"./util-4xOccFjr.js";import{D as vn,g as yn}from"./traffic-DU_BMQPm.js";import{B as Et}from"./bundle-avatar-B9iCn_eS.js";import{u as Sn}from"./use-mobile-maRlSUwU.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CqplRmyi.js";import"./required-BGaDOGrj.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./session-BYq9-2GE.js";import"./use-app-logo-9qTsLgnV.js";import"./base32-DB18VP05.js";import"./useAsyncRetry-DwwEjrjs.js";import"./useAsync-cZ_FPf9k.js";import"./iframe-fHGifsex.js";import"./index-DW-pVTUA.js";import"./index-DBs9Ljax.js";import"./base-chart-C-Raz4Q-.js";import"./index-NomqB6Iy.js";import"./vendor-mui-x-bJ5idfMH.js";import"./AdapterDayjs-C8RSaHa0.js";var Re={exports:{}},Te={exports:{}},Ne={exports:{}},rt;function Cn(){return rt||(rt=1,function(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=n;function n(r){return r==null}t.exports=s.default,t.exports.default=s.default}(Ne,Ne.exports)),Ne.exports}var ot;function wn(){return ot||(ot=1,function(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=f;var n=o(on()),r=o(Cn());function o(u){return u&&u.__esModule?u:{default:u}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,j=/^[-+]?[0-9]+$/;function f(u,a){(0,n.default)(u),a=a||{};var y=a.allow_leading_zeroes===!1?l:j,R=!a.hasOwnProperty("min")||(0,r.default)(a.min)||u>=a.min,w=!a.hasOwnProperty("max")||(0,r.default)(a.max)||u<=a.max,b=!a.hasOwnProperty("lt")||(0,r.default)(a.lt)||u<a.lt,E=!a.hasOwnProperty("gt")||(0,r.default)(a.gt)||u>a.gt;return y.test(u)&&R&&w&&b&&E}t.exports=s.default,t.exports.default=s.default}(Te,Te.exports)),Te.exports}var lt;function Rn(){return lt||(lt=1,function(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=o;var n=r(wn());function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,n.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}t.exports=s.default,t.exports.default=s.default}(Re,Re.exports)),Re.exports}var Tn=Rn();const Nn=Bt(Tn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function In(){const{api:t}=Ye(),{blocklet:s}=Ct(),{t:n}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,j=Object.assign({...ze},s?.settings?.notification?.email||{}),{handleSubmit:f,control:u,formState:a,watch:y,reset:R}=Rt({defaultValues:gt(j,Object.keys(ze))}),w=ye({testReceiver:"",testReceiverError:""}),b=y("enabled"),E=$(async(i,C,D=!0)=>{try{const{blocklet:O}=await t.configNotification({input:{did:l,notification:JSON.stringify({email:i})}}),ae=Object.assign({...ze},O?.settings?.notification?.email||{});R(ae),D&&q.success(n("oauth.saveSuccess"))}catch(O){if(D)q.error(O.message||n("oauth.saveFailed"));else throw O}}),J=$(async(i,C,D)=>{try{a.isDirty&&await E(i,C,!1),await t.sendEmail({input:{did:l,receiver:D,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),q.success(n("notification.email.testSuccess"))}catch(O){q.error(O.message||n("notification.email.testfailed"))}}),M=$((i,C)=>{w.testReceiver=localStorage.getItem("test-receiver")||"",w.testReceiverError="",r.open({title:n("notification.email.testSendEmail"),content:()=>e.jsx(S,{sx:{width:"300px"},children:e.jsx(X,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:n("notification.email.inputTestReceiver"),value:w.testReceiver,onChange:D=>{w.testReceiver=D.target.value},error:!!w.testReceiverError,helperText:w.testReceiverError||" "})}),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),async onConfirm(D){const O=w.testReceiver?.trim();if(!O){w.testReceiverError=n("notification.email.receiverRequired");return}if(!_e(O)){w.testReceiverError=n("notification.email.receiverInvalid");return}w.testReceiverError="",await J(i,C,O),D()}})}),P=$(i=>{const C=i?.trim();return C?_e(C)?!0:n("notification.email.fromInvalid"):n("notification.email.fromRequired")}),F=$(i=>{const C=i?.trim();return C?He(C,{require_host:!1,protocols:[]})?!0:n("notification.email.hostInvalid"):n("notification.email.hostRequired")}),N=$(i=>i?Nn(i)?!0:n("notification.email.portInvalid"):n("notification.email.portRequired")),W=$(i=>i?.trim()?!0:n("notification.email.userRequired")),K=$(i=>i?.trim()?!0:n("notification.email.passwordRequired")),h=$(i=>i?.trim()&&!He(i,{protocols:["http","https"],require_protocol:!0})?n("notification.email.linkInvalid"):!0),T=$(i=>i?.trim()&&!_e(i)?n("notification.email.emailInvalid"):!0),k=$(()=>!0);return e.jsxs(S,{children:[e.jsxs(En,{component:"form",onSubmit:f(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(Q,{title:n("notification.email.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:u,render:({field:i})=>e.jsx(me,{control:e.jsx(Ke,{checked:i.value,...i})})})}),e.jsx(Q,{title:n("notification.email.from"),children:e.jsx(Y,{name:"from",control:u,rules:{validate:b?P:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",required:!0,label:n("notification.email.from"),error:!!a.errors[i.name],helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.host"),children:e.jsx(Y,{name:"host",control:u,rules:{validate:b?F:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",required:!0,error:!!a.errors[i.name],label:n("notification.email.host"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.port"),children:e.jsx(Y,{name:"port",control:u,rules:{validate:b?N:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",required:!0,type:"number",error:!!a.errors[i.name],label:n("notification.email.port"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.user"),children:e.jsx(Y,{name:"user",control:u,rules:{validate:b?W:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",required:!0,error:!!a.errors[i.name],label:n("notification.email.user"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.password"),children:e.jsx(Y,{name:"password",control:u,rules:{validate:b?K:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",required:!0,type:"password",error:!!a.errors[i.name],label:n("notification.email.password"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.secure"),children:e.jsx(Y,{name:"secure",control:u,rules:{validate:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(Ke,{checked:i.value,...i,disabled:!b})})})})}),e.jsxs(cn,{children:[e.jsxs(dn,{expandIcon:e.jsx(Kt,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[n("notification.email.signature"),e.jsx(ut,{title:n("notification.email.signatureTooltip"),children:e.jsx(Wt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(un,{children:[e.jsx(Q,{title:n("notification.email.companyName"),children:e.jsx(Y,{name:"companyName",control:u,rules:{validate:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",error:!!a.errors[i.name],label:n("notification.email.companyName"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.companyLink"),children:e.jsx(Y,{name:"companyLink",control:u,rules:{validate:b?h:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",error:!!a.errors[i.name],label:n("notification.email.companyLink"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.companyAddress"),children:e.jsx(Y,{name:"companyAddress",control:u,rules:{validate:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",error:!!a.errors[i.name],label:n("notification.email.companyAddress"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})}),e.jsx(Q,{title:n("notification.email.supportEmail"),children:e.jsx(Y,{name:"supportEmail",control:u,rules:{validate:b?T:k},render:({field:i})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...i,size:"small",type:"email",error:!!a.errors[i.name],label:n("notification.email.supportEmail"),helperText:a.errors[i.name]?.message||" ",disabled:!b})})})})]})]}),e.jsxs(S,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(le,{variant:"outlined",color:"warning",onClick:f(M),disabled:!b,children:n("oauth.runTest")}),e.jsx(le,{type:"submit",variant:"contained",disabled:!a.isDirty,children:n("oauth.save")})]})]}),o]})}const En=ie(mt)``,Be={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function kn(){const{api:t}=Ye(),{blocklet:s}=Ct(),{t:n}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,j=Object.assign({...Be},s?.settings?.notification?.pushKit||{}),{handleSubmit:f,control:u,formState:a,watch:y,reset:R}=Rt({defaultValues:gt(j,Object.keys(Be))}),w=ye({testReceiver:"",testReceiverError:""}),b=y("enabled"),E=$(async(N,W,K=!0)=>{try{const{blocklet:h}=await t.configNotification({input:{did:l,notification:JSON.stringify({pushKit:N})}}),T=Object.assign({...Be},h?.settings?.notification?.pushKit||{});R(T),K&&q.success(n("oauth.saveSuccess"))}catch(h){if(K)q.error(h.message||n("oauth.saveFailed"));else throw h}}),J=$(async(N,W)=>{try{a.isDirty&&await E(N,W,!1);const K=(s?.configs||[]).find(k=>k.key==="BLOCKLET_APP_URL")?.value,h=Xt(Zt(K,B.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),T={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:h}}}};await t.sendPush({input:{did:l,receiver:w.testReceiver,notification:JSON.stringify(T)}}),q.success(n("notification.pushKit.testSuccess"))}catch(K){q.error(K.message||n("notification.pushKit.testfailed"))}}),M=$((N,W)=>{w.testReceiverError="",r.open({title:n("notification.pushKit.testSend"),content:()=>e.jsx(S,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(X,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:n("notification.pushKit.inputTestReceiver"),value:w.testReceiver,onChange:K=>{w.testReceiver=K.target.value},error:!!w.testReceiverError,helperText:w.testReceiverError||" "})}),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),async onConfirm(K){if(!w.testReceiver?.trim()){w.testReceiverError=n("notification.pushKit.receiverRequired");return}w.testReceiverError="",await J(N,W),K()}})}),P=$(N=>{const W=N?.trim();return W?He(W)?!0:n("notification.pushKit.endpointInvalid"):n("notification.pushKit.endpointRequired")}),F=$(()=>!0);return e.jsxs(S,{children:[e.jsxs(An,{component:"form",onSubmit:f(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(Q,{title:n("notification.pushKit.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:u,render:({field:N})=>e.jsx(me,{control:e.jsx(Ke,{checked:N.value,...N})})})}),e.jsx(Q,{title:n("notification.pushKit.endpoint"),children:e.jsx(Y,{name:"endpoint",control:u,rules:{validate:b?P:F},render:({field:N})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...N,size:"small",required:!0,label:n("notification.pushKit.endpoint"),error:!!a.errors[N.name],helperText:a.errors[N.name]?.message||" ",disabled:!b})})})}),e.jsxs(Q,{title:n("notification.pushKit.customOptions"),children:[e.jsx(Y,{name:"did",control:u,render:({field:N})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...N,size:"small",label:n("notification.pushKit.did"),error:!!a.errors[N.name],helperText:a.errors[N.name]?.message||" ",disabled:!b})})}),e.jsx(Y,{name:"pushPath",control:u,render:({field:N})=>e.jsx(V,{fullWidth:!0,children:e.jsx(X,{...N,size:"small",label:n("notification.pushKit.pushPath"),error:!!a.errors[N.name],helperText:a.errors[N.name]?.message||" ",disabled:!b})})})]}),e.jsxs(S,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(le,{variant:"outlined",color:"warning",onClick:f(M),disabled:!b,children:n("oauth.runTest")}),e.jsx(le,{type:"submit",variant:"contained",disabled:!a.isDirty,children:n("oauth.save")})]})]}),o]})}const An=ie(mt)``,ct=[{label:e.jsx(S,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(S,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function On(){const[t,s]=v.useState(ct[0].value),{locale:n}=v.useContext(tn),r=se(()=>({email:e.jsx(In,{}),pushKit:e.jsx(kn,{})}),[n]),o=v.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(S,{children:[e.jsx(bt,{tabs:ct,current:t,onChange:s}),e.jsx(S,{style:o,children:r[t]})]})}const kt=v.createContext({}),{Provider:Dn,Consumer:Bs}=kt;function Ln({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=Ye(),[l,j]=v.useState([]),[f,u]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),a=se(()=>s.meta?.did,[s]),[y,R]=v.useState([]),[w,b]=v.useState({}),E=se(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),J=async({page:h=1,pageSize:T=20,...k}={})=>{if(!a)return[];try{const i={paging:{page:h,pageSize:T},...k,teamDid:a,dateRange:k.dateRange?[Z(k.dateRange[0]).toISOString(),Z(k.dateRange[1]).toISOString()]:void 0},{dids:C,...D}=i;let O="";C&&C.includes("system")&&(O="system");const ae=C?C.filter(pe=>pe!=="system"):[],de={...D,source:O,componentDids:ae},re=await n.getNotificationSendLog({input:de});return b(de),j(re.list),u(re.paging),re.list}catch(i){return q.error(i.message),[]}},M=async()=>{const h=await n.getNotificationComponents({input:{teamDid:a}});R(h.componentDids)},P=v.useCallback(h=>{const T=s.children.find(k=>k.meta?.did===h);if(T)return T.ancestors=[s],T},[s]),F=async({notificationId:h,receivers:T,channels:k,...i})=>{await n.resendNotification({input:{teamDid:a,notificationId:h,receivers:T,channels:k.map(C=>C==="wallet"?B.NOTIFICATION_SEND_CHANNEL.WALLET:C==="pushKit"?B.NOTIFICATION_SEND_CHANNEL.PUSH:C),...i}})},N=v.useCallback(async h=>(await n.getUser({input:{teamDid:a,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,a]),W=v.useCallback(async({page:h=1,pageSize:T=20,...k}={})=>{try{const i={paging:{page:h,pageSize:T},...k,userName:k.searchText||"",teamDid:a,dateRange:k.dateRange?[Z(k.dateRange[0]).toISOString(),Z(k.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:i})}catch(i){throw q.error(i.message),i}},[n,a]);v.useEffect(()=>{a&&M()},[a]),o(B.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&J(w)},[E,w]),o(B.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||J(w)},[E,w]);const K={fetch:J,data:l,paging:f,blocklet:s,getComponent:P,resendNotification:F,getUser:N,componentDids:y,getReceivers:W,inService:r,teamDid:a};return e.jsx(Dn,{value:{notificationRecords:K},children:t})}function Qe(){const{notificationRecords:t}=v.useContext(kt);return t}Ce.propTypes={severity:p.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Pn={info:"primary",success:"success",error:"error",warning:"warning"};function Ce({severity:t="info"}){return e.jsx(nn,{type:Pn[t],children:t})}const Fn=(t,s,n="")=>{if(!n||!s)return"";switch(n){case B.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case B.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case B.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case B.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function At(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:j="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:ln(o,s)}):"",u=Fn(t,j,l);return r===B.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:u}:r===B.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:u,sentTime:f}}const $e={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ve=["wallet","pushKit","email"],dt=["info","success","error","warning"],Ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},Dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},_n=(t,s)=>{const n=oe(s,"extra.notifications.email",!0);return{available:Ot(t),enabled:n}},zn=(t,s)=>{const n=oe(s,"extra.notifications.push",!0);return{available:Dt(t),enabled:n}},Bn=t=>({enabled:oe(t,"extra.notifications.wallet",!0)}),Wn=t=>({enabled:oe(t,"extra.webhooks",[]).length>0}),Ie=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Kn=(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})}]:[],Ee=(t=[])=>{const s=Z().startOf("day");return t.filter(n=>Z(n.sendAt).isSame(s,"day")).length},qn=(t,s="")=>{if(s&&Ve.includes(s)){const l=`${s}SendRecord`,j=oe(t,l,[]);return Ee(j)}const n=oe(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return Ee(l)}const o={};return Ve.forEach(l=>{const j=`${l}SendRecord`,f=oe(t,j,[]),u=Ee(f);o[l]=u}),r.length>0&&r.forEach(l=>{const j=n[l]??[],f=Ee(j);o[l]=f}),o},Ae=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Oe=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Mn=t=>{switch(t){case B.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case B.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case B.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case B.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Lt=()=>({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 ce({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:j="",reason:f=""}=t,u=[l,f].filter(Boolean).join(", ");return e.jsx(ut,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:u}),e.jsx("span",{children:j})]}):null,arrow:!0,placement:"top",children:e.jsxs(S,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(S,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(S,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:$e[o]}}),e.jsx(S,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:$e[o]}})]}),e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}ce.propTypes={config:p.object.isRequired,enableTooltip:p.bool,showTitle:p.bool,children:p.node};De.propTypes={list:p.array.isRequired,label:p.string.isRequired,onDelete:p.func};function De({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=te();return e.jsxs(S,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),t.map(l=>{const j=At(r,o,{status:l});return e.jsx(Je,{size:"small",label:e.jsx(S,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(ce,{config:j,enableTooltip:!1,children:j.title})}),onDelete:f=>n(f,l)},l)})]})}Xe.propTypes={filterList:p.array.isRequired,onChange:p.func.isRequired,index:p.number.isRequired,column:p.object.isRequired,filterValues:p.array.isRequired,label:p.string.isRequired,renderLabel:p.func.isRequired};function Xe({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:j}){return e.jsxs(V,{className:"filter-container",children:[e.jsx(pt,{component:"legend",children:l}),e.jsx(qe,{row:!0,children:o.map(f=>e.jsx(me,{control:e.jsx(Me,{checked:t[n].indexOf(f.value??f)>-1,onChange:u=>{const a=[...t];u.target.checked?a[n]=[...a[n],f.value??f]:a[n]=a[n].filter(y=>y!==(f.value??f)),s(a[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:j(f)})},f.value??f))})]})}function We(t){return e.jsx(Xe,{...t,renderLabel:s=>e.jsx(ce,{enableTooltip:!1,config:{status:s.status},children:s.label})})}xe.propTypes={status:p.number.isRequired,updatedAt:p.string.isRequired,reason:p.string,channel:p.string,onResend:p.func};function xe({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:j}=te(),f=At(l,j,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(S,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ce,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Pe,{className:"resend-btn",size:"small",startIcon:e.jsx(Ge,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Ze.propTypes={value:p.array.isRequired,onChange:p.func};function Ze({value:t,onChange:s}){const{locale:n}=te(),r=Z().toDate(),[o,l]=v.useState(null),j=v.useCallback(a=>{l(o?null:a.currentTarget)},[o]),f=!!o,u=v.useCallback(a=>{if(!a.startDate||!a.endDate){q.error("Please select a date range");return}if(Z(a.startDate).isAfter(a.endDate)||!Z(a.startDate).isValid()||!Z(a.endDate).isValid()){q.error("Invalid date range");return}s([a.startDate,a.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(ee,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Pe,{onClick:j,variant:"outlined",size:"small",color:"inherit",children:[at(t[0],n)," - ",at(t[1],n)]})}),e.jsx(Ue,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(vn,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:j,definedRanges:yn(r),onChange:u})})]})}et.propTypes={itemComponent:p.elementType.isRequired};function et({itemComponent:t,...s}){const{t:n}=te();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(S,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(sn.TableFilterList,{...s,ItemComponent:t})})]})}function tt({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Je,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}tt.propTypes={label:p.string.isRequired,onDelete:p.func,canDelete:p.func};const Un=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Pt.propTypes={loading:p.bool,onCancel:p.func,onConfirm:p.func};function Pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=te(),[o,l]=v.useState(Un),[j,f]=v.useState(!0),u=(y,R)=>{R.checked=y.target.checked;const w=o.map(b=>({...b,checked:b.value===R.value?R.checked:b.checked}));l(w)},a=y=>{y.stopPropagation(),n({channels:o.filter(R=>R.checked).map(R=>R.value),isResendFailedOnly:j})};return e.jsxs(S,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ee,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(S,{className:"choose-channel",children:e.jsxs(V,{component:"fieldset",variant:"standard",children:[e.jsx(pt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(qe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(y=>e.jsx(me,{control:e.jsx(Me,{checked:y.checked,onChange:R=>u(R,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(S,{className:"resend-config-footer",children:e.jsx(qe,{children:e.jsx(me,{control:e.jsx(Me,{checked:j,onChange:y=>f(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(S,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Pe,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Pe,{onClick:a,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(ft,{size:16}),r("common.confirm")]})]})]})}Ft.propTypes={notificationId:p.string.isRequired,handleResend:p.func,resending:p.bool};function Ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),l=ht(),j=v.useMemo(()=>jt(l,Lt()),[l]),{getReceivers:f,inService:u,teamDid:a,getUser:y,blocklet:R}=Qe(),[w,b]=v.useState(!1),[E,J]=v.useState([]),M=ye({anchorEl:null,position:null}),P=ye({anchorEl:null,position:null}),[F,N]=v.useState(null),[W,K]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,T]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),[k,i]=v.useState([]),C=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],D=async()=>{if(!w&&t)try{b(!0);const c=await f({notificationId:t,...h}),d=c.list.map(m=>({...m,receiverUser:{...m.receiverUser,avatar:It(m.receiverUser.avatar,a,u)}}));J(d),K(c.paging),b(!1)}catch(c){q.error(c.message),b(!1)}};v.useEffect(()=>{D()},[h]);const O=c=>{c.stopPropagation();const d=c.currentTarget;P.anchorEl=d;const m=d.getBoundingClientRect();P.position={top:m.top+window.scrollY,left:m.left+window.scrollX}},ae=c=>c.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(le,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:O,children:r("notification.resend")})}):null,de={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:W.page-1,rowsPerPage:W.pageSize,count:W.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:k,onRowSelectionChange:(c,d)=>{i(d.map(m=>m.dataIndex))},customToolbarSelect:ae},re=({page:c,rowsPerPage:d,searchText:m,filterList:A})=>{const[,U=[],ne=[],G=[]]=A;h.pageSize!==d?T(H=>({...H,pageSize:d,page:1})):h.page!==c+1?T(H=>({...H,page:c+1})):h.searchText!==m?T(H=>({...H,searchText:m,page:1})):je(U,h.walletSendStatus)?je(ne,h.pushKitSendStatus)?je(G,h.emailSendStatus)||T(H=>({...H,emailSendStatus:G,page:1})):T(H=>({...H,pushKitSendStatus:ne,page:1})):T(H=>({...H,walletSendStatus:U,page:1}))},pe=v.useCallback(async(c,d)=>{if(!d)return!1;const m=await y(d);return m?c==="wallet"?Bn(m):c==="email"?_n(R,m):c==="pushKit"?zn(R,m):c==="webhook"?Wn(m):!0:!1},[y,R]),Fe=v.useCallback(c=>Kn(r,c),[r]),ue=()=>{M.anchorEl=null,M.position=null,N(null)},fe=()=>{P.anchorEl=null,P.position=null},we=async(c,d,m=!0,A="")=>{if(!(!d.length||!c.length))try{s(c,d,m,A),P.anchorEl||(await Ie(.5),ue())}catch(U){console.error("handleResend error",{error:U})}},g=async({channels:c,isResendFailedOnly:d})=>{const m=k.map(A=>E[A].receiver);await we(c,m,d),await Ie(.5),fe(),i([])},x=async(c,d=[],m=!0)=>{try{await we(["webhook"],[c.receiver],m,d)}catch(A){q.error(A.response?A.response.statusText:A.message)}},I=async(c,d,m,A=[],U=!0)=>{if(c.stopPropagation(),qn(d,m)>=4){q.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await x(d,A,U);return}if(c){const G=c.currentTarget,H=G.getBoundingClientRect();M.anchorEl=G,M.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}N({channel:m});try{const G=await pe(m,d.receiver);await Ie(1),N({channel:m,result:G}),(typeof G=="boolean"&&G||en(G)&&Object.values(G).every(H=>!!H))&&(await s([m],[d.receiver],U),P.anchorEl||(await Ie(.5),ue()))}catch(G){q.error(G.message)}},_=c=>{T(d=>({...d,dateRange:c,page:1}))},z=(c,d,m,A)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);T(ne=>({...ne,[A]:U,page:1}))},L=se(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:c=>{const{receiverUser:d,receiver:m}=E[c];return d?e.jsxs(S,{"data-cy":`member-name-${d.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(vt,{src:`${d.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:m,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Se,{children:d.fullName})]},m):e.jsx(jn,{size:14,responsive:!1,compact:!0,copyable:!1,did:m})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:c=>e.jsx(De,{list:c,label:"Wallet",onDelete:(d,m)=>{d.stopPropagation(),z(d,m,L[1].options.filterList,"walletSendStatus")}}),update:Ae},filterOptions:{names:C,fullWidth:!0,logic:Oe,display:(c,d,m,A)=>e.jsx(We,{label:"Wallet",filterList:c,onChange:d,index:m,column:A,filterValues:C})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"wallet",onResend:U=>I(U,E[c],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{pushKitSendStatus:d,pushKitSendAt:m,pushKitSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"pushkit",onResend:U=>I(U,E[c],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:c=>e.jsx(De,{list:c,label:"Push Kit",onDelete:(d,m)=>{d.stopPropagation(),z(d,m,L[2].options.filterList,"pushKitSendStatus")}}),update:Ae},filterOptions:{names:C,fullWidth:!0,logic:Oe,display:(c,d,m,A)=>e.jsx(We,{label:"Push Kit",filterList:c,onChange:d,index:m,column:A,filterValues:C})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"email",onResend:U=>I(U,E[c],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:c=>e.jsx(De,{list:c,label:"Email",onDelete:(d,m)=>{d.stopPropagation(),z(d,m,L[3].options.filterList,"emailSendStatus")}}),update:Ae},filterOptions:{names:C,fullWidth:!0,logic:Oe,display:(c,d,m,A)=>e.jsx(We,{label:"Email",filterList:c,onChange:d,index:m,column:A,filterValues:C})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{webhook:d}=E[c];if(!d)return null;const m=Object.entries(d)[0];if(!m)return null;const[A,U]=m,ne=U[0];return e.jsx(S,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(S,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(Se,{maxLength:30,children:A},A),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:G=>I(G,E[c],"webhook",[A],!1)})]},A)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:c=>{const{createdAt:d}=E[c];return e.jsx(Nt,{value:d,locale:o,shouldUpdate:!0})}}}],[E,o,h,r]),he=[e.jsx(Ze,{value:h.dateRange,onChange:_},"date-picker"),e.jsx(le,{variant:"contained",size:"small",color:"primary",loading:w,startIcon:e.jsx(qt,{}),onClick:()=>D(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(S,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx($n,{children:e.jsxs(xt,{theme:j,children:[e.jsx(yt,{className:"receivers-table",locale:o,loading:w,columns:L,data:E,onChange:re,options:de,customButtons:he,components:{TableFilterList:c=>e.jsx(et,{...c,itemComponent:d=>e.jsx(tt,{...d,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ue,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ue,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(Vn,{children:[e.jsxs(ee,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(S,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Fe(F?.channel).map(c=>{const{type:d,pass:m,fail:A}=c;return!F?.result||F?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[d]?ke.success.main:"inherit"},children:[F?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:ke.primary.main}}),e.jsx("span",{children:m})]},d):e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ke.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:A})]},d)})})]})}),P.anchorEl&&e.jsx(Ue,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:fe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Pt,{loading:n,onCancel:fe,onConfirm:g})})]})})})}const Hn=v.memo(Ft),$n=ie.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
|
+
`,Vn=ie.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
|
+
`,ve=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function Jn(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(ge,{item:s})},{name:"Push",value:e.jsx(ge,{item:n})},{name:"Email",value:e.jsx(ge,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(ge,{item:o,isWebhook:!0})}]:[]]}function Gn(t,s,n){const{wallet:r,push:o,email:l,webhook:j}=t;return[{name:"Wallet",value:e.jsx(be,{loading:n,channel:B.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(be,{loading:n,channel:B.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(be,{loading:n,channel:B.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...j.total>0?[{name:"Webhook",value:e.jsx(be,{loading:n,channel:B.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:j,isWebhook:!0,onResend:s})}]:[]]}nt.propTypes={statistics:p.object.isRequired,onResend:p.func,mode:p.oneOf(["simple","detail"]),resending:p.bool};ge.propTypes={item:p.object.isRequired,isWebhook:p.bool};function ge({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,l=r===o?"success":"failed";return e.jsx(S,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(S,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(ce,{config:{status:l},enableTooltip:!1,children:[ve(r)," / ",ve(o)," ",n("notification.sendStatus.success")]})})})}be.propTypes={item:p.object.isRequired,isWebhook:p.bool,channel:p.string,onResend:p.func,loading:p.bool};function be({channel:t=B.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:o=!1}){const{t:l}=te(),{success:j,failed:f,pending:u}=s,a=Mn(t),y=n?j.length:j,R=n?f.length:f,w=n?u.length:u,b=async P=>{P.stopPropagation();const F=n?[...new Set([...j,...f].map(N=>N))]:[];await r([t],[],!0,F)},E=y+R,J=E>0?y/E*100:0,M=E>0?R/E*100:0;return e.jsxs(Yn,{successRatio:J,failedRatio:M,children:[e.jsxs(ee,{variant:"h6",children:[a," (",s.total,")"]}),e.jsxs(ee,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:$e.success,fontWeight:600,fontSize:24},children:ve(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(S,{className:"unsent-area",children:[e.jsxs(S,{children:[e.jsxs(ce,{config:{status:"failed"},enableTooltip:!1,children:[ve(R)," ",l("notification.sendStatus.failed")]}),e.jsxs(ce,{config:{status:"pending"},enableTooltip:!1,children:[ve(w)," ",l("notification.sendStatus.pending")]})]}),R>0&&e.jsx(S,{className:"resend-btn",children:e.jsx(le,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:b,children:l("notification.resend")})})]})]})}function nt({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const o=se(()=>s==="simple"?Jn(t):Gn(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(Tt,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(st,{container:!0,spacing:2,children:o.map(l=>e.jsx(st,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const Yn=ie(S)`
|
|
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,theme:n})=>t===0&&s===0?n.palette.grey[300]:`linear-gradient(to right, ${Ht(n.palette.success.light,.4)} ${t}%, ${n.palette.grey[100]} ${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
|
+
`;_t.propTypes={notification:p.object.isRequired,onCancel:p.func,blocklet:p.object.isRequired,tab:p.string};function _t({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:l}=te(),{getComponent:j,resendNotification:f}=Qe(),[u,a]=v.useState(!1),y=se(()=>j(t.componentDid)||n,[n,t.componentDid]),R=ye({tab:r||"info"}),w=v.useCallback(async(h,T,k=!0,i=[])=>{if(!h.length||!t.id)return;const C=T.length>0?T:t?.receivers?.map(O=>O.receiver);if(!C.length)return;let D=[...h];if(D.includes(B.NOTIFICATION_SEND_CHANNEL.PUSH)&&!Dt(n)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),D=D.filter(O=>O!==B.NOTIFICATION_SEND_CHANNEL.PUSH)),D.includes(B.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!Ot(n)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),D=D.filter(O=>O!==B.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!D.length)try{a(!0),await f({notificationId:t.id,receivers:C,channels:D,resendFailedOnly:k,...D.includes("webhook")&&i.length?{webhookUrls:i}:{}}),q.success("Message has been sent!")}catch(O){console.error("handleResend error",{error:O}),q.error(O.response?O.response.statusText:O.message)}finally{a(!1)}},[n,t.id,t?.receivers,f,o]),b=se(()=>xn(t),[t]),E=se(()=>gn(t),[t]),J=se(()=>b?t?.actorInfo:[],[t]),M=se(()=>n?.did||n?.meta?.did||"",[n]);function P(){return[{name:o("notification.from"),value:b&&E?e.jsx(mn,{actors:J,teamDid:M,size:32,showName:!0}):e.jsx(pn,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(Se,{maxLength:50,children:t.title})},{name:o("notification.body"),value:b?e.jsx(fn,{notification:t,blocklet:n}):e.jsx(bn,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(Ce,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(an,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(T=>e.jsx(Tt,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:T.name,children:T.value},T.name))}const F={info:{label:o("common.basicInfo"),value:"info",component:P},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},N=Object.values(F).map(({label:h,value:T})=>({label:h,value:T})),W=F[R.tab]||F.info,K=h=>{R.tab=h};return e.jsx(St,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{R.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(Xn,{children:[e.jsx(S,{className:"tabs",sx:{mx:3},children:e.jsx(bt,{tabs:N,current:R.tab,onChange:K,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[R.tab==="receivers"&&e.jsx(Hn,{notificationId:t.id,resending:u,handleResend:w}),R.tab==="statistics"&&e.jsx(nt,{statistics:t.statistics,mode:"detail",resending:u,onResend:w}),R.tab==="info"&&e.jsx(W.component,{})]})]})})}const Qn=v.memo(_t),Xn=ie.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: ${ke.text.disabled};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;Le.propTypes={blocklet:p.object,label:p.string};const Zn=ie.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 Le({blocklet:t=null,label:s=""}){return e.jsx(Zn,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(Et,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}zt.propTypes={list:p.array.isRequired,label:p.string.isRequired,onDelete:p.func};function zt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(S,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),t.map(r=>e.jsx(Je,{size:"small",label:e.jsx(S,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(Ce,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function es(t){return e.jsx(Xe,{...t,renderLabel:s=>e.jsx(Ce,{severity:s})})}function ts({customTableButtons:t}){const{t:s,locale:n}=te(),r=ht(),o=$t(r.breakpoints.down("sm")),l=v.useMemo(()=>jt(r,Lt()),[r]),[j,f]=v.useState(!1),{data:u,paging:a,blocklet:y,fetch:R,getComponent:w,componentDids:b,inService:E,teamDid:J}=Qe(),M=v.useRef(null),[P,F]=v.useState(null),[N,W]=v.useState("info"),K=Sn(),[h,T]=v.useState(!1),k=`notification-records-${y.meta?.did}`,i=rn(k),[C,D]=v.useState({pageSize:i.rowsPerPage||10,page:i.page?i.page+1:1,dids:i.dids||[],dateRange:i.dateRange||[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),O=se(()=>{if(!y.children||!y.children.length)return[];const g=[];return y.children.forEach(x=>{const I=x.did||x.meta?.did;b.includes(I)&&(x.ancestors=[y],g.push(x))}),g},[b,y]),ae=async g=>{try{f(!0),await R(g),f(!1)}finally{f(!1)}};v.useEffect(()=>{ae(C)},[C]),v.useEffect(()=>{const g=u.find(x=>x.id===P?.id);P&&g&&F({...g})},[u]);const de=(g,x,I,_)=>{g.stopPropagation();const z=I.filter(L=>L!==x);D(L=>({...L,[_]:z,page:1}))},re=({page:g,rowsPerPage:x,filterList:I})=>{const[_=[],,,,z=[]]=I;C.pageSize!==x?D(L=>({...L,pageSize:x,page:1})):C.page!==g+1?D(L=>({...L,page:g+1})):je(C.dids,_)?je(C.severities,z)||D(L=>({...L,severities:z,page:1})):D(L=>({...L,dids:_,page:1}))},pe=v.useCallback(()=>{F(null),W("info")},[]),Fe=v.useCallback(()=>{R(C)},[R,C]),ue=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:g=>g.map((x,I)=>{if(x==="system")return e.jsx("span",{children:s("notification.system")},`system-${I}`);const _=O.find(z=>(z.did||z.meta?.did)===x);return e.jsx(Le,{blocklet:_,label:_?.title||_?.meta?.title},x)}),update:(g,x,I)=>(g[I].splice(x,1),g)},filterOptions:{names:O,logic:(g,x)=>x.length?!x.includes(g):!1,display:(g,x,I,_)=>e.jsxs(V,{style:{width:"380px"},children:[e.jsx(Vt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Jt,{multiple:!0,value:g[I],renderValue:z=>e.jsx(S,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:z.map(L=>{if(L==="system")return e.jsx("span",{children:s("notification.system")},L);const he=O.find(c=>(c.did||c.meta?.did)===L);return e.jsx(Le,{blocklet:he,label:he?.title||he?.meta?.title},L)})}),onChange:z=>{g[I]=z.target.value,x(g[I],I,_)},children:[e.jsx(it,{value:"system",children:s("notification.system")}),O.map(z=>{const L=z.did||z.meta?.did;return e.jsx(it,{value:L,children:e.jsx(Le,{blocklet:z,label:z.title||z.meta?.title})},L)})]})]})},customBodyRenderLite:g=>{const x=u[g],I=w(x.componentDid);return e.jsxs(S,{sx:{display:"flex",alignItems:"center",gap:1},children:[I?e.jsx(Et,{size:32,blocklet:I,ancestors:I.ancestors??[]}):e.jsx(hn,{blocklet:y,size:32}),e.jsx(Se,{maxLength:50,children:I?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g],{receivers:I}=x;return e.jsx(Gt,{total:I.length,renderSurplus:_=>_<100?e.jsxs("span",{children:["+",_]}):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:_=>{_.stopPropagation(),F(x),W("receivers")},children:I.map(_=>{const{receiverUser:z}=_,L=It(z.avatar,J,E);return e.jsx(vt,{alt:z.fullName,src:`${L}?imageFilter=resize&w=48&h=48`,size:32,did:_.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},_.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(S,{onClick:I=>{I.stopPropagation(),F(x),W("statistics")},children:e.jsx(nt,{statistics:x.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(Se,{maxLength:50,children:x.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:g=>{const x=u[g];return e.jsx(Ce,{severity:x.severity})},filter:!0,filterType:"custom",filterList:C.severities??[],customFilterListOptions:{render:g=>e.jsx(zt,{list:g,label:s("notification.severity"),onDelete:(x,I)=>{x.stopPropagation(),de(x,I,ue[4].options.filterList,"severities")}}),update:Ae},filterOptions:{names:dt,fullWidth:!0,logic:Oe,display:(g,x,I,_)=>e.jsx(es,{label:s("notification.severity"),filterList:g,onChange:x,index:I,column:_,filterValues:dt})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:g=>{const{createdAt:x}=u[g];return e.jsx(Nt,{value:x,locale:n,shouldUpdate:!0})}}}],fe=g=>{D(x=>({...x,dateRange:g,page:1}))},we=[e.jsxs(S,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Yt,{onClick:()=>T(!0),sx:{p:K?0:void 0},children:e.jsx(Qt,{})},"settings"),K?e.jsx(ee,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(S,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ns,{isBreakpointsDownSm:o,children:e.jsx(xt,{theme:l,children:e.jsx(yt,{className:"main-table",verticalKeyWidth:100,loading:j,locale:n,columns:ue,data:u,durable:k,onChange:re,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:a.page-1,rowsPerPage:a.pageSize,count:a.total,...i,onRowClick:(g,{dataIndex:x})=>{F(u[x])}},title:e.jsx(Ze,{value:C.dateRange,onChange:fe}),customButtons:we,components:{TableFilterList:g=>e.jsx(et,{...g,itemComponent:x=>e.jsx(tt,{...x,canDelete:I=>I?.columnNames?.[I?.index||0]?.name==="sender"})})}})})}),P&&e.jsx(Qn,{refresh:Fe,onCancel:pe,notification:P,blocklet:y,tab:N}),e.jsx(St,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:h,onClose:()=>T(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(S,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(On,{})})})]})}const ns=ie.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
|
+
.custom-toobar-title-inner {
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: ${({isBreakpointsDownSm:t})=>t?"space-between":"flex-end"};
|
|
116
|
+
padding-right: ${({isBreakpointsDownSm:t})=>t?"0":"8px"};
|
|
117
|
+
flex-wrap: wrap;
|
|
118
|
+
gap: 8px;
|
|
119
|
+
}
|
|
120
|
+
`;ss.propTypes={blocklet:p.object.isRequired,customTableButtons:p.array};function ss({blocklet:t={},customTableButtons:s=[]}){return e.jsx(Ln,{blocklet:t,children:e.jsx(ts,{customTableButtons:s})})}export{ss as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as g}from"./vendor-react-Dvs43sk9.js";import{j as e,y as O,x as X,bc as G,M as J,ak as m,W as x,a6 as ke,cb as ve,b1 as Q,z as U,b6 as Te,a5 as Ae,at as P,T as E,cc as Ke,bb as Re,aX as De}from"./vendor-mui-core-
|
|
1
|
+
import{r as g}from"./vendor-react-Dvs43sk9.js";import{j as e,y as O,x as X,bc as G,M as J,ak as m,W as x,a6 as ke,cb as ve,b1 as Q,z as U,b6 as Te,a5 as Ae,at as P,T as E,cc as Ke,bb as Re,aX as De}from"./vendor-mui-core-CnXrAOs3.js";import{V as D,z as $,n as F,p as Se,b as oe,k as H,H as Ie,a2 as $e,o as Be,J as Ne,h as Ee,i as _e}from"./vendor-ux-5OlTXZBe.js";import{f as Pe}from"./index-DBs9Ljax.js";import{c as z,_ as I,o as We,aI as ze,ac as Me,ar as ie,as as ae,at as re,e as qe}from"./index-Cq3xfsOS.js";import{a as ce}from"./passport-item-BDPJusYi.js";import{u as W}from"./team-4Qq9vwj5.js";import{l as le}from"./arrow-down.svg-Uxqj9Lez.js";import{T as de}from"./index-Bnv7SivR.js";import{C as pe}from"./confirm-D_oS4C5N.js";import{R as Le,C as _}from"./vendor-utils-cJEl_UEd.js";import{u as Ue}from"./session-BYq9-2GE.js";import{C as V}from"./click-to-copy-CzGMi2Jw.js";import{f as Fe}from"./index-BojVbZw0.js";import{D as He}from"./delete-confirm-DwFvaC6s.js";import{P as Ve}from"./permission-CPpfaEat.js";import{l as M}from"./vendor-arcblock-CqplRmyi.js";import{B as Oe}from"./bundle-avatar-B9iCn_eS.js";import{W as Xe}from"./did-address-C5FXzeAS.js";import{u as me}from"./use-mobile-maRlSUwU.js";import{A as Ge}from"./actions-DqoNrBDK.js";import{T as ne}from"./table-tips-DBCvmY1v.js";import{s as Je}from"./vendor-hooks-CjESGRlR.js";import"./lottie-web-4koyQiv_.js";import"./ua-parser-DP5omx3I.js";import"./util-4xOccFjr.js";import"./base32-DB18VP05.js";import"./isURL-DmCvTfVx.js";import"./use-app-logo-9qTsLgnV.js";import"./vendor-mui-x-bJ5idfMH.js";import"./AdapterDayjs-C8RSaHa0.js";function Y({value:s}){const{t,locale:n}=D(),a=new Date;return new Date(s)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{mode:"daysLeft",value:s,locale:n,type:"all"})}Y.propTypes={value:x.string.isRequired};function Z({value:s,onChange:t,...n}){const{t:a}=D(),o=g.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(X,{children:a("setting.accessKey.authType")}),e.jsx(G,{value:s,onChange:t,fullWidth:!0,label:a("setting.accessKey.authType"),IconComponent:l=>e.jsx(le,{...l,width:20,height:20}),children:o.map(l=>e.jsx(J,{value:l.value,children:e.jsxs(m,{children:[e.jsx("span",{children:l.title}),e.jsx(m,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}Z.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const ee=()=>{const s=z.RBAC_CONFIG.roles.filter(o=>o.passport),{inService:t}=I(),{roles:n}=W(),a=[...s,...t?n:[]];return Le(a,"name").filter(o=>o.name!==z.ROLES.OWNER)};function ue(){const{session:s}=Ue(),t=ee();return g.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const a=t.filter(l=>l.name==="guest");return[...t.filter(l=>l.name!=="guest").filter(l=>s.user.passports.find(b=>b.role===l.name)),...a]},[t,s?.user?.passports,s?.user?.role])}function xe({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:a}=W(),{t:o}=D(),[l,b]=g.useState(!1),[p,j]=g.useState(null),u=ue(),K=()=>{b(!1),j(null)},w=async c=>{const{remark:C,passport:h,authType:i}=c;b(!0);const v=await n.createAccessKey({input:{teamDid:a,remark:C.trim(),passport:h,expireAt:c.expireAt?new Date(c.expireAt).getTime():null,authType:i}}),{data:R}=v;s(R),j(null),b(!1)},d={title:`${o("common.create")} ${o("accessKey")}`,description:(c,C,h)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:c.remark,onChange:i=>{C({...c,remark:i.target.value,__disableConfirm:!c.passport||!i.target.value.trim()}),i.target.value.trim()?h(""):h(o("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{sx:{width:"calc(100% - 46px)"},children:o("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"create-access-key-select-passport",value:c.passport,onChange:i=>{const v=i.target.value;h(null),C({...c,passport:v,__disableConfirm:!c.remark||!v})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:l,IconComponent:i=>e.jsx(le,{...i,width:20,height:20}),children:u.map(i=>e.jsx(J,{value:i.name,"data-cy":`create-access-key-passport-option-${i.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:i.title||i.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:i.description})]})},i.name))})]}),e.jsx(Z,{value:c.authType,onChange:i=>{C({...c,authType:i.target.value})}}),e.jsx(de,{placeholder:o("setting.accessKey.expireTime"),value:c.expireAt,onChange:i=>{C({...c,expireAt:i,__disableConfirm:!c.passport||!c.remark||!i})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:w,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>j(d),className:"rule-action",children:[l?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),o("common.create")]}),p&&e.jsx(pe,{title:p.title,description:p.description,confirm:p.confirm,color:p.color,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}xe.propTypes={remark:x.string,onCreate:x.func};function fe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:a=!0}){const{t:o}=g.useContext(Se),[l,b]=g.useState(!1),[p,j]=g.useState(()=>a),u=I(),K=()=>{j(!p)},w=h=>{b(h.target.checked)},d=_(window.location.origin,u?.info?.routing?.adminPath),c=g.useMemo(()=>a?`const Client = require('@blocklet/server-js');
|
|
2
2
|
const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
|
|
3
3
|
const { joinURL } = require('ufo');
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ const result = await client.getBlocklet(
|
|
|
16
16
|
{ input: { did: rootDid, attachRuntimeInfo: false } },
|
|
17
17
|
{ headers: { 'x-access-blocklet': rootDid } }
|
|
18
18
|
);
|
|
19
|
-
`:u.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),C=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(oe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Qe,{children:o(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(L,{children:[e.jsx(
|
|
19
|
+
`:u.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),C=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(oe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Qe,{children:o(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(L,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(V,{children:t})]}),e.jsxs(L,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),p?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:o("setting.accessKey.showSecret")}):e.jsx(V,{children:n})]}),!p&&e.jsxs(L,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(H,{code:c,language:"shell",showDefaultText:!1}),C&&e.jsx(H,{code:C,language:"shell",showDefaultText:!1})]}),a&&e.jsx("div",{children:e.jsx(Te,{value:"end",disabled:p,control:e.jsx(Ae,{checked:l,onChange:w}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}fe.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const q=P.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
align-items: center;
|
|
@@ -27,14 +27,14 @@ const result = await client.getBlocklet(
|
|
|
27
27
|
`,Qe=P.div`
|
|
28
28
|
font-size: 16px;
|
|
29
29
|
font-weight: bold;
|
|
30
|
-
`;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:o=()=>{}}){const{t:l,locale:b}=D(),{api:p}=I(),{teamDid:j}=W(),u=()=>{o()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(c){Ie.error(c?.message)}finally{u()}},w=c=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:We(c,b),timeAge:Fe(new Date(c),ze(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",w(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(He,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:o="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=D(),[K,w]=g.useState(!1),d=ue(),c=()=>{w(!1),b()},C=async i=>{const{accessKeyId:v,remark:R="",passport:f,expireAt:y,authType
|
|
30
|
+
`;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:o=()=>{}}){const{t:l,locale:b}=D(),{api:p}=I(),{teamDid:j}=W(),u=()=>{o()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(c){Ie.error(c?.message)}finally{u()}},w=c=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:We(c,b),timeAge:Fe(new Date(c),ze(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",w(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(He,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:o="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=D(),[K,w]=g.useState(!1),d=ue(),c=()=>{w(!1),b()},C=async i=>{const{accessKeyId:v,remark:R="",passport:f,expireAt:y,authType:B}=i;w(!0),await p.updateAccessKey({input:{teamDid:j,accessKeyId:v,remark:R.trim(),passport:f,expireAt:y?new Date(y).getTime():null,authType:B}}),n(),c()},h={title:`${u("common.update")} ${u("accessKey")}`,description:(i,v,R)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:u("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:i.accessKeyId,disabled:!0}),e.jsx(U,{label:u("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:i.remark,onChange:f=>{v({...i,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?R(""):R(u("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:u("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"update-access-key-select-passport",value:i.passport,onChange:f=>{const y=f.target.value;R(null),v({...i,passport:y,__disableConfirm:!i.remark||!y})},fullWidth:!0,label:u("setting.accessKey.passport"),disabled:K,children:d.map(f=>e.jsx(J,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(Z,{disabled:!0,value:i.authType,onChange:f=>{v({...i,authType:f.target.value})}}),e.jsx(de,{placeholder:u("setting.accessKey.expireTime"),value:i.expireAt,onChange:f=>{v({...i,expireAt:f,__disableConfirm:!i.passport||!i.remark||!f})}})]}),confirm:u("common.confirm"),cancel:u("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:a,expireAt:o,authType:l},onConfirm:C,onCancel:c};return e.jsx(pe,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})}ge.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function ye({accessKey:s,onCancel:t}){const{t:n}=D();return e.jsx(oe,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{sx:{maxWidth:800,"@media (max-width: 768px)":{margin:"16px",maxWidth:"calc(100vw - 32px)"}}},fullWidth:!0,children:e.jsx(Ye,{children:e.jsx(be,{accessKey:s})})})}ye.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const Ye=P(m)`
|
|
31
31
|
margin-top: -16px;
|
|
32
32
|
|
|
33
33
|
.tabs {
|
|
34
34
|
margin-left: 0;
|
|
35
35
|
margin-right: 0;
|
|
36
36
|
}
|
|
37
|
-
`;function be({accessKey:s}){const{t,locale:n}=D(),{blocklet:a}=
|
|
37
|
+
`;function be({accessKey:s}){const{t,locale:n}=D(),{blocklet:a}=Me(),o=I(),l=ee(),b=me(),p=(a?.children||[]).find(d=>d?.meta?.did===s.componentDid),j=l.find(d=>d.name===s.passport),u=j?j.title:s.passport,K=g.useMemo(()=>o.inService?`curl -H "Authorization: Bearer blocklet-${M.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${M.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,o?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,o.inService,o?.info?.routing?.adminPath]),w=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Xe,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${M.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(m,{children:ce(u,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ie,{showDid:!0,did:s.createdBy,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx($,{value:s.createdAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx($,{value:s.lastUsedAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(Y,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...p?[{label:t("setting.accessKey.component"),content:e.jsxs(m,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Oe,{blocklet:p,ancestors:[a]}),e.jsx(m,{sx:{ml:"16px",minWidth:0},children:e.jsxs(m,{className:"component-header",children:[e.jsx(m,{className:"component-name",children:qe.getDisplayName(p,!0)}),e.jsx(m,{className:"component-version",children:p?.meta?.version})]})})]},p)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:K,language:"shell",showDefaultText:!1})}:null].filter(Boolean)}];return e.jsx(Ze,{gap:3,children:e.jsx(m,{className:"info-area",children:w.map(d=>e.jsxs(m,{sx:{mb:3},children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:d.title}),e.jsx(m,{className:"info-grid",children:d.items.map(c=>e.jsxs(m,{className:"info-item",children:[e.jsx(m,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:c.label})}),e.jsx(m,{className:"info-content",sx:{flex:1,minWidth:0,"@media (max-width: 768px)":{width:"100%",flex:"none"}},children:c.content})]},c.label))})]},d.title))})})}be.propTypes={accessKey:x.object.isRequired};const Ze=P(Q)`
|
|
38
38
|
.info-card {
|
|
39
39
|
margin-bottom: 24px;
|
|
40
40
|
overflow: hidden;
|
|
@@ -147,4 +147,4 @@ const result = await client.getBlocklet(
|
|
|
147
147
|
margin: 0;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
`;function et({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:a}=D(),{api:o,inService:l}=I(),{teamDid:b}=W(),[p,j]=g.useState({}),[u,K]=g.useState(null),[w,d]=g.useState(null),[c,C]=g.useState(null),h=me(),i=ee(),v=g.useRef(null),R=`access-keys-${b}`,f
|
|
150
|
+
`;function et({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:a}=D(),{api:o,inService:l}=I(),{teamDid:b}=W(),[p,j]=g.useState({}),[u,K]=g.useState(null),[w,d]=g.useState(null),[c,C]=g.useState(null),h=me(),i=ee(),v=g.useRef(null),R=`access-keys-${b}`,f=$e(R),[y,B]=g.useState({searchText:f.searchText||"",pageSize:f.rowsPerPage||10,page:1}),S=Je(async()=>{const r={teamDid:b,paging:{page:y.page,pageSize:y.pageSize}};return y.searchText&&(r.remark=y.searchText),await o.getAccessKeys({input:r})},[y.page,y.pageSize,y.searchText]),{loading:je,error:te}=S,N=g.useMemo(()=>S.value?.list||[],[S.value?.list]),se=g.useMemo(()=>s?["accessKeyId","createdVia","createdBy","createdBy"]:[],[s]),we=g.useMemo(()=>[{label:n("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{className:"remark",sx:Be({display:"flex",alignItems:"center",gap:2},t),children:e.jsx(E,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(m,{sx:t,children:e.jsx(Ne,{showDidLogo:!1,children:r})})}},{label:n("common.role"),name:"passport",options:{customBodyRender:r=>{const T=i.find(k=>k.name===r),A=T?T.title:r;return e.jsx(m,{sx:t,children:ce(A,r)})}}},{label:n("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(E,{sx:t,children:r})}},{label:n("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(E,{sx:t,children:n(`setting.accessKey.${r}`)})}},{label:n("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(m,{sx:t,children:r?e.jsx($,{value:r,locale:a}):"-"})}},{label:n("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(m,{sx:t,children:r?e.jsx($,{value:r,locale:a}):"-"})}},{label:n("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>e.jsx(m,{className:"expired-at",sx:t,children:r?e.jsx(Y,{value:r}):n("common.neverExpired")})}},{label:n("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:r=>e.jsx(m,{sx:t,children:r?e.jsx(ie,{showDid:!0,did:r,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0,...h&&{minWidth:"unset"}}}):"-"})}},{label:n("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(r,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{sx:t,children:e.jsx(Ge,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(Ke,{}),text:n("common.edit"),onClick:k=>{k.stopPropagation(),C(A)}},{icon:e.jsx(Re,{}),text:n("common.delete"),onClick:k=>{k.stopPropagation(),d(A)}}]})})}}}].filter(r=>!se.includes(r.name)),[N,a,n,i,d,C,t,h,se]),Ce=({page:r,rowsPerPage:T,searchText:A})=>{y.pageSize!==T?B(k=>({...k,pageSize:T,page:1})):y.page!==r+1?B(k=>({...k,searchText:A,page:r+1})):y.searchText!==A&&B(k=>({...k,searchText:A,page:1}))};return te?e.jsx(De,{severity:"error",children:Pe(te)}):e.jsxs(m,{ref:v,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[h?e.jsx(ne,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}):null,e.jsx(Ee,{durable:R,durableKeys:["page","rowsPerPage","searchText"],data:N,locale:a,columns:we,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:y.page-1,rowsPerPage:y.pageSize,count:S.value?.paging?.total||0,searchText:y.searchText,searchDebounceTime:600,onRowClick(r,{dataIndex:T},A){if(v.current?.contains(A.target)){const k=N[T];K(k)}}},loading:je,onChange:Ce,title:h?null:e.jsx(ne,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}),customButtons:[e.jsx(Ve,{permission:l?"":"mutate_accessKey",children:e.jsx(xe,{onCreate:r=>{const{accessKeyId:T,accessKeySecret:A,authType:k}=r;j({show:!0,accessKeyId:T,accessKeySecret:A,authType:k})}})})],emptyNode:e.jsx(_e,{children:n("oauth.client.empty")})}),p.show&&e.jsx(fe,{hideSecret:p.authType==="signature",onConfirm:()=>{S.retry(),j({show:!1})},...p}),u&&e.jsx(ye,{onCancel:()=>K(null),accessKey:u}),w&&e.jsx(he,{accessKeyId:w.accessKeyId,time:w.lastUsedAt,remark:w.remark||"N/A",onDelete:S.retry,onClose:()=>d(null)}),c&&e.jsx(ge,{...c,onUpdate:S.retry,onClose:()=>C(null)})]})}et.propTypes={isSelf:x.bool,columnSx:x.object};export{et as default};
|