@abtnode/blocklet-services 1.17.3-beta-20251126-121502-d0926972 → 1.17.3-beta-20251128-095123-a76cb6bc
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/routes/oauth/client.js +11 -1
- package/api/routes/user.js +23 -3
- package/api/services/auth/connect/gen-access-key.js +1 -0
- package/api/services/auth/connect/verify-destroy.js +32 -31
- package/api/services/auth/connect/verify-elevated.js +1 -0
- package/api/services/notification/queue.js +34 -7
- package/api/util/user-util.js +48 -0
- package/dist/assets/{AdapterDayjs-B2uxdBcK.js → AdapterDayjs-OZNn2tpO.js} +1 -1
- package/dist/assets/{Google-mmkrFmA4.js → Google-PoHjNVzr.js} +1 -1
- package/dist/assets/{access-control-BsrYt8sR.js → access-control-2f5ZUYvn.js} +1 -1
- package/dist/assets/actions-CIp6hu8_.js +1 -0
- package/dist/assets/{add-component-core-DdA5-pKs.js → add-component-core-C8wP5DXr.js} +35 -35
- package/dist/assets/add-resource-D-X1I5_V.js +1 -0
- package/dist/assets/{addon-DMnO8VZk.js → addon-DWBAL8PD.js} +2 -2
- package/dist/assets/{advanced-D4bpKYrU.js → advanced-l0XvYXrR.js} +2 -2
- package/dist/assets/{aigne-BKYy4lDi.js → aigne-CsKyE9Oj.js} +1 -1
- package/dist/assets/api-DIucIOLX.js +1 -0
- package/dist/assets/{appearance-CoZeiSDb.js → appearance-CDE_5zqq.js} +1 -1
- package/dist/assets/{ar-Dz5bxvSE.js → ar-BJZY7v5z.js} +2 -2
- package/dist/assets/{arrow-down.svg-arX2hS9A.js → arrow-down.svg-C5rjQJG2.js} +1 -1
- package/dist/assets/{audit-logs-Tol8dkkk.js → audit-logs-CvWoJqnE.js} +2 -2
- package/dist/assets/{authorize-Bma44S9y.js → authorize-CgqsMeVu.js} +1 -1
- package/dist/assets/{base-chart-Gh7OtL-d.js → base-chart-DvlyWvB2.js} +1 -1
- package/dist/assets/{base32-HmSqZ9zU.js → base32-AX-I0UaR.js} +1 -1
- package/dist/assets/bind-account-C_93rOKB.js +1 -0
- package/dist/assets/{branding-CnmWjFbu.js → branding-C56V2vpD.js} +1 -1
- package/dist/assets/branding-D-5p5wha.js +1 -0
- package/dist/assets/{branding-Fj3LseIw.js → branding-MYLazJOV.js} +5 -5
- package/dist/assets/{bundle-avatar-CeDsDt5-.js → bundle-avatar-BdQv8P8t.js} +1 -1
- package/dist/assets/button-8Nchte_6.js +1 -0
- package/dist/assets/click-to-copy-DZ_4RDjR.js +1 -0
- package/dist/assets/{cloneDeep-D_9o-MDF.js → cloneDeep-B7kH4W7U.js} +1 -1
- package/dist/assets/{collapse-BlkBpbz3.js → collapse-CHg4yEHL.js} +1 -1
- package/dist/assets/{complete-DetpIm2X.js → complete-BSud_fLS.js} +1 -1
- package/dist/assets/{component-Br_A0gxQ.js → component-Z_4kfVE0.js} +2 -2
- package/dist/assets/{config-hHQ1dQ0r.js → config-QNXiPFng.js} +1 -1
- package/dist/assets/{config-BZ68qemi.js → config-YjT0ptkh.js} +6 -6
- package/dist/assets/{config-navigation-CIiX_S1E.js → config-navigation-BdlyLYhE.js} +2 -2
- package/dist/assets/{config-space-DcxPvrsQ.js → config-space-BSBup5aB.js} +1 -1
- package/dist/assets/{config-DaTqZM7S.js → config-tFuMpr42.js} +1 -1
- package/dist/assets/{confirm-CQifLVQz.js → confirm-DPD7yjeR.js} +1 -1
- package/dist/assets/{connect-BYne4RoU.js → connect-C51xT0zT.js} +1 -1
- package/dist/assets/{connect-DCXdY6aM.js → connect-DFCRlbN9.js} +1 -1
- package/dist/assets/connect-to-B-qzDPba.js +1 -0
- package/dist/assets/{content-layout-CpbYUNJ8.js → content-layout-RghQFMLL.js} +1 -1
- package/dist/assets/{create-passport-svg-hAgKE5uX.js → create-passport-svg-BZVXsAoP.js} +1 -1
- package/dist/assets/createClass-dlbhjEVd.js +1 -0
- package/dist/assets/{dashboard-PCrwcW_N.js → dashboard-Cto_eSyJ.js} +2 -2
- package/dist/assets/{de-Ztxy5vEB.js → de-BF0NHTXz.js} +2 -2
- package/dist/assets/{delete-confirm-DP77Lldw.js → delete-confirm-G3d9EUZU.js} +1 -1
- package/dist/assets/{did-address-CLsSdiw3.js → did-address-CihvGtuj.js} +1 -1
- package/dist/assets/domain-CJ3ZeLQs.js +9 -0
- package/dist/assets/{domain-action-card-DmLVoK6X.js → domain-action-card-BAzAGOUR.js} +2 -2
- package/dist/assets/domains-CbYSc-np.js +1 -0
- package/dist/assets/{email-zUlL8Ooc.js → email-BbooLxm_.js} +1 -1
- package/dist/assets/{empty-spinner-DiVQXbse.js → empty-spinner-2ylB84wv.js} +1 -1
- package/dist/assets/engine-7kGw4V-U.js +1 -0
- package/dist/assets/{es-Cd-spoK_.js → es-Dv2m4LXp.js} +2 -2
- package/dist/assets/{exchange-passport-4jMKVLBc.js → exchange-passport-B7UqzIxE.js} +1 -1
- package/dist/assets/{form-BhkklUts.js → form-Ci18kVmF.js} +3 -3
- package/dist/assets/{form-text-input-BFhD3mCK.js → form-text-input-CBL3JAev.js} +1 -1
- package/dist/assets/{form-wrapper-B9XdbV9a.js → form-wrapper-CqFSijKV.js} +1 -1
- package/dist/assets/{fr-k8jXteN1.js → fr-BGhg9oO3.js} +2 -2
- package/dist/assets/{fuel-_LHEMXNX.js → fuel-BE74WZ6j.js} +1 -1
- package/dist/assets/{gen-access-key-Cuu-iyxE.js → gen-access-key-s40ict9x.js} +1 -1
- package/dist/assets/{gen-simple-access-key-ud5DXiqY.js → gen-simple-access-key-D8YVPusH.js} +1 -1
- package/dist/assets/get-safe-url-DT47R_1b.js +1 -0
- package/dist/assets/{hi-CvpI1-tn.js → hi-CPfDhW8g.js} +2 -2
- package/dist/assets/{home-D-jA_4Lm.js → home-C9ok8LuA.js} +1 -1
- package/dist/assets/{id-D8coHs1U.js → id-9TUzKF6k.js} +2 -2
- package/dist/assets/{iframe-DwMwGxmX.js → iframe-BoFxpqBT.js} +1 -1
- package/dist/assets/{index-Cvr1OSm0.js → index-B9Igf2rm.js} +1 -1
- package/dist/assets/{index-D0XVz0dc.js → index-BF7MtybM.js} +1 -1
- package/dist/assets/{index-BO3UQZPi.js → index-BJz7bmlp.js} +1 -1
- package/dist/assets/{index-DjE2GQIM.js → index-BpNkmzkz.js} +2 -2
- package/dist/assets/{index-DDNvzM4M.js → index-ByWjeUNp.js} +7 -7
- package/dist/assets/{index-s6v6fZUe.js → index-C0TbDTja.js} +4 -4
- package/dist/assets/{index-BNBVWXSX.js → index-CCaP8G-5.js} +2 -2
- package/dist/assets/index-CFLPfp6M.js +124 -0
- package/dist/assets/index-CMuQuCcn.js +1 -0
- package/dist/assets/{index-xERuGIw0.js → index-CN4lpn74.js} +132 -134
- package/dist/assets/{index-auhzedGi.js → index-CO3X6G_g.js} +1 -1
- package/dist/assets/{index-ByEQy1Lz.js → index-CTzNs74h.js} +2 -2
- package/dist/assets/index-CUHwnb5s.js +120 -0
- package/dist/assets/index-CekShFJg.js +6 -0
- package/dist/assets/{index-BQyVf1E3.js → index-CgnIkelt.js} +1 -1
- package/dist/assets/index-CimoFUNL.js +7 -0
- package/dist/assets/index-CionuFLd.js +1 -0
- package/dist/assets/{index-Cpsil-_J.js → index-ClpPXMAi.js} +5 -5
- package/dist/assets/{index-BLT40lDy.js → index-CpVl3QY6.js} +8 -8
- package/dist/assets/{index-DYMBrhSA.js → index-DA2Pny4B.js} +1 -1
- package/dist/assets/{index-B65qJcbt.js → index-DA4iEV0M.js} +1 -1
- package/dist/assets/index-DQB7DBpQ.js +29 -0
- package/dist/assets/{index-kzb9GjyJ.js → index-DXYr8-bJ.js} +1 -1
- package/dist/assets/{index-D_l_jjH3.js → index-DaIayPTI.js} +2 -2
- package/dist/assets/{index-B3nY7xOz.js → index-DbmL_qgW.js} +8 -8
- package/dist/assets/{index-CR-yimk0.js → index-DrJnt_vf.js} +4 -4
- package/dist/assets/index-DsQDfClt.js +1 -0
- package/dist/assets/index-DtUiw_0b.js +55 -0
- package/dist/assets/{index-BcssdfWc.js → index-YApW_a5L.js} +1 -1
- package/dist/assets/{index-B1hEtoFm.js → index-bbu7QFpz.js} +1 -1
- package/dist/assets/{index-CoJqP_N2.js → index-h3JyhqqC.js} +1 -1
- package/dist/assets/{index-KzZiqY9D.js → index-tukXJbMk.js} +6 -6
- package/dist/assets/{index-BWgjTPxl.js → index-yGC4DbEU.js} +1 -1
- package/dist/assets/{invitation-gK2vIEsH.js → invitation-XkzkbIwS.js} +2 -2
- package/dist/assets/{invitations-lfws_T2N.js → invitations-Cy_dNcIE.js} +1 -1
- package/dist/assets/{invite-CGloPprm.js → invite-BSYvges4.js} +1 -1
- package/dist/assets/{isURL-CDvz38EO.js → isURL-DskT4RKm.js} +2 -2
- package/dist/assets/{issue-passport-Dl3X8TTW.js → issue-passport-opYjcMCB.js} +1 -1
- package/dist/assets/{item-CTQ1F-Dd.js → item-DToR6hlW.js} +1 -1
- package/dist/assets/{ja-Dkn5OA2r.js → ja-DT5bRsBF.js} +2 -2
- package/dist/assets/{ko-DXfRo0NY.js → ko-CJn9PyPz.js} +2 -2
- package/dist/assets/{landing-page-DKcKat1r.js → landing-page-DFIsLbb7.js} +1 -1
- package/dist/assets/{launch-result-message--rgseiAA.js → launch-result-message-AcBN2VCj.js} +1 -1
- package/dist/assets/{layout-D1wjW1Oy.js → layout-CkQwn0NR.js} +1 -1
- package/dist/assets/list-D4Gs036Z.js +103 -0
- package/dist/assets/{list-MeDKce8j.js → list-D5UHzaOx.js} +1 -1
- package/dist/assets/{list-header-DOS7AnGs.js → list-header-CA-QkwGq.js} +1 -1
- package/dist/assets/localization-DzNUtlVV.js +1 -0
- package/dist/assets/{log-B9KcwZD3.js → log-RL9u31-I.js} +1 -1
- package/dist/assets/logger-DQUu6ucJ.js +1 -0
- package/dist/assets/login-CqeIoGod.js +1 -0
- package/dist/assets/{login-oauth-callback-f64z-iJf.js → login-oauth-callback-0Nu4mPXk.js} +1 -1
- package/dist/assets/{logo-uploader-D6c2iUqg.js → logo-uploader-Cv5-KB8L.js} +1 -1
- package/dist/assets/lost-passport-CoOQTlhO.js +167 -0
- package/dist/assets/{observability-D1A-1uvj.js → observability-Bzq6nAvX.js} +1 -1
- package/dist/assets/{omit-BSwpPhgW.js → omit-W13eVnqC.js} +1 -1
- package/dist/assets/{open-window-7JDNMA9V.js → open-window-BHKfDlI-.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-CljuJ4kk.js → over-due-invoice-payment-MovV2cwi.js} +1 -1
- package/dist/assets/{overview-CI-TDe1L.js → overview-CCLvrJi4.js} +2 -2
- package/dist/assets/{page-header-Dh_UA7fa.js → page-header-B4MDj6gy.js} +1 -1
- package/dist/assets/passport-CqvORkfw.js +1 -0
- package/dist/assets/{passport-item-DwumTPQv.js → passport-item-BMa8rd85.js} +1 -1
- package/dist/assets/{permission-Blt9Onuq.js → permission-DLnMVuoy.js} +1 -1
- package/dist/assets/{playground-kZ9J2CEx.js → playground-C71u8_tm.js} +1 -1
- package/dist/assets/preferences-CDvS8_ng.js +1 -0
- package/dist/assets/profile-embed-C8ofqlbV.js +1 -0
- package/dist/assets/pt-K9FK6Ube.js +5 -0
- package/dist/assets/publish-resource-CMoJF5DA.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-CbCp5m8Z.js → react-beautiful-dnd.esm--C1KYPc1.js} +1 -1
- package/dist/assets/{react-stripe.esm-C8Keba5n.js → react-stripe.esm-DlJMzZK2.js} +1 -1
- package/dist/assets/{required-CgSsIuqu.js → required-glXJjYm5.js} +1 -1
- package/dist/assets/ru-C_RwukUu.js +5 -0
- package/dist/assets/runtime-D2sDgwrj.js +1 -0
- package/dist/assets/{sanitize-aIE75FMz.js → sanitize-Bm63FeNh.js} +1 -1
- package/dist/assets/sdk-CiQg0Ndf.js +1 -0
- package/dist/assets/{section-tQK-hwwW.js → section-4gVAq_Fp.js} +1 -1
- package/dist/assets/{security-DEVrQWpZ.js → security-D7O7D2Dn.js} +1 -1
- package/dist/assets/{session-CAj-TcUY.js → session-DNlfWI2Z.js} +1 -1
- package/dist/assets/{setup-BT6-74rK.js → setup-CxJT_7C9.js} +1 -1
- package/dist/assets/{shorten-label-JstixX67.js → shorten-label-Cf--RqV-.js} +1 -1
- package/dist/assets/{simple-select-_qsehgaA.js → simple-select-BAtHv3cq.js} +1 -1
- package/dist/assets/{spaces-B6flHcN-.js → spaces-B9YyAxJd.js} +1 -1
- package/dist/assets/{start-BMKAy5mb.js → start-TaXS82Bg.js} +1 -1
- package/dist/assets/{starting-progress-SNgrsu02.js → starting-progress-B6ma-ZGa.js} +1 -1
- package/dist/assets/status-DsksxwVa.js +1 -0
- package/dist/assets/{step-actions-BcFE8m2n.js → step-actions-DbAALRbw.js} +1 -1
- package/dist/assets/{studio-BkTwhFSX.js → studio-IkWmW2Xk.js} +1 -1
- package/dist/assets/{switch-control-DVE8MCqI.js → switch-control-DdOZdvsu.js} +1 -1
- package/dist/assets/{table-tips-DMkRZoRQ.js → table-tips-cVuoMOXE.js} +1 -1
- package/dist/assets/team-BnNEVFdE.js +146 -0
- package/dist/assets/th-Bhii_FfA.js +5 -0
- package/dist/assets/traffic-BibrNphF.js +1 -0
- package/dist/assets/{transfer-3jaJ_59b.js → transfer-CPU5ZBFf.js} +1 -1
- package/dist/assets/{unsubscribe-zGPKbsNi.js → unsubscribe-CBHokiq9.js} +1 -1
- package/dist/assets/{use-app-logo-mH-ZWGvv.js → use-app-logo-BWOYOuhG.js} +1 -1
- package/dist/assets/{use-mobile-BdZU3Qy2.js → use-mobile-BpPz1bKz.js} +1 -1
- package/dist/assets/{use-mobile-nqweJXIG.js → use-mobile-DoKVMODs.js} +1 -1
- package/dist/assets/{use-server-logo-YhCrW0Nr.js → use-server-logo-UGU40YsW.js} +1 -1
- package/dist/assets/{use-window-close-B1fcc1UV.js → use-window-close-CbUhh9L6.js} +1 -1
- package/dist/assets/{useAsync-CuuTq_2R.js → useAsync-Be4McwD-.js} +1 -1
- package/dist/assets/{useAsync-Di_jotad.js → useAsync-Cc-dQGZL.js} +1 -1
- package/dist/assets/{useAsyncRetry-DhVFzdPo.js → useAsyncRetry-DHTJ61Jg.js} +1 -1
- package/dist/assets/{useLocalStorage-BCYIznDQ.js → useLocalStorage-UFpv-3wa.js} +1 -1
- package/dist/assets/user-center-DxoxMBFK.js +126 -0
- package/dist/assets/{user-follower-DYsXrJ7n.js → user-follower-CNxYFKVI.js} +1 -1
- package/dist/assets/{util-wCHwyw_F.js → util-DWpY3O7e.js} +1 -1
- package/dist/assets/{util-BN6NLUU2.js → util-DzwOLYt5.js} +1 -1
- package/dist/assets/{vendor-arcblock-BRRIrPlW.js → vendor-arcblock-3xKfH3F1.js} +114 -115
- package/dist/assets/{vendor-hooks-BeI8hpF9.js → vendor-hooks-fhL5FJET.js} +1 -1
- package/dist/assets/{vendor-mui-core-B62p29u8.js → vendor-mui-core-DHT36AZL.js} +1 -1
- package/dist/assets/{vendor-mui-x-vSVDqxyB.js → vendor-mui-x-B4OOX5Es.js} +1 -1
- package/dist/assets/vendor-utils-BSZ4yJws.js +213 -0
- package/dist/assets/{vendor-ux-k_TkMNDV.js → vendor-ux-sqP3hEhY.js} +45 -45
- package/dist/assets/vi-DVF2tjOG.js +5 -0
- package/dist/assets/{wait-connect-Df9uvB6x.js → wait-connect-Crb0Z6pk.js} +1 -1
- package/dist/assets/{wizard-GCfJ08HB.js → wizard-GO-eYrph.js} +1 -1
- package/dist/assets/{wizard-components-D_w2hIhz.js → wizard-components-B0p6B74G.js} +1 -1
- package/dist/assets/wrap-locale-C_7Ff1OO.js +1 -0
- package/dist/assets/{zh-DB1zAstv.js → zh-98nxdLeR.js} +2 -2
- package/dist/assets/{zh-QBR-GmxX.js → zh-kaABsCb2.js} +1 -1
- package/dist/assets/{zh-tw-DVMVT9am.js → zh-tw-BdDE7n5E.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +32 -32
- package/dist/assets/actions-BQZmpgjH.js +0 -1
- package/dist/assets/add-resource-BwJJ0aia.js +0 -1
- package/dist/assets/api-C1vNuLNj.js +0 -1
- package/dist/assets/bind-account-BHZb-y1l.js +0 -1
- package/dist/assets/branding-DhsDum88.js +0 -1
- package/dist/assets/button-M1tE0EM6.js +0 -1
- package/dist/assets/click-to-copy-COEss4SB.js +0 -1
- package/dist/assets/connect-to-Dp0mJeqn.js +0 -1
- package/dist/assets/createClass-D1NoiqdO.js +0 -1
- package/dist/assets/domain-DptzkTFQ.js +0 -9
- package/dist/assets/domains-Cj55weM5.js +0 -1
- package/dist/assets/engine-Br5kqWzP.js +0 -1
- package/dist/assets/get-safe-url-baxNHkAA.js +0 -1
- package/dist/assets/index-C3PPGtfI.js +0 -6
- package/dist/assets/index-ClXqfbDZ.js +0 -1
- package/dist/assets/index-CozzYt0Z.js +0 -7
- package/dist/assets/index-D45cjNSM.js +0 -1
- package/dist/assets/index-DBBPnrYI.js +0 -124
- package/dist/assets/index-Dr1AOLd_.js +0 -30
- package/dist/assets/index-DxlME7t_.js +0 -120
- package/dist/assets/index-N6YyFqDu.js +0 -1
- package/dist/assets/index-kD1YmpMU.js +0 -55
- package/dist/assets/list-DPsX8TMn.js +0 -103
- package/dist/assets/localization-CASCfNj1.js +0 -1
- package/dist/assets/logger-6-51jSsQ.js +0 -1
- package/dist/assets/login-Cbb7F6Mu.js +0 -1
- package/dist/assets/lost-passport-CSoln1QB.js +0 -167
- package/dist/assets/passport-0dxK_pTH.js +0 -1
- package/dist/assets/preferences-OylPiHSa.js +0 -1
- package/dist/assets/profile-embed-CCdzwTKi.js +0 -1
- package/dist/assets/pt-CNQsUMCu.js +0 -5
- package/dist/assets/publish-resource-Adc4901F.js +0 -1
- package/dist/assets/ru-CjyCft4V.js +0 -5
- package/dist/assets/runtime-OGDYw4nO.js +0 -1
- package/dist/assets/sdk-CxQIQdbk.js +0 -1
- package/dist/assets/status-GY7lihPg.js +0 -1
- package/dist/assets/team-DANl8A6y.js +0 -146
- package/dist/assets/th-WQWRMKAv.js +0 -5
- package/dist/assets/traffic-D_pUHfvx.js +0 -1
- package/dist/assets/user-center-gH0CVETg.js +0 -126
- package/dist/assets/vendor-utils-DZwtp8ph.js +0 -213
- package/dist/assets/vi-Br98wbNi.js +0 -5
- package/dist/assets/wrap-locale-Dgf6KVHX.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,at as r}from"./vendor-mui-core-B62p29u8.js";import{r as s}from"./vendor-react-CUXIiAnY.js";import{s as a}from"./vendor-ux-k_TkMNDV.js";import{t as n}from"./index-xERuGIw0.js";import"./vendor-utils-DZwtp8ph.js";import"./vendor-hooks-BeI8hpF9.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BRRIrPlW.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{V as L,H as q,a3 as N,B as Y,z as Se,x as Te,a9 as Ie}from"./vendor-ux-k_TkMNDV.js";import{q as Re,k as ae,t as We}from"./vendor-hooks-BeI8hpF9.js";import{r as v,a as ce}from"./vendor-react-CUXIiAnY.js";import{D as ze,J as de,j as e,Y as De,bC as Oe,$ as $e,ak as d,z as ne,T as S,a6 as F,aX as te,R as Ae,Q as H,b6 as ie,am as P,bf as _,a5 as J,V as G,S as Z,b4 as Pe,U as B,I as M,ci as qe,bh as Be,a7 as Le,F as Me,W as o,b1 as W,a3 as pe,c2 as ee,cj as Fe,aO as He,aP as Ne,ck as Ue,cl as _e,cm as Ve,s as oe,aU as Ke,aj as Ye,cn as Je,aZ as Qe,cc as Xe,bb as Ge,cb as Ze}from"./vendor-mui-core-B62p29u8.js";import{_ as V,c as ue,a1 as et,ac as tt,b5 as Q,ar as xe,as as he,at as me}from"./index-xERuGIw0.js";import{u as K}from"./team-DANl8A6y.js";import{u as ot}from"./use-mobile-nqweJXIG.js";import{u as st,C as X}from"./index.esm-DTmS4tth.js";import{C as ge,a as be,J as nt}from"./vendor-utils-DZwtp8ph.js";import{C as it}from"./confirm-CQifLVQz.js";import{A as rt}from"./actions-BQZmpgjH.js";import{T as re}from"./table-tips-DMkRZoRQ.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BRRIrPlW.js";import"./session-CAj-TcUY.js";import"./isURL-CDvz38EO.js";import"./use-app-logo-mH-ZWGvv.js";import"./index-DBs9Ljax.js";const lt=n=>{const[p,c]=v.useState(null),[f,r]=v.useState(!0),[w,u]=v.useState(null),j=window.blocklet?.appUrl,a=v.useMemo(()=>{const g={};return p&&(p.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),p.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[p]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(ge(j,ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),u(null)}catch(g){u(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return v.useEffect(()=>{b()},[j]),{openEvent:p,setOpenEvent:c,eventsBySource:a,loading:f,error:w,loadData:b}};function fe({eventsBySource:n,selectedEvents:p,setSelectedEvents:c,error:f=null}){const{t:r}=L(),[w,u]=v.useState({}),j=v.useMemo(()=>{const s={};return Object.entries(n).forEach(([l,{events:m}])=>{const k=m.filter(T=>p[`${T.type}-${T.source}`]).length;s[l]=k}),s},[n,p]),a=v.useMemo(()=>Object.values(j).reduce((s,l)=>s+l,0),[j]),b=v.useMemo(()=>Object.values(n).reduce((s,{events:l})=>s+l.length,0),[n]),g=(s,l)=>{l.stopPropagation(),u({...w,[s]:!w[s]})},y=s=>{const l=`${s.type}-${s.source}`;c(m=>({...m,[l]:!m[l]}))},z=(s,l)=>{const m={};s.forEach(k=>{const T=`${k.type}-${k.source}`;m[T]=!l}),c(k=>({...k,...m}))},I=s=>{const l={};Object.values(n).forEach(({events:m})=>{m.forEach(k=>{const T=`${k.type}-${k.source}`;l[T]=s.target.checked})}),c(l)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ie,{control:e.jsx(J,{onChange:I,checked:a>0&&a===b}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(d,{className:"webhook-event-selector",sx:{maxHeight:"50vh",overflowY:"auto",overflowX:"hidden"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:.5},children:Object.entries(n).map(([s,{source:l,events:m,count:k}],T)=>{const O=j[s]>0,R=j[s]===m.length&&m.length>0,$=w[s];return e.jsxs(ce.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:i})=>T<Object.keys(n).length-1?`1px solid ${i.divider}`:"none",px:0,py:1,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:i=>{i.target.closest(".MuiFormControlLabel-root")||g(s,i)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ie,{control:e.jsx(J,{checked:R,indeterminate:O&&!R,onChange:i=>{i.stopPropagation(),z(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.logo&&e.jsx(Pe,{src:l.logo,sx:{width:24,height:24}}),e.jsx(d,{children:l.title||s}),O&&e.jsx(B,{label:r("webhookEndpoint.selectedCount",{count:j[s]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:i=>`${i.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:k})}),m.length>0&&e.jsx(M,{size:"small",edge:"end",children:$?e.jsx(qe,{}):e.jsx(Be,{})})]})]})}),m.length>0&&e.jsx(Le,{in:$,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{p:0,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(i=>{const x=`${i.type}-${i.source}`,t=!!p[x];return e.jsx(Z,{dense:!0,sx:{py:.75,px:1},onClick:()=>y(i),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:t,sx:{flexShrink:0}}),e.jsxs(d,{sx:{flex:1,minWidth:0},children:[e.jsx(S,{variant:"body1",className:"webhook-event-type",sx:{cursor:"pointer",color:"text.primary",wordBreak:"break-word",overflowWrap:"break-word"},children:i.type}),e.jsx(S,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer",wordBreak:"break-word",overflowWrap:"break-word"},children:i.description})]})]})},x)})})})]},s)})})}),f&&e.jsx(Me,{error:!0,sx:{mt:1},children:f})]})}fe.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};function je({id:n=null,url:p="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:u}=L(),[j,a]=v.useState({}),{teamDid:b}=K(),{api:g}=V(),{loading:y,error:z,eventsBySource:I}=lt(),s=ze(),{control:l,handleSubmit:m,formState:{errors:k},reset:T,setValue:O,trigger:R}=st({defaultValues:{url:"",description:""}}),$=de(s.breakpoints.down("md"));v.useEffect(()=>{const t=Object.values(j).some(h=>h);O("selectedEvents",t?"valid":""),R("selectedEvents")},[j,O,R]);const i=()=>{a({}),T(),w()},x=async t=>{const h=Object.keys(j).filter(C=>j[C]),E={url:t.url,description:t.description,enabledEvents:h.map(C=>{const[D,se]=C.split("-");return!D||!se?null:{type:D,source:se}}).filter(Boolean)};try{if(n){const C=await g.updateWebhookEndpoint({input:{teamDid:b,id:n,data:E}});q.success(`${u("webhookEndpoint.updateWebhook")} ${u("webhookEndpoint.success")}`),r(C)}else{const C=await g.createWebhookEndpoint({input:{teamDid:b,input:E}});q.success(`${u("webhookEndpoint.createWebhook")} ${u("webhookEndpoint.success")}`),r(C)}}catch(C){q.error(C?.message)}i()};return v.useEffect(()=>{T({url:p,description:c}),a(f.reduce((t,h)=>(t[`${h.type}-${h.source}`]=!0,t),{}))},[T,a,p,c,f]),e.jsx(De,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,fullScreen:$,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:m(x),children:[e.jsx(Oe,{children:u(n?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx($e,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:l,rules:{required:u("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:u("webhookEndpoint.validation.urlInvalid")}},render:({field:t})=>e.jsx(ne,{...t,label:u("webhookEndpoint.url.label"),fullWidth:!0,error:!!k.url,helperText:k.url?.message})}),e.jsx(X,{name:"description",control:l,rules:{required:u("webhookEndpoint.validation.descriptionRequired")},render:({field:t})=>e.jsx(ne,{...t,label:u("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!k.description,helperText:k.description?.message})}),e.jsx(X,{name:"selectedEvents",control:l,rules:{required:u("webhookEndpoint.validation.eventRequired")},render:({field:t})=>e.jsx("input",{type:"hidden",...t})}),!y&&I&&Object.keys(I).length>0&&e.jsx(fe,{eventsBySource:I,selectedEvents:j,setSelectedEvents:a,error:k.selectedEvents?.message}),!y&&(!I||Object.keys(I).length===0)&&e.jsx(S,{sx:{color:"text.secondary"},children:u("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:u("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(Ae,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:i,children:u("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:u(n?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}je.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};function ye(n){switch(n){case"enabled":return"success";case"disabled":default:return"default"}}const at=(n="en")=>n==="tw"?"zh":n;function U(n,p="YYYY-MM-DD HH:mm:ss",c="en"){return n?et(n).locale(at(c)).format(p):"-"}function ct(n){return typeof n=="number"?!1:be(n)}function dt(n){return n>=200&&n<300}function A({value:n,label:p,tip:c="",divider:f=!1}){const r=ct(n);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[p,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":n})]}),f&&e.jsx(pe,{orientation:"vertical",flexItem:!0})]})}A.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};function we({title:n,children:p=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(W,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:n}),p]})}we.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};const pt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},ut=n=>{const p={};return n.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();p[f]||(p[f]=[]),p[f]?.push(c)}),p};function ke({eventId:n="",webhookEndpointId:p="",event:c=null}){const{api:f,ws:{useSubscription:r}}=V(),{t:w}=L(),{teamDid:u}=K(),{blocklet:j}=tt(),{data:a,loadMore:b,loadingMore:g,loading:y,mutate:z}=Re(t=>{const E=t?Math.ceil(t.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:u,input:{eventId:n,webhookId:p},paging:{page:E,pageSize:15}}})},{reloadDeps:[n,p]}),I=a?.list||[],[s,l]=v.useState(null),[m,k]=v.useState(!1),T=ut(I);if(v.useEffect(()=>{!s&&a?.list.length&&l(a.list[0])},[a?.list.length,s]),r(ue.EVENTS.WEBHOOK_ATTEMPT,t=>{z(h=>{if(h.list.find(C=>C.id===t.id)){const C=h.list.map(D=>D.id===t.id?{...D,...t}:D);return{...h,list:C}}return t.endpoint=h.list[0]?.endpoint,t.event=h.list[0]?.event,{...h,list:[t,...h.list]}})},[]),y)return e.jsx(F,{});const O=a&&a.list.length<a.paging.total,R=async()=>{s&&(k(!0),await f.retryWebhookAttempt({input:{teamDid:u,eventId:s.event.id,webhookId:p,attemptId:s.id}}).finally(()=>{setTimeout(()=>{k(!1)},1e3)}))},$=t=>{if(t.responseBody&&t.responseBody?.sessionId&&t.responseBody?.projectId&&t.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,E=(j.children||[]).find(D=>D?.meta?.name==="ai-studio"),C=nt(ge(`https://${h}`,E?.mountPoint||"","projects",t.responseBody.projectId,"logs/main"),{sessionId:t.responseBody.sessionId,agentId:t.responseBody.agentId});return e.jsx(M,{sx:{fontSize:20},onClick:()=>window.open(C,"_blank"),children:e.jsx(d,{component:N,icon:Q})})}return null},i=t=>t.status==="pending"?e.jsx(Ue,{color:"warning"}):dt(t.responseStatus)?e.jsx(_e,{color:"success"}):e.jsx(Ve,{color:"error"}),x=s?.triggeredFrom&&(a?.list||[]).find(t=>t.id===s.triggeredFrom);return e.jsxs(xt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:be(Object.keys(T))?e.jsx(S,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(T).map(([t,h])=>e.jsxs(ce.Fragment,{children:[e.jsx(Fe,{sx:{p:0},children:t}),h.map(E=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>l(E),selected:s&&s?.id===E?.id,secondaryAction:e.jsx(S,{sx:{color:"text.secondary"},children:U(E.createdAt,"HH:mm:ss")}),children:[e.jsx(He,{sx:{minWidth:0,mr:1.5},children:i(E)}),e.jsx(Ne,{primary:e.jsx(S,{sx:{color:"text.primary"},children:E.event.type})})]},E.id))]},t))}),O&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:t=>t.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[s&&e.jsxs(W,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h4",children:w(`common.${s.status}`)}),e.jsx(d,{children:$(s)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[x&&e.jsx(P,{placement:"left",title:e.jsxs(W,{onClick:()=>l(x),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(xe,{showDid:!0,did:s.triggeredBy,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(pe,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(S,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"body2",children:s.id}),e.jsx(M,{onClick:()=>l(x),children:e.jsx(d,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(M,{onClick:()=>l(x),children:e.jsx(d,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:N,icon:pt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(S,{variant:"h6",children:[w("webhookEndpoint.response")," (",s.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(s.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(S,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(s.event,null,2)})]})]}),a?.list.length===0&&c&&e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(S,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ke.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};const xt=oe(ee)`
|
|
2
|
-
@keyframes spin {
|
|
3
|
-
to {
|
|
4
|
-
transform: rotate(360deg);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`;function Ee({id:n,onClose:p}){const{t:c}=L(),{api:f}=V(),{teamDid:r}=K(),{loading:w,error:u,data:j}=ae(()=>f.getWebhookEndpoint({input:{teamDid:r,id:n}})),a=j?.data;return u?e.jsx(te,{severity:"error",children:u.message}):w||!a?e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(F,{})}):e.jsxs(ht,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(d,{children:[e.jsxs(W,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(W,{sx:{flex:1,width:0},children:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx(P,{title:a.url,children:e.jsx(_,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(W,{direction:"row",sx:{alignItems:"center"},children:e.jsx(M,{edge:"end",color:"inherit",onClick:p,children:e.jsx(Ye,{})})})]}),e.jsx(d,{sx:{mt:2},children:e.jsxs(W,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(A,{label:c("common.status"),value:e.jsx(B,{size:"small",variant:"filled",label:a.status,color:ye(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(A,{label:c("webhookEndpoint.listen"),value:e.jsx(P,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b?.type},b))}),children:e.jsx(B,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(A,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx(A,{label:c("common.createdAt"),value:U(a.createdAt),divider:!0}),e.jsx(A,{label:c("common.updatedAt"),value:U(a.updatedAt),divider:!0}),e.jsx(A,{label:c("common.createdBy"),value:e.jsx(P,{arrow:!0,title:a.createUser?.did,children:e.jsx(B,{size:"small",variant:"filled",label:a.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(A,{label:c("common.updatedBy"),value:e.jsx(P,{arrow:!0,title:a.updateUser?.did,children:e.jsx(B,{size:"small",variant:"filled",label:a.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(W,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(we,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(W,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(ke,{webhookEndpointId:a.id})})]})]})}Ee.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const ht=oe(W)``;function ve({open:n,onClose:p,id:c}){return e.jsx(Ke,{anchor:"right",open:n,onClose:p,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(d,{sx:{height:"100vh",p:3},children:e.jsx(Ee,{id:c,onClose:p})})})}ve.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function le(){return null}function Ce({options:n={},columns:p=[],toolbar:c=!0,footer:f=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:u="",durableKeys:j=[],data:a=[],loading:b=!1,...g}){const{locale:y}=L(),z=de(l=>l.breakpoints.down("md")),I={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},s={};return c||(s.TableToolbar=le),f||(s.TableFooter=le),e.jsx(mt,{locale:y,options:{...I,...n},columns:(p||[]).map(l=>(l.options=l.options||{},l.options.filter=l.options.filter||!1,l.options.sort=l.options.sort||!1,l)),emptyNode:e.jsx(Se,{children:w}),...g,durable:u,durableKeys:j,data:a,loading:b,components:s,hasRowLink:r,isMobile:z})}Ce.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};const mt=oe(Te)``,gt=v.memo(Ce);function At(){const{teamDid:n}=K(),p=ot(),c=`webhook-endpoints-${n}`,f=Ie(c),{t:r,locale:w}=L(),{api:u}=V(),[j,a]=v.useState(""),[b,g]=v.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=We(c,{defaultValue:{pageSize:f.rowsPerPage||20,page:f.page?f.page+1:1}}),{loading:I,error:s,data:l,refresh:m}=ae(()=>u.getWebhookEndpoints({input:{teamDid:n,paging:{page:y.page,pageSize:y.pageSize}}}));v.useEffect(()=>{m()},[y,m]);const k=v.useCallback(async(i,x)=>{try{await u.updateWebhookEndpoint({input:{teamDid:n,id:i.id,data:{status:x?"disabled":"enabled"}}}),m(),q.success(`${r(x?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(t){q.error(t?.message)}},[u,n,m,r]),T=v.useCallback(async i=>{try{await u.deleteWebhookEndpoint({input:{teamDid:n,id:i}}),m(),g(x=>({...x,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(x){q.error(x?.message)}},[u,n,m,r]),O=(i,x)=>{let t=i.page+1;const h=i.searchText||"";if(h!==j){a(h);return}if(x==="changePage"||x==="changeRowsPerPage"){x!=="changePage"&&(t=1);const E={page:t,pageSize:i.rowsPerPage};a(""),z(E)}};if(s)return e.jsx(te,{severity:"error",children:s.message});if(I||!l)return e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500},children:e.jsx(F,{})});const R=(l?.list||[]).filter(i=>{if(!j)return!0;const x=j.toLowerCase();return i.description.toLowerCase().includes(x)||i.url.toLowerCase().includes(x)}),$=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,x)=>{const t=R[x];return e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(S,{variant:"body2",children:t.description}),e.jsx(d,{sx:{display:"flex"},onClick:h=>{h.stopPropagation()},children:e.jsx(P,{title:t.url,children:e.jsx(_,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,x)=>{const t=R[x];return e.jsx(d,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:t.enabledEvents.map(h=>e.jsx(B,{size:"small",variant:"filled",label:h.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${t.source}-${h.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(i,x)=>{const t=R[x];return e.jsx(B,{size:"small",variant:"filled",label:r(`webhookEndpoint.${t?.status}`),color:ye(t?.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${t.status}`)}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>U(i)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:i=>i?e.jsx(xe,{showDid:!0,did:i?.did,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,x)=>{const t=R[x],h=t?.status==="enabled";return e.jsx(rt,{actions:[{icon:h?e.jsx(Je,{}):e.jsx(Qe,{}),text:r(h?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:E=>{E.stopPropagation(),k(t,h)}},{icon:e.jsx(Xe,{}),text:r("common.edit"),onClick:E=>{E.stopPropagation(),g(C=>({...C,createEdit:{open:!0,id:t.id,url:t.url,description:t.description,enabledEvents:t.enabledEvents}}))}},{icon:e.jsx(Ge,{}),text:r("common.delete"),onClick:E=>{E.stopPropagation(),g(C=>({...C,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>T(t.id),onCancel:()=>g(D=>({...D,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(d,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[p?e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(gt,{durable:c,durableKeys:["page","rowsPerPage"],data:R,columns:$,options:{count:l.count,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(i,{dataIndex:x})=>{const t=l.list[x];g(h=>({...h,webhookDetail:{open:!0,id:t.id}}))}},loading:I,onChange:O,emptyNodeText:e.jsx(W,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:p?null:e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(H,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary",onClick:()=>g(i=>({...i,createEdit:{...i.createEdit,open:!0}})),className:"rule-action",children:[I?e.jsx(F,{size:16}):e.jsx(Ze,{style:{fontSize:16}}),r("common.create")]},"add")]}),b.webhookDetail.open&&e.jsx(ve,{open:!0,onClose:()=>g(i=>({...i,webhookDetail:{open:!1,id:null}})),id:b.webhookDetail.id}),b.createEdit.open&&e.jsx(je,{onSubmit:m,...b.createEdit,onClose:()=>g(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),b.deleteConfirm&&e.jsx(it,{title:b.deleteConfirm.title,description:b.deleteConfirm.description,confirm:b.deleteConfirm.confirm,cancel:b.deleteConfirm.cancel,params:b.deleteConfirm.params,onConfirm:b.deleteConfirm.onConfirm,onCancel:b.deleteConfirm.onCancel})]})}export{At as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as r}from"./vendor-ux-k_TkMNDV.js";import{V as _,W as e}from"./index-xERuGIw0.js";const m={en:_(e),ar:()=>r(()=>import("./ar-Dz5bxvSE.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-Ztxy5vEB.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-Cd-spoK_.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-k8jXteN1.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-CvpI1-tn.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-D8coHs1U.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-Dkn5OA2r.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-DXfRo0NY.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-CNQsUMCu.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-CjyCft4V.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-WQWRMKAv.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-Br98wbNi.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-DVMVT9am.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-DB1zAstv.js"),[],import.meta.url).then(t=>_(t.default))};export{m as t};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import{j as e,y as ht,bc as ye,M as ne,ak as h,Q as G,W as p,J as ve,c1 as xt,I as D,aN as gt,T as E,aj as mt,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,ci as bt,bh as yt,U as Me,cR as vt,cS as wt,at as Z,cT as jt,a6 as V,n as oe,D as Ct,cU as kt,ar as Ae,b1 as we,cV as St,aX as Pt,a$ as It,cW as Tt}from"./vendor-mui-core-B62p29u8.js";import{r as y,a as Rt,u as Mt,j as At}from"./vendor-react-CUXIiAnY.js";import{t as _e,Z as Et,a4 as zt,R as Ee,D as Lt,C as se,n as H,A as Wt}from"./vendor-utils-DZwtp8ph.js";import{a as Dt,G as Bt,bi as $t,c as je,Z as Ot,bj as Nt,aA as qe,X as le,bf as Ut,bk as Ft,a9 as _t,aa as qt,bl as Ht}from"./index-xERuGIw0.js";import{a as T,h as Gt,k as ce,g as Q,b as A,j as Kt}from"./vendor-hooks-BeI8hpF9.js";import{l as He}from"./arrow-down.svg-arX2hS9A.js";import{s as Ce,a3 as L,V as W,ay as Vt,z as Ge,az as Yt,H as O,aA as Zt,aB as Qt,aC as ze,v as Xt,n as Ke,p as ke,aD as Jt,aE as P,Q as er,P as tr,$ as rr,aF as nr,aG as or,o as Ve}from"./vendor-ux-k_TkMNDV.js";import{N as sr}from"./list-DPsX8TMn.js";import{d as ir}from"./search-4YYphs0l.js";import{B as Le}from"./bundle-avatar-CeDsDt5-.js";import{h as We,T as ar}from"./team-DANl8A6y.js";import{b as lr,d as cr,a as dr,c as ur,e as pr,f as fr,h as hr,$ as xr}from"./user-center-gH0CVETg.js";import{T as De,O as gr}from"./index-C3PPGtfI.js";import{c as mr}from"./passport-0dxK_pTH.js";import{N as Ye,U as Ze}from"./index-CoJqP_N2.js";import{u as de}from"./use-mobile-BdZU3Qy2.js";import br from"./index-BO3UQZPi.js";import{U as yr,a as vr}from"./user-follower-DYsXrJ7n.js";import{f as Y}from"./index-DBs9Ljax.js";import{u as me}from"./index-Cvr1OSm0.js";import wr from"./index-KzZiqY9D.js";import{o as jr}from"./vendor-arcblock-BRRIrPlW.js";import{c as Cr,b as ie,a as kr,S as Sr}from"./index-Dr1AOLd_.js";import"./index-B1hEtoFm.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-DHxZ1bRk.js";import"./util-BN6NLUU2.js";import"./base32-HmSqZ9zU.js";import"./session-CAj-TcUY.js";import"./isURL-CDvz38EO.js";import"./use-app-logo-mH-ZWGvv.js";import"./index-CR-yimk0.js";import"./revoke.svg-CuiCGfVW.js";import"./use-mobile-nqweJXIG.js";import"./actions-BQZmpgjH.js";import"./index-D0XVz0dc.js";import"./form-text-input-BFhD3mCK.js";import"./required-CgSsIuqu.js";import"./form-wrapper-B9XdbV9a.js";import"./edit.svg-Dz9cVo7r.js";import"./lock.svg-BPCZ0CT3.js";import"./index-s6v6fZUe.js";import"./permission-Blt9Onuq.js";import"./confirm-CQifLVQz.js";import"./click-to-copy-COEss4SB.js";import"./invitations-lfws_T2N.js";import"./create-passport-svg-hAgKE5uX.js";import"./api-C1vNuLNj.js";import"./table-tips-DMkRZoRQ.js";import"./ua-parser-DP5omx3I.js";import"./sdk-CxQIQdbk.js";import"./passport-item-DwumTPQv.js";import"./did-address-CLsSdiw3.js";import"./index-BQyVf1E3.js";import"./vendor-mui-x-vSVDqxyB.js";import"./AdapterDayjs-B2uxdBcK.js";import"./delete-confirm-DP77Lldw.js";import"./index-DRYJ0xIl.js";function Pr(){let t=new Map;function i({root:s,rootMargin:n,threshold:o}){let u=t.get(s);u||(u=new Map,t.set(s,u));let a=JSON.stringify({rootMargin:n,threshold:o}),d=u.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(f=>{f.forEach(g=>{r.get(g.target)?.(g)})},{root:s,rootMargin:n,threshold:o}),entryCallbacks:r},u.set(a,d)}return{observe:(r,f)=>{d.entryCallbacks.set(r,f),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:i}}var Ir="0px",Tr=[0],Rr=Pr();function Mr(t){let i=t?.rootMargin??Ir,s=t?.threshold??Tr,n=y.useRef(null),o=y.useRef(null),u=y.useRef(null),[a,d]=y.useState(),r=y.useCallback(()=>{let j=n.current;if(!j){d(void 0);return}let v=Rr.getObserver({root:o.current,rootMargin:i,threshold:s});v.observe(j,l=>{d(l)}),u.current=v},[i,s]),f=y.useCallback(()=>{let j=u.current,v=n.current;v&&j?.unobserve(v),u.current=null},[]),g=y.useCallback(j=>{f(),n.current=j,r()},[r,f]),x=y.useCallback(j=>{f(),o.current=j,r()},[r,f]);return[g,{entry:a,rootRef:x}]}var Ar=Mr;function Er(t){let[i,s]=Ar(t),n=!!s.entry?.isIntersecting,[o,u]=y.useState(n);return n&&!o&&u(!0),[i,{...s,isVisible:n,wasEverVisible:o}]}var zr=Er,Lr=100;function Wr({loading:t,hasNextPage:i,onLoadMore:s,rootMargin:n,disabled:o,delayInMs:u=Lr}){let a=y.useRef(s),[d,{rootRef:r,isVisible:f}]=zr({rootMargin:n});y.useEffect(()=>{a.current=s},[s]);let g=!o&&!t&&f&&i;return y.useEffect(()=>{if(g){let x=setTimeout(()=>{a.current()},u);return()=>{clearTimeout(x)}}},[g,u]),[d,{rootRef:r}]}var Dr=Wr;const ge={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function ae({severity:t,size:i=8}){return ge[t]?e.jsx(h,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:ge[t]||ge.info}}):null}Qe.propTypes={theme:p.string,type:p.oneOf(["button","line","select"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function Qe({theme:t="dark",type:i="button",onSelectType:s,extra:n=void 0,currentTab:o="",loading:u=!1,...a}){const{t:d}=y.useContext(Ce),r=[{label:d("notification.allSeverity"),value:""},{label:d("notification.severityType.info"),value:"info"},{label:d("notification.severityType.success"),value:"success"},{label:d("notification.severityType.warning"),value:"warning"},{label:d("notification.severityType.error"),value:"error"}],f=m=>{(m!==o||!u)&&s(m)},g=y.useMemo(()=>{const m={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(m,{}):m},[i,t]),x=(m,C,I)=>e.jsx(G,{disabled:u,onClick:()=>f(m.value),className:`profile-button ${C?"active":""}`,...a,children:m.label},m.value||I),j=(m,C,I)=>e.jsx(G,{variant:"text",disabled:u,onClick:()=>f(m.value),className:`profile-line-button ${C?"active":""}`,...a,children:m.label},m.value||I),v=()=>r?.map((m,C)=>{const I=o===m?.value;return i==="line"?e.jsx(y.Fragment,{children:j(m,I,C)},m.value||C):e.jsx(y.Fragment,{children:x(m,I,C)},m.value||C)}),l=m=>{const{value:C}=m.target;f(C==="all"?"":C)};return i==="select"?e.jsx(ht,{sx:{maxWidth:300},children:e.jsx(ye,{value:o||"all",onChange:l,size:"small",label:"Severity",IconComponent:m=>e.jsx(He,{...m,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((m,C)=>e.jsx(ne,{value:m.value||"all",children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:m.value}),m.label]})},m.value||C))})}):e.jsxs(h,{className:"severity-tabs",sx:g,children:[e.jsx(h,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}Xe.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function Xe({loading:t,paging:i,onChange:s}){const{t:n}=y.useContext(Ce),o=ve(r=>r.breakpoints.down("md"));if(i.pageCount<=0||o)return null;const u=(r,f)=>{s({page:f+1})},a=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},d=i.page-1<=0?0:i.page-1;return e.jsx(h,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(xt,{component:"div",disabled:t,count:i.total,page:d,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:g})=>`${r}–${f} / ${g!==-1?g:`${n()}more than ${f}`}`,rowsPerPage:i.pageSize,onPageChange:u,onRowsPerPageChange:a})})}const Br=y.memo(Xe),$r={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"/>'},Be=6,$e={"& .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}},Or={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Oe=()=>({...Or,width:"calc(50% - 8px)"});Je.propTypes={loading:p.bool,type:p.oneOf(["server","service"]),onFilterChange:p.func,blockletMap:p.object,filterType:p.oneOf(["component","entity"]),selectedId:p.array,severity:p.array,enableMarkAllAsRead:p.bool,unReadCount:p.number,onReadFilterChange:p.func,currentReadFilter:p.string};function Je({onFilterChange:t=()=>{},loading:i=!1,type:s="service",blockletMap:n={},filterType:o="component",selectedId:u=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:g="all"}){const{t:x}=y.useContext(Ce),[j,v]=y.useState(null),l=!!j,[m,C]=y.useState(u),[I,k]=y.useState(a),[b,R]=y.useState(!1),[M,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{C(u),k(a)},[u,a]);const U=[{label:x("notification.filterType.all"),value:"all"},{label:x("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==g||!i)&&f(c)},K=[{label:x("notification.severityType.info"),value:"info"},{label:x("notification.severityType.success"),value:"success"},{label:x("notification.severityType.warning"),value:"warning"},{label:x("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),R(!1)},pe=()=>{v(null)},ee=c=>{const w=m.includes(c)?m.filter(S=>S!==c):[...m,c];C(w),t({id:w,severity:I})},te=c=>{const w=I.includes(c)?I.filter(S=>S!==c):[...I,c];k(w),t({severity:w,id:m})},fe=c=>{_(c.target.value)},he=()=>{R(!b)},q=Rt.useMemo(()=>{if(!n.size)return[];const c=[];return o==="component"&&c.push({label:x("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const S=w.did||w.meta?.did,z=w.title||w.meta?.title||"",$=w.appPid||w.appDid;(o==="component"&&$!==S||o==="entity"&&$===S)&&c.push({label:z,id:S,blocklet:w,ancestors:w.ancestors})}),c},[n,o,x]);y.useEffect(()=>{if(M.trim()==="")N(q);else{const c=M.toLowerCase(),w=q.filter(S=>S.label.toLowerCase().includes(c));N(w)}},[M,q]);const xe=M.trim()!==""||b?B:B.slice(0,Be);return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(h,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>X(c.value),className:`profile-button ${g===c.value?"active":""}`,sx:{...s==="service"&&g===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:g===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&r>0&&` (${r})`]},c.value))}),e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:J,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(L,{icon:$r,hFlip:!0})}),e.jsx(gt,{open:l,anchorEl:j,onClose:pe,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(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:x("notification.severity")}),e.jsx(h,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(m.length>0||I.length>0)&&e.jsx(G,{size:"small",onClick:()=>{C([]),k([]),t({severity:[],id:[]})},startIcon:e.jsx(mt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:x("notification.clear")})})]}),e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(I.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...$e},control:e.jsx(Re,{checked:I.includes(c.value),onChange:()=>te(c.value),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(h,{sx:{mb:2},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:x("notification.from")}),e.jsx(h,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:M,onChange:fe,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(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(L,{icon:ir})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(m.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...$e},control:e.jsx(Re,{checked:m.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(Le,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(E,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&M.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(bt,{}):e.jsx(yt,{})})]})]})})]})]}),m.length>0||I.length>0?e.jsxs(h,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[I.map(c=>{const w=K.find(S=>S.value===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>te(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),m.map(c=>{const w=q.find(S=>S.id===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Le,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const Nr=Z(jt)`
|
|
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 Ur(){const[t,i]=y.useState(!1);y.useEffect(()=>{const n=_e(()=>{i(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(vt,{in:t,children:e.jsx(Nr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(wt,{})})})}const Fr=Z.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})=>oe(t.palette.primary.main,.1)};
|
|
36
|
-
border: 1px solid ${({theme:t})=>oe(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
|
-
`;et.propTypes={blocklets:p.array,context:p.object,pagination:p.bool,inDialog:p.bool,filterType:p.oneOf(["component","entity"]),toViewAll:p.func,type:p.oneOf(["server","service"])};function et({blocklets:t=[],context:i,pagination:s=!0,inDialog:n=!1,filterType:o="component",toViewAll:u=()=>{},type:a="service"}){const{data:d,paging:r,refresh:f,loading:g,params:x,onReadNotification:j,componentDids:v,filterUnReadCount:l,initial:m}=i,C=c=>{f({...x,severity:c&&typeof c=="string"?[c]:c||[],paging:{...x.paging,page:1}})},[I]=Mt(),k=T(()=>I.get("id"),[I]),b=ve(c=>c.breakpoints.down("md")),[R,M]=y.useState(0),[_,B]=y.useState(!1),N=y.useMemo(()=>x.read===!1?"unread":"all",[x.read]),U=T(()=>_e(c=>{if(g)return;const w=d.length,S=d.filter($=>!We($)).length;let z={...x,append:!0,paging:{...x.paging,...c,currentPage:(r.currentPage||0)+1}};N==="unread"&&S<w&&c.page>x.paging.page&&(z={...x,append:!0,paging:{...x.paging,...c,page:x.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(z)},500),[d,x,N,r,g,f]);Gt(()=>{m&&typeof m=="function"&&m()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&M(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const c=document.getElementById(k);c&&c.scrollIntoView({behavior:"smooth",block:"center"}),B(!0)},100),setTimeout(()=>{B(!1)},3e3)},[k]);const X=T(()=>d?.length>0&&d.length<R,[d,R]),K=y.useCallback(c=>{const{blocklet:w={}}=window,S=[w?.did,...(w?.ancestors||[]).map(z=>z)];return v?.includes(c)||S.findIndex(z=>z===c)>-1},[v]),J=y.useMemo(()=>{const c=new Map;return t.length&&t.forEach(w=>{const S=w?.did||w.meta?.did;S&&!c.has(S)&&(w.ancestors=[],c.set(S,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(z=>{c.has(z)||c.set(z,w)})),w?.children?.length>0&&w.children.forEach(z=>{const $=z?.did||z.meta?.did;$&&!c.has($)&&K($)&&(z.ancestors=[w],c.set($,z))})}),c},[t,K]),pe=y.useCallback(()=>{g||U({page:r.page+1})},[r.page,g,U]),[ee]=Dr({loading:g,hasNextPage:X,onLoadMore:pe}),te=c=>{!c||We(c)||j(c.id).then(()=>{n&&u()})},fe=({severity:c,id:w})=>{if(g)return;let S={};o==="component"?S={entityId:[],componentDid:w}:o==="entity"&&(S={componentDid:[],entityId:w}),f({...x,severity:c,...S,paging:{...x.paging,page:1}})},he=c=>{if(g)return;let w={...x,paging:{...x.paging,page:1}};c==="unread"?(w.read=!1,w.paging.currentPage=1):w=Et(w,"read"),f(w)},q=T(()=>o==="component"?Array.isArray(x.componentDid)?x.componentDid:[]:o==="entity"?Array.isArray(x.entityId)?x.entityId:[]:[],[x,o]),xe=T(()=>(Array.isArray(x.severity)?x.severity:[])[0]||"",[x.severity]);return e.jsxs(Fr,{inDialog:!!n,children:[n?e.jsx(Qe,{currentTab:xe,type:"line",theme:"light",onSelectType:C}):e.jsx(Je,{loading:g,blockletMap:J,unReadCount:l,filterType:o,type:a,selectedId:q,onFilterChange:fe,severity:x.severity,onReadFilterChange:he,currentReadFilter:N}),!b&&g?e.jsx(h,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(V,{})}):e.jsx(sr,{data:d,blockletMap:J,onReadNotification:te,onReadBatch:j,inDialog:n,highlightId:k,highlight:!n&&_,type:a}),s&&!b?e.jsx(Br,{loading:g,paging:r,onChange:U}):null,s&&b&&(g||X)?e.jsx(h,{ref:ee,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(V,{})}):null,!n&&b?e.jsx(Ur,{}):null]})}const _r=y.memo(et),F=new $t;function ue(t){const{userDid:i=""}={},{session:s}=Dt(),n=T(()=>{if(i)return i;const r=window.location.href,f=zt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,i]),o=T(()=>s.user,[s]),u=T(()=>o?n===o?.did:!1,[n,o?.did]),a=ce(async()=>{if(await Bt(()=>s?.initialized),u)return s.user;if(n)return F.user.getUserPublicInfo({did:n})},{refreshDeps:[n,u,s?.initialized,o]}),d=T(()=>o?.passports?.some(r=>r.role===je.ROLES.OWNER),[o]);return{currentDid:n,session:s,isMyself:u,user:o,viewUser:a.data,isOwner:d}}function tt({user:t,...i}){const{t:s}=W(),n=Ct(),o=T(()=>{const d=(t?.passports||[]).map(r=>({...r,revoked:r.status===Vt.REVOKED}));return d.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),Ee(d.filter(r=>!r.display),"role").concat(Ee(d.filter(r=>r.display),"display.content"))},[t?.passports]),u=T(()=>o?.find(d=>d.name===t.role),[o,t?.role]),a=n.palette.primary.main;return o.length===0?e.jsx(h,{children:e.jsx(Ge,{children:s("userCenter.noPassport")})}):e.jsx(h,{...i,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,...i.sx},children:o.map(d=>e.jsx(lr,{passport:d,user:t,color:window.blocklet.passportColor,createPassportSvg:mr,title:u&&u.role===d.role?s("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:u&&u.role===d.role?`0px 2px 4px 0px ${a}, 0px 1px 2px -1px ${a}, 0px 0px 0px 1px ${a} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},d.id))})}tt.propTypes={user:p.object.isRequired};function qr({visible:t,onClose:i,nft:s}){return!t||!s?null:e.jsx(Hr,{children:e.jsx(kt,{open:t,onClose:i,children:e.jsx(Gr,{onClick:i,children:e.jsx(Ye,{data:Ze(s),address:s.address,inset:!0})})})})}const Hr=Z.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
|
-
`,Gr=Z.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
|
-
`,Kr=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:oe(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:oe(t.palette.background.paper,1)}}}),Vr={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"}},Ne="https://main.abtnetwork.io/explorer";function rt({user:t}){const{t:i}=W(),s=de(),[n,o]=y.useState({visible:!1,nft:null}),[u,a]=y.useState({anchorEl:null,props:null}),d=k=>{const b=se(Ne,"assets",k);window.open(b,"_blank")},r=(k,b)=>{let R="";typeof b.data?.value=="string"?R=JSON.parse(b.data?.value)?.domain:R=b.data?.value?.domain,a({anchorEl:k,props:{title:R?`Hey, I just won an NFT at the ${R} event!`:"Hey, I just won an NFT!",url:se(Ne,"assets",b.address)}})},f=k=>{o({visible:!0,nft:k})},g=Q({page:1,size:20}),x=ce(async(k=g)=>(await Lt.get(`${je.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...k}})).data,{ready:t?.did&&g,defaultParams:[g],refreshDeps:[t?.did,g]}),{loading:j,data:v}=x,l=v?.page??{cursor:0,next:!1,total:0},m=(k,b)=>{g.page=b,x.run(g)},C=A(k=>[e.jsx(D,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),d(k.address)},children:e.jsx(L,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),f(k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:eye",fontSize:18})},"view")]),I=T(()=>{if(j){const k=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Ae,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ae,{width:"20%"}),e.jsx(h,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:k})]})}return e.jsxs(e.Fragment,{children:[e.jsx(E,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:i("userCenter.common.nft")}),v?.assets?.length===0&&!j&&e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Ge,{children:i("userCenter.common.noNFT")})}),e.jsx(h,{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(k=>e.jsxs(h,{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",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(Ye,{data:Ze(k),address:k.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(h,{className:"footer-mask",sx:Vr,children:C(k)}):e.jsx(h,{className:"mask",sx:Kr,children:e.jsx(we,{direction:"row",spacing:1,children:C(k)})})]},k.address))}),l.next||g.page>1?e.jsx(St,{sx:{display:"flex",justifyContent:"center",mt:2},page:g.page,onChange:m,count:Math.ceil(l.total/g.size),size:"small"}):null,e.jsx(qr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{o({visible:!1,nft:null})}}),e.jsx(Yt,{anchorEl:u.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:u.props||{title:"",url:""}})]})},[j,l,g.page,g.size,m,u,n]);return e.jsx(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:I})}rt.propTypes={user:p.object.isRequired};function Yr(){const{t}=W(),{user:i,isMyself:s,viewUser:n}=ue();return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(tt,{user:i})]}):null,e.jsx(rt,{user:s?i:n})]})}const Zr=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function nt({user:t,onSave:i}){const{t:s,changeLocale:n}=W(),o=Q({locale:t.locale,loading:!1}),u=A(async a=>{try{const{value:d}=a.target;o.loading=!0,await F.user.saveProfile({locale:d}),await i("profile"),n(d),o.locale=d}catch(d){O.error(Y(d))}finally{o.loading=!1}});return e.jsxs(h,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(h,{children:s("userCenter.commonSetting.locale")}),e.jsx(h,{children:e.jsx(ye,{value:o.locale,onChange:u,size:"small",IconComponent:a=>e.jsx(He,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Zr).map(a=>e.jsx(ne,{value:a.code,children:a.name},a.code))})})]})}nt.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function be({onTest:t=H,onDelete:i=H,onSave:s=H,onCancel:n=H,type:o="slack",url:u="",edit:a=!1}){const{t:d}=W(),r=Q({type:o||"slack",url:u||"",edit:a??!1,error:"",loading:!1}),f=A(()=>r.url?Ot(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),g=A(()=>{r.edit=!1,r.url=u||"",r.type=o||"slack",r.error="",r.loading=!1,n()}),x=A(async l=>{r.loading=!0,await t(l),r.loading=!1}),j=A(l=>()=>{f()&&l({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(E,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(V,{size:16}):e.jsx(D,{size:"small",onClick:j(x),sx:{mr:-1},children:e.jsx(L,{icon:cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(h,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(ye,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:l=>{r.type=l.target.value},children:[e.jsx(ne,{value:"api",children:d("userCenter.webhook.url")}),e.jsx(ne,{value:"slack",children:d("userCenter.webhook.slack")})]}),e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ue,{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:l=>{r.url=l.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Fe,{position:"end",children:v})}}}),e.jsx(h,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(D,{color:"success",onClick:j((...l)=>{s(...l),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Zt})}),e.jsx(D,{color:"error",onClick:g,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Qt})})]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:dr})}),e.jsx(D,{color:"error",onClick:()=>{i({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:ur})})]})})]})]})}be.propTypes={onTest:p.func,onDelete:p.func,onSave:p.func,onCancel:p.func,type:p.oneOf(["api","slack"]),url:p.string,edit:p.bool};function re({title:t=void 0,description:i=void 0,value:s,onChange:n,isMobile:o}){const u=A(a=>{a.stopPropagation()});return e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(me,{checked:s,size:"small",onChange:n}),e.jsxs(E,{component:"div",onClick:u,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:o?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:o?"normal":"nowrap"},children:[t,i]})]})}re.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function ot({user:t,isMobile:i}){const{t:s}=W(),n=Q({showAdd:!1}),o=ce(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),u=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...o?.data?.notifications||{}}),[o?.data?.notifications]),a=T(()=>o?.data?.webhooks||[],[o?.data?.webhooks]),d=A(async v=>{try{await F.user.saveUserNotificationConfig(v),O.success(s("userCenter.saveSuccess")),o.run()}catch(l){O.error(Y(l))}}),r=A(async(v,l)=>{await d({notifications:{[v]:l}})}),f=async v=>{try{await F.user.testNotificationWebhook(v),O.success(s("userCenter.webhookTested"))}catch(l){O.error(Y(l))}},g=A(async v=>{await d({webhooks:a.filter((l,m)=>m!==v)})}),x=A(async(v,l)=>{await d({webhooks:a.map((m,C)=>C===v?l:m)})}),j=A(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return o.error?e.jsx(Pt,{severity:"error",children:o.error.message}):o.loading||!o.data?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(V,{})}):e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(h,{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(re,{value:u.wallet,isMobile:i,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:ze(t)&&e.jsx(Xt,{did:ze(t),showQrcode:!1,showAvatar:!i,copyable:!0,compact:!0,responsive:!0,startChars:i?2:6})}),e.jsx(re,{value:u.email,isMobile:i,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(E,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(re,{isMobile:i,value:u.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(we,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,l)=>e.jsx(be,{onTest:f,onDelete:()=>g(l),onSave:(...m)=>x(l,...m),type:v.type,url:v.url,edit:!1},`${l}_${v.url}`)),n.showAdd&&e.jsx(be,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>j(...v),edit:!0},"add"),e.jsx(Ke,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(L,{icon:pr}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ot.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function st({item:t}){const i=ke(),{blocklet:s}=Nt(),{confirmApi:n,confirmHolder:o}=qe(),u=Q({loading:!1}),{t:a}=W(),{session:d}=y.use(le),{bindOAuth:r,unbindOAuth:f,setBaseUrl:g,baseUrl:x}=d.useOAuth(),{disconnectPasskey:j,setTargetAppPid:v}=d.usePasskey(),l=T(()=>Jt[t?.provider]||"unknown",[t?.provider]),m=A(b=>b?._bind?b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===P.PASSKEY&&i.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&i.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),C=A(async()=>{if(t?.provider===P.PASSKEY){await new Promise((b,R)=>{n.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:l}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){j({session:d,connectedAccount:t}).then(b).catch(R),M()},onCancel:b})});return}try{u.loading=!0,await new Promise((b,R)=>{if(t?._bind)n.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:l}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){f({session:d,connectedAccount:{...Wt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(R),M()},onCancel:b});else if(t.provider===P.WALLET)n.open({title:a("userCenter.thirdPartyLogin.confirmBindWallet",{name:l}),content:a("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:a("common.cancel"),onConfirm:M=>{d.bindWallet({onSuccess:b,onCancel:R}),M()},onCancel:b});else{const M=x,_=window?.blocklet;let B="/";const N=er(_),U=tr(_);N&&U?.appPid&&d?.user?.sourceAppPid&&(B=U.appUrl),g(B),v(s?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(R).finally(()=>{g(M),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{u.loading=!1}}),I=A(b=>b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):b?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),k=A(b=>b.provider===P.WALLET&&b.did||b.provider===P.PASSKEY&&(i.arcSphere||i.wallet)?!0:!!t._mainProvider,[i.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(h,{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(Ut,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(h,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:l}),t.userInfo?.email||t.did?e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(h,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(De,{title:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rr,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(h,{children:[e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(h,{component:L,icon:Ft,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(De,{title:m(t),placement:"auto",children:e.jsx(h,{children:e.jsx(Ke,{variant:"outlined",size:"small",sx:b=>{const R=b.palette.error.main,M=b.palette.primary.main;return{color:t?._bind?R:M,borderColor:t?._bind?R:M,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?R:M,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:u.loading?null:e.jsx(L,{icon:fr}),onClick:C,disabled:k(t),loading:u.loading,children:I(t)})})}),o]})}st.propTypes={item:p.shape({provider:p.string,did:p.string,pk:p.string,userInfo:p.object,id:p.string,_bind:p.bool,_rawProvider:p.string,_mainProvider:p.bool}).isRequired};function it({user:t}){const{session:i}=y.use(le),[s,n]=y.useState({}),{getOAuthConfigs:o}=i.useOAuth(),u=ke();Kt(async()=>{const r=await o({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:P.WALLET,order:-1},...r,{provider:P.PASSKEY,order:1/0}]},[s]),d=T(()=>{const r=nr(t);let f=!1,g="",x=or(t);const j=r.find(l=>l.provider===P.AUTH0);return j&&(j.id.startsWith("google-oauth2|")&&(r.some(l=>l.provider==="google")||(f=!0,g=P.GOOGLE,x===P.AUTH0&&(x=P.GOOGLE))),j.id.startsWith("appleid|")&&(r.some(l=>l.provider===P.APPLE)||(f=!0,g=P.APPLE,x===P.AUTH0&&(x=P.APPLE))),j.id.startsWith("github|")&&(r.some(l=>l.provider===P.GITHUB)||(f=!0,g=P.GITHUB,x===P.AUTH0&&(x=P.GITHUB)))),a.map(l=>{if(l.provider===P.AUTH0&&f)return null;const m=f&&l.provider===g?r.find(C=>C.provider===P.AUTH0):r.find(C=>C.provider===l.provider);return m?{...l,provider:l.provider,did:m.did,pk:m.pk,userInfo:m.userInfo,_bind:!0,_rawProvider:m.provider,_mainProvider:l.provider===x}:{...l,provider:l.provider,_rawProvider:l.provider,_mainProvider:l.provider===x}}).filter(l=>!(!l||l.provider===P.PASSKEY&&!l.did)).sort((l,m)=>l._mainProvider?-1:l?.order!==void 0&&m?.order!==void 0?l.order-m.order:l?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(h,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(st,{item:r},r?.provider)),u.wallet||u.arcSphere?null:e.jsx(_t,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:H,onError:H,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}it.propTypes={user:p.object.isRequired};function at({configList:t,onSave:i}){const[s,n]=y.useState(t),{t:o}=W(),u=A(async(a,d)=>{try{const r=await F.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),O.success(o("userCenter.saveSuccess")),i("privacy")}catch(r){O.error(Y(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(h,{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:s.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(h,{children:[e.jsx(me,{checked:d,labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;a.followersOnly?u(a.key,f?"all":"private"):u(a.key,f)}},a.key),a.followersOnly&&d&&e.jsx(h,{sx:{pl:3,pt:1},children:e.jsx(me,{checked:a.value==="follower-only",labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;u(a.key,f?"follower-only":"all")}})})]})})})}at.propTypes={configList:p.arrayOf(p.shape({key:p.string.isRequired,name:p.string.isRequired,value:p.bool.isRequired,isPrivate:p.bool})).isRequired,onSave:p.func.isRequired};function lt({onDestroySelf:t=void 0}){const{confirmHolder:i}=qe(),{t:s}=W(),{session:n}=y.use(le),o=A(async()=>{if(!t||typeof t!="function")return;const u=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await u(),n.logout()}catch(a){O.error(a?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(h,{children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(h,{children:[e.jsx(E,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(E,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(G,{variant:"contained",color:"error",size:"small",onClick:o,children:s("userCenter.dangerZone.delete")})]})}),i]})}lt.propTypes={onDestroySelf:p.func};function Qr(){const t=de({key:"md"}),i=ve(o=>o.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>Ve({},t?s:{}),[t]);return e.jsx(h,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":i?"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:o=>`${o.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(wr,{isSelf:!0,columnSx:n})})}function ct({onDestroySelf:t=void 0,userCenterTabs:i=[]}){const{t:s}=W(),{user:n,session:o,isMyself:u,isOwner:a}=ue(),r=ke().arcSphere,f=de({key:"md"}),g=ce(async()=>n&&u?await F.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,u],loadingDelay:300}),x=T(()=>i.map(l=>({key:l.value,name:l.label,value:l.protected,isPrivate:l.isPrivate,followersOnly:l.followersOnly})),[i]),j=A(async l=>l==="privacy"?(await g.runAsync(),g.data):(l==="profile"&&await o.refresh(),null));y.useEffect(()=>{const l=window.location.hash.slice(1);l&&document.getElementById(l)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(nt,{user:n,onSave:j})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ot,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(it,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(Qr,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(br,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(at,{configList:x,onSave:j})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yr,{user:n,showUser:!1,getUserSessions:l=>F.userSession.getMyLoginSessions({},l)})},!a&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(lt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,x,f,a,t]);return u?e.jsx(h,{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(l=>l?e.jsxs(h,{id:l.value,sx:Ve({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},l.sx),children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600},children:l.label}),e.jsx(h,{sx:{mt:2.5},children:l.content})]},l.value):null)}):null}ct.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const dt=y.createContext({}),{Provider:Xr,Consumer:fo}=dt;function ut({children:t}){const[i]=y.useState(!1),{session:s}=y.use(le),{user:n}=s,[o,u]=y.useState(),a=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{u(n?.didSpace)},[n?.didSpace]);const d=async()=>{u(void 0)},r=x=>{},f=async x=>{u(x),await r(x.endpoint)},g=!!(a&&o);return e.jsx(Xr,{value:{loading:i,spaceGateway:o,session:s,deleteSpaceGateway:d,updateSpaceGateway:f,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:g},children:t})}function Se(){return y.use(dt)}ut.propTypes={children:p.node.isRequired};function Jr(t){const i=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return se(i,"space",n)}function pt({session:t,spaceGateway:i,spaceStatus:s,refresh:n}){return e.jsxs(we,{direction:"row",spacing:1,children:[s===Cr.DISCONNECTED&&e.jsx(ie,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:o=>{console.error(o),O.error(Y(o))}}),e.jsx(D,{size:"small",LinkComponent:It,href:Jr(i.endpoint),target:"_blank",children:e.jsx(Tt,{})})]})}pt.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function ft({spaceGateway:t=void 0}){const{t:i}=W(),{updateSpaceGateway:s,session:n}=Se(),o=de(),u=({spaceGateway:a})=>s(a);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("userCenter.storage.spaces.connected.title")}),!o&&e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})]}),e.jsx(h,{children:t&&e.jsx(kr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(pt,{session:n,...a})},t.endpoint)}),o&&e.jsx(h,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})})]})}ft.propTypes={spaceGateway:p.object};function en(){const{t}=W(),{updateSpaceGateway:i,session:s}=Se(),n=({spaceGateway:o})=>i(o);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Sr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(h,{children:e.jsx(ie,{session:s,onSuccess:n})})]})}function tn(){const{spaceGateway:t,hasStorageEndpoint:i,loading:s}=Se(),{isMyself:n}=ue();return n?s?e.jsx(jr,{relative:"parent",children:e.jsx(V,{})}):e.jsx(nn,{children:e.jsx(h,{sx:{maxWidth:"720px"},children:i?e.jsx(ft,{spaceGateway:t}):e.jsx(en,{})})}):null}function rn(){return e.jsx(ut,{children:e.jsx(tn,{})})}const nn=Z(h)`
|
|
122
|
-
height: 100%;
|
|
123
|
-
overflow-y: auto;
|
|
124
|
-
`;function on(){const{user:t,isMyself:i,viewUser:s}=ue(),{followed:n}=hr();return e.jsx(h,{children:e.jsx(vr,{teamDid:window?.blocklet?.did||"",user:i?t:s,showInvitees:i,followed:n})})}function sn({tab:t=""}){const{api:i}=qt(),s=y.useRef(null),n=At(),o=t||n.tab,a=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),d=Ht(),r=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(g=>({...g,meta:{...g,did:g.did,name:g.name||g.title||"",logo:"logo.png"}}))})),f=async g=>{const{input:x,sessionId:j}=g;try{await i.destroySelf({input:{...x,sessionId:j}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(ar,{mode:"user-center",children:e.jsxs(xr,{ref:s,embed:a==="1",currentTab:o?se(je.WELLKNOWN_SERVICE_PATH_PREFIX,"user",o):"",disableAutoRedirect:o==="settings",children:[o==="notifications"?e.jsx(_r,{blocklets:[r],context:d}):null,o==="nfts"?e.jsx(Yr,{}):null,o==="settings"?e.jsx(ct,{onDestroySelf:f}):null,o==="did-spaces"?e.jsx(rn,{}):null,o==="user-followers"?e.jsx(on,{}):null,o==="orgs"?e.jsx(gr,{id:n.id||""}):null]})})}sn.propTypes={tab:p.string};export{sn as default};
|