@abtnode/blocklet-services 1.16.53-beta-20251011-054719-4ed2f6b7 → 1.16.53-beta-20251011-095147-8bd212c5
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/{access-control-abOzA88J.js → access-control-C2aF8l7f.js} +1 -1
- package/dist/assets/{add-component-core-DyP5DXP3.js → add-component-core-DaSlPT-f.js} +8 -8
- package/dist/assets/{add-resource-D1RE_D63.js → add-resource-BbsAiWlt.js} +1 -1
- package/dist/assets/{addon-BQpY5mGN.js → addon-FUH-lSq2.js} +1 -1
- package/dist/assets/{advanced-BAAkbQ7v.js → advanced-C5U4taie.js} +1 -1
- package/dist/assets/{aigne-BIxsGdE6.js → aigne-eGqt4yLH.js} +1 -1
- package/dist/assets/{appearance-DLL_c3H7.js → appearance-COFOsk8H.js} +1 -1
- package/dist/assets/{arrow-down.svg-B0yKIpV_.js → arrow-down.svg-BIpNdtOh.js} +1 -1
- package/dist/assets/{audit-logs-BjqQg10C.js → audit-logs-mrNr9NEV.js} +1 -1
- package/dist/assets/{authorize-zdSPMvPb.js → authorize-DNMdsHLY.js} +1 -1
- package/dist/assets/{bind-account-MeFLW0-t.js → bind-account-DHM0aKm4.js} +1 -1
- package/dist/assets/{branding-BGqwD_8z.js → branding-C8c4AQBL.js} +1 -1
- package/dist/assets/{branding-DdfX0yE_.js → branding-DCFBnIuE.js} +1 -1
- package/dist/assets/{branding-CZ3msR8C.js → branding-Ds21HJPv.js} +1 -1
- package/dist/assets/{bundle-avatar-BnsIGAGk.js → bundle-avatar-YluGbYkj.js} +1 -1
- package/dist/assets/{complete-BKOQngoV.js → complete-ci8dXkdd.js} +1 -1
- package/dist/assets/{component-ZLIptWjb.js → component-CktAV437.js} +2 -2
- package/dist/assets/{config-DuFudWCR.js → config-BDvrfPci.js} +1 -1
- package/dist/assets/{config-CZV6cEQO.js → config-BE0FYeHo.js} +1 -1
- package/dist/assets/{config-DETFzZFy.js → config-hlI_P1F8.js} +1 -1
- package/dist/assets/{config-navigation-Ckddb7Ew.js → config-navigation-D8-g7qAt.js} +2 -2
- package/dist/assets/{config-space-BMQcYhX4.js → config-space-BLuDOEKJ.js} +1 -1
- package/dist/assets/{confirm-BWJyxR1P.js → confirm-Cs-v9Ueu.js} +1 -1
- package/dist/assets/{connect-ByF8W-k5.js → connect-DZzHQL_N.js} +1 -1
- package/dist/assets/{connect-8ijsDqc0.js → connect-Do64lcqi.js} +1 -1
- package/dist/assets/{connect-to-DsrMYUbG.js → connect-to-D-Tb_fXt.js} +1 -1
- package/dist/assets/{dashboard-dvSAjP1V.js → dashboard-DcdBCHRL.js} +2 -2
- package/dist/assets/{delete-confirm-C5O8wEbn.js → delete-confirm-D-H3beUW.js} +1 -1
- package/dist/assets/{domain-UcW2NDgQ.js → domain-D1iCGb9_.js} +1 -1
- package/dist/assets/{domain-action-card-C4LewNdA.js → domain-action-card-dl9BP1dq.js} +1 -1
- package/dist/assets/{domains-a52EIu7f.js → domains-VJkxJvLu.js} +1 -1
- package/dist/assets/{email-DeJqm_cT.js → email-CXQwvoco.js} +1 -1
- package/dist/assets/engine-OnFdHI4e.js +1 -0
- package/dist/assets/{exchange-passport-Bk3KCI7e.js → exchange-passport-By4W6XDH.js} +1 -1
- package/dist/assets/{form-BzuOEtWl.js → form-B_F_xaXO.js} +1 -1
- package/dist/assets/{fuel-CqEiaVyB.js → fuel-CW2Evrsd.js} +1 -1
- package/dist/assets/{gen-access-key-DPvESsAt.js → gen-access-key-DlPCMbg5.js} +1 -1
- package/dist/assets/{gen-simple-access-key-BDFpf0Fe.js → gen-simple-access-key-DGvoYxjH.js} +1 -1
- package/dist/assets/{get-safe-url-VPE7525h.js → get-safe-url-rD2TSrmk.js} +1 -1
- package/dist/assets/{home-D88mAORC.js → home-B4ti5g0W.js} +1 -1
- package/dist/assets/{iframe-C132otWW.js → iframe-BI7fZAER.js} +1 -1
- package/dist/assets/{index-LVfZZmHk.js → index-4foCOGch.js} +1 -1
- package/dist/assets/{index-G6mLFBwo.js → index-8x51s8zo.js} +3 -3
- package/dist/assets/{index-CLKzAwdz.js → index-B3Wj0Nic.js} +1 -1
- package/dist/assets/{index-CoDgpGOM.js → index-B5MKa5ov.js} +2 -2
- package/dist/assets/{index-CouqM1KS.js → index-B8GEVW-7.js} +1 -1
- package/dist/assets/{index-1FCrRa8S.js → index-Bdipd-mG.js} +1 -1
- package/dist/assets/{index-CfnfoDga.js → index-Bm6372dL.js} +1 -1
- package/dist/assets/{index-DBMcmgkV.js → index-BmZkZYAT.js} +1 -1
- package/dist/assets/{index-BY2B2juN.js → index-Bxd2Cj9Z.js} +1 -1
- package/dist/assets/{index-2yXoHCF5.js → index-CE80LF06.js} +1 -1
- package/dist/assets/{index-BS4gI6Je.js → index-CM-I96vs.js} +1 -1
- package/dist/assets/{index-4N6JSZ-1.js → index-CWPu1V9G.js} +1 -1
- package/dist/assets/index-CwiCg7Wy.js +124 -0
- package/dist/assets/{index-BHZw9zYL.js → index-D-SgeZ2f.js} +1 -1
- package/dist/assets/{index-Dnczsrey.js → index-D46_FTfy.js} +1 -1
- package/dist/assets/{index-4iRJnRDb.js → index-DHsKHttK.js} +1 -1
- package/dist/assets/{index-DqZvBosz.js → index-DbJX8mTu.js} +1 -1
- package/dist/assets/{index-BhwFkAf9.js → index-DeRDwip-.js} +1 -1
- package/dist/assets/{index-BO1dYT6j.js → index-DeRE90O3.js} +1 -1
- package/dist/assets/{index-CSpvJyY6.js → index-DgBkBy0d.js} +1 -1
- package/dist/assets/{index-Dk4snkhP.js → index-Dy82BFhx.js} +1 -1
- package/dist/assets/{index-DU1RbZz3.js → index-Ffd9R2jw.js} +1 -1
- package/dist/assets/{index-BuM1x7gd.js → index-Ha4kS6kt.js} +1 -1
- package/dist/assets/{index-CocTzKAu.js → index-OE1287Me.js} +1 -1
- package/dist/assets/{index-lPn5f6-V.js → index-kK-2wGsh.js} +1 -1
- package/dist/assets/{index-CDK4fL-O.js → index-kYJKn2jR.js} +4 -4
- package/dist/assets/{invitation-Cb4EkBcb.js → invitation-uW2SRspc.js} +1 -1
- package/dist/assets/{invitations-D3Zrof2P.js → invitations-BKP1NV2c.js} +1 -1
- package/dist/assets/{invite-BR4XYB-m.js → invite-Cyj0TX33.js} +1 -1
- package/dist/assets/{isURL-C1DcW1a5.js → isURL-DOKl6zP6.js} +1 -1
- package/dist/assets/{issue-passport-BdoYSf2e.js → issue-passport-jS72R6Y9.js} +1 -1
- package/dist/assets/{item-CkI92KM4.js → item-6E9xBb8C.js} +1 -1
- package/dist/assets/{landing-page-B5oo2gYB.js → landing-page-CfBuAqix.js} +1 -1
- package/dist/assets/{layout-BZEqr9pw.js → layout-Yt1Ps3ty.js} +1 -1
- package/dist/assets/{list-CDnwzHEF.js → list-CWTC1dNA.js} +1 -1
- package/dist/assets/{list-IzlvL0Cm.js → list-CbJU6aON.js} +1 -1
- package/dist/assets/{localization-BicvVG1z.js → localization-BWvCdRh6.js} +1 -1
- package/dist/assets/{log-BLFD38SA.js → log-D8J_RKs2.js} +1 -1
- package/dist/assets/{login-tgh6A96Z.js → login-DqfZ0aMJ.js} +1 -1
- package/dist/assets/{login-oauth-callback-DCxgtqJh.js → login-oauth-callback-BHyWL0cZ.js} +1 -1
- package/dist/assets/{logo-uploader-CeiVmA8S.js → logo-uploader-CN181syA.js} +1 -1
- package/dist/assets/{lost-passport--U8zmxgu.js → lost-passport-BQSFuIDg.js} +1 -1
- package/dist/assets/{open-window-M9ef-LkI.js → open-window-CVPA9xdu.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-W_gVc8Qj.js → over-due-invoice-payment-gqfc7YHA.js} +1 -1
- package/dist/assets/{overview-DZA0nOyD.js → overview-BfjhNxe0.js} +1 -1
- package/dist/assets/{passport-Cd-yq0CU.js → passport-C9JudxNO.js} +1 -1
- package/dist/assets/{passport-item-BEacxvYM.js → passport-item-VF3cWzrN.js} +1 -1
- package/dist/assets/{permission-DNqMBi19.js → permission-B4abezk1.js} +1 -1
- package/dist/assets/{preferences-6Rdph3hk.js → preferences-C_XdWNfF.js} +1 -1
- package/dist/assets/{profile-embed-ChFmka39.js → profile-embed-QqF7FA6v.js} +1 -1
- package/dist/assets/{publish-resource-BtxG5C-8.js → publish-resource-H7eMW32y.js} +1 -1
- package/dist/assets/{runtime-ChFuhKtK.js → runtime-8vm1QUk_.js} +1 -1
- package/dist/assets/sdk-DRBI7AWf.js +1 -0
- package/dist/assets/{security-PpRNxUG9.js → security-Dw-d-MTv.js} +1 -1
- package/dist/assets/{session-DqPgru1C.js → session-C838MSz1.js} +1 -1
- package/dist/assets/{setup-oD1wO9rk.js → setup-DegA44sL.js} +1 -1
- package/dist/assets/{spaces-DGH_8-cq.js → spaces-M_qE7wW_.js} +1 -1
- package/dist/assets/{start-C5yo46Q5.js → start-BVg7NHO7.js} +1 -1
- package/dist/assets/{starting-progress-CG1Jhf-6.js → starting-progress-Bc97wy6x.js} +1 -1
- package/dist/assets/{status-aDx49LDx.js → status-QhfaNvgn.js} +1 -1
- package/dist/assets/{step-actions-DMXYHHE_.js → step-actions-DTwta5X_.js} +1 -1
- package/dist/assets/{studio-DWci_EEj.js → studio-BKBKyaGG.js} +1 -1
- package/dist/assets/{team-DNwgDnjc.js → team-BxHvUIQ6.js} +1 -1
- package/dist/assets/{traffic-Bixs5_Th.js → traffic-bm4qFOVU.js} +1 -1
- package/dist/assets/{transfer-Cz15cjFv.js → transfer-BrMoTS5Z.js} +1 -1
- package/dist/assets/{unsubscribe-CkZxyB3U.js → unsubscribe-B27dQ-V0.js} +1 -1
- package/dist/assets/{use-app-logo-Bbh3GZji.js → use-app-logo-ezyDWOV9.js} +1 -1
- package/dist/assets/{user-center-DkbCI7_Z.js → user-center-uDx2x7Sm.js} +2 -2
- package/dist/assets/{user-follower-BiV6IZnA.js → user-follower-CxhX_9BD.js} +1 -1
- package/dist/assets/{user-sessions-WZG9FkqG.js → user-sessions-B3zzrErP.js} +1 -1
- package/dist/assets/{util-BilORIYw.js → util-B8m2D-S9.js} +1 -1
- package/dist/assets/{util-CT-nPa5g.js → util-k7U_iSB6.js} +1 -1
- package/dist/assets/{wait-connect-Be6pglA3.js → wait-connect-DhEi-ni_.js} +1 -1
- package/dist/assets/{wizard-components-4u9bZcdI.js → wizard-components-BZT4jikM.js} +1 -1
- package/dist/assets/{wizard-B56tgdNq.js → wizard-obzJ3sCB.js} +1 -1
- package/dist/assets/{wrap-locale-CIO-ciR5.js → wrap-locale-CaI-lUtp.js} +1 -1
- package/dist/assets/{zh-1ARDBzTp.js → zh-CPf0Aw2x.js} +1 -1
- package/dist/assets/{zh-C_CaWCk3.js → zh-dnVpNwG1.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/engine-BOS99Pm4.js +0 -1
- package/dist/assets/index-D_TfbqtN.js +0 -124
- package/dist/assets/sdk-C7wG8QyH.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as ee,H as O,P as X,a7 as Ee,a8 as Ue,a9 as We,aa as Ve,c as K,a1 as je,b as ke,q as Me,n as z,ab as _e,j as Ne,k as $e,p as Ie}from"./vendor-ux-B9VfuZTg.js";import{b as u,a as H,g as ie,c as He}from"./vendor-hooks-BlA8TRnZ.js";import{r as D}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as a,b6 as R,am as ce,y as B,z as F,Q as V,T as Q,I as le,a3 as oe,W as E,b1 as W,bb as qe,cb as Le,cE as Je,at as Fe,D as ye,ah as Be,cF as Oe,a6 as be,cG as Ze,a$ as Ke}from"./vendor-mui-core-DRxbhqaK.js";import{X as N,a9 as M,V as G,bd as se,c as ve,b8 as Ge,aW as Qe,W as Ye}from"./index-CDK4fL-O.js";import{A as Z,Q as Xe,b as de,Z as et,n as Y,$ as tt,C as nt,a as st}from"./vendor-utils-CUDP56Ff.js";import{u as te,C as k,a as De}from"./index.esm-JPZAjt0x.js";import{S as ae}from"./switch-control-DEpBEl7-.js";import{S as y}from"./section-ZPKr6_ii.js";import{d as ot}from"./keyboard-arrow-down-rounded-8U0_i9QO.js";import{u as it}from"./index-DlrQ2HQP.js";import{v as at}from"./index-Ba9-ArMT.js";import{r as rt}from"./base32-BK7MXAD4.js";import{u as lt}from"./use-mobile-BQQpAf3i.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./required-BT8zXV8U.js";const we={width:24,height:24,body:'<path fill="currentColor" d="M5 4v16V4v5v-5Zm3 10h2.675q.275-.575.638-1.075t.812-.925H8q-.425 0-.713.288T7 13q0 .425.288.713T8 14Zm0 4h2.075Q10 17.5 10 17t.075-1H8q-.425 0-.713.288T7 17q0 .425.288.713T8 18Zm-3 4q-.825 0-1.413-.588T3 20V4q0-.825.588-1.413T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762V10.3q-.475-.15-.975-.225T17 10V9h-4q-.425 0-.713-.288T12 8V4H5v16h5.675q.275.575.638 1.075t.812.925H5Zm12-10q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12Zm0 8q.275 0 .463-.188t.187-.462q0-.275-.187-.463T17 18.7q-.275 0-.463.188t-.187.462q0 .275.188.463T17 20Zm0-6q-.475 0-.875.238t-.65.637q-.1.15-.025.313t.25.237q.15.075.3 0t.275-.2q.125-.175.313-.275t.412-.1q.325 0 .563.213t.237.537q0 .275-.15.463t-.35.387q-.15.15-.313.3t-.287.35q-.075.15-.113.313t-.037.337q0 .225.125.413t.325.187q.2 0 .325-.15t.125-.35q0-.275.15-.488t.35-.412q.3-.275.525-.613t.225-.737q0-.675-.5-1.138T17 14Z"/>'},ue={enabled:!1,domain:"",clientId:"",clientSecret:""};function ct(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...ue},c?.settings?.oauth?.auth0||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(ue))}),l=d("enabled"),j=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({auth0:s})}}),L=Object.assign({...ue},I?.settings?.oauth?.auth0||{});f(L),O.success(t("oauth.saveSuccess"))}catch(I){O.error(I.message||t("oauth.saveFailed"))}}),v=u(s=>s?.trim()?!0:t("oauth.auth0.domainDescription")),S=u(s=>s?.trim()?!0:t("oauth.auth0.clientIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.auth0.clientSecretDescription")),w=u(()=>!0),h=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[n]);return e.jsx(a,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(a,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.auth0.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(a,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:h,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:s})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.auth0.domain"),children:e.jsx(k,{name:"domain",control:i,rules:{validate:l?v:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.domain"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?S:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.clientId"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?g:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.auth0.clientSecret"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const he={enabled:!1,clientId:"",clientSecret:""};function dt(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...he},c?.settings?.oauth?.github||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(he))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({github:h})}}),I=Object.assign({...he},s?.settings?.oauth?.github||{});f(I),O.success(t("oauth.saveSuccess"))}catch(s){O.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.github.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.github.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[n]);return e.jsx(a,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(a,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.github.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(a,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:i,sx:{alignItems:"center"},render:({field:h})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},size:"small",checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.github.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.github.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.github.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.github.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function ut(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...me},c?.settings?.oauth?.google||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(me))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({google:h})}}),I=Object.assign({...me},s?.settings?.oauth?.google||{});f(I),O.success(t("oauth.saveSuccess"))}catch(s){O.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.google.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.google.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[n]);return e.jsx(a,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(a,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.google.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(a,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:h})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.google.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.google.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.google.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.google.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function ht(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...pe},c?.settings?.oauth?.apple||{}),{handleSubmit:r,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(pe))}),f=p("enabled"),l=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({apple:s})}}),L=Object.assign({...pe},I?.settings?.oauth?.apple||{});d(L),O.success(t("oauth.saveSuccess"))}catch(I){O.error(I.message||t("oauth.saveFailed"))}}),j=u(s=>s?.trim()?!0:t("oauth.apple.teamIdDescription")),v=u(s=>s?.trim()?!0:t("oauth.apple.serviceIdDescription")),S=u(s=>s?.trim()?!0:t("oauth.apple.keyIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.apple.authKeyDescription")),w=u(s=>s?.trim()?!0:t("oauth.apple.bundleIdDescription")),h=u(()=>!0);return e.jsx(a,{children:e.jsxs("form",{onSubmit:r(l),disabled:!0,children:[e.jsx(y,{title:t("oauth.apple.enable"),mb:2.5,children:e.jsx(k,{name:"enabled",control:x,render:({field:s})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.apple.teamId"),children:e.jsx(k,{name:"teamId",control:x,rules:{validate:f?j:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.teamId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.bundleId"),children:e.jsx(k,{name:"bundleId",control:x,rules:{validate:f?w:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.bundleId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.serviceId"),children:e.jsx(k,{name:"serviceId",control:x,rules:{validate:f?v:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.serviceId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.keyId"),children:e.jsx(k,{name:"keyId",control:x,rules:{validate:f?S:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.keyId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.authKey"),children:e.jsx(k,{name:"authKey",control:x,rules:{validate:f?g:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.apple.authKey"),multiline:!0,rows:4,error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:r(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const xe={enabled:!1,clientId:"",clientSecret:""};function mt(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...xe},c?.settings?.oauth?.twitter||{}),{handleSubmit:r,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(xe))}),f=p("enabled"),l=u(async g=>{try{const{blocklet:w}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({twitter:g})}}),h=Object.assign({...xe},w?.settings?.oauth?.twitter||{});d(h),O.success(t("oauth.saveSuccess"))}catch(w){O.error(w.message||t("oauth.saveFailed"))}}),j=u(g=>g?.trim()?!0:t("oauth.twitter.clientIdDescription")),v=u(g=>g?.trim()?!0:t("oauth.twitter.clientSecretDescription")),S=u(()=>!0);return e.jsx(a,{children:e.jsxs("form",{onSubmit:r(l),disabled:!0,children:[e.jsx(y,{title:e.jsx(a,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:t("oauth.twitter.enable")})}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:x,sx:{alignItems:"center"},render:({field:g})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},size:"small",checked:g.value,...g})})})}),e.jsx(y,{title:t("oauth.twitter.clientId"),children:e.jsx(k,{name:"clientId",control:x,rules:{validate:f?j:S},render:({field:g})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",label:t("oauth.twitter.clientId"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.twitter.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:x,rules:{validate:f?v:S},render:({field:g})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",type:"password",label:t("oauth.twitter.clientSecret"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:r(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const pt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Re({id:b,title:c,children:t,index:n,onMove:o,defaultExpand:r=!1,onEnd:x,icon:i=null}){const[p,d]=D.useState(r),f=D.useRef(null),l=D.useRef(null),[{handlerId:j},v]=Ee({accept:"dragItem",collect(s){return{handlerId:s.getHandlerId()}},hover(s,I){if(!f.current)return;const L=s.index,m=n;if(L===m)return;const A=f.current?.getBoundingClientRect(),_=l.current?.getBoundingClientRect(),re=(_.bottom-_.top)/2,$=I.getClientOffset().y-A.top;L<m&&$<re||L>m&&$>re||(o(L,m),s.index=m)}}),[{isDragging:S},g]=Ue({item:{index:n,type:"dragItem"},collect:s=>({isDragging:s.isDragging()}),end:x});g(l),v(f);const w=S?.5:1,h=u(s=>{s.preventDefault(),s.stopPropagation(),d(!p)});return e.jsxs(a,{ref:f,children:[e.jsxs(a,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:l,"data-handler-id":j,children:[e.jsxs(a,{sx:{py:2,px:1,opacity:w,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:h,children:[e.jsx(a,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(X,{fontSize:20,icon:pt})}),e.jsx(a,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:i}),e.jsx(Q,{sx:{flex:1},children:c}),e.jsx(le,{size:"small",sx:{pointerEvents:"auto",transform:p?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(X,{icon:ot,style:{transform:"scale(1.5)"}})})]}),e.jsx(oe,{})]}),e.jsx(a,{sx:{pl:4,py:2.5,display:p?"block":"none"},children:t})]})}Re.propTypes={title:E.string.isRequired,id:E.string.isRequired,children:E.node.isRequired,index:E.number.isRequired,onMove:E.func.isRequired,onEnd:E.func.isRequired,defaultExpand:E.bool,icon:E.any};const xt=[{name:"github",title:G.PROVIDER_NAME.github,icon:e.jsx(se,{provider:"github",sx:{width:20,height:20}}),component:e.jsx(dt,{})},{name:"google",title:G.PROVIDER_NAME.google,icon:e.jsx(se,{provider:"google",sx:{width:20,height:20}}),component:e.jsx(ut,{})},{name:"apple",title:G.PROVIDER_NAME.apple,icon:e.jsx(se,{provider:"apple",sx:{width:20,height:20}}),component:e.jsx(ht,{})},{name:"twitter",title:G.PROVIDER_NAME.twitter,icon:e.jsx(se,{provider:"twitter",sx:{width:20,height:20}}),component:e.jsx(mt,{})},{name:"auth0",title:G.PROVIDER_NAME.auth0,icon:e.jsx(se,{provider:"auth0",sx:{width:20,height:20}}),component:e.jsx(ct,{})}],ft=["github","google","apple","twitter","auth0"];function gt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=c?.settings?.oauth||{},o=Object.keys(n).sort((l,j)=>n[l]?.order!==void 0&&n[j]?.order!==void 0?n[l].order-n[j].order:n[l]?.order!==void 0?-1:1);for(const l of ft)o.includes(l)||o.push(l);const r=ie(o.reduce((l,j,v)=>Object.assign(l,{[j]:v}),{})),x=H(()=>{const l=[...xt];return l.sort((j,v)=>r[j.name]-r[v.name]),l.map(j=>({...j,enabled:n[j.name]?.enabled??!1}))},[r.auth0,r.github,r.google]),i={};typeof window<"u"&&(i.context=window);const p=u(async l=>{const j={};Object.keys(l).forEach(v=>{j[v]={order:l[v]}}),await b.configOAuth({input:{did:t,oauth:JSON.stringify(j)}})}),d=u((l,j)=>{const v=x[l],S=x[j];r[v.name]=j,r[S.name]=l}),f=u(async()=>{await p(r)});return e.jsx(a,{sx:{".section-left":{width:"180px"}},children:e.jsx(We,{backend:Ve,...i,children:x.map((l,j)=>e.jsx(Re,{index:j,id:l.name,title:l.title,icon:l.icon,onMove:d,onEnd:f,defaultExpand:l.enabled,children:l.component},l.name))})})}const J={ttl:ve.SESSION_TTL,cacheTtl:ve.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function U(b){return e.jsx(it,{...b,sx:{transform:"scale(0.75)"}})}function fe(b,c=!1){const t=c?b.ttl*86400:b.ttl/86400;return{...b,ttl:t}}function jt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=Xe({},J,c?.settings?.session||{});de(n.ttl)&&(n.ttl=J.ttl),de(n.cacheTtl)&&(n.cacheTtl=J.cacheTtl),n.phone||(n.phone=J.phone),n.email||(n.email=J.email),de(n.enableBlacklist)&&(n.enableBlacklist=J.enableBlacklist);const{handleSubmit:o,control:r,formState:x,reset:i,watch:p}=te({defaultValues:Z(fe(n),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:d}=ee(),f=p("email.enabled"),l=p("phone.enabled"),j=p("email.enableDomainBlackList"),v=p("email.enableDomainWhiteList"),{fields:S,append:g,remove:w}=De({control:r,name:"email.domainBlackList"}),{fields:h,append:s,remove:I}=De({control:r,name:"email.domainWhiteList"}),L=u(async m=>{try{const{blocklet:A}=await b.updateAppSessionConfig({input:{did:t,config:et(fe(m,!0),["phone"])}}),_=Object.assign({},J,Z(A?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));i(fe(_)),O.success(d("common.configSuccess"))}catch(A){O.error(A.message)}});return e.jsx(bt,{onSubmit:o(L),children:e.jsxs(W,{direction:"column",sx:{gap:6},children:[e.jsxs(a,{children:[e.jsxs(a,{children:[e.jsx(Q,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.profile")}),e.jsx(a,{component:oe,sx:{my:3}})]}),e.jsxs(W,{sx:{gap:2},children:[e.jsx(y,{title:d("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enabled",control:r,render:({field:m})=>e.jsx(U,{...m,checked:m.value})})})}),f&&e.jsxs(W,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(y,{title:d("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireVerified",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireUnique",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.trustOauthProviders",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainBlackList",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),j&&e.jsxs(a,{children:[S.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainBlackList.${A}`,control:r,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>w(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>g(""),children:d("blocklet.config.session.addDomain")})]}),e.jsx(y,{title:d("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainWhiteList",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),v&&e.jsxs(a,{children:[h.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainWhiteList.${A}`,control:r,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>I(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>s(""),children:d("blocklet.config.session.addDomain")})]})]}),e.jsxs(a,{sx:{display:"none"},children:[e.jsx(y,{title:d("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.enabled",control:r,disabled:!0,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),l&&e.jsxs(W,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(y,{title:d("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireVerified",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireUnique",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(a,{children:[e.jsx(Q,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.period")}),e.jsx(a,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(k,{name:"ttl",control:r,rules:{min:1,max:30},render:({field:m})=>e.jsx(B,{fullWidth:!0,sx:{mb:2},children:e.jsx(y,{title:d("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(Je,{...m,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(a,{children:[e.jsx(Q,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.experimentalSettings")}),e.jsx(a,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(y,{title:d("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"enableBlacklist",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})})]}),e.jsx(a,{children:e.jsx(V,{type:"submit",variant:"contained",disabled:!x.isDirty,children:d("oauth.save")})})]})})}const bt=Fe.form`
|
|
1
|
+
import{T as ee,H as O,P as X,a7 as Ee,a8 as Ue,a9 as We,aa as Ve,c as K,a1 as je,b as ke,q as Me,n as z,ab as _e,j as Ne,k as $e,p as Ie}from"./vendor-ux-B9VfuZTg.js";import{b as u,a as H,g as ie,c as He}from"./vendor-hooks-BlA8TRnZ.js";import{r as D}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as a,b6 as R,am as ce,y as B,z as F,Q as V,T as Q,I as le,a3 as oe,W as E,b1 as W,bb as qe,cb as Le,cE as Je,at as Fe,D as ye,ah as Be,cF as Oe,a6 as be,cG as Ze,a$ as Ke}from"./vendor-mui-core-DRxbhqaK.js";import{X as N,a9 as M,V as G,bd as se,c as ve,b8 as Ge,aW as Qe,W as Ye}from"./index-kYJKn2jR.js";import{A as Z,Q as Xe,b as de,Z as et,n as Y,$ as tt,C as nt,a as st}from"./vendor-utils-CUDP56Ff.js";import{u as te,C as k,a as De}from"./index.esm-JPZAjt0x.js";import{S as ae}from"./switch-control-DEpBEl7-.js";import{S as y}from"./section-ZPKr6_ii.js";import{d as ot}from"./keyboard-arrow-down-rounded-8U0_i9QO.js";import{u as it}from"./index-DlrQ2HQP.js";import{v as at}from"./index-Ba9-ArMT.js";import{r as rt}from"./base32-BK7MXAD4.js";import{u as lt}from"./use-mobile-BQQpAf3i.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./required-BT8zXV8U.js";const we={width:24,height:24,body:'<path fill="currentColor" d="M5 4v16V4v5v-5Zm3 10h2.675q.275-.575.638-1.075t.812-.925H8q-.425 0-.713.288T7 13q0 .425.288.713T8 14Zm0 4h2.075Q10 17.5 10 17t.075-1H8q-.425 0-.713.288T7 17q0 .425.288.713T8 18Zm-3 4q-.825 0-1.413-.588T3 20V4q0-.825.588-1.413T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762V10.3q-.475-.15-.975-.225T17 10V9h-4q-.425 0-.713-.288T12 8V4H5v16h5.675q.275.575.638 1.075t.812.925H5Zm12-10q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12Zm0 8q.275 0 .463-.188t.187-.462q0-.275-.187-.463T17 18.7q-.275 0-.463.188t-.187.462q0 .275.188.463T17 20Zm0-6q-.475 0-.875.238t-.65.637q-.1.15-.025.313t.25.237q.15.075.3 0t.275-.2q.125-.175.313-.275t.412-.1q.325 0 .563.213t.237.537q0 .275-.15.463t-.35.387q-.15.15-.313.3t-.287.35q-.075.15-.113.313t-.037.337q0 .225.125.413t.325.187q.2 0 .325-.15t.125-.35q0-.275.15-.488t.35-.412q.3-.275.525-.613t.225-.737q0-.675-.5-1.138T17 14Z"/>'},ue={enabled:!1,domain:"",clientId:"",clientSecret:""};function ct(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...ue},c?.settings?.oauth?.auth0||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(ue))}),l=d("enabled"),j=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({auth0:s})}}),L=Object.assign({...ue},I?.settings?.oauth?.auth0||{});f(L),O.success(t("oauth.saveSuccess"))}catch(I){O.error(I.message||t("oauth.saveFailed"))}}),v=u(s=>s?.trim()?!0:t("oauth.auth0.domainDescription")),S=u(s=>s?.trim()?!0:t("oauth.auth0.clientIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.auth0.clientSecretDescription")),w=u(()=>!0),h=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[n]);return e.jsx(a,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(a,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.auth0.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(a,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:h,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:s})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.auth0.domain"),children:e.jsx(k,{name:"domain",control:i,rules:{validate:l?v:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.domain"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?S:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.clientId"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?g:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.auth0.clientSecret"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const he={enabled:!1,clientId:"",clientSecret:""};function dt(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...he},c?.settings?.oauth?.github||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(he))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({github:h})}}),I=Object.assign({...he},s?.settings?.oauth?.github||{});f(I),O.success(t("oauth.saveSuccess"))}catch(s){O.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.github.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.github.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[n]);return e.jsx(a,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(a,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.github.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(a,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:i,sx:{alignItems:"center"},render:({field:h})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},size:"small",checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.github.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.github.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.github.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.github.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function ut(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...me},c?.settings?.oauth?.google||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(me))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({google:h})}}),I=Object.assign({...me},s?.settings?.oauth?.google||{});f(I),O.success(t("oauth.saveSuccess"))}catch(s){O.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.google.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.google.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[n]);return e.jsx(a,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(a,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.google.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(a,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:h})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.google.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.google.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.google.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.google.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function ht(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...pe},c?.settings?.oauth?.apple||{}),{handleSubmit:r,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(pe))}),f=p("enabled"),l=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({apple:s})}}),L=Object.assign({...pe},I?.settings?.oauth?.apple||{});d(L),O.success(t("oauth.saveSuccess"))}catch(I){O.error(I.message||t("oauth.saveFailed"))}}),j=u(s=>s?.trim()?!0:t("oauth.apple.teamIdDescription")),v=u(s=>s?.trim()?!0:t("oauth.apple.serviceIdDescription")),S=u(s=>s?.trim()?!0:t("oauth.apple.keyIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.apple.authKeyDescription")),w=u(s=>s?.trim()?!0:t("oauth.apple.bundleIdDescription")),h=u(()=>!0);return e.jsx(a,{children:e.jsxs("form",{onSubmit:r(l),disabled:!0,children:[e.jsx(y,{title:t("oauth.apple.enable"),mb:2.5,children:e.jsx(k,{name:"enabled",control:x,render:({field:s})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.apple.teamId"),children:e.jsx(k,{name:"teamId",control:x,rules:{validate:f?j:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.teamId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.bundleId"),children:e.jsx(k,{name:"bundleId",control:x,rules:{validate:f?w:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.bundleId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.serviceId"),children:e.jsx(k,{name:"serviceId",control:x,rules:{validate:f?v:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.serviceId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.keyId"),children:e.jsx(k,{name:"keyId",control:x,rules:{validate:f?S:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.keyId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.authKey"),children:e.jsx(k,{name:"authKey",control:x,rules:{validate:f?g:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.apple.authKey"),multiline:!0,rows:4,error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:r(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const xe={enabled:!1,clientId:"",clientSecret:""};function mt(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...xe},c?.settings?.oauth?.twitter||{}),{handleSubmit:r,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(xe))}),f=p("enabled"),l=u(async g=>{try{const{blocklet:w}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({twitter:g})}}),h=Object.assign({...xe},w?.settings?.oauth?.twitter||{});d(h),O.success(t("oauth.saveSuccess"))}catch(w){O.error(w.message||t("oauth.saveFailed"))}}),j=u(g=>g?.trim()?!0:t("oauth.twitter.clientIdDescription")),v=u(g=>g?.trim()?!0:t("oauth.twitter.clientSecretDescription")),S=u(()=>!0);return e.jsx(a,{children:e.jsxs("form",{onSubmit:r(l),disabled:!0,children:[e.jsx(y,{title:e.jsx(a,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:t("oauth.twitter.enable")})}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:x,sx:{alignItems:"center"},render:({field:g})=>e.jsx(R,{control:e.jsx(ae,{sx:{ml:1},size:"small",checked:g.value,...g})})})}),e.jsx(y,{title:t("oauth.twitter.clientId"),children:e.jsx(k,{name:"clientId",control:x,rules:{validate:f?j:S},render:({field:g})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",label:t("oauth.twitter.clientId"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.twitter.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:x,rules:{validate:f?v:S},render:({field:g})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",type:"password",label:t("oauth.twitter.clientSecret"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:r(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const pt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Re({id:b,title:c,children:t,index:n,onMove:o,defaultExpand:r=!1,onEnd:x,icon:i=null}){const[p,d]=D.useState(r),f=D.useRef(null),l=D.useRef(null),[{handlerId:j},v]=Ee({accept:"dragItem",collect(s){return{handlerId:s.getHandlerId()}},hover(s,I){if(!f.current)return;const L=s.index,m=n;if(L===m)return;const A=f.current?.getBoundingClientRect(),_=l.current?.getBoundingClientRect(),re=(_.bottom-_.top)/2,$=I.getClientOffset().y-A.top;L<m&&$<re||L>m&&$>re||(o(L,m),s.index=m)}}),[{isDragging:S},g]=Ue({item:{index:n,type:"dragItem"},collect:s=>({isDragging:s.isDragging()}),end:x});g(l),v(f);const w=S?.5:1,h=u(s=>{s.preventDefault(),s.stopPropagation(),d(!p)});return e.jsxs(a,{ref:f,children:[e.jsxs(a,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:l,"data-handler-id":j,children:[e.jsxs(a,{sx:{py:2,px:1,opacity:w,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:h,children:[e.jsx(a,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(X,{fontSize:20,icon:pt})}),e.jsx(a,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:i}),e.jsx(Q,{sx:{flex:1},children:c}),e.jsx(le,{size:"small",sx:{pointerEvents:"auto",transform:p?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(X,{icon:ot,style:{transform:"scale(1.5)"}})})]}),e.jsx(oe,{})]}),e.jsx(a,{sx:{pl:4,py:2.5,display:p?"block":"none"},children:t})]})}Re.propTypes={title:E.string.isRequired,id:E.string.isRequired,children:E.node.isRequired,index:E.number.isRequired,onMove:E.func.isRequired,onEnd:E.func.isRequired,defaultExpand:E.bool,icon:E.any};const xt=[{name:"github",title:G.PROVIDER_NAME.github,icon:e.jsx(se,{provider:"github",sx:{width:20,height:20}}),component:e.jsx(dt,{})},{name:"google",title:G.PROVIDER_NAME.google,icon:e.jsx(se,{provider:"google",sx:{width:20,height:20}}),component:e.jsx(ut,{})},{name:"apple",title:G.PROVIDER_NAME.apple,icon:e.jsx(se,{provider:"apple",sx:{width:20,height:20}}),component:e.jsx(ht,{})},{name:"twitter",title:G.PROVIDER_NAME.twitter,icon:e.jsx(se,{provider:"twitter",sx:{width:20,height:20}}),component:e.jsx(mt,{})},{name:"auth0",title:G.PROVIDER_NAME.auth0,icon:e.jsx(se,{provider:"auth0",sx:{width:20,height:20}}),component:e.jsx(ct,{})}],ft=["github","google","apple","twitter","auth0"];function gt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=c?.settings?.oauth||{},o=Object.keys(n).sort((l,j)=>n[l]?.order!==void 0&&n[j]?.order!==void 0?n[l].order-n[j].order:n[l]?.order!==void 0?-1:1);for(const l of ft)o.includes(l)||o.push(l);const r=ie(o.reduce((l,j,v)=>Object.assign(l,{[j]:v}),{})),x=H(()=>{const l=[...xt];return l.sort((j,v)=>r[j.name]-r[v.name]),l.map(j=>({...j,enabled:n[j.name]?.enabled??!1}))},[r.auth0,r.github,r.google]),i={};typeof window<"u"&&(i.context=window);const p=u(async l=>{const j={};Object.keys(l).forEach(v=>{j[v]={order:l[v]}}),await b.configOAuth({input:{did:t,oauth:JSON.stringify(j)}})}),d=u((l,j)=>{const v=x[l],S=x[j];r[v.name]=j,r[S.name]=l}),f=u(async()=>{await p(r)});return e.jsx(a,{sx:{".section-left":{width:"180px"}},children:e.jsx(We,{backend:Ve,...i,children:x.map((l,j)=>e.jsx(Re,{index:j,id:l.name,title:l.title,icon:l.icon,onMove:d,onEnd:f,defaultExpand:l.enabled,children:l.component},l.name))})})}const J={ttl:ve.SESSION_TTL,cacheTtl:ve.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function U(b){return e.jsx(it,{...b,sx:{transform:"scale(0.75)"}})}function fe(b,c=!1){const t=c?b.ttl*86400:b.ttl/86400;return{...b,ttl:t}}function jt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=Xe({},J,c?.settings?.session||{});de(n.ttl)&&(n.ttl=J.ttl),de(n.cacheTtl)&&(n.cacheTtl=J.cacheTtl),n.phone||(n.phone=J.phone),n.email||(n.email=J.email),de(n.enableBlacklist)&&(n.enableBlacklist=J.enableBlacklist);const{handleSubmit:o,control:r,formState:x,reset:i,watch:p}=te({defaultValues:Z(fe(n),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:d}=ee(),f=p("email.enabled"),l=p("phone.enabled"),j=p("email.enableDomainBlackList"),v=p("email.enableDomainWhiteList"),{fields:S,append:g,remove:w}=De({control:r,name:"email.domainBlackList"}),{fields:h,append:s,remove:I}=De({control:r,name:"email.domainWhiteList"}),L=u(async m=>{try{const{blocklet:A}=await b.updateAppSessionConfig({input:{did:t,config:et(fe(m,!0),["phone"])}}),_=Object.assign({},J,Z(A?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));i(fe(_)),O.success(d("common.configSuccess"))}catch(A){O.error(A.message)}});return e.jsx(bt,{onSubmit:o(L),children:e.jsxs(W,{direction:"column",sx:{gap:6},children:[e.jsxs(a,{children:[e.jsxs(a,{children:[e.jsx(Q,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.profile")}),e.jsx(a,{component:oe,sx:{my:3}})]}),e.jsxs(W,{sx:{gap:2},children:[e.jsx(y,{title:d("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enabled",control:r,render:({field:m})=>e.jsx(U,{...m,checked:m.value})})})}),f&&e.jsxs(W,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(y,{title:d("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireVerified",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireUnique",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.trustOauthProviders",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainBlackList",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),j&&e.jsxs(a,{children:[S.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainBlackList.${A}`,control:r,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>w(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>g(""),children:d("blocklet.config.session.addDomain")})]}),e.jsx(y,{title:d("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainWhiteList",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),v&&e.jsxs(a,{children:[h.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainWhiteList.${A}`,control:r,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>I(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>s(""),children:d("blocklet.config.session.addDomain")})]})]}),e.jsxs(a,{sx:{display:"none"},children:[e.jsx(y,{title:d("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.enabled",control:r,disabled:!0,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),l&&e.jsxs(W,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(y,{title:d("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireVerified",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireUnique",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(a,{children:[e.jsx(Q,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.period")}),e.jsx(a,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(k,{name:"ttl",control:r,rules:{min:1,max:30},render:({field:m})=>e.jsx(B,{fullWidth:!0,sx:{mb:2},children:e.jsx(y,{title:d("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(Je,{...m,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(a,{children:[e.jsx(Q,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.experimentalSettings")}),e.jsx(a,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(y,{title:d("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"enableBlacklist",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})})]}),e.jsx(a,{children:e.jsx(V,{type:"submit",variant:"contained",disabled:!x.isDirty,children:d("oauth.save")})})]})})}const bt=Fe.form`
|
|
2
2
|
max-width: 1536px;
|
|
3
3
|
|
|
4
4
|
.advanced-config {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{W as o,j as n,ak as f,f as y,bh as I,av as j,D as L}from"./vendor-mui-core-DRxbhqaK.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,a2 as W,T as A,m as B,K as Z}from"./vendor-ux-B9VfuZTg.js";import{aV as H,aZ as V,a_ as Y,a$ as C,k as K,b0 as P,b1 as G,b2 as J,al as Q,b3 as N,b4 as U}from"./index-
|
|
1
|
+
import{W as o,j as n,ak as f,f as y,bh as I,av as j,D as L}from"./vendor-mui-core-DRxbhqaK.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,a2 as W,T as A,m as B,K as Z}from"./vendor-ux-B9VfuZTg.js";import{aV as H,aZ as V,a_ as Y,a$ as C,k as K,b0 as P,b1 as G,b2 as J,al as Q,b3 as N,b4 as U}from"./index-kYJKn2jR.js";import{Y as X,I as ee,Z as ne}from"./vendor-utils-CUDP56Ff.js";import{a as oe}from"./vendor-hooks-BlA8TRnZ.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
font-size: 14px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u}from"./vendor-react-Dvs43sk9.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bn as B,I as P,a6 as W,bF as M,aj as X,bG as G}from"./vendor-mui-core-DRxbhqaK.js";import{C as H}from"./Google-E3u2a9g7.js";import{c as U}from"./vendor-ux-B9VfuZTg.js";import{c as Y}from"./create-passport-svg-n0J1kwzH.js";import{A as $}from"./vendor-arcblock-DeeG8u0h.js";import{e as J}from"./index-
|
|
1
|
+
import{r as u}from"./vendor-react-Dvs43sk9.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bn as B,I as P,a6 as W,bF as M,aj as X,bG as G}from"./vendor-mui-core-DRxbhqaK.js";import{C as H}from"./Google-E3u2a9g7.js";import{c as U}from"./vendor-ux-B9VfuZTg.js";import{c as Y}from"./create-passport-svg-n0J1kwzH.js";import{A as $}from"./vendor-arcblock-DeeG8u0h.js";import{e as J}from"./index-kYJKn2jR.js";import{R as Q}from"./required-BT8zXV8U.js";import{F as Z}from"./form-wrapper-Dt1iJZge.js";import{L as v}from"./logo-uploader-CN181syA.js";import{A as ee,a as ne,b as te}from"./collapse-DJGzUM1Q.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(H,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?$(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:J.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=G`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,at as r}from"./vendor-mui-core-DRxbhqaK.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{c as a}from"./vendor-ux-B9VfuZTg.js";import{r as n}from"./index-
|
|
1
|
+
import{j as t,at as r}from"./vendor-mui-core-DRxbhqaK.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{c as a}from"./vendor-ux-B9VfuZTg.js";import{r as n}from"./index-kYJKn2jR.js";import"./vendor-utils-CUDP56Ff.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as qr}from"./vendor-utils-CUDP56Ff.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ag as Se,ah as jr,ai as xr,aj as Nr,ak as _r,al as Kr,am as Sr,an as Tr,ao as ke,ap as Ur,aq as Br,ar as Dr,as as Mr,a6 as Lr,r as Cr}from"./vendor-ux-B9VfuZTg.js";import{bf as Or,az as Vr}from"./index-
|
|
1
|
+
import{B as qr}from"./vendor-utils-CUDP56Ff.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ag as Se,ah as jr,ai as xr,aj as Nr,ak as _r,al as Kr,am as Sr,an as Tr,ao as ke,ap as Ur,aq as Br,ar as Dr,as as Mr,a6 as Lr,r as Cr}from"./vendor-ux-B9VfuZTg.js";import{bf as Or,az as Vr}from"./index-kYJKn2jR.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
|
|
2
2
|
`),I=oe(m).split(`
|
|
3
3
|
`),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p}from"./vendor-react-Dvs43sk9.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-DRxbhqaK.js";import{a as j}from"./vendor-hooks-BlA8TRnZ.js";import{_ as r}from"./index-
|
|
1
|
+
import{r as p}from"./vendor-react-Dvs43sk9.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-DRxbhqaK.js";import{a as j}from"./vendor-hooks-BlA8TRnZ.js";import{_ as r}from"./index-kYJKn2jR.js";import{T as A}from"./vendor-ux-B9VfuZTg.js";import{l as C}from"./arrow-down.svg-BIpNdtOh.js";import{L as O,D as H}from"./vendor-mui-x-Qp6zkx78.js";import{A as R}from"./AdapterDayjs-Bp0ir26R.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:T="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const h=e?r(n).tz(e):r(n);i(new Date(h.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:T,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:T=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[h,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),_=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},M=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>T?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>_(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:M,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:h})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,D as M,T as _,ce as T,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as Y,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-DRxbhqaK.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aU as te}from"./index-
|
|
1
|
+
import{j as a,D as M,T as _,ce as T,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as Y,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-DRxbhqaK.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aU as te}from"./index-kYJKn2jR.js";import{e as ie}from"./vendor-hooks-BlA8TRnZ.js";import{M as re,l as m,X as A,Z as S}from"./vendor-ux-B9VfuZTg.js";import{z as oe}from"./vendor-arcblock-DeeG8u0h.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DRxbhqaK.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{c as S,n as p}from"./vendor-ux-B9VfuZTg.js";import{a as C}from"./page-header-DvSb4Cmz.js";import{a9 as g}from"./index-
|
|
1
|
+
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DRxbhqaK.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{c as S,n as p}from"./vendor-ux-B9VfuZTg.js";import{a as C}from"./page-header-DvSb4Cmz.js";import{a9 as g}from"./index-kYJKn2jR.js";import{o as b}from"./vendor-arcblock-DeeG8u0h.js";import{u as k}from"./config-space-BLuDOEKJ.js";import{C as y,D as v,a as w}from"./connect-to-D-Tb_fXt.js";import{S as c}from"./step-actions-DTwta5X_.js";import{S as E}from"./layout-Yt1Ps3ty.js";import"./vendor-utils-CUDP56Ff.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";import"./spaces-M_qE7wW_.js";import"./api-rC33aBSs.js";import"./index-Ha4kS6kt.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-Y8LQew4k.js";import"./index-DBs9Ljax.js";import"./use-mobile-D6YQgajG.js";import"./content-layout-B9tc9LCL.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{T as default};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import{j as e,y as Pt,bc as Pe,M as ie,ak as x,Q as H,W as u,J as pe,c1 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Be,P as Le,b6 as Q,a5 as We,z as Qe,A as Je,ci as At,bh as Mt,U as je,db as zt,dc as Et,at as X,dd as Bt,a6 as Z,n as ae,D as Lt,de as Wt,ar as Oe,b1 as Re,df as Ot,aX as Dt,am as Ce,bq as Nt,br as ye,a$ as $t,cW as Ut}from"./vendor-mui-core-DRxbhqaK.js";import{r as y,a as Ft,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Ht,a8 as Gt,R as De,D as Kt,C as le,n as V,A as Yt}from"./vendor-utils-CUDP56Ff.js";import{a as Vt,F as Zt,bw as Qt,c as Ie,W as Jt,bx as Xt,aW as Te,U as xe,bd as er,by as tr,a6 as rr,aY as nr,a7 as or,bz as sr}from"./index-kYJKn2jR.js";import{a as R,h as et,k as ee,g as G,b as B,j as ir}from"./vendor-hooks-BlA8TRnZ.js";import{l as tt}from"./arrow-down.svg-BIpNdtOh.js";import{c as Ae,P as O,T as W,aw as ar,k as rt,ax as lr,H as q,ay as cr,az as dr,aA as Ne,f as ur,n as nt,e as Me,aB as pr,aC as M,C as xr,B as fr,$ as ot,aD as hr,aE as gr,A as mr,o as ce,I as $e,j as br,a1 as Ue}from"./vendor-ux-B9VfuZTg.js";import{N as yr}from"./list-CWTC1dNA.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-YluGbYkj.js";import{h as _e,T as wr}from"./team-BxHvUIQ6.js";import{b as jr,d as Cr,a as Sr,c as kr,e as Pr,f as Rr,h as Ir,_ as Tr}from"./user-center-uDx2x7Sm.js";import{T as qe,O as Ar}from"./index-B3Wj0Nic.js";import{c as Mr}from"./passport-C9JudxNO.js";import{N as st,U as it}from"./index-4foCOGch.js";import{u as te}from"./use-mobile-D6YQgajG.js";import zr from"./index-kK-2wGsh.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-DlrQ2HQP.js";import{U as ve}from"./user-sessions-B3zzrErP.js";import Er from"./index-DgBkBy0d.js";import{o as Br}from"./vendor-arcblock-DeeG8u0h.js";import{c as Lr,b as de,a as Wr,S as Or}from"./index-Ha4kS6kt.js";import"./index-Y8LQew4k.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-CxhX_9BD.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DeRDwip-.js";import"./util-B8m2D-S9.js";import"./base32-BK7MXAD4.js";import"./session-C838MSz1.js";import"./isURL-DOKl6zP6.js";import"./use-app-logo-ezyDWOV9.js";import"./index-Bdipd-mG.js";import"./use-mobile-BQQpAf3i.js";import"./actions-B4VXcSRp.js";import"./index-Ba9-ArMT.js";import"./form-text-input-CwOsIY5R.js";import"./required-BT8zXV8U.js";import"./form-wrapper-Dt1iJZge.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-Ffd9R2jw.js";import"./permission-B4abezk1.js";import"./confirm-Cs-v9Ueu.js";import"./click-to-copy-CO6UIqva.js";import"./invitations-BKP1NV2c.js";import"./create-passport-svg-n0J1kwzH.js";import"./api-rC33aBSs.js";import"./table-tips-rCE1XKlc.js";import"./passport-item-VF3cWzrN.js";import"./did-address-DnFNwELW.js";import"./index-CE80LF06.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-Bp0ir26R.js";import"./delete-confirm-D-H3beUW.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function o({root:s,rootMargin:n,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:n,threshold:i}),p=a.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:s,rootMargin:n,threshold:i}),entryCallbacks:r},a.set(l,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:o}}var $r="0px",Ur=[0],Fr=Nr();function _r(t){let o=t?.rootMargin??$r,s=t?.threshold??Ur,n=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:i.current,rootMargin:o,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[o,s]),f=y.useCallback(()=>{let C=a.current,v=n.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),n.current=C,r()},[r,f]),m=y.useCallback(C=>{f(),i.current=C,r()},[r,f]);return[h,{entry:l,rootRef:m}]}var qr=_r;function Hr(t){let[o,s]=qr(t),n=!!s.entry?.isIntersecting,[i,a]=y.useState(n);return n&&!i&&a(!0),[o,{...s,isVisible:n,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:o,onLoadMore:s,rootMargin:n,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:n});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&o;return y.useEffect(()=>{if(h){let m=setTimeout(()=>{l.current()},a);return()=>{clearTimeout(m)}}},[h,a]),[p,{rootRef:r}]}var Vr=Yr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ue.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ue({severity:t,size:o=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:o,height:o,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}at.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function at({theme:t="dark",type:o="button",onSelectType:s,extra:n=void 0,currentTab:i="",loading:a=!1,...l}){const{t:p}=y.useContext(Ae),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=g=>{(g!==i||!a)&&s(g)},h=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:o==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return o==="line"?Object.assign(g,{}):g},[o,t]),m=(g,S,T)=>e.jsx(H,{disabled:a,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...l,children:g.label},g.value||T),C=(g,S,T)=>e.jsx(H,{variant:"text",disabled:a,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...l,children:g.label},g.value||T),v=()=>r?.map((g,S)=>{const T=i===g?.value;return o==="line"?e.jsx(y.Fragment,{children:C(g,T,S)},g.value||S):e.jsx(y.Fragment,{children:m(g,T,S)},g.value||S)}),c=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return o==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:i||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(tt,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ie,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ue,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:h,children:[e.jsx(x,{sx:{...o==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:o,onChange:s}){const{t:n}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(o.pageCount<=0||i)return null;const a=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=o.page-1<=0?0:o.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:o.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${n()}more than ${f}`}`,rowsPerPage:o.pageSize,onPageChange:a,onRowsPerPageChange:l})})}const Zr=y.memo(lt),Qr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},He=6,Ge={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Jr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Jr,width:"calc(50% - 8px)"});ct.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function ct({onFilterChange:t=()=>{},loading:o=!1,type:s="service",blockletMap:n={},filterType:i="component",selectedId:a=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:m}=y.useContext(Ae),[C,v]=y.useState(null),c=!!C,[g,S]=y.useState(a),[T,P]=y.useState(l),[b,E]=y.useState(!1),[z,F]=y.useState(""),[N,j]=y.useState([]);y.useEffect(()=>{S(a),P(l)},[a,l]);const k=[{label:m("notification.filterType.all"),value:"all"},{label:m("notification.filterType.unread"),value:"unread"}],D=d=>{(d!==h||!o)&&f(d)},K=[{label:m("notification.severityType.info"),value:"info"},{label:m("notification.severityType.success"),value:"success"},{label:m("notification.severityType.warning"),value:"warning"},{label:m("notification.severityType.error"),value:"error"}],re=d=>{v(d.currentTarget),F(""),E(!1)},he=()=>{v(null)},ne=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(w),t({id:w,severity:T})},oe=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:g})},ge=d=>{F(d.target.value)},me=()=>{E(!b)},Y=Ft.useMemo(()=>{if(!n.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,L=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:L,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,i,m]);y.useEffect(()=>{if(z.trim()==="")j(Y);else{const d=z.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[z,Y]);const be=z.trim()!==""||b?N:N.slice(0,He);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:k.map(d=>e.jsxs(H,{disabled:o,onClick:()=>D(d.value),className:`profile-button ${h===d.value?"active":""}`,sx:{...s==="service"&&h===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx($,{size:"small",onClick:re,disabled:o,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:m("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:m("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Le,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(We,{checked:T.includes(d.value),onChange:()=>oe(d.value),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ue,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:m("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:z,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Be,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Le,{elevation:0,sx:Ke(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(We,{checked:g.includes(d.id),onChange:()=>ne(d.id),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx(Fe,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),N.length>He&&z.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),g.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ue,{severity:d}),w?w.label:d]}),onDelete:()=>oe(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=Y.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Fe,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>ne(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Xr=X(Bt)`
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 20px;
|
|
4
|
+
right: 20px;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
@media (max-width: 600px) {
|
|
7
|
+
bottom: 16px;
|
|
8
|
+
right: 16px;
|
|
9
|
+
transform: scale(0.9);
|
|
10
|
+
}
|
|
11
|
+
`;function en(){const[t,o]=y.useState(!1);y.useEffect(()=>{const n=Xe(()=>{o(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(zt,{in:t,children:e.jsx(Xr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Et,{})})})}const tn=X.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: ${t=>t.inDialog?0:"24px"};
|
|
15
|
+
.MuiContainer-root {
|
|
16
|
+
padding-right: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.profile-button.MuiButtonBase-root {
|
|
20
|
+
border-radius: 9999px;
|
|
21
|
+
margin-right: 2px;
|
|
22
|
+
padding: 5px 12px;
|
|
23
|
+
line-height: 22px;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
border: 1px solid transparent;
|
|
26
|
+
background-color: ${({theme:t})=>t.palette.background.default};
|
|
27
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
border: 1px solid ${({theme:t})=>t.palette.divider} !important;
|
|
30
|
+
}
|
|
31
|
+
.profile-button.active.MuiButtonBase-root,
|
|
32
|
+
.profile-button.active.MuiButtonBase-root:hover {
|
|
33
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
background-color: ${({theme:t})=>ae(t.palette.primary.main,.1)};
|
|
36
|
+
border: 1px solid ${({theme:t})=>ae(t.palette.primary.main,.24)} !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.profile-button.MuiButtonBase-root:hover {
|
|
40
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.profile-line-button.MuiButtonBase-root {
|
|
44
|
+
margin-right: 2px;
|
|
45
|
+
color: ${({theme:t})=>t.palette.text.secondary};
|
|
46
|
+
padding: 5px 12px;
|
|
47
|
+
line-height: 22px;
|
|
48
|
+
font-size: 13px;
|
|
49
|
+
border: none !important;
|
|
50
|
+
border-radius: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.profile-line-button.active.MuiButtonBase-root {
|
|
54
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
55
|
+
border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.profile-button.MuiButtonBase-root:last-of-type,
|
|
59
|
+
.profile-line-button.MuiButtonBase-root {
|
|
60
|
+
margin-right: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.profile-line-button.MuiButtonBase-root:hover {
|
|
64
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
65
|
+
background-color: unset;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
* {
|
|
69
|
+
scrollbar-width: none; /* Firefox */
|
|
70
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
*::-webkit-scrollbar {
|
|
74
|
+
display: none; /* Chrome, Safari and Opera */
|
|
75
|
+
}
|
|
76
|
+
`;dt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function dt({blocklets:t=[],context:o,pagination:s=!0,inDialog:n=!1,filterType:i="component",toViewAll:a=()=>{},type:l="service"}){const{data:p,paging:r,refresh:f,loading:h,params:m,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:g}=o,S=d=>{f({...m,severity:d&&typeof d=="string"?[d]:d||[],paging:{...m.paging,page:1}})},[T]=_t(),P=R(()=>T.get("id"),[T]),b=pe(d=>d.breakpoints.down("md")),[E,z]=y.useState(0),[F,N]=y.useState(!1),j=y.useMemo(()=>m.read===!1?"unread":"all",[m.read]),k=R(()=>Xe(d=>{if(h)return;const w=p.length,A=p.filter(_=>!_e(_)).length;let L={...m,append:!0,paging:{...m.paging,...d,currentPage:(r.currentPage||0)+1}};j==="unread"&&A<w&&d.page>m.paging.page&&(L={...m,append:!0,paging:{...m.paging,...d,page:m.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(L)},500),[p,m,j,r,h,f]);et(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&z(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),N(!0)},100),setTimeout(()=>{N(!1)},3e3)},[P]);const D=R(()=>p?.length>0&&p.length<E,[p,E]),K=y.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(L=>L)];return v?.includes(d)||A.findIndex(L=>L===d)>-1},[v]),re=y.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(L=>{d.has(L)||d.set(L,w)})),w?.children?.length>0&&w.children.forEach(L=>{const _=L?.did||L.meta?.did;_&&!d.has(_)&&K(_)&&(L.ancestors=[w],d.set(_,L))})}),d},[t,K]),he=y.useCallback(()=>{h||k({page:r.page+1})},[r.page,h,k]),[ne]=Vr({loading:h,hasNextPage:D,onLoadMore:he}),oe=d=>{!d||_e(d)||C(d.id).then(()=>{n&&a()})},ge=({severity:d,id:w})=>{if(h)return;let A={};i==="component"?A={entityId:[],componentDid:w}:i==="entity"&&(A={componentDid:[],entityId:w}),f({...m,severity:d,...A,paging:{...m.paging,page:1}})},me=d=>{if(h)return;let w={...m,paging:{...m.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=Ht(w,"read"),f(w)},Y=R(()=>i==="component"?Array.isArray(m.componentDid)?m.componentDid:[]:i==="entity"?Array.isArray(m.entityId)?m.entityId:[]:[],[m,i]),be=R(()=>(Array.isArray(m.severity)?m.severity:[])[0]||"",[m.severity]);return e.jsxs(tn,{inDialog:!!n,children:[n?e.jsx(at,{currentTab:be,type:"line",theme:"light",onSelectType:S}):e.jsx(ct,{loading:h,blockletMap:re,unReadCount:c,filterType:i,type:l,selectedId:Y,onFilterChange:ge,severity:m.severity,onReadFilterChange:me,currentReadFilter:j}),!b&&h?e.jsx(x,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):e.jsx(yr,{data:p,blockletMap:re,onReadNotification:oe,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&F,type:l}),s&&!b?e.jsx(Zr,{loading:h,paging:r,onChange:k}):null,s&&b&&(h||D)?e.jsx(x,{ref:ne,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):null,!n&&b?e.jsx(en,{}):null]})}const rn=y.memo(dt),U=new Qt;function fe(t){const{userDid:o=""}={},{session:s}=Vt(),n=R(()=>{if(o)return o;const r=window.location.href,f=Gt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,o]),i=R(()=>s.user,[s]),a=R(()=>i?n===i?.did:!1,[n,i?.did]),l=ee(async()=>{if(await Zt(()=>s?.initialized),a)return s.user;if(n)return U.user.getUserPublicInfo({did:n})},{refreshDeps:[n,a,s?.initialized,i]}),p=R(()=>i.passports?.some(r=>r.role===Ie.ROLES.OWNER),[i]);return{currentDid:n,session:s,isMyself:a,user:i,viewUser:l.data,isOwner:p}}function ut({user:t,...o}){const{t:s}=W(),n=Lt(),i=R(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===ar.REVOKED}));return p.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),De(p.filter(r=>!r.display),"role").concat(De(p.filter(r=>r.display),"display.content"))},[t?.passports]),a=R(()=>i?.find(p=>p.name===t.role),[i,t?.role]),l=n.palette.primary.main;return i.length===0?e.jsx(x,{children:e.jsx(rt,{children:s("userCenter.noPassport")})}):e.jsx(x,{...o,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,...o.sx},children:i.map(p=>e.jsx(jr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Mr,title:a&&a.role===p.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:a&&a.role===p.role?`0px 2px 4px 0px ${l}, 0px 1px 2px -1px ${l}, 0px 0px 0px 1px ${l} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ut.propTypes={user:u.object.isRequired};function nn({visible:t,onClose:o,nft:s}){return!t||!s?null:e.jsx(on,{children:e.jsx(Wt,{open:t,onClose:o,children:e.jsx(sn,{onClick:o,children:e.jsx(st,{data:it(s),address:s.address,inset:!0})})})})}const on=X.div`
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
.mask {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mask {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
background: rgba(0, 0, 0, 0.6);
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transition: opacity 0.2s;
|
|
100
|
+
}
|
|
101
|
+
`,sn=X.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
height: 100vh;
|
|
106
|
+
width: 100vw;
|
|
107
|
+
|
|
108
|
+
img,
|
|
109
|
+
object {
|
|
110
|
+
max-width: 90vw;
|
|
111
|
+
max-height: 75vh;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nft-display--inset {
|
|
115
|
+
> .MuiBox-root,
|
|
116
|
+
.nft-display__loading {
|
|
117
|
+
width: 75vmin;
|
|
118
|
+
height: 75vmin;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:ae(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:ae(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ye="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:o}=W(),s=te(),[n,i]=y.useState({visible:!1,nft:null}),[a,l]=y.useState({anchorEl:null,props:null}),p=P=>{const b=le(Ye,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let E="";typeof b.data?.value=="string"?E=JSON.parse(b.data?.value)?.domain:E=b.data?.value?.domain,l({anchorEl:P,props:{title:E?`Hey, I just won an NFT at the ${E} event!`:"Hey, I just won an NFT!",url:le(Ye,"assets",b.address)}})},f=P=>{i({visible:!0,nft:P})},h=G({page:1,size:20}),m=ee(async(P=h)=>(await Kt.get(`${Ie.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&h,defaultParams:[h],refreshDeps:[t?.did,h]}),{loading:C,data:v}=m,c=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{h.page=b,m.run(h)},S=B(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Oe,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Oe,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:o("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:o("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Re,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||h.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:h.page,onChange:g,count:Math.ceil(c.total/h.size),size:"small"}):null,e.jsx(nn,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{i({visible:!1,nft:null})}}),e.jsx(lr,{anchorEl:a.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:a.props||{title:"",url:""}})]})},[C,c,h.page,h.size,g,a,n]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:o,isMyself:s,viewUser:n}=fe();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:o})]}):null,e.jsx(pt,{user:s?o:n})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:o}){const{t:s,changeLocale:n}=W(),i=G({locale:t.locale,loading:!1}),a=B(async l=>{try{const{value:p}=l.target;i.loading=!0,await U.user.saveProfile({locale:p}),await o("profile"),n(p),i.locale=p}catch(p){q.error(J(p))}finally{i.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Pe,{value:i.locale,onChange:a,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ie,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=V,onDelete:o=V,onSave:s=V,onCancel:n=V,type:i="slack",url:a="",edit:l=!1}){const{t:p}=W(),r=G({type:i||"slack",url:a||"",edit:l??!1,error:"",loading:!1}),f=B(()=>r.url?Jt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),h=B(()=>{r.edit=!1,r.url=a||"",r.type=i||"slack",r.error="",r.loading=!1,n()}),m=B(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=B(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Z,{size:16}):e.jsx($,{size:"small",onClick:C(m),sx:{mr:-1},children:e.jsx(O,{icon:Cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Pe,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ie,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ie,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Je,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:cr})}),e.jsx($,{color:"error",onClick:h,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:dr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Sr})}),e.jsx($,{color:"error",onClick:()=>{o({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:kr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function se({title:t=void 0,description:o=void 0,value:s,onChange:n,isMobile:i}){const a=B(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:a,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:i?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:i?"normal":"nowrap"},children:[t,o]})]})}se.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:o}){const{t:s}=W(),n=G({showAdd:!1}),i=ee(async()=>await U.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),a=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...i?.data?.notifications||{}}),[i?.data?.notifications]),l=R(()=>i?.data?.webhooks||[],[i?.data?.webhooks]),p=B(async v=>{try{await U.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),i.run()}catch(c){q.error(J(c))}}),r=B(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await U.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(J(c))}},h=B(async v=>{await p({webhooks:l.filter((c,g)=>g!==v)})}),m=B(async(v,c)=>{await p({webhooks:l.map((g,S)=>S===v?c:g)})}),C=B(async v=>{await p({webhooks:[...l,v]}),n.showAdd=!1});return i.error?e.jsx(Dt,{severity:"error",children:i.error.message}):i.loading||!i.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Z,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{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(se,{value:a.wallet,isMobile:o,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(ur,{did:Ne(t),showQrcode:!1,showAvatar:!o,copyable:!0,compact:!0,responsive:!0,startChars:o?2:6})}),e.jsx(se,{value:a.email,isMobile:o,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(se,{isMobile:o,value:a.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Re,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>h(c),onSave:(...g)=>m(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Pr}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function ht({item:t}){const o=Me(),{blocklet:s}=Xt(),{confirmApi:n,confirmHolder:i}=Te(),a=G({loading:!1}),{t:l}=W(),{session:p}=y.use(xe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:h,baseUrl:m}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>pr[t?.provider]||"unknown",[t?.provider]),g=B(b=>b?._bind?b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY&&o.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&o.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=B(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,E)=>{n.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(z){C({session:p,connectedAccount:t}).then(b).catch(E),z()},onCancel:b})});return}try{a.loading=!0,await new Promise((b,E)=>{if(t?._bind)n.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(z){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(E),z()},onCancel:b});else if(t.provider===M.WALLET)n.open({title:l("userCenter.thirdPartyLogin.confirmBindWallet",{name:c}),content:l("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:l("common.cancel"),onConfirm:z=>{p.bindWallet({onSuccess:b,onCancel:E}),z()},onCancel:b});else{const z=m,F=window?.blocklet;let N="/";const j=xr(F),k=fr(F);j&&k?.appPid&&p?.user?.sourceAppPid&&(N=k.appUrl),h(N),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(E).finally(()=>{h(z),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{a.loading=!1}}),T=B(b=>b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):b?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=B(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(o.arcSphere||o.wallet)?!0:!!t._mainProvider,[o.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{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(er,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(qe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:tr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(qe,{title:g(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:b=>{const E=b.palette.error.main,z=b.palette.primary.main;return{color:t?._bind?E:z,borderColor:t?._bind?E:z,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?E:z,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:a.loading?null:e.jsx(O,{icon:Rr}),onClick:S,disabled:P(t),loading:a.loading,children:T(t)})})}),i]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:o}=y.use(xe),[s,n]=y.useState({}),{getOAuthConfigs:i}=o.useOAuth(),a=Me();ir(async()=>{const r=await i({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=hr(t);let f=!1,h="",m=gr(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,h=M.GOOGLE,m===M.AUTH0&&(m=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,h=M.APPLE,m===M.AUTH0&&(m=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,h=M.GITHUB,m===M.AUTH0&&(m=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const g=f&&c.provider===h?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===m}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===m}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),a.wallet||a.arcSphere?null:e.jsx(rr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:o}){const[s,n]=y.useState(t),{t:i}=W(),a=B(async(l,p)=>{try{const r=await U.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(i("userCenter.saveSuccess")),o("privacy")}catch(r){q.error(J(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(x,{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(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?a(l.key,f?"all":"private"):a(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;a(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:o}){const s=R(()=>(t?.passports||[])?.find(n=>n.name===o.role),[t?.passports,o?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:o.avatar,did:o.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ce,{title:o.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:o.fullName})}),e.jsx(je,{label:s?.title||s?.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(Ce,{title:o.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ve=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ze={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new nr({concurrency:1}),ze=y.memo(({userSession:t,isMobile:o=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:n,locale:i}=W();y.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const a=R(()=>o?{display:"flex",justifyContent:"flex-end"}:{},[o]);return e.jsx(x,{...o&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Ue,{size:16,className:"ip-address",style:a,locale:i,children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{size:16,className:"ip-address",style:a,locale:i,children:t.lastLoginIp||n("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Z,{size:12,color:"inherit"})}):null]})})});ze.propTypes={userSession:u.object.isRequired,isMobile:u.bool};ze.defaultProps={isMobile:!1};function yt({user:t,showAction:o=!0,showUser:s=!0,getUserSessions:n,showOffline:i=!1}){const a=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=mr(),{t:r,locale:f}=W(),h=te({key:"md"}),m=pe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Te(),c=B(async()=>{const j=await n({page:a.page,pageSize:a.pageSize,status:a.status}),k=j?.paging?.total||0;return l[a.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const g=ee(c,{refreshDeps:[a.status,a.page,a.pageSize]}),S=R(()=>g.data?.list||[],[g.data?.list]),T=R(()=>{const{status:j}=a;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>ce({},h?Ze:{}),[h]),b=B(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=a,{list:D=[]}=g.data||{},K=D.length||0;k>1&&K===1&&(a.page=Math.max(k-1,1)),g.refresh(),C.close()}})}),E=B(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(a.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(a.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({status:a.status,visitorId:p,includeFederated:!0}),a.page=1,g.refresh(),C.close()}})}),z=[];o&&z.push(e.jsx(Ce,{title:r("userCenter.logoutAllTips",{type:r(a.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:E,disabled:T,children:r("userCenter.logoutAll",{type:r(a.status)})})},"logoutAll"));const F=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:a.page-1,rowsPerPage:a.pageSize,count:g.data?.total||0}),[g.data?.total,a.page,a.pageSize]),N=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.os?.name,D.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.browser?.name,D.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:ce({minWidth:150,maxWidth:250},h?Ze:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx($e,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!i&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx($e,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(ze,{userSession:k,isMobile:h})}}},o&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>b({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:h?"unset":m?"calc(100vw - 300px)":"100%",...h&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...h&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(br,{count:g.data?.total||0,data:S,columns:N,customButtons:z,options:F,locale:f,loading:g.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{a.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),i?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{a.page=j.page+1,a.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:o}=Te(),{t:s}=W(),{session:n}=y.use(xe),i=B(async()=>{if(!t||typeof t!="function")return;const a=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await a(),n.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:i,children:s("userCenter.dangerZone.delete")})]})}),o]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=te({key:"md"}),o=pe(i=>i.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=R(()=>ce({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":o?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:i=>`${i.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:n})})}function wt({onDestroySelf:t=void 0,userCenterTabs:o=[]}){const{t:s}=W(),{user:n,session:i,isMyself:a,isOwner:l}=fe(),r=Me().arcSphere,f=te({key:"md"}),h=ee(async()=>n&&a?await U.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,a],loadingDelay:300}),m=R(()=>o.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[o]),C=B(async c=>c==="privacy"?(await h.runAsync(),h.data):(c==="profile"&&await i.refresh(),null));y.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:n,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:m,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:n,showUser:!1,getUserSessions:c=>U.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,m,f,l,t]);return a?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:ce({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=y.createContext({}),{Provider:fn,Consumer:Ro}=jt;function Ct({children:t}){const[o]=y.useState(!1),{session:s}=y.use(xe),{user:n}=s,[i,a]=y.useState(),l=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{a(n?.didSpace)},[n?.didSpace]);const p=async()=>{a(void 0)},r=m=>{},f=async m=>{a(m),await r(m.endpoint)},h=!!(l&&i);return e.jsx(fn,{value:{loading:o,spaceGateway:i,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:h},children:t})}function Ee(){return y.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const o=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return le(o,"space",n)}function St({session:t,spaceGateway:o,spaceStatus:s,refresh:n}){return e.jsxs(Re,{direction:"row",spacing:1,children:[s===Lr.DISCONNECTED&&e.jsx(de,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:i=>{console.error(i),q.error(J(i))}}),e.jsx($,{size:"small",LinkComponent:$t,href:hn(o.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:o}=W(),{updateSpaceGateway:s,session:n}=Ee(),i=te(),a=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:o("userCenter.storage.spaces.connected.title")}),!i&&e.jsx(de,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:a})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:n,...l})},t.endpoint)}),i&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(de,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:a})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:o,session:s}=Ee(),n=({spaceGateway:i})=>o(i);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(de,{session:s,onSuccess:n})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:o,loading:s}=Ee(),{isMyself:n}=fe();return n?s?e.jsx(Br,{relative:"parent",children:e.jsx(Z,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:o?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=X(x)`
|
|
122
|
+
height: 100%;
|
|
123
|
+
overflow-y: auto;
|
|
124
|
+
`;function vn(){const{user:t,isMyself:o,viewUser:s}=fe(),{followed:n}=Ir();return e.jsx(x,{children:e.jsx(Dr,{teamDid:window?.blocklet?.did||"",user:o?t:s,showInvitees:o,followed:n})})}function wn({tab:t=""}){const{api:o}=or(),s=y.useRef(null),n=qt(),i=t||n.tab,l=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),p=sr(),r=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(h=>({...h,meta:{...h,did:h.did,name:h.name||h.title||"",logo:"logo.png"}}))})),f=async h=>{const{input:m,sessionId:C}=h;try{await o.destroySelf({input:{...m,sessionId:C}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(wr,{mode:"user-center",children:e.jsxs(Tr,{ref:s,embed:l==="1",currentTab:i?le(Ie.WELLKNOWN_SERVICE_PATH_PREFIX,"user",i):"",disableAutoRedirect:i==="settings",children:[i==="notifications"?e.jsx(rn,{blocklets:[r],context:p}):null,i==="nfts"?e.jsx(cn,{}):null,i==="settings"?e.jsx(wt,{onDestroySelf:f}):null,i==="did-spaces"?e.jsx(bn,{}):null,i==="user-followers"?e.jsx(vn,{}):null,i==="orgs"?e.jsx(Ar,{id:n.id||""}):null]})})}wn.propTypes={tab:u.string};export{wn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as v,g as We,a as qe}from"./vendor-react-Dvs43sk9.js";import{g as Ue,k as Z}from"./vendor-hooks-BlA8TRnZ.js";import{j as e,ak as t,at as W,b1 as K,a6 as B,aX as He,am as G,co as Ge,U as Ke,T as F,a3 as Ye,W as S,z as O,M as X,I as _,cp as ge,cb as je,A as Ve,x as Ze,c3 as Xe,c4 as ee,bw as Je,F as Qe,bc as es,s as ss}from"./vendor-mui-core-DRxbhqaK.js";import{T as A,b as $,p as ts,j as ae,I as se,H as D,n as N,k as re,O as ye,x as ve,a3 as as,a0 as rs}from"./vendor-ux-B9VfuZTg.js";import{X as P,o as os,_ as be,c as M,B as Q,a9 as ns,e as is,V as ls,$ as V,b6 as cs}from"./index-
|
|
1
|
+
import{r as v,g as We,a as qe}from"./vendor-react-Dvs43sk9.js";import{g as Ue,k as Z}from"./vendor-hooks-BlA8TRnZ.js";import{j as e,ak as t,at as W,b1 as K,a6 as B,aX as He,am as G,co as Ge,U as Ke,T as F,a3 as Ye,W as S,z as O,M as X,I as _,cp as ge,cb as je,A as Ve,x as Ze,c3 as Xe,c4 as ee,bw as Je,F as Qe,bc as es,s as ss}from"./vendor-mui-core-DRxbhqaK.js";import{T as A,b as $,p as ts,j as ae,I as se,H as D,n as N,k as re,O as ye,x as ve,a3 as as,a0 as rs}from"./vendor-ux-B9VfuZTg.js";import{X as P,o as os,_ as be,c as M,B as Q,a9 as ns,e as is,V as ls,$ as V,b6 as cs}from"./index-kYJKn2jR.js";import{W as oe}from"./did-address-DnFNwELW.js";import{u as z}from"./team-BxHvUIQ6.js";import{a as ne,r as ie,b as le,c as Se,d as J,e as ds,u as ps,f as us}from"./passport-item-VF3cWzrN.js";import{p as Ce}from"./util-B8m2D-S9.js";import{u as ms}from"./use-mobile-BQQpAf3i.js";import{v as H}from"./index-Y8LQew4k.js";import{w as q,P as fs}from"./permission-B4abezk1.js";import{C as xs}from"./Google-E3u2a9g7.js";import{c as hs}from"./create-passport-svg-n0J1kwzH.js";import{A as gs}from"./vendor-arcblock-DeeG8u0h.js";import{G as Y,_ as js}from"./vendor-utils-CUDP56Ff.js";import{e as Te}from"./edit.svg-DycWG9v3.js";import{H as ce,P as ys}from"./index-Ffd9R2jw.js";import{C as we}from"./confirm-Cs-v9Ueu.js";import{L as Ie}from"./list-header-DMpz8A8v.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-DFuQZPPV.js";import"./lottie-web-4koyQiv_.js";import"./session-C838MSz1.js";import"./isURL-DOKl6zP6.js";import"./use-app-logo-ezyDWOV9.js";import"./index-DeRDwip-.js";import"./base32-BK7MXAD4.js";import"./cloneDeep-LRq4Ya2k.js";import"./lock.svg-COUP8tyO.js";const me="info";function De({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=Ue({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(Pe,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Ae,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Le,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx($,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(bs,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ts,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}De.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const bs=W(t)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|