@abtnode/blocklet-services 1.16.43-beta-20250427-232837-e671de06 → 1.16.43-beta-20250430-124448-4edc5502
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/emails/_components/layout.js +2 -2
- package/api/emails/_libs/style.js +8 -3
- package/api/emails/_templates/kyc-code-verify.js +43 -0
- package/api/emails/_templates/new-user-session.js +2 -6
- package/api/emails/_templates/notification.js +2 -6
- package/api/emails/_templates/verify-code-body.js +4 -1
- package/api/emails/_templates/verify-code.js +2 -6
- package/api/index.js +31 -2
- package/api/libs/connect/session.js +4 -2
- package/api/libs/email.js +16 -0
- package/api/middlewares/ensure-blocklet.js +1 -1
- package/api/routes/blocklet.js +26 -17
- package/api/routes/ocap.js +1 -1
- package/api/routes/user-session.js +4 -2
- package/api/routes/user.js +1 -1
- package/api/services/auth/session.js +15 -10
- package/api/services/kyc/index.js +5 -11
- package/dist/assets/{AdapterDayjs-BUGplkxR.js → AdapterDayjs-BWhMsmQP.js} +1 -1
- package/dist/assets/{ArrowDropDown-B0sLkJoY.js → ArrowDropDown-DUCtp8oo.js} +1 -1
- package/dist/assets/{CheckCircle-BNrN9mgy.js → CheckCircle-yKW43XdV.js} +1 -1
- package/dist/assets/{ChevronLeft-Dq00IS01.js → ChevronLeft-6AvuBihM.js} +1 -1
- package/dist/assets/{ChevronRight-ZTqWK-Ga.js → ChevronRight-BsdsjNxw.js} +1 -1
- package/dist/assets/{Community-DZCTPNMP.js → Community-DathqRsd.js} +1 -1
- package/dist/assets/{DeleteOutline-C2sY6hfm.js → DeleteOutline-D_I07sPe.js} +1 -1
- package/dist/assets/{Done-JLiLhELm.js → Done-DLTvHdZB.js} +1 -1
- package/dist/assets/{Download-Ch4RfGRW.js → Download-DKz_gZX5.js} +1 -1
- package/dist/assets/{Edit-CY6fFHQM.js → Edit-odNPT5GK.js} +1 -1
- package/dist/assets/{EditIcon-Bi2cR-_u.js → EditIcon-DWRQ3fi6.js} +1 -1
- package/dist/assets/{Email-Dz2Eyqu0.js → Email-B0n6rLUZ.js} +1 -1
- package/dist/assets/{Error-CSFUqG0m.js → Error-js7ePZ5o.js} +1 -1
- package/dist/assets/{ExpandLess-BiMmSOBl.js → ExpandLess-TUium4RQ.js} +1 -1
- package/dist/assets/{Google-GOp5YvmZ.js → Google-C7d25Q5r.js} +1 -1
- package/dist/assets/{Holiday-Lc6woG1j.js → Holiday-BkY6LMfd.js} +1 -1
- package/dist/assets/{InfoOutlined-CQB5qKm-.js → InfoOutlined-BjII93aR.js} +1 -1
- package/dist/assets/{Launch-fxgQvk19.js → Launch-ryL3I8d9.js} +1 -1
- package/dist/assets/{LaunchOutlined-BV4_W1pb.js → LaunchOutlined-D21Xchdf.js} +1 -1
- package/dist/assets/{Location-B8EOY3d0.js → Location-BQhEvGNL.js} +1 -1
- package/dist/assets/{LockIcon-fuTfhB_G.js → LockIcon-Bd69pSJI.js} +1 -1
- package/dist/assets/{Meeting-Epdyx36z.js → Meeting-BW-_XtSL.js} +1 -1
- package/dist/assets/{MoreHoriz-CX_pwfPT.js → MoreHoriz-DHyMdwpT.js} +1 -1
- package/dist/assets/{OffSick-VYgugWxu.js → OffSick-9I8vBA8l.js} +1 -1
- package/dist/assets/{Phone-KP65huHK.js → Phone-CKzC4712.js} +1 -1
- package/dist/assets/{PlayArrow-DFH1Psjx.js → PlayArrow-zDVVYX6u.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-p6m3avKp.js → QuestionMarkCircle-DpFFQWud.js} +1 -1
- package/dist/assets/{ServerLogo-Bssx1Eou.js → ServerLogo-AfxVBRdi.js} +1 -1
- package/dist/assets/{Timezone-Ce4E1Xey.js → Timezone-C3hiNX6j.js} +1 -1
- package/dist/assets/{TuneOutlined-Dy2qPFGI.js → TuneOutlined-Bv7cSbWT.js} +1 -1
- package/dist/assets/{ViewList-e3CoNi3K.js → ViewList-Ca1IEB31.js} +1 -1
- package/dist/assets/{WorkingRemotely-CXFJ6pz8.js → WorkingRemotely-CHzRY2CT.js} +1 -1
- package/dist/assets/access-control-CwSjARsN.js +14 -0
- package/dist/assets/{actions-DA-6s_nQ.js → actions-BW0Vx00_.js} +1 -1
- package/dist/assets/{add-component-core-DG9mQFsr.js → add-component-core-DXp_ntZ3.js} +43 -37
- package/dist/assets/add-resource-CmPIp37F.js +1 -0
- package/dist/assets/{addon-Bcc-Xwbf.js → addon-FArG2oUy.js} +1 -1
- package/dist/assets/{advanced-DTe2fs5L.js → advanced-mJXTlRFz.js} +2 -2
- package/dist/assets/api-Bf1onQOz.js +1 -0
- package/dist/assets/appearance-D9WrcbPF.js +1 -0
- package/dist/assets/ar-BRKjvO8p.js +1 -0
- package/dist/assets/ar-Duy7ZH--.js +7 -0
- package/dist/assets/audit-logs-CVUuBgdy.js +35 -0
- package/dist/assets/{authorize-DUyL7MEU.js → authorize-Bk0sIDAH.js} +1 -1
- package/dist/assets/{base32-p9VcJrwv.js → base32-C_EKY5vU.js} +1 -1
- package/dist/assets/{branding-_VO2ZZ3t.js → branding-BoSHL25b.js} +2 -2
- package/dist/assets/branding-Cywl-fod.js +54 -0
- package/dist/assets/bundle-avatar-BXQsJw7m.js +1 -0
- package/dist/assets/button-h00yLUET.js +1 -0
- package/dist/assets/{click-to-copy-BGyXQL2i.js → click-to-copy-0s0a7Ak5.js} +1 -1
- package/dist/assets/cloneDeep-WT_kDeVd.js +1 -0
- package/dist/assets/complete--raviZZ4.js +45 -0
- package/dist/assets/{component-5gjaNHCg.js → component-C3maTG8x.js} +82 -75
- package/dist/assets/config-Die5cVWR.js +32 -0
- package/dist/assets/{config-Bh19ZUJ-.js → config-e3P85n7z.js} +1 -1
- package/dist/assets/{config-navigation-Dvjz9nAh.js → config-navigation-DhvlW96p.js} +6 -6
- package/dist/assets/config-space-CHI2AzS5.js +1 -0
- package/dist/assets/{confirm-DqvNmeoz.js → confirm-BqrhdaU7.js} +2 -2
- package/dist/assets/connect-DGOqnhoS.js +5 -0
- package/dist/assets/connect-cpTXz6hq.js +1 -0
- package/dist/assets/connect-to-C1xSYa-8.js +1 -0
- package/dist/assets/{content-layout-BPaAeaMQ.js → content-layout-C3Yd4mK9.js} +1 -1
- package/dist/assets/dashboard-CvJ8cVy-.js +280 -0
- package/dist/assets/de-D3cg0t9f.js +1 -0
- package/dist/assets/de-jJ-wrtW1.js +7 -0
- package/dist/assets/{delete-confirm-_BzUlhv2.js → delete-confirm-CmXluMcs.js} +1 -1
- package/dist/assets/did-address-C6ni99I7.js +1 -0
- package/dist/assets/{domain-ag7_Ivc1.js → domain-B7m2mZGp.js} +1 -1
- package/dist/assets/domain-action-card-DIGUxqW7.js +24 -0
- package/dist/assets/domains-DV-Gl3-a.js +1 -0
- package/dist/assets/{dot-BE1YP292.js → dot-WAAJ-O65.js} +2 -2
- package/dist/assets/{email-DKpgximx.js → email-CxndZMem.js} +2 -2
- package/dist/assets/{empty-spinner-DmDm8XzF.js → empty-spinner-BYUFR95o.js} +1 -1
- package/dist/assets/es-CoGP0eAj.js +7 -0
- package/dist/assets/es-DPjqApVE.js +1 -0
- package/dist/assets/exchange-passport-JjK-mItt.js +1 -0
- package/dist/assets/fr-Dscs9WsP.js +1 -0
- package/dist/assets/fr-yctlgsrj.js +7 -0
- package/dist/assets/{fuel-CcBzY6Bt.js → fuel-bktBZZhG.js} +1 -1
- package/dist/assets/{gen-access-key-DxKwgiGT.js → gen-access-key-CPCwDcVa.js} +1 -1
- package/dist/assets/get-safe-url-C-CJKtkC.js +1 -0
- package/dist/assets/get-safe-url-cyoeQ7Mw.js +1 -0
- package/dist/assets/hi-B8D3j6bs.js +1 -0
- package/dist/assets/hi-Dh_pGPBD.js +5 -0
- package/dist/assets/{home-Bi8fA3jh.js → home-BclSkhw2.js} +1 -1
- package/dist/assets/{id-BderyGO5.js → id-DWMMQI0G.js} +1 -1
- package/dist/assets/id-cicarMJv.js +7 -0
- package/dist/assets/{iframe-DZ181i8X.js → iframe-DZlnwo40.js} +1 -1
- package/dist/assets/{index-CYeIiQ6Q.js → index--MMFwLMX.js} +1 -1
- package/dist/assets/index-17ov_POl.js +345 -0
- package/dist/assets/index-BAstW3VS.js +137 -0
- package/dist/assets/{index-BT0GBmWF.js → index-BUHlfcy3.js} +1 -1
- package/dist/assets/{index-DyxFC42L.js → index-Bdi900W2.js} +3 -3
- package/dist/assets/index-BhX4Vx5B.js +192 -0
- package/dist/assets/{index-SDdS_qt8.js → index-Bt7GP-dU.js} +1 -1
- package/dist/assets/index-BugTfB-J.js +288 -0
- package/dist/assets/index-C-rU1lEd.js +10 -0
- package/dist/assets/index-C0x4zVBW.js +55 -0
- package/dist/assets/index-C4pzdyRW.js +1 -0
- package/dist/assets/index-C8EYAWok.js +113 -0
- package/dist/assets/index-CLD6I2fv.js +6 -0
- package/dist/assets/{index-CHbpkZwO.js → index-CMFOn8T3.js} +1 -1
- package/dist/assets/index-COTyGW2s.js +4 -0
- package/dist/assets/index-CiIQJxvH.js +1 -0
- package/dist/assets/index-CksPySYI.js +701 -0
- package/dist/assets/{index-DKhrYmrN.js → index-DIe9psLc.js} +1 -1
- package/dist/assets/{index-n0Q-fETi.js → index-DJeuTVoT.js} +7 -7
- package/dist/assets/{index-YbJjfDTR.js → index-DODYa3Im.js} +1 -1
- package/dist/assets/{index-B1ljmpu4.css → index-DOq-_YXu.css} +1 -1
- package/dist/assets/{index-CGBZONPv.js → index-D_z5kVUS.js} +1 -1
- package/dist/assets/{index-Dl4W1N74.js → index-DdLPuFP7.js} +1 -1
- package/dist/assets/index-DxR1P6Lh.js +241 -0
- package/dist/assets/index-htPha6tP.js +11 -0
- package/dist/assets/{invitation-BrAZQXQL.js → invitation-sucipANy.js} +8 -8
- package/dist/assets/invite-Bkpf8YcY.js +1 -0
- package/dist/assets/{issue-passport-Dd_yyO08.js → issue-passport-Dm4XKvqR.js} +1 -1
- package/dist/assets/item-CCsztPdL.js +2 -0
- package/dist/assets/ja-3LoBq68U.js +1 -0
- package/dist/assets/ja-Bm56AvcM.js +7 -0
- package/dist/assets/ko-B0ZZ2RWO.js +7 -0
- package/dist/assets/ko-B2dxwXDl.js +1 -0
- package/dist/assets/landing-page-BJMRDSCP.js +1 -0
- package/dist/assets/{launch-result-message-C9huWJUf.js → launch-result-message-B_fS-f90.js} +1 -1
- package/dist/assets/{layout-Cw-hwCHs.js → layout-DV03YuuA.js} +1 -1
- package/dist/assets/list-BgP6u-5j.js +236 -0
- package/dist/assets/list-header-8k1_C0K0.js +1 -0
- package/dist/assets/localization-CTzQFuMS.js +1 -0
- package/dist/assets/{log-Chqr_or_.js → log-B4LRFTNR.js} +1 -1
- package/dist/assets/{logger-zix81YaM.js → logger-8RyN9oiF.js} +1 -1
- package/dist/assets/login-B6TE3gqj.js +1 -0
- package/dist/assets/login-oauth-callback-CPP0UVME.js +1 -0
- package/dist/assets/logo-uploader-DMxsEq63.js +133 -0
- package/dist/assets/{lost-passport-Do1Pl0xI.js → lost-passport-ekwdQ24A.js} +2 -2
- package/dist/assets/lottie-error-CMOXHtBH.js +1 -0
- package/dist/assets/lottie-loading-o-GBrhM9.js +1 -0
- package/dist/assets/lottie-welcome-C9B95FIi.js +1 -0
- package/dist/assets/omit-DNeUY6_X.js +1 -0
- package/dist/assets/{open-window-D8MZhu_7.js → open-window-BjXpEOv2.js} +1 -1
- package/dist/assets/{overview-DLA9wj6a.js → overview-CJRHh92f.js} +2 -2
- package/dist/assets/{page-header-CWY8mxlT.js → page-header-MKUHlyAT.js} +1 -1
- package/dist/assets/{passport-item-CWtlyIE_.js → passport-item-jrknj0MQ.js} +1 -1
- package/dist/assets/{permission-BGM09622.js → permission-PNXSTeNL.js} +1 -1
- package/dist/assets/preferences-9BJlt30G.js +1 -0
- package/dist/assets/profile-embed-CIWdUuC6.js +1 -0
- package/dist/assets/pt-6Xqu-_a4.js +5 -0
- package/dist/assets/pt-eei1_Z4R.js +1 -0
- package/dist/assets/publish-resource-BQg2Vwb0.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-ByydTUk4.js → react-beautiful-dnd.esm-C1Wt0pHO.js} +1 -1
- package/dist/assets/relative-time-cijkMMnc.js +1 -0
- package/dist/assets/ru-ZKgT6XdU.js +1 -0
- package/dist/assets/ru-y0N1jyVB.js +5 -0
- package/dist/assets/runtime-71FSw-R0.js +1 -0
- package/dist/assets/sdk-BXECCi1q.js +1 -0
- package/dist/assets/{security-BhkfG23R.js → security-Y5seZEn6.js} +4 -4
- package/dist/assets/session-DLQ0rbYE.js +1 -0
- package/dist/assets/setup-4hj9RPfM.js +30 -0
- package/dist/assets/{shorten-label-DFzv9EKX.js → shorten-label-SbKUBkvs.js} +1 -1
- package/dist/assets/{simple-select-DlrdVbaI.js → simple-select-CLc0Q9sm.js} +1 -1
- package/dist/assets/{slicedToArray-CPl5_eGD.js → slicedToArray-C0YDCVwK.js} +2 -2
- package/dist/assets/{spaces-WkJCApHO.js → spaces-CP1iyRKS.js} +1 -1
- package/dist/assets/start-Bt5Vo3K8.js +187 -0
- package/dist/assets/starting-progress-yIv14mT6.js +40 -0
- package/dist/assets/{status-CygZ0LuY.js → status-BKlS-OSq.js} +1 -1
- package/dist/assets/{step-actions-D_1PFeFs.js → step-actions-DMwF4axn.js} +1 -1
- package/dist/assets/{studio-Byjzwg8q.js → studio-BR3c6nt5.js} +1 -1
- package/dist/assets/{switch-control-5fEOPVKs.js → switch-control-yJOWKqcv.js} +1 -1
- package/dist/assets/th-CG5eLRZo.js +1 -0
- package/dist/assets/th-CJa7646q.js +5 -0
- package/dist/assets/{traffic-T11hxc--.js → traffic-BzRbyLJ-.js} +1 -1
- package/dist/assets/{transfer-ROpxn9LD.js → transfer-Ds9NQ12A.js} +1 -1
- package/dist/assets/unsubscribe-hfXD8-ea.js +1 -0
- package/dist/assets/use-blocklet-logo-BOYeM9RY.js +1 -0
- package/dist/assets/{use-mobile-C_flBrm-.js → use-mobile-BKvZ6hcv.js} +1 -1
- package/dist/assets/{use-mobile-DlKplWTG.js → use-mobile-BNUwcWCH.js} +1 -1
- package/dist/assets/{useAsync-CGW40D2-.js → useAsync-GjVghrwi.js} +1 -1
- package/dist/assets/{useLocalStorage-DldnaMbZ.js → useLocalStorage-CXDkfohf.js} +1 -1
- package/dist/assets/user-center-CBh-mxjZ.js +76 -0
- package/dist/assets/util-D-LnEy9h.js +1 -0
- package/dist/assets/{util-Bjy-tP7q.js → util-DJFgW-07.js} +1 -1
- package/dist/assets/{vendor-arcblock-ScFEr-lj.js → vendor-arcblock-Dkhgjlzn.js} +100 -97
- package/dist/assets/vendor-hooks-DXGUREV9.js +7 -0
- package/dist/assets/vendor-mui-core-B6POpIBB.js +266 -0
- package/dist/assets/{vendor-mui-x-B0hsmEJ3.js → vendor-mui-x-CATHW1QL.js} +1 -1
- package/dist/assets/{vendor-utils-BNHJB5U7.js → vendor-utils-CjMBJT5V.js} +17 -17
- package/dist/assets/vendor-ux-did-connect-D4-ZeZHm.js +2292 -0
- package/dist/assets/vi-CoZs3B42.js +1 -0
- package/dist/assets/vi-Rc5fwdQU.js +5 -0
- package/dist/assets/wrap-locale-Dob_mf2V.js +1 -0
- package/dist/assets/zh-CgkeS2I3.js +1 -0
- package/dist/assets/{zh-BYRCoK6F.js → zh-J32RyrWT.js} +2 -2
- package/dist/assets/zh-tw-BSUxp5LQ.js +7 -0
- package/dist/assets/zh-tw-CuakNRcW.js +1 -0
- package/dist/index.html +7 -7
- package/dist/service-worker.js +2 -2
- package/dist/share/shared-bridge.html +85 -0
- package/package.json +46 -46
- package/dist/assets/access-control-B20P1UrY.js +0 -14
- package/dist/assets/add-resource-BoS5YkVy.js +0 -1
- package/dist/assets/api-BrU7j0QA.js +0 -1
- package/dist/assets/appearance-DYi32tlk.js +0 -1
- package/dist/assets/ar-CmhpkjwX.js +0 -1
- package/dist/assets/ar-DupP3pla.js +0 -7
- package/dist/assets/audit-logs-CydL26ZC.js +0 -35
- package/dist/assets/branding-CAMtNLMU.js +0 -54
- package/dist/assets/bundle-avatar-D0t7RLGx.js +0 -1
- package/dist/assets/button-BeZibzB9.js +0 -1
- package/dist/assets/cloneDeep-SfcdeqEN.js +0 -1
- package/dist/assets/complete-BzCBoyhn.js +0 -45
- package/dist/assets/config-1xq1_d84.js +0 -32
- package/dist/assets/config-space-CYg-72ab.js +0 -1
- package/dist/assets/connect-Bbc2y5nS.js +0 -1
- package/dist/assets/connect-DM2xKEWk.js +0 -5
- package/dist/assets/connect-to-Ck5O2M1K.js +0 -1
- package/dist/assets/dashboard-8QXGSoVu.js +0 -280
- package/dist/assets/de-Doy9B4I7.js +0 -1
- package/dist/assets/de-TcDcBkI0.js +0 -7
- package/dist/assets/did-address-DUThaBlf.js +0 -1
- package/dist/assets/domain-action-card-D3w6jyPR.js +0 -24
- package/dist/assets/domains-BDxEOJh6.js +0 -1
- package/dist/assets/es-CDD0y3ur.js +0 -7
- package/dist/assets/es-CruF8tDk.js +0 -1
- package/dist/assets/exchange-passport-Izkf8qpM.js +0 -1
- package/dist/assets/fr-Bajh_D8H.js +0 -1
- package/dist/assets/fr-zYSSKlBw.js +0 -7
- package/dist/assets/get-safe-url-Bq9SFfX6.js +0 -1
- package/dist/assets/get-safe-url-DBsPGn--.js +0 -1
- package/dist/assets/hi-BsP-0YrU.js +0 -5
- package/dist/assets/hi-DOsApYK0.js +0 -1
- package/dist/assets/id-CY2FWdMB.js +0 -7
- package/dist/assets/index-B2yOcqTl.js +0 -192
- package/dist/assets/index-BGgGfqEc.js +0 -346
- package/dist/assets/index-B_vrglsK.js +0 -10
- package/dist/assets/index-BnmeT4Bk.js +0 -113
- package/dist/assets/index-C8QMe2NL.js +0 -138
- package/dist/assets/index-Cjjg2_Xp.js +0 -11
- package/dist/assets/index-DNG6b9sp.js +0 -224
- package/dist/assets/index-DO3_1y-L.js +0 -708
- package/dist/assets/index-DO4cSlUf.js +0 -290
- package/dist/assets/index-DcBUShKK.js +0 -1
- package/dist/assets/index-DuH8q5ir.js +0 -1
- package/dist/assets/index-EnQ254k3.js +0 -6
- package/dist/assets/index-bb90BUf4.js +0 -55
- package/dist/assets/index-mDKG4SiY.js +0 -1
- package/dist/assets/index-slEV_y-C.js +0 -4
- package/dist/assets/invite-Cbz8B2uW.js +0 -1
- package/dist/assets/item-nK3D7WH5.js +0 -2
- package/dist/assets/ja-99RIjwwl.js +0 -1
- package/dist/assets/ja-BLPXqHM4.js +0 -7
- package/dist/assets/ko-8oFi6wHH.js +0 -1
- package/dist/assets/ko-Cxgk34co.js +0 -7
- package/dist/assets/landing-page-BMM_oJb1.js +0 -1
- package/dist/assets/list-Dmtz4mRb.js +0 -235
- package/dist/assets/list-header-CgF1S4js.js +0 -1
- package/dist/assets/localization-DATb3Y_j.js +0 -1
- package/dist/assets/login-DjB23H9M.js +0 -1
- package/dist/assets/login-oauth-callback-ILeP59KT.js +0 -1
- package/dist/assets/logo-uploader-CJrdpVcQ.js +0 -133
- package/dist/assets/omit-bLid3PKQ.js +0 -1
- package/dist/assets/preferences-DYdbb0kG.js +0 -1
- package/dist/assets/profile-embed-CeEMHxEc.js +0 -1
- package/dist/assets/pt-BINIHul4.js +0 -5
- package/dist/assets/pt-ChXuTrrd.js +0 -1
- package/dist/assets/publish-resource-BEc_A5mC.js +0 -1
- package/dist/assets/relative-time-Djw-K4Zu.js +0 -1
- package/dist/assets/ru-BifF7u-P.js +0 -5
- package/dist/assets/ru-IkTTTY0K.js +0 -1
- package/dist/assets/runtime-DXl0lfXF.js +0 -1
- package/dist/assets/sdk-CTe6rL6c.js +0 -1
- package/dist/assets/session-VIMbdc9j.js +0 -1
- package/dist/assets/setup-BmYxTt6Z.js +0 -25
- package/dist/assets/start-CVexuuAk.js +0 -187
- package/dist/assets/th-CBxM23U5.js +0 -5
- package/dist/assets/th-OF8xr--T.js +0 -1
- package/dist/assets/unsubscribe-Cd3XOnSp.js +0 -1
- package/dist/assets/use-app-logo-B8Kl9EZt.js +0 -1
- package/dist/assets/user-center-CzyCbtWm.js +0 -77
- package/dist/assets/util-Dw9Eiuko.js +0 -1
- package/dist/assets/vendor-hooks-DftG_2gV.js +0 -7
- package/dist/assets/vendor-mui-core-CQ38ohp2.js +0 -266
- package/dist/assets/vendor-ux-did-connect-BdkhddhO.js +0 -2265
- package/dist/assets/vi-DCBJBc4G.js +0 -1
- package/dist/assets/vi-DY_Y13jR.js +0 -5
- package/dist/assets/wrap-locale-DMTYAE64.js +0 -1
- package/dist/assets/zh-BRAYg0sY.js +0 -1
- package/dist/assets/zh-tw-BG0rlH8p.js +0 -7
- package/dist/assets/zh-tw-D5-DkgwC.js +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{j as n,a9 as f,ac as z,bU as W,T as p,ag as E,bb as P,e as H,w as L}from"./vendor-mui-core-CQ38ohp2.js";import{r as x}from"./vendor-react-DEoibe3W.js";import{h as K,f as V,aJ as X,X as D,W as Z,I as G,K as U}from"./vendor-ux-did-connect-BdkhddhO.js";import{f as v,u as J}from"./vendor-hooks-DftG_2gV.js";import{ag as R,y as q,X as Q}from"./vendor-utils-BNHJB5U7.js";import{C as Y,w as B,x as ee}from"./vendor-arcblock-ScFEr-lj.js";import re from"./Phone-KP65huHK.js";import ne from"./Location-B8EOY3d0.js";import te from"./Email-Dz2Eyqu0.js";import M from"./Timezone-Ce4E1Xey.js";let j=function(e){return e.AvatarOnly="AvatarOnly",e.Detailed="Detailed",e}({}),S=function(e){return e.NameOnly="NameOnly",e.Minimal="Minimal",e.Basic="Basic",e}({}),k=null;try{k=new K}catch(e){console.error("Failed to initialize BlockletSDK:",e),k=null}function ie(e){if(!e)return null;let r="";return e.fullName?r=e.fullName.charAt(0).toUpperCase():e.email?r=e.email.split("@")[0].charAt(0).toUpperCase():r=e.did?e.did.charAt(0).toUpperCase():"?",r}function ae(e){if(!e||typeof e!="string")return!1;try{const r=V.toTypeInfo(e);return r.role!==void 0&&r.role!==X.types.RoleType.ROLE_APPLICATION}catch(r){return console.error("Failed to check if did is user did:",r),!1}}async function oe(e){if(!k)return null;try{return await k.user.getUserPublicInfo({did:e})}catch(r){return console.error("Failed to get user by did:",r),null}}const $=(e,r=48,i=void 0,t=void 0,o=!1)=>{const a=s=>{t==null||t(e,s)};if(!e.avatar){const s=ie(e);return n.jsx(D,{size:r,did:e.did,variant:"circle",onClick:a,sx:{fontSize:r*.4,cursor:o||t?"pointer":"default"},...i||{},children:s})}return n.jsx(D,{size:r,did:e.did,variant:"circle",style:{cursor:o||t?"pointer":"default"},onClick:a,src:e.avatar,alt:e.fullName||"",...i||{}})},le=(e,r=120)=>e?n.jsx(f,{sx:{maxWidth:r},className:"user-card__top-right-content",children:e()}):null;function F({user:e,avatarSize:r,shouldShowHoverCard:i,renderCardContent:t,tooltipTitle:o,tooltipProps:a,avatarProps:s,onAvatarClick:m}){const h=n.jsx(f,{display:"inline-block",children:$(e,r,s,m,i||!!o)});return o?n.jsx(z,{enterDelay:200,title:o,placement:"bottom",...a??{},children:h}):i?n.jsx(z,{enterDelay:200,title:t?t():null,placement:"bottom",arrow:!1,TransitionComponent:W,PopperProps:{sx:{"& .MuiTooltip-tooltip":{backgroundColor:"transparent",p:0,maxWidth:500,zIndex:1e3}}},...a??{},children:h}):h}function se(e){const{user:r,infoType:i,avatarSize:t=48,shouldShowHoverCard:o=!1,renderCardContent:a,...s}=e;return i===S.NameOnly?n.jsx(F,{user:r,avatarSize:t,shouldShowHoverCard:!1,renderCardContent:a,tooltipTitle:r.fullName||r.email||r.did,...s}):n.jsx(F,{user:r,avatarSize:t,shouldShowHoverCard:o,renderCardContent:a,...s})}function ce(e){const{user:r,avatarSize:i=48,onAvatarClick:t}=e;return n.jsxs(n.Fragment,{children:[$(r,i,e.avatarProps,t),n.jsx(p,{variant:"body1",children:r.fullName||r.email||r.did})]})}function de(e,r=10){return e?e.length<=r?e:`${e.slice(0,r-1)}...${e.slice(-2)}`:""}function ue({children:e,maxLength:r=10,sx:i=void 0,hiddenTip:t=!1}){const o=x.useMemo(()=>de(e,r),[e,r]);return(e==null?void 0:e.length)<=r?n.jsx(p,{sx:i,children:e}):t?n.jsx(p,{sx:i,children:o}):n.jsx(z,{title:e,placement:"top",children:n.jsx(p,{sx:i,children:o})})}function fe(e){const{user:r,showDid:i,didProps:t,avatarSize:o,shouldShowHoverCard:a,renderCardContent:s,renderTopRightContent:m,topRightMaxWidth:h,avatarProps:b,shortenLabelProps:C,renderName:g,...w}=e;return n.jsxs(f,{display:"flex",justifyContent:"space-between",alignItems:"center",className:"user-card__avatar-content",children:[n.jsxs(f,{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2,flex:1,minWidth:0,children:[n.jsx(F,{user:r,avatarSize:o,shouldShowHoverCard:a,renderCardContent:s,avatarProps:b,...w}),n.jsxs(f,{children:[n.jsx(p,{variant:"subtitle1",fontWeight:500,color:"text.primary",className:"user-card__full-name-label",fontSize:18,noWrap:!0,sx:{lineHeight:1.1},children:g?g(r):n.jsx(ue,{sx:{fontWeight:500},...C,children:r.fullName||r.email||r.did})}),i&&r.did?n.jsx(Z,{did:r.did,size:14,copyable:!0,compact:!0,locale:"en",sx:{lineHeight:1.5},...t??{}}):null]})]}),le(m,h)]})}const me=x.memo(fe),he={timezone:M,email:te,phone:re,location:ne,link:B};function xe(e){return Q(e)}const N={width:16,height:16};function pe({value:e}){return n.jsxs(f,{display:"flex",alignItems:"center",gap:1,className:"user-card__timezone-field",children:[n.jsx(M,{...N}),n.jsx(Y,{value:e,variant:"body2",color:"grey.800"})]})}function ye({value:e}){const[r,i]=x.useState(!1),t=v(()=>{try{const a=new URL(e);return q(a.origin,"favicon.ico")}catch{return""}},[e]),o=()=>{i(!0)};return n.jsxs(f,{display:"flex",alignItems:"center",gap:1,className:"user-card__link-field",children:[t&&!r?n.jsx("img",{src:t,alt:"site icon",style:{width:16,height:16,objectFit:"contain"},onError:o}):n.jsx(B,{...N}),n.jsx(_,{variant:"body2",color:"grey.800",children:n.jsx(p,{component:"a",href:e,style:{textDecoration:"none",color:"inherit",fontSize:"inherit"},target:"_blank",variant:"body2",color:"grey.800",rel:"noopener noreferrer",children:xe(e)})})]})}function O({field:e,value:r,children:i}){const t=he[e];return n.jsxs(f,{display:"flex",alignItems:"center",gap:1,className:`user-card__${e}-field`,children:[t?n.jsx(t,{...N}):n.jsx(G,{icon:ee,...N}),n.jsx(_,{variant:"body2",color:"grey.800",children:i??r})]},e)}function je({user:e,isFull:r=!1,renderFields:i}){var I;const t=v(()=>i??["bio","email","phone","location","timezone","link"],[i]),o=v(()=>t.includes("bio"),[t]),a=v(()=>e.metadata??{joinedAt:e==null?void 0:e.createdAt,email:e==null?void 0:e.email,phone:{country:"cn",phoneNumber:(e==null?void 0:e.phone)??""}},[e]),s=v(()=>e.address,[e.address]),m=x.useCallback(l=>{var u,c,d;if(!l)return"";switch(l){case"bio":return((u=e.metadata)==null?void 0:u.bio)||"";case"email":return a.email||e.email||"";case"phone":return((c=a.phone)==null?void 0:c.phoneNumber)||e.phone||"";case"location":return(s==null?void 0:s.city)||a.location||"";case"timezone":return a.timezone||"";case"link":return((d=a.links)==null?void 0:d.map(y=>y.url).filter(Boolean))||[];default:return e[l]||""}},[e,a,s]),{effectiveRenderCount:h}=x.useMemo(()=>{const l=t.filter(c=>{if(c==="bio")return!1;const d=m(c);return d==null||d===""?!1:R(d)?d.length>0:String(d).trim().length>0}),u=l.reduce((c,d)=>{const y=m(d);return c+(Array.isArray(y)?y.filter(A=>A&&String(A).trim()).length:1)},0);return{visibleFields:l,effectiveRenderCount:u}},[t,m]),b=h>4,C=J(l=>l!=null&&String(l).trim().length>0),g=x.useMemo(()=>{const l=[];return t.forEach(u=>{if(u==="bio")return;const c=m(u);c&&(R(c)?c.forEach((d,y)=>{C(d)&&l.push({field:u,value:d,key:`${u}-${y}`})}):C(c)&&l.push({field:u,value:c,key:u}))}),l},[t,m,C]);if(t.length===0)return null;const w=l=>{const{field:u,value:c,key:d}=l;switch(u){case"link":return n.jsx(ye,{value:c},d);case"timezone":return n.jsx(pe,{value:c},d);case"email":return n.jsx(O,{field:u,value:c,children:n.jsx(p,{component:"a",href:`mailto:${c}`,rel:"noopener noreferrer",referrerPolicy:"no-referrer",style:{color:"inherit",textDecoration:"none",fontSize:"inherit"},children:c})});default:return n.jsx(O,{field:u,value:c},d)}};return n.jsxs(f,{mt:1,display:"flex",flexDirection:"column",gap:1.5,className:"user-card__basic-content",children:[o&&((I=e.metadata)==null?void 0:I.bio)&&n.jsx(_,{variant:"body2",color:"grey.800",className:"user-card__bio-field",children:e.metadata.bio}),b?n.jsx(P,{container:!0,spacing:.5,children:g.map(l=>n.jsx(P,{item:!0,xs:6,children:w(l)},l.key))}):n.jsx(f,{display:"flex",flexDirection:"column",gap:.5,children:g.map(l=>w(l))})]})}const _=E(p)`
|
|
2
|
-
flex: 1;
|
|
3
|
-
display: -webkit-box;
|
|
4
|
-
line-height: 1.5;
|
|
5
|
-
-webkit-line-clamp: 1;
|
|
6
|
-
-webkit-box-orient: vertical;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
text-overflow: ellipsis;
|
|
9
|
-
word-break: break-word;
|
|
10
|
-
`;function be(e){const{user:r,avatarSize:i=40,renderCustomContent:t,isFull:o=!0,infoType:a=S.Minimal,renderFields:s,popupRenderFields:m,...h}=e;return n.jsxs(f,{display:"flex",flexDirection:"column",width:"100%",flex:1,height:"100%",children:[n.jsx(me,{user:r,avatarSize:i,...h}),a===S.Basic&&n.jsx(je,{user:r,isFull:o,renderFields:s}),n.jsx(f,{className:"user-card__footer",children:t&&n.jsx(f,{sx:{mt:1.5},children:t()})})]})}function T(e){const{infoType:r=S.Minimal}=e;switch(r){case S.NameOnly:return n.jsx(ce,{...e});default:return n.jsx(be,{...e})}}function Ce({children:e,sx:r}){const i=H();return n.jsx(f,{sx:U({p:2,backgroundColor:i.palette.background.paper,border:"1px solid",borderColor:"divider",borderRadius:2,maxWidth:500,minWidth:320,display:"flex"},r||null),children:e})}function ge({children:e,cardType:r=j.Detailed,variant:i="box",containerRef:t,sx:o}){const a={minWidth:320,p:2,borderRadius:2,...r===j.Detailed?{border:"1px solid",borderColor:"divider"}:{}};return i==="paper"?n.jsx(L,{ref:t,elevation:0,sx:a,children:e}):n.jsx(f,{ref:t,sx:U(a,{display:"flex",alignItems:r===j.AvatarOnly?"center":"flex-start",gap:2},o||null),children:e})}function Ae(e){const{cardType:r=j.Detailed,showHoverCard:i}=e,t=i!==void 0?i:r===j.AvatarOnly,o=x.useRef(null),[a,s]=x.useState(()=>e.user||null);if(x.useEffect(()=>{let h=!0;return e.user?s(e.user):e.did&&ae(e.did)&&!e.user&&oe(e.did).then(b=>{h&&s(b)}),()=>{h=!1}},[e.did,e.user]),!a)return n.jsx(D,{did:e.did,size:e.avatarSize,...e.avatarProps});const m=()=>n.jsx(Ce,{sx:e.popupSx,children:n.jsx(T,{...e,shouldShowHoverCard:!1,user:a,avatarProps:e.popupAvatarProps,shortenLabelProps:e.popupShortenLabelProps,renderFields:e.popupRenderFields,renderName:e.popupRenderName})});return r===j.AvatarOnly?n.jsx(se,{...e,shouldShowHoverCard:t,renderCardContent:m,user:a}):n.jsx(ge,{containerRef:o,cardType:r,sx:e.sx,children:n.jsx(T,{...e,shouldShowHoverCard:t,renderCardContent:m,user:a})})}export{j as C,S as I,Ae as U};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import{r as y}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a8 as Pe,ac as yt,T as J,a9 as C,E as Fe,bo as _e,bz as et,bR as Te,bs as Re,bS as Ie,y as Se,b3 as Ee,aa as tt,ag as ce,a1 as st,bb as Xe,br as jt,bn as vt,q as Ze,bZ as St}from"./vendor-mui-core-CQ38ohp2.js";import{c as ie,az as ue,A as Ct}from"./vendor-utils-BNHJB5U7.js";import{Y as Z,j as P,b6 as Nt,r as ke,A as wt,u as te,bO as Tt,X as nt,B as Ae,a5 as at,al as Rt,ar as It,bt as Et}from"./vendor-ux-did-connect-BdkhddhO.js";import{z as At,t as V,l as Dt,I as Je}from"./index-DO3_1y-L.js";import{f as ee,a as De}from"./vendor-hooks-DftG_2gV.js";import{S as he}from"./shorten-label-DFzv9EKX.js";import{I as it}from"./index-CGBZONPv.js";import{A as Ot,S as Lt,a as Pt,b as Ft,B as _t}from"./list-Dmtz4mRb.js";import{R as Be}from"./relative-time-Djw-K4Zu.js";import{a as ze}from"./dashboard-8QXGSoVu.js";import{W as kt}from"./did-address-DUThaBlf.js";import{p as ot}from"./util-Dw9Eiuko.js";import{D as Bt,g as zt}from"./traffic-T11hxc--.js";import{i as Wt,a as Mt}from"./index-DcBUShKK.js";import{B as rt}from"./bundle-avatar-D0t7RLGx.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./index-DKhrYmrN.js";import"./use-app-logo-B8Kl9EZt.js";import"./InfoOutlined-CQB5qKm-.js";import"./sdk-CTe6rL6c.js";import"./CheckCircle-BNrN9mgy.js";import"./index-B_vrglsK.js";import"./Phone-KP65huHK.js";import"./Location-B8EOY3d0.js";import"./Email-Dz2Eyqu0.js";import"./Timezone-Ce4E1Xey.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./session-VIMbdc9j.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";import"./base32-p9VcJrwv.js";import"./iframe-DZ181i8X.js";import"./LaunchOutlined-BV4_W1pb.js";import"./ChevronLeft-Dq00IS01.js";import"./ChevronRight-ZTqWK-Ga.js";import"./index-BT0GBmWF.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./AdapterDayjs-BUGplkxR.js";const lt=y.createContext({}),{Provider:qt,Consumer:mn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=At(),[a,x]=y.useState([]),[u,R]=y.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[v,S]=y.useState([]),[I,M]=y.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...D}={})=>{if(!m)return[];try{const F={paging:{page:h,pageSize:O},...D,teamDid:m,dateRange:D.dateRange?[V(D.dateRange[0]).toISOString(),V(D.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=F;let Q="";B&&B.includes("system")&&(Q="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Q,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),R(se.paging),se.list}catch(F){return Z.error(F.message),[]}},A=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=y.useCallback(h=>{const O=s.children.find(D=>{var F;return((F=D.meta)==null?void 0:F.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:D,...F})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:D.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),...F}})},U=y.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=y.useCallback(async({page:h=1,pageSize:O=20,...D}={})=>{try{const F={paging:{page:h,pageSize:O},...D,userName:D.searchText||"",teamDid:m,dateRange:D.dateRange?[V(D.dateRange[0]).toISOString(),V(D.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:F})}catch(F){throw Z.error(F.message),F}},[n,m]);y.useEffect(()=>{m&&A()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const k={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:H,getUser:U,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:k},children:t})}function We(){const{notificationRecords:t}=y.useContext(lt);return t}const ye={common:{black:"#000",white:"#fff"},primary:{main:"#3773F2",contrastText:"#fff"},secondary:{main:"#16CED1",contrastText:"#fff"},error:{main:"#F16E6E",contrastText:"#fff"},warning:{main:"#DE9E37",contrastText:"#fff"},info:{main:"#0775F8",contrastText:"#fff"},success:{main:"#34BE74",contrastText:"#fff"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{default:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}};ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(ke()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.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={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(ke()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.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={},Zt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Jt=Zt(ke()),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 es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:Dt(o,s)}):"",R=es(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:R}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:R,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Qe=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},je=(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},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.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 ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(yt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(J,{color:"inherit",sx:{fontSize:12},children:R}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(J,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(Fe,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}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:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:R=>{const m=[...t];R.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(v=>v!==(u.value??u)),s(m[n],n,r)},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(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{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:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=y.useState(null),x=y.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=y.useCallback(m=>{if(!m.startDate||!m.endDate){Z.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){Z.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(J,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Je(t[0],n)," - ",Je(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Bt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:zt(r),onChange:R})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{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(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{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:r}=te(),[o,a]=y.useState(ls),[x,u]=y.useState(!0),R=(v,S)=>{S.checked=v.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=v=>{v.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(J,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(v=>e.jsx(Re,{control:e.jsx(Ie,{checked:v.checked,onChange:S=>R(S,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("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:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:R,blocklet:m}=We(),[v,S]=y.useState(!1),[I,M]=y.useState([]),E=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[A,G]=y.useState(null),[H,U]=y.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,k]=y.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=y.useState([]),D=[{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"}],F=async()=>{if(!v&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),U(i.paging),S(!1)}catch(i){Z.error(i.message),S(!1)}};y.useEffect(()=>{F()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Q={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:j})=>{const[,_=[],$=[],K=[]]=j;N.pageSize!==l?k(W=>({...W,pageSize:l,page:1})):N.page!==i+1?k(W=>({...W,page:i+1})):N.searchText!==c?k(W=>({...W,searchText:c,page:1})):ue(_,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||k(W=>({...W,emailSendStatus:K,page:1})):k(W=>({...W,pushKitSendStatus:$,page:1})):k(W=>({...W,walletSendStatus:_,page:1}))},oe=y.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[R,m]),se=y.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,j="")=>{if(!(!l.length||!i.length))try{s(i,l,c,j),L.anchorEl||(await xe(.5),f())}catch(_){console.error("handleResend error",{error:_})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(j=>I[j].receiver);await g(i,c,l),await xe(.5),p(),O([])},T=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(j){Z.error(j.response?j.response.statusText:j.message)}},w=async(i,l,c,j=[],_=!0)=>{if(i.stopPropagation(),os(l,c)>=4){Z.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,j,_);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],_),L.anchorEl||(await xe(.5),f()))}catch(K){Z.error(K.message)}},Y=i=>{k(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,j)=>{i.stopPropagation();const _=c.filter($=>$!==l);k($=>({...$,[j]:_,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"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(he,{children:l.fullName})]},c):e.jsx(kt,{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:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:j,filterValues:D})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"wallet",onResend:_=>w(_,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"pushkit",onResend:_=>w(_,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:j,filterValues:D})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"email",onResend:_=>w(_,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:j,filterValues:D})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[j,_]=c,$=_[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:j},j),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(ut,{}),onClick:()=>F(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Q,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[A==null?void 0:A.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(A==null?void 0:A.channel).map(i=>{var _,$;const{type:l,pass:c,fail:j}=i;return!(A!=null&&A.result)||(_=A==null?void 0:A.result)!=null&&_[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=A==null?void 0:A.result)!=null&&$[l]?ye.success.main:"inherit"},children:[A!=null&&A.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(J,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:ye.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:j})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:b})})]})})})}const cs=y.memo(gt),ds=ce.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
|
-
`,us=ce.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
|
-
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ps(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(re,{item:s})},{name:"Push",value:e.jsx(re,{item:n})},{name:"Email",value:e.jsx(re,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(re,{item:o,isWebhook:!0})}]:[]]}function fs(t,s,n){const{wallet:r,push:o,email:a,webhook:x}=t;return[{name:"Wallet",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.EMAIL,item:a,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};re.propTypes={item:d.object.isRequired,isWebhook:d.bool};re.defaultProps={isWebhook:!1};function re({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,a=r===o?"success":"failed";return e.jsx(C,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(C,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ne,{config:{status:a},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}le.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};le.defaultProps={isWebhook:!1,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function le({channel:t,item:s,isWebhook:n=!1,onResend:r,loading:o}){const{t:a}=te(),{success:x,failed:u,pending:R}=s,m=rs(t),v=n?x.length:x,S=n?u.length:u,I=n?R.length:R,M=async G=>{G.stopPropagation();const H=n?[...new Set([...x,...u].map(U=>U))]:[];await r([t],[],!0,H)},E=v+S,L=E>0?v/E*100:0,A=E>0?S/E*100:0;return e.jsxs(ms,{successRatio:L,failedRatio:A,children:[e.jsxs(J,{variant:"h6",children:[m," (",s.total,")"]}),e.jsxs(J,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:a("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(ne,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",a("notification.sendStatus.failed")]}),e.jsxs(ne,{config:{status:"pending"},enableTooltip:!1,children:[fe(I)," ",a("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:M,children:a("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:r}){const o=ee(()=>s==="simple"?ps(t):fs(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(a=>e.jsx(it,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:a.name,children:a.value},a.name))}):e.jsx(Xe,{container:!0,spacing:2,children:o.map(a=>e.jsx(Xe,{item:!0,md:4,sm:6,xs:12,children:a.value},a.name))})}const ms=ce(C)`
|
|
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:r="info"}){const{t:o,locale:a}=te(),{getComponent:x,resendNotification:u}=We(),[R,m]=y.useState(!1),v=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),S=De({tab:r||"info"}),I=y.useCallback(async(h,O,D=!0,F=[])=>{var Q;if(!h.length||!t.id)return;const B=O.length>0?O:(Q=t==null?void 0:t.receivers)==null?void 0:Q.map(z=>z.receiver);if(!B.length)return;let q=[...h];if(q.includes(P.NOTIFICATION_SEND_CHANNEL.PUSH)&&!mt(n)&&(Z.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),q=q.filter(z=>z!==P.NOTIFICATION_SEND_CHANNEL.PUSH)),q.includes(P.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ft(n)&&(Z.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),q=q.filter(z=>z!==P.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!q.length)try{m(!0),await u({notificationId:t.id,receivers:B,channels:q,resendFailedOnly:D,...q.includes("webhook")&&F.length?{webhookUrls:F}:{}}),Z.success("Message has been sent!")}catch(z){console.error("handleResend error",{error:z}),Z.error(z.response?z.response.statusText:z.message)}finally{m(!1)}},[n,t.id,t==null?void 0:t.receivers,u,o]),M=ee(()=>Wt(t),[t]),E=ee(()=>Mt(t),[t]),L=ee(()=>M?t==null?void 0:t.actorInfo:[],[t]),A=ee(()=>{var h;return(n==null?void 0:n.did)||((h=n==null?void 0:n.meta)==null?void 0:h.did)||""},[n]);function G(){return[{name:o("notification.from"),value:M&&E?e.jsx(Ot,{actors:L,teamDid:A,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(he,{maxLength:50,children:t.title})},{name:o("notification.body"),value:M?e.jsx(Pt,{notification:t,blocklet:n}):e.jsx(Ft,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(ge,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Be,{value:t.createdAt,locale:a,shouldUpdate:!0})}].map(O=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:O.name,children:O.value},O.name))}const H={info:{label:o("common.basicInfo"),value:"info",component:G},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},U=Object.values(H).map(({label:h,value:O})=>({label:h,value:O})),N=H[S.tab]||H.info,k=h=>{S.tab=h};return e.jsx(Rt,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(gs,{children:[e.jsx(C,{mx:3,className:"tabs",children:e.jsx(It,{tabs:U,current:S.tab,onChange:k,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(cs,{notificationId:t.id,resending:R,handleResend:I}),S.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:R,onResend:I}),S.tab==="info"&&e.jsx(N.component,{})]})]})})}const hs=y.memo(xt),gs=ce.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: ${ye.text.disabled};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`;me.propTypes={blocklet:d.object,label:d.string};me.defaultProps={blocklet:null,label:""};const xs=ce.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 me({blocklet:t,label:s}){var n;return e.jsx(xs,{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(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(r=>e.jsx(Fe,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ge,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function bs(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(ge,{severity:s})})}function ys({customTableButtons:t}){var se;const{t:s,locale:n}=te(),[r,o]=y.useState(!1),{data:a,paging:x,blocklet:u,fetch:R,getComponent:m,componentDids:v,inService:S,teamDid:I}=We(),M=y.useRef(null),[E,L]=y.useState(null),[A,G]=y.useState("info"),H=`notification-records-${(se=u.meta)==null?void 0:se.did}`,U=Et(H),[N,k]=y.useState({pageSize:U.rowsPerPage||10,page:U.page?U.page+1:1,dids:U.dids||[],dateRange:U.dateRange||[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),h=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var b;const g=p.did||((b=p.meta)==null?void 0:b.did);v.includes(g)&&(p.ancestors=[u],f.push(p))}),f},[v,u]),O=async f=>{try{o(!0),await R(f),o(!1)}finally{o(!1)}};y.useEffect(()=>{O(N)},[N]),y.useEffect(()=>{const f=a.find(p=>p.id===(E==null?void 0:E.id));E&&f&&L({...f})},[a,E]);const D=(f,p,g,b)=>{f.stopPropagation();const T=g.filter(w=>w!==p);k(w=>({...w,[b]:T,page:1}))},F=({page:f,rowsPerPage:p,filterList:g})=>{const[b=[],,,,T=[]]=g;N.pageSize!==p?k(w=>({...w,pageSize:p,page:1})):N.page!==f+1?k(w=>({...w,page:f+1})):ue(N.dids,b)?ue(N.severities,T)||k(w=>({...w,severities:T,page:1})):k(w=>({...w,dids:b,page:1}))},B=y.useCallback(()=>{L(null),G("info")},[]),q=y.useCallback(()=>{R(N)},[R,N]),Q=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,g)=>{var T;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const b=h.find(w=>{var X;return(w.did||((X=w.meta)==null?void 0:X.did))===p});return e.jsx(me,{blocklet:b,label:(b==null?void 0:b.title)||((T=b==null?void 0:b.meta)==null?void 0:T.title)},p)}),update:(f,p,g)=>(f[g].splice(p,1),f)},filterOptions:{names:h,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,g,b)=>e.jsxs(_e,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(vt,{multiple:!0,value:f[g],renderValue:T=>e.jsx(C,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(w=>{var X;if(w==="system")return e.jsx("span",{children:s("notification.system")},w);const Y=h.find(ae=>{var i;return(ae.did||((i=ae.meta)==null?void 0:i.did))===w});return e.jsx(me,{blocklet:Y,label:(Y==null?void 0:Y.title)||((X=Y==null?void 0:Y.meta)==null?void 0:X.title)},w)})}),onChange:T=>{f[g]=T.target.value,p(f[g],g,b)},children:[e.jsx(Ze,{value:"system",children:s("notification.system")}),h.map(T=>{var Y,X;const w=T.did||((Y=T.meta)==null?void 0:Y.did);return e.jsx(Ze,{value:w,children:e.jsx(me,{blocklet:T,label:T.title||((X=T.meta)==null?void 0:X.title)})},w)})]})]})},customBodyRenderLite:f=>{var b,T;const p=a[f],g=m(p.componentDid);return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(rt,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(_t,{blocklet:u,size:32}),e.jsx(he,{maxLength:50,children:((b=g==null?void 0:g.meta)==null?void 0:b.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=a[f],{receivers:g}=p;return e.jsx(St,{total:g.length,renderSurplus:b=>b<100?e.jsxs("span",{children:["+",b]}):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:b=>{b.stopPropagation(),L(p),G("receivers")},children:g.map(b=>{const{receiverUser:T}=b,w=ot(T.avatar,I,S);return e.jsx(nt,{alt:T.fullName,src:`${w}?imageFilter=resize&w=48&h=48`,size:32,did:b.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},b.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(C,{onClick:g=>{g.stopPropagation(),L(p),G("statistics")},children:e.jsx(Ne,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(he,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=a[f];return e.jsx(ge,{severity:p.severity})},filter:!0,filterType:"custom",filterList:N.severities??[],customFilterListOptions:{render:f=>e.jsx(Ge,{list:f,label:s("notification.severity"),onDelete:(p,g)=>{p.stopPropagation(),D(p,g,Q[4].options.filterList,"severities")}}),update:je},filterOptions:{names:Qe,fullWidth:!0,logic:ve,display:(f,p,g,b)=>e.jsx(bs,{label:s("notification.severity"),filterList:f,onChange:p,index:g,column:b,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=a[f];return e.jsx(Be,{value:p,locale:n,shouldUpdate:!0})}}}],z=f=>{k(p=>({...p,dateRange:f,page:1}))},oe=[...t||[]];return e.jsxs(C,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(js,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:r,locale:n,columns:Q,data:a,durable:H,onChange:F,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...U,onRowClick:(f,{dataIndex:p})=>{L(a[p])}},customPreButtons:[e.jsx(Ue,{value:N.dateRange,onChange:z})],customButtons:oe,components:{TableFilterList:f=>e.jsx($e,{...f,itemComponent:p=>e.jsx(Ce,{...p,canDelete:g=>{var T;const b=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(b==null?void 0:b.name)==="sender"}})})}})})}),E&&e.jsx(hs,{refresh:q,onCancel:B,notification:E,blocklet:u,tab:A})]})}const js=ce.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(Kt,{blocklet:t,children:e.jsx(ys,{customTableButtons:s})})}export{bt as default};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import{u as $,Y as W,bM as Y,I as be,_ as fe,a5 as ge,bt as je}from"./vendor-ux-did-connect-BdkhddhO.js";import{t as ye,m as de,j as we}from"./vendor-hooks-DftG_2gV.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-CQB5qKm-.js";import{z as F,E as ke,F as K,C as ce,t as ve}from"./index-DO3_1y-L.js";import{u as N}from"./dashboard-8QXGSoVu.js";import{H as o,j as e,D as Ee,ai as Ce,t as Te,a9 as f,O as ie,T as S,aa as U,aj as ee,z as Se,y as B,bs as le,bS as V,ac as A,L as Q,A as G,bc as Re,E as O,I as _,C as Ie,bq as Me,ak as P,ce as Pe,X as De,bb as J,bp as ze,b4 as We,cf as Ae,cg as Oe,b5 as qe,am as $e,c1 as Le,s as pe,v as Be,ch as He,ci as Fe,cj as Ne,ck as Ue,cl as _e}from"./vendor-mui-core-CQ38ohp2.js";import{q as Ye}from"./vendor-arcblock-ScFEr-lj.js";import{d as Ke}from"./ExpandLess-BiMmSOBl.js";import{z as ue,x as Ve,y as Je}from"./vendor-utils-BNHJB5U7.js";import{C as Qe}from"./confirm-DqvNmeoz.js";import{A as Ge}from"./actions-DA-6s_nQ.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./format-error-BrmqJs5a.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";import"./MoreHoriz-CX_pwfPT.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),l=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=$(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:h,checked:l>0&&l===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:u<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Re,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(O,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ke,{}):e.jsx(Ye,{})})]})]})}),g.length>0&&e.jsx(Ie,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Me,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var s;const{t:p}=$(),[n,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=ke({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{l({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[q,L]=I.split("-");return!q||!L?null:{type:q,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});W.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});W.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){W.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ee,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ce,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Te,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(K,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(K,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:l,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Se,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ve(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function z(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(A,{title:t.tip,children:e.jsx(Pe,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(De,{orientation:"vertical",flexItem:!0})]})}z.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};z.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=F(),{t:b}=$(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:n,loadMore:l,loadingMore:v,loading:T}=ye(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(q=>{var L;return((L=q==null?void 0:q.meta)==null?void 0:L.name)==="ai-studio"}),I=Ve(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(Ae,{color:"error"}):e.jsx(Oe,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),g&&e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=$(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:n}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(A,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Le,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(z,{label:c("common.status"),value:e.jsx(O,{size:"small",variant:"filled",label:l.status,color:he(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.listen"),value:e.jsx(A,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(O,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(z,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx(z,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx(z,{label:c("common.createdBy"),value:e.jsx(A,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(O,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("common.updatedBy"),value:e.jsx(A,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(O,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:n}=$(),l=Be(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(ge)`
|
|
2
|
-
.MuiPaper-root {
|
|
3
|
-
border-radius: 8px;
|
|
4
|
-
overflow: hidden;
|
|
5
|
-
}
|
|
6
|
-
table.MuiTable-root {
|
|
7
|
-
outline: 1px solid var(--stroke-border-base, #eff1f5);
|
|
8
|
-
border-radius: var(--radius-m, 8px);
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
[class*='MUIDataTable-responsiveBase'] {
|
|
12
|
-
outline: 1px solid var(--stroke-border-base, #eff1f5);
|
|
13
|
-
border-radius: var(--radius-m, 8px);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
th.MuiTableCell-head {
|
|
17
|
-
padding: 8px 16px 8px 16px;
|
|
18
|
-
text-transform: inherit;
|
|
19
|
-
background: var(--backgrounds-bg-subtle, #f9fafb);
|
|
20
|
-
border-bottom: none;
|
|
21
|
-
&:first-of-type {
|
|
22
|
-
border-top-left-radius: 8px;
|
|
23
|
-
padding-left: 20px;
|
|
24
|
-
}
|
|
25
|
-
&:last-of-type {
|
|
26
|
-
border-top-right-radius: 8px;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
tr.MuiTableRow-root:not(.MuiTableRow-footer):hover {
|
|
31
|
-
background: var(--backgrounds-bg-highlight, #eff6ff);
|
|
32
|
-
}
|
|
33
|
-
tr.MuiTableRow-root:last-of-type td:first-of-type {
|
|
34
|
-
border-bottom-left-radius: 8px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
tr.MuiTableRow-root:last-of-type td:last-of-type {
|
|
38
|
-
border-bottom-right-radius: 8px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
tr.MuiTableRow-root:nth-of-type(even) {
|
|
42
|
-
background: var(--backgrounds-bg-subtle, #f9fafb);
|
|
43
|
-
}
|
|
44
|
-
td.MuiTableCell-root {
|
|
45
|
-
border-bottom: none;
|
|
46
|
-
padding-top: 12px;
|
|
47
|
-
padding-bottom: 12px;
|
|
48
|
-
padding-left: 16px;
|
|
49
|
-
padding-right: 16px;
|
|
50
|
-
&:first-of-type {
|
|
51
|
-
padding-left: 20px;
|
|
52
|
-
}
|
|
53
|
-
&.MuiTableCell-footer {
|
|
54
|
-
border: none;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.datatable-footer {
|
|
59
|
-
.MuiTableRow-root.MuiTableRow-footer {
|
|
60
|
-
border: none;
|
|
61
|
-
}
|
|
62
|
-
table.MuiTable-root {
|
|
63
|
-
outline: none;
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
}
|
|
66
|
-
.MuiTablePagination-input {
|
|
67
|
-
background: none;
|
|
68
|
-
}
|
|
69
|
-
div.MuiSelect-select {
|
|
70
|
-
padding: 0 24px 0 0;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
th a,
|
|
75
|
-
td a {
|
|
76
|
-
text-decoration: none;
|
|
77
|
-
display: block;
|
|
78
|
-
color: inherit;
|
|
79
|
-
&:first-of-type {
|
|
80
|
-
padding-left: 0;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
> div {
|
|
85
|
-
overflow: auto;
|
|
86
|
-
}
|
|
87
|
-
.custom-toobar-title-inner {
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
}
|
|
91
|
-
@media (max-width: ${({theme:t})=>t.breakpoints.values.md}px) {
|
|
92
|
-
th a,
|
|
93
|
-
td a {
|
|
94
|
-
text-decoration: none;
|
|
95
|
-
display: block;
|
|
96
|
-
color: inherit;
|
|
97
|
-
padding-top: 0;
|
|
98
|
-
padding-bottom: 0;
|
|
99
|
-
padding-right: 0;
|
|
100
|
-
}
|
|
101
|
-
tr.MuiTableRow-root {
|
|
102
|
-
border: none;
|
|
103
|
-
padding: 20px;
|
|
104
|
-
display: block;
|
|
105
|
-
}
|
|
106
|
-
td.MuiTableCell-root:first-of-type {
|
|
107
|
-
padding-left: 0;
|
|
108
|
-
margin-top: 0;
|
|
109
|
-
}
|
|
110
|
-
td.MuiTableCell-root {
|
|
111
|
-
margin: 0;
|
|
112
|
-
margin-top: 8px;
|
|
113
|
-
align-items: center;
|
|
114
|
-
padding: 0;
|
|
115
|
-
flex-wrap: wrap;
|
|
116
|
-
flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
|
|
117
|
-
align-items: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"center"};
|
|
118
|
-
justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"space-between"};
|
|
119
|
-
}
|
|
120
|
-
td.MuiTableCell-root > div {
|
|
121
|
-
margin-bottom: 4px;
|
|
122
|
-
}
|
|
123
|
-
.MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
|
|
124
|
-
display: flex;
|
|
125
|
-
flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
|
|
126
|
-
align-items: flex-start;
|
|
127
|
-
justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"space-between":"flex-start"};
|
|
128
|
-
flex-wrap: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"nowrap":"wrap"};
|
|
129
|
-
word-break: break-all;
|
|
130
|
-
&.datatables-noprint {
|
|
131
|
-
justify-content: center;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
[class*='MUIDataTable-responsiveBase'] tr:not([class*='responsiveSimple']) td.MuiTableCell-body > div {
|
|
135
|
-
width: inherit;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
`,it=re;function Pt(){const{teamDid:t}=N(),d=`webhook-endpoints-${t}`,c=je(d),{t:a}=$(),{api:b}=F(),[R,p]=C.useState(""),[n,l]=C.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[v,T]=we(d,{defaultValue:{pageSize:c.rowsPerPage||20,page:c.page?c.page+1:1}}),{loading:j,error:y,data:h,refresh:r}=de(()=>b.getWebhookEndpoints({input:{teamDid:t,paging:{page:v.page,pageSize:v.pageSize}}}));C.useEffect(()=>{r()},[v,r]);const w=C.useCallback(async(i,x)=>{try{await b.updateWebhookEndpoint({input:{teamDid:t,id:i.id,data:{status:x?"disabled":"enabled"}}}),r(),W.success(`${a(x?"webhookEndpoint.disable":"webhookEndpoint.enable")}${a("webhookEndpoint.success")}`)}catch(s){W.error(s==null?void 0:s.message)}},[b,t,r,a]),g=C.useCallback(async i=>{try{await b.deleteWebhookEndpoint({input:{teamDid:t,id:i}}),r(),l(x=>({...x,deleteConfirm:null})),W.success(`${a("common.delete")}${a("webhookEndpoint.success")}`)}catch(x){W.error(x==null?void 0:x.message)}},[b,t,r,a]),E=(i,x)=>{let s=i.page+1;const m=i.searchText||"";if(m!==R){p(m);return}if(x==="changePage"||x==="changeRowsPerPage"){x!=="changePage"&&(s=1);const k={page:s,pageSize:i.rowsPerPage};p(""),T(k)}};if(y)return e.jsx(ee,{severity:"error",children:y.message});if(j||!h)return e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500,children:e.jsx(U,{})});const u=((h==null?void 0:h.list)||[]).filter(i=>{if(!R)return!0;const x=R.toLowerCase();return i.description.toLowerCase().includes(x)||i.url.toLowerCase().includes(x)}),M=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,x)=>{const s=u[x];return e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(S,{variant:"body2",children:s.description}),e.jsx(f,{sx:{display:"flex"},onClick:m=>{m.stopPropagation()},children:e.jsx(A,{title:s.url,children:e.jsx(Z,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,x)=>{const s=u[x];return e.jsx(f,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:s.enabledEvents.map(m=>e.jsx(O,{size:"small",variant:"filled",label:m.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${s.source}-${m.type}`))})}}},{label:a("common.status"),name:"status",options:{customBodyRenderLite:(i,x)=>{const s=u[x];return e.jsx(O,{size:"small",variant:"filled",label:a(`webhookEndpoint.${s==null?void 0:s.status}`),color:he(s==null?void 0:s.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${s.status}`)}}},{label:a("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:a("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,x)=>{const s=u[x],m=(s==null?void 0:s.status)==="enabled";return e.jsx(Ge,{actions:[{icon:m?e.jsx(He,{}):e.jsx(Fe,{}),text:a(m?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:k=>{k.stopPropagation(),w(s,m)}},{icon:e.jsx(Ne,{}),text:a("common.edit"),onClick:k=>{k.stopPropagation(),l(D=>({...D,createEdit:{open:!0,id:s.id,url:s.url,description:s.description,enabledEvents:s.enabledEvents}}))}},{icon:e.jsx(Ue,{}),text:a("common.delete"),onClick:k=>{k.stopPropagation(),l(D=>({...D,deleteConfirm:{title:a("webhookEndpoint.deleteWebhook.title"),description:a("webhookEndpoint.deleteWebhook.description"),confirm:a("common.confirm"),cancel:a("common.cancel"),onConfirm:()=>g(s.id),onCancel:()=>l(I=>({...I,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(e.Fragment,{children:[e.jsx(it,{durable:d,durableKeys:["page","rowsPerPage"],data:u,columns:M,options:{count:h.count,page:v.page-1,rowsPerPage:v.pageSize,customToolbar:()=>e.jsx(_,{onClick:()=>l(i=>({...i,createEdit:{...i.createEdit,open:!0}})),children:e.jsx(_e,{})},"add"),onRowClick:(i,{dataIndex:x})=>{const s=h.list[x];l(m=>({...m,webhookDetail:{open:!0,id:s.id}}))}},loading:j,onChange:E,title:e.jsx(S,{variant:"h6",children:a("webhookEndpoint.title")}),emptyNodeText:e.jsxs(P,{gap:1,children:[a("webhookEndpoint.noWebhooksAdded"),e.jsx(B,{variant:"contained",color:"primary",onClick:()=>l(i=>({...i,createEdit:{...i.createEdit,open:!0}})),children:a("webhookEndpoint.createWebhook")})]})}),n.webhookDetail.open&&e.jsx(me,{open:!0,onClose:()=>l(i=>({...i,webhookDetail:{open:!1,id:null}})),id:n.webhookDetail.id}),n.createEdit.open&&e.jsx(oe,{onSubmit:r,...n.createEdit,onClose:()=>l(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),n.deleteConfirm&&e.jsx(Qe,{title:n.deleteConfirm.title,description:n.deleteConfirm.description,confirm:n.deleteConfirm.confirm,cancel:n.deleteConfirm.cancel,params:n.deleteConfirm.params,onConfirm:n.deleteConfirm.onConfirm,onCancel:n.deleteConfirm.onCancel})]})}export{Pt as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as d}from"./vendor-react-DEoibe3W.js";import{H as l,j as n,a9 as g,b3 as A,O as G,I as O,aa as U,c2 as Y,ag as J}from"./vendor-mui-core-CQ38ohp2.js";import{b2 as Q,aN as Z,d as v}from"./vendor-ux-did-connect-BdkhddhO.js";import{d as ee}from"./Done-JLiLhELm.js";import{C as te}from"./Google-GOp5YvmZ.js";import{ac as ne,f as re}from"./index-DO3_1y-L.js";import{R as oe,F as se,L as ie}from"./logo-uploader-CJrdpVcQ.js";const S={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function _({editing:r,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return r&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[r]);const k=s=>{p.current=s,a(s)},b=()=>{u(!1),a(p.current)},C=n.jsx(g,{className:"form-item-input slot",px:1,children:n.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&n.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=n.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:b,children:[n.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:n.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),n.jsx(A,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n.jsx(te,{color:o,onChange:s=>k(s.hex)})})]});return r?f:C}_.propTypes=S;function D({editing:r,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,k=d.useRef(a),{t:b}=d.useContext(Q),C=s=>{s.key==="Enter"&&c(k.current,"confirm")},f=s=>{k.current=s,c(s)};return r?n.jsx(G,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:C,...m}):n.jsx(g,{px:1,className:"form-item-input slot",children:a||n.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:o||p})})})}D.propTypes=S;D.defaultProps={componentProps:{}};function T({editing:r,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?Z.getPassportColorFromDid(m.appDid):o;return n.jsxs(g,{display:"flex",alignItems:"center",children:[n.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:ne({title:"Owner",issuer:re.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),n.jsx(_,{...u,editing:r,value:r?p:o,onChange:a,componentProps:c})]})}T.propTypes={...S,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};T.defaultProps={};const ae=Y`
|
|
2
|
-
0%, 100% {
|
|
3
|
-
transform: scale(1) translateX(0);
|
|
4
|
-
}
|
|
5
|
-
50% {
|
|
6
|
-
transform: scale(1.05) translateX(-3px);
|
|
7
|
-
}
|
|
8
|
-
25%, 75% {
|
|
9
|
-
transform: scale(1.1) translateX(3px);
|
|
10
|
-
}
|
|
11
|
-
`,le={input:D,color:_,passport:T,uploader:r=>n.jsx(ie,{...r.componentProps})};function ce(r,{editing:o=!1}){const{componentType:a="input",render:c,renderFormItem:u}=r;return o&&u?u:!o&&c?c:le[a==null?void 0:a.toLowerCase()]}function z({schema:r,loading:o,value:a,defaultValue:c,onChange:u,style:m,disabled:p}){const k=Object.prototype.toString.call(a)==="[object Object]",[b,C]=d.useState([]),[f,s]=d.useState(k?a:c),V=d.useMemo(()=>r.length===1,[r]),h=d.useCallback(e=>b.find(t=>t.key===e),[b]);d.useEffect(()=>{var e;V&&((e=r[0])!=null&&e.required)&&C([{key:r[0].key,editing:!0,initialValue:c[r[0].key]}])},[r,V,c]);const I=d.useCallback(e=>{C(t=>t.find(i=>i.key===e.key)?t.map(i=>i.key===e.key?e:{...i}):[e].concat(t))},[]),P=d.useCallback((e,t,x)=>{const{key:i,secure:w}=e,y=h(i)??{...e};y.editing=!0;const R=f[i]!==t;y.edited=t&&y.initialValue!==t,y.initialValue=c[i];const j={...f,[i]:t};R&&s(j),u({[i]:t},{allValues:j,action:x,currentItem:e}),x==="confirm"&&w&&s({...f,[i]:"__encrypted__"}),x==="confirm"&&(y.initialValue=f[i]),["confirm","cancel"].includes(x)&&(y.editing=!1,y.edited=!1),I(y)},[c,f,u,I,h]);function K(e,{editing:t=!1}){const{key:x}=e,i=k?a[x]:f[x];return i==="__encrypted__"?t?"":"******":i}const N=d.useCallback(e=>{const t=h(e.key);t&&P(e,t.initialValue,"cancel")},[h,P]),q=d.useCallback(e=>{const t=h(e.key);!t||!t.edited||(t.shaking=!0,I(t),setTimeout(()=>{t.shaking=!1,I(t)},500))},[h,I]),B=d.useCallback(e=>{const t=h(e.key);!t||!t.edited?N(e):q(e)},[h,q,N]);return n.jsx(de,{className:"form",style:m,children:r==null?void 0:r.map(e=>{const{key:t,description:x,required:i,solo:w=!1,hidden:y=!1,componentProps:L={},skipButtonDisabled:R=!1}=e;if(y)return null;const j=h(t),{editing:F,shaking:M}=j??{},E=K(e,{editing:F}),W=ce(e,{editing:F}),X={inputProps:{"data-cy":"schema-form-item-component"},key:t,description:x,editing:F,value:E,onChange:(H,$="change")=>P(e,H,$),componentProps:L,skipButtonDisabled:R,onBlur:()=>B(e)};return n.jsxs(g,{className:"form-item",children:[!w&&n.jsxs(g,{className:"form-item-label",style:{color:i&&!E?"#ff0000":"#333"},children:[x,i&&n.jsx(oe,{})]}),n.jsxs(g,{className:"form-item-body",children:[n.jsx(g,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:w?"center":"left"},style:{cursor:"text"},onClick:()=>{p||j!=null&&j.edited||R||P(e,f[t],"edit")},children:n.jsx(W,{...X})}),!w&&n.jsx(g,{className:"form-item-action",style:{marginLeft:0},children:F?n.jsxs(n.Fragment,{children:[j.edited?n.jsx(O,{"data-cy":"schema-form-item-confirm",onClick:()=>{P(e,E,"confirm")},disabled:p||o,sx:{animation:M?`${ae} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:o?n.jsx(U,{size:24}):n.jsx(ee,{})}):null,n.jsx(O,{"data-cy":"schema-form-item-cancel",onClick:()=>N(e),style:{paddingLeft:j.edited?4:8},disabled:p||o,size:"large",children:n.jsx(v,{})})]}):null})]})]},t)})})}z.propTypes={schema:l.array.isRequired,loading:l.bool,onChange:l.func.isRequired,value:l.object,defaultValue:l.object,style:l.object,disabled:l.bool};z.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const de=J(se)``;export{z as S};
|