@abtnode/blocklet-services 1.16.49-beta-20250819-084933-3bcbd851 → 1.16.49-beta-20250821-102221-1b7283d6
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/libs/connect/session.js +4 -4
- package/api/services/analytics/index.js +8 -5
- package/api/services/auth/connect/connect-to-did-spaces-for-user.js +5 -5
- package/api/services/auth/connect/migrate-app-to-struct-v2.js +1 -1
- package/api/state/profile.js +1 -1
- package/api/util/blocklet-utils.js +2 -2
- package/dist/assets/{AdapterDayjs-DQyL5DVQ.js → AdapterDayjs-VDBijwaM.js} +1 -1
- package/dist/assets/{Google-C3EYOLRU.js → Google-Sm1AunGv.js} +1 -1
- package/dist/assets/{access-control-CuUB1GoU.js → access-control-CKo7ApzQ.js} +1 -1
- package/dist/assets/{actions-DnpJX6lQ.js → actions-Bf4UKTeu.js} +1 -1
- package/dist/assets/{add-component-core-JXDWXmkX.js → add-component-core-2s4YrHkE.js} +7 -7
- package/dist/assets/add-resource-B5ESeEdz.js +1 -0
- package/dist/assets/{addon-D99FdIJX.js → addon-Cbd_t8fg.js} +1 -1
- package/dist/assets/{advanced-CGlqr3Vl.js → advanced-Bgj7amLL.js} +2 -2
- package/dist/assets/{aigne-DceTN7Rt.js → aigne-D5HIKgzm.js} +1 -1
- package/dist/assets/api-IUmhrtIY.js +1 -0
- package/dist/assets/{appearance-fnwZybsp.js → appearance-_Bk4EnMK.js} +1 -1
- package/dist/assets/{ar-B5ZCU4Ws.js → ar-BvKie2ZN.js} +1 -1
- package/dist/assets/{arrow-down.svg-BcoTeNyX.js → arrow-down.svg-DaFWY5aq.js} +1 -1
- package/dist/assets/{audit-logs-Dzq32Y_L.js → audit-logs-Bh4pY_tu.js} +2 -2
- package/dist/assets/authorize--3SKB1wC.js +1 -0
- package/dist/assets/{base-chart-CBzZ3RX9.js → base-chart-DZz4r8-E.js} +1 -1
- package/dist/assets/base32-BkgeFkJa.js +1 -0
- package/dist/assets/bind-account-CoQBu2J9.js +1 -0
- package/dist/assets/branding-7dpJRuU0.js +1 -0
- package/dist/assets/{branding-g04aJopG.js → branding-CuAzEVpH.js} +2 -2
- package/dist/assets/{branding-BgclUoWJ.js → branding-Spk8WElf.js} +5 -5
- package/dist/assets/{bundle-avatar-VT8FLC3N.js → bundle-avatar-CopjjSKq.js} +1 -1
- package/dist/assets/button-DEDR-8Tu.js +1 -0
- package/dist/assets/{click-to-copy-LMYjlbUz.js → click-to-copy-CVpUD4ji.js} +1 -1
- package/dist/assets/{cloneDeep-KmDjD-jP.js → cloneDeep-DqaMBldf.js} +1 -1
- package/dist/assets/{collapse-XWrflTSv.js → collapse-C-BNkgS6.js} +1 -1
- package/dist/assets/{complete-BnL-RLHX.js → complete-BJT8H_Qd.js} +2 -2
- package/dist/assets/{component-B20Ffd5t.js → component-Ds8koLEG.js} +3 -3
- package/dist/assets/{config-BV0yp1Ym.js → config-CPOsDUsI.js} +1 -1
- package/dist/assets/{config-DRsQLuMp.js → config-DE3v72_z.js} +3 -3
- package/dist/assets/{config-CJHA8pSh.js → config-_-5NHvON.js} +2 -2
- package/dist/assets/{config-navigation-CR3DV4xf.js → config-navigation-C-4ZP-lf.js} +11 -11
- package/dist/assets/{config-space-BzTYceTE.js → config-space-CtK2sF5f.js} +1 -1
- package/dist/assets/confirm-Bax75YdO.js +7 -0
- package/dist/assets/{connect-BaSUwW0G.js → connect-Csks8pFO.js} +1 -1
- package/dist/assets/{connect-Dvl9nMFJ.js → connect-DY6itK40.js} +1 -1
- package/dist/assets/connect-to-DBq3ktB8.js +1 -0
- package/dist/assets/{content-layout-yAb710pQ.js → content-layout-DoBqUAz1.js} +1 -1
- package/dist/assets/createClass-D9kGlylC.js +1 -0
- package/dist/assets/{dashboard-CuNuXf3l.js → dashboard-CbwKTvVC.js} +6 -6
- package/dist/assets/{de-Bt2QRaGQ.js → de-C9BQPFcm.js} +1 -1
- package/dist/assets/{delete-confirm-DTjAa9xG.js → delete-confirm-Db0zAWAY.js} +1 -1
- package/dist/assets/{did-address-CY4nLJqm.js → did-address-CcsL3-Qm.js} +1 -1
- package/dist/assets/{domain-C8-oT2Wp.js → domain-CHD8k2pC.js} +1 -1
- package/dist/assets/domain-action-card-DtOm7RPt.js +28 -0
- package/dist/assets/domains-CePn01LF.js +1 -0
- package/dist/assets/{email-BXcDoVMA.js → email-B1F9_dDw.js} +3 -3
- package/dist/assets/{empty-spinner-CvzdEO93.js → empty-spinner-BMVhld2Z.js} +1 -1
- package/dist/assets/engine-UogTYMtu.js +1 -0
- package/dist/assets/{es-RcHRYKIM.js → es-DPjcV6cX.js} +1 -1
- package/dist/assets/{exchange-passport-BJ2cvp1M.js → exchange-passport-B90C9g4T.js} +1 -1
- package/dist/assets/{form-Df41zlMi.js → form-o2cQtSfF.js} +2 -2
- package/dist/assets/{form-text-input-DHhw6HI1.js → form-text-input-DJPCEDjA.js} +1 -1
- package/dist/assets/{form-wrapper-DihET07L.js → form-wrapper-CHYdE4By.js} +1 -1
- package/dist/assets/{fr-CQKeqjRX.js → fr-ButkVdgL.js} +1 -1
- package/dist/assets/{fuel-D_lR2dCI.js → fuel-mxa8OZsa.js} +1 -1
- package/dist/assets/gen-access-key-BgQp83Fx.js +1 -0
- package/dist/assets/gen-simple-access-key-DbEHuHKs.js +1 -0
- package/dist/assets/get-safe-url-BNFAIq84.js +1 -0
- package/dist/assets/hdkey-Dszfv2Lm.js +62 -0
- package/dist/assets/hi-CLqQ4LHH.js +5 -0
- package/dist/assets/{home-YcebrtVr.js → home-C03NbY1T.js} +1 -1
- package/dist/assets/{id-B2v2gNB3.js → id-B6zyYCjr.js} +1 -1
- package/dist/assets/iframe-CZx2enRR.js +1 -0
- package/dist/assets/{index-Pzk7QDI_.js → index-B2R6qrmp.js} +1 -1
- package/dist/assets/index-B5ss4uTe.js +271 -0
- package/dist/assets/index-BF7bSwjJ.js +1022 -0
- package/dist/assets/{index-I45i29I1.js → index-BFQdM_lT.js} +1 -1
- package/dist/assets/{index-C2CNlq3a.js → index-BIfpX-Mq.js} +1 -1
- package/dist/assets/index-BUlqbV5J.js +124 -0
- package/dist/assets/index-BhhsbfbV.js +1 -0
- package/dist/assets/{index-BbOvyzfE.js → index-BtkFo6d6.js} +1 -1
- package/dist/assets/{index-CV12n3b0.js → index-Bzij4iIk.js} +1 -1
- package/dist/assets/{index-DYgvuymH.js → index-C-DpXzH8.js} +1 -1
- package/dist/assets/{index-BusluHY3.js → index-CJubEPJw.js} +12 -12
- package/dist/assets/{index-Bx4IaUHc.js → index-CLmp-nsJ.js} +6 -6
- package/dist/assets/index-CZjtHtZ4.js +1 -0
- package/dist/assets/{index-D4wH7CER.js → index-CcHUYWYZ.js} +6 -6
- package/dist/assets/{index-Q_U4JZ73.js → index-CqAqyoyD.js} +1 -1
- package/dist/assets/index-CrDQcn26.js +6 -0
- package/dist/assets/index-D9F9PzFc.js +113 -0
- package/dist/assets/{index-yRvJst1p.js → index-DGpFay7j.js} +10 -10
- package/dist/assets/{index-DeQPqRmy.js → index-DKALSagn.js} +2 -2
- package/dist/assets/{index-CX5AEYFR.js → index-DO8dY30H.js} +1 -1
- package/dist/assets/index-DQ5bllFt.js +55 -0
- package/dist/assets/index-DQmcrxe_.js +1 -0
- package/dist/assets/{index-DHaiY3PI.js → index-DT3k66ox.js} +1 -1
- package/dist/assets/index-D_t0hM3n.js +30 -0
- package/dist/assets/{index-DQ3_Wuxe.js → index-DnMPdyj-.js} +1 -1
- package/dist/assets/{index-Bv7qQ-8a.js → index-MgFhlLet.js} +1 -1
- package/dist/assets/{index-DtDUB9t6.js → index-R8yzPJ8-.js} +1 -1
- package/dist/assets/{index-COzISRvj.js → index-TDbD3rO2.js} +9 -9
- package/dist/assets/index-_fIzCi4b.js +7 -0
- package/dist/assets/{index-BNm1HXpF.js → index-wKz_l66R.js} +11 -11
- package/dist/assets/{invitation-Cic0zA9s.js → invitation-Py8TsLWL.js} +3 -3
- package/dist/assets/{invite-EVcEzrIF.js → invite-CrcJXNQ_.js} +1 -1
- package/dist/assets/{isURL-BZcSl4qG.js → isURL-CH4qUEqk.js} +2 -2
- package/dist/assets/{issue-passport-B3O3mNxG.js → issue-passport-BrCzpb_k.js} +1 -1
- package/dist/assets/{item-BJ_EimT6.js → item-pMF7ItdE.js} +1 -1
- package/dist/assets/{ja-BweNHYYv.js → ja-5mnOXG6B.js} +1 -1
- package/dist/assets/{ko-BrUV9qyv.js → ko-Msmkvh9O.js} +1 -1
- package/dist/assets/landing-page-tr6cY26r.js +1 -0
- package/dist/assets/{launch-result-message-CFuQ3Maq.js → launch-result-message-BhJWVXUs.js} +1 -1
- package/dist/assets/{layout-DTue3JyF.js → layout-BTWkyZIA.js} +1 -1
- package/dist/assets/list-D9c57rY9.js +4 -0
- package/dist/assets/{list-header-bAafK8zK.js → list-header-BQx81X9X.js} +1 -1
- package/dist/assets/list-u8QyXkOA.js +103 -0
- package/dist/assets/localization-DiI2Nbuc.js +1 -0
- package/dist/assets/{log-DiR01oV7.js → log-atnf1Umh.js} +1 -1
- package/dist/assets/logger-yrkSQn8c.js +1 -0
- package/dist/assets/login-CKylUR0F.js +1 -0
- package/dist/assets/{login-oauth-callback-D2Bc3xAH.js → login-oauth-callback-5DVKz_Jh.js} +1 -1
- package/dist/assets/{logo-uploader-BayOewpo.js → logo-uploader-DbxANvEK.js} +2 -2
- package/dist/assets/{lost-passport-flvvhlNS.js → lost-passport-pzKFXIgF.js} +2 -2
- package/dist/assets/{observability-DUV9CYIA.js → observability-F2NkCkza.js} +1 -1
- package/dist/assets/{omit-DdJriebF.js → omit-BM-5z5qE.js} +1 -1
- package/dist/assets/{open-window-Cj2XU2ZE.js → open-window-DM0S-jzk.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DveCusKe.js → over-due-invoice-payment-CvZTMHvs.js} +1 -1
- package/dist/assets/{overview-BCygf-5_.js → overview-phdRvAI_.js} +2 -2
- package/dist/assets/{page-header-BtdOLX8d.js → page-header-CSMnIoYZ.js} +1 -1
- package/dist/assets/passport-item-Ml3CykE7.js +1 -0
- package/dist/assets/{permission-BPBzp1tm.js → permission-D9Anejwj.js} +1 -1
- package/dist/assets/{playground-Doy13-fN.js → playground-CTvnZW2L.js} +1 -1
- package/dist/assets/preferences-DClQtBed.js +1 -0
- package/dist/assets/profile-embed-CIuOCLMD.js +1 -0
- package/dist/assets/pt-D1bjCfHu.js +5 -0
- package/dist/assets/publish-resource-DrVZkMgt.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DR1a-vn2.js → react-beautiful-dnd.esm-CYy644iX.js} +1 -1
- package/dist/assets/{react-stripe.esm-DJ2wjb7C.js → react-stripe.esm-CLg1-THR.js} +1 -1
- package/dist/assets/{required-2qxcR9JF.js → required-CobBjKC9.js} +1 -1
- package/dist/assets/ru-DcnfcUY4.js +5 -0
- package/dist/assets/runtime-BfAbZoi3.js +1 -0
- package/dist/assets/{sanitize-t-NsAK4g.js → sanitize-NVxeYIWy.js} +1 -1
- package/dist/assets/sdk-DkOKBbdA.js +1 -0
- package/dist/assets/{section-D4T7FV6C.js → section-Dq8SB7lh.js} +1 -1
- package/dist/assets/{security-BAcM8QUq.js → security-DulYEnHf.js} +3 -3
- package/dist/assets/session-COCrt-qG.js +1 -0
- package/dist/assets/{setup-Cs_D4O1K.js → setup-CHgFauXU.js} +1 -1
- package/dist/assets/{shorten-label-BfHH-3ih.js → shorten-label-BHlFrl9P.js} +1 -1
- package/dist/assets/{simple-select-DIgPQFb4.js → simple-select-rm53gQ69.js} +1 -1
- package/dist/assets/{spaces-CU7Gi53i.js → spaces-CvL1Uwkd.js} +1 -1
- package/dist/assets/{start-Ds4Of13F.js → start-BhGEcDw9.js} +1 -1
- package/dist/assets/{starting-progress-BTMrLOch.js → starting-progress-mgdXXqlr.js} +1 -1
- package/dist/assets/status-v5BitGK5.js +1 -0
- package/dist/assets/{step-actions-DDyCXELh.js → step-actions-C48J0mE1.js} +1 -1
- package/dist/assets/{studio-CYLOXolI.js → studio-iYVCEWav.js} +1 -1
- package/dist/assets/{switch-control-CAUrltdD.js → switch-control-BR8H_fdm.js} +1 -1
- package/dist/assets/{table-tips-BNjmTVFL.js → table-tips-BP283GGZ.js} +1 -1
- package/dist/assets/team-BVaQVRGX.js +146 -0
- package/dist/assets/th-C2mNGstJ.js +5 -0
- package/dist/assets/traffic-CMbIGtyi.js +1 -0
- package/dist/assets/{transfer-2ba_g--R.js → transfer-WHnS-w5n.js} +1 -1
- package/dist/assets/{unsubscribe-B0KWDak0.js → unsubscribe-flFhRa0X.js} +1 -1
- package/dist/assets/{use-app-logo-pyV6ZPrc.js → use-app-logo-Cb6MS9by.js} +1 -1
- package/dist/assets/{use-mobile-BcHeqFSk.js → use-mobile-C_DcJ5SZ.js} +1 -1
- package/dist/assets/{use-mobile-BmKySh5X.js → use-mobile-DM4d_PLd.js} +1 -1
- package/dist/assets/{use-server-logo-CFQEMdB-.js → use-server-logo-Cxah39TH.js} +1 -1
- package/dist/assets/{use-window-close-PwuafSt8.js → use-window-close-DpgRKaaP.js} +1 -1
- package/dist/assets/{useAsync-BrjQTmBf.js → useAsync-BrMo9m7W.js} +1 -1
- package/dist/assets/{useAsync-C0iFIKqR.js → useAsync-CsYRBczg.js} +1 -1
- package/dist/assets/{useAsyncRetry-BmdG-NgH.js → useAsyncRetry-D4-sRZN-.js} +1 -1
- package/dist/assets/useLocalStorage-DqhgzGNT.js +1 -0
- package/dist/assets/user-center-BrV7Sqsj.js +126 -0
- package/dist/assets/user-sessions-DMHiVE2_.js +1 -0
- package/dist/assets/{util-BW0qhGTg.js → util-CU3dCXzc.js} +1 -1
- package/dist/assets/{util-Dceeaiqy.js → util-CmTchaCE.js} +1 -1
- package/dist/assets/{vendor-arcblock-D_Dm09bZ.js → vendor-arcblock-B7AoUs4o.js} +139 -138
- package/dist/assets/{vendor-hooks-9cd36rYd.js → vendor-hooks-BRXKH6Nb.js} +1 -1
- package/dist/assets/{vendor-mui-core-DV92LEhm.js → vendor-mui-core-B7zoO8f5.js} +1 -1
- package/dist/assets/{vendor-mui-x-8McV6Pkb.js → vendor-mui-x-Qph0dQcg.js} +1 -1
- package/dist/assets/vendor-utils-DtY42AM-.js +213 -0
- package/dist/assets/{vendor-ux-C9Q7otQi.js → vendor-ux-B7q8W4Pg.js} +11 -11
- package/dist/assets/vi-C4AydA45.js +5 -0
- package/dist/assets/{wait-connect-CZLL86-A.js → wait-connect-bu1NVn-9.js} +1 -1
- package/dist/assets/{wizard-B45wL4-0.js → wizard-E9dqLz0c.js} +1 -1
- package/dist/assets/{wizard-components-DtebwiYw.js → wizard-components-DRUX-bqp.js} +3 -3
- package/dist/assets/wrap-locale-C1S0zrtd.js +1 -0
- package/dist/assets/{zh-BaEjqGHy.js → zh-BG6k4eXG.js} +2 -2
- package/dist/assets/{zh-DBSThusI.js → zh-CwK2Wb9a.js} +1 -1
- package/dist/assets/{zh-tw-xcyHbP3V.js → zh-tw-6SDy5fyY.js} +2 -2
- package/dist/index.html +6 -6
- package/dist/service-worker.js +1 -1
- package/package.json +33 -33
- package/dist/assets/add-resource-DfcJCfFx.js +0 -1
- package/dist/assets/api-ZbpPN5Q9.js +0 -1
- package/dist/assets/authorize-Cp-IEkvY.js +0 -1
- package/dist/assets/base32-rvunYmjt.js +0 -1
- package/dist/assets/bind-account-DWpWB9oY.js +0 -1
- package/dist/assets/branding-C1Ia1UuG.js +0 -1
- package/dist/assets/button-DTxgdpBB.js +0 -1
- package/dist/assets/confirm-DTV46cI2.js +0 -7
- package/dist/assets/connect-to-DqRnkSJR.js +0 -1
- package/dist/assets/createClass-BMZZ4tvt.js +0 -1
- package/dist/assets/domain-action-card-CEOtRquC.js +0 -28
- package/dist/assets/domains-UcvU4SNI.js +0 -1
- package/dist/assets/engine-D80vWtQO.js +0 -1
- package/dist/assets/gen-access-key-CceVm9CK.js +0 -1
- package/dist/assets/gen-simple-access-key-DBtfSm_M.js +0 -1
- package/dist/assets/get-safe-url-C-ga6boD.js +0 -1
- package/dist/assets/hi-C3FQ6j4Z.js +0 -5
- package/dist/assets/iframe-yWzH7Y70.js +0 -1
- package/dist/assets/index-9RuhtmiE.js +0 -7
- package/dist/assets/index-B8oq6zxb.js +0 -1
- package/dist/assets/index-BPLFlpyZ.js +0 -1
- package/dist/assets/index-Bpx_SHfH.js +0 -124
- package/dist/assets/index-BwWh6qt0.js +0 -113
- package/dist/assets/index-CBuBVmWe.js +0 -1020
- package/dist/assets/index-CJ69vsWG.js +0 -271
- package/dist/assets/index-DMpO3u1o.js +0 -29
- package/dist/assets/index-DTwsbX7O.js +0 -55
- package/dist/assets/index-Dib9OV0s.js +0 -6
- package/dist/assets/index-GUfN0pBe.js +0 -62
- package/dist/assets/index-OkiS9ggb.js +0 -1
- package/dist/assets/landing-page-CEwZuo6C.js +0 -1
- package/dist/assets/list-DFvUHI6u.js +0 -103
- package/dist/assets/list-DKV7bt8d.js +0 -2
- package/dist/assets/localization-BAcpaWtp.js +0 -1
- package/dist/assets/logger-__gJZTBC.js +0 -1
- package/dist/assets/login-DcV8dmSg.js +0 -1
- package/dist/assets/passport-item-Bej8KfmX.js +0 -1
- package/dist/assets/preferences-f1ltD9jG.js +0 -1
- package/dist/assets/profile-embed-DKKNp824.js +0 -1
- package/dist/assets/pt-DopXhOk4.js +0 -5
- package/dist/assets/publish-resource-Ce_uMtZk.js +0 -1
- package/dist/assets/ru-pXOMfITZ.js +0 -5
- package/dist/assets/runtime-EaR7CQWh.js +0 -1
- package/dist/assets/sdk-D0Pm334j.js +0 -1
- package/dist/assets/session-DW40g2df.js +0 -1
- package/dist/assets/status-D4MGFqcv.js +0 -1
- package/dist/assets/team-C8yfeoct.js +0 -146
- package/dist/assets/th-Dt7avnjd.js +0 -5
- package/dist/assets/traffic-BjVQYor-.js +0 -1
- package/dist/assets/useLocalStorage-BRaJWH_j.js +0 -1
- package/dist/assets/user-center-V4qQZYhM.js +0 -126
- package/dist/assets/user-sessions-DYh09QrL.js +0 -1
- package/dist/assets/vendor-utils-CddrUZ58.js +0 -213
- package/dist/assets/vi-BbB_zl6_.js +0 -5
- package/dist/assets/wrap-locale-FkxlVw29.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,v as R,p as w,s as p}from"./index-
|
|
1
|
+
import{c as A,v as R,p as w,s as p}from"./index-BFQdM_lT.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import{j as e,y as St,bb as Se,M as ae,ak as f,Q as _,W as u,J as xe,c0 as kt,I as O,aN as Pt,T as I,aj as Rt,b5 as Ee,P as Le,b6 as Q,a5 as Be,z as Ve,A as Ye,cm as It,bf as Tt,U as je,d8 as At,d9 as Mt,at as ee,da as zt,a6 as Y,n as le,D as Et,db as Lt,ar as We,b1 as ke,dc as Bt,aX as Wt,am as J,bp as Nt,bq as ye,a$ as Dt,cV as Ot}from"./vendor-mui-core-B7zoO8f5.js";import{r as y,a as $t,u as Ut,j as Ft}from"./vendor-react-Dvs43sk9.js";import{t as Ze,Z as qt,a7 as _t,R as Ne,D as Ht,C as ce,n as V,A as Gt}from"./vendor-utils-DtY42AM-.js";import{a as Kt,G as Vt,bw as Yt,c as Pe,d as Zt,Y as Qt,bx as Jt,aU as Re,W as fe,bh as Xt,by as er,a5 as tr,aW as rr,a6 as nr,bz as or}from"./index-BF7bSwjJ.js";import{a as T,h as Qe,k as te,g as H,b as E,j as sr}from"./vendor-hooks-BRXKH6Nb.js";import{l as Je}from"./arrow-down.svg-DaFWY5aq.js";import{G as Ie,aa as D,T as N,aL as ir,a9 as Xe,aM as ar,H as q,aN as lr,aO as cr,aP as De,J as dr,D as et,I as Te,aQ as ur,aR as M,a1 as pr,a0 as xr,$ as tt,aS as fr,aT as hr,Z as gr,C as de,a5 as Oe,ab as mr}from"./vendor-ux-B7q8W4Pg.js";import{N as br}from"./list-u8QyXkOA.js";import{d as yr}from"./search-4YYphs0l.js";import{B as $e}from"./bundle-avatar-CopjjSKq.js";import{h as Ue,T as vr}from"./team-BVaQVRGX.js";import{b as wr,d as jr,a as Cr,c as Sr,e as kr,f as Pr,B as Rr}from"./user-center-BrV7Sqsj.js";import{N as rt,U as nt}from"./index-DnMPdyj-.js";import{u as re}from"./use-mobile-DM4d_PLd.js";import Ir from"./index-BhhsbfbV.js";import{f as X}from"./index-DBs9Ljax.js";import{u as ot}from"./index-BtkFo6d6.js";import{U as ve}from"./user-sessions-DMHiVE2_.js";import Tr from"./index-CcHUYWYZ.js";import{o as Ar}from"./vendor-arcblock-B7AoUs4o.js";import{c as Mr,b as ue,a as zr,S as Er}from"./index-D_t0hM3n.js";import"./index-C-DpXzH8.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DO8dY30H.js";import"./util-CmTchaCE.js";import"./base32-BkgeFkJa.js";import"./session-COCrt-qG.js";import"./isURL-CH4qUEqk.js";import"./use-app-logo-Cb6MS9by.js";import"./index-CLmp-nsJ.js";import"./api-IUmhrtIY.js";import"./table-tips-BP283GGZ.js";import"./use-mobile-C_DcJ5SZ.js";import"./passport-item-Ml3CykE7.js";import"./did-address-CcsL3-Qm.js";import"./index-MgFhlLet.js";import"./vendor-mui-x-Qph0dQcg.js";import"./AdapterDayjs-VDBijwaM.js";import"./confirm-Bax75YdO.js";import"./click-to-copy-CVpUD4ji.js";import"./delete-confirm-Db0zAWAY.js";import"./permission-D9Anejwj.js";import"./actions-Bf4UKTeu.js";import"./index-DRYJ0xIl.js";function Lr(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let c=JSON.stringify({rootMargin:n,threshold:l}),p=i.get(c);if(!p){let r=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(c,p)}return{observe:(r,x)=>{p.entryCallbacks.set(r,x),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:s}}var Br="0px",Wr=[0],Nr=Lr();function Dr(t){let s=t?.rootMargin??Br,o=t?.threshold??Wr,n=y.useRef(null),l=y.useRef(null),i=y.useRef(null),[c,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Nr.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,a=>{p(a)}),i.current=v},[s,o]),x=y.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=y.useCallback(C=>{x(),n.current=C,r()},[r,x]),h=y.useCallback(C=>{x(),l.current=C,r()},[r,x]);return[m,{entry:c,rootRef:h}]}var Or=Dr;function $r(t){let[s,o]=Or(t),n=!!o.entry?.isIntersecting,[l,i]=y.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Ur=$r,Fr=100;function qr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=Fr}){let c=y.useRef(o),[p,{rootRef:r,isVisible:x}]=Ur({rootMargin:n});y.useEffect(()=>{c.current=o},[o]);let m=!l&&!t&&x&&s;return y.useEffect(()=>{if(m){let h=setTimeout(()=>{c.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[p,{rootRef:r}]}var _r=qr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:s=8}){return we[t]?e.jsx(f,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}st.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function st({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...c}){const{t:p}=y.useContext(Ie),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],x=g=>{(g!==l||!i)&&o(g)},m=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,k,R)=>e.jsx(_,{disabled:i,onClick:()=>x(g.value),className:`profile-button ${k?"active":""}`,...c,children:g.label},g.value||R),C=(g,k,R)=>e.jsx(_,{variant:"text",disabled:i,onClick:()=>x(g.value),className:`profile-line-button ${k?"active":""}`,...c,children:g.label},g.value||R),v=()=>r?.map((g,k)=>{const R=l===g?.value;return s==="line"?e.jsx(y.Fragment,{children:C(g,R,k)},g.value||k):e.jsx(y.Fragment,{children:h(g,R,k)},g.value||k)}),a=g=>{const{value:k}=g.target;x(k==="all"?"":k)};return s==="select"?e.jsx(St,{sx:{maxWidth:300},children:e.jsx(Se,{value:l||"all",onChange:a,size:"small",label:"Severity",IconComponent:g=>e.jsx(Je,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,k)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||k))})}):e.jsxs(f,{className:"severity-tabs",sx:m,children:[e.jsx(f,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}it.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function it({loading:t,paging:s,onChange:o}){const{t:n}=y.useContext(Ie),l=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,x)=>{o({page:x+1})},c=r=>{const x=Number(r.target.value);o({page:1,pageSize:x})},p=s.page-1<=0?0:s.page-1;return e.jsx(f,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(kt,{component:"div",disabled:t,count:s.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:x,count:m})=>`${r}–${x} / ${m!==-1?m:`${n()}more than ${x}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:c})})}const Hr=y.memo(it),Gr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Fe=6,qe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Kr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},_e=()=>({...Kr,width:"calc(50% - 8px)"});at.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function at({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:c=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:x=()=>{},currentReadFilter:m="all"}){const{t:h}=y.useContext(Ie),[C,v]=y.useState(null),a=!!C,[g,k]=y.useState(i),[R,P]=y.useState(c),[b,z]=y.useState(!1),[L,U]=y.useState(""),[j,S]=y.useState([]);y.useEffect(()=>{k(i),P(c)},[i,c]);const B=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=d=>{(d!==m||!s)&&x(d)},Z=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),U(""),z(!1)},he=()=>{v(null)},oe=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];k(w),t({id:w,severity:R})},se=d=>{const w=R.includes(d)?R.filter(A=>A!==d):[...R,d];P(w),t({severity:w,id:g})},ge=d=>{U(d.target.value)},me=()=>{z(!b)},K=$t.useMemo(()=>{if(!n.size)return[];const d=[];return l==="component"&&d.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,W=w.title||w.meta?.title||"",F=w.appPid||w.appDid;(l==="component"&&F!==A||l==="entity"&&F===A)&&d.push({label:W,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,l,h]);y.useEffect(()=>{if(L.trim()==="")S(K);else{const d=L.toLowerCase(),w=K.filter(A=>A.label.toLowerCase().includes(d));S(w)}},[L,K]);const be=L.trim()!==""||b?j:j.slice(0,Fe);return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(f,{sx:{display:"flex",gap:1.5},children:B.map(d=>e.jsxs(_,{disabled:s,onClick:()=>G(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...o==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(O,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(D,{icon:Gr,hFlip:!0})}),e.jsx(Pt,{open:a,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(f,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(_,{size:"small",onClick:()=>{k([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Rt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Z.map(d=>e.jsx(Le,{elevation:0,sx:_e(R.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...qe},control:e.jsx(Be,{checked:R.includes(d.value),onChange:()=>se(d.value),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(f,{sx:{mb:2},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(f,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ve,{size:"small",placeholder:"search",value:L,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ye,{position:"start",sx:{marginRight:"2px"},children:e.jsx(D,{icon:yr})})}}})})]}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Le,{elevation:0,sx:_e(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...qe},control:e.jsx(Be,{checked:g.includes(d.id),onChange:()=>oe(d.id),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx($e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),j.length>Fe&&L.trim()===""&&e.jsx(_,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(It,{}):e.jsx(Tt,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(f,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(d=>{const w=Z.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),w?w.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=K.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx($e,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Vr=ee(zt)`
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 20px;
|
|
4
|
+
right: 20px;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
@media (max-width: 600px) {
|
|
7
|
+
bottom: 16px;
|
|
8
|
+
right: 16px;
|
|
9
|
+
transform: scale(0.9);
|
|
10
|
+
}
|
|
11
|
+
`;function Yr(){const[t,s]=y.useState(!1);y.useEffect(()=>{const n=Ze(()=>{s(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const o=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(At,{in:t,children:e.jsx(Vr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:o,children:e.jsx(Mt,{})})})}const Zr=ee.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: ${t=>t.inDialog?0:"24px"};
|
|
15
|
+
.MuiContainer-root {
|
|
16
|
+
padding-right: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.profile-button.MuiButtonBase-root {
|
|
20
|
+
border-radius: 9999px;
|
|
21
|
+
margin-right: 2px;
|
|
22
|
+
padding: 5px 12px;
|
|
23
|
+
line-height: 22px;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
border: 1px solid transparent;
|
|
26
|
+
background-color: ${({theme:t})=>t.palette.background.default};
|
|
27
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
border: 1px solid ${({theme:t})=>t.palette.divider} !important;
|
|
30
|
+
}
|
|
31
|
+
.profile-button.active.MuiButtonBase-root,
|
|
32
|
+
.profile-button.active.MuiButtonBase-root:hover {
|
|
33
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
background-color: ${({theme:t})=>le(t.palette.primary.main,.1)};
|
|
36
|
+
border: 1px solid ${({theme:t})=>le(t.palette.primary.main,.24)} !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.profile-button.MuiButtonBase-root:hover {
|
|
40
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.profile-line-button.MuiButtonBase-root {
|
|
44
|
+
margin-right: 2px;
|
|
45
|
+
color: ${({theme:t})=>t.palette.text.secondary};
|
|
46
|
+
padding: 5px 12px;
|
|
47
|
+
line-height: 22px;
|
|
48
|
+
font-size: 13px;
|
|
49
|
+
border: none !important;
|
|
50
|
+
border-radius: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.profile-line-button.active.MuiButtonBase-root {
|
|
54
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
55
|
+
border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.profile-button.MuiButtonBase-root:last-of-type,
|
|
59
|
+
.profile-line-button.MuiButtonBase-root {
|
|
60
|
+
margin-right: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.profile-line-button.MuiButtonBase-root:hover {
|
|
64
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
65
|
+
background-color: unset;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
* {
|
|
69
|
+
scrollbar-width: none; /* Firefox */
|
|
70
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
*::-webkit-scrollbar {
|
|
74
|
+
display: none; /* Chrome, Safari and Opera */
|
|
75
|
+
}
|
|
76
|
+
`;lt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function lt({blocklets:t=[],context:s,pagination:o=!0,inDialog:n=!1,filterType:l="component",toViewAll:i=()=>{},type:c="service"}){const{data:p,paging:r,refresh:x,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:a,initial:g}=s,k=d=>{x({...h,severity:d&&typeof d=="string"?[d]:d||[],paging:{...h.paging,page:1}})},[R]=Ut(),P=T(()=>R.get("id"),[R]),b=xe(d=>d.breakpoints.down("md")),[z,L]=y.useState(0),[U,j]=y.useState(!1),S=y.useMemo(()=>h.read===!1?"unread":"all",[h.read]),B=T(()=>Ze(d=>{if(m)return;const w=p.length,A=p.filter(F=>!Ue(F)).length;let W={...h,append:!0,paging:{...h.paging,...d,currentPage:(r.currentPage||0)+1}};S==="unread"&&A<w&&d.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...d,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),x(W)},500),[p,h,S,r,m,x]);Qe(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=T(()=>p?.length>0&&p.length<z,[p,z]),Z=y.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(d)||A.findIndex(W=>W===d)>-1},[v]),ne=y.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{d.has(W)||d.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const F=W?.did||W.meta?.did;F&&!d.has(F)&&Z(F)&&(W.ancestors=[w],d.set(F,W))})}),d},[t,Z]),he=y.useCallback(()=>{m||B({page:r.page+1})},[r.page,m,B]),[oe]=_r({loading:m,hasNextPage:G,onLoadMore:he}),se=d=>{!d||Ue(d)||C(d.id).then(()=>{n&&i()})},ge=({severity:d,id:w})=>{if(m)return;let A={};l==="component"?A={entityId:[],componentDid:w}:l==="entity"&&(A={componentDid:[],entityId:w}),x({...h,severity:d,...A,paging:{...h.paging,page:1}})},me=d=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=qt(w,"read"),x(w)},K=T(()=>l==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:l==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,l]),be=T(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(Zr,{inDialog:!!n,children:[n?e.jsx(st,{currentTab:be,type:"line",theme:"light",onSelectType:k}):e.jsx(at,{loading:m,blockletMap:ne,unReadCount:a,filterType:l,type:c,selectedId:K,onFilterChange:ge,severity:h.severity,onReadFilterChange:me,currentReadFilter:S}),!b&&m?e.jsx(f,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(br,{data:p,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:c}),o&&!b?e.jsx(Hr,{loading:m,paging:r,onChange:B}):null,o&&b&&(m||G)?e.jsx(f,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!n&&b?e.jsx(Yr,{}):null]})}const Qr=y.memo(lt),$=new Yt;function Ae(t){const{userDid:s=""}={},{session:o}=Kt(),n=T(()=>{if(s)return s;const r=window.location.href,x=_t(r);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:o?.user?.did},[o?.user?.did,s]),l=T(()=>o.user,[o]),i=T(()=>l?n===l?.did:!1,[n,l?.did]),c=te(async()=>{if(await Vt(()=>o?.initialized),i)return o.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,o?.initialized,l]}),p=T(()=>l.passports?.some(r=>r.role===Pe.ROLES.OWNER),[l]);return{currentDid:n,session:o,isMyself:i,user:l,viewUser:c.data,isOwner:p}}function ct({user:t,...s}){const{t:o}=N(),n=Et(),l=T(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===ir.REVOKED}));return p.sort((r,x)=>r.revoked===x.revoked?0:r.revoked?1:-1),Ne(p.filter(r=>!r.display),"role").concat(Ne(p.filter(r=>r.display),"display.content"))},[t?.passports]),i=T(()=>l?.find(p=>p.name===t.role),[l,t?.role]),c=n.palette.primary.main;return l.length===0?e.jsx(f,{children:e.jsx(Xe,{children:o("userCenter.noPassport")})}):e.jsx(f,{...s,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...s.sx},children:l.map(p=>e.jsx(wr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Zt,title:i&&i.role===p.role?o("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===p.role?`0px 2px 4px 0px ${c}, 0px 1px 2px -1px ${c}, 0px 0px 0px 1px ${c} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ct.propTypes={user:u.object.isRequired};function Jr({visible:t,onClose:s,nft:o}){return!t||!o?null:e.jsx(Xr,{children:e.jsx(Lt,{open:t,onClose:s,children:e.jsx(en,{onClick:s,children:e.jsx(rt,{data:nt(o),address:o.address,inset:!0})})})})}const Xr=ee.div`
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
.mask {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mask {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
background: rgba(0, 0, 0, 0.6);
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transition: opacity 0.2s;
|
|
100
|
+
}
|
|
101
|
+
`,en=ee.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
height: 100vh;
|
|
106
|
+
width: 100vw;
|
|
107
|
+
|
|
108
|
+
img,
|
|
109
|
+
object {
|
|
110
|
+
max-width: 90vw;
|
|
111
|
+
max-height: 75vh;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nft-display--inset {
|
|
115
|
+
> .MuiBox-root,
|
|
116
|
+
.nft-display__loading {
|
|
117
|
+
width: 75vmin;
|
|
118
|
+
height: 75vmin;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,tn=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:le(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:le(t.palette.background.paper,1)}}}),rn={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},He="https://main.abtnetwork.io/explorer";function dt({user:t}){const{t:s}=N(),o=re(),[n,l]=y.useState({visible:!1,nft:null}),[i,c]=y.useState({anchorEl:null,props:null}),p=P=>{const b=ce(He,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,c({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(He,"assets",b.address)}})},x=P=>{l({visible:!0,nft:P})},m=H({page:1,size:20}),h=te(async(P=m)=>(await Ht.get(`${Pe.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&m,defaultParams:[m],refreshDeps:[t?.did,m]}),{loading:C,data:v}=h,a=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{m.page=b,h.run(m)},k=E(P=>[e.jsx(O,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(D,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(O,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(O,{size:"small",onClick:b=>{b.stopPropagation(),x(P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:eye",fontSize:18})},"view")]),R=T(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(We,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(We,{width:"20%"}),e.jsx(f,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:s("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Xe,{children:s("userCenter.common.noNFT")})}),e.jsx(f,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(f,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...o?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(rt,{data:nt(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),o?e.jsx(f,{className:"footer-mask",sx:rn,children:k(P)}):e.jsx(f,{className:"mask",sx:tn,children:e.jsx(ke,{direction:"row",spacing:1,children:k(P)})})]},P.address))}),a.next||m.page>1?e.jsx(Bt,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:g,count:Math.ceil(a.total/m.size),size:"small"}):null,e.jsx(Jr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{l({visible:!1,nft:null})}}),e.jsx(ar,{anchorEl:i.anchorEl,onClose:()=>{c({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,a,m.page,m.size,g,i,n]);return e.jsx(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}dt.propTypes={user:u.object.isRequired};function nn(){const{t}=N(),{user:s,isMyself:o,viewUser:n}=Ae();return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[o?e.jsxs(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ct,{user:s})]}):null,e.jsx(dt,{user:o?s:n})]})}const on=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function ut({user:t,onSave:s}){const{t:o,changeLocale:n}=N(),l=H({locale:t.locale,loading:!1}),i=E(async c=>{try{const{value:p}=c.target;l.loading=!0,await $.user.saveProfile({locale:p}),await s("profile"),n(p),l.locale=p}catch(p){q.error(X(p))}finally{l.loading=!1}});return e.jsxs(f,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(f,{children:o("userCenter.commonSetting.locale")}),e.jsx(f,{children:e.jsx(Se,{value:l.locale,onChange:i,size:"small",IconComponent:c=>e.jsx(Je,{...c,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||on).map(c=>e.jsx(ae,{value:c.code,children:c.name},c.code))})})]})}ut.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function Ce({onTest:t=V,onDelete:s=V,onSave:o=V,onCancel:n=V,type:l="slack",url:i="",edit:c=!1}){const{t:p}=N(),r=H({type:l||"slack",url:i||"",edit:c??!1,error:"",loading:!1}),x=E(()=>r.url?Qt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=l||"slack",r.error="",r.loading=!1,n()}),h=E(async a=>{r.loading=!0,await t(a),r.loading=!1}),C=E(a=>()=>{x()&&a({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Y,{size:16}):e.jsx(O,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(D,{icon:jr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(f,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Se,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:a=>{r.type=a.target.value},children:[e.jsx(ae,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ve,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:a=>{r.url=a.target.value,x()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Ye,{position:"end",children:v})}}}),e.jsx(f,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(O,{color:"success",onClick:C((...a)=>{o(...a),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:lr})}),e.jsx(O,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:cr})})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Cr})}),e.jsx(O,{color:"error",onClick:()=>{s({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Sr})})]})})]})]})}Ce.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function ie({title:t=void 0,description:s=void 0,value:o,onChange:n,isMobile:l}){const i=E(c=>{c.stopPropagation()});return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{checked:o,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:l?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:l?"normal":"nowrap"},children:[t,s]})]})}ie.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function pt({user:t,isMobile:s}){const{t:o}=N(),n=H({showAdd:!1}),l=te(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...l?.data?.notifications||{}}),[l?.data?.notifications]),c=T(()=>l?.data?.webhooks||[],[l?.data?.webhooks]),p=E(async v=>{try{await $.user.saveUserNotificationConfig(v),q.success(o("userCenter.saveSuccess")),l.run()}catch(a){q.error(X(a))}}),r=E(async(v,a)=>{await p({notifications:{[v]:a}})}),x=async v=>{try{await $.user.testNotificationWebhook(v),q.success(o("userCenter.webhookTested"))}catch(a){q.error(X(a))}},m=E(async v=>{await p({webhooks:c.filter((a,g)=>g!==v)})}),h=E(async(v,a)=>{await p({webhooks:c.map((g,k)=>k===v?a:g)})}),C=E(async v=>{await p({webhooks:[...c,v]}),n.showAdd=!1});return l.error?e.jsx(Wt,{severity:"error",children:l.error.message}):l.loading||!l.data?e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(ie,{value:i.wallet,isMobile:s,title:o("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:De(t)&&e.jsx(dr,{did:De(t),showQrcode:!1,showAvatar:!s,copyable:!0,compact:!0,responsive:!0,startChars:s?2:6})}),e.jsx(ie,{value:i.email,isMobile:s,onChange:v=>r("email",v.target.checked),title:o("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:s,value:i.push,title:o("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(ke,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[c.map((v,a)=>e.jsx(Ce,{onTest:x,onDelete:()=>m(a),onSave:(...g)=>h(a,...g),type:v.type,url:v.url,edit:!1},`${a}_${v.url}`)),n.showAdd&&e.jsx(Ce,{onTest:x,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(et,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(D,{icon:kr}),onClick:()=>{n.showAdd=!0},children:o("userCenter.addWebhook")})]})]})}pt.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function xt({item:t}){const s=Te(),{blocklet:o}=Jt(),{confirmApi:n,confirmHolder:l}=Re(),i=H({loading:!1}),{t:c}=N(),{session:p}=y.use(fe),{bindOAuth:r,unbindOAuth:x,setBaseUrl:m,baseUrl:h}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),a=T(()=>ur[t?.provider]||"unknown",[t?.provider]),g=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,z)=>{n.open({title:c("userCenter.thirdPartyLogin.disconnectPasskey",{name:a}),content:c("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:a}),confirmButtonText:c("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:c("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(b).catch(z),L()},onCancel:b})});return}try{i.loading=!0,await new Promise((b,z)=>{if(t?._bind)n.open({title:c("userCenter.thirdPartyLogin.confirmUnbind",{name:a}),content:c("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:a}),confirmButtonText:c("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:c("common.cancel"),onConfirm(L){x({session:p,connectedAccount:{...Gt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),L()},onCancel:b});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:b,onCancel:z});else{const L=h,U=window?.blocklet;let j="/";const S=pr(U),B=xr(U);S&&B?.appPid&&p?.user?.sourceAppPid&&(j=B.appUrl),m(j),v(o?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{m(L),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{i.loading=!1}}),k=E(b=>b.provider===M.WALLET&&b.did?c("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?c("userCenter.thirdPartyLogin.mainAccount"):b?._bind?c("userCenter.thirdPartyLogin.disconnect"):c("userCenter.thirdPartyLogin.connect")),R=E(b=>b.provider===M.WALLET&&b.did?c("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY?c("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider?c("userCenter.thirdPartyLogin.mainProviderCantRemove"):""),P=E(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(s.arcSphere||s.wallet)?!0:!!t._mainProvider,[s.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(f,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Xt,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:b})=>t?.provider===M.GITHUB&&b.mode==="dark"?"invert(1)":"none"}}),e.jsx(f,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:a}),t.userInfo?.email||t.did?e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(f,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(J,{title:e.jsx(e.Fragment,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(tt,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(f,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]})}),children:e.jsx(f,{component:D,icon:er,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(J,{title:R(t),placement:"auto",children:e.jsx(f,{children:e.jsx(et,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,L=b.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(D,{icon:Pr}),onClick:g,disabled:P(t),loading:i.loading,children:k(t)})})}),l]})}xt.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function ft({user:t}){const{session:s}=y.use(fe),[o,n]=y.useState({}),{getOAuthConfigs:l}=s.useOAuth(),i=Te();sr(async()=>{const r=await l({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const c=T(()=>{const r=Object.keys(o).map(x=>({...o[x],provider:x})).filter(x=>x.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[o]),p=T(()=>{const r=fr(t);let x=!1,m="",h=hr(t);const C=r.find(a=>a.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(a=>a.provider==="google")||(x=!0,m=M.GOOGLE,h===M.AUTH0&&(h=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(a=>a.provider===M.APPLE)||(x=!0,m=M.APPLE,h===M.AUTH0&&(h=M.APPLE))),C.id.startsWith("github|")&&(r.some(a=>a.provider===M.GITHUB)||(x=!0,m=M.GITHUB,h===M.AUTH0&&(h=M.GITHUB)))),c.map(a=>{if(a.provider===M.AUTH0&&x)return null;const g=x&&a.provider===m?r.find(k=>k.provider===M.AUTH0):r.find(k=>k.provider===a.provider);return g?{...a,provider:a.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:a.provider===h}:{...a,provider:a.provider,_rawProvider:a.provider,_mainProvider:a.provider===h}}).filter(a=>!(!a||a.provider===M.PASSKEY&&!a.did)).sort((a,g)=>a._mainProvider?-1:a?.order!==void 0&&g?.order!==void 0?a.order-g.order:a?.order!==void 0?-1:1)},[t?.connectedAccounts,c]);return e.jsxs(f,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(xt,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(tr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ft.propTypes={user:u.object.isRequired};function ht({configList:t,onSave:s}){const[o,n]=y.useState(t),{t:l}=N(),i=E(async(c,p)=>{try{const r=await $.user.saveUserPrivacyConfig({[c]:!p});n(o.map(x=>({...x,value:r?.[x.key]??x.value}))),q.success(l("userCenter.saveSuccess")),s("privacy")}catch(r){q.error(X(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:o.map(c=>c.isPrivate?null:e.jsx(ot,{checked:!c.value,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("userCenter.toPublic",{name:c.name})})},size:"small",onChange:p=>i(c.key,p.target.checked)},c.key))})}ht.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function gt({user:t,sessionUser:s}){const o=T(()=>(t?.passports||[])?.find(n=>n.name===s.role),[t?.passports,s?.role]);return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(tt,{size:40,variant:"circle",shape:"circle",src:s.avatar,did:s.did,sx:{flexShrink:0}}),e.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(J,{title:s.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:s.fullName})}),e.jsx(je,{label:o?.title||o?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(J,{title:s.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.email})})]})]})}gt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const sn=()=>Promise.resolve(""),Ge=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ke={display:"flex",justifyContent:"flex-end",textAlign:"right"},an=new rr({concurrency:1}),Me=y.memo(({userSession:t,isMobile:s=!1})=>{const o=H({loading:!0,ipRegion:""}),{t:n}=N();return y.useEffect(()=>{an.add(async()=>{try{o.ipRegion=await sn(t.lastLoginIp)}finally{o.loading=!1}})},[o,t.lastLoginIp]),e.jsx(f,{...s&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:o.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:o.ipRegion}),e.jsx(I,{variant:"body2",color:"grey",children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{children:t.lastLoginIp||n("userCenter.unknown")}),o.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Y,{size:12,color:"inherit"})}):null]})})});Me.propTypes={userSession:u.object.isRequired,isMobile:u.bool};Me.defaultProps={isMobile:!1};function mt({user:t,showAction:s=!0,showUser:o=!0,getUserSessions:n,showOffline:l=!1}){const i=H({status:"online",page:1,pageSize:10}),c=H({online:0,expired:0,offline:0}),p=gr(),{t:r}=N(),x=re({key:"md"}),m=xe(j=>j.breakpoints.down("lg")),{confirmApi:h,confirmHolder:C}=Re(),v=E(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),S=j?.paging?.total||0;return c[i.status]=S,{total:S,list:j?.list||[]}});Qe(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});c.expired=j?.paging?.total||0;const S=await n({page:1,pageSize:1,status:"offline"});c.offline=S?.paging?.total||0});const a=te(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=T(()=>a.data?.list||[],[a.data?.list]),k=T(()=>{const{status:j}=i;return j==="online"?c[j]<=1:c[j]===0},[g,p]),R=T(()=>de({},x?Ke:{}),[x]),P=E(({visitorId:j})=>{h.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({visitorId:j,includeFederated:!0});const{page:S=0}=i,{list:B=[]}=a.data||{},G=B.length||0;S>1&&G===1&&(i.page=Math.max(S-1,1)),a.refresh(),h.close()}})}),b=E(()=>{h.open({title:r("userCenter.logoutAllSession",{type:r(i.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(i.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({status:i.status,visitorId:p,includeFederated:!0}),i.page=1,a.refresh(),h.close()}})}),z=[];s&&z.push(e.jsx(J,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(_,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:k,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const L=T(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:a.data?.total||0}),[a.data?.total,i.page,i.pageSize]),U=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const S=g[j],B=Ge(S?.ua);return e.jsx(f,{sx:R,children:[B.os?.name,B.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const S=g[j],B=Ge(S?.ua);return e.jsx(f,{sx:R,children:[B.browser?.name,B.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.extra?.walletOS||r("userCenter.unknown")})}}},o&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:de({minWidth:150,maxWidth:250},x?Ke:{}),children:e.jsx(gt,{sessionUser:S.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.createdAt?e.jsx(Oe,{value:S.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!l&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:S.status==="expired"?r("userCenter.expired"):e.jsx(Oe,{value:S.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(Me,{userSession:S,isMobile:x})}}},s&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const S=g[j];return e.jsx(f,{sx:R,children:e.jsx(_,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===S.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:S.visitorId}),children:S.status==="expired"?r("userCenter.remove"):p===S.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(f,{className:"pc-user-sessions",sx:{maxWidth:x?"unset":m?"calc(100vw - 300px)":"100%",...x&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...x&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[C,e.jsx(mr,{count:a.data?.total||0,data:g,columns:U,customButtons:z,options:L,loading:a.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.expired,")"]})]})}),l?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}mt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function bt({onDestroySelf:t=void 0}){const{confirmHolder:s}=Re(),{t:o}=N(),{session:n}=y.use(fe),l=E(async()=>{if(!t||typeof t!="function")return;const i=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await i(),n.logout()}catch(c){q.error(c?.message||o("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(f,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:o("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:o("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(_,{variant:"contained",color:"error",size:"small",onClick:l,children:o("userCenter.dangerZone.delete")})]})}),s]})}bt.propTypes={onDestroySelf:u.func};function ln(){const t=re({key:"md"}),s=xe(l=>l.breakpoints.down("lg")),o={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>de({},t?o:{}),[t]);return e.jsx(f,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":s?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:l=>`${l.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Tr,{isSelf:!0,columnSx:n})})}function yt({onDestroySelf:t=void 0,userCenterTabs:s=[]}){const{t:o}=N(),{user:n,session:l,isMyself:i,isOwner:c}=Ae(),r=Te().arcSphere,x=re({key:"md"}),m=te(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=T(()=>s.map(a=>({key:a.value,name:a.label,value:a.protected,isPrivate:a.isPrivate})),[s]),C=E(async a=>a==="privacy"?(await m.runAsync(),m.data):(a==="profile"&&await l.refresh(),null));y.useEffect(()=>{const a=window.location.hash.slice(1);a&&document.getElementById(a)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:o("userCenter.commonSetting.title"),value:"common",content:e.jsx(ut,{user:n,onSave:C})},{label:o("userCenter.notificationManagement"),value:"notification",content:e.jsx(pt,{user:n,isMobile:x})},{label:o("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ft,{user:n})},{label:o("common.accessKeys"),value:"accessKeys",content:e.jsx(ln,{isSelf:!0})},{label:o("common.mcpServers"),value:"mcpServers",content:e.jsx(Ir,{})},{label:o("userCenter.privacyManagement"),value:"privacy",content:e.jsx(ht,{configList:h,onSave:C})},{label:o("userCenter.sessionManagement"),value:"session",content:e.jsx(mt,{user:n,showUser:!1,getUserSessions:a=>$.userSession.getMyLoginSessions({},a)})},!c&&t&&typeof t=="function"?{label:o("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(bt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,x,c,t]);return i?e.jsx(f,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(a=>a?e.jsxs(f,{id:a.value,sx:de({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},a.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:a.label}),e.jsx(f,{sx:{mt:2.5},children:a.content})]},a.value):null)}):null}yt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const vt=y.createContext({}),{Provider:cn,Consumer:ao}=vt;function wt({children:t}){const[s]=y.useState(!1),{session:o}=y.use(fe),{user:n}=o,[l,i]=y.useState(),c=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const p=async()=>{i(void 0)},r=h=>{},x=async h=>{i(h),await r(h.endpoint)},m=!!(c&&l);return e.jsx(cn,{value:{loading:s,spaceGateway:l,session:o,deleteSpaceGateway:p,updateSpaceGateway:x,storageEndpoint:c,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function ze(){return y.use(vt)}wt.propTypes={children:u.node.isRequired};function dn(t){const s=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(s,"space",n)}function jt({session:t,spaceGateway:s,spaceStatus:o,refresh:n}){return e.jsxs(ke,{direction:"row",spacing:1,children:[o===Mr.DISCONNECTED&&e.jsx(ue,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:l=>{console.error(l),q.error(X(l))}}),e.jsx(O,{size:"small",LinkComponent:Dt,href:dn(s.endpoint),target:"_blank",children:e.jsx(Ot,{})})]})}jt.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function Ct({spaceGateway:t=void 0}){const{t:s}=N(),{updateSpaceGateway:o,session:n}=ze(),l=re(),i=({spaceGateway:c})=>o(c);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:s("userCenter.storage.spaces.connected.title")}),!l&&e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(f,{children:t&&e.jsx(zr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:c=>e.jsx(jt,{session:n,...c})},t.endpoint)}),l&&e.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}Ct.propTypes={spaceGateway:u.object};function un(){const{t}=N(),{updateSpaceGateway:s,session:o}=ze(),n=({spaceGateway:l})=>s(l);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Er,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(f,{children:e.jsx(ue,{session:o,onSuccess:n})})]})}function pn(){const{spaceGateway:t,hasStorageEndpoint:s,loading:o}=ze(),{isMyself:n}=Ae();return n?o?e.jsx(Ar,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(fn,{children:e.jsx(f,{sx:{maxWidth:"720px"},children:s?e.jsx(Ct,{spaceGateway:t}):e.jsx(un,{})})}):null}function xn(){return e.jsx(wt,{children:e.jsx(pn,{})})}const fn=ee(f)`
|
|
122
|
+
height: 100%;
|
|
123
|
+
overflow-y: auto;
|
|
124
|
+
`;function lo(){const{api:t}=nr(),s=y.useRef(null),n=Ft().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),c=or(),p=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(x=>({...x,meta:{...x,did:x.did,name:x.name||x.title||"",logo:"logo.png"}}))})),r=async x=>{const{input:m,sessionId:h}=x;try{await t.destroySelf({input:{...m,sessionId:h}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(vr,{children:e.jsxs(Rr,{ref:s,embed:i==="1",currentTab:n?ce(Pe.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(Qr,{blocklets:[p],context:c}):null,n==="nfts"?e.jsx(nn,{}):null,n==="settings"?e.jsx(yt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(xn,{}):null]})})}export{lo as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l}from"./vendor-react-Dvs43sk9.js";import{T as C,$ as E,L,N as M}from"./vendor-ux-B7q8W4Pg.js";import{k as y}from"./vendor-hooks-BRXKH6Nb.js";import{j as e,ak as s,a6 as $,aX as w,b1 as P,y as W,x as _,bb as B,M as N,T as z,a$ as A,I as D,bc as K,Q as F,W as U}from"./vendor-mui-core-B7zoO8f5.js";import{c as S,Z as k}from"./index-BF7bSwjJ.js";import{a as q}from"./api-IUmhrtIY.js";import{T as V}from"./table-tips-BP283GGZ.js";import{u as G}from"./team-BVaQVRGX.js";import{u as H}from"./session-COCrt-qG.js";import"./vendor-utils-DtY42AM-.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.js";import"./use-mobile-C_DcJ5SZ.js";import"./isURL-CH4qUEqk.js";import"./use-app-logo-Cb6MS9by.js";function T({endpoint:i}){const[t,a]=l.useState("mcp-link"),x=k(),{api:h}=k(),{teamDid:m}=G(),{t:c,locale:p}=C(),{session:r}=H(),{data:u,run:o,loading:g}=y(()=>{const f={owner:S.SERVER_ROLES.ADMIN}[r?.user?.role]||r?.user?.role;return h.createAccessKey({input:{teamDid:m,passport:f,authType:"simple",remark:"Generated by MCP Servers"}})},{manual:!0}),{imgPrefix:n}=x,j=l.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[n]),v=j.find(d=>d.value===t),b=l.useMemo(()=>u?.data?.accessKeySecret,[u]),R=l.useMemo(()=>!b&&t!=="mcp-link",[b,t]),I=d=>{const f=`npx @blocklet/install-mcp@latest i ${i} --client ${d} --streamableHTTP --oauth2Bearer ${b}`;switch(d){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return f;case"mcp-link":default:return i}};return e.jsxs(s,{className:"mcp-servers-container",children:[e.jsx(L,{tabs:j,current:t,onChange:a,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(z,{component:"span",variant:"h6",sx:{fontWeight:"bold",my:2},children:t==="mcp-link"?v?.label:`${v?.label} ${c("installCommand")}`}),t!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${p}/mcp-${t}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(K,{fontSize:"small"})})})]}),e.jsxs(s,{className:"mcp-servers-codeblock",sx:{position:"relative","& pre":{borderRadius:1},"& .codeblock__inner":{overflow:"auto !important",borderRadius:1}},children:[e.jsx(M,{code:I(t),language:"shell",style:{margin:0}}),R&&e.jsx(s,{sx:{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:g?e.jsx($,{}):e.jsx(F,{variant:"contained",color:"primary",onClick:o,size:"small",children:`${c("common.generate")} ${c("command")}`})})]})]})]})}T.propTypes={endpoint:U.string.isRequired};function ce(){const[i,t]=l.useState(null),{t:a,locale:x}=C(),h=`${window?.blocklet?.appUrl}${S.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:m,loading:c,error:p}=y(()=>Promise.all([q.get(h)])),r=l.useMemo(()=>m?.[0]?.data?.servers||[],[m]);l.useEffect(()=>{r?.length&&t(r.find(o=>o.did===window?.blocklet?.did)||r[0])},[r]);const u=o=>{const g=o.target.value;t(r.find(n=>n.did===g))};return c?e.jsx(s,{children:e.jsx($,{})}):p?e.jsx(w,{color:"error",children:p?.message}):r?.length?e.jsxs(P,{sx:{gap:2,maxWidth:1200},children:[e.jsx(V,{title:a("mcp.listTitle"),tooltipTitle:a("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${x}/mcp-server`}),e.jsxs(W,{fullWidth:!0,children:[e.jsx(_,{id:"server-select-label",children:a("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:i?.did||"",label:a("mcp.available"),onChange:u,children:r.map(o=>e.jsx(N,{value:o.did,children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(E,{variant:"rounded",shape:"square",did:o.did,src:o.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:o.name})]})},o.did))})]}),i&&e.jsx(T,{endpoint:i.endpoint})]}):e.jsx(w,{color:"warning",children:a("mcp.noServer")})}export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,b6 as e,be as a,W as s}from"./vendor-mui-core-
|
|
1
|
+
import{j as i,b6 as e,be as a,W as s}from"./vendor-mui-core-B7zoO8f5.js";import{l}from"./vendor-ux-B7q8W4Pg.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,T as i}from"./vendor-mui-core-
|
|
1
|
+
import{j as e,T as i}from"./vendor-mui-core-B7zoO8f5.js";import{K as p,L as c}from"./vendor-utils-DtY42AM-.js";import{l as x}from"./vendor-ux-B7q8W4Pg.js";function y({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(d,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const d=x("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
|
|
4
4
|
justify-content: flex-start;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as m,j as e,Q as c,bf as B,P as C,ai as E,o as I,bg as P,O as z}from"./vendor-mui-core-
|
|
1
|
+
import{M as m,j as e,Q as c,bf as B,P as C,ai as E,o as I,bg as P,O as z}from"./vendor-mui-core-B7zoO8f5.js";import{r as o}from"./vendor-react-Dvs43sk9.js";import{n as A}from"./vendor-utils-DtY42AM-.js";import{l as p}from"./vendor-ux-B7q8W4Pg.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[g,l]=o.useState(!1),n=o.useRef(null),j=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:g,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:j})})})})]})}L.Item=m;const v=p(P)`
|
|
2
2
|
> .MuiButtonBase-root:last-of-type {
|
|
3
3
|
min-width: 2em;
|
|
4
4
|
padding-left: 0;
|