@abtnode/blocklet-services 1.17.8-beta-20260116-080047-9fdd00d3 → 1.17.8-beta-20260119-102944-6ba93a16
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/dist/assets/{AdapterDayjs-BI3dme25.js → AdapterDayjs-CYW0YvmK.js} +1 -1
- package/dist/assets/{Google-BMSeyXdi.js → Google-DKRt92nm.js} +1 -1
- package/dist/assets/{access-control-CSfPgD_B.js → access-control-RI6LQbSm.js} +1 -1
- package/dist/assets/{actions-Ng-YRTer.js → actions-BlWED76c.js} +2 -2
- package/dist/assets/{actions-Dktj9pEF.js → actions-DydkTgA0.js} +1 -1
- package/dist/assets/{add-component-core-DOIm-W83.js → add-component-core-nc1ps0ni.js} +32 -32
- package/dist/assets/{add-resource-_wuuBiJJ.js → add-resource-BVOdOQSW.js} +1 -1
- package/dist/assets/{addon-N_sS-Sx6.js → addon-DfWedLEC.js} +1 -1
- package/dist/assets/{advanced-BhbxG-_n.js → advanced-CuKHqbLO.js} +2 -2
- package/dist/assets/{aigne-DElJAbjP.js → aigne-6nMSoyeQ.js} +1 -1
- package/dist/assets/{appearance-D71HSeGD.js → appearance-C9TkbSjV.js} +1 -1
- package/dist/assets/{ar-BHqjWgUQ.js → ar-DOhYGTlW.js} +1 -1
- package/dist/assets/{audit-logs-Ci_HlT4m.js → audit-logs-DKGke9hI.js} +2 -2
- package/dist/assets/{authorize-DQERA3Vv.js → authorize-DkSqywe8.js} +1 -1
- package/dist/assets/{base-chart-DWXZOkNE.js → base-chart-DcZV4ZCI.js} +1 -1
- package/dist/assets/{base32-Cpvj2sD4.js → base32-7iZvvdX8.js} +1 -1
- package/dist/assets/{bind-account-BIzFrnLk.js → bind-account-DOwM9Nhe.js} +1 -1
- package/dist/assets/branding-Cak2s8bn.js +1 -0
- package/dist/assets/{branding-BHJqY7Mz.js → branding-CwSyd5WC.js} +1 -1
- package/dist/assets/{branding-DAdwbyWZ.js → branding-lcfxmmPp.js} +1 -1
- package/dist/assets/{bundle-avatar-sDqev1Fh.js → bundle-avatar-DwiOyeMO.js} +1 -1
- package/dist/assets/button-uUU4Wycr.js +1 -0
- package/dist/assets/{click-to-copy-RBTqACSW.js → click-to-copy-BgIYUMoo.js} +1 -1
- package/dist/assets/{collapse-DWmyzfnW.js → collapse-RMuUWnK3.js} +1 -1
- package/dist/assets/{complete-D6XDZtnV.js → complete-Udiv_yFp.js} +1 -1
- package/dist/assets/{component-B2qSKMGx.js → component-CuKviNC8.js} +2 -2
- package/dist/assets/{config-oF-A1tKe.js → config-6IwEgT3b.js} +1 -1
- package/dist/assets/{config-Ca5tnO9j.js → config-CJwxv2uK.js} +1 -1
- package/dist/assets/{config-fYkZxdEr.js → config-D1OcHGlN.js} +4 -4
- package/dist/assets/{config-navigation-BEYJ5bSz.js → config-navigation-hDihVsjx.js} +2 -2
- package/dist/assets/{config-space-HmsYCb6s.js → config-space-DfstlHnF.js} +1 -1
- package/dist/assets/{confirm-DQYDHHdS.js → confirm-CdVn5WdC.js} +1 -1
- package/dist/assets/{connect-COLwEMSx.js → connect-CT2vMz6l.js} +3 -3
- package/dist/assets/{connect-ydb7rKXe.js → connect-DA7RO2yv.js} +1 -1
- package/dist/assets/{connect-BeWeBwCA.js → connect-Dy0Y8HRB.js} +1 -1
- package/dist/assets/{connect-to-C3ac4B-g.js → connect-to-CQMUbQkH.js} +1 -1
- package/dist/assets/{content-layout-CanSZTqf.js → content-layout-Dlmn5DW6.js} +1 -1
- package/dist/assets/{create-passport-svg-De1vqcmo.js → create-passport-svg-hldNORaB.js} +1 -1
- package/dist/assets/{createClass-CRUn7w67.js → createClass-CgfWUrk8.js} +1 -1
- package/dist/assets/{dashboard-BZiea8Z_.js → dashboard-BvI3ii8Z.js} +2 -2
- package/dist/assets/{de-QUGQFv2K.js → de-CtKPdGk6.js} +1 -1
- package/dist/assets/{delete-confirm-CpaOkuin.js → delete-confirm-CkiUXocp.js} +1 -1
- package/dist/assets/{did-address-DRYM96gB.js → did-address-CG36eCOx.js} +1 -1
- package/dist/assets/{domain-D9Kc4Rgt.js → domain-CDTeLbkZ.js} +1 -1
- package/dist/assets/{domain-action-card-ugKl692S.js → domain-action-card-kMPYS2Nj.js} +1 -1
- package/dist/assets/domains-TI6o1CvX.js +1 -0
- package/dist/assets/{email-DDyG3qPR.js → email-DHRHueET.js} +2 -2
- package/dist/assets/{empty-spinner-ChYvCNCV.js → empty-spinner-DB1GKIOS.js} +1 -1
- package/dist/assets/engine-D_fEFx9_.js +1 -0
- package/dist/assets/{es-C4w6cL07.js → es-BSYtSZPg.js} +1 -1
- package/dist/assets/{exchange-passport-DoiXZo5M.js → exchange-passport-Cc872mjQ.js} +1 -1
- package/dist/assets/{fallback-CZRO9TTQ.js → fallback-D-IHOW-7.js} +1 -1
- package/dist/assets/{form--iZWaH7Y.js → form-Co-tgocU.js} +1 -1
- package/dist/assets/{form-text-input-Cs-LuCu0.js → form-text-input-CPLafaTk.js} +1 -1
- package/dist/assets/{form-wrapper-EixE0Jkw.js → form-wrapper-kWYD3nZz.js} +1 -1
- package/dist/assets/{fr-Bq3UipEu.js → fr-C35fi7h9.js} +1 -1
- package/dist/assets/{fuel-C85y6XSK.js → fuel-BFx1ShM2.js} +1 -1
- package/dist/assets/{gen-access-key-DxF-VBeV.js → gen-access-key-DrgLVRbm.js} +1 -1
- package/dist/assets/{gen-simple-access-key-Cxq1_uy6.js → gen-simple-access-key-B24d6k7g.js} +1 -1
- package/dist/assets/get-safe-url-beob4f2C.js +1 -0
- package/dist/assets/{hi-DGZy0DLh.js → hi-5fpYJkiW.js} +1 -1
- package/dist/assets/{home-EzPPxjBW.js → home-Dw18IODa.js} +1 -1
- package/dist/assets/{id-DOzDilAf.js → id-DoVb0JYr.js} +1 -1
- package/dist/assets/{iframe-C5nvJ0m0.js → iframe-DUzp97tk.js} +1 -1
- package/dist/assets/{index-B3ArnS-X.js → index--WQuhwJL.js} +1 -1
- package/dist/assets/{index-Cw8Yly1u.js → index-2M4w6J9r.js} +1 -1
- package/dist/assets/{index-D3fA5iF-.js → index-3H6a5edM.js} +1 -1
- package/dist/assets/{index-_uJPC7_n.js → index-8RHrVCC6.js} +1 -1
- package/dist/assets/{index-BM9QepzF.js → index-B-8044Gs.js} +22 -11
- package/dist/assets/{index-Ba_SJ3UV.js → index-B6l4xGy5.js} +2 -2
- package/dist/assets/{index-CbZQvtgh.js → index-B9FojAjj.js} +1 -1
- package/dist/assets/{index-BQFgfBFX.js → index-BOPR4Iyc.js} +2 -2
- package/dist/assets/{index-VlFqUdI2.js → index-BUhEyicQ.js} +1 -1
- package/dist/assets/{index-DGU5RA0-.js → index-BeunkI-Z.js} +3 -3
- package/dist/assets/{index-_bvucGkF.js → index-Bo9KtpTY.js} +1 -1
- package/dist/assets/{index-r7svI4rK.js → index-Bpic07NM.js} +7 -7
- package/dist/assets/{index-BuucS_rQ.js → index-C1fKsLzf.js} +1 -1
- package/dist/assets/{index-D_ymA2Th.js → index-C4ZzROeE.js} +5 -5
- package/dist/assets/{index-sb6EjUcD.js → index-CEJb82tA.js} +1 -1
- package/dist/assets/{index-Ca33rdd_.js → index-CXp5SI_f.js} +82 -82
- package/dist/assets/{index-zkaWHEAS.js → index-C_kNXHsF.js} +1 -1
- package/dist/assets/{index-DvQIPWQ6.js → index-Cax1AxL9.js} +1 -1
- package/dist/assets/{index-Ca5zgzpl.js → index-CfvGuvbD.js} +1 -1
- package/dist/assets/{index-BbO4pSmm.js → index-CqCXPf7W.js} +1 -1
- package/dist/assets/{index-p0MfrvgW.js → index-Cx0E03Bs.js} +1 -1
- package/dist/assets/{index-CL5ZGYlc.js → index-D3BuekEe.js} +3 -3
- package/dist/assets/{index-D4_8N2le.js → index-D6pCyJv8.js} +1 -1
- package/dist/assets/{index-Ddl9fWMP.js → index-DFUM0Pvk.js} +1 -1
- package/dist/assets/{index-B3fG443w.js → index-DH4rC-7M.js} +1 -1
- package/dist/assets/{index-B2PeJoug.js → index-DKzBOJCu.js} +2 -2
- package/dist/assets/index-DL0wTcgx.js +1 -0
- package/dist/assets/{index-C9V4aWeM.js → index-DWHFecw2.js} +4 -4
- package/dist/assets/{index-Dxb3MonW.js → index-DcW3jqfL.js} +1 -1
- package/dist/assets/{index-CxOxF1pg.js → index-Di2nSesc.js} +1 -1
- package/dist/assets/{index-CiCryHDZ.js → index-DqcciDRh.js} +2 -2
- package/dist/assets/{index-DCxNOCc2.js → index-VKjWmvRV.js} +1 -1
- package/dist/assets/{index-DVOweIMx.js → index-Vf51dp11.js} +1 -1
- package/dist/assets/{index-2AyCotIy.js → index-ZzcJ7eKO.js} +1 -1
- package/dist/assets/{index-Bwibx9MU.js → index-bEFOmVth.js} +1 -1
- package/dist/assets/{info-outline-rounded-DVdLJtdi.js → info-outline-rounded-DlgANjBB.js} +1 -1
- package/dist/assets/{invitation-CUluW5mi.js → invitation-BP8hOEFv.js} +1 -1
- package/dist/assets/invitations-C8aZLxdl.js +3 -0
- package/dist/assets/{invite-zC3nU84H.js → invite-Cd5zEHFb.js} +1 -1
- package/dist/assets/{issue-passport-B_pYDft0.js → issue-passport-D7zqv3Al.js} +1 -1
- package/dist/assets/{item-DoUn7xhc.js → item-DNj7ORqk.js} +1 -1
- package/dist/assets/{ja-DMq-YXDX.js → ja-DZPUwZ9l.js} +1 -1
- package/dist/assets/{ko-BrYbXurh.js → ko-q4i4r9g6.js} +1 -1
- package/dist/assets/{landing-page-BJAji-kI.js → landing-page-JLA-ZD1t.js} +1 -1
- package/dist/assets/{launch-result-message-B2nhmkKt.js → launch-result-message-DJqF-slD.js} +1 -1
- package/dist/assets/{layout-CydCBGqn.js → layout-Cwvm7lmD.js} +1 -1
- package/dist/assets/{list-BIwaCPhs.js → list-3MUy-8Ol.js} +2 -2
- package/dist/assets/{list-CO8Xp7iX.js → list-BSXHuqLM.js} +1 -1
- package/dist/assets/{list-header-DQZTNnUc.js → list-header-BEZSwSji.js} +1 -1
- package/dist/assets/localization-Dond4H78.js +1 -0
- package/dist/assets/{log-JZXyzrRA.js → log-Bq445Z1e.js} +1 -1
- package/dist/assets/logger-CCAAJ2Xo.js +1 -0
- package/dist/assets/{login-CU5Tw5QB.js → login-dc2t9Qyo.js} +1 -1
- package/dist/assets/{login-method-item-KhJ672kA.js → login-method-item-CyTsqz88.js} +1 -1
- package/dist/assets/{login-oauth-callback-Bz7N73Sg.js → login-oauth-callback-Bext19kc.js} +1 -1
- package/dist/assets/{logo-uploader-DjKJkvts.js → logo-uploader-CyZuvhwV.js} +1 -1
- package/dist/assets/{lost-passport-CyJVtH1V.js → lost-passport-BiYg3QQI.js} +1 -1
- package/dist/assets/{metadata-CkzdOpl3.js → metadata-B2-Ltdko.js} +1 -1
- package/dist/assets/{nav-menu-5M0Q4jYU.js → nav-menu-DSdXRbfg.js} +1 -1
- package/dist/assets/{open-window-DphH3aTv.js → open-window-Dyu79ome.js} +1 -1
- package/dist/assets/over-due-invoice-payment-DzUsy6q0.js +1 -0
- package/dist/assets/{overview-CGIG2I_w.js → overview-0TBmi-_i.js} +1 -1
- package/dist/assets/{page-header-B0HpJClf.js → page-header-qdK3sAJh.js} +1 -1
- package/dist/assets/{passport-DKYg_d4G.js → passport-BhEaZ-sr.js} +1 -1
- package/dist/assets/{passport-item-CjcqN_g-.js → passport-item-DHwif94N.js} +1 -1
- package/dist/assets/{permission-DhyiLNfC.js → permission-CvrrGfG6.js} +1 -1
- package/dist/assets/preferences-BBSWzZiT.js +1 -0
- package/dist/assets/profile-embed-shcOdRUI.js +1 -0
- package/dist/assets/{provider-icon-DX-QfJQN.js → provider-icon-DO2PqSth.js} +1 -1
- package/dist/assets/{pt-Dl6732JN.js → pt-BFCHl6F1.js} +1 -1
- package/dist/assets/{publish-resource-vCC9AfJK.js → publish-resource-CMuHIOUf.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-bkXlrjYw.js → react-beautiful-dnd.esm-CWJ5I9Zv.js} +1 -1
- package/dist/assets/{react-stripe.esm-BBCEegrE.js → react-stripe.esm-B-FTN8ep.js} +1 -1
- package/dist/assets/{required-11pmtzQr.js → required-DnQpCGsD.js} +1 -1
- package/dist/assets/{ru-CVUeN9AX.js → ru-CSTl62kK.js} +1 -1
- package/dist/assets/{runtime-BjKYEBG_.js → runtime-B_ZLP4FF.js} +1 -1
- package/dist/assets/sdk-CktKu_IW.js +1 -0
- package/dist/assets/{section-ewv0pNWr.js → section-CZylgxjz.js} +1 -1
- package/dist/assets/{security-Xrnc8Gqe.js → security-DHRU8k0u.js} +1 -1
- package/dist/assets/{session-lE2gmzzF.js → session-Bp3LV7zJ.js} +1 -1
- package/dist/assets/{setup-p5LUFpYK.js → setup-B6-Ei_3X.js} +1 -1
- package/dist/assets/{shorten-label-1iJcvGQT.js → shorten-label-CuBHsWUR.js} +1 -1
- package/dist/assets/{simple-select-BKXEgxog.js → simple-select-nI-W90c_.js} +1 -1
- package/dist/assets/{spaces-Ckljlc4d.js → spaces-ix8u0ZiI.js} +1 -1
- package/dist/assets/{start-BE-C9MhV.js → start-oRp78RMQ.js} +1 -1
- package/dist/assets/{starting-progress-DC-J-5Os.js → starting-progress-CWp5fTY0.js} +1 -1
- package/dist/assets/{status-DR5t3VVx.js → status-Dn_LKaNp.js} +1 -1
- package/dist/assets/{step-actions-CArEuzNw.js → step-actions-DIZRcnXf.js} +1 -1
- package/dist/assets/{studio-BEzAGvQT.js → studio-CVIa8-XY.js} +1 -1
- package/dist/assets/{switch-CmVFEdik.js → switch-BbyTGEOo.js} +1 -1
- package/dist/assets/{switch-control-DbLHF-NB.js → switch-control-BRjXGc1d.js} +1 -1
- package/dist/assets/{table-tips-DQIh1EQR.js → table-tips-Dvmdodc5.js} +1 -1
- package/dist/assets/{team-7-48iuwj.js → team-BTz28XqK.js} +1 -1
- package/dist/assets/{th-32eBNQes.js → th-D75Dlluo.js} +1 -1
- package/dist/assets/theme-mode-toggle-D3bcd10D.js +1 -0
- package/dist/assets/{traffic-Dwd2RNqG.js → traffic-Cea69sMW.js} +1 -1
- package/dist/assets/{transfer-BwnSX6wY.js → transfer-BydXCVCg.js} +1 -1
- package/dist/assets/unsubscribe-BjAjx-Fl.js +1 -0
- package/dist/assets/{use-app-logo-BzsLZwwK.js → use-app-logo-IRizt64R.js} +1 -1
- package/dist/assets/{use-blocklet-logo-BWPJOOVd.js → use-blocklet-logo-Cf1j7pQz.js} +1 -1
- package/dist/assets/{use-mobile-DgmmfWdl.js → use-mobile-CyUZDIaX.js} +1 -1
- package/dist/assets/{use-mobile-BSL5RsRd.js → use-mobile-DFkQ5N0b.js} +1 -1
- package/dist/assets/{use-mobile-TAIHvgoJ.js → use-mobile-DwGMuJlg.js} +1 -1
- package/dist/assets/{use-server-logo-BLcfNvrR.js → use-server-logo-KZn9RrZd.js} +1 -1
- package/dist/assets/{use-window-close-D2_118dJ.js → use-window-close-Dpj5UcYT.js} +1 -1
- package/dist/assets/{useAsyncRetry-B-Txlvk6.js → useAsyncRetry-C4R9ufi-.js} +1 -1
- package/dist/assets/{useLocalStorage-D6axLnAi.js → useLocalStorage-BQfIniHX.js} +1 -1
- package/dist/assets/{user-center-DBscV1le.js → user-center-6K47tx8j.js} +5 -5
- package/dist/assets/{user-follower-Di51icra.js → user-follower-BwzTutxU.js} +1 -1
- package/dist/assets/{util-DCHBQZpP.js → util-DkTwHdRu.js} +1 -1
- package/dist/assets/{util-ad0rjUA1.js → util-DySzCymV.js} +1 -1
- package/dist/assets/{vendor-arcblock-ivFYo5vP.js → vendor-arcblock-Dll6qxMT.js} +1 -1
- package/dist/assets/{vendor-mui-core-D7t4vMS5.js → vendor-mui-core-CV-FnYH_.js} +1 -1
- package/dist/assets/{vendor-mui-x-BpPw6UfF.js → vendor-mui-x-DwN6dcQH.js} +1 -1
- package/dist/assets/{vendor-ux-Dl3wVbv_.js → vendor-ux-CLT2i3Pv.js} +2 -2
- package/dist/assets/{vi-DF8IinAc.js → vi-D1mKYrmb.js} +1 -1
- package/dist/assets/{wait-connect-DOIonmAv.js → wait-connect-q0_7mz_u.js} +1 -1
- package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +68 -0
- package/dist/assets/{wizard-CrkxQgBY.js → wizard-C5Kl-g70.js} +1 -1
- package/dist/assets/{wizard-components-BzPyRFRt.js → wizard-components-DQrlaeeW.js} +1 -1
- package/dist/assets/wrap-locale-5DJTJTXP.js +1 -0
- package/dist/assets/{zh-DQQBhbva.js → zh-CJ9vCpmv.js} +1 -1
- package/dist/assets/{zh-ByJkLAV1.js → zh-G2I44gfs.js} +1 -1
- package/dist/assets/{zh-tw-34G9tsUP.js → zh-tw-C4Juvs-i.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +31 -31
- package/dist/assets/branding-D-ShZ8m2.js +0 -1
- package/dist/assets/button-B_Qd9K_t.js +0 -1
- package/dist/assets/domains-B9b2gmbn.js +0 -1
- package/dist/assets/engine-L1SEogaX.js +0 -1
- package/dist/assets/get-safe-url-D4zRnTpF.js +0 -1
- package/dist/assets/index-BoJbHOhC.js +0 -1
- package/dist/assets/invitations-gJ3uAWGN.js +0 -3
- package/dist/assets/localization-BYdi6ljV.js +0 -1
- package/dist/assets/logger-BMHd-C1S.js +0 -1
- package/dist/assets/over-due-invoice-payment-DD_j5vb4.js +0 -1
- package/dist/assets/preferences-DHjRWgwZ.js +0 -1
- package/dist/assets/profile-embed-Gc79_Dhj.js +0 -1
- package/dist/assets/sdk-CXEy5Pgp.js +0 -1
- package/dist/assets/theme-mode-toggle-BltDSXhy.js +0 -1
- package/dist/assets/unsubscribe-CP0mTwWi.js +0 -1
- package/dist/assets/wallet-hidden-topbar-DKISAPb3.js +0 -68
- package/dist/assets/wrap-locale-BJF_SaOe.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrCTi6nm.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as e,V as ro,z as li,A as no,F as ko,Z as So,b1 as To,T as R,I as ie,ak as Co,a0 as Po,y as Pi,bN as Be,M as ze,aM as Ai,al as g,S as Ao,R as ue,an as ke,bM as Io,aT as Ge,bZ as qo,a4 as ao,bS as Mo,b_ as Do,a8 as zo,G as Lo,a7 as Re,C as Ro,b4 as _o,b3 as mi,L as No,bJ as Eo,bK as ii,bL as oi,at as Oo,bb as $o,bW as Uo,bU as Fo,as as Ii,n as qi,bV as Wo}from"./vendor-mui-core-D7t4vMS5.js";import{r as k,g as Bo}from"./vendor-react-DX7tU9aY.js";import{d as Z,a as M,b as A,n as Ho,x as Zo,i as me,r as Le,j as Vo,p as Go}from"./vendor-hooks-DAZ1H6Va.js";import{k as lo,aq as Yo,i as he,am as Ye,ar as Qo,$ as _e,c as co,aj as Ko,U as Xo,H as Mi}from"./index-Ca33rdd_.js";import{I as Jo,B as et,Y as G,bj as it,W as H,P as Y,a0 as ot,_ as Se,a6 as uo,bk as He,Z as Qe,Q as X,U as hi,bd as tt,aP as pe,ae as st,bf as rt,bg as Di,b4 as fi,N as nt,a1 as ci,aQ as at,bl as lt,ar as B,a4 as ct,a5 as dt,af as po,bh as ti,bi as ut,T as pt,be as mt,X as ht,bm as Ne,l as mo,bb as ft}from"./vendor-ux-Dl3wVbv_.js";import{k as xt}from"./fallback-CZRO9TTQ.js";import{a2 as Ze,z as se,n as ae,ab as gt,v as bt,a4 as zi,x as wt,D as vt,a8 as yt,C as jt,a7 as Li,F as Ri}from"./vendor-utils-BzQg432x.js";import{_ as kt}from"./index-CL5ZGYlc.js";import{N as _i}from"./index-DCxNOCc2.js";import{l as le,g as St,L as Tt,a as $e,N as Ct}from"./wallet-hidden-topbar-DKISAPb3.js";import{t as di}from"./arrow-down.svg-Dz9H9vM-.js";import{a as Pt}from"./revoke.svg-BF_gJc34.js";import{N as xi,U as ho}from"./index-_uJPC7_n.js";import{u as fo}from"./index-zkaWHEAS.js";import{u as gi}from"./use-mobile-DgmmfWdl.js";import{U as Ni}from"./actions-Ng-YRTer.js";import{x as At,d as It}from"./info-outline-rounded-DVdLJtdi.js";import{d as qt,a as Mt}from"./google-icon-vNOJy67F.js";import{o as Dt}from"./vendor-arcblock-ivFYo5vP.js";import{D as zt,a as Ve,b as Lt,S as Rt}from"./index-Cw8Yly1u.js";import"./index-BojVbZw0.js";const Q={zh:{settings:"设置",noPassport:"暂无通行证",passport:"通行证",notification:"通知",email:"邮箱地址",phone:"电话号码",lastLogin:"上次登录",lastLoginAt:"上次登录时间",lastLoginIp:"上次登录地址",createdAt:"加入时间",registerFrom:"注册来源",invitedBy:"邀请人",unknown:"未知",walletNotification:"钱包通知",emailNotification:"邮件通知",phoneNotification:"短信通知",pushNotification:"推送消息(由 Push Kit 提供)",addWebhook:"新增外部通知",saveSuccess:"保存成功",saveFailed:"保存失败",webhookTested:"测试消息已经发送",done:"完成",emptyField:"未填写",emptyContent:"暂无内容",underProtected:"用户已设置隐私保护",followersOnly:"用户已设置仅粉丝可见,关注用户后可查看",noUserFound:"未找到指定的用户",notificationManagement:"通知管理",privacyManagement:"隐私管理",storageManagement:"DID Spaces",userFollowers:"关注 & 粉丝",webhook:{url:"自定义URL",slack:"Slack"},common:{confirm:"确认",cancel:"取消",required:"必填的",invalid:"无效",setting:"设置",save:"保存",profile:"信息",nft:"NFTs",noNFT:"暂无 NFT"},toPublic:"公开 “{name}” 页面",currentPassport:"当前使用的通行证",refreshProfile:{title:"刷新个人信息",successfully:"刷新个人信息成功"},switchProfile:"切换",userInfo:"个人信息",myInfo:"我的信息",hisInfo:"TA 的信息",loginNow:"立即登录",viewAfterLogin:"登录后才可以查看",sessionManagement:"会话管理",storage:{spaces:{tips:"提示",label:"请输入 DID Spaces 服务地址",connectedWithName:"你已成功连接至 {name}",gateway:{delete:{failed:"删除 DID Spaces 失败"}},provideNFT:{title:"请为 {appName} 出示 DID Spaces NFT",scan:"使用你的 DID Wallet 为应用 {appName} 出示 DID Spaces NFT",success:"连接成功"},connect:{useWallet:"使用 DID Wallet 连接",useWalletReconnect:"使用 DID Wallet 重新连接",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"}}},thirdPartyLogin:{title:"已连接的账户",connect:"绑定",disconnect:"解绑",mainProviderCantRemove:"主账号不允许解绑",confirmUnbind:"确定要解绑 {name} 吗?",confirmUnbindDescription:"解绑后您将无法使用 {name} 登录至该账户。如果解绑后,您仍使用 {name} 登录,会自动创建一个新账户",disconnectPasskey:"确定要移除 Passkey 吗?",disconnectPasskeyDescription:"移除后您将无法使用此 Passkey 登录。如果移除后,您仍使用此 Passkey 登录,会自动创建一个新账户"},commonSetting:{title:"通用设置",locale:"偏好语言"},dangerZone:{title:"危险操作",deleteAccount:"删除账户",deleteAccountDescription:"删除账户后,您将无法使用该账户登录,您的数据将从平台中完全删除,不可恢复。",delete:"删除"},userStatus:{Online:"在线",Meeting:"开会中",Community:"通勤中",Holiday:"休假",OffSick:"病假",WorkingRemotely:"远程工作",duration:{NoClear:"不要清除",ThirtyMinutes:"30分钟",OneHour:"1小时",FourHours:"4小时",Today:"今天",ThisWeek:"本周",Custom:"自定义时间"}},profile:{addLink:"添加连接",location:"位置",timezone:"时区",bio:"个人简介",setStatus:"设置状态",localTime:"当地时间:",email:"邮箱地址",emailInvalid:"邮箱格式不正确",emailSourceProviderNotAllowEdit:"使用邮箱注册的用户不允许修改邮箱",phone:"电话号码",phoneInvalid:"电话号码格式不正确",editProfile:"编辑资料",removeStatusAfter:"在...之后移除状态",justForYou:"仅对您可见",cleanStatus:"清除状态",quickSettings:"快捷设置",selectEndTime:"选择结束时间",pleaseSelectTime:"请选择时间",invalidURL:"无效的 URL",duplicateURL:"URL 已存在",socialMedia:"社交链接",timezonePhase:{dawn:"凌晨",morning:"上午",afternoon:"下午",night:"晚上"},address:{title:"地址",country:"国家/地区",province:"州/省",city:"城市/镇",line1:"地址",line2:"地址2",detailedAddress:"详细地址",postalCode:"邮政编码",invalidPostalCode:"邮政编码格式不正确"},maxLinkCount:"最多可添加 {count} 个社交链接",chat:"聊天",follow:"关注",unfollow:"取消关注",follow_success:"关注成功",unfollow_success:"取消关注成功"},destroyMyself:{title:"删除账户",scan:"删除账户后,您将无法使用该账户登录,您的数据将从平台中完全删除,不可恢复。",confirm:"确认删除",cancel:"取消",success:"删除账户成功",abort:"取消删除账户",error:"删除账户失败"},notImplemented:"操作未实现",userCenter:{title:"用户中心"},userNotFound:"用户不存在",userNotFoundDescription:"该账户已被管理员停用或移除。"},en:{settings:"Settings",noPassport:"No passport yet",passport:"Passports",notification:"Notification",email:"Email",phone:"Phone",lastLogin:"Last Login & IP",lastLoginAt:"Last Login",lastLoginIp:"Last IP",createdAt:"Member Since",registerFrom:"Register From",invitedBy:"Invited By",unknown:"Unknown",walletNotification:"DID Wallet notification",emailNotification:"Email notification",phoneNotification:"SMS notification",pushNotification:"Push notification (powered by Push Kit)",addWebhook:"Add external notification",saveSuccess:"Save succeed",saveFailed:"Save failed",webhookTested:"Test message sent",done:"Done",emptyField:"None",notificationManagement:"Notifications",privacyManagement:"Privacy",storageManagement:"DID Spaces",userFollowers:"Following & Followers",emptyContent:"Empty",underProtected:"This page has protected privacy",followersOnly:"This page is only visible to followers, follow the user to view",noUserFound:"No user found",webhook:{url:"Custom url",slack:"Slack"},common:{confirm:"Confirm",cancel:"Cancel",required:"Required",invalid:"Invalid",setting:"Settings",save:"Save",profile:"Profile",nft:"NFTs",noNFT:"No NFT"},toPublic:'Public "{name}" page',currentPassport:"Passport currently in use",refreshProfile:{title:"Refresh profile",successfully:"Refresh profile successfully"},switchProfile:"Switch",userInfo:"User Info",myInfo:"My Info",hisInfo:"His/Her Info",loginNow:"Login",viewAfterLogin:"View after login",sessionManagement:"Session Management",storage:{spaces:{tips:"Tips",label:"Enter DID Spaces Gateway",connectedWithName:"You have successfully connected to {name}",gateway:{delete:{failed:"Delete gateway failed"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to allow the app {appName} show DID space NFT",success:"Connected successfully"},connect:{useWallet:"Connect with DID Wallet",useWalletReconnect:"Reconnect with DID Wallet",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"}}},thirdPartyLogin:{title:"Connected Accounts",connect:"Connect",disconnect:"Disconnect",mainProviderCantRemove:"Main account not allowed to remove",confirmUnbind:"Are you sure to unbind {name}?",confirmUnbindDescription:"You will not be able to log in to this account using {name} after unbundling. If you are still logged in with {name} after unbundling, a new account will be created automatically!",disconnectPasskey:"Are you sure to remove {name}?",disconnectPasskeyDescription:"You will not be able to log in with this passkey upon removing. If you are still logged in with this passkey after removing, a new account will be created automatically!"},commonSetting:{title:"Common Settings",locale:"Preferred language"},dangerZone:{title:"Danger Zone",deleteAccount:"Delete Account",deleteAccountDescription:"Delete account will make you unable to login with this account, your data will be completely deleted from the platform and cannot be recovered.",delete:"Delete"},userStatus:{Online:"Online",Meeting:"In a Meeting",Community:"Commuting",Holiday:"On Holiday",OffSick:"Off Sick",WorkingRemotely:"Working Remotely",duration:{NoClear:"Don't clear",ThirtyMinutes:"30 minutes",OneHour:"1 hour",FourHours:"4 hours",Today:"Today",ThisWeek:"This Week",Custom:"Custom"}},profile:{addLink:"Add link",location:"Location",timezone:"Timezone",bio:"Bio",setStatus:"Set a Status",localTime:"Local Time: ",email:"Email",emailInvalid:"Email is invalid",emailSourceProviderNotAllowEdit:"Email registered users are not allowed to edit email",phone:"Phone",phoneInvalid:"Phone number is invalid",editProfile:"Edit Profile",removeStatusAfter:"Remove status after...",justForYou:"Visible to you only",maxInputLength:"Max input length is",selectEndTime:"Select end time",pleaseSelectTime:"Please select time",cleanStatus:"Clean status",quickSettings:"Quick Settings",invalidURL:"Invalid URL",duplicateURL:"URL already exists",socialMedia:"Social Media",timezonePhase:{dawn:"AM",morning:"AM",afternoon:"PM",night:"PM"},address:{title:"Address",country:"Country/Region",province:"State/Province",city:"City/Town",line1:"Address",line2:"Address 2",detailedAddress:"Detailed Address",postalCode:"Postal Code",invalidPostalCode:"Postal code is invalid"},maxLinkCount:"Up to {count} social links can be added",chat:"Chat",follow:"Follow",unfollow:"Unfollow",follow_success:"Follow successfully",unfollow_success:"Unfollow successfully"},destroyMyself:{title:"Delete Account",scan:"Delete account will make you unable to login with this account, your data will be completely deleted from the platform and cannot be recovered.",confirm:"Confirm delete",cancel:"Cancel",success:"Delete account successfully",abort:"Delete account aborted",error:"Delete account failed"},notImplemented:"This action is not implemented",userCenter:{title:"User Center"},userNotFound:"User not found",userNotFoundDescription:"The account has been deactivated or removed by the administrator."}};var V=(i=>(i.NoClear="no_clear",i.ThirtyMinutes="30_minutes",i.OneHour="1_hour",i.FourHours="4_hours",i.Today="today",i.ThisWeek="this_week",i.Custom="custom",i))(V||{}),K=(i=>(i.Meeting="meeting",i.Community="community",i.Holiday="holiday",i.OffSick="off_sick",i.WorkingRemotely="working_remotely",i))(K||{});Z.extend(Jo);Z.extend(et);const Ei=3600,Oi=1800,$i=600,Ui=300,Fi=60,Wi=1,_t=Z.tz.guess(),Bi=["America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Asia/Tokyo","Asia/Shanghai","Asia/Hong_Kong","Asia/Singapore","Asia/Seoul","Asia/Kolkata","Australia/Sydney","Australia/Melbourne","Pacific/Auckland","America/Sao_Paulo","America/Mexico_City","Africa/Cairo","UTC"],Nt=()=>{if(typeof Intl<"u"&&Intl.supportedValuesOf)try{return Intl.supportedValuesOf("timeZone")}catch{console.warn("Intl.supportedValuesOf not supported, falling back to common timezones")}if(typeof Intl<"u"&&Intl.DateTimeFormat)try{if(new Intl.DateTimeFormat("en",{timeZone:"UTC"}).resolvedOptions().timeZone)return Bi}catch{console.warn("Intl.DateTimeFormat timezone support limited")}return Bi},Sr=()=>Nt().map(i=>{try{const a=Z.tz(Z(),i).utcOffset()/60,t=Math.floor(a),s=a%1*60;return{label:`GMT${t>=0?"+":""}${t}:${s===30?"30":"00"}`,value:i}}catch{return console.warn(`Timezone ${i} not supported, skipping`),null}}).filter(i=>i!==null).sort((i,a)=>{const[t,s]=i.label.replace("GMT","").split(":").map(Number),[x,w]=a.label.replace("GMT","").split(":").map(Number),p=t*60+s;return x*60+w-p}).map(i=>({label:`(${i.label}) ${i.value}`,value:i.value})),ui=i=>lo(Ze(i)),Et=(i,a)=>{if(!i||!a||!ui(i)||!ui(a))return!1;const t=Ze(i.trim()),s=Ze(a.trim());return t.toLowerCase()===s.toLowerCase()},Ot=i=>{let a=i?.dateRange?.map(s=>Z(s))??[];const t=Z();switch(i?.duration){case V.ThirtyMinutes:a=[t,t.add(30,"minutes")];break;case V.OneHour:a=[t,t.add(1,"hour")];break;case V.FourHours:a=[t,t.add(4,"hours")];break;case V.Today:a=[t,t.endOf("day")];break;case V.ThisWeek:a=[t,t.endOf("week")];break;case V.NoClear:a=[t,t];break}return a.map(s=>s.toDate())},$t=i=>{const a=Z();return a.isAfter(Z(i[0]))&&a.isBefore(Z(i[1]))},Hi=i=>{const{duration:a,dateRange:t}=i??{};return!a||!t?!1:a===V.NoClear||Z(t?.[0]).isSame(Z(t?.[1]))},Ut=i=>{const a=Z(),t=Z(i).diff(a,"seconds"),s=x=>x*1e3;return t>=Ei?s(Ei):t>=Oi?s(Oi):t>=$i?s($i):t>=Ui?s(Ui):t>=Fi?s(Fi):t>=Wi?s(Wi):0},Zi={color:"text.primary",borderColor:"grey.100",backgroundColor:"background.default","&:hover":{borderColor:"grey.100",backgroundColor:"action.hover"},py:.5,borderRadius:1},Ft={color:"primary.contrastText",borderColor:"primary.main",backgroundColor:"primary.main","&:hover":{borderColor:"primary.main",backgroundColor:"primary.main"},py:.5,borderRadius:1},Wt={x:{domains:["twitter.com","x.com"]},facebook:{domains:["facebook.com","fb.com"],options:{skipDarkInvert:!0}},"linkedin-icon":{domains:["linkedin.com"],options:{skipDarkInvert:!0}},"github-icon":{domains:["github.com"]},"instagram-icon":{domains:["instagram.com"]},"youtube-icon":{domains:["youtube.com","youtu.be"],options:{skipDarkInvert:!0}},"tiktok-icon":{domains:["tiktok.com"]},"reddit-icon":{domains:["reddit.com"],options:{skipDarkInvert:!0}},"medium-icon":{domains:["medium.com"]},"discord-icon":{domains:["discord.com","discord.gg"],options:{skipDarkInvert:!0}},telegram:{domains:["telegram.org","t.me"],options:{skipDarkInvert:!0}},"whatsapp-monochrome-icon":{domains:["whatsapp.com"]},producthunt:{domains:["producthunt.com"],options:{skipDarkInvert:!0}},ycombinator:{domains:["ycombinator.com","news.ycombinator.com"],options:{skipDarkInvert:!0}}},Tr=i=>{try{const a=Ze(i),t=new URL(a).hostname.toLowerCase().replace(/^www\./,"");for(const[s,{domains:x,options:w}]of Object.entries(Wt))if(x.some(p=>t===p||t.endsWith(`.${p}`)))return{icon:`logos:${s}`,options:w};return}catch{return}};function Bt({user:i,switchPassport:a}){const t=M(()=>(i?.passports||[])?.find(s=>s.name===i.role||s.role===i.role),[i?.passports,i?.role]);return e.jsx(ro,{label:t?.title||i?.role||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.100",backgroundColor:"transparent",textTransform:"capitalize",pr:1,pl:.5,"&:active":{boxShadow:"none"}},clickable:!0,deleteIcon:e.jsx(G,{icon:it,color:"inherit"}),onDelete:a,onClick:a})}const Ht=k.memo(Bt);function Zt({value:i,onChange:a,error:t=void 0,helperText:s=void 0,label:x=void 0,timezone:w=void 0}){const p=k.useRef(null),m=Z().format("YYYY-MM-DDTHH:mm"),h=M(()=>{let u=Z();return i&&(u=w?Z(i).tz(w):Z(i)),u.format("YYYY-MM-DD HH:mm")},[i,w]);return e.jsxs(li,{fullWidth:!0,error:t,children:[e.jsx(no,{inputRef:p,type:"datetime-local",value:h,onChange:u=>{a(new Date(u.target.value))},label:x,error:t,onClick:()=>{p.current?.showPicker()},sx:{"& .MuiInputBase-root":{cursor:"pointer"},"& .MuiOutlinedInput-notchedOutline":{cursor:"pointer"}},slotProps:{htmlInput:{min:m,style:{cursor:"pointer"}},inputLabel:{shrink:!0}}}),s&&e.jsx(ko,{children:s})]})}const Vi={padding:"8px 16px",borderRadius:"8px","&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderRadius:"8px"},".MuiSelect-select":{padding:"0 !important",display:"flex",alignItems:"center"}};function Vt({open:i,onClose:a,data:t,selected:s,onSelect:x,timezone:w=void 0}){const{locale:p}=H(),m=A((c,T={})=>Y(Q,c,p,"en",T)),[h,u]=k.useState(s?.value||""),[f,C]=k.useState(s?.duration||""),[r,d]=k.useState(s?.dateRange?.[1]||""),[n,o]=k.useState(!1);k.useEffect(()=>{u(s?.value||""),C(s?.duration||""),d(s?.dateRange?.[1]||"")},[s]);const l=k.useMemo(()=>h&&f,[h,f]),y=t.find(c=>c.id===h),b=c=>{x({value:c.id,...c.duration?{duration:c.duration}:{}}),a()},v=(c=!1)=>{if(c)x(void 0);else{const T=Z();x({value:h,...f?{duration:f}:{},...f===V.Custom&&r?{dateRange:[T.toDate(),Z(r).toDate()]}:{}})}a()};return e.jsxs(So,{open:i,onClose:a,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{borderRadius:"8px"}},children:[e.jsxs(To,{sx:{borderBottom:"1px solid",borderColor:"divider"},children:[e.jsx(R,{variant:"body1",sx:{fontSize:"16px !important",mb:0},children:m("profile.setStatus")}),e.jsx(ie,{"aria-label":"close",onClick:a,sx:{position:"absolute",right:8,top:8,color:c=>c.palette.grey[500]},children:e.jsx(Co,{})})]}),e.jsxs(Po,{children:[e.jsxs(li,{fullWidth:!0,sx:{mt:2},children:[e.jsx(Pi,{size:"small",sx:{fontSize:"14px"},children:m("profile.setStatus")}),e.jsx(Be,{value:h,label:m("profile.setStatus"),onChange:c=>{u(c.target.value),o(!0)},variant:"outlined",IconComponent:c=>e.jsx(di,{...c,width:20,height:20}),sx:Vi,children:t.map(c=>e.jsx(ze,{value:c.id,children:e.jsxs(k.Suspense,{fallback:null,children:[c.icon&&e.jsx(Ai,{style:{minWidth:"24px"},children:k.createElement(c.icon,{style:{fontSize:"16px",width:"16px",height:"16px"}})}),c.name]})},c.id))})]}),h?e.jsxs(li,{fullWidth:!0,sx:{mt:"24px"},children:[e.jsx(Pi,{size:"small",sx:{fontSize:"14px"},children:m("profile.removeStatusAfter")}),e.jsx(Be,{value:f,label:m("profile.removeStatusAfter"),onChange:c=>{const{value:T}=c.target;C(T),T===V.Custom&&d(Z().toDate()),o(!0)},variant:"outlined",IconComponent:c=>e.jsx(di,{...c,width:20,height:20}),sx:Vi,children:y?.children?.map(c=>e.jsx(ze,{value:c.id,children:c.name},c.id))})]}):e.jsxs(g,{sx:{mt:"24px"},children:[e.jsx(R,{variant:"body2",sx:{color:"text.secondary"},children:m("profile.quickSettings")}),t.map(c=>e.jsx(g,{onClick:()=>b(c),sx:{display:"flex",alignItems:"center",gap:"4px",p:"4px",cursor:"pointer",borderRadius:"8px","&:hover":{bgcolor:"action.hover"}},children:e.jsxs(k.Suspense,{fallback:null,children:[c.icon&&e.jsx(Ai,{style:{minWidth:"24px"},children:k.createElement(c.icon,{style:{fontSize:"16px",width:"16px",height:"16px"}})}),c.name,c.durationName&&e.jsxs(R,{variant:"body2",sx:{color:"text.secondary"},children:["- ",c.durationName]})]})},c.id))]}),f===V.Custom&&e.jsx(g,{sx:{mt:"24px"},children:e.jsx(Zt,{value:r,onChange:c=>{d(c),o(!0)},label:m("profile.selectEndTime"),timezone:w,error:f===V.Custom&&!r,helperText:f===V.Custom&&!r?m("profile.pleaseSelectTime"):void 0})})]}),e.jsx(Ao,{sx:{p:"16px 24px",borderTop:"1px solid",borderColor:"divider"},children:s?.value&&!n?e.jsx(ue,{sx:{...Zi,minWidth:"54px"},size:"small",variant:"outlined",onClick:()=>v(!0),children:m("profile.cleanStatus")}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{size:"small",variant:"outlined",sx:{...Zi,minWidth:"54px"},onClick:a,children:m("common.cancel")}),e.jsx(ue,{sx:{...Ft,minWidth:"54px","&.Mui-disabled":{backgroundColor:"rgba(0, 0, 0, 0.12)"}},disabled:!l,onClick:()=>v(!1),size:"small",variant:"outlined",children:m("common.confirm")})]})})]})}const Gt=k.lazy(()=>Se(()=>import("./Meeting-QV3KsWwx.js"),[],import.meta.url)),Yt=k.lazy(()=>Se(()=>import("./Community-BiwM1i9F.js"),[],import.meta.url)),Qt=k.lazy(()=>Se(()=>import("./Holiday-BfArn73w.js"),[],import.meta.url)),Kt=k.lazy(()=>Se(()=>import("./OffSick-DP4yfBRj.js"),[],import.meta.url)),Xt=k.lazy(()=>Se(()=>import("./WorkingRemotely-DTxVm_VO.js"),[],import.meta.url)),Gi={[K.Meeting]:Gt,[K.Community]:Yt,[K.Holiday]:Qt,[K.OffSick]:Kt,[K.WorkingRemotely]:Xt},Jt={[K.Meeting]:{duration:V.OneHour,durationName:"userStatus.duration.OneHour"},[K.Community]:{duration:V.ThirtyMinutes,durationName:"userStatus.duration.ThirtyMinutes"},[K.Holiday]:{duration:V.ThisWeek,durationName:"userStatus.duration.ThisWeek"},[K.OffSick]:{duration:V.Today,durationName:"userStatus.duration.Today"},[K.WorkingRemotely]:{duration:V.ThisWeek,durationName:"userStatus.duration.ThisWeek"}};function es({isMobile:i=void 0,size:a,isMyself:t,status:s,onChange:x,timezone:w=void 0}){const{locale:p}=H(),m=A((j,O={})=>Y(Q,j,p,"en",O)),[h,u]=k.useState(void 0),f=A(()=>{u(void 0)});k.useEffect(()=>{u(1e3)},[s]);const C=Ho(()=>{if(s?.value&&s?.dateRange?.length===2){if(Hi(s))return;if(!$t(s.dateRange))f(),x(void 0);else{const j=Ut(s.dateRange[1]);j>0?u(j):(f(),x(void 0))}}else f()},h);Zo(()=>{C()});const[r,d]=k.useState(null),n=k.useCallback(()=>Object.keys(V).map(j=>({id:V[j],name:m(`userStatus.duration.${j}`)})),[m]),o=M(()=>{const j=n();return Object.keys(K).map(O=>{const D=Jt[K[O]];return{id:K[O],name:m(`userStatus.${O}`),icon:Gi[K[O]],...D?{duration:D.duration,durationName:m(D.durationName)}:{},children:j}})},[m,n,p]),l=j=>{t&&d(j.currentTarget)},y=()=>{d(null)},b=j=>{t&&(x(j),y())},v=Gi[s?.value],c=k.useMemo(()=>{const j=o.find(O=>O.id===s?.value);if(j){const O=p==="zh"?"zh-cn":"en-us";let D;return Hi(s)||(D=s?.dateRange?.map(J=>ot(J,{locale:O}))),D&&D.length>0?`${j.name}: ${D.join("~")}`:j.name}return null},[s,o,p]),T=!!r;return e.jsxs(is,{size:a,isMobile:i,children:[e.jsx(ke,{title:c,children:e.jsx(g,{className:"status-icon",onClick:l,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:v?e.jsx(k.Suspense,{fallback:null,children:e.jsx(v,{style:{width:16,height:16}})}):e.jsx(Io,{color:"success",variant:"dot"})})}),T&&e.jsx(Vt,{selected:s,data:o,open:T,onSelect:b,onClose:y,timezone:w})]})}const is=Ge("div")`
|
|
2
|
+
import{j as e,V as no,z as li,A as ao,F as So,Z as To,b1 as Co,T as R,I as oe,ak as Po,a0 as Ao,y as Pi,bN as Be,M as ze,aM as Ai,al as g,S as Io,R as ue,an as ke,bM as qo,aT as Ge,bZ as Mo,a4 as lo,bS as Do,b_ as zo,a8 as Lo,G as Ro,a7 as Re,C as _o,b4 as No,b3 as mi,L as Eo,bJ as Oo,bK as ii,bL as oi,at as $o,bb as Uo,bW as Fo,bU as Wo,as as Ii,n as qi,bV as Bo}from"./vendor-mui-core-CV-FnYH_.js";import{r as k,g as Ho}from"./vendor-react-DX7tU9aY.js";import{d as Z,a as M,b as A,n as Zo,x as Vo,i as me,r as Le,j as Go,p as Yo}from"./vendor-hooks-DAZ1H6Va.js";import{aq as Qo,ar as Ko,k as co,as as Xo,i as he,am as Ye,at as Jo,$ as _e,c as uo,aj as et,U as it,H as Mi}from"./index-CXp5SI_f.js";import{a2 as Di,I as ot,B as tt,Y as G,bl as st,W as H,P as Y,a0 as rt,_ as Se,a6 as po,bm as He,Z as Qe,Q as X,U as hi,bf as nt,aQ as pe,ae as at,bh as lt,bi as zi,b5 as fi,N as ct,a1 as ci,aR as dt,bn as ut,ar as B,a4 as pt,a5 as mt,af as mo,bj as ti,bk as ht,T as ft,bg as xt,X as gt,bo as Ne,l as ho,bc as bt}from"./vendor-ux-CLT2i3Pv.js";import{k as wt}from"./fallback-D-IHOW-7.js";import{z as ee,a2 as Ze,n as ae,ab as vt,v as yt,a4 as Li,x as jt,D as kt,a8 as St,C as Tt,a7 as Ri,F as _i}from"./vendor-utils-BzQg432x.js";import{_ as Ct}from"./index-D3BuekEe.js";import{N as Ni}from"./index-VKjWmvRV.js";import{t as di}from"./arrow-down.svg-Dz9H9vM-.js";import{L as Pt,a as $e,N as At}from"./wallet-hidden-topbar-joIVZ1nl.js";import{a as It}from"./revoke.svg-BF_gJc34.js";import{N as xi,U as fo}from"./index-8RHrVCC6.js";import{u as xo}from"./index-C_kNXHsF.js";import{u as gi}from"./use-mobile-CyUZDIaX.js";import{U as Ei}from"./actions-BlWED76c.js";import{x as qt,d as Mt}from"./info-outline-rounded-DlgANjBB.js";import{d as Dt,a as zt}from"./google-icon-vNOJy67F.js";import{o as Lt}from"./vendor-arcblock-Dll6qxMT.js";import{D as Rt,a as Ve,b as _t,S as Nt}from"./index-2M4w6J9r.js";import"./index-BojVbZw0.js";const Q={zh:{settings:"设置",noPassport:"暂无通行证",passport:"通行证",notification:"通知",email:"邮箱地址",phone:"电话号码",lastLogin:"上次登录",lastLoginAt:"上次登录时间",lastLoginIp:"上次登录地址",createdAt:"加入时间",registerFrom:"注册来源",invitedBy:"邀请人",unknown:"未知",walletNotification:"钱包通知",emailNotification:"邮件通知",phoneNotification:"短信通知",pushNotification:"推送消息(由 Push Kit 提供)",addWebhook:"新增外部通知",saveSuccess:"保存成功",saveFailed:"保存失败",webhookTested:"测试消息已经发送",done:"完成",emptyField:"未填写",emptyContent:"暂无内容",underProtected:"用户已设置隐私保护",followersOnly:"用户已设置仅粉丝可见,关注用户后可查看",noUserFound:"未找到指定的用户",notificationManagement:"通知管理",privacyManagement:"隐私管理",storageManagement:"DID Spaces",userFollowers:"关注 & 粉丝",webhook:{url:"自定义URL",slack:"Slack"},common:{confirm:"确认",cancel:"取消",required:"必填的",invalid:"无效",setting:"设置",save:"保存",profile:"信息",nft:"NFTs",noNFT:"暂无 NFT"},toPublic:"公开 “{name}” 页面",currentPassport:"当前使用的通行证",refreshProfile:{title:"刷新个人信息",successfully:"刷新个人信息成功"},switchProfile:"切换",userInfo:"个人信息",myInfo:"我的信息",hisInfo:"TA 的信息",loginNow:"立即登录",viewAfterLogin:"登录后才可以查看",sessionManagement:"会话管理",storage:{spaces:{tips:"提示",label:"请输入 DID Spaces 服务地址",connectedWithName:"你已成功连接至 {name}",gateway:{delete:{failed:"删除 DID Spaces 失败"}},provideNFT:{title:"请为 {appName} 出示 DID Spaces NFT",scan:"使用你的 DID Wallet 为应用 {appName} 出示 DID Spaces NFT",success:"连接成功"},connect:{useWallet:"使用 DID Wallet 连接",useWalletReconnect:"使用 DID Wallet 重新连接",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"}}},thirdPartyLogin:{title:"已连接的账户",connect:"绑定",disconnect:"解绑",mainProviderCantRemove:"主账号不允许解绑",confirmUnbind:"确定要解绑 {name} 吗?",confirmUnbindDescription:"解绑后您将无法使用 {name} 登录至该账户。如果解绑后,您仍使用 {name} 登录,会自动创建一个新账户",disconnectPasskey:"确定要移除 Passkey 吗?",disconnectPasskeyDescription:"移除后您将无法使用此 Passkey 登录。如果移除后,您仍使用此 Passkey 登录,会自动创建一个新账户"},commonSetting:{title:"通用设置",locale:"偏好语言"},dangerZone:{title:"危险操作",deleteAccount:"删除账户",deleteAccountDescription:"删除账户后,您将无法使用该账户登录,您的数据将从平台中完全删除,不可恢复。",delete:"删除"},userStatus:{Online:"在线",Meeting:"开会中",Community:"通勤中",Holiday:"休假",OffSick:"病假",WorkingRemotely:"远程工作",duration:{NoClear:"不要清除",ThirtyMinutes:"30分钟",OneHour:"1小时",FourHours:"4小时",Today:"今天",ThisWeek:"本周",Custom:"自定义时间"}},profile:{addLink:"添加连接",location:"位置",timezone:"时区",bio:"个人简介",setStatus:"设置状态",localTime:"当地时间:",email:"邮箱地址",emailInvalid:"邮箱格式不正确",emailSourceProviderNotAllowEdit:"使用邮箱注册的用户不允许修改邮箱",phone:"电话号码",phoneInvalid:"电话号码格式不正确",editProfile:"编辑资料",removeStatusAfter:"在...之后移除状态",justForYou:"仅对您可见",cleanStatus:"清除状态",quickSettings:"快捷设置",selectEndTime:"选择结束时间",pleaseSelectTime:"请选择时间",invalidURL:"无效的 URL",duplicateURL:"URL 已存在",socialMedia:"社交链接",timezonePhase:{dawn:"凌晨",morning:"上午",afternoon:"下午",night:"晚上"},address:{title:"地址",country:"国家/地区",province:"州/省",city:"城市/镇",line1:"地址",line2:"地址2",detailedAddress:"详细地址",postalCode:"邮政编码",invalidPostalCode:"邮政编码格式不正确"},maxLinkCount:"最多可添加 {count} 个社交链接",chat:"聊天",follow:"关注",unfollow:"取消关注",follow_success:"关注成功",unfollow_success:"取消关注成功"},destroyMyself:{title:"删除账户",scan:"删除账户后,您将无法使用该账户登录,您的数据将从平台中完全删除,不可恢复。",confirm:"确认删除",cancel:"取消",success:"删除账户成功",abort:"取消删除账户",error:"删除账户失败"},notImplemented:"操作未实现",userCenter:{title:"用户中心"},userNotFound:"用户不存在",userNotFoundDescription:"该账户已被管理员停用或移除。"},en:{settings:"Settings",noPassport:"No passport yet",passport:"Passports",notification:"Notification",email:"Email",phone:"Phone",lastLogin:"Last Login & IP",lastLoginAt:"Last Login",lastLoginIp:"Last IP",createdAt:"Member Since",registerFrom:"Register From",invitedBy:"Invited By",unknown:"Unknown",walletNotification:"DID Wallet notification",emailNotification:"Email notification",phoneNotification:"SMS notification",pushNotification:"Push notification (powered by Push Kit)",addWebhook:"Add external notification",saveSuccess:"Save succeed",saveFailed:"Save failed",webhookTested:"Test message sent",done:"Done",emptyField:"None",notificationManagement:"Notifications",privacyManagement:"Privacy",storageManagement:"DID Spaces",userFollowers:"Following & Followers",emptyContent:"Empty",underProtected:"This page has protected privacy",followersOnly:"This page is only visible to followers, follow the user to view",noUserFound:"No user found",webhook:{url:"Custom url",slack:"Slack"},common:{confirm:"Confirm",cancel:"Cancel",required:"Required",invalid:"Invalid",setting:"Settings",save:"Save",profile:"Profile",nft:"NFTs",noNFT:"No NFT"},toPublic:'Public "{name}" page',currentPassport:"Passport currently in use",refreshProfile:{title:"Refresh profile",successfully:"Refresh profile successfully"},switchProfile:"Switch",userInfo:"User Info",myInfo:"My Info",hisInfo:"His/Her Info",loginNow:"Login",viewAfterLogin:"View after login",sessionManagement:"Session Management",storage:{spaces:{tips:"Tips",label:"Enter DID Spaces Gateway",connectedWithName:"You have successfully connected to {name}",gateway:{delete:{failed:"Delete gateway failed"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to allow the app {appName} show DID space NFT",success:"Connected successfully"},connect:{useWallet:"Connect with DID Wallet",useWalletReconnect:"Reconnect with DID Wallet",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"}}},thirdPartyLogin:{title:"Connected Accounts",connect:"Connect",disconnect:"Disconnect",mainProviderCantRemove:"Main account not allowed to remove",confirmUnbind:"Are you sure to unbind {name}?",confirmUnbindDescription:"You will not be able to log in to this account using {name} after unbundling. If you are still logged in with {name} after unbundling, a new account will be created automatically!",disconnectPasskey:"Are you sure to remove {name}?",disconnectPasskeyDescription:"You will not be able to log in with this passkey upon removing. If you are still logged in with this passkey after removing, a new account will be created automatically!"},commonSetting:{title:"Common Settings",locale:"Preferred language"},dangerZone:{title:"Danger Zone",deleteAccount:"Delete Account",deleteAccountDescription:"Delete account will make you unable to login with this account, your data will be completely deleted from the platform and cannot be recovered.",delete:"Delete"},userStatus:{Online:"Online",Meeting:"In a Meeting",Community:"Commuting",Holiday:"On Holiday",OffSick:"Off Sick",WorkingRemotely:"Working Remotely",duration:{NoClear:"Don't clear",ThirtyMinutes:"30 minutes",OneHour:"1 hour",FourHours:"4 hours",Today:"Today",ThisWeek:"This Week",Custom:"Custom"}},profile:{addLink:"Add link",location:"Location",timezone:"Timezone",bio:"Bio",setStatus:"Set a Status",localTime:"Local Time: ",email:"Email",emailInvalid:"Email is invalid",emailSourceProviderNotAllowEdit:"Email registered users are not allowed to edit email",phone:"Phone",phoneInvalid:"Phone number is invalid",editProfile:"Edit Profile",removeStatusAfter:"Remove status after...",justForYou:"Visible to you only",maxInputLength:"Max input length is",selectEndTime:"Select end time",pleaseSelectTime:"Please select time",cleanStatus:"Clean status",quickSettings:"Quick Settings",invalidURL:"Invalid URL",duplicateURL:"URL already exists",socialMedia:"Social Media",timezonePhase:{dawn:"AM",morning:"AM",afternoon:"PM",night:"PM"},address:{title:"Address",country:"Country/Region",province:"State/Province",city:"City/Town",line1:"Address",line2:"Address 2",detailedAddress:"Detailed Address",postalCode:"Postal Code",invalidPostalCode:"Postal code is invalid"},maxLinkCount:"Up to {count} social links can be added",chat:"Chat",follow:"Follow",unfollow:"Unfollow",follow_success:"Follow successfully",unfollow_success:"Unfollow successfully"},destroyMyself:{title:"Delete Account",scan:"Delete account will make you unable to login with this account, your data will be completely deleted from the platform and cannot be recovered.",confirm:"Confirm delete",cancel:"Cancel",success:"Delete account successfully",abort:"Delete account aborted",error:"Delete account failed"},notImplemented:"This action is not implemented",userCenter:{title:"User Center"},userNotFound:"User not found",userNotFoundDescription:"The account has been deactivated or removed by the administrator."}},le=i=>{const{response:a}=i;return a?`Request failed: ${a.status} ${a.statusText}: ${JSON.stringify(a.data)}`:i.message},Et=i=>i.scope==="kyc"?Qo({...i,issuerAvatarUrl:ee(window.location.origin,Di,"/blocklet/logo"),type:i.role}):Ko({...i,issuerAvatarUrl:ee(window.location.origin,Di,"/blocklet/logo")});var V=(i=>(i.NoClear="no_clear",i.ThirtyMinutes="30_minutes",i.OneHour="1_hour",i.FourHours="4_hours",i.Today="today",i.ThisWeek="this_week",i.Custom="custom",i))(V||{}),K=(i=>(i.Meeting="meeting",i.Community="community",i.Holiday="holiday",i.OffSick="off_sick",i.WorkingRemotely="working_remotely",i))(K||{});Z.extend(ot);Z.extend(tt);const Oi=3600,$i=1800,Ui=600,Fi=300,Wi=60,Bi=1,Ot=Z.tz.guess(),Hi=["America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Asia/Tokyo","Asia/Shanghai","Asia/Hong_Kong","Asia/Singapore","Asia/Seoul","Asia/Kolkata","Australia/Sydney","Australia/Melbourne","Pacific/Auckland","America/Sao_Paulo","America/Mexico_City","Africa/Cairo","UTC"],$t=()=>{if(typeof Intl<"u"&&Intl.supportedValuesOf)try{return Intl.supportedValuesOf("timeZone")}catch{console.warn("Intl.supportedValuesOf not supported, falling back to common timezones")}if(typeof Intl<"u"&&Intl.DateTimeFormat)try{if(new Intl.DateTimeFormat("en",{timeZone:"UTC"}).resolvedOptions().timeZone)return Hi}catch{console.warn("Intl.DateTimeFormat timezone support limited")}return Hi},Pr=()=>$t().map(i=>{try{const a=Z.tz(Z(),i).utcOffset()/60,t=Math.floor(a),s=a%1*60;return{label:`GMT${t>=0?"+":""}${t}:${s===30?"30":"00"}`,value:i}}catch{return console.warn(`Timezone ${i} not supported, skipping`),null}}).filter(i=>i!==null).sort((i,a)=>{const[t,s]=i.label.replace("GMT","").split(":").map(Number),[x,w]=a.label.replace("GMT","").split(":").map(Number),p=t*60+s;return x*60+w-p}).map(i=>({label:`(${i.label}) ${i.value}`,value:i.value})),ui=i=>co(Ze(i)),Ut=(i,a)=>{if(!i||!a||!ui(i)||!ui(a))return!1;const t=Ze(i.trim()),s=Ze(a.trim());return t.toLowerCase()===s.toLowerCase()},Ft=i=>{let a=i?.dateRange?.map(s=>Z(s))??[];const t=Z();switch(i?.duration){case V.ThirtyMinutes:a=[t,t.add(30,"minutes")];break;case V.OneHour:a=[t,t.add(1,"hour")];break;case V.FourHours:a=[t,t.add(4,"hours")];break;case V.Today:a=[t,t.endOf("day")];break;case V.ThisWeek:a=[t,t.endOf("week")];break;case V.NoClear:a=[t,t];break}return a.map(s=>s.toDate())},Wt=i=>{const a=Z();return a.isAfter(Z(i[0]))&&a.isBefore(Z(i[1]))},Zi=i=>{const{duration:a,dateRange:t}=i??{};return!a||!t?!1:a===V.NoClear||Z(t?.[0]).isSame(Z(t?.[1]))},Bt=i=>{const a=Z(),t=Z(i).diff(a,"seconds"),s=x=>x*1e3;return t>=Oi?s(Oi):t>=$i?s($i):t>=Ui?s(Ui):t>=Fi?s(Fi):t>=Wi?s(Wi):t>=Bi?s(Bi):0},Vi={color:"text.primary",borderColor:"grey.100",backgroundColor:"background.default","&:hover":{borderColor:"grey.100",backgroundColor:"action.hover"},py:.5,borderRadius:1},Ht={color:"primary.contrastText",borderColor:"primary.main",backgroundColor:"primary.main","&:hover":{borderColor:"primary.main",backgroundColor:"primary.main"},py:.5,borderRadius:1},Zt={x:{domains:["twitter.com","x.com"]},facebook:{domains:["facebook.com","fb.com"],options:{skipDarkInvert:!0}},"linkedin-icon":{domains:["linkedin.com"],options:{skipDarkInvert:!0}},"github-icon":{domains:["github.com"]},"instagram-icon":{domains:["instagram.com"]},"youtube-icon":{domains:["youtube.com","youtu.be"],options:{skipDarkInvert:!0}},"tiktok-icon":{domains:["tiktok.com"]},"reddit-icon":{domains:["reddit.com"],options:{skipDarkInvert:!0}},"medium-icon":{domains:["medium.com"]},"discord-icon":{domains:["discord.com","discord.gg"],options:{skipDarkInvert:!0}},telegram:{domains:["telegram.org","t.me"],options:{skipDarkInvert:!0}},"whatsapp-monochrome-icon":{domains:["whatsapp.com"]},producthunt:{domains:["producthunt.com"],options:{skipDarkInvert:!0}},ycombinator:{domains:["ycombinator.com","news.ycombinator.com"],options:{skipDarkInvert:!0}}},Ar=i=>{try{const a=Ze(i),t=new URL(a).hostname.toLowerCase().replace(/^www\./,"");for(const[s,{domains:x,options:w}]of Object.entries(Zt))if(x.some(p=>t===p||t.endsWith(`.${p}`)))return{icon:`logos:${s}`,options:w};return}catch{return}};function Vt({user:i,switchPassport:a}){const t=M(()=>(i?.passports||[])?.find(s=>s.name===i.role||s.role===i.role),[i?.passports,i?.role]);return e.jsx(no,{label:t?.title||i?.role||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.100",backgroundColor:"transparent",textTransform:"capitalize",pr:1,pl:.5,"&:active":{boxShadow:"none"}},clickable:!0,deleteIcon:e.jsx(G,{icon:st,color:"inherit"}),onDelete:a,onClick:a})}const Gt=k.memo(Vt);function Yt({value:i,onChange:a,error:t=void 0,helperText:s=void 0,label:x=void 0,timezone:w=void 0}){const p=k.useRef(null),m=Z().format("YYYY-MM-DDTHH:mm"),h=M(()=>{let u=Z();return i&&(u=w?Z(i).tz(w):Z(i)),u.format("YYYY-MM-DD HH:mm")},[i,w]);return e.jsxs(li,{fullWidth:!0,error:t,children:[e.jsx(ao,{inputRef:p,type:"datetime-local",value:h,onChange:u=>{a(new Date(u.target.value))},label:x,error:t,onClick:()=>{p.current?.showPicker()},sx:{"& .MuiInputBase-root":{cursor:"pointer"},"& .MuiOutlinedInput-notchedOutline":{cursor:"pointer"}},slotProps:{htmlInput:{min:m,style:{cursor:"pointer"}},inputLabel:{shrink:!0}}}),s&&e.jsx(So,{children:s})]})}const Gi={padding:"8px 16px",borderRadius:"8px","&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderRadius:"8px"},".MuiSelect-select":{padding:"0 !important",display:"flex",alignItems:"center"}};function Qt({open:i,onClose:a,data:t,selected:s,onSelect:x,timezone:w=void 0}){const{locale:p}=H(),m=A((c,T={})=>Y(Q,c,p,"en",T)),[h,u]=k.useState(s?.value||""),[f,C]=k.useState(s?.duration||""),[r,d]=k.useState(s?.dateRange?.[1]||""),[n,o]=k.useState(!1);k.useEffect(()=>{u(s?.value||""),C(s?.duration||""),d(s?.dateRange?.[1]||"")},[s]);const l=k.useMemo(()=>h&&f,[h,f]),y=t.find(c=>c.id===h),b=c=>{x({value:c.id,...c.duration?{duration:c.duration}:{}}),a()},v=(c=!1)=>{if(c)x(void 0);else{const T=Z();x({value:h,...f?{duration:f}:{},...f===V.Custom&&r?{dateRange:[T.toDate(),Z(r).toDate()]}:{}})}a()};return e.jsxs(To,{open:i,onClose:a,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{borderRadius:"8px"}},children:[e.jsxs(Co,{sx:{borderBottom:"1px solid",borderColor:"divider"},children:[e.jsx(R,{variant:"body1",sx:{fontSize:"16px !important",mb:0},children:m("profile.setStatus")}),e.jsx(oe,{"aria-label":"close",onClick:a,sx:{position:"absolute",right:8,top:8,color:c=>c.palette.grey[500]},children:e.jsx(Po,{})})]}),e.jsxs(Ao,{children:[e.jsxs(li,{fullWidth:!0,sx:{mt:2},children:[e.jsx(Pi,{size:"small",sx:{fontSize:"14px"},children:m("profile.setStatus")}),e.jsx(Be,{value:h,label:m("profile.setStatus"),onChange:c=>{u(c.target.value),o(!0)},variant:"outlined",IconComponent:c=>e.jsx(di,{...c,width:20,height:20}),sx:Gi,children:t.map(c=>e.jsx(ze,{value:c.id,children:e.jsxs(k.Suspense,{fallback:null,children:[c.icon&&e.jsx(Ai,{style:{minWidth:"24px"},children:k.createElement(c.icon,{style:{fontSize:"16px",width:"16px",height:"16px"}})}),c.name]})},c.id))})]}),h?e.jsxs(li,{fullWidth:!0,sx:{mt:"24px"},children:[e.jsx(Pi,{size:"small",sx:{fontSize:"14px"},children:m("profile.removeStatusAfter")}),e.jsx(Be,{value:f,label:m("profile.removeStatusAfter"),onChange:c=>{const{value:T}=c.target;C(T),T===V.Custom&&d(Z().toDate()),o(!0)},variant:"outlined",IconComponent:c=>e.jsx(di,{...c,width:20,height:20}),sx:Gi,children:y?.children?.map(c=>e.jsx(ze,{value:c.id,children:c.name},c.id))})]}):e.jsxs(g,{sx:{mt:"24px"},children:[e.jsx(R,{variant:"body2",sx:{color:"text.secondary"},children:m("profile.quickSettings")}),t.map(c=>e.jsx(g,{onClick:()=>b(c),sx:{display:"flex",alignItems:"center",gap:"4px",p:"4px",cursor:"pointer",borderRadius:"8px","&:hover":{bgcolor:"action.hover"}},children:e.jsxs(k.Suspense,{fallback:null,children:[c.icon&&e.jsx(Ai,{style:{minWidth:"24px"},children:k.createElement(c.icon,{style:{fontSize:"16px",width:"16px",height:"16px"}})}),c.name,c.durationName&&e.jsxs(R,{variant:"body2",sx:{color:"text.secondary"},children:["- ",c.durationName]})]})},c.id))]}),f===V.Custom&&e.jsx(g,{sx:{mt:"24px"},children:e.jsx(Yt,{value:r,onChange:c=>{d(c),o(!0)},label:m("profile.selectEndTime"),timezone:w,error:f===V.Custom&&!r,helperText:f===V.Custom&&!r?m("profile.pleaseSelectTime"):void 0})})]}),e.jsx(Io,{sx:{p:"16px 24px",borderTop:"1px solid",borderColor:"divider"},children:s?.value&&!n?e.jsx(ue,{sx:{...Vi,minWidth:"54px"},size:"small",variant:"outlined",onClick:()=>v(!0),children:m("profile.cleanStatus")}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{size:"small",variant:"outlined",sx:{...Vi,minWidth:"54px"},onClick:a,children:m("common.cancel")}),e.jsx(ue,{sx:{...Ht,minWidth:"54px","&.Mui-disabled":{backgroundColor:"rgba(0, 0, 0, 0.12)"}},disabled:!l,onClick:()=>v(!1),size:"small",variant:"outlined",children:m("common.confirm")})]})})]})}const Kt=k.lazy(()=>Se(()=>import("./Meeting-QV3KsWwx.js"),[],import.meta.url)),Xt=k.lazy(()=>Se(()=>import("./Community-BiwM1i9F.js"),[],import.meta.url)),Jt=k.lazy(()=>Se(()=>import("./Holiday-BfArn73w.js"),[],import.meta.url)),es=k.lazy(()=>Se(()=>import("./OffSick-DP4yfBRj.js"),[],import.meta.url)),is=k.lazy(()=>Se(()=>import("./WorkingRemotely-DTxVm_VO.js"),[],import.meta.url)),Yi={[K.Meeting]:Kt,[K.Community]:Xt,[K.Holiday]:Jt,[K.OffSick]:es,[K.WorkingRemotely]:is},os={[K.Meeting]:{duration:V.OneHour,durationName:"userStatus.duration.OneHour"},[K.Community]:{duration:V.ThirtyMinutes,durationName:"userStatus.duration.ThirtyMinutes"},[K.Holiday]:{duration:V.ThisWeek,durationName:"userStatus.duration.ThisWeek"},[K.OffSick]:{duration:V.Today,durationName:"userStatus.duration.Today"},[K.WorkingRemotely]:{duration:V.ThisWeek,durationName:"userStatus.duration.ThisWeek"}};function ts({isMobile:i=void 0,size:a,isMyself:t,status:s,onChange:x,timezone:w=void 0}){const{locale:p}=H(),m=A((j,O={})=>Y(Q,j,p,"en",O)),[h,u]=k.useState(void 0),f=A(()=>{u(void 0)});k.useEffect(()=>{u(1e3)},[s]);const C=Zo(()=>{if(s?.value&&s?.dateRange?.length===2){if(Zi(s))return;if(!Wt(s.dateRange))f(),x(void 0);else{const j=Bt(s.dateRange[1]);j>0?u(j):(f(),x(void 0))}}else f()},h);Vo(()=>{C()});const[r,d]=k.useState(null),n=k.useCallback(()=>Object.keys(V).map(j=>({id:V[j],name:m(`userStatus.duration.${j}`)})),[m]),o=M(()=>{const j=n();return Object.keys(K).map(O=>{const D=os[K[O]];return{id:K[O],name:m(`userStatus.${O}`),icon:Yi[K[O]],...D?{duration:D.duration,durationName:m(D.durationName)}:{},children:j}})},[m,n,p]),l=j=>{t&&d(j.currentTarget)},y=()=>{d(null)},b=j=>{t&&(x(j),y())},v=Yi[s?.value],c=k.useMemo(()=>{const j=o.find(O=>O.id===s?.value);if(j){const O=p==="zh"?"zh-cn":"en-us";let D;return Zi(s)||(D=s?.dateRange?.map(J=>rt(J,{locale:O}))),D&&D.length>0?`${j.name}: ${D.join("~")}`:j.name}return null},[s,o,p]),T=!!r;return e.jsxs(ss,{size:a,isMobile:i,children:[e.jsx(ke,{title:c,children:e.jsx(g,{className:"status-icon",onClick:l,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:v?e.jsx(k.Suspense,{fallback:null,children:e.jsx(v,{style:{width:16,height:16}})}):e.jsx(qo,{color:"success",variant:"dot"})})}),T&&e.jsx(Qt,{selected:s,data:o,open:T,onSelect:b,onClose:y,timezone:w})]})}const ss=Ge("div")`
|
|
3
3
|
position: absolute;
|
|
4
4
|
left: ${({size:i})=>`${i*3/4}px`};
|
|
5
5
|
top: ${({size:i})=>`${i*.65}px`};
|
|
@@ -21,10 +21,10 @@ import{j as e,V as ro,z as li,A as no,F as ko,Z as So,b1 as To,T as R,I as ie,ak
|
|
|
21
21
|
border-radius: ${({isMobile:i})=>i?"8px":"13px"};
|
|
22
22
|
background-color: #eff1f5;
|
|
23
23
|
}
|
|
24
|
-
`,os={width:24,height:24,body:'<path fill="currentColor" d="M13 11.6V8q0-.425-.288-.713T12 7q-.425 0-.713.288T11 8v3.975q0 .2.075.388t.225.337l3.3 3.3q.275.275.7.275T16 16q.275-.275.275-.7T16 14.6l-3-3ZM12 22q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22Zm0-10Zm0 8q3.325 0 5.663-2.337T20 12q0-3.325-2.337-5.663T12 4Q8.675 4 6.337 6.337T4 12q0 3.325 2.337 5.663T12 20Z"/>'},ts={width:24,height:24,body:'<path fill="currentColor" d="m12 11.6l2.5 2.5q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275l-2.8-2.8q-.15-.15-.225-.337T10 11.975V8q0-.425.288-.713T11 7q.425 0 .713.288T12 8v3.6ZM18 6h-2q-.425 0-.713-.287T15 5q0-.425.288-.713T16 4h2V2q0-.425.288-.713T19 1q.425 0 .713.288T20 2v2h2q.425 0 .713.288T23 5q0 .425-.288.713T22 6h-2v2q0 .425-.288.713T19 9q-.425 0-.713-.288T18 8V6Zm-7 15q-1.875 0-3.513-.7t-2.862-1.925Q3.4 17.15 2.7 15.512T2 12q0-1.875.7-3.513t1.925-2.862Q5.85 4.4 7.488 3.7T11 3q.275 0 .513.013t.512.062q.425 0 .713.288t.287.712q0 .425-.288.713t-.712.287q-.275 0-.513-.038T11 5Q8.05 5 6.025 7.025T4 12q0 2.95 2.025 4.975T11 19q2.95 0 4.975-2.025T18 12q0-.425.288-.713T19 11q.425 0 .713.288T20 12q0 1.875-.7 3.513t-1.925 2.862Q16.15 19.6 14.512 20.3T11 21Z"/>'},Yi={width:24,height:24,body:'<path fill="currentColor" d="M9.4 19.55q-.45-.825-.788-1.713T8.05 16H5.1q.725 1.25 1.813 2.175T9.4 19.55ZM4.25 14h3.4q-.075-.5-.113-.988T7.5 12q0-.525.038-1.012T7.65 10h-3.4q-.125.5-.188.988T4 12q0 .525.063 1.012T4.25 14Zm.85-6h2.95q.225-.95.563-1.838T9.4 4.45Q8 4.9 6.912 5.825T5.1 8Zm5 0h3.8q-.3-1.1-.775-2.075T12 4.05q-.65.9-1.125 1.875T10.1 8Zm5.85 0h2.95q-.725-1.25-1.813-2.175T14.6 4.45q.45.825.788 1.713T15.95 8ZM12 22q-2.05 0-3.875-.788t-3.188-2.15q-1.362-1.362-2.15-3.187T2 12q0-2.075.788-3.888t2.15-3.174Q6.3 3.575 8.124 2.788T12 2q2.075 0 3.888.788t3.174 2.15q1.363 1.362 2.15 3.175T22 12q0 .25-.013.5t-.037.5h-2.025q.05-.25.063-.488T20 12q0-.525-.063-1.012T19.75 10h-3.4q.075.5.113.988T16.5 12v.513q0 .237-.025.487h-2q.025-.25.025-.488V12q0-.525-.038-1.012T14.35 10h-4.7q-.075.5-.113.988T9.5 12q0 .525.038 1.012T9.65 14H13v2h-2.9q.3 1.1.775 2.075T12 19.95q.275-.4.525-.813T13 18.3v3.65q-.25.025-.487.038T12 22Zm5-3.575v1.225q0 .425-.288.713T16 20.65q-.425 0-.713-.287T15 19.65V16q0-.425.288-.713T16 15h3.65q.425 0 .713.288t.287.712q0 .425-.287.713T19.65 17H18.4l2.25 2.25q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L17 18.425Z"/>'},ss={width:24,height:24,body:'<path fill="currentColor" d="M2 12q-.425 0-.725-.263t-.25-.637q.175-2.125 1.1-3.975t2.4-3.212Q6 2.55 7.925 1.775T12 1q2.15 0 4.075.775t3.4 2.138q1.475 1.362 2.4 3.212t1.1 3.975q.05.375-.25.638T22 12q-.4 0-.7-.25t-.35-.65q-.35-3.45-2.9-5.775T12 3Q8.5 3 5.95 5.325T3.05 11.1q-.05.4-.35.65T2 12Zm4 0q-.425 0-.713-.275t-.237-.65q.35-2.6 2.313-4.338T12 5q2.675 0 4.638 1.738t2.312 4.337q.05.375-.238.65T18 12q-.4 0-.713-.213t-.362-.587q-.3-1.8-1.675-3T12 7q-1.875 0-3.25 1.2t-1.675 3q-.05.375-.363.588T6 12Zm6 7.4l-2.3 2.3q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l2.7-2.7v-3.3q-.675-.3-1.088-.925T9.5 12q0-1.05.725-1.775T12 9.5q1.05 0 1.775.725T14.5 12q0 .75-.413 1.375T13 14.3v3.3l2.7 2.7q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 19.4Z"/>'};function rs({data:i,verified:a=!1,...t}){return e.jsxs(g,{...t,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...t.sx},children:[e.jsxs(R,{sx:{display:"flex",alignItems:"center",color:"text.primary",fontSize:"14px",gap:1,fontWeight:500},children:[i.icon,i.title]}),e.jsxs(g,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(R,{component:"div",sx:{color:"text.secondary",whiteSpace:"pre-wrap",fontSize:"14px"},children:i.content}),a&&e.jsx(qo,{color:"success",style:{fontSize:16,marginLeft:4}})]})]})}function ns({user:i,isMySelf:a=!1,...t}){const{locale:s}=H(),x=A((m,h={})=>Y(Q,m,s,"en",h)),w=M(()=>i?.sourceProvider&&uo[i.sourceProvider]||x("unknown"),[i?.sourceProvider]),p=[];return a&&(p.push({icon:e.jsx(G,{fontSize:16,icon:os}),title:x("lastLoginAt"),content:i?.lastLoginAt?e.jsx(He,{locale:s,value:i?.lastLoginAt,relativeRange:3*86400*1e3}):x("unknown")}),p.push({icon:e.jsx(G,{fontSize:16,icon:ss}),title:x("lastLoginIp"),content:i?.lastLoginIp?e.jsx(Yo,{maxLength:20,children:i?.lastLoginIp}):x("unknown")})),p.push({icon:e.jsx(G,{fontSize:16,icon:ts}),title:x("createdAt"),content:i?.createdAt?e.jsx(He,{locale:s,value:i?.createdAt}):x("unknown")}),a&&(p.push({icon:e.jsx(G,{fontSize:16,icon:Yi}),title:x("registerFrom"),content:w}),i?.inviter&&p.push({icon:e.jsx(G,{fontSize:16,icon:Yi}),title:x("invitedBy"),content:e.jsx(Qe,{style:{maxWidth:260},did:i.inviter,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:s})})),e.jsx(g,{...t,sx:{display:"flex",flexDirection:"column",gap:1.5,...t?.sx},children:p.map(m=>e.jsx(rs,{data:m,sx:{flex:1}},m.title))})}const as=()=>{const{componentMountPoints:i=[]}=window.blocklet||{};return i.find(a=>a.name==="did-comments")?.mountPoint};function ls({user:i}){const{locale:a}=H(),t=A((w,p={})=>Y(Q,w,a,"en",p)),s=k.useMemo(()=>as(),[]),x=A(()=>{window.open(se(s,`/chat/dm/${i?.did}`),"_blank")});return s?e.jsxs(ue,{fullWidth:!0,variant:"outlined",color:"inherit",onClick:x,sx:{borderColor:"divider"},children:[e.jsx(G,{icon:"tabler:message-dots",style:{marginRight:4}}),t("profile.chat")]}):null}function cs({userDid:i,t:a,isMySelf:t}){const s=he(),[x,w]=k.useState(!1),p=A(async()=>{try{if(t){w(!0);return}const u=await s.user.isFollowingUser({userDid:i});w(u)}catch(u){console.error(u)}}),m=A(async(u=i)=>{if(!(t&&u===i))try{await s.user.followUser({userDid:u}),X.success(a("profile.follow_success")),p()}catch(f){console.error(f),X.error(le(f))}}),h=A(async(u=i)=>{if(!(t&&u===i))try{await s.user.unfollowUser({userDid:u}),X.success(a("profile.unfollow_success")),p()}catch(f){console.error(f),X.error(le(f))}});return k.useEffect(()=>{i&&!t&&p()},[p,i,t]),{followed:x,followUser:m,unfollowUser:h}}const xo=k.createContext({followed:!1,followUser:()=>{},unfollowUser:()=>{}}),{Provider:ds}=xo;function Qi({isMySelf:i,userDid:a,children:t}){const{locale:s}=H(),x=A((h,u={})=>Y(Q,h,s,"en",u)),{followed:w,followUser:p,unfollowUser:m}=cs({userDid:a,t:x,isMySelf:i});return e.jsx(ds,{value:{followed:w,followUser:p,unfollowUser:m},children:t})}function go(){return k.useContext(xo)}function us(){const{locale:i}=H(),a=A((w,p={})=>Y(Q,w,i,"en",p)),{followed:t,followUser:s,unfollowUser:x}=go();return e.jsx(ue,{variant:"contained",onClick:()=>t?x():s(),fullWidth:!0,children:a(t?"profile.unfollow":"profile.follow")})}function ps({user:i}){return e.jsxs(g,{sx:{display:"flex",gap:1},children:[e.jsx(ls,{user:i}),e.jsx(us,{})]})}const ms=k.lazy(()=>Se(()=>import("./metadata-CkzdOpl3.js"),__vite__mapDeps([0,1]),import.meta.url));function Ki({user:i,isMyself:a=!0,showFullDid:t=!0,switchPassport:s,switchProfile:x,isMobile:w=!1,onlyProfile:p=!1,refreshProfile:m,isShowSocialActions:h=!1,...u}){const f=he(),{locale:C}=H(),[r,d]=k.useState(void 0),n=A((c,T={})=>Y(Q,c,C,"en",T)),[o,l]=k.useState(!w||p);k.useEffect(()=>{d(i?.metadata?.status)},[i]),k.useEffect(()=>{l(!w||p)},[w,p]);const y=async c=>{if(a)try{if(c){const T=Ot(c);c.dateRange=T.length>0?T:r?.dateRange??[]}d(c),await f.user.saveProfile({metadata:{...i?.metadata??{joinedAt:i?.createdAt,email:i?.email,phone:i?.phone},status:c||{}}}),m()}catch(T){console.error(T),X.error(le(T))}},b=()=>{l(!o)},v=async c=>{if(!a)return;const{metadata:T,address:j}=c;try{const O=T?.links?.map((D,J)=>{if(!D.url||!ui(D.url)||J>0&&T.links?.slice(0,J)?.some(S=>Et(S.url,D.url)))return null;try{return gt(D.url).protocol||(D.url=se("https://",D.url)),D}catch{return console.error("Invalid URL:",D.url),null}}).filter(D=>!!D)||[];T.links=O,await f.user.saveProfile({metadata:T,address:j}),m()}catch(O){console.error(O),X.error(le(O))}};return e.jsxs(g,{...u,sx:{position:"relative",...u.sx??{}},children:[e.jsxs(g,{className:"user-info",sx:{display:"flex",flexDirection:w?"row":"column",gap:2},children:[e.jsxs(g,{className:"user-avatar",sx:{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(hi,{src:i?.avatar,did:i?.did,size:u.size||(w?64:100),variant:"circle",shape:"circle",sx:{borderRadius:"100%",backgroundColor:"#fff",position:"relative",overflow:"hidden",flexShrink:0,...a?{cursor:"pointer","&::after":{content:`"${n("switchProfile")}"`,color:"white",position:"absolute",fontSize:"12px",bottom:0,left:0,right:0,height:"25%",backgroundColor:"rgba(0, 0, 0, 0.3)",display:"flex",justifyContent:"center",alignItems:"center"}}:{}},onClick:a?x:ae}),e.jsx(es,{isMobile:w,size:u.size||(w?64:100),isMyself:a,timezone:i?.metadata?.timezone||_t,status:r,onChange:y})]}),e.jsxs(g,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(R,{variant:"h6",component:"div",sx:{flex:1,fontWeight:600,display:"flex",alignItems:"center",gap:1,fontSize:"24px !important",flexWrap:"wrap"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i?.fullName}),a?e.jsx(Ht,{user:i,switchPassport:s}):null]}),e.jsx(Qe,{did:i.did,size:16,showQrcode:!0,copyable:!0,compact:!t,responsive:!t,locale:C})]})]}),!a&&h?e.jsx(g,{sx:{mt:2},children:e.jsx(ps,{user:i})}):null,e.jsx(ms,{isMobile:w,isMyself:a,user:i,onSave:v}),a?e.jsxs(e.Fragment,{children:[e.jsx(ao,{sx:{my:w?1:3}}),w&&!p?e.jsx(g,{sx:{display:"flex",justifyContent:"center",mb:0},children:e.jsx(ie,{size:"small",onClick:b,sx:{backgroundColor:"grey.50","&:hover":{backgroundColor:"grey.50",opacity:.8}},children:o?e.jsx(Mo,{}):e.jsx(Do,{})})}):null,e.jsxs(zo,{in:o,timeout:"auto",children:[e.jsx(R,{component:"p",sx:{color:"text.secondary",fontSize:"14px",mb:2},children:n("profile.justForYou")}),e.jsx(ns,{user:i,isMySelf:a})]})]}):null]})}function hs({passport:i,user:a,color:t,width:s=150,icon:x=null,createPassportSvg:w,children:p,...m}){const{t:h}=H();return e.jsxs(g,{...m,sx:{display:"flex",alignItems:"center",...m?.sx},children:[!!i.display&&e.jsx(g,{className:"passport-item__display",sx:{width:s},children:e.jsx(xi,{address:i.id,data:i.display,imageFilter:typeof s=="number"?{imageFilter:"resize",w:s}:null})}),!i.display&&e.jsx(g,{className:"passport-item__display",dangerouslySetInnerHTML:{__html:w({title:i.scope==="kyc"?i.name:i.title,issuer:i.issuer&&i.issuer.name,issuerDid:i.issuer&&i.issuer.id,ownerName:a.fullName,ownerDid:a.did,ownerAvatarUrl:a.avatar,revoked:i.revoked,scope:i.scope,role:i.role,display:i.display,preferredColor:t,width:s})}}),e.jsxs(g,{className:"passport-item__body",sx:{p:0,ml:3,mt:0},children:[e.jsxs(g,{className:"passport-item__title",sx:{display:"flex",alignItems:"center",fontWeight:400,fontSize:"16px",lineHeight:1.1875,color:"text.primary"},children:[bt(i.title),e.jsxs(g,{className:"passport-item__status-icon",sx:{svg:{fill:"#bfbfbf",height:"1.2em",marginLeft:"0.4em"}},children:[x,i.revoked&&e.jsx(Pt,{})]})]}),i.expirationDate&&e.jsx(g,{className:"passport-item__title",sx:{display:"flex",alignItems:"center",fontWeight:400,fontSize:"16px",lineHeight:1.1875,color:"text.primary"},children:h("team.passport.validUntil",{date:i.expirationDate})}),p]})]})}function fs({user:i,...a}){const{locale:t}=H(),s=A((h,u={})=>Y(Q,h,t,"en",u)),x=Lo(),w=M(()=>{const h=(i?.passports||[]).map(u=>({...u,revoked:u.status===tt.REVOKED}));return h.sort((u,f)=>u.revoked===f.revoked?0:u.revoked?1:-1),zi(h.filter(u=>!u.display),"role").concat(zi(h.filter(u=>u.display),"display.content"))},[i?.passports]),p=M(()=>w?.find(h=>h.name===i.role),[w,i?.role]),m=x.palette.primary.main;return w.length===0?e.jsx(g,{children:e.jsx(pe,{children:s("noPassport")})}):e.jsx(g,{...a,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,...a.sx},children:w.map(h=>e.jsx(hs,{passport:h,user:i,color:window.blocklet.passportColor,createPassportSvg:St,title:p&&p.role===h.role?s("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:p&&p.role===h.role?`0px 2px 4px 0px ${m}, 0px 1px 2px -1px ${m}, 0px 0px 0px 1px ${m} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},h.id))})}const xs={width:24,height:24,body:'<path fill="currentColor" d="M11 13H6q-.425 0-.713-.288T5 12q0-.425.288-.713T6 11h5V6q0-.425.288-.713T12 5q.425 0 .713.288T13 6v5h5q.425 0 .713.288T19 12q0 .425-.288.713T18 13h-5v5q0 .425-.288.713T12 19q-.425 0-.713-.288T11 18v-5Z"/>'},gs={width:24,height:24,body:'<path fill="currentColor" d="M4.4 19.425q-.5.2-.95-.088T3 18.5V14l8-2l-8-2V5.5q0-.55.45-.838t.95-.087l15.4 6.5q.625.275.625.925t-.625.925l-15.4 6.5Z"/>'},bs={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h8.925l-2 2H5v14h14v-6.95l2-2V19q0 .825-.588 1.413T19 21H5Zm7-9Zm-3 2v-2.425q0-.4.15-.763t.425-.637l8.6-8.6q.3-.3.675-.45t.75-.15q.4 0 .763.15t.662.45L22.425 3q.275.3.425.663T23 4.4q0 .375-.138.738t-.437.662l-8.6 8.6q-.275.275-.637.438t-.763.162H10q-.425 0-.713-.288T9 14Zm12.025-9.6l-1.4-1.4l1.4 1.4ZM11 13h1.4l5.8-5.8l-.7-.7l-.725-.7L11 11.575V13Zm6.5-6.5l-.725-.7l.725.7l.7.7l-.7-.7Z"/>'},ws={width:24,height:24,body:'<path fill="currentColor" d="M7 21q-.825 0-1.413-.588T5 19V6q-.425 0-.713-.288T4 5q0-.425.288-.713T5 4h4q0-.425.288-.713T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6v13q0 .825-.588 1.413T17 21H7ZM17 6H7v13h10V6ZM9 17h2V8H9v9Zm4 0h2V8h-2v9ZM7 6v13V6Z"/>'};function Xi({onTest:i=ae,onDelete:a=ae,onSave:t=ae,onCancel:s=ae,type:x="slack",url:w="",edit:p=!1}){const{locale:m}=H(),h=A((o,l={})=>Y(Q,o,m,"en",l)),u=me({type:x||"slack",url:w||"",edit:p??!1,error:"",loading:!1}),f=A(()=>u.url?lo(u.url)?(u.error="",!0):(u.error=h("common.invalid"),!1):(u.error=h("common.required"),!1)),C=A(()=>{u.edit=!1,u.url=w||"",u.type=x||"slack",u.error="",u.loading=!1,s()}),r=A(async o=>{u.loading=!0,await i(o),u.loading=!1}),d=A(o=>()=>{f()&&o({type:u.type,url:u.url})}),n=M(()=>u.error?e.jsx(R,{component:"span",color:"error",children:u.error}):u.edit?u.loading?e.jsx(Re,{size:16}):e.jsx(ie,{size:"small",onClick:d(r),sx:{mr:-1},children:e.jsx(G,{icon:gs})}):null,[u.error,u.edit,u.loading]);return e.jsxs(g,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Be,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!u.edit||u.loading,size:"small",value:u.type,onChange:o=>{u.type=o.target.value},children:[e.jsx(ze,{value:"api",children:h("webhook.url")}),e.jsx(ze,{value:"slack",children:h("webhook.slack")})]}),e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(no,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!u.edit||u.loading,fullWidth:!0,size:"small",required:!0,value:u.url,onChange:o=>{u.url=o.target.value,f()},error:!!u.error,slotProps:{input:{endAdornment:e.jsx(Ro,{position:"end",children:n})}}}),e.jsx(g,{sx:{display:"flex",gap:.5},children:u.edit?e.jsxs(e.Fragment,{children:[e.jsx(ie,{color:"success",onClick:d((...o)=>{t(...o),u.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:st})}),e.jsx(ie,{color:"error",onClick:C,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:rt})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{onClick:()=>{u.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:bs})}),e.jsx(ie,{color:"error",onClick:()=>{a({type:u.type,url:u.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:ws})})]})})]})]})}function si({title:i=void 0,description:a=void 0,value:t,onChange:s,isMobile:x}){const w=A(p=>{p.stopPropagation()});return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(fo,{checked:t,size:"small",onChange:s}),e.jsxs(R,{component:"div",onClick:w,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:x?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:x?"normal":"nowrap"},children:[i,a]})]})}function vs({user:i,isMobile:a}){const{locale:t}=H(),s=he(),x=A((o,l={})=>Y(Q,o,t,"en",l)),w=me({showAdd:!1}),p=Le(async()=>await s.user.getUserNotificationConfig(),{refreshDeps:[i],loadingDelay:300}),m=M(()=>({wallet:!0,email:!0,phone:!1,push:!0,...p?.data?.notifications||{}}),[p?.data?.notifications]),h=M(()=>p?.data?.webhooks||[],[p?.data?.webhooks]),u=A(async o=>{try{await s.user.saveUserNotificationConfig(o),X.success(x("saveSuccess")),p.run()}catch(l){X.error(le(l))}}),f=A(async(o,l)=>{await u({notifications:{[o]:l}})}),C=async o=>{try{await s.user.testNotificationWebhook(o),X.success(x("webhookTested"))}catch(l){X.error(le(l))}},r=A(async o=>{await u({webhooks:h.filter((l,y)=>y!==o)})}),d=A(async(o,l)=>{await u({webhooks:h.map((y,b)=>b===o?l:y)})}),n=A(async o=>{await u({webhooks:[...h,o]}),w.showAdd=!1});return p.error?e.jsx(_o,{severity:"error",children:p.error.message}):p.loading||!p.data?e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Re,{})}):e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(g,{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(si,{value:m.wallet,isMobile:a,title:x("walletNotification"),onChange:o=>f("wallet",o.target.checked),description:Di(i)&&e.jsx(Qe,{did:Di(i),showQrcode:!1,showAvatar:!a,copyable:!0,compact:!0,responsive:!0,locale:t,startChars:a?2:6})}),e.jsx(si,{value:m.email,isMobile:a,onChange:o=>f("email",o.target.checked),title:x("emailNotification"),description:i?.email&&e.jsx(R,{component:"span",sx:{color:"text.secondary",fontSize:13},children:i?.email})}),e.jsx(si,{isMobile:a,value:m.push,title:x("pushNotification"),onChange:o=>f("push",o.target.checked)})]}),e.jsxs(mi,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[h.map((o,l)=>e.jsx(Xi,{onTest:C,onDelete:()=>r(l),onSave:(...y)=>d(l,...y),type:o.type,url:o.url,edit:!1},`${l}_${o.url}`)),w.showAdd&&e.jsx(Xi,{onTest:C,onCancel:()=>{w.showAdd=!1},onSave:(...o)=>n(...o),edit:!0},"add"),e.jsx(fi,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(G,{icon:xs}),onClick:()=>{w.showAdd=!0},children:x("addWebhook")})]})]})}function ys({configList:i,onSave:a}){const t=he(),[s,x]=k.useState(i),{locale:w}=H(),p=A((h,u={})=>Y(Q,h,w,"en",u)),m=A(async(h,u)=>{try{const f=await t.user.saveUserPrivacyConfig({[h]:!u});x(s.map(C=>({...C,value:f?.[C.key]??C.value}))),X.success(p("saveSuccess")),a("privacy")}catch(f){X.error(le(f))}});return e.jsx(g,{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(h=>h.isPrivate?null:e.jsx(fo,{checked:!h.value,labelProps:{label:e.jsx(R,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:p("toPublic",{name:h.name})})},size:"small",onChange:u=>m(h.key,u.target.checked)},h.key))})}var De={exports:{}},js=De.exports,Ji;function ks(){return Ji||(Ji=1,(function(i,a){(function(t,s){var x="1.0.41",w="",p="?",m="function",h="undefined",u="object",f="string",C="major",r="model",d="name",n="type",o="vendor",l="version",y="architecture",b="console",v="mobile",c="tablet",T="smarttv",j="wearable",O="embedded",D=500,J="Amazon",S="Apple",z="ASUS",$="BlackBerry",U="Browser",fe="Chrome",Ke="Edge",be="Firefox",xe="Google",Te="Honor",Ce="Huawei",Xe="Lenovo",we="LG",Pe="Microsoft",ve="Motorola",ge="Nvidia",Ae="OnePlus",ce="Opera",ye="OPPO",de="Samsung",q="Sharp",_="Sony",W="Xiaomi",re="Zebra",wi="Facebook",vi="Chromium OS",yi="Mac OS",ji=" Browser",vo=function(L,N){var I={};for(var F in L)N[F]&&N[F].length%2===0?I[F]=N[F].concat(L[F]):I[F]=L[F];return I},Ee=function(L){for(var N={},I=0;I<L.length;I++)N[L[I].toUpperCase()]=L[I];return N},ki=function(L,N){return typeof L===f?Ie(N).indexOf(Ie(L))!==-1:!1},Ie=function(L){return L.toLowerCase()},yo=function(L){return typeof L===f?L.replace(/[^\d\.]/g,w).split(".")[0]:s},Je=function(L,N){if(typeof L===f)return L=L.replace(/^\s\s*/,w),typeof N===h?L:L.substring(0,D)},qe=function(L,N){for(var I=0,F,ne,oe,E,P,te;I<N.length&&!P;){var ei=N[I],Ci=N[I+1];for(F=ne=0;F<ei.length&&!P&&ei[F];)if(P=ei[F++].exec(L),P)for(oe=0;oe<Ci.length;oe++)te=P[++ne],E=Ci[oe],typeof E===u&&E.length>0?E.length===2?typeof E[1]==m?this[E[0]]=E[1].call(this,te):this[E[0]]=E[1]:E.length===3?typeof E[1]===m&&!(E[1].exec&&E[1].test)?this[E[0]]=te?E[1].call(this,te,E[2]):s:this[E[0]]=te?te.replace(E[1],E[2]):s:E.length===4&&(this[E[0]]=te?E[3].call(this,te.replace(E[1],E[2])):s):this[E]=te||s;I+=2}},Me=function(L,N){for(var I in N)if(typeof N[I]===u&&N[I].length>0){for(var F=0;F<N[I].length;F++)if(ki(N[I][F],L))return I===p?s:I}else if(ki(N[I],L))return I===p?s:I;return N.hasOwnProperty("*")?N["*"]:L},jo={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Si={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ti={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,l],[/opios[\/ ]+([\w\.]+)/i],[l,[d,ce+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[l,[d,ce+" GX"]],[/\bopr\/([\w\.]+)/i],[l,[d,ce]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[l,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[l,[d,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,l],[/quark(?:pc)?\/([-\w\.]+)/i],[l,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[l,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[d,"UC"+U]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[l,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[l,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[l,[d,"Smart Lenovo "+U]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+U],l],[/\bfocus\/([\w\.]+)/i],[l,[d,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[l,[d,ce+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[d,ce+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[d,"MIUI"+ji]],[/fxios\/([\w\.-]+)/i],[l,[d,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[l,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],l],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+ji],l],[/samsungbrowser\/([\w\.]+)/i],[l,[d,de+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[l,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,l],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[l,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,wi],l],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[l,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[d,fe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,fe+" WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[d,"Android "+U]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,l],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[l,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[l,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[l,Me,jo]],[/(webkit|khtml)\/([\w\.]+)/i],[d,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],l],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[d,be+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[d,[l,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[l,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[y,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[y,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[y,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[y,/ower/,w,Ie]],[/ sun4\w[;\)]/i],[[y,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[y,Ie]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[r,[o,de],[n,c]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[r,[o,de],[n,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[r,[o,S],[n,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[r,[o,S],[n,c]],[/(macintosh);/i],[r,[o,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[r,[o,q],[n,v]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[r,[o,Te],[n,c]],[/honor([-\w ]+)[;\)]/i],[r,[o,Te],[n,v]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[r,[o,Ce],[n,c]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[r,[o,Ce],[n,v]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[r,/_/g," "],[o,W],[n,c]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[r,/_/g," "],[o,W],[n,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[r,[o,ye],[n,v]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[r,[o,Me,{OnePlus:["304","403","203"],"*":ye}],[n,c]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[r,[o,"Vivo"],[n,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[r,[o,"Realme"],[n,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[r,[o,ve],[n,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[r,[o,ve],[n,c]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[r,[o,we],[n,c]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[r,[o,we],[n,v]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[r,[o,Xe],[n,c]],[/(nokia) (t[12][01])/i],[o,r,[n,c]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[r,/_/g," "],[n,v],[o,"Nokia"]],[/(pixel (c|tablet))\b/i],[r,[o,xe],[n,c]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[r,[o,xe],[n,v]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[r,[o,_],[n,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[r,"Xperia Tablet"],[o,_],[n,c]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[r,[o,Ae],[n,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[r,[o,J],[n,c]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[r,/(.+)/g,"Fire Phone $1"],[o,J],[n,v]],[/(playbook);[-\w\),; ]+(rim)/i],[r,o,[n,c]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[r,[o,$],[n,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[r,[o,z],[n,c]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[r,[o,z],[n,v]],[/(nexus 9)/i],[r,[o,"HTC"],[n,c]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[o,[r,/_/g," "],[n,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[r,[o,"TCL"],[n,c]],[/(itel) ((\w+))/i],[[o,Ie],r,[n,Me,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[r,[o,"Acer"],[n,c]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[r,[o,"Meizu"],[n,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[r,[o,"Ulefone"],[n,v]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[r,[o,"Energizer"],[n,v]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[r,[o,"Cat"],[n,v]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[r,[o,"Smartfren"],[n,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[r,[o,"Nothing"],[n,v]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[r,[o,"Archos"],[n,c]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[r,[o,"Archos"],[n,v]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[o,r,[n,c]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[o,r,[n,v]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[o,r,[n,c]],[/(surface duo)/i],[r,[o,Pe],[n,c]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[r,[o,"Fairphone"],[n,v]],[/(u304aa)/i],[r,[o,"AT&T"],[n,v]],[/\bsie-(\w*)/i],[r,[o,"Siemens"],[n,v]],[/\b(rct\w+) b/i],[r,[o,"RCA"],[n,c]],[/\b(venue[\d ]{2,7}) b/i],[r,[o,"Dell"],[n,c]],[/\b(q(?:mv|ta)\w+) b/i],[r,[o,"Verizon"],[n,c]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[r,[o,"Barnes & Noble"],[n,c]],[/\b(tm\d{3}\w+) b/i],[r,[o,"NuVision"],[n,c]],[/\b(k88) b/i],[r,[o,"ZTE"],[n,c]],[/\b(nx\d{3}j) b/i],[r,[o,"ZTE"],[n,v]],[/\b(gen\d{3}) b.+49h/i],[r,[o,"Swiss"],[n,v]],[/\b(zur\d{3}) b/i],[r,[o,"Swiss"],[n,c]],[/\b((zeki)?tb.*\b) b/i],[r,[o,"Zeki"],[n,c]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[o,"Dragon Touch"],r,[n,c]],[/\b(ns-?\w{0,9}) b/i],[r,[o,"Insignia"],[n,c]],[/\b((nxa|next)-?\w{0,9}) b/i],[r,[o,"NextBook"],[n,c]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[o,"Voice"],r,[n,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[o,"LvTel"],r,[n,v]],[/\b(ph-1) /i],[r,[o,"Essential"],[n,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[r,[o,"Envizen"],[n,c]],[/\b(trio[-\w\. ]+) b/i],[r,[o,"MachSpeed"],[n,c]],[/\btu_(1491) b/i],[r,[o,"Rotor"],[n,c]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[r,[o,ge],[n,c]],[/(sprint) (\w+)/i],[o,r,[n,v]],[/(kin\.[onetw]{3})/i],[[r,/\./g," "],[o,Pe],[n,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[r,[o,re],[n,c]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[r,[o,re],[n,v]],[/smart-tv.+(samsung)/i],[o,[n,T]],[/hbbtv.+maple;(\d+)/i],[[r,/^/,"SmartTV"],[o,de],[n,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[o,we],[n,T]],[/(apple) ?tv/i],[o,[r,S+" TV"],[n,T]],[/crkey/i],[[r,fe+"cast"],[o,xe],[n,T]],[/droid.+aft(\w+)( bui|\))/i],[r,[o,J],[n,T]],[/(shield \w+ tv)/i],[r,[o,ge],[n,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[r,[o,q],[n,T]],[/(bravia[\w ]+)( bui|\))/i],[r,[o,_],[n,T]],[/(mi(tv|box)-?\w+) bui/i],[r,[o,W],[n,T]],[/Hbbtv.*(technisat) (.*);/i],[o,r,[n,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[o,Je],[r,Je],[n,T]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[r,[n,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[n,T]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[o,r,[n,b]],[/droid.+; (shield)( bui|\))/i],[r,[o,ge],[n,b]],[/(playstation \w+)/i],[r,[o,_],[n,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[r,[o,Pe],[n,b]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[r,[o,de],[n,j]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[o,r,[n,j]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[r,[o,ye],[n,j]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[r,[o,S],[n,j]],[/(opwwe\d{3})/i],[r,[o,Ae],[n,j]],[/(moto 360)/i],[r,[o,ve],[n,j]],[/(smartwatch 3)/i],[r,[o,_],[n,j]],[/(g watch r)/i],[r,[o,we],[n,j]],[/droid.+; (wt63?0{2,3})\)/i],[r,[o,re],[n,j]],[/droid.+; (glass) \d/i],[r,[o,xe],[n,j]],[/(pico) (4|neo3(?: link|pro)?)/i],[o,r,[n,j]],[/; (quest( \d| pro)?)/i],[r,[o,wi],[n,j]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[o,[n,O]],[/(aeobc)\b/i],[r,[o,J],[n,O]],[/(homepod).+mac os/i],[r,[o,S],[n,O]],[/windows iot/i],[[n,O]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[r,[n,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[r,[n,c]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[n,c]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[n,v]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[r,[o,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[d,Ke+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[d,l],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,l],[/ladybird\//i],[[d,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,l],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[d,[l,Me,Si]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,Me,Si],[d,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,yi],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[l,d],[/(ubuntu) ([\w\.]+) like android/i],[[d,/(.+)/,"$1 Touch"],l],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[d,l],[/\(bb(10);/i],[l,[d,$]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[l,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[d,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[l,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[l,[d,fe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,vi],l],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,l],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,l]]},ee=function(L,N){if(typeof L===u&&(N=L,L=s),!(this instanceof ee))return new ee(L,N).getResult();var I=typeof t!==h&&t.navigator?t.navigator:s,F=L||(I&&I.userAgent?I.userAgent:w),ne=I&&I.userAgentData?I.userAgentData:s,oe=N?vo(Ti,N):Ti,E=I&&I.userAgent==F;return this.getBrowser=function(){var P={};return P[d]=s,P[l]=s,qe.call(P,F,oe.browser),P[C]=yo(P[l]),E&&I&&I.brave&&typeof I.brave.isBrave==m&&(P[d]="Brave"),P},this.getCPU=function(){var P={};return P[y]=s,qe.call(P,F,oe.cpu),P},this.getDevice=function(){var P={};return P[o]=s,P[r]=s,P[n]=s,qe.call(P,F,oe.device),E&&!P[n]&&ne&&ne.mobile&&(P[n]=v),E&&P[r]=="Macintosh"&&I&&typeof I.standalone!==h&&I.maxTouchPoints&&I.maxTouchPoints>2&&(P[r]="iPad",P[n]=c),P},this.getEngine=function(){var P={};return P[d]=s,P[l]=s,qe.call(P,F,oe.engine),P},this.getOS=function(){var P={};return P[d]=s,P[l]=s,qe.call(P,F,oe.os),E&&!P[d]&&ne&&ne.platform&&ne.platform!="Unknown"&&(P[d]=ne.platform.replace(/chrome os/i,vi).replace(/macos/i,yi)),P},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return F},this.setUA=function(P){return F=typeof P===f&&P.length>D?Je(P,D):P,this},this.setUA(F),this};ee.VERSION=x,ee.BROWSER=Ee([d,l,C]),ee.CPU=Ee([y]),ee.DEVICE=Ee([r,o,n,b,v,T,c,j,O]),ee.ENGINE=ee.OS=Ee([d,l]),i.exports&&(a=i.exports=ee),a.UAParser=ee;var je=typeof t!==h&&(t.jQuery||t.Zepto);if(je&&!je.ua){var Oe=new ee;je.ua=Oe.getResult(),je.ua.get=function(){return Oe.getUA()},je.ua.set=function(L){Oe.setUA(L);var N=Oe.getResult();for(var I in N)je.ua[I]=N[I]}}})(typeof window=="object"?window:js)})(De,De.exports)),De.exports}var Ss=ks();const ri=Bo(Ss);function Ts({user:i,sessionUser:a}){const t=M(()=>(i?.passports||[])?.find(s=>s.name===a.role),[i?.passports,a?.role]);return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(hi,{size:40,variant:"circle",shape:"circle",src:a.avatar,did:a.did,sx:{flexShrink:0}}),e.jsxs(g,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ke,{title:a.fullName,children:e.jsx(R,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:a.fullName})}),e.jsx(ro,{label:t?.title||t?.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(ke,{title:a.email,children:e.jsx(R,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.email})})]})]})}const Cs={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有{type}会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有{type}会话",logoutAllSessionConfirm:"确定要注销所有{type}会话吗?",online:"活跃"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all {type} sessions",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all {type} sessions",logoutAllSessionConfirm:"Are you sure to logout all {type} sessions?",online:"Active"}},bo="Reserved IP",eo="ip-region-cache";async function Ps(i){const a=`https://ipapi.co/${i}/json/`,t=await(await fetch(a)).json();let s="";return t.error?t.reserved&&(s=bo):s=[t.country_name,t.region,t.city].filter(Boolean).join("/"),s}async function As(i){const a=`https://api.ip.sb/geoip/${i}`,t=await(await fetch(a)).json();let s="";return t.error?t.reserved&&(s=bo):s=[t.country,t.region,t.city].filter(Boolean).join("/"),s}async function Is(i){let a="",t={};try{const s=localStorage.getItem(eo);s&&(t=JSON.parse(s))}catch{t={}}if(t[i])a=t[i];else{try{a=await As(i)}catch{console.warn("Fail to get ip region from ip.sb")}if(!a)try{a=await Ps(i)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(a){const s=Object.keys(t);s.length>100&&delete t[s[0]],t[i]&&delete t[i],t[i]=a,localStorage.setItem(eo,JSON.stringify(t))}return a}const io=i=>new ri(i,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ri.BROWSER.NAME,ri.BROWSER.VERSION]]}).getResult(),oo={display:"flex",justifyContent:"flex-end",textAlign:"right"},qs=new Qo({concurrency:1}),Ms=k.memo(({userSession:i,isMobile:a=!1})=>{const t=me({loading:!0,ipRegion:""}),{t:s}=H();return k.useEffect(()=>{qs.add(async()=>{try{t.ipRegion=await Is(i.lastLoginIp)}finally{t.loading=!1}})},[t,i.lastLoginIp]),e.jsx(g,{...a&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:t.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(R,{variant:"body2",children:t.ipRegion}),e.jsx(R,{variant:"body2",color:"grey",children:i.lastLoginIp||s("unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:i.lastLoginIp||s("unknown")}),t.loading?e.jsx(R,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Re,{size:12,color:"inherit"})}):null]})})});function Ds({user:i,showAction:a=!0,showUser:t=!0,getUserSessions:s,showOffline:x=!1,showAppPid:w=!1}){const p=he(),m=me({status:"online",page:1,pageSize:10}),h=me({online:0,expired:0,offline:0}),u=nt(),{locale:f}=H(),C=gi({key:"md"}),r=No(S=>S.breakpoints.down("lg")),{confirmApi:d,confirmHolder:n}=Ye(),o=A((S,z={})=>Y(Cs,S,f,"en",z)),l=A(async()=>{const S=await s({page:m.page,pageSize:m.pageSize,status:m.status}),z=S?.paging?.total||0;return h[m.status]=z,{total:z,list:S?.list||[]}});Vo(async()=>{const S=await s({page:1,pageSize:1,status:"expired"});h.expired=S?.paging?.total||0;const z=await s({page:1,pageSize:1,status:"offline"});h.offline=z?.paging?.total||0});const y=Le(l,{refreshDeps:[m.status,m.page,m.pageSize]}),b=M(()=>y.data?.list||[],[y.data?.list]),v=M(()=>{const S=m.status;return S==="online"?h[S]<=1:h[S]===0},[b,u]),c=M(()=>ci({},C?oo:{}),[C]),T=A(({visitorId:S})=>{d.open({title:o("logoutThisSession"),content:o("logoutThisSessionConfirm"),confirmButtonText:o("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("cancel"),onConfirm:async()=>{await p.user.logout({visitorId:S,includeFederated:!0});const{page:z=0}=m,{list:$=[]}=y.data||{},U=$.length||0;z>1&&U===1&&(m.page=Math.max(z-1,1)),y.refresh(),d.close()}})}),j=A(()=>{d.open({title:o("logoutAllSession",{type:o(m.status)}),content:o("logoutAllSessionConfirm",{type:o(m.status)}),confirmButtonText:o("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("cancel"),onConfirm:async()=>{await p.user.logout({status:m.status,visitorId:u,includeFederated:!0}),m.page=1,y.refresh(),d.close()}})}),O=[];a&&O.push(e.jsx(ke,{title:o("logoutAllTips",{type:o(m.status)}),children:e.jsx(ue,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:j,disabled:v,children:o("logoutAll",{type:o(m.status)})})},"logoutAll"));const D=M(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:m.page-1,rowsPerPage:m.pageSize,count:y.data?.total||0}),[y.data?.total,m.page,m.pageSize]),J=[{label:o("platform"),name:"platform",options:{customBodyRenderLite:S=>{const z=b[S],$=io(z?.ua);return e.jsx(g,{sx:c,children:[$.os?.name,$.os?.version].filter(Boolean).join("/")||o("unknown")})}}},{label:o("deviceType"),name:"deviceType",options:{customBodyRenderLite:S=>{const z=b[S],$=io(z?.ua);return e.jsx(g,{sx:c,children:[$.browser?.name,$.browser?.version].filter(Boolean).join("/")||o("unknown")})}}},{label:o("walletOS"),name:"walletOS",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:z.extra?.walletOS||o("unknown")})}}},w&&{label:"App Pid",name:"appPid",options:{customBodyRenderLite:S=>{const z=b[S];return z.appPid?e.jsx(Qe,{size:14,responsive:!1,compact:!0,did:z.appPid}):null}}},t&&{label:o("user"),name:"user",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:ci({minWidth:150,maxWidth:250},C?oo:{}),children:e.jsx(Ts,{sessionUser:z.user,user:i})})}}},{label:o("createdAt"),name:"createdAt",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:z.createdAt?e.jsx(He,{value:z.createdAt,relativeRange:3*86400*1e3,locale:f}):o("unknown")})}}},!x&&{label:o("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:z.status==="expired"?o("expired"):e.jsx(He,{value:z.updatedAt,relativeRange:3*86400*1e3,locale:f})})}}},{label:o("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(Ms,{userSession:z,isMobile:C})}}},a&&{label:o("actions"),name:"actions",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:e.jsx(ue,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:u===z.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>T({visitorId:z.visitorId}),children:z.status==="expired"?o("remove"):u===z.visitorId?o("currentSession"):o("logout")})})}}}].filter(Boolean);return e.jsxs(g,{className:"pc-user-sessions",sx:{maxWidth:C?"unset":r?"calc(100vw - 300px)":"100%",...C&&{".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:S=>`${S.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...C&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[n,e.jsx(at,{count:y.data?.total||0,locale:f,data:b,columns:J,customButtons:O,options:D,loading:y.loading,className:"pc-user-sessions-table",title:e.jsxs(Eo,{row:!0,sx:{lineHeight:1,ml:1},onChange:S=>{m.status=S.target.value},children:[e.jsx(ii,{value:"online",control:e.jsx(oi,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="online"}),label:e.jsxs(R,{sx:{display:"flex",alignItems:"center"},children:[o("online"),e.jsxs(R,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",h.online,")"]})]})}),e.jsx(ii,{value:"expired",control:e.jsx(oi,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="expired"}),label:e.jsxs(R,{sx:{display:"flex",alignItems:"center"},children:[o("expired"),e.jsxs(R,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",h.expired,")"]})]})}),x?e.jsx(ii,{value:"offline",control:e.jsx(oi,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="offline"}),label:e.jsxs(R,{sx:{display:"flex",alignItems:"center"},children:[o("offline"),e.jsxs(R,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",h.offline,")"]})]})}):null]}),onChange:S=>{m.page=S.page+1,m.pageSize=S.rowsPerPage}})]})}const zs={width:24,height:24,body:'<path fill="currentColor" d="M7 17q-2.075 0-3.538-1.463T2 12q0-2.075 1.463-3.538T7 7h3q.425 0 .713.288T11 8q0 .425-.288.713T10 9H7q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15h3q.425 0 .713.288T11 16q0 .425-.288.713T10 17H7Zm2-4q-.425 0-.713-.288T8 12q0-.425.288-.713T9 11h6q.425 0 .713.288T16 12q0 .425-.288.713T15 13H9Zm5 4q-.425 0-.713-.288T13 16q0-.425.288-.713T14 15h3q1.25 0 2.125-.875T20 12q0-1.25-.875-2.125T17 9h-3q-.425 0-.713-.288T13 8q0-.425.288-.713T14 7h3q2.075 0 3.538 1.463T22 12q0 2.075-1.463 3.538T17 17h-3Z"/>'},Ls={width:24,height:24,body:'<path fill="currentColor" d="M3 20v-2.8q0-.85.438-1.563T4.6 14.55q1.55-.775 3.15-1.163T11 13q.5 0 1 .038t1 .112q-.1 1.45.525 2.738T15.35 18v2H3Zm16 3l-1.5-1.5v-4.65q-1.1-.325-1.8-1.238T15 13.5q0-1.45 1.025-2.475T18.5 10q1.45 0 2.475 1.025T22 13.5q0 1.125-.638 2t-1.612 1.25L21 18l-1.5 1.5L21 21l-2 2Zm-8-11q-1.65 0-2.825-1.175T7 8q0-1.65 1.175-2.825T11 4q1.65 0 2.825 1.175T15 8q0 1.65-1.175 2.825T11 12Zm7.5 2q.425 0 .713-.288T19.5 13q0-.425-.288-.713T18.5 12q-.425 0-.713.288T17.5 13q0 .425.288.713T18.5 14Z"/>'},Rs={width:24,height:24,body:'<path fill="currentColor" d="M2 20V4h20v16H2ZM4 8h16V6H4v2Zm11.775 6.075L20 10.525V10H4v1.225l11.775 2.85Z"/>'},_s={width:256,height:250,body:'<path fill="#161614" d="M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39c-.929-.417-1.45-1.284-1.15-1.922c.276-.655 1.279-.838 2.205-.399c.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591c-.837-.892-.994-2.086-.375-2.66c.63-.566 1.787-.301 2.626.591c.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104c-.784-1.138-.784-2.503.017-3.05c.795-.547 2.058-.055 2.861 1.075c.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49c-1.119-1.032-1.43-2.496-.726-3.27c.71-.776 2.213-.558 3.315.49c1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033c-1.448-.439-2.395-1.613-2.103-2.626c.301-1.01 1.747-1.484 3.207-1.028c1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95c-1.53.034-2.769-.82-2.786-1.86c0-1.065 1.202-1.932 2.733-1.958c1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37c-1.485.271-2.861-.365-3.05-1.386c-.184-1.056.893-2.114 2.376-2.387c1.514-.263 2.868.356 3.061 1.403Z"/>'};function ni({item:i}){const{blocklet:a}=At(),{confirmApi:t,confirmHolder:s}=Ye(),x=me({loading:!1}),{locale:w}=H(),p=A((b,v={})=>Y(Q,b,w,"en",v)),{session:m}=k.use(_e),{bindOAuth:h,unbindOAuth:u,setBaseUrl:f,baseUrl:C}=m.useOAuth(),{disconnectPasskey:r,setTargetAppPid:d}=m.usePasskey(),n={[B.AUTH0]:lt,[B.APPLE]:Mt,[B.GITHUB]:_s,[B.GOOGLE]:qt,[B.PASSKEY]:Ls,[B.WALLET]:Rs},o=M(()=>n[i?.provider],[i?.provider]),l=M(()=>uo[i?.provider]||"unknown",[i?.provider]),y=A(async()=>{if(i?.provider===B.PASSKEY){await new Promise((b,v)=>{t.open({title:p("thirdPartyLogin.disconnectPasskey",{name:l}),content:p("thirdPartyLogin.disconnectPasskeyDescription",{name:l}),confirmButtonText:p("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:p("common.cancel"),onConfirm(c){r({session:m,connectedAccount:i}).then(b).catch(v),c()},onCancel:b})});return}try{x.loading=!0,await new Promise((b,v)=>{if(i?._bind)t.open({title:p("thirdPartyLogin.confirmUnbind",{name:l}),content:p("thirdPartyLogin.confirmUnbindDescription",{name:l}),confirmButtonText:p("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:p("common.cancel"),onConfirm(c){u({session:m,connectedAccount:{...wt(i,["did","pk"]),showProvider:i.provider,provider:i._rawProvider}}).then(b).catch(v),c()},onCancel:b});else{const c=C,T=window?.blocklet;let j="/";const O=ct(T),D=dt(T);O&&D?.appPid&&m?.user?.sourceAppPid&&(j=D.appUrl),f(j),d(a?.appPid),h({session:m,oauthItem:{...i,provider:i._rawProvider}}).then(b).catch(v).finally(()=>{f(c),d()})}})}catch(b){console.error(`Failed to ${i?._bind?"unbind":"bind"} oauth account`,b)}finally{x.loading=!1}});return e.jsxs(e.Fragment,{children:[e.jsxs(g,{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(g,{component:G,icon:o,fill:"currentColor",sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:b})=>i?.provider===B.GITHUB&&b.mode==="dark"?"invert(1)":"none"}}),e.jsx(g,{sx:{flex:1},children:l}),e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(g,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:i.userInfo?.email||i.did}),i.userInfo?.name?e.jsx(ke,{title:e.jsx(e.Fragment,{children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(hi,{size:36,variant:"circle",shape:"circle",src:i.userInfo?.picture,did:i.did}),e.jsxs(g,{children:[e.jsx(R,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:i.userInfo?.name}),e.jsx(R,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:i.userInfo?.email})]})]})}),children:e.jsx(g,{component:G,icon:It,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]})]}),e.jsx(ke,{title:i._mainProvider?p("thirdPartyLogin.mainProviderCantRemove"):"",children:e.jsx(g,{children:e.jsx(fi,{variant:"outlined",size:"small",sx:b=>{const v=b.palette.error.main,c=b.palette.primary.main;return{color:i?._bind?v:c,borderColor:i?._bind?v:c,backgroundColor:"background.default","&:hover":{borderColor:i?._bind?v:c,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:x.loading?null:e.jsx(G,{icon:zs}),onClick:y,disabled:i._mainProvider,loading:x.loading,children:i?._bind?p("thirdPartyLogin.disconnect"):p("thirdPartyLogin.connect")})})}),s]})}function Ns({user:i}){const{session:a}=k.use(_e),[t,s]=k.useState({}),{getOAuthConfigs:x}=a.useOAuth(),w=po();Go(async()=>{const f=await x({sourceAppPid:i?.sourceAppPid});s(f)},[i?.sourceAppPid]);const p=M(()=>Object.keys(t).map(f=>({...t[f],provider:f})).filter(f=>f.enabled),[t]),m=M(()=>{const f=ti(i);let C=!1,r="",d=ut(i);const n=f.find(o=>o.provider===B.AUTH0);return n&&(n.id.startsWith("google-oauth2|")&&(f.some(o=>o.provider==="google")||(C=!0,r=B.GOOGLE,d===B.AUTH0&&(d=B.GOOGLE))),n.id.startsWith("appleid|")&&(f.some(o=>o.provider===B.APPLE)||(C=!0,r=B.APPLE,d===B.AUTH0&&(d=B.APPLE))),n.id.startsWith("github|")&&(f.some(o=>o.provider===B.GITHUB)||(C=!0,r=B.GITHUB,d===B.AUTH0&&(d=B.GITHUB)))),p.map(o=>{if(o.provider===B.AUTH0&&C)return null;const l=C&&o.provider===r?f.find(y=>y.provider===B.AUTH0):f.find(y=>y.provider===o.provider);return l?{...o,provider:o.provider,did:l.did,pk:l.pk,userInfo:l.userInfo,_bind:!0,_rawProvider:l.provider,_mainProvider:o.provider===d}:{...o,provider:o.provider,_rawProvider:o.provider,_mainProvider:o.provider===d}}).filter(Boolean).sort((o,l)=>o?.order!==void 0&&l?.order!==void 0?o.order-l.order:o?.order!==void 0?-1:1)},[i?.connectedAccounts,p]),h=M(()=>ti(i).filter(f=>f.provider===B.PASSKEY&&f.did!==i?.did).map(f=>({...f,_bind:!0})),[i]),u=M(()=>ti(i).filter(f=>f.provider===B.WALLET&&f.did!==i?.did).map(f=>({...f,_mainProvider:!0})),[i]);return e.jsx(g,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:!m.length&&!h.length&&!u.length?e.jsx(Ni,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add Passkey",onSuccess:ae,onError:ae,dense:!0}):e.jsxs(e.Fragment,{children:[m.map(f=>e.jsx(ni,{item:f},f?.provider)),h.map(f=>e.jsx(ni,{item:f},f.id)),u.map(f=>e.jsx(ni,{item:f},f.id)),w.wallet||w.arcSphere?null:e.jsx(Ni,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:ae,onError:ae,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})})}const Es=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function Os({user:i,onSave:a}){const{locale:t,changeLocale:s}=H(),x=he(),w=A((h,u={})=>Y(Q,h,t,"en",u)),p=me({locale:i.locale,loading:!1}),m=A(async h=>{try{const{value:u}=h.target;p.loading=!0,await x.user.saveProfile({locale:u}),await a("profile"),s(u),p.locale=u}catch(u){X.error(le(u))}finally{p.loading=!1}});return e.jsxs(g,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(g,{children:w("commonSetting.locale")}),e.jsxs(g,{children:[p.loading?e.jsx(Oo,{color:"primary",sx:{height:2}}):e.jsx(g,{sx:{height:2,visibility:"hidden"}}),e.jsx(Be,{value:p.locale,onChange:m,size:"small",IconComponent:h=>e.jsx(di,{...h,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Es).map(h=>e.jsx(ze,{value:h.code,children:h.name},h.code))})]})]})}function $s({onDestroySelf:i=void 0}){const{confirmHolder:a}=Ye(),{locale:t}=H(),{session:s}=k.use(_e),x=A((p,m={})=>Y(Q,p,t,"en",m)),w=A(async()=>{if(!i||typeof i!="function")return;const p=s.withSecondaryAuth(i,{extraParams:{locale:t,removeUserDid:s?.user?.did,input:{user:{did:s?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await p(),s.logout()}catch(m){X.error(m?.message||x("destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(g,{children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(g,{children:[e.jsx(R,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:x("dangerZone.deleteAccount")}),e.jsx(R,{variant:"caption",sx:{color:"text.secondary"},children:x("dangerZone.deleteAccountDescription")})]}),e.jsx(ue,{variant:"contained",color:"error",size:"small",onClick:w,children:x("dangerZone.delete")})]})}),a]})}function Us({user:i,settings:a,onSave:t,isMobile:s,...x}){const w=he(),{locale:p}=H(),m=po().arcSphere,h=A((r,d={})=>Y(Q,r,p,"en",d)),u=M(()=>i.passports?.some(r=>r.role===co.ROLES.OWNER),[i]),f=M(()=>(a?.userCenterTabs||[]).map(r=>({key:r.value,name:r.label,value:r.protected,isPrivate:r.isPrivate})),[a?.userCenterTabs]),C=M(()=>[m?void 0:{label:h("commonSetting.title"),value:"common",content:e.jsx(Os,{user:i,onSave:t})},{label:h("notificationManagement"),value:"notification",content:e.jsx(vs,{user:i,isMobile:s})},{label:h("thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(Ns,{user:i})},{label:h("privacyManagement"),value:"privacy",content:e.jsx(ys,{configList:f,onSave:t})},{label:h("sessionManagement"),value:"session",content:e.jsx(Ds,{user:i,showUser:!1,getUserSessions:r=>w.userSession.getMyLoginSessions({},r)})},!u&&x.onDestroySelf&&typeof x.onDestroySelf=="function"?{label:h("dangerZone.title"),value:"dangerZone",content:e.jsx($s,{onDestroySelf:x.onDestroySelf}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[i,f,s]);return k.useEffect(()=>{const r=window.location.hash.slice(1);r&&document.getElementById(r)?.scrollIntoView({behavior:"smooth"})},[]),e.jsx(g,{...x,sx:{...x?.sx,display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},maxWidth:"100%"},children:C.map(r=>r?e.jsxs(g,{id:r.value,sx:ci({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},r.sx),children:[e.jsx(R,{sx:{color:"text.primary",fontWeight:600},children:r.label}),e.jsx(g,{sx:{mt:2.5},children:r.content})]},r.value):null)})}const wo=k.createContext({}),{Provider:Fs,Consumer:Cr}=wo;function Ws({children:i}){const[a]=k.useState(!1),{session:t}=k.use(_e),{user:s}=t,[x,w]=k.useState(),p=k.useMemo(()=>s?.didSpace?.endpoint,[s?.didSpace]);k.useEffect(()=>{w(s?.didSpace)},[s?.didSpace]);const m=async()=>{w(void 0)},h=u=>{};return e.jsx(Fs,{value:{loading:a,spaceGateway:x,session:t,deleteSpaceGateway:m,updateSpaceGateway:async u=>{w(u),await h(u.endpoint)},storageEndpoint:p,settingStorageEndpoint:h,hasStorageEndpoint:!!(p&&x)},children:i})}function bi(){return k.use(wo)}function Bs(i){const a=i.replace(/\/api\/space\/.+/,""),t=i.replace(/\/$/,"").split("/").at(-4);return se(a,"space",t)}function Hs({session:i,spaceGateway:a,spaceStatus:t,refresh:s}){return e.jsxs(mi,{direction:"row",spacing:1,children:[t===zt.DISCONNECTED&&e.jsx(Ve,{reconnect:!0,variant:"outlined",session:i,spaceDid:i.user?.didSpace?.did,spaceGatewayUrl:i.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await s()},onError:x=>{console.error(x),X.error(le(x))}}),e.jsx(ie,{size:"small",LinkComponent:$o,href:Bs(a.endpoint),target:"_blank",children:e.jsx(Uo,{})})]})}function Zs({spaceGateway:i}){const{t:a}=H(),{updateSpaceGateway:t,session:s}=bi(),x=gi(),w=({spaceGateway:p})=>t(p);return e.jsxs(g,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(g,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(R,{sx:{fontSize:"16px",fontWeight:"bold"},children:a("storage.spaces.connected.title")}),!x&&e.jsx(Ve,{connectScope:"user",session:s,onSuccess:w})]}),e.jsx(g,{children:i&&e.jsx(Lt,{endpoint:i.endpoint,deps:[i],selected:!0,footer:!0,action:p=>e.jsx(Hs,{session:s,...p})},i.endpoint)}),x&&e.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(Ve,{connectScope:"user",session:s,onSuccess:w})})]})}function Vs(){const{t:i}=H(),{updateSpaceGateway:a,session:t}=bi(),s=({spaceGateway:x})=>a(x);return e.jsxs(g,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(R,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("storage.spaces.connect.providerForStorage")}),e.jsx(Rt,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(g,{children:e.jsx(Ve,{session:t,onSuccess:s})})]})}function Gs(){const{spaceGateway:i,hasStorageEndpoint:a,loading:t}=bi(),{locale:s}=H();return t?e.jsx(Dt,{relative:"parent",children:e.jsx(Re,{})}):e.jsx(pt,{translations:Q,locale:s,children:e.jsx(Ys,{children:e.jsx(g,{sx:{maxWidth:"720px"},children:a?e.jsx(Zs,{spaceGateway:i}):e.jsx(Vs,{})})})})}const Ys=Ge(g)`
|
|
24
|
+
`,rs={width:24,height:24,body:'<path fill="currentColor" d="M13 11.6V8q0-.425-.288-.713T12 7q-.425 0-.713.288T11 8v3.975q0 .2.075.388t.225.337l3.3 3.3q.275.275.7.275T16 16q.275-.275.275-.7T16 14.6l-3-3ZM12 22q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22Zm0-10Zm0 8q3.325 0 5.663-2.337T20 12q0-3.325-2.337-5.663T12 4Q8.675 4 6.337 6.337T4 12q0 3.325 2.337 5.663T12 20Z"/>'},ns={width:24,height:24,body:'<path fill="currentColor" d="m12 11.6l2.5 2.5q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275l-2.8-2.8q-.15-.15-.225-.337T10 11.975V8q0-.425.288-.713T11 7q.425 0 .713.288T12 8v3.6ZM18 6h-2q-.425 0-.713-.287T15 5q0-.425.288-.713T16 4h2V2q0-.425.288-.713T19 1q.425 0 .713.288T20 2v2h2q.425 0 .713.288T23 5q0 .425-.288.713T22 6h-2v2q0 .425-.288.713T19 9q-.425 0-.713-.288T18 8V6Zm-7 15q-1.875 0-3.513-.7t-2.862-1.925Q3.4 17.15 2.7 15.512T2 12q0-1.875.7-3.513t1.925-2.862Q5.85 4.4 7.488 3.7T11 3q.275 0 .513.013t.512.062q.425 0 .713.288t.287.712q0 .425-.288.713t-.712.287q-.275 0-.513-.038T11 5Q8.05 5 6.025 7.025T4 12q0 2.95 2.025 4.975T11 19q2.95 0 4.975-2.025T18 12q0-.425.288-.713T19 11q.425 0 .713.288T20 12q0 1.875-.7 3.513t-1.925 2.862Q16.15 19.6 14.512 20.3T11 21Z"/>'},Qi={width:24,height:24,body:'<path fill="currentColor" d="M9.4 19.55q-.45-.825-.788-1.713T8.05 16H5.1q.725 1.25 1.813 2.175T9.4 19.55ZM4.25 14h3.4q-.075-.5-.113-.988T7.5 12q0-.525.038-1.012T7.65 10h-3.4q-.125.5-.188.988T4 12q0 .525.063 1.012T4.25 14Zm.85-6h2.95q.225-.95.563-1.838T9.4 4.45Q8 4.9 6.912 5.825T5.1 8Zm5 0h3.8q-.3-1.1-.775-2.075T12 4.05q-.65.9-1.125 1.875T10.1 8Zm5.85 0h2.95q-.725-1.25-1.813-2.175T14.6 4.45q.45.825.788 1.713T15.95 8ZM12 22q-2.05 0-3.875-.788t-3.188-2.15q-1.362-1.362-2.15-3.187T2 12q0-2.075.788-3.888t2.15-3.174Q6.3 3.575 8.124 2.788T12 2q2.075 0 3.888.788t3.174 2.15q1.363 1.362 2.15 3.175T22 12q0 .25-.013.5t-.037.5h-2.025q.05-.25.063-.488T20 12q0-.525-.063-1.012T19.75 10h-3.4q.075.5.113.988T16.5 12v.513q0 .237-.025.487h-2q.025-.25.025-.488V12q0-.525-.038-1.012T14.35 10h-4.7q-.075.5-.113.988T9.5 12q0 .525.038 1.012T9.65 14H13v2h-2.9q.3 1.1.775 2.075T12 19.95q.275-.4.525-.813T13 18.3v3.65q-.25.025-.487.038T12 22Zm5-3.575v1.225q0 .425-.288.713T16 20.65q-.425 0-.713-.287T15 19.65V16q0-.425.288-.713T16 15h3.65q.425 0 .713.288t.287.712q0 .425-.287.713T19.65 17H18.4l2.25 2.25q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L17 18.425Z"/>'},as={width:24,height:24,body:'<path fill="currentColor" d="M2 12q-.425 0-.725-.263t-.25-.637q.175-2.125 1.1-3.975t2.4-3.212Q6 2.55 7.925 1.775T12 1q2.15 0 4.075.775t3.4 2.138q1.475 1.362 2.4 3.212t1.1 3.975q.05.375-.25.638T22 12q-.4 0-.7-.25t-.35-.65q-.35-3.45-2.9-5.775T12 3Q8.5 3 5.95 5.325T3.05 11.1q-.05.4-.35.65T2 12Zm4 0q-.425 0-.713-.275t-.237-.65q.35-2.6 2.313-4.338T12 5q2.675 0 4.638 1.738t2.312 4.337q.05.375-.238.65T18 12q-.4 0-.713-.213t-.362-.587q-.3-1.8-1.675-3T12 7q-1.875 0-3.25 1.2t-1.675 3q-.05.375-.363.588T6 12Zm6 7.4l-2.3 2.3q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l2.7-2.7v-3.3q-.675-.3-1.088-.925T9.5 12q0-1.05.725-1.775T12 9.5q1.05 0 1.775.725T14.5 12q0 .75-.413 1.375T13 14.3v3.3l2.7 2.7q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 19.4Z"/>'};function ls({data:i,verified:a=!1,...t}){return e.jsxs(g,{...t,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...t.sx},children:[e.jsxs(R,{sx:{display:"flex",alignItems:"center",color:"text.primary",fontSize:"14px",gap:1,fontWeight:500},children:[i.icon,i.title]}),e.jsxs(g,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(R,{component:"div",sx:{color:"text.secondary",whiteSpace:"pre-wrap",fontSize:"14px"},children:i.content}),a&&e.jsx(Mo,{color:"success",style:{fontSize:16,marginLeft:4}})]})]})}function cs({user:i,isMySelf:a=!1,...t}){const{locale:s}=H(),x=A((m,h={})=>Y(Q,m,s,"en",h)),w=M(()=>i?.sourceProvider&&po[i.sourceProvider]||x("unknown"),[i?.sourceProvider]),p=[];return a&&(p.push({icon:e.jsx(G,{fontSize:16,icon:rs}),title:x("lastLoginAt"),content:i?.lastLoginAt?e.jsx(He,{locale:s,value:i?.lastLoginAt,relativeRange:3*86400*1e3}):x("unknown")}),p.push({icon:e.jsx(G,{fontSize:16,icon:as}),title:x("lastLoginIp"),content:i?.lastLoginIp?e.jsx(Xo,{maxLength:20,children:i?.lastLoginIp}):x("unknown")})),p.push({icon:e.jsx(G,{fontSize:16,icon:ns}),title:x("createdAt"),content:i?.createdAt?e.jsx(He,{locale:s,value:i?.createdAt}):x("unknown")}),a&&(p.push({icon:e.jsx(G,{fontSize:16,icon:Qi}),title:x("registerFrom"),content:w}),i?.inviter&&p.push({icon:e.jsx(G,{fontSize:16,icon:Qi}),title:x("invitedBy"),content:e.jsx(Qe,{style:{maxWidth:260},did:i.inviter,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:s})})),e.jsx(g,{...t,sx:{display:"flex",flexDirection:"column",gap:1.5,...t?.sx},children:p.map(m=>e.jsx(ls,{data:m,sx:{flex:1}},m.title))})}const ds=()=>{const{componentMountPoints:i=[]}=window.blocklet||{};return i.find(a=>a.name==="did-comments")?.mountPoint};function us({user:i}){const{locale:a}=H(),t=A((w,p={})=>Y(Q,w,a,"en",p)),s=k.useMemo(()=>ds(),[]),x=A(()=>{window.open(ee(s,`/chat/dm/${i?.did}`),"_blank")});return s?e.jsxs(ue,{fullWidth:!0,variant:"outlined",color:"inherit",onClick:x,sx:{borderColor:"divider"},children:[e.jsx(G,{icon:"tabler:message-dots",style:{marginRight:4}}),t("profile.chat")]}):null}function ps({userDid:i,t:a,isMySelf:t}){const s=he(),[x,w]=k.useState(!1),p=A(async()=>{try{if(t){w(!0);return}const u=await s.user.isFollowingUser({userDid:i});w(u)}catch(u){console.error(u)}}),m=A(async(u=i)=>{if(!(t&&u===i))try{await s.user.followUser({userDid:u}),X.success(a("profile.follow_success")),p()}catch(f){console.error(f),X.error(le(f))}}),h=A(async(u=i)=>{if(!(t&&u===i))try{await s.user.unfollowUser({userDid:u}),X.success(a("profile.unfollow_success")),p()}catch(f){console.error(f),X.error(le(f))}});return k.useEffect(()=>{i&&!t&&p()},[p,i,t]),{followed:x,followUser:m,unfollowUser:h}}const go=k.createContext({followed:!1,followUser:()=>{},unfollowUser:()=>{}}),{Provider:ms}=go;function Ki({isMySelf:i,userDid:a,children:t}){const{locale:s}=H(),x=A((h,u={})=>Y(Q,h,s,"en",u)),{followed:w,followUser:p,unfollowUser:m}=ps({userDid:a,t:x,isMySelf:i});return e.jsx(ms,{value:{followed:w,followUser:p,unfollowUser:m},children:t})}function bo(){return k.useContext(go)}function hs(){const{locale:i}=H(),a=A((w,p={})=>Y(Q,w,i,"en",p)),{followed:t,followUser:s,unfollowUser:x}=bo();return e.jsx(ue,{variant:"contained",onClick:()=>t?x():s(),fullWidth:!0,children:a(t?"profile.unfollow":"profile.follow")})}function fs({user:i}){return e.jsxs(g,{sx:{display:"flex",gap:1},children:[e.jsx(us,{user:i}),e.jsx(hs,{})]})}const xs=k.lazy(()=>Se(()=>import("./metadata-B2-Ltdko.js"),__vite__mapDeps([0,1]),import.meta.url));function Xi({user:i,isMyself:a=!0,showFullDid:t=!0,switchPassport:s,switchProfile:x,isMobile:w=!1,onlyProfile:p=!1,refreshProfile:m,isShowSocialActions:h=!1,...u}){const f=he(),{locale:C}=H(),[r,d]=k.useState(void 0),n=A((c,T={})=>Y(Q,c,C,"en",T)),[o,l]=k.useState(!w||p);k.useEffect(()=>{d(i?.metadata?.status)},[i]),k.useEffect(()=>{l(!w||p)},[w,p]);const y=async c=>{if(a)try{if(c){const T=Ft(c);c.dateRange=T.length>0?T:r?.dateRange??[]}d(c),await f.user.saveProfile({metadata:{...i?.metadata??{joinedAt:i?.createdAt,email:i?.email,phone:i?.phone},status:c||{}}}),m()}catch(T){console.error(T),X.error(le(T))}},b=()=>{l(!o)},v=async c=>{if(!a)return;const{metadata:T,address:j}=c;try{const O=T?.links?.map((D,J)=>{if(!D.url||!ui(D.url)||J>0&&T.links?.slice(0,J)?.some(S=>Ut(S.url,D.url)))return null;try{return vt(D.url).protocol||(D.url=ee("https://",D.url)),D}catch{return console.error("Invalid URL:",D.url),null}}).filter(D=>!!D)||[];T.links=O,await f.user.saveProfile({metadata:T,address:j}),m()}catch(O){console.error(O),X.error(le(O))}};return e.jsxs(g,{...u,sx:{position:"relative",...u.sx??{}},children:[e.jsxs(g,{className:"user-info",sx:{display:"flex",flexDirection:w?"row":"column",gap:2},children:[e.jsxs(g,{className:"user-avatar",sx:{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(hi,{src:i?.avatar,did:i?.did,size:u.size||(w?64:100),variant:"circle",shape:"circle",sx:{borderRadius:"100%",backgroundColor:"#fff",position:"relative",overflow:"hidden",flexShrink:0,...a?{cursor:"pointer","&::after":{content:`"${n("switchProfile")}"`,color:"white",position:"absolute",fontSize:"12px",bottom:0,left:0,right:0,height:"25%",backgroundColor:"rgba(0, 0, 0, 0.3)",display:"flex",justifyContent:"center",alignItems:"center"}}:{}},onClick:a?x:ae}),e.jsx(ts,{isMobile:w,size:u.size||(w?64:100),isMyself:a,timezone:i?.metadata?.timezone||Ot,status:r,onChange:y})]}),e.jsxs(g,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(R,{variant:"h6",component:"div",sx:{flex:1,fontWeight:600,display:"flex",alignItems:"center",gap:1,fontSize:"24px !important",flexWrap:"wrap"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i?.fullName}),a?e.jsx(Gt,{user:i,switchPassport:s}):null]}),e.jsx(Qe,{did:i.did,size:16,showQrcode:!0,copyable:!0,compact:!t,responsive:!t,locale:C})]})]}),!a&&h?e.jsx(g,{sx:{mt:2},children:e.jsx(fs,{user:i})}):null,e.jsx(xs,{isMobile:w,isMyself:a,user:i,onSave:v}),a?e.jsxs(e.Fragment,{children:[e.jsx(lo,{sx:{my:w?1:3}}),w&&!p?e.jsx(g,{sx:{display:"flex",justifyContent:"center",mb:0},children:e.jsx(oe,{size:"small",onClick:b,sx:{backgroundColor:"grey.50","&:hover":{backgroundColor:"grey.50",opacity:.8}},children:o?e.jsx(Do,{}):e.jsx(zo,{})})}):null,e.jsxs(Lo,{in:o,timeout:"auto",children:[e.jsx(R,{component:"p",sx:{color:"text.secondary",fontSize:"14px",mb:2},children:n("profile.justForYou")}),e.jsx(cs,{user:i,isMySelf:a})]})]}):null]})}function gs({passport:i,user:a,color:t,width:s=150,icon:x=null,createPassportSvg:w,children:p,...m}){const{t:h}=H();return e.jsxs(g,{...m,sx:{display:"flex",alignItems:"center",...m?.sx},children:[!!i.display&&e.jsx(g,{className:"passport-item__display",sx:{width:s},children:e.jsx(xi,{address:i.id,data:i.display,imageFilter:typeof s=="number"?{imageFilter:"resize",w:s}:null})}),!i.display&&e.jsx(g,{className:"passport-item__display",dangerouslySetInnerHTML:{__html:w({title:i.scope==="kyc"?i.name:i.title,issuer:i.issuer&&i.issuer.name,issuerDid:i.issuer&&i.issuer.id,ownerName:a.fullName,ownerDid:a.did,ownerAvatarUrl:a.avatar,revoked:i.revoked,scope:i.scope,role:i.role,display:i.display,preferredColor:t,width:s})}}),e.jsxs(g,{className:"passport-item__body",sx:{p:0,ml:3,mt:0},children:[e.jsxs(g,{className:"passport-item__title",sx:{display:"flex",alignItems:"center",fontWeight:400,fontSize:"16px",lineHeight:1.1875,color:"text.primary"},children:[yt(i.title),e.jsxs(g,{className:"passport-item__status-icon",sx:{svg:{fill:"#bfbfbf",height:"1.2em",marginLeft:"0.4em"}},children:[x,i.revoked&&e.jsx(It,{})]})]}),i.expirationDate&&e.jsx(g,{className:"passport-item__title",sx:{display:"flex",alignItems:"center",fontWeight:400,fontSize:"16px",lineHeight:1.1875,color:"text.primary"},children:h("team.passport.validUntil",{date:i.expirationDate})}),p]})]})}function bs({user:i,...a}){const{locale:t}=H(),s=A((h,u={})=>Y(Q,h,t,"en",u)),x=Ro(),w=M(()=>{const h=(i?.passports||[]).map(u=>({...u,revoked:u.status===nt.REVOKED}));return h.sort((u,f)=>u.revoked===f.revoked?0:u.revoked?1:-1),Li(h.filter(u=>!u.display),"role").concat(Li(h.filter(u=>u.display),"display.content"))},[i?.passports]),p=M(()=>w?.find(h=>h.name===i.role),[w,i?.role]),m=x.palette.primary.main;return w.length===0?e.jsx(g,{children:e.jsx(pe,{children:s("noPassport")})}):e.jsx(g,{...a,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,...a.sx},children:w.map(h=>e.jsx(gs,{passport:h,user:i,color:window.blocklet.passportColor,createPassportSvg:Et,title:p&&p.role===h.role?s("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:p&&p.role===h.role?`0px 2px 4px 0px ${m}, 0px 1px 2px -1px ${m}, 0px 0px 0px 1px ${m} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},h.id))})}const ws={width:24,height:24,body:'<path fill="currentColor" d="M11 13H6q-.425 0-.713-.288T5 12q0-.425.288-.713T6 11h5V6q0-.425.288-.713T12 5q.425 0 .713.288T13 6v5h5q.425 0 .713.288T19 12q0 .425-.288.713T18 13h-5v5q0 .425-.288.713T12 19q-.425 0-.713-.288T11 18v-5Z"/>'},vs={width:24,height:24,body:'<path fill="currentColor" d="M4.4 19.425q-.5.2-.95-.088T3 18.5V14l8-2l-8-2V5.5q0-.55.45-.838t.95-.087l15.4 6.5q.625.275.625.925t-.625.925l-15.4 6.5Z"/>'},ys={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h8.925l-2 2H5v14h14v-6.95l2-2V19q0 .825-.588 1.413T19 21H5Zm7-9Zm-3 2v-2.425q0-.4.15-.763t.425-.637l8.6-8.6q.3-.3.675-.45t.75-.15q.4 0 .763.15t.662.45L22.425 3q.275.3.425.663T23 4.4q0 .375-.138.738t-.437.662l-8.6 8.6q-.275.275-.637.438t-.763.162H10q-.425 0-.713-.288T9 14Zm12.025-9.6l-1.4-1.4l1.4 1.4ZM11 13h1.4l5.8-5.8l-.7-.7l-.725-.7L11 11.575V13Zm6.5-6.5l-.725-.7l.725.7l.7.7l-.7-.7Z"/>'},js={width:24,height:24,body:'<path fill="currentColor" d="M7 21q-.825 0-1.413-.588T5 19V6q-.425 0-.713-.288T4 5q0-.425.288-.713T5 4h4q0-.425.288-.713T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6v13q0 .825-.588 1.413T17 21H7ZM17 6H7v13h10V6ZM9 17h2V8H9v9Zm4 0h2V8h-2v9ZM7 6v13V6Z"/>'};function Ji({onTest:i=ae,onDelete:a=ae,onSave:t=ae,onCancel:s=ae,type:x="slack",url:w="",edit:p=!1}){const{locale:m}=H(),h=A((o,l={})=>Y(Q,o,m,"en",l)),u=me({type:x||"slack",url:w||"",edit:p??!1,error:"",loading:!1}),f=A(()=>u.url?co(u.url)?(u.error="",!0):(u.error=h("common.invalid"),!1):(u.error=h("common.required"),!1)),C=A(()=>{u.edit=!1,u.url=w||"",u.type=x||"slack",u.error="",u.loading=!1,s()}),r=A(async o=>{u.loading=!0,await i(o),u.loading=!1}),d=A(o=>()=>{f()&&o({type:u.type,url:u.url})}),n=M(()=>u.error?e.jsx(R,{component:"span",color:"error",children:u.error}):u.edit?u.loading?e.jsx(Re,{size:16}):e.jsx(oe,{size:"small",onClick:d(r),sx:{mr:-1},children:e.jsx(G,{icon:vs})}):null,[u.error,u.edit,u.loading]);return e.jsxs(g,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Be,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!u.edit||u.loading,size:"small",value:u.type,onChange:o=>{u.type=o.target.value},children:[e.jsx(ze,{value:"api",children:h("webhook.url")}),e.jsx(ze,{value:"slack",children:h("webhook.slack")})]}),e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(ao,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!u.edit||u.loading,fullWidth:!0,size:"small",required:!0,value:u.url,onChange:o=>{u.url=o.target.value,f()},error:!!u.error,slotProps:{input:{endAdornment:e.jsx(_o,{position:"end",children:n})}}}),e.jsx(g,{sx:{display:"flex",gap:.5},children:u.edit?e.jsxs(e.Fragment,{children:[e.jsx(oe,{color:"success",onClick:d((...o)=>{t(...o),u.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:at})}),e.jsx(oe,{color:"error",onClick:C,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:lt})})]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{onClick:()=>{u.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:ys})}),e.jsx(oe,{color:"error",onClick:()=>{a({type:u.type,url:u.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(G,{icon:js})})]})})]})]})}function si({title:i=void 0,description:a=void 0,value:t,onChange:s,isMobile:x}){const w=A(p=>{p.stopPropagation()});return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(xo,{checked:t,size:"small",onChange:s}),e.jsxs(R,{component:"div",onClick:w,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:x?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:x?"normal":"nowrap"},children:[i,a]})]})}function ks({user:i,isMobile:a}){const{locale:t}=H(),s=he(),x=A((o,l={})=>Y(Q,o,t,"en",l)),w=me({showAdd:!1}),p=Le(async()=>await s.user.getUserNotificationConfig(),{refreshDeps:[i],loadingDelay:300}),m=M(()=>({wallet:!0,email:!0,phone:!1,push:!0,...p?.data?.notifications||{}}),[p?.data?.notifications]),h=M(()=>p?.data?.webhooks||[],[p?.data?.webhooks]),u=A(async o=>{try{await s.user.saveUserNotificationConfig(o),X.success(x("saveSuccess")),p.run()}catch(l){X.error(le(l))}}),f=A(async(o,l)=>{await u({notifications:{[o]:l}})}),C=async o=>{try{await s.user.testNotificationWebhook(o),X.success(x("webhookTested"))}catch(l){X.error(le(l))}},r=A(async o=>{await u({webhooks:h.filter((l,y)=>y!==o)})}),d=A(async(o,l)=>{await u({webhooks:h.map((y,b)=>b===o?l:y)})}),n=A(async o=>{await u({webhooks:[...h,o]}),w.showAdd=!1});return p.error?e.jsx(No,{severity:"error",children:p.error.message}):p.loading||!p.data?e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Re,{})}):e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(g,{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(si,{value:m.wallet,isMobile:a,title:x("walletNotification"),onChange:o=>f("wallet",o.target.checked),description:zi(i)&&e.jsx(Qe,{did:zi(i),showQrcode:!1,showAvatar:!a,copyable:!0,compact:!0,responsive:!0,locale:t,startChars:a?2:6})}),e.jsx(si,{value:m.email,isMobile:a,onChange:o=>f("email",o.target.checked),title:x("emailNotification"),description:i?.email&&e.jsx(R,{component:"span",sx:{color:"text.secondary",fontSize:13},children:i?.email})}),e.jsx(si,{isMobile:a,value:m.push,title:x("pushNotification"),onChange:o=>f("push",o.target.checked)})]}),e.jsxs(mi,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[h.map((o,l)=>e.jsx(Ji,{onTest:C,onDelete:()=>r(l),onSave:(...y)=>d(l,...y),type:o.type,url:o.url,edit:!1},`${l}_${o.url}`)),w.showAdd&&e.jsx(Ji,{onTest:C,onCancel:()=>{w.showAdd=!1},onSave:(...o)=>n(...o),edit:!0},"add"),e.jsx(fi,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(G,{icon:ws}),onClick:()=>{w.showAdd=!0},children:x("addWebhook")})]})]})}function Ss({configList:i,onSave:a}){const t=he(),[s,x]=k.useState(i),{locale:w}=H(),p=A((h,u={})=>Y(Q,h,w,"en",u)),m=A(async(h,u)=>{try{const f=await t.user.saveUserPrivacyConfig({[h]:!u});x(s.map(C=>({...C,value:f?.[C.key]??C.value}))),X.success(p("saveSuccess")),a("privacy")}catch(f){X.error(le(f))}});return e.jsx(g,{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(h=>h.isPrivate?null:e.jsx(xo,{checked:!h.value,labelProps:{label:e.jsx(R,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:p("toPublic",{name:h.name})})},size:"small",onChange:u=>m(h.key,u.target.checked)},h.key))})}var De={exports:{}},Ts=De.exports,eo;function Cs(){return eo||(eo=1,(function(i,a){(function(t,s){var x="1.0.41",w="",p="?",m="function",h="undefined",u="object",f="string",C="major",r="model",d="name",n="type",o="vendor",l="version",y="architecture",b="console",v="mobile",c="tablet",T="smarttv",j="wearable",O="embedded",D=500,J="Amazon",S="Apple",z="ASUS",$="BlackBerry",U="Browser",fe="Chrome",Ke="Edge",be="Firefox",xe="Google",Te="Honor",Ce="Huawei",Xe="Lenovo",we="LG",Pe="Microsoft",ve="Motorola",ge="Nvidia",Ae="OnePlus",ce="Opera",ye="OPPO",de="Samsung",q="Sharp",_="Sony",W="Xiaomi",re="Zebra",wi="Facebook",vi="Chromium OS",yi="Mac OS",ji=" Browser",yo=function(L,N){var I={};for(var F in L)N[F]&&N[F].length%2===0?I[F]=N[F].concat(L[F]):I[F]=L[F];return I},Ee=function(L){for(var N={},I=0;I<L.length;I++)N[L[I].toUpperCase()]=L[I];return N},ki=function(L,N){return typeof L===f?Ie(N).indexOf(Ie(L))!==-1:!1},Ie=function(L){return L.toLowerCase()},jo=function(L){return typeof L===f?L.replace(/[^\d\.]/g,w).split(".")[0]:s},Je=function(L,N){if(typeof L===f)return L=L.replace(/^\s\s*/,w),typeof N===h?L:L.substring(0,D)},qe=function(L,N){for(var I=0,F,ne,te,E,P,se;I<N.length&&!P;){var ei=N[I],Ci=N[I+1];for(F=ne=0;F<ei.length&&!P&&ei[F];)if(P=ei[F++].exec(L),P)for(te=0;te<Ci.length;te++)se=P[++ne],E=Ci[te],typeof E===u&&E.length>0?E.length===2?typeof E[1]==m?this[E[0]]=E[1].call(this,se):this[E[0]]=E[1]:E.length===3?typeof E[1]===m&&!(E[1].exec&&E[1].test)?this[E[0]]=se?E[1].call(this,se,E[2]):s:this[E[0]]=se?se.replace(E[1],E[2]):s:E.length===4&&(this[E[0]]=se?E[3].call(this,se.replace(E[1],E[2])):s):this[E]=se||s;I+=2}},Me=function(L,N){for(var I in N)if(typeof N[I]===u&&N[I].length>0){for(var F=0;F<N[I].length;F++)if(ki(N[I][F],L))return I===p?s:I}else if(ki(N[I],L))return I===p?s:I;return N.hasOwnProperty("*")?N["*"]:L},ko={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Si={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ti={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,l],[/opios[\/ ]+([\w\.]+)/i],[l,[d,ce+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[l,[d,ce+" GX"]],[/\bopr\/([\w\.]+)/i],[l,[d,ce]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[l,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[l,[d,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,l],[/quark(?:pc)?\/([-\w\.]+)/i],[l,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[l,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[d,"UC"+U]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[l,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[l,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[l,[d,"Smart Lenovo "+U]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+U],l],[/\bfocus\/([\w\.]+)/i],[l,[d,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[l,[d,ce+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[d,ce+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[d,"MIUI"+ji]],[/fxios\/([\w\.-]+)/i],[l,[d,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[l,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],l],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+ji],l],[/samsungbrowser\/([\w\.]+)/i],[l,[d,de+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[l,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,l],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[l,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,wi],l],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[l,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[d,fe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,fe+" WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[d,"Android "+U]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,l],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[l,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[l,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[l,Me,ko]],[/(webkit|khtml)\/([\w\.]+)/i],[d,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],l],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[d,be+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[d,[l,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[l,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[y,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[y,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[y,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[y,/ower/,w,Ie]],[/ sun4\w[;\)]/i],[[y,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[y,Ie]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[r,[o,de],[n,c]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[r,[o,de],[n,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[r,[o,S],[n,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[r,[o,S],[n,c]],[/(macintosh);/i],[r,[o,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[r,[o,q],[n,v]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[r,[o,Te],[n,c]],[/honor([-\w ]+)[;\)]/i],[r,[o,Te],[n,v]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[r,[o,Ce],[n,c]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[r,[o,Ce],[n,v]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[r,/_/g," "],[o,W],[n,c]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[r,/_/g," "],[o,W],[n,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[r,[o,ye],[n,v]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[r,[o,Me,{OnePlus:["304","403","203"],"*":ye}],[n,c]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[r,[o,"Vivo"],[n,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[r,[o,"Realme"],[n,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[r,[o,ve],[n,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[r,[o,ve],[n,c]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[r,[o,we],[n,c]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[r,[o,we],[n,v]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[r,[o,Xe],[n,c]],[/(nokia) (t[12][01])/i],[o,r,[n,c]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[r,/_/g," "],[n,v],[o,"Nokia"]],[/(pixel (c|tablet))\b/i],[r,[o,xe],[n,c]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[r,[o,xe],[n,v]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[r,[o,_],[n,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[r,"Xperia Tablet"],[o,_],[n,c]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[r,[o,Ae],[n,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[r,[o,J],[n,c]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[r,/(.+)/g,"Fire Phone $1"],[o,J],[n,v]],[/(playbook);[-\w\),; ]+(rim)/i],[r,o,[n,c]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[r,[o,$],[n,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[r,[o,z],[n,c]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[r,[o,z],[n,v]],[/(nexus 9)/i],[r,[o,"HTC"],[n,c]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[o,[r,/_/g," "],[n,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[r,[o,"TCL"],[n,c]],[/(itel) ((\w+))/i],[[o,Ie],r,[n,Me,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[r,[o,"Acer"],[n,c]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[r,[o,"Meizu"],[n,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[r,[o,"Ulefone"],[n,v]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[r,[o,"Energizer"],[n,v]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[r,[o,"Cat"],[n,v]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[r,[o,"Smartfren"],[n,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[r,[o,"Nothing"],[n,v]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[r,[o,"Archos"],[n,c]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[r,[o,"Archos"],[n,v]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[o,r,[n,c]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[o,r,[n,v]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[o,r,[n,c]],[/(surface duo)/i],[r,[o,Pe],[n,c]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[r,[o,"Fairphone"],[n,v]],[/(u304aa)/i],[r,[o,"AT&T"],[n,v]],[/\bsie-(\w*)/i],[r,[o,"Siemens"],[n,v]],[/\b(rct\w+) b/i],[r,[o,"RCA"],[n,c]],[/\b(venue[\d ]{2,7}) b/i],[r,[o,"Dell"],[n,c]],[/\b(q(?:mv|ta)\w+) b/i],[r,[o,"Verizon"],[n,c]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[r,[o,"Barnes & Noble"],[n,c]],[/\b(tm\d{3}\w+) b/i],[r,[o,"NuVision"],[n,c]],[/\b(k88) b/i],[r,[o,"ZTE"],[n,c]],[/\b(nx\d{3}j) b/i],[r,[o,"ZTE"],[n,v]],[/\b(gen\d{3}) b.+49h/i],[r,[o,"Swiss"],[n,v]],[/\b(zur\d{3}) b/i],[r,[o,"Swiss"],[n,c]],[/\b((zeki)?tb.*\b) b/i],[r,[o,"Zeki"],[n,c]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[o,"Dragon Touch"],r,[n,c]],[/\b(ns-?\w{0,9}) b/i],[r,[o,"Insignia"],[n,c]],[/\b((nxa|next)-?\w{0,9}) b/i],[r,[o,"NextBook"],[n,c]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[o,"Voice"],r,[n,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[o,"LvTel"],r,[n,v]],[/\b(ph-1) /i],[r,[o,"Essential"],[n,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[r,[o,"Envizen"],[n,c]],[/\b(trio[-\w\. ]+) b/i],[r,[o,"MachSpeed"],[n,c]],[/\btu_(1491) b/i],[r,[o,"Rotor"],[n,c]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[r,[o,ge],[n,c]],[/(sprint) (\w+)/i],[o,r,[n,v]],[/(kin\.[onetw]{3})/i],[[r,/\./g," "],[o,Pe],[n,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[r,[o,re],[n,c]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[r,[o,re],[n,v]],[/smart-tv.+(samsung)/i],[o,[n,T]],[/hbbtv.+maple;(\d+)/i],[[r,/^/,"SmartTV"],[o,de],[n,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[o,we],[n,T]],[/(apple) ?tv/i],[o,[r,S+" TV"],[n,T]],[/crkey/i],[[r,fe+"cast"],[o,xe],[n,T]],[/droid.+aft(\w+)( bui|\))/i],[r,[o,J],[n,T]],[/(shield \w+ tv)/i],[r,[o,ge],[n,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[r,[o,q],[n,T]],[/(bravia[\w ]+)( bui|\))/i],[r,[o,_],[n,T]],[/(mi(tv|box)-?\w+) bui/i],[r,[o,W],[n,T]],[/Hbbtv.*(technisat) (.*);/i],[o,r,[n,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[o,Je],[r,Je],[n,T]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[r,[n,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[n,T]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[o,r,[n,b]],[/droid.+; (shield)( bui|\))/i],[r,[o,ge],[n,b]],[/(playstation \w+)/i],[r,[o,_],[n,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[r,[o,Pe],[n,b]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[r,[o,de],[n,j]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[o,r,[n,j]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[r,[o,ye],[n,j]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[r,[o,S],[n,j]],[/(opwwe\d{3})/i],[r,[o,Ae],[n,j]],[/(moto 360)/i],[r,[o,ve],[n,j]],[/(smartwatch 3)/i],[r,[o,_],[n,j]],[/(g watch r)/i],[r,[o,we],[n,j]],[/droid.+; (wt63?0{2,3})\)/i],[r,[o,re],[n,j]],[/droid.+; (glass) \d/i],[r,[o,xe],[n,j]],[/(pico) (4|neo3(?: link|pro)?)/i],[o,r,[n,j]],[/; (quest( \d| pro)?)/i],[r,[o,wi],[n,j]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[o,[n,O]],[/(aeobc)\b/i],[r,[o,J],[n,O]],[/(homepod).+mac os/i],[r,[o,S],[n,O]],[/windows iot/i],[[n,O]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[r,[n,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[r,[n,c]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[n,c]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[n,v]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[r,[o,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[d,Ke+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[d,l],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,l],[/ladybird\//i],[[d,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,l],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[d,[l,Me,Si]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,Me,Si],[d,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,yi],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[l,d],[/(ubuntu) ([\w\.]+) like android/i],[[d,/(.+)/,"$1 Touch"],l],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[d,l],[/\(bb(10);/i],[l,[d,$]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[l,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[d,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[l,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[l,[d,fe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,vi],l],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,l],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,l]]},ie=function(L,N){if(typeof L===u&&(N=L,L=s),!(this instanceof ie))return new ie(L,N).getResult();var I=typeof t!==h&&t.navigator?t.navigator:s,F=L||(I&&I.userAgent?I.userAgent:w),ne=I&&I.userAgentData?I.userAgentData:s,te=N?yo(Ti,N):Ti,E=I&&I.userAgent==F;return this.getBrowser=function(){var P={};return P[d]=s,P[l]=s,qe.call(P,F,te.browser),P[C]=jo(P[l]),E&&I&&I.brave&&typeof I.brave.isBrave==m&&(P[d]="Brave"),P},this.getCPU=function(){var P={};return P[y]=s,qe.call(P,F,te.cpu),P},this.getDevice=function(){var P={};return P[o]=s,P[r]=s,P[n]=s,qe.call(P,F,te.device),E&&!P[n]&&ne&&ne.mobile&&(P[n]=v),E&&P[r]=="Macintosh"&&I&&typeof I.standalone!==h&&I.maxTouchPoints&&I.maxTouchPoints>2&&(P[r]="iPad",P[n]=c),P},this.getEngine=function(){var P={};return P[d]=s,P[l]=s,qe.call(P,F,te.engine),P},this.getOS=function(){var P={};return P[d]=s,P[l]=s,qe.call(P,F,te.os),E&&!P[d]&&ne&&ne.platform&&ne.platform!="Unknown"&&(P[d]=ne.platform.replace(/chrome os/i,vi).replace(/macos/i,yi)),P},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return F},this.setUA=function(P){return F=typeof P===f&&P.length>D?Je(P,D):P,this},this.setUA(F),this};ie.VERSION=x,ie.BROWSER=Ee([d,l,C]),ie.CPU=Ee([y]),ie.DEVICE=Ee([r,o,n,b,v,T,c,j,O]),ie.ENGINE=ie.OS=Ee([d,l]),i.exports&&(a=i.exports=ie),a.UAParser=ie;var je=typeof t!==h&&(t.jQuery||t.Zepto);if(je&&!je.ua){var Oe=new ie;je.ua=Oe.getResult(),je.ua.get=function(){return Oe.getUA()},je.ua.set=function(L){Oe.setUA(L);var N=Oe.getResult();for(var I in N)je.ua[I]=N[I]}}})(typeof window=="object"?window:Ts)})(De,De.exports)),De.exports}var Ps=Cs();const ri=Ho(Ps);function As({user:i,sessionUser:a}){const t=M(()=>(i?.passports||[])?.find(s=>s.name===a.role),[i?.passports,a?.role]);return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(hi,{size:40,variant:"circle",shape:"circle",src:a.avatar,did:a.did,sx:{flexShrink:0}}),e.jsxs(g,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ke,{title:a.fullName,children:e.jsx(R,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:a.fullName})}),e.jsx(no,{label:t?.title||t?.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(ke,{title:a.email,children:e.jsx(R,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.email})})]})]})}const Is={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有{type}会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有{type}会话",logoutAllSessionConfirm:"确定要注销所有{type}会话吗?",online:"活跃"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all {type} sessions",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all {type} sessions",logoutAllSessionConfirm:"Are you sure to logout all {type} sessions?",online:"Active"}},wo="Reserved IP",io="ip-region-cache";async function qs(i){const a=`https://ipapi.co/${i}/json/`,t=await(await fetch(a)).json();let s="";return t.error?t.reserved&&(s=wo):s=[t.country_name,t.region,t.city].filter(Boolean).join("/"),s}async function Ms(i){const a=`https://api.ip.sb/geoip/${i}`,t=await(await fetch(a)).json();let s="";return t.error?t.reserved&&(s=wo):s=[t.country,t.region,t.city].filter(Boolean).join("/"),s}async function Ds(i){let a="",t={};try{const s=localStorage.getItem(io);s&&(t=JSON.parse(s))}catch{t={}}if(t[i])a=t[i];else{try{a=await Ms(i)}catch{console.warn("Fail to get ip region from ip.sb")}if(!a)try{a=await qs(i)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(a){const s=Object.keys(t);s.length>100&&delete t[s[0]],t[i]&&delete t[i],t[i]=a,localStorage.setItem(io,JSON.stringify(t))}return a}const oo=i=>new ri(i,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ri.BROWSER.NAME,ri.BROWSER.VERSION]]}).getResult(),to={display:"flex",justifyContent:"flex-end",textAlign:"right"},zs=new Jo({concurrency:1}),Ls=k.memo(({userSession:i,isMobile:a=!1})=>{const t=me({loading:!0,ipRegion:""}),{t:s}=H();return k.useEffect(()=>{zs.add(async()=>{try{t.ipRegion=await Ds(i.lastLoginIp)}finally{t.loading=!1}})},[t,i.lastLoginIp]),e.jsx(g,{...a&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:t.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(R,{variant:"body2",children:t.ipRegion}),e.jsx(R,{variant:"body2",color:"grey",children:i.lastLoginIp||s("unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:i.lastLoginIp||s("unknown")}),t.loading?e.jsx(R,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Re,{size:12,color:"inherit"})}):null]})})});function Rs({user:i,showAction:a=!0,showUser:t=!0,getUserSessions:s,showOffline:x=!1,showAppPid:w=!1}){const p=he(),m=me({status:"online",page:1,pageSize:10}),h=me({online:0,expired:0,offline:0}),u=ct(),{locale:f}=H(),C=gi({key:"md"}),r=Eo(S=>S.breakpoints.down("lg")),{confirmApi:d,confirmHolder:n}=Ye(),o=A((S,z={})=>Y(Is,S,f,"en",z)),l=A(async()=>{const S=await s({page:m.page,pageSize:m.pageSize,status:m.status}),z=S?.paging?.total||0;return h[m.status]=z,{total:z,list:S?.list||[]}});Go(async()=>{const S=await s({page:1,pageSize:1,status:"expired"});h.expired=S?.paging?.total||0;const z=await s({page:1,pageSize:1,status:"offline"});h.offline=z?.paging?.total||0});const y=Le(l,{refreshDeps:[m.status,m.page,m.pageSize]}),b=M(()=>y.data?.list||[],[y.data?.list]),v=M(()=>{const S=m.status;return S==="online"?h[S]<=1:h[S]===0},[b,u]),c=M(()=>ci({},C?to:{}),[C]),T=A(({visitorId:S})=>{d.open({title:o("logoutThisSession"),content:o("logoutThisSessionConfirm"),confirmButtonText:o("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("cancel"),onConfirm:async()=>{await p.user.logout({visitorId:S,includeFederated:!0});const{page:z=0}=m,{list:$=[]}=y.data||{},U=$.length||0;z>1&&U===1&&(m.page=Math.max(z-1,1)),y.refresh(),d.close()}})}),j=A(()=>{d.open({title:o("logoutAllSession",{type:o(m.status)}),content:o("logoutAllSessionConfirm",{type:o(m.status)}),confirmButtonText:o("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("cancel"),onConfirm:async()=>{await p.user.logout({status:m.status,visitorId:u,includeFederated:!0}),m.page=1,y.refresh(),d.close()}})}),O=[];a&&O.push(e.jsx(ke,{title:o("logoutAllTips",{type:o(m.status)}),children:e.jsx(ue,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:j,disabled:v,children:o("logoutAll",{type:o(m.status)})})},"logoutAll"));const D=M(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:m.page-1,rowsPerPage:m.pageSize,count:y.data?.total||0}),[y.data?.total,m.page,m.pageSize]),J=[{label:o("platform"),name:"platform",options:{customBodyRenderLite:S=>{const z=b[S],$=oo(z?.ua);return e.jsx(g,{sx:c,children:[$.os?.name,$.os?.version].filter(Boolean).join("/")||o("unknown")})}}},{label:o("deviceType"),name:"deviceType",options:{customBodyRenderLite:S=>{const z=b[S],$=oo(z?.ua);return e.jsx(g,{sx:c,children:[$.browser?.name,$.browser?.version].filter(Boolean).join("/")||o("unknown")})}}},{label:o("walletOS"),name:"walletOS",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:z.extra?.walletOS||o("unknown")})}}},w&&{label:"App Pid",name:"appPid",options:{customBodyRenderLite:S=>{const z=b[S];return z.appPid?e.jsx(Qe,{size:14,responsive:!1,compact:!0,did:z.appPid}):null}}},t&&{label:o("user"),name:"user",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:ci({minWidth:150,maxWidth:250},C?to:{}),children:e.jsx(As,{sessionUser:z.user,user:i})})}}},{label:o("createdAt"),name:"createdAt",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:z.createdAt?e.jsx(He,{value:z.createdAt,relativeRange:3*86400*1e3,locale:f}):o("unknown")})}}},!x&&{label:o("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:z.status==="expired"?o("expired"):e.jsx(He,{value:z.updatedAt,relativeRange:3*86400*1e3,locale:f})})}}},{label:o("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(Ls,{userSession:z,isMobile:C})}}},a&&{label:o("actions"),name:"actions",options:{customBodyRenderLite:S=>{const z=b[S];return e.jsx(g,{sx:c,children:e.jsx(ue,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:u===z.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>T({visitorId:z.visitorId}),children:z.status==="expired"?o("remove"):u===z.visitorId?o("currentSession"):o("logout")})})}}}].filter(Boolean);return e.jsxs(g,{className:"pc-user-sessions",sx:{maxWidth:C?"unset":r?"calc(100vw - 300px)":"100%",...C&&{".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:S=>`${S.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...C&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[n,e.jsx(dt,{count:y.data?.total||0,locale:f,data:b,columns:J,customButtons:O,options:D,loading:y.loading,className:"pc-user-sessions-table",title:e.jsxs(Oo,{row:!0,sx:{lineHeight:1,ml:1},onChange:S=>{m.status=S.target.value},children:[e.jsx(ii,{value:"online",control:e.jsx(oi,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="online"}),label:e.jsxs(R,{sx:{display:"flex",alignItems:"center"},children:[o("online"),e.jsxs(R,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",h.online,")"]})]})}),e.jsx(ii,{value:"expired",control:e.jsx(oi,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="expired"}),label:e.jsxs(R,{sx:{display:"flex",alignItems:"center"},children:[o("expired"),e.jsxs(R,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",h.expired,")"]})]})}),x?e.jsx(ii,{value:"offline",control:e.jsx(oi,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="offline"}),label:e.jsxs(R,{sx:{display:"flex",alignItems:"center"},children:[o("offline"),e.jsxs(R,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",h.offline,")"]})]})}):null]}),onChange:S=>{m.page=S.page+1,m.pageSize=S.rowsPerPage}})]})}const _s={width:24,height:24,body:'<path fill="currentColor" d="M7 17q-2.075 0-3.538-1.463T2 12q0-2.075 1.463-3.538T7 7h3q.425 0 .713.288T11 8q0 .425-.288.713T10 9H7q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15h3q.425 0 .713.288T11 16q0 .425-.288.713T10 17H7Zm2-4q-.425 0-.713-.288T8 12q0-.425.288-.713T9 11h6q.425 0 .713.288T16 12q0 .425-.288.713T15 13H9Zm5 4q-.425 0-.713-.288T13 16q0-.425.288-.713T14 15h3q1.25 0 2.125-.875T20 12q0-1.25-.875-2.125T17 9h-3q-.425 0-.713-.288T13 8q0-.425.288-.713T14 7h3q2.075 0 3.538 1.463T22 12q0 2.075-1.463 3.538T17 17h-3Z"/>'},Ns={width:24,height:24,body:'<path fill="currentColor" d="M3 20v-2.8q0-.85.438-1.563T4.6 14.55q1.55-.775 3.15-1.163T11 13q.5 0 1 .038t1 .112q-.1 1.45.525 2.738T15.35 18v2H3Zm16 3l-1.5-1.5v-4.65q-1.1-.325-1.8-1.238T15 13.5q0-1.45 1.025-2.475T18.5 10q1.45 0 2.475 1.025T22 13.5q0 1.125-.638 2t-1.612 1.25L21 18l-1.5 1.5L21 21l-2 2Zm-8-11q-1.65 0-2.825-1.175T7 8q0-1.65 1.175-2.825T11 4q1.65 0 2.825 1.175T15 8q0 1.65-1.175 2.825T11 12Zm7.5 2q.425 0 .713-.288T19.5 13q0-.425-.288-.713T18.5 12q-.425 0-.713.288T17.5 13q0 .425.288.713T18.5 14Z"/>'},Es={width:24,height:24,body:'<path fill="currentColor" d="M2 20V4h20v16H2ZM4 8h16V6H4v2Zm11.775 6.075L20 10.525V10H4v1.225l11.775 2.85Z"/>'},Os={width:256,height:250,body:'<path fill="#161614" d="M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39c-.929-.417-1.45-1.284-1.15-1.922c.276-.655 1.279-.838 2.205-.399c.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591c-.837-.892-.994-2.086-.375-2.66c.63-.566 1.787-.301 2.626.591c.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104c-.784-1.138-.784-2.503.017-3.05c.795-.547 2.058-.055 2.861 1.075c.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49c-1.119-1.032-1.43-2.496-.726-3.27c.71-.776 2.213-.558 3.315.49c1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033c-1.448-.439-2.395-1.613-2.103-2.626c.301-1.01 1.747-1.484 3.207-1.028c1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95c-1.53.034-2.769-.82-2.786-1.86c0-1.065 1.202-1.932 2.733-1.958c1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37c-1.485.271-2.861-.365-3.05-1.386c-.184-1.056.893-2.114 2.376-2.387c1.514-.263 2.868.356 3.061 1.403Z"/>'};function ni({item:i}){const{blocklet:a}=qt(),{confirmApi:t,confirmHolder:s}=Ye(),x=me({loading:!1}),{locale:w}=H(),p=A((b,v={})=>Y(Q,b,w,"en",v)),{session:m}=k.use(_e),{bindOAuth:h,unbindOAuth:u,setBaseUrl:f,baseUrl:C}=m.useOAuth(),{disconnectPasskey:r,setTargetAppPid:d}=m.usePasskey(),n={[B.AUTH0]:ut,[B.APPLE]:zt,[B.GITHUB]:Os,[B.GOOGLE]:Dt,[B.PASSKEY]:Ns,[B.WALLET]:Es},o=M(()=>n[i?.provider],[i?.provider]),l=M(()=>po[i?.provider]||"unknown",[i?.provider]),y=A(async()=>{if(i?.provider===B.PASSKEY){await new Promise((b,v)=>{t.open({title:p("thirdPartyLogin.disconnectPasskey",{name:l}),content:p("thirdPartyLogin.disconnectPasskeyDescription",{name:l}),confirmButtonText:p("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:p("common.cancel"),onConfirm(c){r({session:m,connectedAccount:i}).then(b).catch(v),c()},onCancel:b})});return}try{x.loading=!0,await new Promise((b,v)=>{if(i?._bind)t.open({title:p("thirdPartyLogin.confirmUnbind",{name:l}),content:p("thirdPartyLogin.confirmUnbindDescription",{name:l}),confirmButtonText:p("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:p("common.cancel"),onConfirm(c){u({session:m,connectedAccount:{...jt(i,["did","pk"]),showProvider:i.provider,provider:i._rawProvider}}).then(b).catch(v),c()},onCancel:b});else{const c=C,T=window?.blocklet;let j="/";const O=pt(T),D=mt(T);O&&D?.appPid&&m?.user?.sourceAppPid&&(j=D.appUrl),f(j),d(a?.appPid),h({session:m,oauthItem:{...i,provider:i._rawProvider}}).then(b).catch(v).finally(()=>{f(c),d()})}})}catch(b){console.error(`Failed to ${i?._bind?"unbind":"bind"} oauth account`,b)}finally{x.loading=!1}});return e.jsxs(e.Fragment,{children:[e.jsxs(g,{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(g,{component:G,icon:o,fill:"currentColor",sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:b})=>i?.provider===B.GITHUB&&b.mode==="dark"?"invert(1)":"none"}}),e.jsx(g,{sx:{flex:1},children:l}),e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(g,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:i.userInfo?.email||i.did}),i.userInfo?.name?e.jsx(ke,{title:e.jsx(e.Fragment,{children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(hi,{size:36,variant:"circle",shape:"circle",src:i.userInfo?.picture,did:i.did}),e.jsxs(g,{children:[e.jsx(R,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:i.userInfo?.name}),e.jsx(R,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:i.userInfo?.email})]})]})}),children:e.jsx(g,{component:G,icon:Mt,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]})]}),e.jsx(ke,{title:i._mainProvider?p("thirdPartyLogin.mainProviderCantRemove"):"",children:e.jsx(g,{children:e.jsx(fi,{variant:"outlined",size:"small",sx:b=>{const v=b.palette.error.main,c=b.palette.primary.main;return{color:i?._bind?v:c,borderColor:i?._bind?v:c,backgroundColor:"background.default","&:hover":{borderColor:i?._bind?v:c,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:x.loading?null:e.jsx(G,{icon:_s}),onClick:y,disabled:i._mainProvider,loading:x.loading,children:i?._bind?p("thirdPartyLogin.disconnect"):p("thirdPartyLogin.connect")})})}),s]})}function $s({user:i}){const{session:a}=k.use(_e),[t,s]=k.useState({}),{getOAuthConfigs:x}=a.useOAuth(),w=mo();Yo(async()=>{const f=await x({sourceAppPid:i?.sourceAppPid});s(f)},[i?.sourceAppPid]);const p=M(()=>Object.keys(t).map(f=>({...t[f],provider:f})).filter(f=>f.enabled),[t]),m=M(()=>{const f=ti(i);let C=!1,r="",d=ht(i);const n=f.find(o=>o.provider===B.AUTH0);return n&&(n.id.startsWith("google-oauth2|")&&(f.some(o=>o.provider==="google")||(C=!0,r=B.GOOGLE,d===B.AUTH0&&(d=B.GOOGLE))),n.id.startsWith("appleid|")&&(f.some(o=>o.provider===B.APPLE)||(C=!0,r=B.APPLE,d===B.AUTH0&&(d=B.APPLE))),n.id.startsWith("github|")&&(f.some(o=>o.provider===B.GITHUB)||(C=!0,r=B.GITHUB,d===B.AUTH0&&(d=B.GITHUB)))),p.map(o=>{if(o.provider===B.AUTH0&&C)return null;const l=C&&o.provider===r?f.find(y=>y.provider===B.AUTH0):f.find(y=>y.provider===o.provider);return l?{...o,provider:o.provider,did:l.did,pk:l.pk,userInfo:l.userInfo,_bind:!0,_rawProvider:l.provider,_mainProvider:o.provider===d}:{...o,provider:o.provider,_rawProvider:o.provider,_mainProvider:o.provider===d}}).filter(Boolean).sort((o,l)=>o?.order!==void 0&&l?.order!==void 0?o.order-l.order:o?.order!==void 0?-1:1)},[i?.connectedAccounts,p]),h=M(()=>ti(i).filter(f=>f.provider===B.PASSKEY&&f.did!==i?.did).map(f=>({...f,_bind:!0})),[i]),u=M(()=>ti(i).filter(f=>f.provider===B.WALLET&&f.did!==i?.did).map(f=>({...f,_mainProvider:!0})),[i]);return e.jsx(g,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:!m.length&&!h.length&&!u.length?e.jsx(Ei,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add Passkey",onSuccess:ae,onError:ae,dense:!0}):e.jsxs(e.Fragment,{children:[m.map(f=>e.jsx(ni,{item:f},f?.provider)),h.map(f=>e.jsx(ni,{item:f},f.id)),u.map(f=>e.jsx(ni,{item:f},f.id)),w.wallet||w.arcSphere?null:e.jsx(Ei,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:ae,onError:ae,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})})}const Us=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function Fs({user:i,onSave:a}){const{locale:t,changeLocale:s}=H(),x=he(),w=A((h,u={})=>Y(Q,h,t,"en",u)),p=me({locale:i.locale,loading:!1}),m=A(async h=>{try{const{value:u}=h.target;p.loading=!0,await x.user.saveProfile({locale:u}),await a("profile"),s(u),p.locale=u}catch(u){X.error(le(u))}finally{p.loading=!1}});return e.jsxs(g,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(g,{children:w("commonSetting.locale")}),e.jsxs(g,{children:[p.loading?e.jsx($o,{color:"primary",sx:{height:2}}):e.jsx(g,{sx:{height:2,visibility:"hidden"}}),e.jsx(Be,{value:p.locale,onChange:m,size:"small",IconComponent:h=>e.jsx(di,{...h,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Us).map(h=>e.jsx(ze,{value:h.code,children:h.name},h.code))})]})]})}function Ws({onDestroySelf:i=void 0}){const{confirmHolder:a}=Ye(),{locale:t}=H(),{session:s}=k.use(_e),x=A((p,m={})=>Y(Q,p,t,"en",m)),w=A(async()=>{if(!i||typeof i!="function")return;const p=s.withSecondaryAuth(i,{extraParams:{locale:t,removeUserDid:s?.user?.did,input:{user:{did:s?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await p(),s.logout()}catch(m){X.error(m?.message||x("destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(g,{children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(g,{children:[e.jsx(R,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:x("dangerZone.deleteAccount")}),e.jsx(R,{variant:"caption",sx:{color:"text.secondary"},children:x("dangerZone.deleteAccountDescription")})]}),e.jsx(ue,{variant:"contained",color:"error",size:"small",onClick:w,children:x("dangerZone.delete")})]})}),a]})}function Bs({user:i,settings:a,onSave:t,isMobile:s,...x}){const w=he(),{locale:p}=H(),m=mo().arcSphere,h=A((r,d={})=>Y(Q,r,p,"en",d)),u=M(()=>i.passports?.some(r=>r.role===uo.ROLES.OWNER),[i]),f=M(()=>(a?.userCenterTabs||[]).map(r=>({key:r.value,name:r.label,value:r.protected,isPrivate:r.isPrivate})),[a?.userCenterTabs]),C=M(()=>[m?void 0:{label:h("commonSetting.title"),value:"common",content:e.jsx(Fs,{user:i,onSave:t})},{label:h("notificationManagement"),value:"notification",content:e.jsx(ks,{user:i,isMobile:s})},{label:h("thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx($s,{user:i})},{label:h("privacyManagement"),value:"privacy",content:e.jsx(Ss,{configList:f,onSave:t})},{label:h("sessionManagement"),value:"session",content:e.jsx(Rs,{user:i,showUser:!1,getUserSessions:r=>w.userSession.getMyLoginSessions({},r)})},!u&&x.onDestroySelf&&typeof x.onDestroySelf=="function"?{label:h("dangerZone.title"),value:"dangerZone",content:e.jsx(Ws,{onDestroySelf:x.onDestroySelf}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[i,f,s]);return k.useEffect(()=>{const r=window.location.hash.slice(1);r&&document.getElementById(r)?.scrollIntoView({behavior:"smooth"})},[]),e.jsx(g,{...x,sx:{...x?.sx,display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},maxWidth:"100%"},children:C.map(r=>r?e.jsxs(g,{id:r.value,sx:ci({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},r.sx),children:[e.jsx(R,{sx:{color:"text.primary",fontWeight:600},children:r.label}),e.jsx(g,{sx:{mt:2.5},children:r.content})]},r.value):null)})}const vo=k.createContext({}),{Provider:Hs,Consumer:Ir}=vo;function Zs({children:i}){const[a]=k.useState(!1),{session:t}=k.use(_e),{user:s}=t,[x,w]=k.useState(),p=k.useMemo(()=>s?.didSpace?.endpoint,[s?.didSpace]);k.useEffect(()=>{w(s?.didSpace)},[s?.didSpace]);const m=async()=>{w(void 0)},h=u=>{};return e.jsx(Hs,{value:{loading:a,spaceGateway:x,session:t,deleteSpaceGateway:m,updateSpaceGateway:async u=>{w(u),await h(u.endpoint)},storageEndpoint:p,settingStorageEndpoint:h,hasStorageEndpoint:!!(p&&x)},children:i})}function bi(){return k.use(vo)}function Vs(i){const a=i.replace(/\/api\/space\/.+/,""),t=i.replace(/\/$/,"").split("/").at(-4);return ee(a,"space",t)}function Gs({session:i,spaceGateway:a,spaceStatus:t,refresh:s}){return e.jsxs(mi,{direction:"row",spacing:1,children:[t===Rt.DISCONNECTED&&e.jsx(Ve,{reconnect:!0,variant:"outlined",session:i,spaceDid:i.user?.didSpace?.did,spaceGatewayUrl:i.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await s()},onError:x=>{console.error(x),X.error(le(x))}}),e.jsx(oe,{size:"small",LinkComponent:Uo,href:Vs(a.endpoint),target:"_blank",children:e.jsx(Fo,{})})]})}function Ys({spaceGateway:i}){const{t:a}=H(),{updateSpaceGateway:t,session:s}=bi(),x=gi(),w=({spaceGateway:p})=>t(p);return e.jsxs(g,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(g,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(R,{sx:{fontSize:"16px",fontWeight:"bold"},children:a("storage.spaces.connected.title")}),!x&&e.jsx(Ve,{connectScope:"user",session:s,onSuccess:w})]}),e.jsx(g,{children:i&&e.jsx(_t,{endpoint:i.endpoint,deps:[i],selected:!0,footer:!0,action:p=>e.jsx(Gs,{session:s,...p})},i.endpoint)}),x&&e.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(Ve,{connectScope:"user",session:s,onSuccess:w})})]})}function Qs(){const{t:i}=H(),{updateSpaceGateway:a,session:t}=bi(),s=({spaceGateway:x})=>a(x);return e.jsxs(g,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(R,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("storage.spaces.connect.providerForStorage")}),e.jsx(Nt,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(g,{children:e.jsx(Ve,{session:t,onSuccess:s})})]})}function Ks(){const{spaceGateway:i,hasStorageEndpoint:a,loading:t}=bi(),{locale:s}=H();return t?e.jsx(Lt,{relative:"parent",children:e.jsx(Re,{})}):e.jsx(ft,{translations:Q,locale:s,children:e.jsx(Xs,{children:e.jsx(g,{sx:{maxWidth:"720px"},children:a?e.jsx(Ys,{spaceGateway:i}):e.jsx(Qs,{})})})})}const Xs=Ge(g)`
|
|
25
25
|
height: 100%;
|
|
26
26
|
overflow-y: auto;
|
|
27
|
-
`;function
|
|
27
|
+
`;function Js({visible:i,onClose:a,nft:t}){return!i||!t?null:e.jsx(er,{children:e.jsx(Wo,{open:i,onClose:a,children:e.jsx(ir,{onClick:a,children:e.jsx(xi,{data:fo(t),address:t.address,inset:!0})})})})}const er=Ge.div`
|
|
28
28
|
position: relative;
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: 100%;
|
|
@@ -49,7 +49,7 @@ import{j as e,V as ro,z as li,A as no,F as ko,Z as So,b1 as To,T as R,I as ie,ak
|
|
|
49
49
|
opacity: 0;
|
|
50
50
|
transition: opacity 0.2s;
|
|
51
51
|
}
|
|
52
|
-
`,
|
|
52
|
+
`,ir=Ge.div`
|
|
53
53
|
display: flex;
|
|
54
54
|
justify-content: center;
|
|
55
55
|
align-items: center;
|
|
@@ -69,4 +69,4 @@ import{j as e,V as ro,z as li,A as no,F as ko,Z as So,b1 as To,T as R,I as ie,ak
|
|
|
69
69
|
height: 75vmin;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
`,Js=i=>({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:qi(i.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:qi(i.palette.background.paper,1)}}}),to="https://main.abtnetwork.io/explorer";function er({user:i}){const{locale:a}=H(),t=A((y,b={})=>Y(Q,y,a,"en",b)),[s,x]=k.useState({visible:!1,nft:null}),[w,p]=k.useState({anchorEl:null,props:null}),m=y=>{const b=se(to,"assets",y);window.open(b,"_blank")},h=(y,b)=>{let v="";typeof b.data?.value=="string"?v=JSON.parse(b.data?.value)?.domain:v=b.data?.value?.domain,p({anchorEl:y,props:{title:v?`Hey, I just won an NFT at the ${v} event!`:"Hey, I just won an NFT!",url:se(to,"assets",b.address)}})},u=y=>{x({visible:!0,nft:y})},f=me({page:1,size:20}),C=Le(async(y=f)=>(await vt.get(`${co.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:i.did,...y}})).data,{defaultParams:[f],refreshDeps:[i.did,f]}),{loading:r,data:d}=C,n=d?.page??{cursor:0,next:!1,total:0},o=(y,b)=>{f.page=b,C.run(f)},l=M(()=>{if(r){const y=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Ii,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ii,{width:"20%"}),e.jsx(g,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:y})]})}return e.jsxs(e.Fragment,{children:[e.jsx(R,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:t("common.nft")}),d?.assets?.length===0&&!r&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(pe,{children:t("common.noNFT")})}),e.jsx(g,{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:d?.assets?.map(y=>e.jsxs(g,{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","&:hover .mask":{opacity:1}},children:[e.jsx(xi,{data:ho(y),address:y.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),e.jsx(g,{className:"mask",sx:Js,children:e.jsxs(mi,{direction:"row",spacing:1,children:[e.jsx(ie,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),m(y.address)},children:e.jsx(G,{icon:"tabler:link",fontSize:18})}),e.jsx(ie,{size:"small",onClick:b=>{b.stopPropagation(),h(b.currentTarget,y)},className:"mask-item",children:e.jsx(G,{icon:"tabler:share-2",fontSize:18})}),e.jsx(ie,{size:"small",onClick:b=>{b.stopPropagation(),u(y)},className:"mask-item",children:e.jsx(G,{icon:"tabler:eye",fontSize:18})})]})})]},y.address))}),n.next||f.page>1?e.jsx(Wo,{sx:{display:"flex",justifyContent:"center",mt:2},page:f.page,onChange:o,count:Math.ceil(n.total/f.size),size:"small"}):null,e.jsx(Qs,{visible:s.visible&&!!s.nft,nft:s.nft,onClose:()=>{x({visible:!1,nft:null})}}),e.jsx(mt,{anchorEl:w.anchorEl,onClose:()=>{p({anchorEl:null,props:null})},sharedProps:w.props||{title:"",url:""}})]})},[r,n,f.page,f.size,o,w,s]);return e.jsx(g,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:l})}function ir({currentActiveTab:i,isMyself:a,isSupportFollow:t=!1,children:s}){const{locale:x}=H(),w=A((h,u={})=>Y(Q,h,x,"en",u)),{followed:p}=go();if(a||!i?.protected||i?.protected==="all")return s;const{protected:m}=i;return!t&&m==="follower-only"?s:m===!0||m==="private"?e.jsx(pe,{children:w("underProtected")}):m==="follower-only"?p?s:e.jsx(pe,{children:w("followersOnly")}):e.jsx(pe,{children:w("underProtected")})}const Ue=se(Ne,"/nfts"),Fe=se(Ne,"/settings"),We=se(Ne,"/did-spaces"),pi=se(Ne,"/user-followers"),or=i=>i.some(a=>["/userCenter/nfts","/userCenter/user-followers","/userCenter/settings","/userCenter/did-spaces"].includes(a.id)||[Ue,Fe,We,pi].includes(a.link)),so=mo(g)(({theme:i})=>({flex:1,boxSizing:"border-box",padding:"0 16px",width:"100%",maxWidth:1600,margin:"0 auto",display:"flex",alignItems:"stretch",gap:2.5,flexDirection:"column",[i.breakpoints.up("md")]:{flexDirection:"row"}})),ai=mo(g)(({theme:i})=>({overflow:"hidden",flex:"revert",[i.breakpoints.up("md")]:{flex:1},"@media (min-width: 960px) and (max-width: 1050px)":{"& .user-center-tabs":{maxWidth:"500px"}}}));function Pr({children:i,notLoginContent:a=null,currentTab:t,contentProps:s={},disableAutoRedirect:x=!1,hideFooter:w=!1,headerProps:p={},footerProps:m={},userDid:h=void 0,stickySidebar:u=!1,embed:f=!1,onlyProfile:C=!1,onDestroySelf:r=void 0}){const d=he(),{locale:n,defaultLocale:o}=H(),l=gi({key:"md"}),y=A((q,_={})=>Y(Q,q,n,"en",_)),b=k.use(_e)?.session,v=M(()=>{if(h)return h;const q=window.location.href,_=yt(q);return _?.did?Array.isArray(_.did)?_.did[0]:_.did:b?.user?.did},[b?.user?.did,h]),c=M(()=>b?.user?v===b?.user?.did:!1,[v,b?.user?.did]),T=k.useMemo(()=>!!b?.user&&ht(),[b?.user]),j=Le(async()=>{if(await Ko(()=>b?.initialized),c)return b.user;if(v)return d.user.getUserPublicInfo({did:v})},{refreshDeps:[v,c,b?.initialized,b?.user]}),O=A(()=>c?b.refresh():j.refresh()),D=Le(async()=>j.data&&t?await d.user.getUserPrivacyConfig({did:v}):null,{refreshDeps:[v,j.data,t],loadingDelay:300}),{confirmHolder:J}=Ye({fullScreen:l,sx:{".MuiDialog-paper":{borderRadius:1,maxWidth:1200},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),S=M(()=>{const q=jt(window.blocklet);try{return Tt(q)}catch(_){return console.error("Failed to format blocklet info",_,q),q}},[]),z=M(()=>{const q={label:y("common.nft"),protected:!1,isPrivate:!1,value:Ue,url:$e(Ue,n,o)},_={label:y("userFollowers"),protected:!1,isPrivate:!1,value:pi,url:$e(pi,n,o)};let W=T?[q,_]:[q];if(c){const re=[q,{label:y("common.setting"),protected:!0,isPrivate:!0,value:Fe,url:$e(Fe,n,o)},{label:y("storageManagement"),protected:!0,isPrivate:!0,value:We,url:$e(We,n,o)}];W=T?[...re,_]:re}return W},[c,n,T]),$=M(()=>{const q=S?.navigation?.userCenter||[],_=or(q);return(Ct({navigation:q,locale:n,defaultLocale:o})||[]).concat(_?[]:z).map(W=>{const re=W.value??W._rawLink??W.link??W.url;return{value:re,label:W.title||W.label,url:W.link||W.url,protected:D?.data?.[re]??!1,isPrivate:W.isPrivate||W.private||(W?._rawLink?.includes("/customer")??!1),followersOnly:W.component==="did-comments"}}).filter(W=>c||!W.isPrivate)},[S,j.data,D?.data,n,z,c]),U=M(()=>$.find(q=>Li(q.value)===Li(t)),[$]),fe=M(()=>{const q=window.blocklet?.appName,_=[U?.label,y("userCenter.title")].filter(Boolean).join("-");return q?`${_} | ${q}`:_},[U,y]),Ke=A(q=>q&&(k.isValidElement(q)?k.cloneElement(q,{...q.props||{},userCenterTabs:$}):k.Children.map(q,_=>k.isValidElement(_)?k.cloneElement(_,{..._.props||{},userCenterTabs:$}):_))),be=A(q=>{const _=$.find(W=>W.value===q);_&&(window.location.href=Ri(_.url,{did:c?void 0:v}))}),xe=M(()=>e.jsx(Us,{user:j.data,settings:{userCenterTabs:$},onSave:async q=>q==="privacy"?(await D.runAsync(),D.data):(q==="profile"&&await b.refresh(),null),isMobile:l,onDestroySelf:r}),[j.data,$,D.data,D.runAsync]),Te=M(()=>U&&U?.value===Fe,[U]),Ce=M(()=>U&&U?.value===se(Ne,"/profile")||U?.value===Ue,[U]),Xe=M(()=>U&&U?.value===We,[U]),we=b.useOAuth(),Pe=b.usePasskey(),ve=A(()=>{b?.user?.sourceProvider==="passkey"?Pe.switchPassport(b.user):["google","apple","email","github"].includes(b?.user?.sourceProvider??"")?we.switchOAuthPassport(b.user):b&&b.switchPassport()}),ge=M(()=>Ce?e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[c?e.jsxs(g,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(R,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:y("passport")}),e.jsx(fs,{user:j.data})]}):null,e.jsx(er,{user:j.data})]}):Te&&c?xe:Xe&&c?e.jsx(Ws,{children:e.jsx(Gs,{})}):null,[Te,Ce,j,c,u,xe]),Ae=M(()=>e.jsx(g,{sx:{display:{xs:c?"none":"block",md:"block"},py:3},children:e.jsx(pe,{children:y("emptyContent")})}),[c,n]),ce=M(()=>!D.data||D.loading?e.jsx(g,{sx:{height:"100%",minWidth:"160px",minHeight:"160px",display:"flex",justifyContent:"center",alignItems:"center",flex:1},children:e.jsx(Re,{})}):e.jsx(g,{sx:{flex:1},children:e.jsx(ir,{isSupportFollow:T,currentActiveTab:U,isMyself:c,children:i?e.jsx(g,{...s,children:Ke(i)}):ge})}),[D,U,c,i,s,ge,n]),ye=M(()=>{if(j.loading||b.loading)return null;if(j.error){if(j.error?.response?.status===404)return e.jsx(g,{sx:{width:"100%"},children:e.jsx(Xo,{status:404,description:y("noUserFound")})});const q={message:j.error.response?.data?.error||j.error.message||"error occurred"};return e.jsx(g,{sx:{width:"100%"},children:e.jsx(xt,{error:q})})}return!v&&!j.data?a||e.jsx(g,{sx:{width:"100%"},children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:1},children:[e.jsx(pe,{children:y("viewAfterLogin")}),e.jsx(fi,{size:"small",variant:"contained",onClick:()=>b.login(),children:y("loginNow")})]})}):v&&!j.data&&!j.loading?e.jsx(pe,{style:{width:"100%",paddingTop:16},children:e.jsxs(g,{sx:{textAlign:"center",width:"100%"},children:[e.jsx(R,{variant:"body1",sx:{fontSize:18,fontWeight:500},children:y("userNotFound")}),e.jsx(R,{variant:"body1",color:"text.secondary",children:y("userNotFoundDescription")})]})}):f?e.jsxs(ai,{children:[$.length>0&&t?e.jsx(g,{sx:{display:l?"block":"flex",height:"100%",overflow:"auto",padding:"1px"},children:ce}):null,$.length===0&&Ae]}):C?e.jsx(ai,{display:"flex",flexDirection:l?"column":"row",children:e.jsx(Ki,{isMobile:l,order:l?1:"unset",isMyself:c,switchPassport:ve,switchProfile:b.switchProfile,user:j.data,showFullDid:!1,onlyProfile:C,refreshProfile:O,isShowSocialActions:T,sx:{padding:l?"16px 0 0 0":"40px 24px 24px 40px",...l?{}:{width:320,maxWidth:320,flexShrink:0},boxSizing:"content-box"}})}):e.jsxs(ai,{display:"flex",flexDirection:l?"column":"row",children:[e.jsxs(g,{className:"user-center-tabs",sx:{flex:"1",order:l?2:"unset",width:l?"unset":"calc(100% - 424px)"},children:[$.length>0&&t?e.jsxs(g,{sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"auto",padding:"1px"},children:[e.jsx(ft,{orientation:"horizontal",variant:"line",tabs:$,current:U?.value??t,onChange:be,enableTabClick:!0,sx:{mb:q=>`${q.spacing(3)} !important`,".MuiTabs-flexContainer":{gap:3,".MuiButtonBase-root":{padding:l?"16px 4px":"32px 4px 16px 4px",fontSize:16},".MuiTab-root":{display:"block",textAlign:"left",alignItems:"flex-start",justifyContent:"flex-start",fontWeight:400,mr:0}},".MuiTabs-indicator":{zIndex:2},".MuiTabs-scroller":{"&:after":{content:'""',display:"block",position:"sticky",left:0,zIndex:1,width:"100%",height:"1px",backgroundColor:"divider"}}}}),ce]}):null,$.length===0&&Ae]}),!l&&e.jsx(ao,{orientation:"vertical",sx:{ml:5}}),e.jsx(Ki,{isMobile:l,order:l?1:"unset",isMyself:c,switchPassport:ve,switchProfile:b.switchProfile,user:j.data,refreshProfile:O,showFullDid:!1,isShowSocialActions:T,sx:{padding:l?"16px 0 0 0":"40px 24px 24px 40px",...l?{}:{width:320,maxWidth:320,flexShrink:0},boxSizing:"content-box"}})]})},[j,$,c,U,D,t,u,ge]),de=M(()=>c?!1:U?.isPrivate,[c,U]);if(M(()=>C||f||!$.length||!b.user?!1:!x&&!t&&$?.length>0||!U||de,[x,t,$,U,de,C,b.user,f])){const q=$[0]?.url,_=$.find(W=>W.value===q);return q&&!_?.isPrivate&&window.location.replace(Ri(q,{did:c?void 0:v})),null}return f||C?e.jsxs(g,{children:[e.jsx(Mi,{children:e.jsx("title",{children:fe})}),e.jsx(_i,{style:{display:"none"}}),e.jsxs(so,{children:[e.jsx(Qi,{isMySelf:c,userDid:j.data?.did??"",children:ye}),J]})]}):e.jsxs(g,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column"},children:[e.jsx(Mi,{children:e.jsx("title",{children:fe})}),e.jsx(_i,{bordered:!0,...p,maxWidth:"100%"}),e.jsxs(so,{children:[e.jsx(Qi,{isMySelf:c,userDid:j.data?.did??"",children:ye}),J]}),w?null:e.jsx(kt,{bordered:!0,...m,sx:{".MuiContainer-root":{maxWidth:1600}}})]})}export{Zi as $,Ft as F,Tr as H,Et as R,Sr as _,bs as a,hs as b,ws as c,gs as d,xs as e,zs as f,Q as g,go as h,ui as i,Pr as q};
|
|
72
|
+
`,or=i=>({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:qi(i.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:qi(i.palette.background.paper,1)}}}),so="https://main.abtnetwork.io/explorer";function tr({user:i}){const{locale:a}=H(),t=A((y,b={})=>Y(Q,y,a,"en",b)),[s,x]=k.useState({visible:!1,nft:null}),[w,p]=k.useState({anchorEl:null,props:null}),m=y=>{const b=ee(so,"assets",y);window.open(b,"_blank")},h=(y,b)=>{let v="";typeof b.data?.value=="string"?v=JSON.parse(b.data?.value)?.domain:v=b.data?.value?.domain,p({anchorEl:y,props:{title:v?`Hey, I just won an NFT at the ${v} event!`:"Hey, I just won an NFT!",url:ee(so,"assets",b.address)}})},u=y=>{x({visible:!0,nft:y})},f=me({page:1,size:20}),C=Le(async(y=f)=>(await kt.get(`${uo.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:i.did,...y}})).data,{defaultParams:[f],refreshDeps:[i.did,f]}),{loading:r,data:d}=C,n=d?.page??{cursor:0,next:!1,total:0},o=(y,b)=>{f.page=b,C.run(f)},l=M(()=>{if(r){const y=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Ii,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ii,{width:"20%"}),e.jsx(g,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:y})]})}return e.jsxs(e.Fragment,{children:[e.jsx(R,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:t("common.nft")}),d?.assets?.length===0&&!r&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(pe,{children:t("common.noNFT")})}),e.jsx(g,{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:d?.assets?.map(y=>e.jsxs(g,{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","&:hover .mask":{opacity:1}},children:[e.jsx(xi,{data:fo(y),address:y.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),e.jsx(g,{className:"mask",sx:or,children:e.jsxs(mi,{direction:"row",spacing:1,children:[e.jsx(oe,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),m(y.address)},children:e.jsx(G,{icon:"tabler:link",fontSize:18})}),e.jsx(oe,{size:"small",onClick:b=>{b.stopPropagation(),h(b.currentTarget,y)},className:"mask-item",children:e.jsx(G,{icon:"tabler:share-2",fontSize:18})}),e.jsx(oe,{size:"small",onClick:b=>{b.stopPropagation(),u(y)},className:"mask-item",children:e.jsx(G,{icon:"tabler:eye",fontSize:18})})]})})]},y.address))}),n.next||f.page>1?e.jsx(Bo,{sx:{display:"flex",justifyContent:"center",mt:2},page:f.page,onChange:o,count:Math.ceil(n.total/f.size),size:"small"}):null,e.jsx(Js,{visible:s.visible&&!!s.nft,nft:s.nft,onClose:()=>{x({visible:!1,nft:null})}}),e.jsx(xt,{anchorEl:w.anchorEl,onClose:()=>{p({anchorEl:null,props:null})},sharedProps:w.props||{title:"",url:""}})]})},[r,n,f.page,f.size,o,w,s]);return e.jsx(g,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:l})}function sr({currentActiveTab:i,isMyself:a,isSupportFollow:t=!1,children:s}){const{locale:x}=H(),w=A((h,u={})=>Y(Q,h,x,"en",u)),{followed:p}=bo();if(a||!i?.protected||i?.protected==="all")return s;const{protected:m}=i;return!t&&m==="follower-only"?s:m===!0||m==="private"?e.jsx(pe,{children:w("underProtected")}):m==="follower-only"?p?s:e.jsx(pe,{children:w("followersOnly")}):e.jsx(pe,{children:w("underProtected")})}const Ue=ee(Ne,"/nfts"),Fe=ee(Ne,"/settings"),We=ee(Ne,"/did-spaces"),pi=ee(Ne,"/user-followers"),rr=i=>i.some(a=>["/userCenter/nfts","/userCenter/user-followers","/userCenter/settings","/userCenter/did-spaces"].includes(a.id)||[Ue,Fe,We,pi].includes(a.link)),ro=ho(g)(({theme:i})=>({flex:1,boxSizing:"border-box",padding:"0 16px",width:"100%",maxWidth:1600,margin:"0 auto",display:"flex",alignItems:"stretch",gap:2.5,flexDirection:"column",[i.breakpoints.up("md")]:{flexDirection:"row"}})),ai=ho(g)(({theme:i})=>({overflow:"hidden",flex:"revert",[i.breakpoints.up("md")]:{flex:1},"@media (min-width: 960px) and (max-width: 1050px)":{"& .user-center-tabs":{maxWidth:"500px"}}}));function qr({children:i,notLoginContent:a=null,currentTab:t,contentProps:s={},disableAutoRedirect:x=!1,hideFooter:w=!1,headerProps:p={},footerProps:m={},userDid:h=void 0,stickySidebar:u=!1,embed:f=!1,onlyProfile:C=!1,onDestroySelf:r=void 0}){const d=he(),{locale:n,defaultLocale:o}=H(),l=gi({key:"md"}),y=A((q,_={})=>Y(Q,q,n,"en",_)),b=k.use(_e)?.session,v=M(()=>{if(h)return h;const q=window.location.href,_=St(q);return _?.did?Array.isArray(_.did)?_.did[0]:_.did:b?.user?.did},[b?.user?.did,h]),c=M(()=>b?.user?v===b?.user?.did:!1,[v,b?.user?.did]),T=k.useMemo(()=>!!b?.user&>(),[b?.user]),j=Le(async()=>{if(await et(()=>b?.initialized),c)return b.user;if(v)return d.user.getUserPublicInfo({did:v})},{refreshDeps:[v,c,b?.initialized,b?.user]}),O=A(()=>c?b.refresh():j.refresh()),D=Le(async()=>j.data&&t?await d.user.getUserPrivacyConfig({did:v}):null,{refreshDeps:[v,j.data,t],loadingDelay:300}),{confirmHolder:J}=Ye({fullScreen:l,sx:{".MuiDialog-paper":{borderRadius:1,maxWidth:1200},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),S=M(()=>{const q=Tt(window.blocklet);try{return Pt(q)}catch(_){return console.error("Failed to format blocklet info",_,q),q}},[]),z=M(()=>{const q={label:y("common.nft"),protected:!1,isPrivate:!1,value:Ue,url:$e(Ue,n,o)},_={label:y("userFollowers"),protected:!1,isPrivate:!1,value:pi,url:$e(pi,n,o)};let W=T?[q,_]:[q];if(c){const re=[q,{label:y("common.setting"),protected:!0,isPrivate:!0,value:Fe,url:$e(Fe,n,o)},{label:y("storageManagement"),protected:!0,isPrivate:!0,value:We,url:$e(We,n,o)}];W=T?[...re,_]:re}return W},[c,n,T]),$=M(()=>{const q=S?.navigation?.userCenter||[],_=rr(q);return(At({navigation:q,locale:n,defaultLocale:o})||[]).concat(_?[]:z).map(W=>{const re=W.value??W._rawLink??W.link??W.url;return{value:re,label:W.title||W.label,url:W.link||W.url,protected:D?.data?.[re]??!1,isPrivate:W.isPrivate||W.private||(W?._rawLink?.includes("/customer")??!1),followersOnly:W.component==="did-comments"}}).filter(W=>c||!W.isPrivate)},[S,j.data,D?.data,n,z,c]),U=M(()=>$.find(q=>Ri(q.value)===Ri(t)),[$]),fe=M(()=>{const q=window.blocklet?.appName,_=[U?.label,y("userCenter.title")].filter(Boolean).join("-");return q?`${_} | ${q}`:_},[U,y]),Ke=A(q=>q&&(k.isValidElement(q)?k.cloneElement(q,{...q.props||{},userCenterTabs:$}):k.Children.map(q,_=>k.isValidElement(_)?k.cloneElement(_,{..._.props||{},userCenterTabs:$}):_))),be=A(q=>{const _=$.find(W=>W.value===q);_&&(window.location.href=_i(_.url,{did:c?void 0:v}))}),xe=M(()=>e.jsx(Bs,{user:j.data,settings:{userCenterTabs:$},onSave:async q=>q==="privacy"?(await D.runAsync(),D.data):(q==="profile"&&await b.refresh(),null),isMobile:l,onDestroySelf:r}),[j.data,$,D.data,D.runAsync]),Te=M(()=>U&&U?.value===Fe,[U]),Ce=M(()=>U&&U?.value===ee(Ne,"/profile")||U?.value===Ue,[U]),Xe=M(()=>U&&U?.value===We,[U]),we=b.useOAuth(),Pe=b.usePasskey(),ve=A(()=>{b?.user?.sourceProvider==="passkey"?Pe.switchPassport(b.user):["google","apple","email","github"].includes(b?.user?.sourceProvider??"")?we.switchOAuthPassport(b.user):b&&b.switchPassport()}),ge=M(()=>Ce?e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[c?e.jsxs(g,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(R,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:y("passport")}),e.jsx(bs,{user:j.data})]}):null,e.jsx(tr,{user:j.data})]}):Te&&c?xe:Xe&&c?e.jsx(Zs,{children:e.jsx(Ks,{})}):null,[Te,Ce,j,c,u,xe]),Ae=M(()=>e.jsx(g,{sx:{display:{xs:c?"none":"block",md:"block"},py:3},children:e.jsx(pe,{children:y("emptyContent")})}),[c,n]),ce=M(()=>!D.data||D.loading?e.jsx(g,{sx:{height:"100%",minWidth:"160px",minHeight:"160px",display:"flex",justifyContent:"center",alignItems:"center",flex:1},children:e.jsx(Re,{})}):e.jsx(g,{sx:{flex:1},children:e.jsx(sr,{isSupportFollow:T,currentActiveTab:U,isMyself:c,children:i?e.jsx(g,{...s,children:Ke(i)}):ge})}),[D,U,c,i,s,ge,n]),ye=M(()=>{if(j.loading||b.loading)return null;if(j.error){if(j.error?.response?.status===404)return e.jsx(g,{sx:{width:"100%"},children:e.jsx(it,{status:404,description:y("noUserFound")})});const q={message:j.error.response?.data?.error||j.error.message||"error occurred"};return e.jsx(g,{sx:{width:"100%"},children:e.jsx(wt,{error:q})})}return!v&&!j.data?a||e.jsx(g,{sx:{width:"100%"},children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:1},children:[e.jsx(pe,{children:y("viewAfterLogin")}),e.jsx(fi,{size:"small",variant:"contained",onClick:()=>b.login(),children:y("loginNow")})]})}):v&&!j.data&&!j.loading?e.jsx(pe,{style:{width:"100%",paddingTop:16},children:e.jsxs(g,{sx:{textAlign:"center",width:"100%"},children:[e.jsx(R,{variant:"body1",sx:{fontSize:18,fontWeight:500},children:y("userNotFound")}),e.jsx(R,{variant:"body1",color:"text.secondary",children:y("userNotFoundDescription")})]})}):f?e.jsxs(ai,{children:[$.length>0&&t?e.jsx(g,{sx:{display:l?"block":"flex",height:"100%",overflow:"auto",padding:"1px"},children:ce}):null,$.length===0&&Ae]}):C?e.jsx(ai,{display:"flex",flexDirection:l?"column":"row",children:e.jsx(Xi,{isMobile:l,order:l?1:"unset",isMyself:c,switchPassport:ve,switchProfile:b.switchProfile,user:j.data,showFullDid:!1,onlyProfile:C,refreshProfile:O,isShowSocialActions:T,sx:{padding:l?"16px 0 0 0":"40px 24px 24px 40px",...l?{}:{width:320,maxWidth:320,flexShrink:0},boxSizing:"content-box"}})}):e.jsxs(ai,{display:"flex",flexDirection:l?"column":"row",children:[e.jsxs(g,{className:"user-center-tabs",sx:{flex:"1",order:l?2:"unset",width:l?"unset":"calc(100% - 424px)"},children:[$.length>0&&t?e.jsxs(g,{sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"auto",padding:"1px"},children:[e.jsx(bt,{orientation:"horizontal",variant:"line",tabs:$,current:U?.value??t,onChange:be,enableTabClick:!0,sx:{mb:q=>`${q.spacing(3)} !important`,".MuiTabs-flexContainer":{gap:3,".MuiButtonBase-root":{padding:l?"16px 4px":"32px 4px 16px 4px",fontSize:16},".MuiTab-root":{display:"block",textAlign:"left",alignItems:"flex-start",justifyContent:"flex-start",fontWeight:400,mr:0}},".MuiTabs-indicator":{zIndex:2},".MuiTabs-scroller":{"&:after":{content:'""',display:"block",position:"sticky",left:0,zIndex:1,width:"100%",height:"1px",backgroundColor:"divider"}}}}),ce]}):null,$.length===0&&Ae]}),!l&&e.jsx(lo,{orientation:"vertical",sx:{ml:5}}),e.jsx(Xi,{isMobile:l,order:l?1:"unset",isMyself:c,switchPassport:ve,switchProfile:b.switchProfile,user:j.data,refreshProfile:O,showFullDid:!1,isShowSocialActions:T,sx:{padding:l?"16px 0 0 0":"40px 24px 24px 40px",...l?{}:{width:320,maxWidth:320,flexShrink:0},boxSizing:"content-box"}})]})},[j,$,c,U,D,t,u,ge]),de=M(()=>c?!1:U?.isPrivate,[c,U]);if(M(()=>C||f||!$.length||!b.user?!1:!x&&!t&&$?.length>0||!U||de,[x,t,$,U,de,C,b.user,f])){const q=$[0]?.url,_=$.find(W=>W.value===q);return q&&!_?.isPrivate&&window.location.replace(_i(q,{did:c?void 0:v})),null}return f||C?e.jsxs(g,{children:[e.jsx(Mi,{children:e.jsx("title",{children:fe})}),e.jsx(Ni,{style:{display:"none"}}),e.jsxs(ro,{children:[e.jsx(Ki,{isMySelf:c,userDid:j.data?.did??"",children:ye}),J]})]}):e.jsxs(g,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column"},children:[e.jsx(Mi,{children:e.jsx("title",{children:fe})}),e.jsx(Ni,{bordered:!0,...p,maxWidth:"100%"}),e.jsxs(ro,{children:[e.jsx(Ki,{isMySelf:c,userDid:j.data?.did??"",children:ye}),J]}),w?null:e.jsx(Ct,{bordered:!0,...m,sx:{".MuiContainer-root":{maxWidth:1600}}})]})}export{Vi as $,Ht as F,Ar as H,Ut as R,Pr as _,ys as a,gs as b,js as c,vs as d,ws as e,_s as f,Q as g,bo as h,ui as i,qr as q};
|