@abtnode/blocklet-services 1.16.53-beta-20251009-113612-7a16b6a0 → 1.16.53-beta-20251011-054719-4ed2f6b7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routes/user-session.js +14 -3
- package/api/routes/user.js +9 -6
- package/dist/assets/{access-control-CTocOnrY.js → access-control-abOzA88J.js} +1 -1
- package/dist/assets/{add-component-core-ChMhkX_e.js → add-component-core-DyP5DXP3.js} +1 -1
- package/dist/assets/{add-resource-BQMxE4TR.js → add-resource-D1RE_D63.js} +1 -1
- package/dist/assets/{addon-B1SOMf-o.js → addon-BQpY5mGN.js} +1 -1
- package/dist/assets/{advanced-BeUvs5a-.js → advanced-BAAkbQ7v.js} +1 -1
- package/dist/assets/{aigne-BFbK-Dx1.js → aigne-BIxsGdE6.js} +1 -1
- package/dist/assets/{appearance-BjJHVOrD.js → appearance-DLL_c3H7.js} +1 -1
- package/dist/assets/{arrow-down.svg-CnYWDYHP.js → arrow-down.svg-B0yKIpV_.js} +1 -1
- package/dist/assets/{audit-logs-CYyFSo7D.js → audit-logs-BjqQg10C.js} +1 -1
- package/dist/assets/{authorize-C9NR3hcn.js → authorize-zdSPMvPb.js} +1 -1
- package/dist/assets/{bind-account-EzHCVNcL.js → bind-account-MeFLW0-t.js} +1 -1
- package/dist/assets/{branding-C6k_gnic.js → branding-BGqwD_8z.js} +1 -1
- package/dist/assets/{branding-iucefL5d.js → branding-CZ3msR8C.js} +1 -1
- package/dist/assets/{branding-D14MEcTS.js → branding-DdfX0yE_.js} +1 -1
- package/dist/assets/{bundle-avatar-Bbip6Pw_.js → bundle-avatar-BnsIGAGk.js} +1 -1
- package/dist/assets/{complete-DBBI-G-v.js → complete-BKOQngoV.js} +1 -1
- package/dist/assets/{component-BuKDir1W.js → component-ZLIptWjb.js} +3 -3
- package/dist/assets/{config-B7yZVsVx.js → config-CZV6cEQO.js} +1 -1
- package/dist/assets/{config-uTQPBtNY.js → config-DETFzZFy.js} +1 -1
- package/dist/assets/{config-CGESXcGy.js → config-DuFudWCR.js} +1 -1
- package/dist/assets/{config-navigation-Ci4sw2Mg.js → config-navigation-Ckddb7Ew.js} +2 -2
- package/dist/assets/{config-space-CIxZdD1U.js → config-space-BMQcYhX4.js} +1 -1
- package/dist/assets/{confirm-CRSsToIg.js → confirm-BWJyxR1P.js} +1 -1
- package/dist/assets/{connect-BA-e5Sky.js → connect-8ijsDqc0.js} +1 -1
- package/dist/assets/{connect-D_SRcELW.js → connect-ByF8W-k5.js} +1 -1
- package/dist/assets/{connect-to-DPxJtWAi.js → connect-to-DsrMYUbG.js} +1 -1
- package/dist/assets/{dashboard-CdEA39BJ.js → dashboard-dvSAjP1V.js} +2 -2
- package/dist/assets/{delete-confirm-BOL7KX0x.js → delete-confirm-C5O8wEbn.js} +1 -1
- package/dist/assets/{domain-C02xJ2j2.js → domain-UcW2NDgQ.js} +1 -1
- package/dist/assets/{domain-action-card-BYDa5XpT.js → domain-action-card-C4LewNdA.js} +1 -1
- package/dist/assets/{domains-CeH-Is8l.js → domains-a52EIu7f.js} +1 -1
- package/dist/assets/{email-CgqDRKYJ.js → email-DeJqm_cT.js} +1 -1
- package/dist/assets/engine-BOS99Pm4.js +1 -0
- package/dist/assets/{exchange-passport-SXEaleiF.js → exchange-passport-Bk3KCI7e.js} +1 -1
- package/dist/assets/{form-kOntOXIX.js → form-BzuOEtWl.js} +1 -1
- package/dist/assets/{fuel-DvIA5Tre.js → fuel-CqEiaVyB.js} +1 -1
- package/dist/assets/{gen-access-key-D6gAc7bG.js → gen-access-key-DPvESsAt.js} +1 -1
- package/dist/assets/{gen-simple-access-key-BfvI0i1-.js → gen-simple-access-key-BDFpf0Fe.js} +1 -1
- package/dist/assets/{get-safe-url-BVWVLDco.js → get-safe-url-VPE7525h.js} +1 -1
- package/dist/assets/{home-Bbu96BmU.js → home-D88mAORC.js} +1 -1
- package/dist/assets/{iframe-B-WaBiaG.js → iframe-C132otWW.js} +1 -1
- package/dist/assets/{index-BqNVAj3b.js → index-1FCrRa8S.js} +1 -1
- package/dist/assets/{index-MSxXwe2g.js → index-2yXoHCF5.js} +1 -1
- package/dist/assets/{index-CW83LAem.js → index-4N6JSZ-1.js} +1 -1
- package/dist/assets/{index-EE_leCro.js → index-4iRJnRDb.js} +1 -1
- package/dist/assets/{index-B9UOYoTi.js → index-BHZw9zYL.js} +1 -1
- package/dist/assets/{index-BWkRqWUV.js → index-BO1dYT6j.js} +1 -1
- package/dist/assets/{index-KhL4--33.js → index-BS4gI6Je.js} +1 -1
- package/dist/assets/{index-MjpHZ4K2.js → index-BY2B2juN.js} +1 -1
- package/dist/assets/{index-ChG9_ZZV.js → index-BhwFkAf9.js} +1 -1
- package/dist/assets/{index-BPjsO-fA.js → index-BuM1x7gd.js} +1 -1
- package/dist/assets/{index-C5weIh5R.js → index-CDK4fL-O.js} +5 -5
- package/dist/assets/{index-B5ctIRcA.js → index-CLKzAwdz.js} +1 -1
- package/dist/assets/{index-BwK-dbsY.js → index-CSpvJyY6.js} +1 -1
- package/dist/assets/{index-Czh1GNRc.js → index-CfnfoDga.js} +1 -1
- package/dist/assets/{index-Bne2IVDb.js → index-CoDgpGOM.js} +2 -2
- package/dist/assets/{index-CsM_pYF8.js → index-CocTzKAu.js} +1 -1
- package/dist/assets/{index-B0HVlpUv.js → index-CouqM1KS.js} +1 -1
- package/dist/assets/{index-DeWjB4q9.js → index-DBMcmgkV.js} +1 -1
- package/dist/assets/{index-DI0tEMGN.js → index-DU1RbZz3.js} +1 -1
- package/dist/assets/{index-yyZ56Avq.js → index-D_TfbqtN.js} +1 -1
- package/dist/assets/{index-CCGTCthU.js → index-Dk4snkhP.js} +1 -1
- package/dist/assets/index-Dnczsrey.js +281 -0
- package/dist/assets/{index-Dn2h6APz.js → index-DqZvBosz.js} +1 -1
- package/dist/assets/{index-DtY0rQzd.js → index-G6mLFBwo.js} +3 -3
- package/dist/assets/{index-pSrG3Rtm.js → index-LVfZZmHk.js} +1 -1
- package/dist/assets/{index-BtyqZ8ix.js → index-lPn5f6-V.js} +1 -1
- package/dist/assets/{invitation-DvFWKTOM.js → invitation-Cb4EkBcb.js} +1 -1
- package/dist/assets/{invitations-CD5qt7h8.js → invitations-D3Zrof2P.js} +1 -1
- package/dist/assets/{invite-CMqMLqon.js → invite-BR4XYB-m.js} +1 -1
- package/dist/assets/{isURL-Drc7oe8g.js → isURL-C1DcW1a5.js} +1 -1
- package/dist/assets/{issue-passport-BR40SDVR.js → issue-passport-BdoYSf2e.js} +1 -1
- package/dist/assets/{item-DwykRAIj.js → item-CkI92KM4.js} +1 -1
- package/dist/assets/{landing-page-BTu1Wo51.js → landing-page-B5oo2gYB.js} +1 -1
- package/dist/assets/{layout-_Ka_GN5x.js → layout-BZEqr9pw.js} +1 -1
- package/dist/assets/{list-TG9HMVa3.js → list-CDnwzHEF.js} +1 -1
- package/dist/assets/{list-C4b_Znkz.js → list-IzlvL0Cm.js} +1 -1
- package/dist/assets/{localization-CqBu9Ts-.js → localization-BicvVG1z.js} +1 -1
- package/dist/assets/{log-BFOgPn13.js → log-BLFD38SA.js} +1 -1
- package/dist/assets/{login-oauth-callback-BuNQ-CRv.js → login-oauth-callback-DCxgtqJh.js} +1 -1
- package/dist/assets/{login-CUoIcXNe.js → login-tgh6A96Z.js} +1 -1
- package/dist/assets/{logo-uploader-l9C8sEUo.js → logo-uploader-CeiVmA8S.js} +1 -1
- package/dist/assets/{lost-passport-lnqu8OpR.js → lost-passport--U8zmxgu.js} +1 -1
- package/dist/assets/{open-window-B52q5qrk.js → open-window-M9ef-LkI.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DKbbN5W7.js → over-due-invoice-payment-W_gVc8Qj.js} +1 -1
- package/dist/assets/{overview-BITUbq3E.js → overview-DZA0nOyD.js} +1 -1
- package/dist/assets/{passport-WPJBoZJA.js → passport-Cd-yq0CU.js} +1 -1
- package/dist/assets/{passport-item-gIxDDwjF.js → passport-item-BEacxvYM.js} +1 -1
- package/dist/assets/{permission-BeGf253a.js → permission-DNqMBi19.js} +1 -1
- package/dist/assets/{preferences-D0Ol69r8.js → preferences-6Rdph3hk.js} +1 -1
- package/dist/assets/{profile-embed-YGIFeQVj.js → profile-embed-ChFmka39.js} +1 -1
- package/dist/assets/{publish-resource-fDNwoZVu.js → publish-resource-BtxG5C-8.js} +1 -1
- package/dist/assets/{runtime-DPpYl0V4.js → runtime-ChFuhKtK.js} +1 -1
- package/dist/assets/sdk-C7wG8QyH.js +1 -0
- package/dist/assets/{security-Jp9VavjR.js → security-PpRNxUG9.js} +1 -1
- package/dist/assets/{session-DEBZccHT.js → session-DqPgru1C.js} +1 -1
- package/dist/assets/{setup-3SRIuMWN.js → setup-oD1wO9rk.js} +1 -1
- package/dist/assets/{spaces-_v4BsoCo.js → spaces-DGH_8-cq.js} +1 -1
- package/dist/assets/{start-BaF8jQQs.js → start-C5yo46Q5.js} +1 -1
- package/dist/assets/{starting-progress-Bdr1122s.js → starting-progress-CG1Jhf-6.js} +1 -1
- package/dist/assets/{status-Kru479eT.js → status-aDx49LDx.js} +1 -1
- package/dist/assets/{step-actions-z2PSGmvy.js → step-actions-DMXYHHE_.js} +1 -1
- package/dist/assets/{studio-C8Cis2HF.js → studio-DWci_EEj.js} +1 -1
- package/dist/assets/{team-DjK1LiLV.js → team-DNwgDnjc.js} +1 -1
- package/dist/assets/{traffic-CxwOXUbM.js → traffic-Bixs5_Th.js} +1 -1
- package/dist/assets/{transfer-M0yRAOWx.js → transfer-Cz15cjFv.js} +1 -1
- package/dist/assets/{unsubscribe-CULX4z09.js → unsubscribe-CkZxyB3U.js} +1 -1
- package/dist/assets/{use-app-logo-BOmNYQgU.js → use-app-logo-Bbh3GZji.js} +1 -1
- package/dist/assets/{user-center-1elUCI9j.js → user-center-DkbCI7_Z.js} +2 -2
- package/dist/assets/{user-follower-CYu4VkvK.js → user-follower-BiV6IZnA.js} +1 -1
- package/dist/assets/{user-sessions-B_eqpmUt.js → user-sessions-WZG9FkqG.js} +1 -1
- package/dist/assets/{util-DUiP0chO.js → util-BilORIYw.js} +1 -1
- package/dist/assets/{util-DY1uHmM4.js → util-CT-nPa5g.js} +1 -1
- package/dist/assets/{wait-connect-DMl1x3Ld.js → wait-connect-Be6pglA3.js} +1 -1
- package/dist/assets/{wizard-Cq7OgF_R.js → wizard-B56tgdNq.js} +1 -1
- package/dist/assets/{wizard-components-CseIhcl0.js → wizard-components-4u9bZcdI.js} +1 -1
- package/dist/assets/{wrap-locale-DtJXVWeM.js → wrap-locale-CIO-ciR5.js} +1 -1
- package/dist/assets/{zh-CJ0qBy8e.js → zh-CZLHYA5h.js} +1 -1
- package/dist/assets/{zh-DS2mQXmf.js → zh-C_CaWCk3.js} +1 -1
- package/dist/assets/{zh-tw-Cs-zRk58.js → zh-tw-B-qWW0q8.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-Dde2jLpF.js +0 -1
- package/dist/assets/index-CuH2SZN0.js +0 -281
- package/dist/assets/sdk-Jn7q4_AB.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as B,ak as z,T as pe,z as gt,y as ht,bc as dt,M as Ct,Q as Me,at as ce,ar as lt,bb as xt,du as Et,dv as Rt,I as mt,dw as yt,D as bt,c2 as le,aj as wt,a6 as vt}from"./vendor-mui-core-DRxbhqaK.js";import{r as oe,p as Ve,g as It}from"./vendor-react-Dvs43sk9.js";import{x as St,g as Ze,u as Lt,j as Bt,e as _t,k as Tt}from"./vendor-hooks-BlA8TRnZ.js";import{K as Ht,R as Ot,_ as he,ag as ct}from"./vendor-ux-B9VfuZTg.js";import{ad as Nt}from"./vendor-utils-CUDP56Ff.js";import{mediaKitApi as Qt}from"./index-Bne2IVDb.js";import{r as De}from"./index-BPy8_fa2.js";import"./lottie-web-4koyQiv_.js";import"./index-C5weIh5R.js";import"./vendor-arcblock-DeeG8u0h.js";import"./index-DRYJ0xIl.js";const ft=oe.createContext({}),pt=()=>oe.useContext(ft);function qt({children:h,restrictions:f,i18n:w,theme:R}){const[x,b]=St({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=oe.useMemo(()=>({...x,onLoading:n,restrictions:f,i18n:w}),[x]);return B.jsx(Ht,{theme:R,children:B.jsx(ft.Provider,{value:e,children:h})})}const Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURBVHgB7d3RcdTIGoZhcSJYMoAMIAIgAiACIALIwBCBIQIgA4jAkAEZQAYmAx+6iqnjM+vxjD3qX/qk56niYm92wYve6W790ty5+GMACPCfASCEYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYghWsG/fvg137twp+/X8+fOhh9+/f5f9GdrPjFyCFezz589DpXaxt7iM7Z9//hkeP348VPj69etALsEK9uXLl6FSi1WvSL5+/Xqo8OnTpy7RpYZghZrqwusVybbCaiut3trPzCorl2CFqt4ObrRt4Y8fP4axtVi9fPlyqNBiTybBCvTr169JD497rVCePn06VOh1Fkd/ghVo6i3N+/fvhx7atvDBgwdDhQ8fPgzkEaxAvYJxqLY66bXCe/bs2VDBtjCTYIVpoWhbwqn1WqFU3S2celvN7QhWmKkO27eZyWIKghWmevZqFzNZTEGwgsztAjOTRTXBCjKX7e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QSCNYOVXcHHzx4sKjZq10qZ7J6nQNV3fH0RtvdBOsK7S981eFn5XZpSu0MyEzWYcxk7SZYV6h879VaXt5WeXBtJmu5BOsKVZ9u7S//GraDG5WjG0uYyeLfBGtL+2Qze9VH5cH1EmaybAv/TbC2VH6yLXW6/TqVj+qYyVoewbqkcvaqPTe4xvcfVT6qYyZreQTrksol+NLezHCoykd1zGQtj2BdUnV3sB20r3E7uFEVLDNZyyNYf1XOXq39e+gqZ8/MZC2LYP1VOXu1truD2yof1TGTtSyC9VfVp9jS38xwKDNZhzOT9T+CNdTOXlWdfcxd5aM6ZrKWQ7CG2k+wtd4d3Fb9qI6ZrGVYfbCq33u1pkdx9qncFprJWobVB6tyqb32w/ZtlfNMZrKWYfXB8maGaVWd6ZnJWgZfVQ/EcOgOxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",Mt=""+window.__toCdnUrl("assets/bedrock-yFRPpe__.png"),Zt=""+window.__toCdnUrl("assets/deepseek-C3x42pq3.png"),Dt=""+window.__toCdnUrl("assets/doubao-yPqHSkLx.png"),Gt=""+window.__toCdnUrl("assets/gemini-DffKpc81.png"),jt=""+window.__toCdnUrl("assets/google-DT1VSJ0m.png"),Vt=""+window.__toCdnUrl("assets/ideogram-REIjy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m469kNgLSBDm/1ehMvcY1ymFnx8LVrw+yGwFpClzR6roaWCUwueNQismVVrs4+1hxb8kvtYag3jCKwZxRsn0yi49JsiUws+vu9z7xnaeM9HYM0k0xOMozPVKjiztODvR0Mt+G0TWDPJMgq2bqVnasH3OVGV2gTWDDK12aON3nrFowVPKwJrokz3ts3RZh9riy14e1j5CKyJ4s2R5cbmtQudmVrwc/wSWfK1eFDrOAJrgnhTZBk/1hgFH8rUgo/RMM4gy8rqbRyBNVKmNvvV1VWq5nmWryXL6pf5CKyRMrXZs5xkei/LaKgFvz0Ca4S9tNnHylR1mNKC10bPR2ANtLc2+1jZWvBGw20QWAPstc0+VqYWfJxNRn0Ca4C9ttnHynSDdLTgs5z+GlwlHOfscKcDKMAKCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoIz/AWP7oZ6cDDZCAAAAAElFTkSuQmCC",ge={anthropic:Wt,bedrock:Mt,deepseek:Zt,doubao:Dt,gemini:Gt,google:jt,ideogram:Vt,ollama:Ft,openai:kt,openrouter:Yt,poe:Pt,xai:Ut},Fe={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function Kt({onSubmit:h,models:f}){const{loading:w,i18n:R}=pt(),x=Ze({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&h(t)},{run:n}=Lt(b,{wait:500}),e=oe.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(zt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(z,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(z,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(gt,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(z,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(ht,{fullWidth:!0,size:"small",children:B.jsx(dt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=f.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(z,{component:"img",src:ge[a.provider],alt:a.provider,style:Fe}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:f.map(t=>B.jsx(Ct,{value:`${t.provider}/${t.model}`,children:B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(z,{component:"img",src:ge[t.provider],alt:t.provider,style:Fe}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(Me,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:w||e,children:R(w?"aiImageGenerating":"aiImageGenerate")},w?"loading-submit":"submit")]})}const zt=ce(z)`
|
|
1
|
+
import{j as B,ak as z,T as pe,z as gt,y as ht,bc as dt,M as Ct,Q as Me,at as ce,ar as lt,bb as xt,du as Et,dv as Rt,I as mt,dw as yt,D as bt,c2 as le,aj as wt,a6 as vt}from"./vendor-mui-core-DRxbhqaK.js";import{r as oe,p as Ve,g as It}from"./vendor-react-Dvs43sk9.js";import{x as St,g as Ze,u as Lt,j as Bt,e as _t,k as Tt}from"./vendor-hooks-BlA8TRnZ.js";import{K as Ht,R as Ot,_ as he,ag as ct}from"./vendor-ux-B9VfuZTg.js";import{ad as Nt}from"./vendor-utils-CUDP56Ff.js";import{mediaKitApi as Qt}from"./index-CoDgpGOM.js";import{r as De}from"./index-BPy8_fa2.js";import"./lottie-web-4koyQiv_.js";import"./index-CDK4fL-O.js";import"./vendor-arcblock-DeeG8u0h.js";import"./index-DRYJ0xIl.js";const ft=oe.createContext({}),pt=()=>oe.useContext(ft);function qt({children:h,restrictions:f,i18n:w,theme:R}){const[x,b]=St({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=oe.useMemo(()=>({...x,onLoading:n,restrictions:f,i18n:w}),[x]);return B.jsx(Ht,{theme:R,children:B.jsx(ft.Provider,{value:e,children:h})})}const Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURBVHgB7d3RcdTIGoZhcSJYMoAMIAIgAiACIALIwBCBIQIgA4jAkAEZQAYmAx+6iqnjM+vxjD3qX/qk56niYm92wYve6W790ty5+GMACPCfASCEYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEE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gATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",Mt=""+window.__toCdnUrl("assets/bedrock-yFRPpe__.png"),Zt=""+window.__toCdnUrl("assets/deepseek-C3x42pq3.png"),Dt=""+window.__toCdnUrl("assets/doubao-yPqHSkLx.png"),Gt=""+window.__toCdnUrl("assets/gemini-DffKpc81.png"),jt=""+window.__toCdnUrl("assets/google-DT1VSJ0m.png"),Vt=""+window.__toCdnUrl("assets/ideogram-REIjy0Er.png"),Ft=""+window.__toCdnUrl("assets/ollama-C7MZn2d_.png"),kt=""+window.__toCdnUrl("assets/openai-DlpqJdrb.png"),Yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0dSURBVHgB7d1Nb1XXucDxlahAogQUUi6VSG+iQCT7CmJyS0FB5WYQRreT209wP1w7yqhpB3QSKrUgEYWQFkIlLCW4aTASxrGRbRryIqX7OXBSILzY2Od4P2v9ftIRBKkDv5x/13r23us89V2nACTwdAFIQrCANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEO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hsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoIz/AWP7oZ6cDDZCAAAAAElFTkSuQmCC",ge={anthropic:Wt,bedrock:Mt,deepseek:Zt,doubao:Dt,gemini:Gt,google:jt,ideogram:Vt,ollama:Ft,openai:kt,openrouter:Yt,poe:Pt,xai:Ut},Fe={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function Kt({onSubmit:h,models:f}){const{loading:w,i18n:R}=pt(),x=Ze({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&h(t)},{run:n}=Lt(b,{wait:500}),e=oe.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(zt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(z,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(z,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(gt,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(z,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(ht,{fullWidth:!0,size:"small",children:B.jsx(dt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=f.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(z,{component:"img",src:ge[a.provider],alt:a.provider,style:Fe}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:f.map(t=>B.jsx(Ct,{value:`${t.provider}/${t.model}`,children:B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(z,{component:"img",src:ge[t.provider],alt:t.provider,style:Fe}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(Me,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:w||e,children:R(w?"aiImageGenerating":"aiImageGenerate")},w?"loading-submit":"submit")]})}const zt=ce(z)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
height: 100%;
|
|
@@ -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-C5weIh5R.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-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`
|
|
2
2
|
max-width: 1536px;
|
|
3
3
|
|
|
4
4
|
.advanced-config {
|
|
@@ -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-CDK4fL-O.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{r as j,g as ge}from"./vendor-react-Dvs43sk9.js";import{j as o,T as H,z as $,x as ye,c3 as ve,c4 as Y,bw as je,F as Ce,bD as Te,aX as Fe,a6 as U,W as C,b6 as be,a5 as we,I as K,at as G,ak as B,J as Se,Q as Be,cb as De,am as Re}from"./vendor-mui-core-DRxbhqaK.js";import{X as L,b7 as ae,B as le,c as Ne}from"./index-
|
|
1
|
+
import{r as j,g as ge}from"./vendor-react-Dvs43sk9.js";import{j as o,T as H,z as $,x as ye,c3 as ve,c4 as Y,bw as je,F as Ce,bD as Te,aX as Fe,a6 as U,W as C,b6 as be,a5 as we,I as K,at as G,ak as B,J as Se,Q as Be,cb as De,am as Re}from"./vendor-mui-core-DRxbhqaK.js";import{X as L,b7 as ae,B as le,c as Ne}from"./index-CDK4fL-O.js";import{T as M,b as ce,n as E,H as z,E as ee,S as Pe}from"./vendor-ux-B9VfuZTg.js";import{e as ue}from"./edit.svg-DycWG9v3.js";import{C as He}from"./lock.svg-COUP8tyO.js";import{G as Ie,H as Ee}from"./vendor-utils-CUDP56Ff.js";import{f as pe}from"./index-DBs9Ljax.js";import{u as de}from"./team-DNwgDnjc.js";import{w as me,P as Le}from"./permission-DNqMBi19.js";import{C as Me}from"./confirm-BWJyxR1P.js";const _e=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));var A={exports:{}},W={exports:{}},te;function ke(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};W.exports=m}()),W.exports}var V,re;function ne(){if(re)return V;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return V=u,V}/*!
|
|
2
2
|
* Determine if an object is a Buffer
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -1,4 +1,4 @@
|
|
|
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 Le,P as Be,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 Lt,a6 as Z,n as ae,D as Bt,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-C5weIh5R.js";import{a as R,h as et,k as ee,g as G,b as E,j as ir}from"./vendor-hooks-BlA8TRnZ.js";import{l as tt}from"./arrow-down.svg-CnYWDYHP.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-TG9HMVa3.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-Bbip6Pw_.js";import{h as _e,T as wr}from"./team-DjK1LiLV.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-1elUCI9j.js";import{T as qe,O as Ar}from"./index-B5ctIRcA.js";import{c as Mr}from"./passport-WPJBoZJA.js";import{N as st,U as it}from"./index-pSrG3Rtm.js";import{u as te}from"./use-mobile-D6YQgajG.js";import zr from"./index-BtyqZ8ix.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-DlrQ2HQP.js";import{U as ve}from"./user-sessions-B_eqpmUt.js";import Er from"./index-BwK-dbsY.js";import{o as Lr}from"./vendor-arcblock-DeeG8u0h.js";import{c as Br,b as de,a as Wr,S as Or}from"./index-BPjsO-fA.js";import"./index-Y8LQew4k.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-CYu4VkvK.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-ChG9_ZZV.js";import"./util-DUiP0chO.js";import"./base32-BK7MXAD4.js";import"./session-DEBZccHT.js";import"./isURL-Drc7oe8g.js";import"./use-app-logo-BOmNYQgU.js";import"./index-BqNVAj3b.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-DI0tEMGN.js";import"./permission-BeGf253a.js";import"./confirm-CRSsToIg.js";import"./click-to-copy-CO6UIqva.js";import"./invitations-CD5qt7h8.js";import"./create-passport-svg-n0J1kwzH.js";import"./api-rC33aBSs.js";import"./table-tips-rCE1XKlc.js";import"./passport-item-gIxDDwjF.js";import"./did-address-DnFNwELW.js";import"./index-MSxXwe2g.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-Bp0ir26R.js";import"./delete-confirm-BOL7KX0x.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function n({root:s,rootMargin:o,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:o,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:o,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:n}}var $r="0px",Ur=[0],Fr=Nr();function _r(t){let n=t?.rootMargin??$r,s=t?.threshold??Ur,o=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=o.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:i.current,rootMargin:n,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[n,s]),f=y.useCallback(()=>{let C=a.current,v=o.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),o.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[n,s]=qr(t),o=!!s.entry?.isIntersecting,[i,a]=y.useState(o);return o&&!i&&a(!0),[n,{...s,isVisible:o,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:n,onLoadMore:s,rootMargin:o,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:o});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&n;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:n=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:n,height:n,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:n="button",onSelectType:s,extra:o=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:n==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return n==="line"?Object.assign(g,{}):g},[n,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 n==="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 n==="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:{...n==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:n,onChange:s}){const{t:o}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(n.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=n.page-1<=0?0:n.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:n.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${o()}more than ${f}`}`,rowsPerPage:n.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:n=!1,type:s="service",blockletMap:o={},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,z]=y.useState(!1),[L,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||!n)&&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(""),z(!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=()=>{z(!b)},Y=Ft.useMemo(()=>{if(!o.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[o,i,m]);y.useEffect(()=>{if(L.trim()==="")j(Y);else{const d=L.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,Y]);const be=L.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:n,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:n,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(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Be,{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:n,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:L,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{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:n,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&&L.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(Lt)`
|
|
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 Le,P as Be,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 Lt,a6 as Z,n as ae,D as Bt,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-CDK4fL-O.js";import{a as R,h as et,k as ee,g as G,b as E,j as ir}from"./vendor-hooks-BlA8TRnZ.js";import{l as tt}from"./arrow-down.svg-B0yKIpV_.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-CDnwzHEF.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-BnsIGAGk.js";import{h as _e,T as wr}from"./team-DNwgDnjc.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-DkbCI7_Z.js";import{T as qe,O as Ar}from"./index-CLKzAwdz.js";import{c as Mr}from"./passport-Cd-yq0CU.js";import{N as st,U as it}from"./index-LVfZZmHk.js";import{u as te}from"./use-mobile-D6YQgajG.js";import zr from"./index-lPn5f6-V.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-DlrQ2HQP.js";import{U as ve}from"./user-sessions-WZG9FkqG.js";import Er from"./index-CSpvJyY6.js";import{o as Lr}from"./vendor-arcblock-DeeG8u0h.js";import{c as Br,b as de,a as Wr,S as Or}from"./index-BuM1x7gd.js";import"./index-Y8LQew4k.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-BiV6IZnA.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BhwFkAf9.js";import"./util-BilORIYw.js";import"./base32-BK7MXAD4.js";import"./session-DqPgru1C.js";import"./isURL-C1DcW1a5.js";import"./use-app-logo-Bbh3GZji.js";import"./index-1FCrRa8S.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-DU1RbZz3.js";import"./permission-DNqMBi19.js";import"./confirm-BWJyxR1P.js";import"./click-to-copy-CO6UIqva.js";import"./invitations-D3Zrof2P.js";import"./create-passport-svg-n0J1kwzH.js";import"./api-rC33aBSs.js";import"./table-tips-rCE1XKlc.js";import"./passport-item-BEacxvYM.js";import"./did-address-DnFNwELW.js";import"./index-2yXoHCF5.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-Bp0ir26R.js";import"./delete-confirm-C5O8wEbn.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function n({root:s,rootMargin:o,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:o,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:o,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:n}}var $r="0px",Ur=[0],Fr=Nr();function _r(t){let n=t?.rootMargin??$r,s=t?.threshold??Ur,o=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=o.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:i.current,rootMargin:n,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[n,s]),f=y.useCallback(()=>{let C=a.current,v=o.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),o.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[n,s]=qr(t),o=!!s.entry?.isIntersecting,[i,a]=y.useState(o);return o&&!i&&a(!0),[n,{...s,isVisible:o,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:n,onLoadMore:s,rootMargin:o,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:o});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&n;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:n=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:n,height:n,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:n="button",onSelectType:s,extra:o=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:n==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return n==="line"?Object.assign(g,{}):g},[n,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 n==="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 n==="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:{...n==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:n,onChange:s}){const{t:o}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(n.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=n.page-1<=0?0:n.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:n.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${o()}more than ${f}`}`,rowsPerPage:n.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:n=!1,type:s="service",blockletMap:o={},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,z]=y.useState(!1),[L,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||!n)&&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(""),z(!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=()=>{z(!b)},Y=Ft.useMemo(()=>{if(!o.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[o,i,m]);y.useEffect(()=>{if(L.trim()==="")j(Y);else{const d=L.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,Y]);const be=L.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:n,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:n,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(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Be,{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:n,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:L,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{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:n,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&&L.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(Lt)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: 20px;
|
|
4
4
|
right: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as M,H as q,P as N,q as Y,k as ve,j as Ce,a0 as Se}from"./vendor-ux-B9VfuZTg.js";import{o as Te,k as le,t as Ie}from"./vendor-hooks-BlA8TRnZ.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bC as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as $,bf as _,a5 as J,V as G,S as Z,b4 as Oe,U as L,I as B,ci as Pe,bh as $e,a7 as Ae,F as qe,W as t,b1 as R,a3 as ce,c2 as ee,cj as Le,aO as Me,aP as Be,ck as Fe,cl as He,cm as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cn as Ve,aZ as Ye,cc as Je,bb as Qe,cb as Xe}from"./vendor-mui-core-DRxbhqaK.js";import{B as de,o as pe,l as ue}from"./index-ChG9_ZZV.js";import{X as K,c as xe,_ as Ge,a9 as Ze,b5 as Q}from"./index-C5weIh5R.js";import{u as V}from"./team-DjK1LiLV.js";import{u as et}from"./use-mobile-BQQpAf3i.js";import{u as tt,C as X}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-CUDP56Ff.js";import{C as st}from"./confirm-CRSsToIg.js";import{A as nt}from"./actions-B4VXcSRp.js";import{T as ie}from"./table-tips-rCE1XKlc.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./session-DEBZccHT.js";import"./isURL-Drc7oe8g.js";import"./use-app-logo-BOmNYQgU.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[f,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{b()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:f,error:w,loadData:b}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:f=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),b=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(J,{onChange:T,checked:l>0&&l===b}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx($,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(J,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Pe,{}):e.jsx($e,{})})]})]})}),m.length>0&&e.jsx(Ae,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),f&&e.jsx(qe,{error:!0,sx:{mt:1},children:f})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function be({id:i=null,url:u="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:b}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:b,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:b,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(f.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,f]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(X,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(X,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}be.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function fe(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Ge(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function P({value:i,label:u,tip:c="",divider:f=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx($,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),f&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();u[f]||(u[f]=[]),u[f]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:f,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:b,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map(A=>A.id===s.id?{...A,...s}:A);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await f.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find(A=>A?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx($,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
|
|
1
|
+
import{T as M,H as q,P as N,q as Y,k as ve,j as Ce,a0 as Se}from"./vendor-ux-B9VfuZTg.js";import{o as Te,k as le,t as Ie}from"./vendor-hooks-BlA8TRnZ.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bC as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as $,bf as _,a5 as J,V as G,S as Z,b4 as Oe,U as L,I as B,ci as Pe,bh as $e,a7 as Ae,F as qe,W as t,b1 as R,a3 as ce,c2 as ee,cj as Le,aO as Me,aP as Be,ck as Fe,cl as He,cm as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cn as Ve,aZ as Ye,cc as Je,bb as Qe,cb as Xe}from"./vendor-mui-core-DRxbhqaK.js";import{B as de,o as pe,l as ue}from"./index-BhwFkAf9.js";import{X as K,c as xe,_ as Ge,a9 as Ze,b5 as Q}from"./index-CDK4fL-O.js";import{u as V}from"./team-DNwgDnjc.js";import{u as et}from"./use-mobile-BQQpAf3i.js";import{u as tt,C as X}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-CUDP56Ff.js";import{C as st}from"./confirm-BWJyxR1P.js";import{A as nt}from"./actions-B4VXcSRp.js";import{T as ie}from"./table-tips-rCE1XKlc.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DeeG8u0h.js";import"./session-DqPgru1C.js";import"./isURL-C1DcW1a5.js";import"./use-app-logo-Bbh3GZji.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[f,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{b()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:f,error:w,loadData:b}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:f=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),b=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(J,{onChange:T,checked:l>0&&l===b}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx($,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(J,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Pe,{}):e.jsx($e,{})})]})]})}),m.length>0&&e.jsx(Ae,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),f&&e.jsx(qe,{error:!0,sx:{mt:1},children:f})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function be({id:i=null,url:u="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:b}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:b,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:b,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(f.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,f]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(X,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(X,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}be.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function fe(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Ge(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function P({value:i,label:u,tip:c="",divider:f=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx($,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),f&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();u[f]||(u[f]=[]),u[f]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:f,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:b,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map(A=>A.id===s.id?{...A,...s}:A);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await f.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find(A=>A?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx($,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
|
|
2
2
|
@keyframes spin {
|
|
3
3
|
to {
|
|
4
4
|
transform: rotate(360deg);
|