@abtnode/blocklet-services 1.16.49-beta-20250822-070545-6d3344cc → 1.16.49-beta-20250826-112154-8ca981fa
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/user.js +85 -1
- package/dist/assets/{AdapterDayjs-VDBijwaM.js → AdapterDayjs-DAMiGWmL.js} +1 -1
- package/dist/assets/{Google-Sm1AunGv.js → Google-BsTnh-4u.js} +1 -1
- package/dist/assets/{access-control-VF0jIUag.js → access-control-DCA_eQZz.js} +1 -1
- package/dist/assets/{actions-Bf4UKTeu.js → actions-ERKO514H.js} +1 -1
- package/dist/assets/{add-component-core-DPxKUwJB.js → add-component-core-k3nxNuTO.js} +1 -1
- package/dist/assets/{add-resource-DuOqQFR-.js → add-resource-DStWoX4i.js} +1 -1
- package/dist/assets/{addon-CosTdlat.js → addon-2mvzI-dq.js} +1 -1
- package/dist/assets/{advanced-B9TR0x_M.js → advanced-BfOlOCpe.js} +1 -1
- package/dist/assets/{aigne-C7JPp9u1.js → aigne-BzgFpPaQ.js} +1 -1
- package/dist/assets/{appearance-Byekpih2.js → appearance-CK8AP8Pg.js} +1 -1
- package/dist/assets/{ar-fE5SSTrt.js → ar-CPI6kJBB.js} +1 -1
- package/dist/assets/{arrow-down.svg-lBR1lfm2.js → arrow-down.svg-DL1hxWw7.js} +1 -1
- package/dist/assets/{audit-logs-BTyQcfWp.js → audit-logs-BwrxLp74.js} +2 -2
- package/dist/assets/{authorize-BbCQomqp.js → authorize-CTMuTRsh.js} +1 -1
- package/dist/assets/{base-chart-DZz4r8-E.js → base-chart-DshYrsm-.js} +1 -1
- package/dist/assets/{base32-D7JDMggs.js → base32-Bpx2GVVK.js} +1 -1
- package/dist/assets/{bind-account-B-fdpRuH.js → bind-account-C0dQGqpS.js} +1 -1
- package/dist/assets/{branding-DKOBu_eV.js → branding-B2z6Bmgr.js} +2 -2
- package/dist/assets/{branding-Bp4tsvug.js → branding-DIJg1MWH.js} +1 -1
- package/dist/assets/branding-DewpBr-G.js +1 -0
- package/dist/assets/{bundle-avatar-FLzOZWlh.js → bundle-avatar-DgaVgcWV.js} +1 -1
- package/dist/assets/button-yt7KOkBe.js +1 -0
- package/dist/assets/{click-to-copy-CVpUD4ji.js → click-to-copy-xhWFT-k-.js} +1 -1
- package/dist/assets/{collapse-C-BNkgS6.js → collapse-6qdm8LaH.js} +1 -1
- package/dist/assets/{complete-CnjLDP7N.js → complete-CRI2gBzt.js} +1 -1
- package/dist/assets/{component-Dogt0tzj.js → component-B6-WwWY8.js} +3 -3
- package/dist/assets/{config-BxiVjVAu.js → config-CCmDjOhk.js} +1 -1
- package/dist/assets/{config-gL555Qh4.js → config-Cx_MPp7p.js} +1 -1
- package/dist/assets/{config-B5Y8LOpp.js → config-D-pz2Qoj.js} +6 -6
- package/dist/assets/{config-navigation-CveewaP3.js → config-navigation-DZ7YK-yA.js} +3 -3
- package/dist/assets/{config-space-h6V3UKMc.js → config-space-Hn6vDRvK.js} +1 -1
- package/dist/assets/{confirm-C9tgdTJT.js → confirm-DjiQAQPO.js} +1 -1
- package/dist/assets/{connect-CYT-S8fi.js → connect-CH9xsJFa.js} +1 -1
- package/dist/assets/{connect-Cx2VNYgu.js → connect-DGqjsZSn.js} +1 -1
- package/dist/assets/{connect-to-DiEQlFbF.js → connect-to-CR0Mrnxa.js} +1 -1
- package/dist/assets/{content-layout-DoBqUAz1.js → content-layout-C04Obhnh.js} +1 -1
- package/dist/assets/{createClass-D9kGlylC.js → createClass-C2F6VGHd.js} +1 -1
- package/dist/assets/{dashboard-D1d9MQbs.js → dashboard-DDrnxcgl.js} +3 -3
- package/dist/assets/{de-Byq6SyWJ.js → de-DXdF82Jr.js} +1 -1
- package/dist/assets/{delete-confirm-XVeEePxy.js → delete-confirm-D3Ubb7rP.js} +1 -1
- package/dist/assets/{did-address-CcsL3-Qm.js → did-address-BWvYsV02.js} +1 -1
- package/dist/assets/{domain-CV6OAKYE.js → domain-PJvqoN80.js} +1 -1
- package/dist/assets/{domain-action-card-BXYZu_pS.js → domain-action-card-DhcgmOYz.js} +2 -2
- package/dist/assets/domains-CkoVlvYd.js +1 -0
- package/dist/assets/{email-CniDyVLQ.js → email-DsO0liCw.js} +1 -1
- package/dist/assets/{empty-spinner-BMVhld2Z.js → empty-spinner-BkNT2e_n.js} +1 -1
- package/dist/assets/engine-RAnesRm4.js +1 -0
- package/dist/assets/{es-Q8J1CCMS.js → es-Cdb297yS.js} +1 -1
- package/dist/assets/{exchange-passport-BnNDAYeY.js → exchange-passport-BOqqcYhR.js} +1 -1
- package/dist/assets/{form-BndJ7ZnS.js → form-VkZc9Km5.js} +1 -1
- package/dist/assets/{form-text-input-DJPCEDjA.js → form-text-input-DUMoSxHd.js} +1 -1
- package/dist/assets/{form-wrapper-CHYdE4By.js → form-wrapper-Buohf72H.js} +1 -1
- package/dist/assets/{fr-8njRrvuV.js → fr-CQValz_y.js} +1 -1
- package/dist/assets/{fuel-BTh7B67H.js → fuel-D6o3EPCQ.js} +1 -1
- package/dist/assets/{gen-access-key-CbaepD9-.js → gen-access-key-TaufSRBN.js} +1 -1
- package/dist/assets/{gen-simple-access-key-mJK0zx1B.js → gen-simple-access-key-BDdGaGUR.js} +1 -1
- package/dist/assets/get-safe-url-XoZDPEu8.js +1 -0
- package/dist/assets/{hdkey-BpKJbkt5.js → hdkey-BZdKcn7a.js} +1 -1
- package/dist/assets/{hi-JUTdfcRr.js → hi-CAensap9.js} +1 -1
- package/dist/assets/{home-BwLLSjzW.js → home-CHjIGcwE.js} +1 -1
- package/dist/assets/{id-CrtgRPeX.js → id-6AFgcYKj.js} +1 -1
- package/dist/assets/{iframe-CbjzikLk.js → iframe-D4HLtPwz.js} +1 -1
- package/dist/assets/{index-DQmcrxe_.js → index-B74V2YA6.js} +1 -1
- package/dist/assets/{index-BtkFo6d6.js → index-BC4kejU3.js} +1 -1
- package/dist/assets/{index-BKiTWpo1.js → index-BH2GiZzC.js} +1 -1
- package/dist/assets/{index-DzSOofQf.js → index-BMIctAqA.js} +1 -1
- package/dist/assets/{index-DzqNo2lD.js → index-BWFAeSHM.js} +1 -1
- package/dist/assets/{index-Bk02VaQE.js → index-BeCF0QOk.js} +1 -1
- package/dist/assets/index-BnvMgnLZ.js +55 -0
- package/dist/assets/{index-hXRVhE3g.js → index-BqC6LPCM.js} +1 -1
- package/dist/assets/{index-Cd2DJL-w.js → index-Bx3gbTGK.js} +1 -1
- package/dist/assets/index-C54fBQKM.js +271 -0
- package/dist/assets/{index-BIfpX-Mq.js → index-CMEi9dbm.js} +1 -1
- package/dist/assets/{index-BxU3q403.js → index-CWYofUen.js} +3 -3
- package/dist/assets/{index-pAv7g5o_.js → index-Csyn0uY8.js} +1 -1
- package/dist/assets/{index-ew1if2W6.js → index-CzpBsr1A.js} +1 -1
- package/dist/assets/{index-DEu06Btv.js → index-D-GZOScK.js} +1 -1
- package/dist/assets/index-D17HAcYi.js +7 -0
- package/dist/assets/{index-Bzij4iIk.js → index-DI1BHDx_.js} +1 -1
- package/dist/assets/{index-CuQBOJqN.js → index-DO37nRKU.js} +27 -27
- package/dist/assets/{index-SbRD4xbu.js → index-DPTpzNhV.js} +4 -4
- package/dist/assets/{index-B5t6TkeL.js → index-DZVXsFnM.js} +12 -12
- package/dist/assets/index-Da2Fkfd8.js +124 -0
- package/dist/assets/{index-BtHQU9Nx.js → index-DexkP2Yg.js} +1 -1
- package/dist/assets/{index-BY2dcTa4.js → index-DgIrECdq.js} +1 -1
- package/dist/assets/{index-Ca4b_pCt.js → index-DrDeYBYQ.js} +1 -1
- package/dist/assets/{index-B9sHaKla.js → index-DzDny7hn.js} +1 -1
- package/dist/assets/{index-DT3k66ox.js → index-EyZ2cODm.js} +1 -1
- package/dist/assets/{index-C-DpXzH8.js → index-N7n9Y6Ev.js} +1 -1
- package/dist/assets/{index-BFQdM_lT.js → index-WeFxHe8W.js} +1 -1
- package/dist/assets/{index-yi4PlkyH.js → index-iZoPQlsF.js} +1 -1
- package/dist/assets/index-l6N7xl6j.js +1 -0
- package/dist/assets/{invitation-CsvJMPo7.js → invitation-fLqQwL2V.js} +1 -1
- package/dist/assets/{invite-DEEX5t_7.js → invite-BuBkQcNM.js} +1 -1
- package/dist/assets/{isURL-Cuto2_sB.js → isURL-B__byeRB.js} +1 -1
- package/dist/assets/{issue-passport-BuT9-mlQ.js → issue-passport-B59-VmcV.js} +1 -1
- package/dist/assets/{item-CEYjCEHD.js → item-B66UD90-.js} +1 -1
- package/dist/assets/{ja-BDFhRccP.js → ja-D59y1sZ9.js} +1 -1
- package/dist/assets/{ko-Dde62QRb.js → ko-DlSyClni.js} +1 -1
- package/dist/assets/{landing-page-CbZO5p-X.js → landing-page-CcxfBDvV.js} +1 -1
- package/dist/assets/{launch-result-message-BhJWVXUs.js → launch-result-message-nmd233tx.js} +1 -1
- package/dist/assets/{layout-BOMMbsdq.js → layout-BtMyFuvH.js} +1 -1
- package/dist/assets/{list-CIIZmkmF.js → list-BzBZOB70.js} +3 -3
- package/dist/assets/{list-CcfeNfGu.js → list-KwyPdRy6.js} +1 -1
- package/dist/assets/{list-header-BQx81X9X.js → list-header-DT-KLaK2.js} +1 -1
- package/dist/assets/localization-C3WwrJSz.js +1 -0
- package/dist/assets/{log-CHaoSWXc.js → log-CJiXT96P.js} +365 -16
- package/dist/assets/logger-BPHaK-bk.js +1 -0
- package/dist/assets/login-DdD8TQxB.js +1 -0
- package/dist/assets/{login-oauth-callback-DJxlMwXZ.js → login-oauth-callback-apTwCkdH.js} +1 -1
- package/dist/assets/{logo-uploader-C0ihL7E6.js → logo-uploader-CIzfJVj3.js} +2 -2
- package/dist/assets/{lost-passport-BoAvHfI_.js → lost-passport-sedmBiTv.js} +2 -2
- package/dist/assets/{observability-F2NkCkza.js → observability-BLOR-pai.js} +1 -1
- package/dist/assets/{open-window-BNY_OfK6.js → open-window-DaSfgtU9.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DXbfRbJ6.js → over-due-invoice-payment-BW9Vjd39.js} +1 -1
- package/dist/assets/{overview-DpF1loGs.js → overview-BI6gWUol.js} +1 -1
- package/dist/assets/{page-header-CSMnIoYZ.js → page-header-D3lUeEWm.js} +1 -1
- package/dist/assets/{passport-item-VXkf3FVk.js → passport-item-BX30szp1.js} +1 -1
- package/dist/assets/{permission-DeQz9qFD.js → permission-NMvfYJeQ.js} +1 -1
- package/dist/assets/{playground-CTvnZW2L.js → playground-DGDm_k8W.js} +1 -1
- package/dist/assets/preferences-CeBMYsxj.js +1 -0
- package/dist/assets/profile-embed-D7i_oi27.js +1 -0
- package/dist/assets/{pt-C4nfuExm.js → pt-C_3CX1PR.js} +1 -1
- package/dist/assets/publish-resource-DRVUWcok.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-CYy644iX.js → react-beautiful-dnd.esm-Lp0g0Q08.js} +1 -1
- package/dist/assets/{react-stripe.esm-CLg1-THR.js → react-stripe.esm-CBymx38E.js} +1 -1
- package/dist/assets/{required-CobBjKC9.js → required-TNLp5hTp.js} +1 -1
- package/dist/assets/{ru-B4GtNlEa.js → ru-FBGLUlo5.js} +1 -1
- package/dist/assets/runtime-B_S3oSYT.js +1 -0
- package/dist/assets/sdk-CXzRO4fi.js +1 -0
- package/dist/assets/{section-Dq8SB7lh.js → section-BpYiAw-V.js} +1 -1
- package/dist/assets/{security-sVehajDA.js → security-DqsO4co1.js} +1 -1
- package/dist/assets/{session-Bk6ebojT.js → session-DuaiASiB.js} +1 -1
- package/dist/assets/{setup-B9yaqoQM.js → setup-Bv3iwBD5.js} +1 -1
- package/dist/assets/{shorten-label-BHlFrl9P.js → shorten-label-C8uk1g60.js} +1 -1
- package/dist/assets/{simple-select-rm53gQ69.js → simple-select-fgsPxdEE.js} +1 -1
- package/dist/assets/{spaces-HwfT17d7.js → spaces-Dx5KH7MV.js} +1 -1
- package/dist/assets/{start-4J_Dh_zH.js → start-DTrYwwTK.js} +1 -1
- package/dist/assets/{starting-progress-mgdXXqlr.js → starting-progress-B7SsMBie.js} +1 -1
- package/dist/assets/{status-B1AV3yPH.js → status-DV5ZaWRZ.js} +1 -1
- package/dist/assets/{step-actions-YjxSTbIE.js → step-actions-Dt_jvJOc.js} +1 -1
- package/dist/assets/{studio-Cx6j_6QU.js → studio-DZB6_SfH.js} +1 -1
- package/dist/assets/{switch-control-BR8H_fdm.js → switch-control-BXSVR4of.js} +1 -1
- package/dist/assets/{table-tips-BP283GGZ.js → table-tips-BbhDCXCb.js} +1 -1
- package/dist/assets/{team-Dl23XmaY.js → team-DrpyaDg_.js} +1 -1
- package/dist/assets/{th-BkShd6jD.js → th-DmSMYMH5.js} +1 -1
- package/dist/assets/{traffic-O-wVx65-.js → traffic-BEWuWa0Q.js} +1 -1
- package/dist/assets/{transfer-gEq9B27K.js → transfer-BFCvEfMq.js} +1 -1
- package/dist/assets/{unsubscribe-vpGsla5T.js → unsubscribe-D7hdugTe.js} +1 -1
- package/dist/assets/{use-app-logo-7cjs_pn8.js → use-app-logo-B4Ni4-9K.js} +1 -1
- package/dist/assets/{use-mobile-C_DcJ5SZ.js → use-mobile-C7GZXQ3Y.js} +1 -1
- package/dist/assets/{use-mobile-DM4d_PLd.js → use-mobile-CtV6Z2rA.js} +1 -1
- package/dist/assets/{use-server-logo-Cxah39TH.js → use-server-logo-beKp3Dx7.js} +1 -1
- package/dist/assets/{use-window-close-DpgRKaaP.js → use-window-close-Dz6xsCmU.js} +1 -1
- package/dist/assets/{useAsync-BrMo9m7W.js → useAsync-B3JLhOUX.js} +1 -1
- package/dist/assets/{useAsync-CsYRBczg.js → useAsync-BzDh8_wv.js} +1 -1
- package/dist/assets/{useAsyncRetry-D4-sRZN-.js → useAsyncRetry-CxZ45F4C.js} +1 -1
- package/dist/assets/{useLocalStorage-DqhgzGNT.js → useLocalStorage-rkkjWL9w.js} +1 -1
- package/dist/assets/user-center-CmMx3fvE.js +126 -0
- package/dist/assets/user-follower-CKs6NBJh.js +32 -0
- package/dist/assets/user-sessions-tY1bFqyC.js +1 -0
- package/dist/assets/{util-Ca2jlZN4.js → util-BsoIGi_3.js} +1 -1
- package/dist/assets/{util-o8U4JIlX.js → util-_V0aUJlg.js} +1 -1
- package/dist/assets/{vendor-arcblock-B7AoUs4o.js → vendor-arcblock-BWU60ucH.js} +1 -1
- package/dist/assets/vendor-hooks-CLY4g97Q.js +7 -0
- package/dist/assets/{vendor-mui-core-B7zoO8f5.js → vendor-mui-core-C2nSSl8u.js} +10 -10
- package/dist/assets/{vendor-mui-x-Qph0dQcg.js → vendor-mui-x-KqeuegFB.js} +1 -1
- package/dist/assets/{vendor-ux-B7q8W4Pg.js → vendor-ux-BEdmA2UN.js} +2 -2
- package/dist/assets/{vi-C1PSP5SP.js → vi-CjDg6MoB.js} +1 -1
- package/dist/assets/{wait-connect-DPAxcgcf.js → wait-connect-C_6vFp9c.js} +1 -1
- package/dist/assets/{wizard-072KuoFQ.js → wizard-BDOYT_SP.js} +1 -1
- package/dist/assets/{wizard-components-Dx5C9E35.js → wizard-components-DOppNu0m.js} +2 -2
- package/dist/assets/wrap-locale-B-euzNKT.js +1 -0
- package/dist/assets/{zh-C_fDhC3R.js → zh-C7--1pmA.js} +1 -1
- package/dist/assets/{zh-gAK37O_Y.js → zh-DaR6QxjC.js} +1 -1
- package/dist/assets/{zh-tw-BGfyObps.js → zh-tw-DaxtX1HY.js} +1 -1
- package/dist/assets/{zh-tw-DeWXdL1Q.js → zh-tw-yfBxbyqP.js} +1 -1
- package/dist/assets/{zh-B7NO6y1P.js → zh-wVmF24jB.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +31 -31
- package/dist/assets/branding-CXO5C9Lb.js +0 -1
- package/dist/assets/button-DEDR-8Tu.js +0 -1
- package/dist/assets/domains-DrF1lJas.js +0 -1
- package/dist/assets/engine-hsJUTQxh.js +0 -1
- package/dist/assets/get-safe-url-Bpq2IOGY.js +0 -1
- package/dist/assets/index-0VNYJQln.js +0 -271
- package/dist/assets/index-BH6jQqKY.js +0 -55
- package/dist/assets/index-C4e0bu4c.js +0 -124
- package/dist/assets/index-CjfYhb8W.js +0 -1
- package/dist/assets/index-JixySlIT.js +0 -7
- package/dist/assets/localization-DNJagVoT.js +0 -1
- package/dist/assets/logger-yrkSQn8c.js +0 -1
- package/dist/assets/login-C0FSm4ep.js +0 -1
- package/dist/assets/preferences-C7TivEto.js +0 -1
- package/dist/assets/profile-embed-Dzt59MHT.js +0 -1
- package/dist/assets/publish-resource-BSY6p0as.js +0 -1
- package/dist/assets/runtime-B01d8fEk.js +0 -1
- package/dist/assets/sdk-ZTxfQBV1.js +0 -1
- package/dist/assets/user-center-DtJ32yjF.js +0 -126
- package/dist/assets/user-sessions-CFxn5EHL.js +0 -1
- package/dist/assets/vendor-hooks-BRXKH6Nb.js +0 -7
- package/dist/assets/wrap-locale-BQM6_LkP.js +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import{j as e,y as kt,bb as Pe,M as ae,ak as f,Q as _,W as p,J as xe,c0 as St,I as N,aN as Pt,T as I,aj as Rt,b5 as Le,P as Be,b6 as Z,a5 as We,z as Ye,A as Qe,cm as It,bf as Tt,U as Ce,d8 as Mt,d9 as At,at as ee,da as zt,a6 as Y,n as le,D as Et,db as Lt,ar as Oe,b1 as Re,dc as Bt,aX as Wt,am as J,bp as Ot,bq as ve,a$ as Dt,cV as Nt}from"./vendor-mui-core-C2nSSl8u.js";import{r as y,a as $t,u as Ut,j as Ft}from"./vendor-react-Dvs43sk9.js";import{t as Ze,Z as qt,a7 as _t,R as De,D as Ht,C as ce,n as V,A as Gt}from"./vendor-utils-DtY42AM-.js";import{a as Kt,G as Vt,bw as Yt,c as Ie,d as Qt,Y as Zt,bx as Jt,aU as Te,W as fe,bh as Xt,by as er,a5 as tr,aW as rr,a6 as nr,bz as or}from"./index-DO37nRKU.js";import{a as T,h as Je,k as te,g as H,b as E,j as sr}from"./vendor-hooks-CLY4g97Q.js";import{l as Xe}from"./arrow-down.svg-DL1hxWw7.js";import{G as Me,aa as D,T as O,aL as ir,O as et,aM as ar,H as q,aN as lr,aO as cr,aP as Ne,J as dr,D as tt,I as Ae,aQ as ur,aR as A,a2 as pr,a1 as xr,$ as rt,aS as fr,aT as hr,a0 as gr,C as de,a6 as $e,ab as mr}from"./vendor-ux-BEdmA2UN.js";import{N as br}from"./list-KwyPdRy6.js";import{d as yr}from"./search-4YYphs0l.js";import{B as Ue}from"./bundle-avatar-DgaVgcWV.js";import{h as Fe,T as vr}from"./team-DrpyaDg_.js";import{b as wr,d as jr,a as Cr,c as kr,e as Sr,f as Pr,h as Rr,j as Ir}from"./user-center-CmMx3fvE.js";import{N as nt,U as ot}from"./index-Csyn0uY8.js";import{u as re}from"./use-mobile-C7GZXQ3Y.js";import Tr from"./index-D-GZOScK.js";import{f as X}from"./index-DBs9Ljax.js";import{u as ke}from"./index-BC4kejU3.js";import{U as we}from"./user-sessions-tY1bFqyC.js";import Mr from"./index-CzpBsr1A.js";import{o as Ar}from"./vendor-arcblock-BWU60ucH.js";import{c as zr,b as ue,a as Er,S as Lr}from"./index-DexkP2Yg.js";import"./index-N7n9Y6Ev.js";import"./index-BojVbZw0.js";import{U as Br}from"./user-follower-CKs6NBJh.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BWFAeSHM.js";import"./util-BsoIGi_3.js";import"./base32-Bpx2GVVK.js";import"./session-DuaiASiB.js";import"./isURL-B__byeRB.js";import"./use-app-logo-B4Ni4-9K.js";import"./index-DrDeYBYQ.js";import"./api-IUmhrtIY.js";import"./table-tips-BbhDCXCb.js";import"./use-mobile-CtV6Z2rA.js";import"./passport-item-BX30szp1.js";import"./did-address-BWvYsV02.js";import"./index-Bx3gbTGK.js";import"./vendor-mui-x-KqeuegFB.js";import"./AdapterDayjs-DAMiGWmL.js";import"./confirm-DjiQAQPO.js";import"./click-to-copy-xhWFT-k-.js";import"./delete-confirm-D3Ubb7rP.js";import"./permission-NMvfYJeQ.js";import"./actions-ERKO514H.js";import"./index-DRYJ0xIl.js";function Wr(){let t=new Map;function s({root:o,rootMargin:n,threshold:c}){let i=t.get(o);i||(i=new Map,t.set(o,i));let a=JSON.stringify({rootMargin:n,threshold:c}),d=i.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(x=>{x.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:c}),entryCallbacks:r},i.set(a,d)}return{observe:(r,x)=>{d.entryCallbacks.set(r,x),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:s}}var Or="0px",Dr=[0],Nr=Wr();function $r(t){let s=t?.rootMargin??Or,o=t?.threshold??Dr,n=y.useRef(null),c=y.useRef(null),i=y.useRef(null),[a,d]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){d(void 0);return}let v=Nr.getObserver({root:c.current,rootMargin:s,threshold:o});v.observe(C,l=>{d(l)}),i.current=v},[s,o]),x=y.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=y.useCallback(C=>{x(),n.current=C,r()},[r,x]),h=y.useCallback(C=>{x(),c.current=C,r()},[r,x]);return[m,{entry:a,rootRef:h}]}var Ur=$r;function Fr(t){let[s,o]=Ur(t),n=!!o.entry?.isIntersecting,[c,i]=y.useState(n);return n&&!c&&i(!0),[s,{...o,isVisible:n,wasEverVisible:c}]}var qr=Fr,_r=100;function Hr({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:c,delayInMs:i=_r}){let a=y.useRef(o),[d,{rootRef:r,isVisible:x}]=qr({rootMargin:n});y.useEffect(()=>{a.current=o},[o]);let m=!c&&!t&&x&&s;return y.useEffect(()=>{if(m){let h=setTimeout(()=>{a.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[d,{rootRef:r}]}var Gr=Hr;const je={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function pe({severity:t,size:s=8}){return je[t]?e.jsx(f,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:je[t]||je.info}}):null}st.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 st({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:c="",loading:i=!1,...a}){const{t:d}=y.useContext(Me),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"}],x=g=>{(g!==c||!i)&&o(g)},m=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,S,R)=>e.jsx(_,{disabled:i,onClick:()=>x(g.value),className:`profile-button ${S?"active":""}`,...a,children:g.label},g.value||R),C=(g,S,R)=>e.jsx(_,{variant:"text",disabled:i,onClick:()=>x(g.value),className:`profile-line-button ${S?"active":""}`,...a,children:g.label},g.value||R),v=()=>r?.map((g,S)=>{const R=c===g?.value;return s==="line"?e.jsx(y.Fragment,{children:C(g,R,S)},g.value||S):e.jsx(y.Fragment,{children:h(g,R,S)},g.value||S)}),l=g=>{const{value:S}=g.target;x(S==="all"?"":S)};return s==="select"?e.jsx(kt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:c||"all",onChange:l,size:"small",label:"Severity",IconComponent:g=>e.jsx(Xe,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(f,{className:"severity-tabs",sx:m,children:[e.jsx(f,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}it.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function it({loading:t,paging:s,onChange:o}){const{t:n}=y.useContext(Me),c=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||c)return null;const i=(r,x)=>{o({page:x+1})},a=r=>{const x=Number(r.target.value);o({page:1,pageSize:x})},d=s.page-1<=0?0:s.page-1;return e.jsx(f,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(St,{component:"div",disabled:t,count:s.total,page:d,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:x,count:m})=>`${r}–${x} / ${m!==-1?m:`${n()}more than ${x}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:a})})}const Kr=y.memo(it),Vr={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"/>'},qe=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}},Yr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},He=()=>({...Yr,width:"calc(50% - 8px)"});at.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 at({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:c="component",selectedId:i=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:x=()=>{},currentReadFilter:m="all"}){const{t:h}=y.useContext(Me),[C,v]=y.useState(null),l=!!C,[g,S]=y.useState(i),[R,P]=y.useState(a),[b,z]=y.useState(!1),[L,U]=y.useState(""),[j,k]=y.useState([]);y.useEffect(()=>{S(i),P(a)},[i,a]);const B=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=u=>{(u!==m||!s)&&x(u)},Q=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=u=>{v(u.currentTarget),U(""),z(!1)},ge=()=>{v(null)},oe=u=>{const w=g.includes(u)?g.filter(M=>M!==u):[...g,u];S(w),t({id:w,severity:R})},se=u=>{const w=R.includes(u)?R.filter(M=>M!==u):[...R,u];P(w),t({severity:w,id:g})},me=u=>{U(u.target.value)},be=()=>{z(!b)},K=$t.useMemo(()=>{if(!n.size)return[];const u=[];return c==="component"&&u.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const M=w.did||w.meta?.did,W=w.title||w.meta?.title||"",F=w.appPid||w.appDid;(c==="component"&&F!==M||c==="entity"&&F===M)&&u.push({label:W,id:M,blocklet:w,ancestors:w.ancestors})}),u},[n,c,h]);y.useEffect(()=>{if(L.trim()==="")k(K);else{const u=L.toLowerCase(),w=K.filter(M=>M.label.toLowerCase().includes(u));k(w)}},[L,K]);const ye=L.trim()!==""||b?j:j.slice(0,qe);return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(f,{sx:{display:"flex",gap:1.5},children:B.map(u=>e.jsxs(_,{disabled:s,onClick:()=>G(u.value),className:`profile-button ${m===u.value?"active":""}`,sx:{...o==="service"&&m===u.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===u.value?"bold":"normal"},children:[u.label,u.value==="unread"&&r>0&&` (${r})`]},u.value))}),e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(N,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(D,{icon:Vr,hFlip:!0})}),e.jsx(Pt,{open:l,anchorEl:C,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(f,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(_,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Rt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Q.map(u=>e.jsx(Be,{elevation:0,sx:He(R.includes(u.value)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},..._e},control:e.jsx(We,{checked:R.includes(u.value),onChange:()=>se(u.value),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:u.value}),u.label]})})},u.value))})}),e.jsxs(f,{sx:{mb:2},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(f,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ye,{size:"small",placeholder:"search",value:L,onChange:me,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(Qe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(D,{icon:yr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:ye.map(u=>e.jsx(Be,{elevation:0,sx:He(g.includes(u.id)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},..._e},control:e.jsx(We,{checked:g.includes(u.id),onChange:()=>oe(u.id),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[u.blocklet&&e.jsx(Ue,{size:20,blocklet:u.blocklet,ancestors:u.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:u.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:u.label})]})})},u.id))}),j.length>qe&&L.trim()===""&&e.jsx(_,{fullWidth:!0,size:"small",onClick:be,sx:{mt:1},endIcon:b?e.jsx(It,{}):e.jsx(Tt,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(f,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(u=>{const w=Q.find(M=>M.value===u);return e.jsx(Ce,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:u}),w?w.label:u]}),onDelete:()=>se(u),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${u}`)}),g.map(u=>{const w=K.find(M=>M.id===u);return e.jsx(Ce,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Ue,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:u]}),variant:"outlined",onDelete:()=>oe(u),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${u}`)})]}):null]})}const Qr=ee(zt)`
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 20px;
|
|
4
|
+
right: 20px;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
@media (max-width: 600px) {
|
|
7
|
+
bottom: 16px;
|
|
8
|
+
right: 16px;
|
|
9
|
+
transform: scale(0.9);
|
|
10
|
+
}
|
|
11
|
+
`;function Zr(){const[t,s]=y.useState(!1);y.useEffect(()=>{const n=Ze(()=>{s(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const o=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(Mt,{in:t,children:e.jsx(Qr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:o,children:e.jsx(At,{})})})}const Jr=ee.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: ${t=>t.inDialog?0:"24px"};
|
|
15
|
+
.MuiContainer-root {
|
|
16
|
+
padding-right: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.profile-button.MuiButtonBase-root {
|
|
20
|
+
border-radius: 9999px;
|
|
21
|
+
margin-right: 2px;
|
|
22
|
+
padding: 5px 12px;
|
|
23
|
+
line-height: 22px;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
border: 1px solid transparent;
|
|
26
|
+
background-color: ${({theme:t})=>t.palette.background.default};
|
|
27
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
border: 1px solid ${({theme:t})=>t.palette.divider} !important;
|
|
30
|
+
}
|
|
31
|
+
.profile-button.active.MuiButtonBase-root,
|
|
32
|
+
.profile-button.active.MuiButtonBase-root:hover {
|
|
33
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
background-color: ${({theme:t})=>le(t.palette.primary.main,.1)};
|
|
36
|
+
border: 1px solid ${({theme:t})=>le(t.palette.primary.main,.24)} !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.profile-button.MuiButtonBase-root:hover {
|
|
40
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.profile-line-button.MuiButtonBase-root {
|
|
44
|
+
margin-right: 2px;
|
|
45
|
+
color: ${({theme:t})=>t.palette.text.secondary};
|
|
46
|
+
padding: 5px 12px;
|
|
47
|
+
line-height: 22px;
|
|
48
|
+
font-size: 13px;
|
|
49
|
+
border: none !important;
|
|
50
|
+
border-radius: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.profile-line-button.active.MuiButtonBase-root {
|
|
54
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
55
|
+
border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.profile-button.MuiButtonBase-root:last-of-type,
|
|
59
|
+
.profile-line-button.MuiButtonBase-root {
|
|
60
|
+
margin-right: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.profile-line-button.MuiButtonBase-root:hover {
|
|
64
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
65
|
+
background-color: unset;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
* {
|
|
69
|
+
scrollbar-width: none; /* Firefox */
|
|
70
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
*::-webkit-scrollbar {
|
|
74
|
+
display: none; /* Chrome, Safari and Opera */
|
|
75
|
+
}
|
|
76
|
+
`;lt.propTypes={blocklets: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 lt({blocklets:t=[],context:s,pagination:o=!0,inDialog:n=!1,filterType:c="component",toViewAll:i=()=>{},type:a="service"}){const{data:d,paging:r,refresh:x,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:l,initial:g}=s,S=u=>{x({...h,severity:u&&typeof u=="string"?[u]:u||[],paging:{...h.paging,page:1}})},[R]=Ut(),P=T(()=>R.get("id"),[R]),b=xe(u=>u.breakpoints.down("md")),[z,L]=y.useState(0),[U,j]=y.useState(!1),k=y.useMemo(()=>h.read===!1?"unread":"all",[h.read]),B=T(()=>Ze(u=>{if(m)return;const w=d.length,M=d.filter(F=>!Fe(F)).length;let W={...h,append:!0,paging:{...h.paging,...u,currentPage:(r.currentPage||0)+1}};k==="unread"&&M<w&&u.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...u,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),x(W)},500),[d,h,k,r,m,x]);Je(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const u=document.getElementById(P);u&&u.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=T(()=>d?.length>0&&d.length<z,[d,z]),Q=y.useCallback(u=>{const{blocklet:w={}}=window,M=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(u)||M.findIndex(W=>W===u)>-1},[v]),ne=y.useMemo(()=>{const u=new Map;return t.length&&t.forEach(w=>{const M=w?.did||w.meta?.did;M&&!u.has(M)&&(w.ancestors=[],u.set(M,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{u.has(W)||u.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const F=W?.did||W.meta?.did;F&&!u.has(F)&&Q(F)&&(W.ancestors=[w],u.set(F,W))})}),u},[t,Q]),ge=y.useCallback(()=>{m||B({page:r.page+1})},[r.page,m,B]),[oe]=Gr({loading:m,hasNextPage:G,onLoadMore:ge}),se=u=>{!u||Fe(u)||C(u.id).then(()=>{n&&i()})},me=({severity:u,id:w})=>{if(m)return;let M={};c==="component"?M={entityId:[],componentDid:w}:c==="entity"&&(M={componentDid:[],entityId:w}),x({...h,severity:u,...M,paging:{...h.paging,page:1}})},be=u=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};u==="unread"?(w.read=!1,w.paging.currentPage=1):w=qt(w,"read"),x(w)},K=T(()=>c==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:c==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,c]),ye=T(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(Jr,{inDialog:!!n,children:[n?e.jsx(st,{currentTab:ye,type:"line",theme:"light",onSelectType:S}):e.jsx(at,{loading:m,blockletMap:ne,unReadCount:l,filterType:c,type:a,selectedId:K,onFilterChange:me,severity:h.severity,onReadFilterChange:be,currentReadFilter:k}),!b&&m?e.jsx(f,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(br,{data:d,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:a}),o&&!b?e.jsx(Kr,{loading:m,paging:r,onChange:B}):null,o&&b&&(m||G)?e.jsx(f,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!n&&b?e.jsx(Zr,{}):null]})}const Xr=y.memo(lt),$=new Yt;function he(t){const{userDid:s=""}={},{session:o}=Kt(),n=T(()=>{if(s)return s;const r=window.location.href,x=_t(r);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:o?.user?.did},[o?.user?.did,s]),c=T(()=>o.user,[o]),i=T(()=>c?n===c?.did:!1,[n,c?.did]),a=te(async()=>{if(await Vt(()=>o?.initialized),i)return o.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,o?.initialized,c]}),d=T(()=>c.passports?.some(r=>r.role===Ie.ROLES.OWNER),[c]);return{currentDid:n,session:o,isMyself:i,user:c,viewUser:a.data,isOwner:d}}function ct({user:t,...s}){const{t:o}=O(),n=Et(),c=T(()=>{const d=(t?.passports||[]).map(r=>({...r,revoked:r.status===ir.REVOKED}));return d.sort((r,x)=>r.revoked===x.revoked?0:r.revoked?1:-1),De(d.filter(r=>!r.display),"role").concat(De(d.filter(r=>r.display),"display.content"))},[t?.passports]),i=T(()=>c?.find(d=>d.name===t.role),[c,t?.role]),a=n.palette.primary.main;return c.length===0?e.jsx(f,{children:e.jsx(et,{children:o("userCenter.noPassport")})}):e.jsx(f,{...s,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...s.sx},children:c.map(d=>e.jsx(wr,{passport:d,user:t,color:window.blocklet.passportColor,createPassportSvg:Qt,title:i&&i.role===d.role?o("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===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))})}ct.propTypes={user:p.object.isRequired};function en({visible:t,onClose:s,nft:o}){return!t||!o?null:e.jsx(tn,{children:e.jsx(Lt,{open:t,onClose:s,children:e.jsx(rn,{onClick:s,children:e.jsx(nt,{data:ot(o),address:o.address,inset:!0})})})})}const tn=ee.div`
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
.mask {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mask {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
background: rgba(0, 0, 0, 0.6);
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transition: opacity 0.2s;
|
|
100
|
+
}
|
|
101
|
+
`,rn=ee.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
height: 100vh;
|
|
106
|
+
width: 100vw;
|
|
107
|
+
|
|
108
|
+
img,
|
|
109
|
+
object {
|
|
110
|
+
max-width: 90vw;
|
|
111
|
+
max-height: 75vh;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nft-display--inset {
|
|
115
|
+
> .MuiBox-root,
|
|
116
|
+
.nft-display__loading {
|
|
117
|
+
width: 75vmin;
|
|
118
|
+
height: 75vmin;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,nn=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:le(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:le(t.palette.background.paper,1)}}}),on={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"}},Ge="https://main.abtnetwork.io/explorer";function dt({user:t}){const{t:s}=O(),o=re(),[n,c]=y.useState({visible:!1,nft:null}),[i,a]=y.useState({anchorEl:null,props:null}),d=P=>{const b=ce(Ge,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,a({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(Ge,"assets",b.address)}})},x=P=>{c({visible:!0,nft:P})},m=H({page:1,size:20}),h=te(async(P=m)=>(await Ht.get(`${Ie.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&m,defaultParams:[m],refreshDeps:[t?.did,m]}),{loading:C,data:v}=h,l=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{m.page=b,h.run(m)},S=E(P=>[e.jsx(N,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),d(P.address)},children:e.jsx(D,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(N,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(N,{size:"small",onClick:b=>{b.stopPropagation(),x(P)},className:"mask-item",children:e.jsx(D,{icon:"tabler:eye",fontSize:18})},"view")]),R=T(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Oe,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Oe,{width:"20%"}),e.jsx(f,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:s("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(et,{children:s("userCenter.common.noNFT")})}),e.jsx(f,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(f,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...o?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(nt,{data:ot(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),o?e.jsx(f,{className:"footer-mask",sx:on,children:S(P)}):e.jsx(f,{className:"mask",sx:nn,children:e.jsx(Re,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),l.next||m.page>1?e.jsx(Bt,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:g,count:Math.ceil(l.total/m.size),size:"small"}):null,e.jsx(en,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{c({visible:!1,nft:null})}}),e.jsx(ar,{anchorEl:i.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,l,m.page,m.size,g,i,n]);return e.jsx(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}dt.propTypes={user:p.object.isRequired};function sn(){const{t}=O(),{user:s,isMyself:o,viewUser:n}=he();return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[o?e.jsxs(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ct,{user:s})]}):null,e.jsx(dt,{user:o?s:n})]})}const an=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function ut({user:t,onSave:s}){const{t:o,changeLocale:n}=O(),c=H({locale:t.locale,loading:!1}),i=E(async a=>{try{const{value:d}=a.target;c.loading=!0,await $.user.saveProfile({locale:d}),await s("profile"),n(d),c.locale=d}catch(d){q.error(X(d))}finally{c.loading=!1}});return e.jsxs(f,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(f,{children:o("userCenter.commonSetting.locale")}),e.jsx(f,{children:e.jsx(Pe,{value:c.locale,onChange:i,size:"small",IconComponent:a=>e.jsx(Xe,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||an).map(a=>e.jsx(ae,{value:a.code,children:a.name},a.code))})})]})}ut.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function Se({onTest:t=V,onDelete:s=V,onSave:o=V,onCancel:n=V,type:c="slack",url:i="",edit:a=!1}){const{t:d}=O(),r=H({type:c||"slack",url:i||"",edit:a??!1,error:"",loading:!1}),x=E(()=>r.url?Zt(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=c||"slack",r.error="",r.loading=!1,n()}),h=E(async l=>{r.loading=!0,await t(l),r.loading=!1}),C=E(l=>()=>{x()&&l({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Y,{size:16}):e.jsx(N,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(D,{icon:jr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(f,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Pe,{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(ae,{value:"api",children:d("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:d("userCenter.webhook.slack")})]}),e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ye,{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,x()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Qe,{position:"end",children:v})}}}),e.jsx(f,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(N,{color:"success",onClick:C((...l)=>{o(...l),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:lr})}),e.jsx(N,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:cr})})]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:Cr})}),e.jsx(N,{color:"error",onClick:()=>{s({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(D,{icon:kr})})]})})]})]})}Se.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 ie({title:t=void 0,description:s=void 0,value:o,onChange:n,isMobile:c}){const i=E(a=>{a.stopPropagation()});return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ke,{checked:o,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:c?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:c?"normal":"nowrap"},children:[t,s]})]})}ie.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function pt({user:t,isMobile:s}){const{t:o}=O(),n=H({showAdd:!1}),c=te(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...c?.data?.notifications||{}}),[c?.data?.notifications]),a=T(()=>c?.data?.webhooks||[],[c?.data?.webhooks]),d=E(async v=>{try{await $.user.saveUserNotificationConfig(v),q.success(o("userCenter.saveSuccess")),c.run()}catch(l){q.error(X(l))}}),r=E(async(v,l)=>{await d({notifications:{[v]:l}})}),x=async v=>{try{await $.user.testNotificationWebhook(v),q.success(o("userCenter.webhookTested"))}catch(l){q.error(X(l))}},m=E(async v=>{await d({webhooks:a.filter((l,g)=>g!==v)})}),h=E(async(v,l)=>{await d({webhooks:a.map((g,S)=>S===v?l:g)})}),C=E(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return c.error?e.jsx(Wt,{severity:"error",children:c.error.message}):c.loading||!c.data?e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(ie,{value:i.wallet,isMobile:s,title:o("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(dr,{did:Ne(t),showQrcode:!1,showAvatar:!s,copyable:!0,compact:!0,responsive:!0,startChars:s?2:6})}),e.jsx(ie,{value:i.email,isMobile:s,onChange:v=>r("email",v.target.checked),title:o("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:s,value:i.push,title:o("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Re,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,l)=>e.jsx(Se,{onTest:x,onDelete:()=>m(l),onSave:(...g)=>h(l,...g),type:v.type,url:v.url,edit:!1},`${l}_${v.url}`)),n.showAdd&&e.jsx(Se,{onTest:x,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(tt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(D,{icon:Sr}),onClick:()=>{n.showAdd=!0},children:o("userCenter.addWebhook")})]})]})}pt.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function xt({item:t}){const s=Ae(),{blocklet:o}=Jt(),{confirmApi:n,confirmHolder:c}=Te(),i=H({loading:!1}),{t:a}=O(),{session:d}=y.use(fe),{bindOAuth:r,unbindOAuth:x,setBaseUrl:m,baseUrl:h}=d.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=d.usePasskey(),l=T(()=>ur[t?.provider]||"unknown",[t?.provider]),g=E(async()=>{if(t?.provider===A.PASSKEY){await new Promise((b,z)=>{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(L){C({session:d,connectedAccount:t}).then(b).catch(z),L()},onCancel:b})});return}try{i.loading=!0,await new Promise((b,z)=>{if(t?._bind)n.open({title: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(L){x({session:d,connectedAccount:{...Gt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),L()},onCancel:b});else if(t.provider===A.WALLET)d.bindWallet({onSuccess:b,onCancel:z});else{const L=h,U=window?.blocklet;let j="/";const k=pr(U),B=xr(U);k&&B?.appPid&&d?.user?.sourceAppPid&&(j=B.appUrl),m(j),v(o?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{m(L),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{i.loading=!1}}),S=E(b=>b.provider===A.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):b?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),R=E(b=>b.provider===A.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===A.PASSKEY?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):""),P=E(b=>b.provider===A.WALLET&&b.did||b.provider===A.PASSKEY&&(s.arcSphere||s.wallet)?!0:!!t._mainProvider,[s.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(f,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Xt,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:b})=>t?.provider===A.GITHUB&&b.mode==="dark"?"invert(1)":"none"}}),e.jsx(f,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:l}),t.userInfo?.email||t.did?e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(f,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(J,{title:e.jsx(e.Fragment,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rt,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(f,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]})}),children:e.jsx(f,{component:D,icon:er,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(J,{title:R(t),placement:"auto",children:e.jsx(f,{children:e.jsx(tt,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,L=b.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(D,{icon:Pr}),onClick:g,disabled:P(t),loading:i.loading,children:S(t)})})}),c]})}xt.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 ft({user:t}){const{session:s}=y.use(fe),[o,n]=y.useState({}),{getOAuthConfigs:c}=s.useOAuth(),i=Ae();sr(async()=>{const r=await c({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(o).map(x=>({...o[x],provider:x})).filter(x=>x.enabled);return[{provider:A.WALLET,order:-1},...r,{provider:A.PASSKEY,order:1/0}]},[o]),d=T(()=>{const r=fr(t);let x=!1,m="",h=hr(t);const C=r.find(l=>l.provider===A.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(l=>l.provider==="google")||(x=!0,m=A.GOOGLE,h===A.AUTH0&&(h=A.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(l=>l.provider===A.APPLE)||(x=!0,m=A.APPLE,h===A.AUTH0&&(h=A.APPLE))),C.id.startsWith("github|")&&(r.some(l=>l.provider===A.GITHUB)||(x=!0,m=A.GITHUB,h===A.AUTH0&&(h=A.GITHUB)))),a.map(l=>{if(l.provider===A.AUTH0&&x)return null;const g=x&&l.provider===m?r.find(S=>S.provider===A.AUTH0):r.find(S=>S.provider===l.provider);return g?{...l,provider:l.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:l.provider===h}:{...l,provider:l.provider,_rawProvider:l.provider,_mainProvider:l.provider===h}}).filter(l=>!(!l||l.provider===A.PASSKEY&&!l.did)).sort((l,g)=>l._mainProvider?-1:l?.order!==void 0&&g?.order!==void 0?l.order-g.order:l?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(f,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(xt,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(tr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ft.propTypes={user:p.object.isRequired};function ht({configList:t,onSave:s}){const[o,n]=y.useState(t),{t:c}=O(),i=E(async(a,d)=>{try{const r=await $.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(o.map(x=>({...x,value:r?.[x.key]??x.value}))),q.success(c("userCenter.saveSuccess")),s("privacy")}catch(r){q.error(X(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:o.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(f,{children:[e.jsx(ke,{checked:d,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:c("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:x}=r.target;a.followersOnly?i(a.key,x?"all":"private"):i(a.key,x)}},a.key),a.followersOnly&&d&&e.jsx(f,{sx:{pl:3,pt:1},children:e.jsx(ke,{checked:a.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:c("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:x}=r.target;i(a.key,x?"follower-only":"all")}})})]})})})}ht.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 gt({user:t,sessionUser:s}){const o=T(()=>(t?.passports||[])?.find(n=>n.name===s.role),[t?.passports,s?.role]);return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rt,{size:40,variant:"circle",shape:"circle",src:s.avatar,did:s.did,sx:{flexShrink:0}}),e.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(J,{title:s.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:s.fullName})}),e.jsx(Ce,{label:o?.title||o?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(J,{title:s.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.email})})]})]})}gt.propTypes={user:p.object.isRequired,sessionUser:p.shape({role:p.string,avatar:p.string,did:p.string,fullName:p.string,email:p.string}).isRequired};const ln=()=>Promise.resolve(""),Ke=t=>new we(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we.BROWSER.NAME,we.BROWSER.VERSION]]}).getResult(),Ve={display:"flex",justifyContent:"flex-end",textAlign:"right"},cn=new rr({concurrency:1}),ze=y.memo(({userSession:t,isMobile:s=!1})=>{const o=H({loading:!0,ipRegion:""}),{t:n}=O();return y.useEffect(()=>{cn.add(async()=>{try{o.ipRegion=await ln(t.lastLoginIp)}finally{o.loading=!1}})},[o,t.lastLoginIp]),e.jsx(f,{...s&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:o.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:o.ipRegion}),e.jsx(I,{variant:"body2",color:"grey",children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{children:t.lastLoginIp||n("userCenter.unknown")}),o.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Y,{size:12,color:"inherit"})}):null]})})});ze.propTypes={userSession:p.object.isRequired,isMobile:p.bool};ze.defaultProps={isMobile:!1};function mt({user:t,showAction:s=!0,showUser:o=!0,getUserSessions:n,showOffline:c=!1}){const i=H({status:"online",page:1,pageSize:10}),a=H({online:0,expired:0,offline:0}),d=gr(),{t:r}=O(),x=re({key:"md"}),m=xe(j=>j.breakpoints.down("lg")),{confirmApi:h,confirmHolder:C}=Te(),v=E(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),k=j?.paging?.total||0;return a[i.status]=k,{total:k,list:j?.list||[]}});Je(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});a.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});a.offline=k?.paging?.total||0});const l=te(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=T(()=>l.data?.list||[],[l.data?.list]),S=T(()=>{const{status:j}=i;return j==="online"?a[j]<=1:a[j]===0},[g,d]),R=T(()=>de({},x?Ve:{}),[x]),P=E(({visitorId:j})=>{h.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=i,{list:B=[]}=l.data||{},G=B.length||0;k>1&&G===1&&(i.page=Math.max(k-1,1)),l.refresh(),h.close()}})}),b=E(()=>{h.open({title:r("userCenter.logoutAllSession",{type:r(i.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(i.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({status:i.status,visitorId:d,includeFederated:!0}),i.page=1,l.refresh(),h.close()}})}),z=[];s&&z.push(e.jsx(J,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(_,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:S,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const L=T(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:l.data?.total||0}),[l.data?.total,i.page,i.pageSize]),U=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=g[j],B=Ke(k?.ua);return e.jsx(f,{sx:R,children:[B.os?.name,B.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=g[j],B=Ke(k?.ua);return e.jsx(f,{sx:R,children:[B.browser?.name,B.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.extra?.walletOS||r("userCenter.unknown")})}}},o&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:de({minWidth:150,maxWidth:250},x?Ve:{}),children:e.jsx(gt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.createdAt?e.jsx($e,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!c&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.status==="expired"?r("userCenter.expired"):e.jsx($e,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(ze,{userSession:k,isMobile:x})}}},s&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:e.jsx(_,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:d===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):d===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(f,{className:"pc-user-sessions",sx:{maxWidth:x?"unset":m?"calc(100vw - 300px)":"100%",...x&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...x&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[C,e.jsx(mr,{count:l.data?.total||0,data:g,columns:U,customButtons:z,options:L,loading:l.loading,className:"pc-user-sessions-table",title:e.jsxs(Ot,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(Z,{value:"online",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",a.online,")"]})]})}),e.jsx(Z,{value:"expired",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",a.expired,")"]})]})}),c?e.jsx(Z,{value:"offline",control:e.jsx(ve,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",a.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}mt.propTypes={user:p.object.isRequired,showAction:p.bool,showUser:p.bool,showOffline:p.bool,getUserSessions:p.func.isRequired};function bt({onDestroySelf:t=void 0}){const{confirmHolder:s}=Te(),{t:o}=O(),{session:n}=y.use(fe),c=E(async()=>{if(!t||typeof t!="function")return;const i=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await i(),n.logout()}catch(a){q.error(a?.message||o("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(f,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:o("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:o("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(_,{variant:"contained",color:"error",size:"small",onClick:c,children:o("userCenter.dangerZone.delete")})]})}),s]})}bt.propTypes={onDestroySelf:p.func};function dn(){const t=re({key:"md"}),s=xe(c=>c.breakpoints.down("lg")),o={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>de({},t?o:{}),[t]);return e.jsx(f,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":s?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:c=>`${c.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(Mr,{isSelf:!0,columnSx:n})})}function yt({onDestroySelf:t=void 0,userCenterTabs:s=[]}){const{t:o}=O(),{user:n,session:c,isMyself:i,isOwner:a}=he(),r=Ae().arcSphere,x=re({key:"md"}),m=te(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=T(()=>s.map(l=>({key:l.value,name:l.label,value:l.protected,isPrivate:l.isPrivate,followersOnly:l.followersOnly})),[s]),C=E(async l=>l==="privacy"?(await m.runAsync(),m.data):(l==="profile"&&await c.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:o("userCenter.commonSetting.title"),value:"common",content:e.jsx(ut,{user:n,onSave:C})},{label:o("userCenter.notificationManagement"),value:"notification",content:e.jsx(pt,{user:n,isMobile:x})},{label:o("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ft,{user:n})},{label:o("common.accessKeys"),value:"accessKeys",content:e.jsx(dn,{isSelf:!0})},{label:o("common.mcpServers"),value:"mcpServers",content:e.jsx(Tr,{})},{label:o("userCenter.privacyManagement"),value:"privacy",content:e.jsx(ht,{configList:h,onSave:C})},{label:o("userCenter.sessionManagement"),value:"session",content:e.jsx(mt,{user:n,showUser:!1,getUserSessions:l=>$.userSession.getMyLoginSessions({},l)})},!a&&t&&typeof t=="function"?{label:o("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(bt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,x,a,t]);return i?e.jsx(f,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(l=>l?e.jsxs(f,{id:l.value,sx:de({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},l.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:l.label}),e.jsx(f,{sx:{mt:2.5},children:l.content})]},l.value):null)}):null}yt.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const vt=y.createContext({}),{Provider:un,Consumer:po}=vt;function wt({children:t}){const[s]=y.useState(!1),{session:o}=y.use(fe),{user:n}=o,[c,i]=y.useState(),a=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const d=async()=>{i(void 0)},r=h=>{},x=async h=>{i(h),await r(h.endpoint)},m=!!(a&&c);return e.jsx(un,{value:{loading:s,spaceGateway:c,session:o,deleteSpaceGateway:d,updateSpaceGateway:x,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function Ee(){return y.use(vt)}wt.propTypes={children:p.node.isRequired};function pn(t){const s=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(s,"space",n)}function jt({session:t,spaceGateway:s,spaceStatus:o,refresh:n}){return e.jsxs(Re,{direction:"row",spacing:1,children:[o===zr.DISCONNECTED&&e.jsx(ue,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:c=>{console.error(c),q.error(X(c))}}),e.jsx(N,{size:"small",LinkComponent:Dt,href:pn(s.endpoint),target:"_blank",children:e.jsx(Nt,{})})]})}jt.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function Ct({spaceGateway:t=void 0}){const{t:s}=O(),{updateSpaceGateway:o,session:n}=Ee(),c=re(),i=({spaceGateway:a})=>o(a);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:s("userCenter.storage.spaces.connected.title")}),!c&&e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(f,{children:t&&e.jsx(Er,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(jt,{session:n,...a})},t.endpoint)}),c&&e.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}Ct.propTypes={spaceGateway:p.object};function xn(){const{t}=O(),{updateSpaceGateway:s,session:o}=Ee(),n=({spaceGateway:c})=>s(c);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Lr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(f,{children:e.jsx(ue,{session:o,onSuccess:n})})]})}function fn(){const{spaceGateway:t,hasStorageEndpoint:s,loading:o}=Ee(),{isMyself:n}=he();return n?o?e.jsx(Ar,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(gn,{children:e.jsx(f,{sx:{maxWidth:"720px"},children:s?e.jsx(Ct,{spaceGateway:t}):e.jsx(xn,{})})}):null}function hn(){return e.jsx(wt,{children:e.jsx(fn,{})})}const gn=ee(f)`
|
|
122
|
+
height: 100%;
|
|
123
|
+
overflow-y: auto;
|
|
124
|
+
`;function mn(){const{user:t,isMyself:s,viewUser:o}=he(),{followUser:n,unfollowUser:c,followed:i}=Rr(),a=async(d,r)=>{await(r?c:n)(d)};return e.jsx(f,{children:e.jsx(Br,{teamDid:window?.blocklet?.did||"",user:s?t:o,onToggleFollow:a,followed:i})})}function xo(){const{api:t}=nr(),s=y.useRef(null),n=Ft().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),a=or(),d=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(x=>({...x,meta:{...x,did:x.did,name:x.name||x.title||"",logo:"logo.png"}}))})),r=async x=>{const{input:m,sessionId:h}=x;try{await t.destroySelf({input:{...m,sessionId:h}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(vr,{children:e.jsxs(Ir,{ref:s,embed:i==="1",currentTab:n?ce(Ie.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(Xr,{blocklets:[d],context:a}):null,n==="nfts"?e.jsx(sn,{}):null,n==="settings"?e.jsx(yt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(hn,{}):null,n==="user-followers"?e.jsx(mn,{}):null]})})}export{xo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as y1,J as Ct,j as d,Y as ht,$ as Et,I as mt,
|
|
1
|
+
import{D as y1,J as Ct,j as d,Y as ht,$ as Et,I as mt,dR as yt,ar as g1,ak as ee,a$ as he,cV as A1,b1 as gt,am as S1,T as Ee,bC as At,z as St,cs as Dt,a6 as Bt,Q as wt}from"./vendor-mui-core-C2nSSl8u.js";import{C as P,a as bt,ag as D1,J as de,c as It,w as Ht,B as U,I as Tt,F as Ot}from"./vendor-utils-DtY42AM-.js";import{T as vt,a5 as B1,J as xt,l as Ft,r as Lt,a as Ut,b as kt,c as Rt,d as w1,e as Pt,f as Mt,g as Nt,h as b1,i as jt,j as Vt,k as Jt,m as I1,n as Kt,o as Zt,p as Qt,q as Fe,s as _t,t as Gt,u as Xt,v as zt,am as Yt,b6 as qt,F as Wt,D as Pe,b7 as Me}from"./vendor-ux-BEdmA2UN.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{k as H1,b as T1,a as be}from"./vendor-hooks-CLY4g97Q.js";import{bl as Le,Y as Ue,cg as O1,ch as $t,au as ie,v as e6,bu as t6,bw as r6}from"./index-DO37nRKU.js";import{x as n6}from"./index-DRYJ0xIl.js";import{f as i6}from"./index-BojVbZw0.js";import{v as Ne}from"./index-N7n9Y6Ev.js";const me=Le({});function s6({key:e}={key:"md"}){const r=y1();return Ct(r.breakpoints.down(e))}var L=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(L||{}),v1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(v1||{}),K=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(K||{});function a6({endpoint:e,deps:r=[]}){return H1(async()=>{if(!Ue(e))return;const{headers:n}=await me.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,u,a,C,c,f,E,o,l,p]=[n["x-space-name"],n["x-subscription-id"],n["x-listable"]==="true",n["x-readable"]==="true",n["x-writeable"]==="true",n["x-space-version"],n["x-space-owner-did"],n["x-space-is-available"],n["x-error-code"],n["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(o===void 0||l===void 0){const g=a&&C&&c;return{version:f,name:h,subscriptionId:u,ownerDid:E||"",isAvailable:g,errorCode:g?0:L.UNAUTHORIZED,isSiteAdmin:p==="true"}}return{version:f,name:h,subscriptionId:u,ownerDid:E,isAvailable:o==="true",errorCode:parseInt(l,10),isSiteAdmin:p==="true"}},{refreshDeps:[e].concat(r),onError(n){console.error(n)}})}const o6=O1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
|
|
2
2
|
1. Please contact the DID Space administrator to verify the relevant configuration.
|
|
3
3
|
2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"DID Space is currently unreachable due to potential server issues, network problems, or maintenance. Please click the link to visit the homepage and check its status.",incompatible:`The current connection of DID Spaces version ({spaceVersion}) is not compatible with the component version ({expectVersion}). Please contact the administrator for adjustments.
|
|
4
4
|
If you are the administrator, you can click the link below to take action.`},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID Spaces NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to DID Spaces"}}},auditLog:{backup:{description:"A backup operation was completed {relativeTime}"},restore:{description:"A restore operation was completed {relativeTime}"},connected:{description:"A connection was established {relativeTime}"},disconnected:{description:"The connection was disconnected {relativeTime}"},objectsSync:{description:"{totalCount} objects ({size}) were synchronized {relativeTime}"}}}),c6=O1.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级",viewMore:"查看更多"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"连接至 DID Spaces",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",blockedByCors:"因 CORS 限制,访问被阻止",unreachable:"DID Space 无法访问",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",cors:`连接请求可能因 CORS 限制而失败:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u}from"./vendor-react-Dvs43sk9.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bm as B,I as P,a6 as W,bE as M,aj as X,bF as G}from"./vendor-mui-core-
|
|
1
|
+
import{r as u}from"./vendor-react-Dvs43sk9.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bm as B,I as P,a6 as W,bE as M,aj as X,bF as G}from"./vendor-mui-core-C2nSSl8u.js";import{C as H}from"./Google-BsTnh-4u.js";import{G as U}from"./vendor-ux-BEdmA2UN.js";import{aK as Y,f as $}from"./index-DO37nRKU.js";import{A as J}from"./vendor-arcblock-BWU60ucH.js";import{R as Q}from"./required-TNLp5hTp.js";import{F as Z}from"./form-wrapper-Buohf72H.js";import{L as v}from"./logo-uploader-CIzfJVj3.js";import{A as ee,a as ne,b as te}from"./collapse-6qdm8LaH.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(H,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?J(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=G`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{W as o,j as n,ak as f,f as y,bf as S,av as j,D as _}from"./vendor-mui-core-
|
|
1
|
+
import{W as o,j as n,ak as f,f as y,bf as S,av as j,D as _}from"./vendor-mui-core-C2nSSl8u.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,aj as A,T as B,y as L,a7 as W}from"./vendor-ux-BEdmA2UN.js";import{aT as H,b1 as Y,b2 as C,k as Z,b3 as V,b4 as G,b5 as J,aj as K,b6 as N,b7 as P}from"./index-DO37nRKU.js";import{Y as Q,I as U,Z as X}from"./vendor-utils-DtY42AM-.js";import{a as ee}from"./vendor-hooks-CLY4g97Q.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(ne,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const ne=k("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
font-size: 14px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-
|
|
1
|
+
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-C2nSSl8u.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{G as S,D as p}from"./vendor-ux-BEdmA2UN.js";import{a as C}from"./page-header-D3lUeEWm.js";import{a8 as g}from"./index-DO37nRKU.js";import{o as b}from"./vendor-arcblock-BWU60ucH.js";import{u as k}from"./config-space-Hn6vDRvK.js";import{C as y,D as v,a as w}from"./connect-to-CR0Mrnxa.js";import{S as c}from"./step-actions-Dt_jvJOc.js";import{S as E}from"./layout-BtMyFuvH.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./spaces-Dx5KH7MV.js";import"./api-IUmhrtIY.js";import"./index-DexkP2Yg.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-N7n9Y6Ev.js";import"./index-DBs9Ljax.js";import"./use-mobile-C7GZXQ3Y.js";import"./content-layout-C04Obhnh.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(D,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const D=j(E)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{T as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{B as oT,D as $m,E as Xm,F as Zm}from"./vendor-hooks-CLY4g97Q.js";import{B as qm}from"./vendor-utils-DtY42AM-.js";import{g as jL,a as JL,r as QL}from"./vendor-react-Dvs43sk9.js";/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as m,j as e,Q as c,bf as B,P as C,ai as E,o as I,bg as P,O as z}from"./vendor-mui-core-
|
|
1
|
+
import{M as m,j as e,Q as c,bf as B,P as C,ai as E,o as I,bg as P,O as z}from"./vendor-mui-core-C2nSSl8u.js";import{r as o}from"./vendor-react-Dvs43sk9.js";import{n as A}from"./vendor-utils-DtY42AM-.js";import{l as p}from"./vendor-ux-BEdmA2UN.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[g,l]=o.useState(!1),n=o.useRef(null),j=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:g,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:j})})})})]})}L.Item=m;const v=p(P)`
|
|
2
2
|
> .MuiButtonBase-root:last-of-type {
|
|
3
3
|
min-width: 2em;
|
|
4
4
|
padding-left: 0;
|