@abtnode/blocklet-services 1.16.49-beta-20250826-112154-8ca981fa → 1.16.49-beta-20250828-094758-93e69d1f
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/index.js +7 -1
- package/api/routes/blocklet.js +2 -1
- package/api/routes/csp-proxy.js +0 -1
- package/api/routes/user.js +92 -73
- package/api/services/notification/queue.js +2 -1
- package/dist/assets/{AdapterDayjs-DAMiGWmL.js → AdapterDayjs-B7ApPoXD.js} +1 -1
- package/dist/assets/{Google-BsTnh-4u.js → Google-DfN9Rvbc.js} +1 -1
- package/dist/assets/{access-control-DCA_eQZz.js → access-control-sVJ3CDsk.js} +1 -1
- package/dist/assets/{actions-ERKO514H.js → actions-DAS8NTxZ.js} +1 -1
- package/dist/assets/{add-component-core-k3nxNuTO.js → add-component-core-C-lS-f2s.js} +1 -1
- package/dist/assets/{add-resource-DStWoX4i.js → add-resource-BO5CaS7z.js} +1 -1
- package/dist/assets/{addon-2mvzI-dq.js → addon-BbUmhDrg.js} +2 -2
- package/dist/assets/{advanced-BfOlOCpe.js → advanced-yos-VoDO.js} +1 -1
- package/dist/assets/{aigne-BzgFpPaQ.js → aigne-BFaiITB3.js} +1 -1
- package/dist/assets/{appearance-CK8AP8Pg.js → appearance-CVPCj_g7.js} +1 -1
- package/dist/assets/{arrow-down.svg-DL1hxWw7.js → arrow-down.svg-D4RAc36g.js} +1 -1
- package/dist/assets/{audit-logs-BwrxLp74.js → audit-logs-DB3qhQg4.js} +2 -2
- package/dist/assets/{authorize-CTMuTRsh.js → authorize-B9eAVgLd.js} +1 -1
- package/dist/assets/{base-chart-DshYrsm-.js → base-chart-VPtnEoZA.js} +1 -1
- package/dist/assets/{base32-Bpx2GVVK.js → base32-BfYXZjht.js} +1 -1
- package/dist/assets/{bind-account-C0dQGqpS.js → bind-account-CZsXV4Ww.js} +1 -1
- package/dist/assets/branding-4AKasu0p.js +1 -0
- package/dist/assets/{branding-B2z6Bmgr.js → branding-4PyVgsm-.js} +2 -2
- package/dist/assets/{branding-DIJg1MWH.js → branding-BRbN1Bkg.js} +1 -1
- package/dist/assets/{bundle-avatar-DgaVgcWV.js → bundle-avatar-DQcnLf3o.js} +1 -1
- package/dist/assets/button-CxhwEH5Q.js +1 -0
- package/dist/assets/{click-to-copy-xhWFT-k-.js → click-to-copy-C6lmeRAF.js} +1 -1
- package/dist/assets/{collapse-6qdm8LaH.js → collapse-8NywKzkD.js} +1 -1
- package/dist/assets/{complete-CRI2gBzt.js → complete-EQPcfiZv.js} +1 -1
- package/dist/assets/{component-B6-WwWY8.js → component-BhUI-d0d.js} +3 -3
- package/dist/assets/{config-CCmDjOhk.js → config-DJJS3dIe.js} +1 -1
- package/dist/assets/{config-D-pz2Qoj.js → config-Le6WeCol.js} +5 -5
- package/dist/assets/{config-Cx_MPp7p.js → config-OBLXnYuT.js} +1 -1
- package/dist/assets/{config-navigation-DZ7YK-yA.js → config-navigation-avFj7dYF.js} +3 -3
- package/dist/assets/{config-space-Hn6vDRvK.js → config-space-BbpgeOnW.js} +1 -1
- package/dist/assets/{confirm-DjiQAQPO.js → confirm-dtnPbiJU.js} +1 -1
- package/dist/assets/{connect-CH9xsJFa.js → connect-H6B42tsr.js} +1 -1
- package/dist/assets/connect-OCT-OS7Y.js +1 -0
- package/dist/assets/{connect-to-CR0Mrnxa.js → connect-to-rTDj0z18.js} +1 -1
- package/dist/assets/{content-layout-C04Obhnh.js → content-layout-C8_nylvn.js} +1 -1
- package/dist/assets/{createClass-C2F6VGHd.js → createClass-tr3IJmK6.js} +1 -1
- package/dist/assets/{dashboard-DDrnxcgl.js → dashboard-BvIj00oy.js} +3 -3
- package/dist/assets/{delete-confirm-D3Ubb7rP.js → delete-confirm-o1zts8U4.js} +1 -1
- package/dist/assets/{did-address-BWvYsV02.js → did-address-jhnZEWZT.js} +1 -1
- package/dist/assets/{domain-PJvqoN80.js → domain-BtX17din.js} +1 -1
- package/dist/assets/{domain-action-card-DhcgmOYz.js → domain-action-card-qxxmLU3c.js} +2 -2
- package/dist/assets/domains-DxA8mkxh.js +1 -0
- package/dist/assets/{email-DsO0liCw.js → email-AcFKXEOo.js} +1 -1
- package/dist/assets/{empty-spinner-BkNT2e_n.js → empty-spinner-8MrwYy6o.js} +1 -1
- package/dist/assets/engine-Dn2eu8pq.js +1 -0
- package/dist/assets/{exchange-passport-BOqqcYhR.js → exchange-passport-Bq0t5R-b.js} +1 -1
- package/dist/assets/{form-VkZc9Km5.js → form-D8WxwcUb.js} +1 -1
- package/dist/assets/{form-text-input-DUMoSxHd.js → form-text-input-My8a96Qh.js} +1 -1
- package/dist/assets/{form-wrapper-Buohf72H.js → form-wrapper-CyRbKpkJ.js} +1 -1
- package/dist/assets/{fuel-D6o3EPCQ.js → fuel-BmHBUS5K.js} +1 -1
- package/dist/assets/{gen-access-key-TaufSRBN.js → gen-access-key-lWNMSsTk.js} +1 -1
- package/dist/assets/{gen-simple-access-key-BDdGaGUR.js → gen-simple-access-key-BDUwC53R.js} +1 -1
- package/dist/assets/get-safe-url-BQ6d4MgK.js +1 -0
- package/dist/assets/{hdkey-BZdKcn7a.js → hdkey-DSMaex4r.js} +1 -1
- package/dist/assets/{home-CHjIGcwE.js → home-BFQjMOv3.js} +1 -1
- package/dist/assets/{iframe-D4HLtPwz.js → iframe-Rfnl7VOX.js} +1 -1
- package/dist/assets/{index-BMIctAqA.js → index-B19K9uJe.js} +5 -5
- package/dist/assets/{index-DzDny7hn.js → index-B5xugf-_.js} +1 -1
- package/dist/assets/{index-C54fBQKM.js → index-B6vMF9Hk.js} +6 -6
- package/dist/assets/{index-CzpBsr1A.js → index-BAz4_gi3.js} +1 -1
- package/dist/assets/{index-Csyn0uY8.js → index-BPi7kqxm.js} +1 -1
- package/dist/assets/index-BWTQhZ4U.js +1027 -0
- package/dist/assets/{index-D-GZOScK.js → index-C-ScWNDm.js} +1 -1
- package/dist/assets/{index-DgIrECdq.js → index-C43c4laP.js} +1 -1
- package/dist/assets/{index-BC4kejU3.js → index-CGLt1oNo.js} +1 -1
- package/dist/assets/{index-B74V2YA6.js → index-CKzo9Uef.js} +1 -1
- package/dist/assets/{index-N7n9Y6Ev.js → index-CNHQRHA5.js} +1 -1
- package/dist/assets/{index-DPTpzNhV.js → index-CRLXC3_Y.js} +1 -1
- package/dist/assets/{index-CWYofUen.js → index-CUQ2UhNw.js} +12 -12
- package/dist/assets/{index-WeFxHe8W.js → index-Ch35mI2K.js} +1 -1
- package/dist/assets/{index-DrDeYBYQ.js → index-CrBAth7d.js} +9 -9
- package/dist/assets/{index-DexkP2Yg.js → index-CuvhlXtp.js} +4 -4
- package/dist/assets/{index-BqC6LPCM.js → index-D1unLlb1.js} +3 -3
- package/dist/assets/{index-D17HAcYi.js → index-D8KcYxzV.js} +2 -2
- package/dist/assets/{index-CMEi9dbm.js → index-DTsM42Id.js} +1 -1
- package/dist/assets/{index-l6N7xl6j.js → index-DWUa0yxY.js} +1 -1
- package/dist/assets/{index-DI1BHDx_.js → index-DZ2X8gFe.js} +1 -1
- package/dist/assets/{index-BeCF0QOk.js → index-Djqtu3nK.js} +10 -10
- package/dist/assets/{index-Bx3gbTGK.js → index-DpkWkxvh.js} +1 -1
- package/dist/assets/{index-BH2GiZzC.js → index-DzFhCctN.js} +1 -1
- package/dist/assets/index-FcG9efoK.js +1 -0
- package/dist/assets/index-I2pdu38s.js +124 -0
- package/dist/assets/{index-DZVXsFnM.js → index-M1n8940k.js} +12 -12
- package/dist/assets/{index-iZoPQlsF.js → index-R9xEgWqx.js} +1 -1
- package/dist/assets/{index-BnvMgnLZ.js → index-ooq0mqFx.js} +2 -2
- package/dist/assets/{invitation-fLqQwL2V.js → invitation-CcLaY9mC.js} +4 -4
- package/dist/assets/invite-DJCMRtEr.js +1 -0
- package/dist/assets/{isURL-B__byeRB.js → isURL-DFvT0vCW.js} +1 -1
- package/dist/assets/{issue-passport-B59-VmcV.js → issue-passport-CkIJRolL.js} +1 -1
- package/dist/assets/{item-B66UD90-.js → item-C2hII4fE.js} +1 -1
- package/dist/assets/{landing-page-CcxfBDvV.js → landing-page-Co2xmYHL.js} +1 -1
- package/dist/assets/{launch-result-message-nmd233tx.js → launch-result-message-CYwb6iA9.js} +1 -1
- package/dist/assets/{layout-BtMyFuvH.js → layout-C3tvXFgk.js} +1 -1
- package/dist/assets/{list-BzBZOB70.js → list-BPUjG_QR.js} +3 -3
- package/dist/assets/{list-KwyPdRy6.js → list-CfoGe8c8.js} +2 -2
- package/dist/assets/{list-header-DT-KLaK2.js → list-header-DdgW2mjM.js} +1 -1
- package/dist/assets/localization-D43nyvZk.js +1 -0
- package/dist/assets/{log-CJiXT96P.js → log-B9lGtGiW.js} +1 -1
- package/dist/assets/logger-4k8NsA4u.js +1 -0
- package/dist/assets/{login-DdD8TQxB.js → login-CzFKzWTR.js} +1 -1
- package/dist/assets/{login-oauth-callback-apTwCkdH.js → login-oauth-callback-X95PJ2qp.js} +1 -1
- package/dist/assets/{logo-uploader-CIzfJVj3.js → logo-uploader-8ln-60_3.js} +2 -2
- package/dist/assets/{lost-passport-sedmBiTv.js → lost-passport-DKWbWBzi.js} +1 -1
- package/dist/assets/{observability-BLOR-pai.js → observability-4ZKd3ESd.js} +1 -1
- package/dist/assets/{open-window-DaSfgtU9.js → open-window-DzVl2k4x.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-BW9Vjd39.js → over-due-invoice-payment-BPVLaNw4.js} +1 -1
- package/dist/assets/{overview-BI6gWUol.js → overview-DSyEFumj.js} +2 -2
- package/dist/assets/{page-header-D3lUeEWm.js → page-header-CyNE6Ofr.js} +1 -1
- package/dist/assets/passport-item-DCZlw8VZ.js +1 -0
- package/dist/assets/{permission-NMvfYJeQ.js → permission-CwauIzov.js} +1 -1
- package/dist/assets/{playground-DGDm_k8W.js → playground-DeasY3DH.js} +1 -1
- package/dist/assets/preferences-CnB-T7sM.js +1 -0
- package/dist/assets/profile-embed-Cje1NBan.js +1 -0
- package/dist/assets/{publish-resource-DRVUWcok.js → publish-resource-CfsKbVhC.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Lp0g0Q08.js → react-beautiful-dnd.esm-tMcQD2yf.js} +1 -1
- package/dist/assets/{react-stripe.esm-CBymx38E.js → react-stripe.esm-CvJuW6o6.js} +1 -1
- package/dist/assets/{required-TNLp5hTp.js → required-McYgDRcp.js} +1 -1
- package/dist/assets/{runtime-B_S3oSYT.js → runtime-C1a1bdul.js} +1 -1
- package/dist/assets/sdk-BVLD2Hdt.js +1 -0
- package/dist/assets/{section-BpYiAw-V.js → section-DSgkHUgY.js} +1 -1
- package/dist/assets/{security-DqsO4co1.js → security-BbgwNqVc.js} +3 -3
- package/dist/assets/{session-DuaiASiB.js → session-U-hEcJ3m.js} +1 -1
- package/dist/assets/{setup-Bv3iwBD5.js → setup-CwuOKBim.js} +1 -1
- package/dist/assets/{shorten-label-C8uk1g60.js → shorten-label-CphpNRtN.js} +1 -1
- package/dist/assets/{simple-select-fgsPxdEE.js → simple-select-B6PbGWwo.js} +1 -1
- package/dist/assets/{spaces-Dx5KH7MV.js → spaces-D0iulZZE.js} +1 -1
- package/dist/assets/{start-DTrYwwTK.js → start-DuZ3YiJZ.js} +1 -1
- package/dist/assets/{starting-progress-B7SsMBie.js → starting-progress-D9vpVI4j.js} +1 -1
- package/dist/assets/{status-DV5ZaWRZ.js → status-cH_88o_O.js} +1 -1
- package/dist/assets/{step-actions-Dt_jvJOc.js → step-actions-9LK_rPuF.js} +1 -1
- package/dist/assets/{studio-DZB6_SfH.js → studio-BtJ8IG1e.js} +1 -1
- package/dist/assets/{switch-control-BXSVR4of.js → switch-control-_r5tnNLs.js} +1 -1
- package/dist/assets/{table-tips-BbhDCXCb.js → table-tips-DaCM8P_z.js} +1 -1
- package/dist/assets/{team-DrpyaDg_.js → team-BqbXtbtA.js} +1 -1
- package/dist/assets/{traffic-BEWuWa0Q.js → traffic-B01d9dTv.js} +1 -1
- package/dist/assets/{transfer-BFCvEfMq.js → transfer-Bzsb7K-h.js} +1 -1
- package/dist/assets/{unsubscribe-D7hdugTe.js → unsubscribe-DLiekCH0.js} +1 -1
- package/dist/assets/{use-app-logo-B4Ni4-9K.js → use-app-logo-1g85gLSt.js} +1 -1
- package/dist/assets/{use-mobile-C7GZXQ3Y.js → use-mobile-BTugf2DR.js} +1 -1
- package/dist/assets/{use-mobile-CtV6Z2rA.js → use-mobile-BjYFyM2N.js} +1 -1
- package/dist/assets/{use-server-logo-beKp3Dx7.js → use-server-logo-B7LbKzj5.js} +1 -1
- package/dist/assets/{use-window-close-Dz6xsCmU.js → use-window-close-SfvxIQ67.js} +1 -1
- package/dist/assets/{useAsyncRetry-CxZ45F4C.js → useAsyncRetry-XOTAwnFJ.js} +1 -1
- package/dist/assets/{useLocalStorage-rkkjWL9w.js → useLocalStorage-DH_lecPn.js} +1 -1
- package/dist/assets/user-center-Bp-3sWFi.js +126 -0
- package/dist/assets/{user-follower-CKs6NBJh.js → user-follower-CkIxC3f3.js} +2 -2
- package/dist/assets/{user-sessions-tY1bFqyC.js → user-sessions-Cbiat2FW.js} +1 -1
- package/dist/assets/{util-_V0aUJlg.js → util-PKueOfaS.js} +1 -1
- package/dist/assets/{util-BsoIGi_3.js → util-jhRcmTca.js} +1 -1
- package/dist/assets/{vendor-arcblock-BWU60ucH.js → vendor-arcblock-Q5ECWsoh.js} +1 -1
- package/dist/assets/{vendor-mui-core-C2nSSl8u.js → vendor-mui-core-BkVXEDpj.js} +15 -15
- package/dist/assets/{vendor-mui-x-KqeuegFB.js → vendor-mui-x-DiiSwpci.js} +1 -1
- package/dist/assets/vendor-ux-lckoR4gs.js +1569 -0
- package/dist/assets/{wait-connect-C_6vFp9c.js → wait-connect-CZc79arT.js} +1 -1
- package/dist/assets/{wizard-BDOYT_SP.js → wizard-BJB_eh3v.js} +2 -2
- package/dist/assets/{wizard-components-DOppNu0m.js → wizard-components-DLjvO_g6.js} +3 -3
- package/dist/assets/{wrap-locale-B-euzNKT.js → wrap-locale-DSvJTIUK.js} +1 -1
- package/dist/assets/{zh-C7--1pmA.js → zh-D7F3wDQu.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/package.json +35 -34
- package/dist/assets/branding-DewpBr-G.js +0 -1
- package/dist/assets/button-yt7KOkBe.js +0 -1
- package/dist/assets/connect-DGqjsZSn.js +0 -1
- package/dist/assets/domains-CkoVlvYd.js +0 -1
- package/dist/assets/engine-RAnesRm4.js +0 -1
- package/dist/assets/get-safe-url-XoZDPEu8.js +0 -1
- package/dist/assets/index-BWFAeSHM.js +0 -1
- package/dist/assets/index-DO37nRKU.js +0 -1022
- package/dist/assets/index-Da2Fkfd8.js +0 -124
- package/dist/assets/invite-BuBkQcNM.js +0 -1
- package/dist/assets/localization-C3WwrJSz.js +0 -1
- package/dist/assets/logger-BPHaK-bk.js +0 -1
- package/dist/assets/passport-item-BX30szp1.js +0 -1
- package/dist/assets/preferences-CeBMYsxj.js +0 -1
- package/dist/assets/profile-embed-D7i_oi27.js +0 -1
- package/dist/assets/sdk-CXzRO4fi.js +0 -1
- package/dist/assets/user-center-CmMx3fvE.js +0 -126
- package/dist/assets/vendor-ux-BEdmA2UN.js +0 -1569
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as v,a$ as
|
|
1
|
+
import{j as e,T as v,a$ as b,D as I,J as T,ak as t}from"./vendor-mui-core-BkVXEDpj.js";import{W as B,w as E,X as P,$ as j,Z as $}from"./vendor-ux-lckoR4gs.js";import{a as A}from"./vendor-hooks-CLY4g97Q.js";import{ak as C}from"./index-BWTQhZ4U.js";function M({linkProps:s=void 0,showExtra:o=!1,...n}){return e.jsxs(v,{...n,children:["Powered by"," ",e.jsx(b,{href:"https://www.arcblock.io",target:"_blank",...s,children:"ArcBlock"}),"'s"," ",e.jsx(b,{href:"https://www.blocklet.io",target:"_blank",...s,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function N({did:s,children:o,title:n=void 0,description:a=void 0,actions:m=void 0,logo:i=void 0,logoSize:d=50,poweredBy:x=void 0,termsOfUse:g=void 0,standalone:y=!1}){const r=globalThis?.blocklet||globalThis?.env||{},{palette:f}=I(),c=T(l=>l.breakpoints.down("lg")),w=C({meta:r}),k=A(()=>{const l=r.appPid,u=B.isEthereumDid(l),D=u?void 0:E(l);return u?P(l):D.color},[r?.appPid]);if(!s)return o;n===void 0&&(n=r.appName),a===void 0&&(a=r.appDescription),i===void 0&&(i=w||""),typeof i=="string"&&(i?i=e.jsx(t,{sx:{height:d,maxHeight:d,objectFit:"contain"},component:"img",src:i,alt:`${r.appName}'s logo`}):i=e.jsx(j,{size:d,did:s,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx(M,{linkProps:{color:f.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!c,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!c&&(p=e.jsx(t,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:s,variant:"rounded"})}));const z=!!o;let h=!y;return c&&(h=!z),e.jsxs(t,{sx:{width:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",px:{xs:2,sm:4,md:8},pt:{xs:2,sm:4,md:6},pb:{xs:5,md:8},background:`radial-gradient(circle at bottom right, ${$(k,.3)} 10%, ${f.background.default} 50%)`,position:"relative"},children:[e.jsxs(t,{sx:{maxWidth:1200,display:"flex",alignItems:"center",justifyContent:[h,p].filter(Boolean).length>1?"space-between":"center",width:"100%",margin:"auto"},children:[h?e.jsxs(t,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(t,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(v,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:n}),a?e.jsx(t,{sx:{mb:2,color:"text.secondary"},children:a}):null,m?e.jsx(t,{sx:{mt:8},children:m}):null,g?e.jsx(t,{sx:{mt:-1,color:"grey"},children:g}):null]}):null,p]}),e.jsx(t,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}export{N as K};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,at as n,an as c,a6 as d,bi as h,aj as m,W as i}from"./vendor-mui-core-
|
|
1
|
+
import{j as t,at as n,an as c,a6 as d,bi as h,aj as m,W as i}from"./vendor-mui-core-BkVXEDpj.js";function p({variant:e="success",title:o="",subTitle:a="",footer:s=null,...l}){let r;switch(e){case"error":r=m;break;case"info":r=h;break;case"loading":r=d;break;default:r=c}return t.jsx(u,{variant:e,...l,children:t.jsxs("div",{className:"result-body",children:[t.jsx("span",{className:`result-icon color-${e}`,children:t.jsx(r,{})}),t.jsx("div",{className:`result-title color-${e} ${o?"":"ele-hide"}`,children:o}),t.jsx("div",{className:`result-sub-title ${a?"":"ele-hide"}`,children:a}),s&&t.jsx("div",{className:"result-footer",children:s})]})})}p.propTypes={variant:i.oneOf(["success","error","info","loading"]),title:i.string,subTitle:i.any,footer:i.any};const u=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,at as m}from"./vendor-mui-core-
|
|
1
|
+
import{j as a,at as m}from"./vendor-mui-core-BkVXEDpj.js";import{C as p}from"./content-layout-C8_nylvn.js";import{T as c,H as s}from"./vendor-ux-lckoR4gs.js";import{a6 as d,X as i}from"./index-BWTQhZ4U.js";const u=m(p)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as I,a as Rr}from"./vendor-react-Dvs43sk9.js";import{r as Gt,a as Zt,b as Qt,c as er,d as ct,e as tr,f as rr,g as nr,h as lt,i as ir,j as sr,k as or,m as Ke,n as ar,o as cr,p as lr,q as je,s as ur,t as fr,u as dr,v as hr,am as Cr,b6 as Dr,T as Be,H as De,_ as Kr,$ as pr,a6 as Ce,ab as Nr,O as Ir}from"./vendor-ux-BEdmA2UN.js";import{j as r,Y as ut,bB as ft,I as dt,aj as ht,$ as pt,b1 as me,T as X,ak as k,z as V,F as M,b7 as Lr,b5 as yr,b6 as mr,a5 as gr,a3 as yt,aX as br,R as _r,Q as He,a6 as mt,W as w,am as qr,ck as Sr,cl as Mr,c9 as Fr}from"./vendor-mui-core-C2nSSl8u.js";import{B as Wr,a as Vr,l as zr}from"./index-BWFAeSHM.js";import{u as Yr}from"./useAsyncRetry-CxZ45F4C.js";import{w as Er,B as C,o as Xr,b as Jr,C as xt}from"./vendor-utils-DtY42AM-.js";import{r as Gr}from"./hdkey-BZdKcn7a.js";import{Z as Pe,c as re,a8 as Zr}from"./index-DO37nRKU.js";import{u as $e}from"./team-DrpyaDg_.js";import{u as xr,C as z}from"./index.esm-JPZAjt0x.js";import{T as Qr}from"./index-Bx3gbTGK.js";import{E as en}from"./empty-spinner-BkNT2e_n.js";import{C as q}from"./click-to-copy-xhWFT-k-.js";import{D as tn}from"./delete-confirm-D3Ubb7rP.js";import{a as rn}from"./passport-item-BX30szp1.js";import{A as nn}from"./actions-ERKO514H.js";import{T as Tt}from"./table-tips-BbhDCXCb.js";import{u as sn}from"./use-mobile-CtV6Z2rA.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./useAsync-B3JLhOUX.js";import"./vendor-arcblock-BWU60ucH.js";import"./session-DuaiASiB.js";import"./isURL-B__byeRB.js";import"./use-app-logo-B4Ni4-9K.js";import"./arrow-down.svg-DL1hxWw7.js";import"./vendor-mui-x-KqeuegFB.js";import"./AdapterDayjs-DAMiGWmL.js";import"./confirm-DjiQAQPO.js";import"./index-DBs9Ljax.js";import"./did-address-BWvYsV02.js";import"./util-BsoIGi_3.js";import"./base32-Bpx2GVVK.js";var Ae={},ke={},Z={},Ht;function ne(){return Ht||(Ht=1,function(e){var a=Z&&Z.__createBinding||(Object.create?function(t,u,y,U){U===void 0&&(U=y);var x=Object.getOwnPropertyDescriptor(u,y);(!x||("get"in x?!u.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return u[y]}}),Object.defineProperty(t,U,x)}:function(t,u,y,U){U===void 0&&(U=y),t[U]=u[y]}),i=Z&&Z.__setModuleDefault||(Object.create?function(t,u){Object.defineProperty(t,"default",{enumerable:!0,value:u})}:function(t,u){t.default=u}),d=Z&&Z.__importStar||function(t){if(t&&t.__esModule)return t;var u={};if(t!=null)for(var y in t)y!=="default"&&Object.prototype.hasOwnProperty.call(t,y)&&a(u,t,y);return i(u,t),u},c=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.fromTokenToUnit=e.fromUnitToToken=e.numberToString=e.toHex=e.hexToBytes=e.bytesToHex=e.numberToHex=e.hexToNumber=e.hexToUtf8=e.utf8ToHex=e.toBN=e.isHex=e.isHexStrict=e.isBigNumber=e.isBN=e.stripHexPrefix=e.isHexPrefixed=e.numberToBN=e.rightPad=e.leftPad=e.BN=e.isBase58btc=void 0,e.isUint8Array=ge,e.UUID=Ge,e.isUUID=Ze,e.toUint8Array=be,e.toBuffer=Ue,e.toBase58=Qe,e.fromBase58=et,e.toBase64=tt,e.fromBase64=rt,e.toAddress=te,e.toDid=nt,e.isSameDid=it,e.formatTxType=st;const s=c(Gt),m=c(Zt),f=c(Qt),p=c(er),g=c(ct),n=c(tr),o=c(rr),l=c(nr);e.rightPad=l.default;const h=c(lt);e.leftPad=h.default;const E=c(ir()),b=c(sr()),_=c(Er());e.BN=_.default;const A=d(or()),R="did:abt:",H=new _.default(0),T=new _.default(-1),j={encode:t=>`z${E.default.encode(t)}`,decode:t=>E.default.decode(t.slice(1))},O=t=>{if(typeof t!="string")return!1;if(t[0]==="z")try{return j.decode(t),!0}catch{return!1}return!1};e.isBase58btc=O;const S=t=>{if(typeof t=="string"||typeof t=="number"){let u=new _.default(1);const y=String(t).toLowerCase().trim(),U=y.substr(0,2)==="0x"||y.substr(0,3)==="-0x";let x=(0,e.stripHexPrefix)(y);if(x.substr(0,1)==="-"&&(x=(0,e.stripHexPrefix)(x.slice(1)),u=new _.default(-1,10)),x=x===""?"0":x,!x.match(/^-?[0-9]+$/)&&x.match(/^[0-9A-Fa-f]+$/)||x.match(/^[a-fA-F]+$/)||U===!0&&x.match(/^[0-9A-Fa-f]+$/))return new _.default(x,16).mul(u);if((x.match(/^-?[0-9]+$/)||x==="")&&U===!1)return new _.default(x,10).mul(u)}if((0,e.isBN)(t))return new _.default(t.toString(10),10);throw new Error(`[number-to-bn] while converting number ${JSON.stringify(t)} to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.`)};e.numberToBN=S;const v=t=>{if(typeof t!="string")throw new Error("[is-hex-prefixed] value must be type string");return t.slice(0,2).toLowerCase()==="0x"};e.isHexPrefixed=v;const P=t=>typeof t=="string"&&(0,e.isHexPrefixed)(t)?t.slice(2):t;e.stripHexPrefix=P;const B=t=>t instanceof _.default||t&&t.constructor&&t.constructor.name==="BN";e.isBN=B;const N=t=>t&&t.constructor&&t.constructor.name==="BigNumber";e.isBigNumber=N;const ee=t=>((0,m.default)(t)||(0,f.default)(t))&&/^(-)?0x[0-9a-f]*$/i.test(t);e.isHexStrict=ee;const Ne=t=>((0,m.default)(t)||(0,f.default)(t))&&/^(-0x|0x|0X|-0X)?[0-9a-f]*$/i.test(t);e.isHex=Ne;const Ie=(t,u=10)=>{try{if(typeof t=="number"&&t>0){const y=Number(t).toLocaleString("fullwide",{useGrouping:!1});return new _.default(y,u)}return(0,e.numberToBN)(t)}catch(y){throw new Error(`${y} Given value: "${t}"`)}};e.toBN=Ie;const Le=t=>{t=A.encode(t);let u="";t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join("");for(let y=0;y<t.length;y++){const x=t.charCodeAt(y).toString(16);u+=x.length<2?`0${x}`:x}return`0x${u}`};e.utf8ToHex=Le;const qe=t=>{if(!(0,e.isHexStrict)(t))throw new Error(`The parameter "${t}" must be a valid HEX string.`);let u="",y=0;t=t.replace(/^0x/i,""),t=t.replace(/^(?:00)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:00)*/,""),t=t.split("").reverse().join("");const U=t.length;for(let x=0;x<U;x+=2)y=parseInt(t.substr(x,2),16),u+=String.fromCharCode(y);return A.decode(u)};e.hexToUtf8=qe;const Me=t=>t?(0,e.toBN)(t).toNumber():0;e.hexToNumber=Me;const Fe=t=>{if((0,o.default)(t)||typeof t>"u")return t;if(!isFinite(t)&&!(0,e.isHex)(t))throw new Error(`Given input "${t}" is not a number.`);const u=(0,e.toBN)(t),y=u.toString(16);return u.lt(new _.default(0))?`-0x${y.substr(1)}`:`0x${y}`};e.numberToHex=Fe;const We=t=>{const u=[];for(let y=0;y<t.length;y++)u.push((t[y]>>>4).toString(16)),u.push((t[y]&15).toString(16));return`0x${u.join("")}`};e.bytesToHex=We;const Ve=t=>{if(t=t.toString(16),!(0,e.isHex)(t))throw new Error(`Given value "${t}" is not a valid hex string.`);t=t.replace(/^0x/i,""),t=t.length%2?`0${t}`:t;const u=[];for(let y=0;y<t.length;y+=2)u.push(parseInt(t.substr(y,2),16));return u};e.hexToBytes=Ve;const ze=(t,u=!1)=>ge(t)||C.isBuffer(t)?u?"bytes":(0,e.bytesToHex)(t):(0,e.isBase58btc)(t)?u?"bytes":(0,e.bytesToHex)(j.decode(t)):(0,s.default)(t)?u?"bool":t?"0x01":"0x00":(0,p.default)(t)&&!(0,e.isBigNumber)(t)&&!(0,e.isBN)(t)?u?"string":(0,e.utf8ToHex)(JSON.stringify(t)):typeof t=="string"?t.indexOf("-0x")===0||t.indexOf("-0X")===0?u?"int256":(0,e.numberToHex)(t):t.indexOf("0x")===0||t.indexOf("0X")===0?u?"bytes":t:u?"string":(0,e.utf8ToHex)(t):u?+t<0?"int256":"uint256":(0,e.numberToHex)(t);e.toHex=ze;const Ye=t=>{if(typeof t=="string"){if(!t.match(/^-?[0-9.]+$/))throw new Error(`Invalid value '${t}' while converting to string, should be a number matching (^-?[0-9.]+).`);return t}if(typeof t=="number")return Number.isInteger(t)&&t>0?Number(t).toLocaleString("fullwide",{useGrouping:!1}):String(t);if(typeof t=="object"&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error(`while converting number to string, invalid number value '${t}' type ${typeof t}.`)};e.numberToString=Ye;const Xe=(t,u=18,y={})=>{let U=(0,e.toBN)(t);const x=U.lt(H),F=(0,e.toBN)(`1${"0".repeat(u)}`,10),G=F.toString(10).length-1||1,K=y||{};x&&(U=U.mul(T));let $=U.mod(F).toString(10);for(;$.length<G;)$=`0${$}`;K.pad||($=$.match(/^([0-9]*[1-9]|0)(0*)/)[1]);let L=U.div(F).toString(10);K.commify&&(L=L.replace(/\B(?=(\d{3})+(?!\d))/g,","));let _e=`${L}${$==="0"?"":`.${$}`}`;return x&&(_e=`-${_e}`),_e};e.fromUnitToToken=Xe;const Je=(t,u=18)=>{let y=(0,e.numberToString)(t);const U=(0,e.toBN)(`1${"0".repeat(u)}`,10),x=U.toString(10).length-1||1,F=y.substring(0,1)==="-";if(F&&(y=y.substring(1)),y===".")throw new Error(`error converting token ${t} to unit, invalid value`);const G=y.split(".");if(G.length>2)throw new Error(`error converting token ${t} to unit, too many decimal points`);let K=G[0],$=G[1];if(K||(K="0"),$||($="0"),$.length>x)throw new Error(`error converting token ${t} to unit, too many decimal places`);for(;$.length<x;)$+="0";K=new _.default(K),$=new _.default($);let L=K.mul(U).add($);return F&&(L=L.mul(T)),new _.default(L.toString(10),10)};e.fromTokenToUnit=Je;function ge(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function Ge(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const u=Math.random()*16|0;return(t==="x"?u:u&3|8).toString(16)})}function Ze(t){return/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(t)}function be(t){let u=null;if([null,void 0,""].includes(t))u=new Uint8Array;else if(C.isBuffer(t))u=new Uint8Array(t);else if((0,e.isHexStrict)(t))u=new Uint8Array((0,e.hexToBytes)(t));else if(ge(t))u=new Uint8Array(t);else if((0,e.isBase58btc)(t))u=new Uint8Array(j.decode(t));else if(typeof t=="string")u=new Uint8Array((0,e.hexToBytes)((0,e.toHex)(t)));else throw new Error(`Unsupported input type ${typeof t} detected for toBuffer, only Uint8Array/Buffer/Hex/Base58 are supported`);return u}function Ue(t){return C.from(be(t))}function Qe(t){const u=j.encode(be(t));return C.from(u).toString("utf-8")}function et(t){if((0,e.isBase58btc)(t)===!1)throw new Error("fromBase58 expect strict base58 encoded string as input");return C.from(j.decode(t))}function tt(t,u=!0){const y=b.default.encode(Ue(t));return u?b.default.escape(y):y}function rt(t){if(typeof t!="string")throw new Error("fromBase64 requires input to be a string");return C.from(b.default.unescape(t),"base64")}function te(t){return t.replace(R,"")}function nt(t){return`${R}${te(t)}`}function it(t,u){return te(t).toLowerCase()===te(u).toLowerCase()}function st(t){return(0,g.default)((0,n.default)(t))}}(Z)),Z}var jt;function ve(){if(jt)return ke;jt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.encode=a;const e=ne();function a(i,d="hex"){return["hex","base16"].includes(d)?(0,e.toHex)(i):d==="base58"?(0,e.toBase58)(i):d==="base64"?(0,e.toBase64)(i):d==="Uint8Array"?(0,e.toUint8Array)(i):d==="buffer"?(0,e.toBuffer)(i):i}return ke}var ie={},vt;function on(){if(vt)return ie;vt=1;var e=ie&&ie.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.KeccakHasher=void 0;const a=e(Ke()),i=ne(),d=ve();class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=n=>a.default[`keccak${m}`](n),g=(n,o)=>o===1?p(n):g(p(n),o-1);this[f]=(n,o=1,l="hex")=>{let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=g(h,o);return(0,d.encode)(`0x${E}`,l)}})}}return ie.KeccakHasher=c,ie.default=new c,ie}var Se={},wt;function an(){if(wt)return Se;wt=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.Sha2Hasher=void 0;const e=ne(),a=ar(),i=ve(),d={sha224:a.sha224,sha256:a.sha256,sha384:a.sha384,sha512:a.sha512};class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=d[`sha${m}`],g=(n,o)=>{let l=n;try{l=(0,e.toUint8Array)(n)}catch{}return o===1?`0x${p().update(l).digest("hex")}`:g(g(l,1),o-1)};this[f]=(n,o=2,l="hex")=>{const h=g(n,o);return(0,i.encode)(h,l)}})}}return Se.Sha2Hasher=c,Se.default=new c,Se}var se={},Ut;function cn(){if(Ut)return se;Ut=1;var e=se&&se.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(se,"__esModule",{value:!0}),se.Sha3Hasher=void 0;const a=e(Ke()),i=ne(),d=ve();class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=a.default[`sha3_${m}`],g=(n,o)=>o===1?p(n):g(p(n),o-1);this[f]=(n,o=1,l="hex")=>{let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=g(h,o);return(0,d.encode)(`0x${E}`,l)}})}}return se.Sha3Hasher=c,se.default=new c,se}var oe={},Ee={},At;function gt(){if(At)return Ee;At=1;var e=Ee&&Ee.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ee,"__esModule",{value:!0});const a=e(cr());return Ee.default=a.default.create("genKeyPair","getPublicKey","sign","verify"),Ee}var Ot;function ln(){if(Ot)return oe;Ot=1;var e=oe&&oe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(oe,"__esModule",{value:!0}),oe.Ed25519Signer=void 0;const a=e(lr()),i=e(je()),d=ne(),c=e(gt()),s=ve(),m=a.default.sign;class f extends c.default{constructor(){super()}genKeyPair(g="hex",n){const o=n?(0,d.toUint8Array)(n):new Uint8Array((0,i.default)(32));if(o.byteLength!==32)throw new Error("Invalid seed to generate key pair");const l=m.keyPair.fromSeed(o);return l.publicKey=(0,s.encode)(l.publicKey,g),l.secretKey=(0,s.encode)(l.secretKey,g),l}getPublicKey(g,n="hex"){const o=(0,d.toUint8Array)(g),l=m.keyPair.fromSecretKey(o).publicKey;return(0,s.encode)(l,n)}sign(g,n,o="hex"){const l=(0,d.toUint8Array)(n),h=(0,d.toUint8Array)(g),E=m.detached(h,l);return(0,s.encode)(E,o)}verify(g,n,o){const l=(0,d.toUint8Array)(o),h=(0,d.toUint8Array)(g),E=(0,d.toUint8Array)(n);return m.detached.verify(h,E,l)}}return oe.Ed25519Signer=f,oe.default=new f,oe}var ae={},ce={},Bt;function Tr(){if(Bt)return ce;Bt=1;var e=ce&&ce.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(ce,"__esModule",{value:!0}),ce.Secp256k1Signer=void 0;const a=e(ur()),i=ne(),d=e(je()),c=e(gt()),s=ve(),m=a.default.ec,f=new m("secp256k1");class p extends c.default{constructor(){super(),this.pkHasFormatPrefix=!0,this.pkCompressed=!1}isValidSK(n){if(n.byteLength!==32)return!1;const o=new i.BN(n);return o.cmp(f.curve.n)<0&&!o.isZero()}genKeyPair(n="hex"){let o=null;do o=new Uint8Array((0,d.default)(32));while(!this.isValidSK(o));const l=this.getPublicKey((0,i.toHex)(o));return{secretKey:(0,s.encode)(o,n),publicKey:(0,s.encode)(l,n)}}getPublicKey(n,o="hex"){if(!this.isValidSK((0,i.toUint8Array)(n)))throw new Error("Invalid secret key");let l=f.keyFromPrivate((0,i.toBuffer)(n)).getPublic(this.pkCompressed,"hex");return this.pkHasFormatPrefix===!1&&(l=l.slice(2)),(0,s.encode)(`0x${l}`,o)}sign(n,o,l="hex"){let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=f.keyFromPrivate((0,i.toBuffer)(o)).sign((0,i.stripHexPrefix)(h),{canonical:!0}).toDER("hex");return(0,s.encode)(`0x${E}`,l)}verify(n,o,l){let h=n;try{h=(0,i.toUint8Array)(n)}catch{}let E=(0,i.toBuffer)(l);return this.pkHasFormatPrefix===!1&&E[0]!==4&&E.byteLength===64&&(E=C.concat([C.from([4]),E])),f.keyFromPublic(E).verify((0,i.stripHexPrefix)(h),(0,i.stripHexPrefix)((0,i.toHex)(o)))}}return ce.Secp256k1Signer=p,ce.default=new p,ce}var Pt;function un(){if(Pt)return ae;Pt=1;var e=ae&&ae.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(ae,"__esModule",{value:!0}),ae.EthereumSigner=void 0;const a=e(fr()),i=e(dr()),d=ne(),c=Tr();class s extends c.Secp256k1Signer{constructor(){super(),this.pkHasFormatPrefix=!1}ethHash(f){const p=(0,d.isHexStrict)(f)?f:(0,d.utf8ToHex)(f),g=(0,d.hexToBytes)(p),n=C.from(g),o=`Ethereum Signed Message:
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CUQ2UhNw.js","assets/index-BWTQhZ4U.js","assets/vendor-mui-core-BkVXEDpj.js","assets/vendor-react-Dvs43sk9.js","assets/vendor-ux-lckoR4gs.js","assets/vendor-utils-DtY42AM-.js","assets/vendor-hooks-CLY4g97Q.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-Q5ECWsoh.js","assets/index-DrVXX4fX.css","assets/index-BPy8_fa2.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as I,a as Rr}from"./vendor-react-Dvs43sk9.js";import{r as Gt,a as Zt,b as Qt,c as er,d as ct,e as tr,f as rr,g as nr,h as lt,i as ir,j as sr,k as or,m as Ke,n as ar,o as cr,p as lr,q as je,s as ur,t as fr,u as dr,v as hr,an as Cr,b9 as Dr,T as Be,H as De,_ as Kr,$ as pr,a6 as Ce,ac as Nr,O as Ir}from"./vendor-ux-lckoR4gs.js";import{j as r,Y as ut,bB as ft,I as dt,aj as ht,$ as pt,b1 as me,T as X,ak as k,z as V,F as M,b7 as Lr,b5 as yr,b6 as mr,a5 as gr,a3 as yt,aX as br,R as _r,Q as He,a6 as mt,W as w,am as qr,ck as Sr,cl as Mr,c9 as Fr}from"./vendor-mui-core-BkVXEDpj.js";import{B as Wr,o as Vr,l as zr}from"./index-FcG9efoK.js";import{u as Yr}from"./useAsyncRetry-XOTAwnFJ.js";import{w as Er,B as C,o as Xr,b as Jr,C as xt}from"./vendor-utils-DtY42AM-.js";import{r as Gr}from"./hdkey-DSMaex4r.js";import{Z as Pe,c as re,a8 as Zr}from"./index-BWTQhZ4U.js";import{u as $e}from"./team-BqbXtbtA.js";import{u as xr,C as z}from"./index.esm-JPZAjt0x.js";import{T as Qr}from"./index-DpkWkxvh.js";import{E as en}from"./empty-spinner-8MrwYy6o.js";import{C as q}from"./click-to-copy-C6lmeRAF.js";import{D as tn}from"./delete-confirm-o1zts8U4.js";import{a as rn}from"./passport-item-DCZlw8VZ.js";import{A as nn}from"./actions-DAS8NTxZ.js";import{T as Tt}from"./table-tips-DaCM8P_z.js";import{u as sn}from"./use-mobile-BTugf2DR.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./useAsync-B3JLhOUX.js";import"./vendor-arcblock-Q5ECWsoh.js";import"./session-U-hEcJ3m.js";import"./isURL-DFvT0vCW.js";import"./use-app-logo-1g85gLSt.js";import"./arrow-down.svg-D4RAc36g.js";import"./vendor-mui-x-DiiSwpci.js";import"./AdapterDayjs-B7ApPoXD.js";import"./confirm-dtnPbiJU.js";import"./index-DBs9Ljax.js";import"./did-address-jhnZEWZT.js";import"./util-jhRcmTca.js";import"./base32-BfYXZjht.js";var Ae={},ke={},Z={},Ht;function ne(){return Ht||(Ht=1,function(e){var a=Z&&Z.__createBinding||(Object.create?function(t,u,y,U){U===void 0&&(U=y);var x=Object.getOwnPropertyDescriptor(u,y);(!x||("get"in x?!u.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return u[y]}}),Object.defineProperty(t,U,x)}:function(t,u,y,U){U===void 0&&(U=y),t[U]=u[y]}),i=Z&&Z.__setModuleDefault||(Object.create?function(t,u){Object.defineProperty(t,"default",{enumerable:!0,value:u})}:function(t,u){t.default=u}),d=Z&&Z.__importStar||function(t){if(t&&t.__esModule)return t;var u={};if(t!=null)for(var y in t)y!=="default"&&Object.prototype.hasOwnProperty.call(t,y)&&a(u,t,y);return i(u,t),u},c=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.fromTokenToUnit=e.fromUnitToToken=e.numberToString=e.toHex=e.hexToBytes=e.bytesToHex=e.numberToHex=e.hexToNumber=e.hexToUtf8=e.utf8ToHex=e.toBN=e.isHex=e.isHexStrict=e.isBigNumber=e.isBN=e.stripHexPrefix=e.isHexPrefixed=e.numberToBN=e.rightPad=e.leftPad=e.BN=e.isBase58btc=void 0,e.isUint8Array=ge,e.UUID=Ge,e.isUUID=Ze,e.toUint8Array=be,e.toBuffer=Ue,e.toBase58=Qe,e.fromBase58=et,e.toBase64=tt,e.fromBase64=rt,e.toAddress=te,e.toDid=nt,e.isSameDid=it,e.formatTxType=st;const s=c(Gt),m=c(Zt),f=c(Qt),p=c(er),g=c(ct),n=c(tr),o=c(rr),l=c(nr);e.rightPad=l.default;const h=c(lt);e.leftPad=h.default;const E=c(ir()),b=c(sr()),_=c(Er());e.BN=_.default;const A=d(or()),R="did:abt:",H=new _.default(0),T=new _.default(-1),j={encode:t=>`z${E.default.encode(t)}`,decode:t=>E.default.decode(t.slice(1))},O=t=>{if(typeof t!="string")return!1;if(t[0]==="z")try{return j.decode(t),!0}catch{return!1}return!1};e.isBase58btc=O;const S=t=>{if(typeof t=="string"||typeof t=="number"){let u=new _.default(1);const y=String(t).toLowerCase().trim(),U=y.substr(0,2)==="0x"||y.substr(0,3)==="-0x";let x=(0,e.stripHexPrefix)(y);if(x.substr(0,1)==="-"&&(x=(0,e.stripHexPrefix)(x.slice(1)),u=new _.default(-1,10)),x=x===""?"0":x,!x.match(/^-?[0-9]+$/)&&x.match(/^[0-9A-Fa-f]+$/)||x.match(/^[a-fA-F]+$/)||U===!0&&x.match(/^[0-9A-Fa-f]+$/))return new _.default(x,16).mul(u);if((x.match(/^-?[0-9]+$/)||x==="")&&U===!1)return new _.default(x,10).mul(u)}if((0,e.isBN)(t))return new _.default(t.toString(10),10);throw new Error(`[number-to-bn] while converting number ${JSON.stringify(t)} to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.`)};e.numberToBN=S;const v=t=>{if(typeof t!="string")throw new Error("[is-hex-prefixed] value must be type string");return t.slice(0,2).toLowerCase()==="0x"};e.isHexPrefixed=v;const P=t=>typeof t=="string"&&(0,e.isHexPrefixed)(t)?t.slice(2):t;e.stripHexPrefix=P;const B=t=>t instanceof _.default||t&&t.constructor&&t.constructor.name==="BN";e.isBN=B;const N=t=>t&&t.constructor&&t.constructor.name==="BigNumber";e.isBigNumber=N;const ee=t=>((0,m.default)(t)||(0,f.default)(t))&&/^(-)?0x[0-9a-f]*$/i.test(t);e.isHexStrict=ee;const Ne=t=>((0,m.default)(t)||(0,f.default)(t))&&/^(-0x|0x|0X|-0X)?[0-9a-f]*$/i.test(t);e.isHex=Ne;const Ie=(t,u=10)=>{try{if(typeof t=="number"&&t>0){const y=Number(t).toLocaleString("fullwide",{useGrouping:!1});return new _.default(y,u)}return(0,e.numberToBN)(t)}catch(y){throw new Error(`${y} Given value: "${t}"`)}};e.toBN=Ie;const Le=t=>{t=A.encode(t);let u="";t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join("");for(let y=0;y<t.length;y++){const x=t.charCodeAt(y).toString(16);u+=x.length<2?`0${x}`:x}return`0x${u}`};e.utf8ToHex=Le;const qe=t=>{if(!(0,e.isHexStrict)(t))throw new Error(`The parameter "${t}" must be a valid HEX string.`);let u="",y=0;t=t.replace(/^0x/i,""),t=t.replace(/^(?:00)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:00)*/,""),t=t.split("").reverse().join("");const U=t.length;for(let x=0;x<U;x+=2)y=parseInt(t.substr(x,2),16),u+=String.fromCharCode(y);return A.decode(u)};e.hexToUtf8=qe;const Me=t=>t?(0,e.toBN)(t).toNumber():0;e.hexToNumber=Me;const Fe=t=>{if((0,o.default)(t)||typeof t>"u")return t;if(!isFinite(t)&&!(0,e.isHex)(t))throw new Error(`Given input "${t}" is not a number.`);const u=(0,e.toBN)(t),y=u.toString(16);return u.lt(new _.default(0))?`-0x${y.substr(1)}`:`0x${y}`};e.numberToHex=Fe;const We=t=>{const u=[];for(let y=0;y<t.length;y++)u.push((t[y]>>>4).toString(16)),u.push((t[y]&15).toString(16));return`0x${u.join("")}`};e.bytesToHex=We;const Ve=t=>{if(t=t.toString(16),!(0,e.isHex)(t))throw new Error(`Given value "${t}" is not a valid hex string.`);t=t.replace(/^0x/i,""),t=t.length%2?`0${t}`:t;const u=[];for(let y=0;y<t.length;y+=2)u.push(parseInt(t.substr(y,2),16));return u};e.hexToBytes=Ve;const ze=(t,u=!1)=>ge(t)||C.isBuffer(t)?u?"bytes":(0,e.bytesToHex)(t):(0,e.isBase58btc)(t)?u?"bytes":(0,e.bytesToHex)(j.decode(t)):(0,s.default)(t)?u?"bool":t?"0x01":"0x00":(0,p.default)(t)&&!(0,e.isBigNumber)(t)&&!(0,e.isBN)(t)?u?"string":(0,e.utf8ToHex)(JSON.stringify(t)):typeof t=="string"?t.indexOf("-0x")===0||t.indexOf("-0X")===0?u?"int256":(0,e.numberToHex)(t):t.indexOf("0x")===0||t.indexOf("0X")===0?u?"bytes":t:u?"string":(0,e.utf8ToHex)(t):u?+t<0?"int256":"uint256":(0,e.numberToHex)(t);e.toHex=ze;const Ye=t=>{if(typeof t=="string"){if(!t.match(/^-?[0-9.]+$/))throw new Error(`Invalid value '${t}' while converting to string, should be a number matching (^-?[0-9.]+).`);return t}if(typeof t=="number")return Number.isInteger(t)&&t>0?Number(t).toLocaleString("fullwide",{useGrouping:!1}):String(t);if(typeof t=="object"&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error(`while converting number to string, invalid number value '${t}' type ${typeof t}.`)};e.numberToString=Ye;const Xe=(t,u=18,y={})=>{let U=(0,e.toBN)(t);const x=U.lt(H),F=(0,e.toBN)(`1${"0".repeat(u)}`,10),G=F.toString(10).length-1||1,K=y||{};x&&(U=U.mul(T));let $=U.mod(F).toString(10);for(;$.length<G;)$=`0${$}`;K.pad||($=$.match(/^([0-9]*[1-9]|0)(0*)/)[1]);let L=U.div(F).toString(10);K.commify&&(L=L.replace(/\B(?=(\d{3})+(?!\d))/g,","));let _e=`${L}${$==="0"?"":`.${$}`}`;return x&&(_e=`-${_e}`),_e};e.fromUnitToToken=Xe;const Je=(t,u=18)=>{let y=(0,e.numberToString)(t);const U=(0,e.toBN)(`1${"0".repeat(u)}`,10),x=U.toString(10).length-1||1,F=y.substring(0,1)==="-";if(F&&(y=y.substring(1)),y===".")throw new Error(`error converting token ${t} to unit, invalid value`);const G=y.split(".");if(G.length>2)throw new Error(`error converting token ${t} to unit, too many decimal points`);let K=G[0],$=G[1];if(K||(K="0"),$||($="0"),$.length>x)throw new Error(`error converting token ${t} to unit, too many decimal places`);for(;$.length<x;)$+="0";K=new _.default(K),$=new _.default($);let L=K.mul(U).add($);return F&&(L=L.mul(T)),new _.default(L.toString(10),10)};e.fromTokenToUnit=Je;function ge(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function Ge(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const u=Math.random()*16|0;return(t==="x"?u:u&3|8).toString(16)})}function Ze(t){return/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(t)}function be(t){let u=null;if([null,void 0,""].includes(t))u=new Uint8Array;else if(C.isBuffer(t))u=new Uint8Array(t);else if((0,e.isHexStrict)(t))u=new Uint8Array((0,e.hexToBytes)(t));else if(ge(t))u=new Uint8Array(t);else if((0,e.isBase58btc)(t))u=new Uint8Array(j.decode(t));else if(typeof t=="string")u=new Uint8Array((0,e.hexToBytes)((0,e.toHex)(t)));else throw new Error(`Unsupported input type ${typeof t} detected for toBuffer, only Uint8Array/Buffer/Hex/Base58 are supported`);return u}function Ue(t){return C.from(be(t))}function Qe(t){const u=j.encode(be(t));return C.from(u).toString("utf-8")}function et(t){if((0,e.isBase58btc)(t)===!1)throw new Error("fromBase58 expect strict base58 encoded string as input");return C.from(j.decode(t))}function tt(t,u=!0){const y=b.default.encode(Ue(t));return u?b.default.escape(y):y}function rt(t){if(typeof t!="string")throw new Error("fromBase64 requires input to be a string");return C.from(b.default.unescape(t),"base64")}function te(t){return t.replace(R,"")}function nt(t){return`${R}${te(t)}`}function it(t,u){return te(t).toLowerCase()===te(u).toLowerCase()}function st(t){return(0,g.default)((0,n.default)(t))}}(Z)),Z}var jt;function ve(){if(jt)return ke;jt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.encode=a;const e=ne();function a(i,d="hex"){return["hex","base16"].includes(d)?(0,e.toHex)(i):d==="base58"?(0,e.toBase58)(i):d==="base64"?(0,e.toBase64)(i):d==="Uint8Array"?(0,e.toUint8Array)(i):d==="buffer"?(0,e.toBuffer)(i):i}return ke}var ie={},vt;function on(){if(vt)return ie;vt=1;var e=ie&&ie.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.KeccakHasher=void 0;const a=e(Ke()),i=ne(),d=ve();class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=n=>a.default[`keccak${m}`](n),g=(n,o)=>o===1?p(n):g(p(n),o-1);this[f]=(n,o=1,l="hex")=>{let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=g(h,o);return(0,d.encode)(`0x${E}`,l)}})}}return ie.KeccakHasher=c,ie.default=new c,ie}var Se={},wt;function an(){if(wt)return Se;wt=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.Sha2Hasher=void 0;const e=ne(),a=ar(),i=ve(),d={sha224:a.sha224,sha256:a.sha256,sha384:a.sha384,sha512:a.sha512};class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=d[`sha${m}`],g=(n,o)=>{let l=n;try{l=(0,e.toUint8Array)(n)}catch{}return o===1?`0x${p().update(l).digest("hex")}`:g(g(l,1),o-1)};this[f]=(n,o=2,l="hex")=>{const h=g(n,o);return(0,i.encode)(h,l)}})}}return Se.Sha2Hasher=c,Se.default=new c,Se}var se={},Ut;function cn(){if(Ut)return se;Ut=1;var e=se&&se.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(se,"__esModule",{value:!0}),se.Sha3Hasher=void 0;const a=e(Ke()),i=ne(),d=ve();class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=a.default[`sha3_${m}`],g=(n,o)=>o===1?p(n):g(p(n),o-1);this[f]=(n,o=1,l="hex")=>{let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=g(h,o);return(0,d.encode)(`0x${E}`,l)}})}}return se.Sha3Hasher=c,se.default=new c,se}var oe={},Ee={},At;function gt(){if(At)return Ee;At=1;var e=Ee&&Ee.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ee,"__esModule",{value:!0});const a=e(cr());return Ee.default=a.default.create("genKeyPair","getPublicKey","sign","verify"),Ee}var Ot;function ln(){if(Ot)return oe;Ot=1;var e=oe&&oe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(oe,"__esModule",{value:!0}),oe.Ed25519Signer=void 0;const a=e(lr()),i=e(je()),d=ne(),c=e(gt()),s=ve(),m=a.default.sign;class f extends c.default{constructor(){super()}genKeyPair(g="hex",n){const o=n?(0,d.toUint8Array)(n):new Uint8Array((0,i.default)(32));if(o.byteLength!==32)throw new Error("Invalid seed to generate key pair");const l=m.keyPair.fromSeed(o);return l.publicKey=(0,s.encode)(l.publicKey,g),l.secretKey=(0,s.encode)(l.secretKey,g),l}getPublicKey(g,n="hex"){const o=(0,d.toUint8Array)(g),l=m.keyPair.fromSecretKey(o).publicKey;return(0,s.encode)(l,n)}sign(g,n,o="hex"){const l=(0,d.toUint8Array)(n),h=(0,d.toUint8Array)(g),E=m.detached(h,l);return(0,s.encode)(E,o)}verify(g,n,o){const l=(0,d.toUint8Array)(o),h=(0,d.toUint8Array)(g),E=(0,d.toUint8Array)(n);return m.detached.verify(h,E,l)}}return oe.Ed25519Signer=f,oe.default=new f,oe}var ae={},ce={},Bt;function Tr(){if(Bt)return ce;Bt=1;var e=ce&&ce.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(ce,"__esModule",{value:!0}),ce.Secp256k1Signer=void 0;const a=e(ur()),i=ne(),d=e(je()),c=e(gt()),s=ve(),m=a.default.ec,f=new m("secp256k1");class p extends c.default{constructor(){super(),this.pkHasFormatPrefix=!0,this.pkCompressed=!1}isValidSK(n){if(n.byteLength!==32)return!1;const o=new i.BN(n);return o.cmp(f.curve.n)<0&&!o.isZero()}genKeyPair(n="hex"){let o=null;do o=new Uint8Array((0,d.default)(32));while(!this.isValidSK(o));const l=this.getPublicKey((0,i.toHex)(o));return{secretKey:(0,s.encode)(o,n),publicKey:(0,s.encode)(l,n)}}getPublicKey(n,o="hex"){if(!this.isValidSK((0,i.toUint8Array)(n)))throw new Error("Invalid secret key");let l=f.keyFromPrivate((0,i.toBuffer)(n)).getPublic(this.pkCompressed,"hex");return this.pkHasFormatPrefix===!1&&(l=l.slice(2)),(0,s.encode)(`0x${l}`,o)}sign(n,o,l="hex"){let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=f.keyFromPrivate((0,i.toBuffer)(o)).sign((0,i.stripHexPrefix)(h),{canonical:!0}).toDER("hex");return(0,s.encode)(`0x${E}`,l)}verify(n,o,l){let h=n;try{h=(0,i.toUint8Array)(n)}catch{}let E=(0,i.toBuffer)(l);return this.pkHasFormatPrefix===!1&&E[0]!==4&&E.byteLength===64&&(E=C.concat([C.from([4]),E])),f.keyFromPublic(E).verify((0,i.stripHexPrefix)(h),(0,i.stripHexPrefix)((0,i.toHex)(o)))}}return ce.Secp256k1Signer=p,ce.default=new p,ce}var Pt;function un(){if(Pt)return ae;Pt=1;var e=ae&&ae.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(ae,"__esModule",{value:!0}),ae.EthereumSigner=void 0;const a=e(fr()),i=e(dr()),d=ne(),c=Tr();class s extends c.Secp256k1Signer{constructor(){super(),this.pkHasFormatPrefix=!1}ethHash(f){const p=(0,d.isHexStrict)(f)?f:(0,d.utf8ToHex)(f),g=(0,d.hexToBytes)(p),n=C.from(g),o=`Ethereum Signed Message:
|
|
3
3
|
${g.length}`,l=C.from(o),h=C.concat([l,n]);return i.default.keccak256s(h)}ethSign(f,p){return a.default.sign(f,p)}ethRecover(f,p){return a.default.recover(f,p)}}return ae.EthereumSigner=s,ae.default=new s,ae}var le={},$t;function fn(){if($t)return le;$t=1;var e=le&&le.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(le,"__esModule",{value:!0}),le.PasskeySigner=void 0;const a=ne(),i=hr(),d=e(gt());class c extends d.default{constructor(){super()}genKeyPair(m="hex",f){throw new Error("Not supported")}getPublicKey(m,f="hex"){throw new Error("Not supported")}sign(m,f,p="hex"){throw new Error("Not supported")}async verify(m,f,p,g){const n=JSON.parse(g);if(!n.authenticatorData||!n.clientDataJSON)throw new Error("extra.authenticatorData or extra.clientDataJSON is required for passkey signature verification");const o=(0,a.toBuffer)((0,a.fromBase64)(n.authenticatorData)),l=await(0,i.toHash)(i.isoBase64URL.toBuffer(n.clientDataJSON));if((0,i.decodeClientDataJSON)(n.clientDataJSON).challenge!==(0,a.toBase64)(m))throw new Error("challenge mismatch for passkey signature");return(0,i.verifySignature)({signature:i.isoBase64URL.toBuffer(typeof f=="string"?f:(0,a.toBase64)(f)),data:i.isoUint8Array.concat([o,l]),credentialPublicKey:p})}}return le.PasskeySigner=c,le.default=new c,le}var kt;function dn(){return kt||(kt=1,function(e){var a=Ae&&Ae.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.toTxHash=e.Hashers=e.Signers=e.types=e.Hasher=e.Signer=void 0,e.getSigner=o,e.getHasher=l,e.getRandomBytes=h;const i=a(je()),d=ve(),c=a(on()),s=a(an()),m=a(cn()),f=a(ln()),p=a(un()),g=a(Tr()),n=a(fn());e.Signer={Ed25519:f.default,Secp256k1:g.default,Ethereum:p.default,Passkey:n.default},e.Hasher={SHA2:s.default,SHA3:m.default,Keccak:c.default},e.types={KeyType:{ED25519:0,SECP256K1:1,ETHEREUM:2,PASSKEY:3},HashType:{KECCAK:0,SHA3:1,KECCAK_384:2,SHA3_384:3,KECCAK_512:4,SHA3_512:5,SHA2:6},RoleType:{ROLE_ACCOUNT:0,ROLE_NODE:1,ROLE_DEVICE:2,ROLE_APPLICATION:3,ROLE_SMART_CONTRACT:4,ROLE_BOT:5,ROLE_ASSET:6,ROLE_STAKE:7,ROLE_VALIDATOR:8,ROLE_GROUP:9,ROLE_TX:10,ROLE_TETHER:11,ROLE_SWAP:12,ROLE_DELEGATION:13,ROLE_VC:14,ROLE_BLOCKLET:15,ROLE_STORE:16,ROLE_TOKEN:17,ROLE_FACTORY:18,ROLE_ROLLUP:19,ROLE_STORAGE:20,ROLE_PROFILE:21,ROLE_PASSKEY:22,ROLE_TOKEN_FACTORY:23,ROLE_ANY:63},EncodingType:{BASE16:0,BASE58:1}};function o(b){if(typeof e.Signers[b]>"u")throw new Error(`Unsupported signer type: ${b}`);return e.Signers[b]}function l(b){if(typeof e.Hashers[b]>"u")throw new Error(`Unsupported hash type: ${b}`);return e.Hashers[b]}function h(b=32,_="hex"){return(0,d.encode)((0,i.default)(b),_)}e.Signers=Object.freeze({[e.types.KeyType.ED25519]:e.Signer.Ed25519,[e.types.KeyType.SECP256K1]:e.Signer.Secp256k1,[e.types.KeyType.ETHEREUM]:e.Signer.Ethereum,[e.types.KeyType.PASSKEY]:e.Signer.Passkey}),e.Hashers=Object.freeze({[e.types.HashType.KECCAK]:e.Hasher.Keccak.hash256,[e.types.HashType.KECCAK_384]:e.Hasher.Keccak.hash384,[e.types.HashType.KECCAK_512]:e.Hasher.Keccak.hash512,[e.types.HashType.SHA3]:e.Hasher.SHA3.hash256,[e.types.HashType.SHA3_384]:e.Hasher.SHA3.hash384,[e.types.HashType.SHA3_512]:e.Hasher.SHA3.hash512,[e.types.HashType.SHA2]:e.Hasher.SHA2.hash256});const E=b=>e.Hasher.SHA2.hash256(b,1,"hex").replace(/^0x/,"").toUpperCase();e.toTxHash=E}(Ae)),Ae}var Y={},Q={},Rt;function J(){return Rt||(Rt=1,function(e){var a=Q&&Q.__createBinding||(Object.create?function(t,u,y,U){U===void 0&&(U=y);var x=Object.getOwnPropertyDescriptor(u,y);(!x||("get"in x?!u.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return u[y]}}),Object.defineProperty(t,U,x)}:function(t,u,y,U){U===void 0&&(U=y),t[U]=u[y]}),i=Q&&Q.__setModuleDefault||(Object.create?function(t,u){Object.defineProperty(t,"default",{enumerable:!0,value:u})}:function(t,u){t.default=u}),d=Q&&Q.__importStar||function(t){if(t&&t.__esModule)return t;var u={};if(t!=null)for(var y in t)y!=="default"&&Object.prototype.hasOwnProperty.call(t,y)&&a(u,t,y);return i(u,t),u},c=Q&&Q.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.fromTokenToUnit=e.fromUnitToToken=e.numberToString=e.toHex=e.hexToBytes=e.bytesToHex=e.numberToHex=e.hexToNumber=e.hexToUtf8=e.utf8ToHex=e.toBN=e.isHex=e.isHexStrict=e.isBigNumber=e.isBN=e.stripHexPrefix=e.isHexPrefixed=e.numberToBN=e.rightPad=e.leftPad=e.BN=e.isBase58btc=void 0,e.isUint8Array=ge,e.UUID=Ge,e.isUUID=Ze,e.toUint8Array=be,e.toBuffer=Ue,e.toBase58=Qe,e.fromBase58=et,e.toBase64=tt,e.fromBase64=rt,e.toAddress=te,e.toDid=nt,e.isSameDid=it,e.formatTxType=st;const s=c(Gt),m=c(Zt),f=c(Qt),p=c(er),g=c(ct),n=c(tr),o=c(rr),l=c(nr);e.rightPad=l.default;const h=c(lt);e.leftPad=h.default;const E=c(ir()),b=c(sr()),_=c(Er());e.BN=_.default;const A=d(or()),R="did:abt:",H=new _.default(0),T=new _.default(-1),j={encode:t=>`z${E.default.encode(t)}`,decode:t=>E.default.decode(t.slice(1))},O=t=>{if(typeof t!="string")return!1;if(t[0]==="z")try{return j.decode(t),!0}catch{return!1}return!1};e.isBase58btc=O;const S=t=>{if(typeof t=="string"||typeof t=="number"){let u=new _.default(1);const y=String(t).toLowerCase().trim(),U=y.substr(0,2)==="0x"||y.substr(0,3)==="-0x";let x=(0,e.stripHexPrefix)(y);if(x.substr(0,1)==="-"&&(x=(0,e.stripHexPrefix)(x.slice(1)),u=new _.default(-1,10)),x=x===""?"0":x,!x.match(/^-?[0-9]+$/)&&x.match(/^[0-9A-Fa-f]+$/)||x.match(/^[a-fA-F]+$/)||U===!0&&x.match(/^[0-9A-Fa-f]+$/))return new _.default(x,16).mul(u);if((x.match(/^-?[0-9]+$/)||x==="")&&U===!1)return new _.default(x,10).mul(u)}if((0,e.isBN)(t))return new _.default(t.toString(10),10);throw new Error(`[number-to-bn] while converting number ${JSON.stringify(t)} to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.`)};e.numberToBN=S;const v=t=>{if(typeof t!="string")throw new Error("[is-hex-prefixed] value must be type string");return t.slice(0,2).toLowerCase()==="0x"};e.isHexPrefixed=v;const P=t=>typeof t=="string"&&(0,e.isHexPrefixed)(t)?t.slice(2):t;e.stripHexPrefix=P;const B=t=>t instanceof _.default||t&&t.constructor&&t.constructor.name==="BN";e.isBN=B;const N=t=>t&&t.constructor&&t.constructor.name==="BigNumber";e.isBigNumber=N;const ee=t=>((0,m.default)(t)||(0,f.default)(t))&&/^(-)?0x[0-9a-f]*$/i.test(t);e.isHexStrict=ee;const Ne=t=>((0,m.default)(t)||(0,f.default)(t))&&/^(-0x|0x|0X|-0X)?[0-9a-f]*$/i.test(t);e.isHex=Ne;const Ie=(t,u=10)=>{try{if(typeof t=="number"&&t>0){const y=Number(t).toLocaleString("fullwide",{useGrouping:!1});return new _.default(y,u)}return(0,e.numberToBN)(t)}catch(y){throw new Error(`${y} Given value: "${t}"`)}};e.toBN=Ie;const Le=t=>{t=A.encode(t);let u="";t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join("");for(let y=0;y<t.length;y++){const x=t.charCodeAt(y).toString(16);u+=x.length<2?`0${x}`:x}return`0x${u}`};e.utf8ToHex=Le;const qe=t=>{if(!(0,e.isHexStrict)(t))throw new Error(`The parameter "${t}" must be a valid HEX string.`);let u="",y=0;t=t.replace(/^0x/i,""),t=t.replace(/^(?:00)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:00)*/,""),t=t.split("").reverse().join("");const U=t.length;for(let x=0;x<U;x+=2)y=parseInt(t.substr(x,2),16),u+=String.fromCharCode(y);return A.decode(u)};e.hexToUtf8=qe;const Me=t=>t?(0,e.toBN)(t).toNumber():0;e.hexToNumber=Me;const Fe=t=>{if((0,o.default)(t)||typeof t>"u")return t;if(!isFinite(t)&&!(0,e.isHex)(t))throw new Error(`Given input "${t}" is not a number.`);const u=(0,e.toBN)(t),y=u.toString(16);return u.lt(new _.default(0))?`-0x${y.substr(1)}`:`0x${y}`};e.numberToHex=Fe;const We=t=>{const u=[];for(let y=0;y<t.length;y++)u.push((t[y]>>>4).toString(16)),u.push((t[y]&15).toString(16));return`0x${u.join("")}`};e.bytesToHex=We;const Ve=t=>{if(t=t.toString(16),!(0,e.isHex)(t))throw new Error(`Given value "${t}" is not a valid hex string.`);t=t.replace(/^0x/i,""),t=t.length%2?`0${t}`:t;const u=[];for(let y=0;y<t.length;y+=2)u.push(parseInt(t.substr(y,2),16));return u};e.hexToBytes=Ve;const ze=(t,u=!1)=>ge(t)||C.isBuffer(t)?u?"bytes":(0,e.bytesToHex)(t):(0,e.isBase58btc)(t)?u?"bytes":(0,e.bytesToHex)(j.decode(t)):(0,s.default)(t)?u?"bool":t?"0x01":"0x00":(0,p.default)(t)&&!(0,e.isBigNumber)(t)&&!(0,e.isBN)(t)?u?"string":(0,e.utf8ToHex)(JSON.stringify(t)):typeof t=="string"?t.indexOf("-0x")===0||t.indexOf("-0X")===0?u?"int256":(0,e.numberToHex)(t):t.indexOf("0x")===0||t.indexOf("0X")===0?u?"bytes":t:u?"string":(0,e.utf8ToHex)(t):u?+t<0?"int256":"uint256":(0,e.numberToHex)(t);e.toHex=ze;const Ye=t=>{if(typeof t=="string"){if(!t.match(/^-?[0-9.]+$/))throw new Error(`Invalid value '${t}' while converting to string, should be a number matching (^-?[0-9.]+).`);return t}if(typeof t=="number")return Number.isInteger(t)&&t>0?Number(t).toLocaleString("fullwide",{useGrouping:!1}):String(t);if(typeof t=="object"&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error(`while converting number to string, invalid number value '${t}' type ${typeof t}.`)};e.numberToString=Ye;const Xe=(t,u=18,y={})=>{let U=(0,e.toBN)(t);const x=U.lt(H),F=(0,e.toBN)(`1${"0".repeat(u)}`,10),G=F.toString(10).length-1||1,K=y||{};x&&(U=U.mul(T));let $=U.mod(F).toString(10);for(;$.length<G;)$=`0${$}`;K.pad||($=$.match(/^([0-9]*[1-9]|0)(0*)/)[1]);let L=U.div(F).toString(10);K.commify&&(L=L.replace(/\B(?=(\d{3})+(?!\d))/g,","));let _e=`${L}${$==="0"?"":`.${$}`}`;return x&&(_e=`-${_e}`),_e};e.fromUnitToToken=Xe;const Je=(t,u=18)=>{let y=(0,e.numberToString)(t);const U=(0,e.toBN)(`1${"0".repeat(u)}`,10),x=U.toString(10).length-1||1,F=y.substring(0,1)==="-";if(F&&(y=y.substring(1)),y===".")throw new Error(`error converting token ${t} to unit, invalid value`);const G=y.split(".");if(G.length>2)throw new Error(`error converting token ${t} to unit, too many decimal points`);let K=G[0],$=G[1];if(K||(K="0"),$||($="0"),$.length>x)throw new Error(`error converting token ${t} to unit, too many decimal places`);for(;$.length<x;)$+="0";K=new _.default(K),$=new _.default($);let L=K.mul(U).add($);return F&&(L=L.mul(T)),new _.default(L.toString(10),10)};e.fromTokenToUnit=Je;function ge(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function Ge(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const u=Math.random()*16|0;return(t==="x"?u:u&3|8).toString(16)})}function Ze(t){return/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(t)}function be(t){let u=null;if([null,void 0,""].includes(t))u=new Uint8Array;else if(C.isBuffer(t))u=new Uint8Array(t);else if((0,e.isHexStrict)(t))u=new Uint8Array((0,e.hexToBytes)(t));else if(ge(t))u=new Uint8Array(t);else if((0,e.isBase58btc)(t))u=new Uint8Array(j.decode(t));else if(typeof t=="string")u=new Uint8Array((0,e.hexToBytes)((0,e.toHex)(t)));else throw new Error(`Unsupported input type ${typeof t} detected for toBuffer, only Uint8Array/Buffer/Hex/Base58 are supported`);return u}function Ue(t){return C.from(be(t))}function Qe(t){const u=j.encode(be(t));return C.from(u).toString("utf-8")}function et(t){if((0,e.isBase58btc)(t)===!1)throw new Error("fromBase58 expect strict base58 encoded string as input");return C.from(j.decode(t))}function tt(t,u=!0){const y=b.default.encode(Ue(t));return u?b.default.escape(y):y}function rt(t){if(typeof t!="string")throw new Error("fromBase64 requires input to be a string");return C.from(b.default.unescape(t),"base64")}function te(t){return t.replace(R,"")}function nt(t){return`${R}${te(t)}`}function it(t,u){return te(t).toLowerCase()===te(u).toLowerCase()}function st(t){return(0,g.default)((0,n.default)(t))}}(Q)),Q}var Oe={},Re={},Ct;function we(){if(Ct)return Re;Ct=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.encode=a;const e=J();function a(i,d="hex"){return["hex","base16"].includes(d)?(0,e.toHex)(i):d==="base58"?(0,e.toBase58)(i):d==="base64"?(0,e.toBase64)(i):d==="Uint8Array"?(0,e.toUint8Array)(i):d==="buffer"?(0,e.toBuffer)(i):i}return Re}var ue={},Dt;function hn(){if(Dt)return ue;Dt=1;var e=ue&&ue.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ue,"__esModule",{value:!0}),ue.KeccakHasher=void 0;const a=e(Ke()),i=J(),d=we();class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=n=>a.default[`keccak${m}`](n),g=(n,o)=>o===1?p(n):g(p(n),o-1);this[f]=(n,o=1,l="hex")=>{let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=g(h,o);return(0,d.encode)(`0x${E}`,l)}})}}return ue.KeccakHasher=c,ue.default=new c,ue}var xe={},Kt;function pn(){if(Kt)return xe;Kt=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.Sha2Hasher=void 0;const e=J(),a=ar(),i=we(),d={sha224:a.sha224,sha256:a.sha256,sha384:a.sha384,sha512:a.sha512};class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=d[`sha${m}`],g=(n,o)=>{let l=n;try{l=(0,e.toUint8Array)(n)}catch{}return o===1?`0x${p().update(l).digest("hex")}`:g(g(l,1),o-1)};this[f]=(n,o=2,l="hex")=>{const h=g(n,o);return(0,i.encode)(h,l)}})}}return xe.Sha2Hasher=c,xe.default=new c,xe}var fe={},Nt;function yn(){if(Nt)return fe;Nt=1;var e=fe&&fe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(fe,"__esModule",{value:!0}),fe.Sha3Hasher=void 0;const a=e(Ke()),i=J(),d=we();class c{constructor(){[224,256,384,512].forEach(m=>{const f=`hash${m}`,p=a.default[`sha3_${m}`],g=(n,o)=>o===1?p(n):g(p(n),o-1);this[f]=(n,o=1,l="hex")=>{let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=g(h,o);return(0,d.encode)(`0x${E}`,l)}})}}return fe.Sha3Hasher=c,fe.default=new c,fe}var de={},Te={},It;function bt(){if(It)return Te;It=1;var e=Te&&Te.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Te,"__esModule",{value:!0});const a=e(cr());return Te.default=a.default.create("genKeyPair","getPublicKey","sign","verify"),Te}var Lt;function mn(){if(Lt)return de;Lt=1;var e=de&&de.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(de,"__esModule",{value:!0}),de.Ed25519Signer=void 0;const a=e(lr()),i=e(je()),d=J(),c=e(bt()),s=we(),m=a.default.sign;class f extends c.default{constructor(){super()}genKeyPair(g="hex",n){const o=n?(0,d.toUint8Array)(n):new Uint8Array((0,i.default)(32));if(o.byteLength!==32)throw new Error("Invalid seed to generate key pair");const l=m.keyPair.fromSeed(o);return l.publicKey=(0,s.encode)(l.publicKey,g),l.secretKey=(0,s.encode)(l.secretKey,g),l}getPublicKey(g,n="hex"){const o=(0,d.toUint8Array)(g),l=m.keyPair.fromSecretKey(o).publicKey;return(0,s.encode)(l,n)}sign(g,n,o="hex"){const l=(0,d.toUint8Array)(n),h=(0,d.toUint8Array)(g),E=m.detached(h,l);return(0,s.encode)(E,o)}verify(g,n,o){const l=(0,d.toUint8Array)(o),h=(0,d.toUint8Array)(g),E=(0,d.toUint8Array)(n);return m.detached.verify(h,E,l)}}return de.Ed25519Signer=f,de.default=new f,de}var he={},pe={},qt;function Hr(){if(qt)return pe;qt=1;var e=pe&&pe.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.Secp256k1Signer=void 0;const a=e(ur()),i=J(),d=e(je()),c=e(bt()),s=we(),m=a.default.ec,f=new m("secp256k1");class p extends c.default{constructor(){super(),this.pkHasFormatPrefix=!0,this.pkCompressed=!1}isValidSK(n){if(n.byteLength!==32)return!1;const o=new i.BN(n);return o.cmp(f.curve.n)<0&&!o.isZero()}genKeyPair(n="hex"){let o=null;do o=new Uint8Array((0,d.default)(32));while(!this.isValidSK(o));const l=this.getPublicKey((0,i.toHex)(o));return{secretKey:(0,s.encode)(o,n),publicKey:(0,s.encode)(l,n)}}getPublicKey(n,o="hex"){if(!this.isValidSK((0,i.toUint8Array)(n)))throw new Error("Invalid secret key");let l=f.keyFromPrivate((0,i.toBuffer)(n)).getPublic(this.pkCompressed,"hex");return this.pkHasFormatPrefix===!1&&(l=l.slice(2)),(0,s.encode)(`0x${l}`,o)}sign(n,o,l="hex"){let h=n;try{h=(0,i.toUint8Array)(n)}catch{}const E=f.keyFromPrivate((0,i.toBuffer)(o)).sign((0,i.stripHexPrefix)(h),{canonical:!0}).toDER("hex");return(0,s.encode)(`0x${E}`,l)}verify(n,o,l){let h=n;try{h=(0,i.toUint8Array)(n)}catch{}let E=(0,i.toBuffer)(l);return this.pkHasFormatPrefix===!1&&E[0]!==4&&E.byteLength===64&&(E=C.concat([C.from([4]),E])),f.keyFromPublic(E).verify((0,i.stripHexPrefix)(h),(0,i.stripHexPrefix)((0,i.toHex)(o)))}}return pe.Secp256k1Signer=p,pe.default=new p,pe}var Mt;function gn(){if(Mt)return he;Mt=1;var e=he&&he.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(he,"__esModule",{value:!0}),he.EthereumSigner=void 0;const a=e(fr()),i=e(dr()),d=J(),c=Hr();class s extends c.Secp256k1Signer{constructor(){super(),this.pkHasFormatPrefix=!1}ethHash(f){const p=(0,d.isHexStrict)(f)?f:(0,d.utf8ToHex)(f),g=(0,d.hexToBytes)(p),n=C.from(g),o=`Ethereum Signed Message:
|
|
4
|
-
${g.length}`,l=C.from(o),h=C.concat([l,n]);return i.default.keccak256s(h)}ethSign(f,p){return a.default.sign(f,p)}ethRecover(f,p){return a.default.recover(f,p)}}return he.EthereumSigner=s,he.default=new s,he}var ye={},Ft;function bn(){if(Ft)return ye;Ft=1;var e=ye&&ye.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ye,"__esModule",{value:!0}),ye.PasskeySigner=void 0;const a=J(),i=hr(),d=e(bt());class c extends d.default{constructor(){super()}genKeyPair(m="hex",f){throw new Error("Not supported")}getPublicKey(m,f="hex"){throw new Error("Not supported")}sign(m,f,p="hex"){throw new Error("Not supported")}async verify(m,f,p,g){const n=JSON.parse(g);if(!n.authenticatorData||!n.clientDataJSON)throw new Error("extra.authenticatorData or extra.clientDataJSON is required for passkey signature verification");const o=(0,a.toBuffer)((0,a.fromBase64)(n.authenticatorData)),l=await(0,i.toHash)(i.isoBase64URL.toBuffer(n.clientDataJSON));if((0,i.decodeClientDataJSON)(n.clientDataJSON).challenge!==(0,a.toBase64)(m))throw new Error("challenge mismatch for passkey signature");return(0,i.verifySignature)({signature:i.isoBase64URL.toBuffer(typeof f=="string"?f:(0,a.toBase64)(f)),data:i.isoUint8Array.concat([o,l]),credentialPublicKey:p})}}return ye.PasskeySigner=c,ye.default=new c,ye}var Wt;function _t(){return Wt||(Wt=1,function(e){var a=Oe&&Oe.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.toTxHash=e.Hashers=e.Signers=e.types=e.Hasher=e.Signer=void 0,e.getSigner=o,e.getHasher=l,e.getRandomBytes=h;const i=a(je()),d=we(),c=a(hn()),s=a(pn()),m=a(yn()),f=a(mn()),p=a(gn()),g=a(Hr()),n=a(bn());e.Signer={Ed25519:f.default,Secp256k1:g.default,Ethereum:p.default,Passkey:n.default},e.Hasher={SHA2:s.default,SHA3:m.default,Keccak:c.default},e.types={KeyType:{ED25519:0,SECP256K1:1,ETHEREUM:2,PASSKEY:3},HashType:{KECCAK:0,SHA3:1,KECCAK_384:2,SHA3_384:3,KECCAK_512:4,SHA3_512:5,SHA2:6},RoleType:{ROLE_ACCOUNT:0,ROLE_NODE:1,ROLE_DEVICE:2,ROLE_APPLICATION:3,ROLE_SMART_CONTRACT:4,ROLE_BOT:5,ROLE_ASSET:6,ROLE_STAKE:7,ROLE_VALIDATOR:8,ROLE_GROUP:9,ROLE_TX:10,ROLE_TETHER:11,ROLE_SWAP:12,ROLE_DELEGATION:13,ROLE_VC:14,ROLE_BLOCKLET:15,ROLE_STORE:16,ROLE_TOKEN:17,ROLE_FACTORY:18,ROLE_ROLLUP:19,ROLE_STORAGE:20,ROLE_PROFILE:21,ROLE_PASSKEY:22,ROLE_TOKEN_FACTORY:23,ROLE_ANY:63},EncodingType:{BASE16:0,BASE58:1}};function o(b){if(typeof e.Signers[b]>"u")throw new Error(`Unsupported signer type: ${b}`);return e.Signers[b]}function l(b){if(typeof e.Hashers[b]>"u")throw new Error(`Unsupported hash type: ${b}`);return e.Hashers[b]}function h(b=32,_="hex"){return(0,d.encode)((0,i.default)(b),_)}e.Signers=Object.freeze({[e.types.KeyType.ED25519]:e.Signer.Ed25519,[e.types.KeyType.SECP256K1]:e.Signer.Secp256k1,[e.types.KeyType.ETHEREUM]:e.Signer.Ethereum,[e.types.KeyType.PASSKEY]:e.Signer.Passkey}),e.Hashers=Object.freeze({[e.types.HashType.KECCAK]:e.Hasher.Keccak.hash256,[e.types.HashType.KECCAK_384]:e.Hasher.Keccak.hash384,[e.types.HashType.KECCAK_512]:e.Hasher.Keccak.hash512,[e.types.HashType.SHA3]:e.Hasher.SHA3.hash256,[e.types.HashType.SHA3_384]:e.Hasher.SHA3.hash384,[e.types.HashType.SHA3_512]:e.Hasher.SHA3.hash512,[e.types.HashType.SHA2]:e.Hasher.SHA2.hash256});const E=b=>e.Hasher.SHA2.hash256(b,1,"hex").replace(/^0x/,"").toUpperCase();e.toTxHash=E}(Oe)),Oe}var ot={},D={},W={},Vt;function jr(){if(Vt)return W;Vt=1;var e=W&&W.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(W,"__esModule",{value:!0}),W.toStrictHex=W.toBytes=W.toBits=W.DID_PREFIX=void 0;const a=e(lt),i=J(),d="did:abt:";W.DID_PREFIX=d;const c=f=>{try{if((0,i.isHexStrict)(f))return C.from((0,i.stripHexPrefix)(f),"hex");let p=(0,i.fromBase58)(f.replace(d,""));for(;p.length<26;)p=C.concat([C.from([0]),p]);return p}catch(p){throw new Error(`Cannot convert DID string to byte array: ${p.message}`)}};W.toBytes=c;const s=(f,p)=>(0,a.default)((0,i.toBN)(f).toString(2),p,"0");W.toBits=s;const m=(f,p)=>{const g=f.replace(/^0x/i,"");return typeof p=="number"&&p%2===0?(0,a.default)(f,p,"0"):g.length%2===0?g:`0${g}`};return W.toStrictHex=m,W}var zt;function _n(){if(zt)return D;zt=1;var e=D&&D.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(D,"__esModule",{value:!0}),D.toChecksumAddress=D.isEthereumDid=D.isEthereumType=D.toTypeInfoStr=D.toTypeInfo=D.fromTypeInfo=D.DID_TYPE_PASSKEY=D.DID_TYPE_ETHEREUM=D.DID_TYPE_ARCBLOCK=void 0,D.DidType=b;const a=J(),i=e(ct),d=e(Cr),c=e(Dr),s=_t(),m=jr(),f={pk:"key",address:"encoding"},p={role:s.types.RoleType.ROLE_ACCOUNT,pk:s.types.KeyType.ED25519,hash:s.types.HashType.SHA3,address:s.types.EncodingType.BASE58};D.DID_TYPE_ARCBLOCK=p;const g={role:s.types.RoleType.ROLE_PASSKEY,pk:s.types.KeyType.PASSKEY,hash:s.types.HashType.SHA2,address:s.types.EncodingType.BASE58};D.DID_TYPE_PASSKEY=g;const n={role:s.types.RoleType.ROLE_ACCOUNT,pk:s.types.KeyType.ETHEREUM,hash:s.types.HashType.KECCAK,address:s.types.EncodingType.BASE16};D.DID_TYPE_ETHEREUM=n;const o=H=>{const T=["pk","hash","address"];return(0,d.default)((0,c.default)(H,T),(0,c.default)(n,T))};D.isEthereumType=o;const l=H=>{const T=(0,a.toAddress)(H);return/^(0x)?[0-9a-f]{40}$/i.test(T)?/^(0x|0X)?[0-9a-f]{40}$/.test(T)||/^(0x|0X)?[0-9A-F]{40}$/.test(T)?!0:h(T):!1};D.isEthereumDid=l;const h=H=>{const T=H.replace(/^0x/i,""),j=s.Hasher.Keccak.hash256(T.toLowerCase()).replace(/^0x/i,"");for(let O=0;O<40;O++)if(parseInt(j[O],16)>7&&T[O].toUpperCase()!==T[O]||parseInt(j[O],16)<=7&&T[O].toLowerCase()!==T[O])return!1;return!0},E=H=>{if(typeof H>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(H))throw new Error(`Given address "${H}" is not a valid Ethereum address.`);const T=H.toLowerCase().replace(/^0x/i,""),j=s.Hasher.Keccak.hash256(T).replace(/^0x/i,"");let O="0x";for(let S=0;S<T.length;S++)parseInt(j[S],16)>7?O+=T[S].toUpperCase():O+=T[S];return O};D.toChecksumAddress=E;function b(H={}){let T={};["default","arcblock"].includes(H)?T=p:["eth","ethereum"].includes(H)?T=n:["passkey"].includes(H)?T=g:T={...p,...H};const{role:j,pk:O,hash:S,address:v}=T;Object.keys(T).forEach(B=>{const N=(0,i.default)(`${f[B]||B}Type`);if(Object.values(s.types[N]).includes(T[B])===!1)throw new Error(`Unsupported ${B} type: ${T[B]}`)});const P={role:j,pk:O,hash:S,address:v};return o(P)===!1&&[s.types.RoleType.ROLE_NODE,s.types.RoleType.ROLE_VALIDATOR,s.types.RoleType.ROLE_TETHER,s.types.RoleType.ROLE_SWAP].includes(P.role)&&(P.hash=s.types.HashType.SHA2),P}b.toJSON=H=>Object.keys(H).reduce((T,j)=>{const O=(0,i.default)(`${f[j]||j}Type`),S=Object.keys(s.types[O]),v=Object.values(s.types[O]);return T[j]=S[v.indexOf(H[j])],T},{}),b.fromJSON=H=>Object.keys(H).reduce((T,j)=>{const O=(0,i.default)(`${f[j]||j}Type`),S=Object.keys(s.types[O]),v=Object.values(s.types[O]);return T[j]=v[S.indexOf(H[j])],T},{});const _=H=>{const T=b(H),j=(0,m.toBits)(T.role,6),O=(0,m.toBits)(T.pk,5),S=(0,m.toBits)(T.hash,5),v=`${j}${O}${S}`,P=(0,a.stripHexPrefix)((0,a.numberToHex)(parseInt(v,2)));return(0,m.toStrictHex)(P,4)};D.fromTypeInfo=_;const A=H=>{let T={};try{if(l(H))T=n;else{const O=(0,m.toBytes)(H).slice(0,2),S=(0,m.toStrictHex)(C.from(O).toString("hex")),v=(0,m.toBits)(new a.BN(S,16),16),P=v.slice(0,6),B=v.slice(6,11),N=v.slice(11,16);T={role:parseInt(P,2),pk:parseInt(B,2),hash:parseInt(N,2),address:(0,a.isHex)((0,a.toAddress)(H))?s.types.EncodingType.BASE16:s.types.EncodingType.BASE58}}return Object.keys(T).forEach(j=>{Object.values(s.types[`${(0,i.default)(f[j]||j)}Type`]).includes(T[j])===!1&&delete T[j]}),T}catch{return T}};D.toTypeInfo=A;const R=H=>{const T=A(H);return Object.keys(T).reduce((j,O)=>{const S=s.types[`${(0,i.default)(f[O]||O)}Type`];return j[O]=Object.keys(S).find(v=>S[v]===T[O]),j},{})};return D.toTypeInfoStr=R,D}var Yt;function Sn(){return Yt||(Yt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_TYPE_PASSKEY=e.DID_TYPE_ETHEREUM=e.DID_TYPE_ARCBLOCK=e.DID_PREFIX=e.DidType=e.fromTypeInfo=e.toTypeInfoStr=e.toTypeInfo=e.isEthereumType=e.isEthereumDid=e.isValid=e.isFromPublicKey=e.toDid=e.toAddress=e.fromHash=e.fromPublicKeyHash=e.fromPublicKey=e.fromSecretKey=e.toStrictHex=e.types=void 0;const a=_t();Object.defineProperty(e,"types",{enumerable:!0,get:function(){return a.types}});const i=J();Object.defineProperty(e,"toAddress",{enumerable:!0,get:function(){return i.toAddress}}),Object.defineProperty(e,"toDid",{enumerable:!0,get:function(){return i.toDid}});const d=_n();Object.defineProperty(e,"DidType",{enumerable:!0,get:function(){return d.DidType}}),Object.defineProperty(e,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return d.DID_TYPE_ARCBLOCK}}),Object.defineProperty(e,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return d.DID_TYPE_ETHEREUM}}),Object.defineProperty(e,"DID_TYPE_PASSKEY",{enumerable:!0,get:function(){return d.DID_TYPE_PASSKEY}}),Object.defineProperty(e,"fromTypeInfo",{enumerable:!0,get:function(){return d.fromTypeInfo}}),Object.defineProperty(e,"isEthereumDid",{enumerable:!0,get:function(){return d.isEthereumDid}}),Object.defineProperty(e,"isEthereumType",{enumerable:!0,get:function(){return d.isEthereumType}}),Object.defineProperty(e,"toTypeInfo",{enumerable:!0,get:function(){return d.toTypeInfo}}),Object.defineProperty(e,"toTypeInfoStr",{enumerable:!0,get:function(){return d.toTypeInfoStr}});const c=jr();Object.defineProperty(e,"DID_PREFIX",{enumerable:!0,get:function(){return c.DID_PREFIX}}),Object.defineProperty(e,"toStrictHex",{enumerable:!0,get:function(){return c.toStrictHex}});const s=(o,l)=>{const h=(0,d.DidType)(l),E=(0,a.getSigner)(h.pk).getPublicKey(o);return m(E.indexOf("0x")===0?E:`0x${E}`,h)};e.fromSecretKey=s;const m=(o,l)=>{const h=(0,d.DidType)(l),b=(0,a.getHasher)(h.hash)(o,1);return f(b,h)};e.fromPublicKey=m;const f=(o,l)=>{const h=(0,d.DidType)(l),E=(0,i.stripHexPrefix)(o).slice(0,40),b=(0,a.getHasher)(h.hash),_=(0,d.fromTypeInfo)(h),A=(0,i.stripHexPrefix)(b(`0x${_}${E}`,1)).slice(0,8),R=`0x${_}${E}${A}`;return(0,d.isEthereumType)(h)?(0,d.toChecksumAddress)(`0x${o.slice(-40)}`):h.address===a.types.EncodingType.BASE58?(0,i.toBase58)(R):R};e.fromPublicKeyHash=f;const p=(o,l=a.types.RoleType.ROLE_ACCOUNT)=>{const h=Object.keys(a.types.RoleType),E=Object.values(a.types.RoleType);if(E.indexOf(l)===-1)throw new Error(`Unsupported role type ${l} when gen ddi from hash`);const b=(0,d.DidType)({role:a.types.RoleType[h[E.indexOf(l)]]});return f(o,b)};e.fromHash=p;const g=(o,l)=>{if(n(o)===!1)return!1;const h=(0,d.toTypeInfo)(o),E=m(l,h),b=o.replace(c.DID_PREFIX,"");return E===b};e.isFromPublicKey=g;const n=o=>{if(!o)return!1;const l=(0,i.toAddress)(String(o)),{hash:h}=(0,d.toTypeInfo)(l);if(typeof h>"u")return!1;if((0,d.isEthereumDid)(l))return!0;const E=(0,a.getHasher)(h),b=(0,c.toBytes)(l),_=(0,c.toStrictHex)(C.from(b.slice(0,22)).toString("hex")),A=(0,c.toStrictHex)(C.from(b.slice(22,26)).toString("hex")),R=(0,i.stripHexPrefix)(E(`0x${_}`,1)).slice(0,8);return A===R};e.isValid=n}(ot)),ot}var Xt;function En(){if(Xt)return Y;Xt=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.WalletType=void 0,Y.Wallet=d,Y.fromSecretKey=c,Y.fromPublicKey=s,Y.fromAddress=m,Y.fromRandom=f,Y.fromJSON=p,Y.isValid=g;const e=J(),a=_t(),i=Sn();Y.WalletType=i.DidType;function d(n,o="default"){const l=(0,i.DidType)(o),h=(0,a.getSigner)(l.pk),E=(0,a.getHasher)(l.hash);return{type:l,secretKey:n.sk,publicKey:n.pk,address:n.pk?(0,i.fromPublicKey)(n.pk,l):n.address,hash(b,_=1,A="hex"){return E(b,_,A)},sign(b,_=!0,A="hex"){if(!n.sk)throw new Error("Cannot sign data without a secretKey");if(_){const R=E(b,1);return h.sign(R,n.sk,A)}return h.sign(b,n.sk,A)},async verify(b,_,A=!0,R){if(!n.pk)throw new Error("Cannot verify data without a publicKey");const H=A?E(b,1):b;return h.verify(H,_,n.pk,R)},ethHash(b){if(typeof h.ethHash!="function")throw new Error("ethHash is not supported by signer");return h.ethHash(b)},ethSign(b,_=!0){if(!n.sk)throw new Error("Cannot sign data without a secretKey");if(typeof h.ethHash!="function")throw new Error("ethSign is not supported by signer");return _?h.ethSign(h.ethHash(b),(0,e.toHex)(n.sk)):h.ethSign(b,(0,e.toHex)(n.sk))},ethVerify(b,_,A=!0){if(typeof h.ethHash!="function")throw new Error("ethVerify is not supported by signer");const R=A?h.ethHash(b):b;return h.ethRecover(R,_)===this.address},toAddress(){return n.pk?(0,i.fromPublicKey)(n.pk,l):n.address},toJSON(){return{type:i.DidType.toJSON(l),sk:(0,e.toHex)(n.sk),pk:(0,e.toHex)(n.pk),address:this.address}}}}function c(n,o="default"){const l=(0,i.DidType)(o),h={sk:n,pk:(0,a.getSigner)(l.pk).getPublicKey(n)};return d(h,l)}function s(n,o="default"){return d({pk:n},(0,i.DidType)(o))}function m(n){return d({address:(0,i.toAddress)(n)},(0,i.toTypeInfo)(n))}function f(n="default"){const o=(0,i.DidType)(n),h=(0,a.getSigner)(o.pk).genKeyPair();return d({sk:h.secretKey,pk:h.publicKey},o)}function p(n){const o=i.DidType.fromJSON(n.type);return d(n,o)}function g(n,o=!0){return!(!n||typeof n!="object"||typeof n.verify!="function"||typeof n.toAddress!="function"||typeof n.toJSON!="function"||!n.type||!n.publicKey||o&&(!n.secretKey||typeof n.sign!="function"))}return Y}var at,Jt;function xn(){if(Jt)return at;Jt=1;const e=Gr(),a=dn(),{fromSecretKey:i,WalletType:d}=En(),{isHexStrict:c,toHex:s,toBuffer:m,stripHexPrefix:f}=ne(),{types:p}=a;return at={fromAppDid:(n,o,l={role:p.RoleType.ROLE_ACCOUNT},h=0)=>{if(!o)throw new Error("Cannot get user wallet with empty root sk");const E=a.Hasher.SHA3.hash256(m(n)),b=f(E).slice(0,16),_=b.slice(0,8),A=b.slice(8,16),R=parseInt(+`0x${_}`,10)&2147483647,H=parseInt(+`0x${A}`,10)&2147483647,T=f(c(o)?o:s(o)),j=e.fromMasterSeed(C.from(T,"hex")),O=`m/44'/260'/${R}'/${H}'/${h}`,S=j.derive(O),v=d(l),{pk:P=p.KeyType.ED25519}=v;let B;return P===p.KeyType.ED25519?B=a.Signer.Ed25519.genKeyPair("hex",S.privateKey).secretKey:B=s(S.privateKey),P===p.KeyType.ETHEREUM&&(B=B.slice(0,66)),i(B,v)}},at}var vr=xn();const Tn={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function wr({onCreated:e,onClose:a}){const[i,d]=I.useState(!1),{t:c,locale:s}=Be(),{api:m}=Pe(),{teamDid:f}=$e(),{control:p,handleSubmit:g,formState:{errors:n},watch:o,setValue:l}=xr({defaultValues:Tn,mode:"onChange"}),h=o("scope"),E=_=>{_!=="profile:read"&&l("scope",h.includes(_)?h.filter(A=>A!==_):[...h,_])},b=async _=>{d(!0);try{const A={..._,redirectUris:_.redirectUris,contacts:_.contacts?_.contacts.split(",").map(R=>R.trim()):[],scope:_.scope.join(" ")};await m.createOAuthClient({input:{teamDid:f,input:Xr(A,Jr)}}),e(A)}catch(A){De.error(A.message||"Failed to create OAuth App")}finally{d(!1)}};return r.jsxs(ut,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[r.jsxs(ft,{children:[c("oauth.client.register")," ",r.jsx(dt,{onClick:a,sx:{position:"absolute",right:8,top:8},children:r.jsx(ht,{})})]}),r.jsx(pt,{children:r.jsxs(me,{spacing:4,sx:{mt:2},children:[r.jsx(X,{variant:"h6",gutterBottom:!0,children:c("oauth.client.requiredInformation")}),r.jsx(k,{children:r.jsx(z,{name:"clientName",control:p,rules:{required:c("oauth.client.validate.clientName"),minLength:{value:3,message:c("oauth.client.validate.clientNameMinLength")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.name"),required:!0,fullWidth:!0,placeholder:c("oauth.client.input.clientNamePlaceholder"),error:!!n.clientName,helperText:n.clientName?.message}),r.jsx(M,{children:c("oauth.client.helperText.clientName")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"clientUri",control:p,rules:{required:c("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:c("oauth.client.validate.clientUriInvalid")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:c("oauth.client.input.clientUriPlaceholder"),error:!!n.clientUri,helperText:n.clientUri?.message}),r.jsx(M,{children:c("oauth.client.helperText.clientUri")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"redirectUris",control:p,rules:{required:c("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:c("oauth.client.validate.redirectUrisInvalid")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:c("oauth.client.input.redirectUrisPlaceholder"),error:!!n.redirectUris,helperText:n.redirectUris?.message}),r.jsxs(k,{sx:{display:"flex",gap:"2px"},children:[r.jsx(M,{children:c("oauth.client.helperText.redirectUris")}),r.jsx(M,{children:c("oauth.client.helperText.read")}),r.jsx(M,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:c("oauth.client.helperText.document")}),r.jsx(M,{children:c("oauth.client.helperText.more")})]})]})})}),r.jsxs(Lr,{variant:"outlined",sx:{p:2,display:"none"},children:[r.jsx(X,{variant:"subtitle2",gutterBottom:!0,children:c("oauth.client.input.permissions")}),r.jsx(k,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:r.jsx(yr,{children:Object.entries(re.OAUTH_SCOPES).map(([_,A])=>r.jsx(mr,{control:r.jsx(gr,{checked:h.includes(_),onChange:()=>E(_),disabled:_==="profile:read",color:"primary"}),label:r.jsx(k,{children:r.jsx(X,{variant:"body2",sx:{fontWeight:500},children:A})})},_))})})]}),r.jsx(yt,{}),r.jsx(X,{variant:"h6",gutterBottom:!0,children:c("oauth.client.optionalInformation")}),r.jsx(me,{children:r.jsx(z,{name:"contacts",control:p,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:c("oauth.client.validate.contacts")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.contacts"),fullWidth:!0,placeholder:c("oauth.client.input.contactsPlaceholder"),error:!!n.contacts,helperText:n.contacts?.message}),r.jsx(M,{children:c("oauth.client.helperText.contacts")})]})})}),r.jsxs(me,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsx(z,{name:"tosUri",control:p,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:c("oauth.client.validate.tosUriInvalid")}},render:({field:_})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.tosUri"),fullWidth:!0,placeholder:c("oauth.client.input.tosUriPlaceholder"),error:!!n.tosUri,helperText:n.tosUri?.message}),r.jsx(M,{children:c("oauth.client.helperText.tosUri")})]})}),r.jsx(z,{name:"policyUri",control:p,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:c("oauth.client.validate.policyUriInvalid")}},render:({field:_})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.policyUri"),fullWidth:!0,placeholder:c("oauth.client.input.policyUriPlaceholder"),error:!!n.policyUri,helperText:n.policyUri?.message}),r.jsx(M,{children:c("oauth.client.helperText.policyUri")})]})})]}),n.error&&r.jsx(br,{severity:"error",children:n.error.message})]})}),r.jsxs(_r,{children:[r.jsx(He,{onClick:a,children:c("common.cancel")}),r.jsxs(He,{onClick:g(b),disabled:i,variant:"contained",color:"primary",children:[i?r.jsx(mt,{size:20,sx:{mr:1}}):null,c("oauth.client.registerButton")]})]})]})}wr.propTypes={onCreated:w.func.isRequired,onClose:w.func.isRequired};function St({scope:e="",...a}){if(!e)return null;const i=e.split(" ").filter(Boolean);return r.jsx(me,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(d=>r.jsx(Rr.Fragment,{children:r.jsx(qr,{title:re.OAUTH_SCOPES[d],children:r.jsx(q,{children:d})})},d))})}St.propTypes={scope:w.string};const Et=e=>{const{prefix:a}=Pe(),{blocklet:i}=Zr(),d=xt(a,"/api/media/upload",i.appPid),c=I.useCallback(m=>m?m.startsWith("http")?m:`${xt(a,"/api/media/upload",i.appPid)}/${m}`:"",[a,i.appPid]);return{clientLogoUrl:I.useMemo(()=>c(e),[e,c]),apiPath:d,getClientLogoUrl:c}},Hn=I.lazy(()=>Kr(()=>import("./index-CWYofUen.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(e=>({default:e.Uploader})));function Ur({client:e,onUpdate:a,onClose:i}){const[d,c]=I.useState(!1),{t:s,locale:m}=Be(),f=I.useRef(null),{api:p}=Pe(),{teamDid:g}=$e(),{control:n,handleSubmit:o,formState:{errors:l},watch:h,setValue:E,getValues:b}=xr({defaultValues:{clientName:e.clientName||"",clientUri:e.clientUri||"",redirectUris:Array.isArray(e.redirectUris)?e.redirectUris.join(","):"",scope:e.scope?e.scope.split(" "):["profile:read"],contacts:Array.isArray(e.contacts)?e.contacts.join(","):"",tosUri:e.tosUri||"",policyUri:e.policyUri||"",logoUri:e.logoUri||"",clientSecretExpiresAt:e.clientSecretExpiresAt||null},mode:"onChange"}),_=h("scope"),A=h("logoUri"),{clientLogoUrl:R,apiPath:H}=Et(A),T=S=>{S!=="profile:read"&&E("scope",_.includes(S)?_.filter(v=>v!==S):[..._,S])},j=async S=>{const v={clientId:e.clientId,clientName:S.clientName.trim(),clientUri:S.clientUri,redirectUris:S.redirectUris.split(",").map(P=>P.trim()).filter(Boolean),contacts:S.contacts?S.contacts.split(",").map(P=>P.trim()):[],scope:S.scope.join(" "),tosUri:S.tosUri,policyUri:S.policyUri,logoUri:S.logoUri,clientSecretExpiresAt:S.clientSecretExpiresAt?parseInt(S.clientSecretExpiresAt/1e3,10):null};await p.updateOAuthClient({input:{teamDid:g,input:v}})},O=async S=>{c(!0);try{await j(S),a(),i()}catch(v){De.error(v.message||s("oauth.client.updateFailed"))}finally{c(!1)}};return r.jsxs(ut,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[r.jsxs(ft,{children:[s("oauth.client.update")," ",r.jsx(dt,{onClick:i,sx:{position:"absolute",right:8,top:8},children:r.jsx(ht,{})})]}),r.jsx(pt,{children:r.jsxs(me,{spacing:3,sx:{mt:2},children:[r.jsxs(k,{sx:{mb:3},children:[r.jsx(X,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),r.jsxs(k,{children:[r.jsx(k,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:R?r.jsx(k,{children:r.jsx("img",{src:R,alt:"client-logo",style:{width:"100%",height:"100%"}})}):r.jsx(k,{onClick:()=>{f.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:r.jsx(Sr,{sx:{fontSize:40,color:"common.white"}})})}),r.jsx(He,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{f.current?.open()},children:s(R?"common.change":"common.upload")})]}),r.jsx(k,{sx:{display:"flex",alignItems:"center"},children:r.jsx(I.Suspense,{fallback:r.jsx(en,{}),children:r.jsx(Hn,{ref:f,locale:m,popup:!0,onUploadFinish:S=>{E("logoUri",S.data.filename),j(b()).then(()=>{a()}).catch(v=>{De.error(v.message||s("oauth.client.updateFailed"))}).finally(()=>{f.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:H,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),r.jsx(X,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),r.jsx(V,{label:"Client Id",fullWidth:!0,value:e.clientId,disabled:!0}),r.jsx(k,{children:r.jsx(z,{name:"clientName",control:n,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!l.clientName,helperText:l.clientName?.message}),r.jsx(M,{children:s("oauth.client.helperText.clientName")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"clientUri",control:n,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!l.clientUri,helperText:l.clientUri?.message}),r.jsx(M,{children:s("oauth.client.helperText.clientUri")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"redirectUris",control:n,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!l.redirectUris,helperText:l.redirectUris?.message}),r.jsx(M,{children:s("oauth.client.helperText.redirectUris")})]})})}),r.jsx(z,{name:"clientSecretExpiresAt",control:n,render:({field:S})=>r.jsx(Qr,{placeholder:s("oauth.client.input.expireTime"),value:S.value*1e3,onChange:v=>{S.onChange(v)}})}),r.jsxs(k,{sx:{display:"none"},children:[r.jsx(X,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),r.jsx(k,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:r.jsx(yr,{children:Object.entries(re.OAUTH_SCOPES).map(([S,v])=>r.jsx(mr,{control:r.jsx(gr,{checked:_.includes(S),onChange:()=>T(S),disabled:S==="profile:read",color:"primary"}),label:r.jsx(k,{children:r.jsx(X,{variant:"body2",sx:{fontWeight:500},children:v})})},S))})})]}),r.jsx(yt,{}),r.jsx(X,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),r.jsx(k,{children:r.jsx(z,{name:"contacts",control:n,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!l.contacts,helperText:l.contacts?.message}),r.jsx(M,{children:s("oauth.client.helperText.contacts")})]})})}),r.jsxs(me,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsx(z,{name:"tosUri",control:n,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:S})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{...S,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!l.tosUri,helperText:l.tosUri?.message}),r.jsx(M,{children:s("oauth.client.helperText.tosUri")})]})}),r.jsx(z,{name:"policyUri",control:n,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:S})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{...S,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!l.policyUri,helperText:l.policyUri?.message}),r.jsx(M,{children:s("oauth.client.helperText.policyUri")})]})})]}),l.error&&r.jsx(br,{severity:"error",children:l.error.message})]})}),r.jsxs(_r,{children:[r.jsx(He,{onClick:i,children:s("common.cancel")}),r.jsx(He,{onClick:o(O),disabled:d,variant:"contained",color:"primary",children:d?r.jsx(mt,{size:16}):s("common.update")})]})]})}Ur.propTypes={client:w.shape({clientId:w.string.isRequired,clientName:w.string.isRequired,clientUri:w.string,redirectUris:w.arrayOf(w.string),scope:w.string,contacts:w.arrayOf(w.string),tosUri:w.string,policyUri:w.string,logoUri:w.string,clientSecretExpiresAt:w.number}).isRequired,onUpdate:w.func.isRequired,onClose:w.func.isRequired};function Ar({client:e,onUpdate:a,onClose:i}){return r.jsx(Ur,{client:e,onUpdate:d=>a(d),onClose:i})}Ar.propTypes={client:w.shape({clientId:w.string.isRequired,clientName:w.string.isRequired,clientUri:w.string,redirectUris:w.arrayOf(w.string),scope:w.string,contacts:w.arrayOf(w.string),tosUri:w.string,policyUri:w.string,logoUri:w.string,clientSecretExpiresAt:w.number}).isRequired,onUpdate:w.func.isRequired,onClose:w.func.isRequired};function Or({clientId:e,clientName:a,onDelete:i=()=>{},onClose:d=()=>{}}){const{t:c}=Be(),{api:s}=Pe(),{teamDid:m}=$e(),f=()=>{d()},p=async()=>{try{await s.deleteOAuthClient({input:{teamDid:m,clientId:e}}),i()}catch(n){De.error(n?.message)}finally{f()}},g={keyName:a,title:c("oauth.client.delete.title"),description:c("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:c("oauth.client.delete.description",{name:a}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:p,onCancel:f};return r.jsx(tn,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}Or.propTypes={clientId:w.string.isRequired,clientName:w.string.isRequired,onDelete:w.func,onClose:w.func};function Br({title:e,items:a}){return r.jsxs(k,{sx:{mb:3},children:[r.jsx(X,{variant:"h6",sx:{mb:1.5},children:e}),r.jsx(me,{spacing:1.5,children:a.map(({label:i,value:d})=>r.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(X,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),r.jsx(X,{sx:{wordBreak:"break-all"},children:d||"-"})]},i))})]})}Br.propTypes={title:w.string.isRequired,items:w.arrayOf(w.shape({label:w.string.isRequired,value:w.any})).isRequired};function Pr({client:e,onClose:a}){const{t:i,locale:d}=Be(),{teamDid:c}=$e(),{clientName:s,clientId:m,clientSecret:f,redirectUris:p,scope:g,clientUri:n,logoUri:o,contacts:l,tosUri:h,policyUri:E,jwksUri:b,jwks:_,softwareId:A,softwareVersion:R,clientIdIssuedAt:H,clientSecretExpiresAt:T,updatedAt:j,createUser:O}=e,{clientLogoUrl:S}=Et(o),v=N=>{try{const ee=new URL(window.blocklet.appUrl);return ee.pathname=N,ee.toString()}catch{return"-"}},P=vr.fromAppDid(m,c),B=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:r.jsx(pr,{variant:"rounded",shape:"square",src:S,did:P.address,size:64})},{label:i("oauth.client.clientUri"),value:n?r.jsx(q,{children:n}):"-"},{label:i("oauth.client.clientId"),value:r.jsx(q,{children:m})},{label:i("oauth.client.clientSecret"),value:r.jsx(q,{children:f})},{label:i("oauth.client.redirectUris"),value:r.jsx(q,{children:(p||[]).join(", ")})},{label:i("oauth.client.scope"),value:r.jsx(St,{scope:g})},{label:i("oauth.client.createUser"),value:O?rn(O,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:r.jsx(q,{children:v("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:l.length?r.jsx(q,{children:(l||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:h?r.jsx(q,{children:h}):"-"},{label:i("oauth.client.policyUri"),value:E?r.jsx(q,{children:E}):"-"},{label:i("oauth.client.jwksUri"),value:b},{label:i("oauth.client.jwks"),value:_},{label:i("oauth.client.softwareId"),value:A},{label:i("oauth.client.softwareVersion"),value:R}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:H?r.jsx(Ce,{value:H*1e3,type:"all",locale:d}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:T?r.jsx(Ce,{value:T*1e3,type:"all",locale:d}):"-"},{label:i("common.updatedAt"),value:j?r.jsx(Ce,{value:j,type:"all",locale:d}):"-"}]}].filter(Boolean);return r.jsxs(ut,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[r.jsxs(ft,{children:[i("oauth.client.oauthAppDetails"),r.jsx(dt,{onClick:a,sx:{position:"absolute",right:8,top:8},children:r.jsx(ht,{})})]}),r.jsx(pt,{children:r.jsx(k,{sx:{mt:1},children:B.map((N,ee)=>r.jsxs(k,{children:[r.jsx(Br,{title:N.title,items:N.items}),ee!==B.length-1&&r.jsx(yt,{sx:{my:2}})]},N.title))})})]})}Pr.propTypes={client:w.object.isRequired,onClose:w.func.isRequired};function jn(e){return r.jsx(Ce,{value:e*1e3})}function $r({selected:e=null,onClose:a}){return e?r.jsx(Pr,{client:e,onClose:a}):null}$r.propTypes={selected:w.object,onClose:w.func.isRequired};function kr({open:e,onCreated:a,onClose:i}){return e?r.jsx(wr,{onCreated:a,onClose:i}):null}kr.propTypes={open:w.bool.isRequired,onCreated:w.func.isRequired,onClose:w.func.isRequired};function si(){const[e,a]=I.useState({searchText:"",pageSize:10,page:1}),[i,d]=I.useState(null),[c,s]=I.useState(!1),m=I.useRef(null),{t:f,locale:p}=Be(),{api:g}=Pe(),{teamDid:n}=$e(),[o,l]=I.useState(null),[h,E]=I.useState(null),b=sn(),{getClientLogoUrl:_}=Et(),A=Yr(async()=>await g.getOAuthClients({input:{teamDid:n,paging:{page:e.page,pageSize:e.pageSize}}}),[e.page,e.pageSize]),{loading:R}=A,H=I.useMemo(()=>A.value?.list||[],[A.value?.list]),T=I.useMemo(()=>e.searchText?H.filter(S=>S.clientName.toLowerCase().includes(e.searchText.toLowerCase())||S.clientId.toLowerCase().includes(e.searchText.toLowerCase())||S.scope.toLowerCase().includes(e.searchText.toLowerCase())):H,[e.searchText,H]),j=I.useMemo(()=>[{label:f("oauth.client.name"),name:"clientName",options:{customBodyRender:(S,{rowIndex:v})=>{const P=T[v],B=_(P.logoUri),N=vr.fromAppDid(P.clientId,n);return r.jsx(k,{sx:{display:"flex",alignItems:"center",gap:2},children:r.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[r.jsx(pr,{variant:"rounded",shape:"square",did:N.address,src:B,size:48}),r.jsxs(me,{sx:{gap:.5},children:[r.jsx(k,{sx:{color:"text.primary"},children:P.clientName}),r.jsx(k,{sx:{color:"text.secondary"},children:P.clientUri})]})]})})}}},{label:f("oauth.client.clientId"),name:"clientId"},{label:f("oauth.client.scope"),name:"scope",options:{customBodyRender:S=>r.jsx(St,{scope:S})}},{label:f("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:jn}},{label:f("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:S=>S?r.jsx(Wr,{showDid:!0,did:S,cardType:zr.Detailed,infoType:Vr.Minimal,sx:{border:0,padding:0}}):f("oauth.client.openRegistration")}},{label:f("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(S,{rowIndex:v})=>{const P=T[v];return r.jsx(nn,{actions:[{icon:r.jsx(Mr,{}),text:f("common.edit"),onClick:B=>{B.stopPropagation(),l(P)}},{icon:r.jsx(Fr,{}),text:f("common.delete"),onClick:B=>{B.stopPropagation(),E(P)}}]})}}}],[T,f,_,n,l,E]),O=({page:S,rowsPerPage:v,searchText:P})=>{e.pageSize!==v?a(B=>({...B,searchText:"",pageSize:v,page:1})):e.page!==S+1?a(B=>({...B,searchText:"",page:S+1})):e.searchText!==P&&a(B=>({...B,searchText:P,page:1}))};return r.jsxs(k,{ref:m,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[b?r.jsx(Tt,{title:f("oauth.client.listTitle"),tooltipTitle:f("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${p}/oauth-service`}):null,r.jsx(Nr,{data:T,columns:j,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:e.page-1,rowsPerPage:e.pageSize,count:T.length,searchDebounceTime:400,onRowClick(S,{dataIndex:v},P){if(m.current?.contains(P.target)){const B=T[v];d(B)}}},onChange:O,title:b?null:r.jsx(Tt,{title:f("oauth.client.listTitle"),tooltipTitle:f("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${p}/oauth-service`}),customButtons:[r.jsxs(He,{variant:"contained",size:"small",onClick:()=>s(!0),children:[R?r.jsx(mt,{size:16}):r.jsx(Sr,{style:{fontSize:16}}),f("common.create")]},"add")],loading:!1,emptyNode:r.jsx(Ir,{children:f("oauth.client.empty")})}),r.jsx($r,{selected:i,onClose:()=>d(null)}),r.jsx(kr,{open:c,onCreated:()=>{s(!1),A.retry()},onClose:()=>s(!1)}),o&&r.jsx(Ar,{client:o,onUpdate:A.retry,onClose:()=>l(null)}),h&&r.jsx(Or,{...h,onDelete:A.retry,onClose:()=>E(null)})]})}export{si as default};
|
|
4
|
+
${g.length}`,l=C.from(o),h=C.concat([l,n]);return i.default.keccak256s(h)}ethSign(f,p){return a.default.sign(f,p)}ethRecover(f,p){return a.default.recover(f,p)}}return he.EthereumSigner=s,he.default=new s,he}var ye={},Ft;function bn(){if(Ft)return ye;Ft=1;var e=ye&&ye.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ye,"__esModule",{value:!0}),ye.PasskeySigner=void 0;const a=J(),i=hr(),d=e(bt());class c extends d.default{constructor(){super()}genKeyPair(m="hex",f){throw new Error("Not supported")}getPublicKey(m,f="hex"){throw new Error("Not supported")}sign(m,f,p="hex"){throw new Error("Not supported")}async verify(m,f,p,g){const n=JSON.parse(g);if(!n.authenticatorData||!n.clientDataJSON)throw new Error("extra.authenticatorData or extra.clientDataJSON is required for passkey signature verification");const o=(0,a.toBuffer)((0,a.fromBase64)(n.authenticatorData)),l=await(0,i.toHash)(i.isoBase64URL.toBuffer(n.clientDataJSON));if((0,i.decodeClientDataJSON)(n.clientDataJSON).challenge!==(0,a.toBase64)(m))throw new Error("challenge mismatch for passkey signature");return(0,i.verifySignature)({signature:i.isoBase64URL.toBuffer(typeof f=="string"?f:(0,a.toBase64)(f)),data:i.isoUint8Array.concat([o,l]),credentialPublicKey:p})}}return ye.PasskeySigner=c,ye.default=new c,ye}var Wt;function _t(){return Wt||(Wt=1,function(e){var a=Oe&&Oe.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.toTxHash=e.Hashers=e.Signers=e.types=e.Hasher=e.Signer=void 0,e.getSigner=o,e.getHasher=l,e.getRandomBytes=h;const i=a(je()),d=we(),c=a(hn()),s=a(pn()),m=a(yn()),f=a(mn()),p=a(gn()),g=a(Hr()),n=a(bn());e.Signer={Ed25519:f.default,Secp256k1:g.default,Ethereum:p.default,Passkey:n.default},e.Hasher={SHA2:s.default,SHA3:m.default,Keccak:c.default},e.types={KeyType:{ED25519:0,SECP256K1:1,ETHEREUM:2,PASSKEY:3},HashType:{KECCAK:0,SHA3:1,KECCAK_384:2,SHA3_384:3,KECCAK_512:4,SHA3_512:5,SHA2:6},RoleType:{ROLE_ACCOUNT:0,ROLE_NODE:1,ROLE_DEVICE:2,ROLE_APPLICATION:3,ROLE_SMART_CONTRACT:4,ROLE_BOT:5,ROLE_ASSET:6,ROLE_STAKE:7,ROLE_VALIDATOR:8,ROLE_GROUP:9,ROLE_TX:10,ROLE_TETHER:11,ROLE_SWAP:12,ROLE_DELEGATION:13,ROLE_VC:14,ROLE_BLOCKLET:15,ROLE_STORE:16,ROLE_TOKEN:17,ROLE_FACTORY:18,ROLE_ROLLUP:19,ROLE_STORAGE:20,ROLE_PROFILE:21,ROLE_PASSKEY:22,ROLE_TOKEN_FACTORY:23,ROLE_ANY:63},EncodingType:{BASE16:0,BASE58:1}};function o(b){if(typeof e.Signers[b]>"u")throw new Error(`Unsupported signer type: ${b}`);return e.Signers[b]}function l(b){if(typeof e.Hashers[b]>"u")throw new Error(`Unsupported hash type: ${b}`);return e.Hashers[b]}function h(b=32,_="hex"){return(0,d.encode)((0,i.default)(b),_)}e.Signers=Object.freeze({[e.types.KeyType.ED25519]:e.Signer.Ed25519,[e.types.KeyType.SECP256K1]:e.Signer.Secp256k1,[e.types.KeyType.ETHEREUM]:e.Signer.Ethereum,[e.types.KeyType.PASSKEY]:e.Signer.Passkey}),e.Hashers=Object.freeze({[e.types.HashType.KECCAK]:e.Hasher.Keccak.hash256,[e.types.HashType.KECCAK_384]:e.Hasher.Keccak.hash384,[e.types.HashType.KECCAK_512]:e.Hasher.Keccak.hash512,[e.types.HashType.SHA3]:e.Hasher.SHA3.hash256,[e.types.HashType.SHA3_384]:e.Hasher.SHA3.hash384,[e.types.HashType.SHA3_512]:e.Hasher.SHA3.hash512,[e.types.HashType.SHA2]:e.Hasher.SHA2.hash256});const E=b=>e.Hasher.SHA2.hash256(b,1,"hex").replace(/^0x/,"").toUpperCase();e.toTxHash=E}(Oe)),Oe}var ot={},D={},W={},Vt;function jr(){if(Vt)return W;Vt=1;var e=W&&W.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(W,"__esModule",{value:!0}),W.toStrictHex=W.toBytes=W.toBits=W.DID_PREFIX=void 0;const a=e(lt),i=J(),d="did:abt:";W.DID_PREFIX=d;const c=f=>{try{if((0,i.isHexStrict)(f))return C.from((0,i.stripHexPrefix)(f),"hex");let p=(0,i.fromBase58)(f.replace(d,""));for(;p.length<26;)p=C.concat([C.from([0]),p]);return p}catch(p){throw new Error(`Cannot convert DID string to byte array: ${p.message}`)}};W.toBytes=c;const s=(f,p)=>(0,a.default)((0,i.toBN)(f).toString(2),p,"0");W.toBits=s;const m=(f,p)=>{const g=f.replace(/^0x/i,"");return typeof p=="number"&&p%2===0?(0,a.default)(f,p,"0"):g.length%2===0?g:`0${g}`};return W.toStrictHex=m,W}var zt;function _n(){if(zt)return D;zt=1;var e=D&&D.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(D,"__esModule",{value:!0}),D.toChecksumAddress=D.isEthereumDid=D.isEthereumType=D.toTypeInfoStr=D.toTypeInfo=D.fromTypeInfo=D.DID_TYPE_PASSKEY=D.DID_TYPE_ETHEREUM=D.DID_TYPE_ARCBLOCK=void 0,D.DidType=b;const a=J(),i=e(ct),d=e(Cr),c=e(Dr),s=_t(),m=jr(),f={pk:"key",address:"encoding"},p={role:s.types.RoleType.ROLE_ACCOUNT,pk:s.types.KeyType.ED25519,hash:s.types.HashType.SHA3,address:s.types.EncodingType.BASE58};D.DID_TYPE_ARCBLOCK=p;const g={role:s.types.RoleType.ROLE_PASSKEY,pk:s.types.KeyType.PASSKEY,hash:s.types.HashType.SHA2,address:s.types.EncodingType.BASE58};D.DID_TYPE_PASSKEY=g;const n={role:s.types.RoleType.ROLE_ACCOUNT,pk:s.types.KeyType.ETHEREUM,hash:s.types.HashType.KECCAK,address:s.types.EncodingType.BASE16};D.DID_TYPE_ETHEREUM=n;const o=H=>{const T=["pk","hash","address"];return(0,d.default)((0,c.default)(H,T),(0,c.default)(n,T))};D.isEthereumType=o;const l=H=>{const T=(0,a.toAddress)(H);return/^(0x)?[0-9a-f]{40}$/i.test(T)?/^(0x|0X)?[0-9a-f]{40}$/.test(T)||/^(0x|0X)?[0-9A-F]{40}$/.test(T)?!0:h(T):!1};D.isEthereumDid=l;const h=H=>{const T=H.replace(/^0x/i,""),j=s.Hasher.Keccak.hash256(T.toLowerCase()).replace(/^0x/i,"");for(let O=0;O<40;O++)if(parseInt(j[O],16)>7&&T[O].toUpperCase()!==T[O]||parseInt(j[O],16)<=7&&T[O].toLowerCase()!==T[O])return!1;return!0},E=H=>{if(typeof H>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(H))throw new Error(`Given address "${H}" is not a valid Ethereum address.`);const T=H.toLowerCase().replace(/^0x/i,""),j=s.Hasher.Keccak.hash256(T).replace(/^0x/i,"");let O="0x";for(let S=0;S<T.length;S++)parseInt(j[S],16)>7?O+=T[S].toUpperCase():O+=T[S];return O};D.toChecksumAddress=E;function b(H={}){let T={};["default","arcblock"].includes(H)?T=p:["eth","ethereum"].includes(H)?T=n:["passkey"].includes(H)?T=g:T={...p,...H};const{role:j,pk:O,hash:S,address:v}=T;Object.keys(T).forEach(B=>{const N=(0,i.default)(`${f[B]||B}Type`);if(Object.values(s.types[N]).includes(T[B])===!1)throw new Error(`Unsupported ${B} type: ${T[B]}`)});const P={role:j,pk:O,hash:S,address:v};return o(P)===!1&&[s.types.RoleType.ROLE_NODE,s.types.RoleType.ROLE_VALIDATOR,s.types.RoleType.ROLE_TETHER,s.types.RoleType.ROLE_SWAP].includes(P.role)&&(P.hash=s.types.HashType.SHA2),P}b.toJSON=H=>Object.keys(H).reduce((T,j)=>{const O=(0,i.default)(`${f[j]||j}Type`),S=Object.keys(s.types[O]),v=Object.values(s.types[O]);return T[j]=S[v.indexOf(H[j])],T},{}),b.fromJSON=H=>Object.keys(H).reduce((T,j)=>{const O=(0,i.default)(`${f[j]||j}Type`),S=Object.keys(s.types[O]),v=Object.values(s.types[O]);return T[j]=v[S.indexOf(H[j])],T},{});const _=H=>{const T=b(H),j=(0,m.toBits)(T.role,6),O=(0,m.toBits)(T.pk,5),S=(0,m.toBits)(T.hash,5),v=`${j}${O}${S}`,P=(0,a.stripHexPrefix)((0,a.numberToHex)(parseInt(v,2)));return(0,m.toStrictHex)(P,4)};D.fromTypeInfo=_;const A=H=>{let T={};try{if(l(H))T=n;else{const O=(0,m.toBytes)(H).slice(0,2),S=(0,m.toStrictHex)(C.from(O).toString("hex")),v=(0,m.toBits)(new a.BN(S,16),16),P=v.slice(0,6),B=v.slice(6,11),N=v.slice(11,16);T={role:parseInt(P,2),pk:parseInt(B,2),hash:parseInt(N,2),address:(0,a.isHex)((0,a.toAddress)(H))?s.types.EncodingType.BASE16:s.types.EncodingType.BASE58}}return Object.keys(T).forEach(j=>{Object.values(s.types[`${(0,i.default)(f[j]||j)}Type`]).includes(T[j])===!1&&delete T[j]}),T}catch{return T}};D.toTypeInfo=A;const R=H=>{const T=A(H);return Object.keys(T).reduce((j,O)=>{const S=s.types[`${(0,i.default)(f[O]||O)}Type`];return j[O]=Object.keys(S).find(v=>S[v]===T[O]),j},{})};return D.toTypeInfoStr=R,D}var Yt;function Sn(){return Yt||(Yt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_TYPE_PASSKEY=e.DID_TYPE_ETHEREUM=e.DID_TYPE_ARCBLOCK=e.DID_PREFIX=e.DidType=e.fromTypeInfo=e.toTypeInfoStr=e.toTypeInfo=e.isEthereumType=e.isEthereumDid=e.isValid=e.isFromPublicKey=e.toDid=e.toAddress=e.fromHash=e.fromPublicKeyHash=e.fromPublicKey=e.fromSecretKey=e.toStrictHex=e.types=void 0;const a=_t();Object.defineProperty(e,"types",{enumerable:!0,get:function(){return a.types}});const i=J();Object.defineProperty(e,"toAddress",{enumerable:!0,get:function(){return i.toAddress}}),Object.defineProperty(e,"toDid",{enumerable:!0,get:function(){return i.toDid}});const d=_n();Object.defineProperty(e,"DidType",{enumerable:!0,get:function(){return d.DidType}}),Object.defineProperty(e,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return d.DID_TYPE_ARCBLOCK}}),Object.defineProperty(e,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return d.DID_TYPE_ETHEREUM}}),Object.defineProperty(e,"DID_TYPE_PASSKEY",{enumerable:!0,get:function(){return d.DID_TYPE_PASSKEY}}),Object.defineProperty(e,"fromTypeInfo",{enumerable:!0,get:function(){return d.fromTypeInfo}}),Object.defineProperty(e,"isEthereumDid",{enumerable:!0,get:function(){return d.isEthereumDid}}),Object.defineProperty(e,"isEthereumType",{enumerable:!0,get:function(){return d.isEthereumType}}),Object.defineProperty(e,"toTypeInfo",{enumerable:!0,get:function(){return d.toTypeInfo}}),Object.defineProperty(e,"toTypeInfoStr",{enumerable:!0,get:function(){return d.toTypeInfoStr}});const c=jr();Object.defineProperty(e,"DID_PREFIX",{enumerable:!0,get:function(){return c.DID_PREFIX}}),Object.defineProperty(e,"toStrictHex",{enumerable:!0,get:function(){return c.toStrictHex}});const s=(o,l)=>{const h=(0,d.DidType)(l),E=(0,a.getSigner)(h.pk).getPublicKey(o);return m(E.indexOf("0x")===0?E:`0x${E}`,h)};e.fromSecretKey=s;const m=(o,l)=>{const h=(0,d.DidType)(l),b=(0,a.getHasher)(h.hash)(o,1);return f(b,h)};e.fromPublicKey=m;const f=(o,l)=>{const h=(0,d.DidType)(l),E=(0,i.stripHexPrefix)(o).slice(0,40),b=(0,a.getHasher)(h.hash),_=(0,d.fromTypeInfo)(h),A=(0,i.stripHexPrefix)(b(`0x${_}${E}`,1)).slice(0,8),R=`0x${_}${E}${A}`;return(0,d.isEthereumType)(h)?(0,d.toChecksumAddress)(`0x${o.slice(-40)}`):h.address===a.types.EncodingType.BASE58?(0,i.toBase58)(R):R};e.fromPublicKeyHash=f;const p=(o,l=a.types.RoleType.ROLE_ACCOUNT)=>{const h=Object.keys(a.types.RoleType),E=Object.values(a.types.RoleType);if(E.indexOf(l)===-1)throw new Error(`Unsupported role type ${l} when gen ddi from hash`);const b=(0,d.DidType)({role:a.types.RoleType[h[E.indexOf(l)]]});return f(o,b)};e.fromHash=p;const g=(o,l)=>{if(n(o)===!1)return!1;const h=(0,d.toTypeInfo)(o),E=m(l,h),b=o.replace(c.DID_PREFIX,"");return E===b};e.isFromPublicKey=g;const n=o=>{if(!o)return!1;const l=(0,i.toAddress)(String(o)),{hash:h}=(0,d.toTypeInfo)(l);if(typeof h>"u")return!1;if((0,d.isEthereumDid)(l))return!0;const E=(0,a.getHasher)(h),b=(0,c.toBytes)(l),_=(0,c.toStrictHex)(C.from(b.slice(0,22)).toString("hex")),A=(0,c.toStrictHex)(C.from(b.slice(22,26)).toString("hex")),R=(0,i.stripHexPrefix)(E(`0x${_}`,1)).slice(0,8);return A===R};e.isValid=n}(ot)),ot}var Xt;function En(){if(Xt)return Y;Xt=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.WalletType=void 0,Y.Wallet=d,Y.fromSecretKey=c,Y.fromPublicKey=s,Y.fromAddress=m,Y.fromRandom=f,Y.fromJSON=p,Y.isValid=g;const e=J(),a=_t(),i=Sn();Y.WalletType=i.DidType;function d(n,o="default"){const l=(0,i.DidType)(o),h=(0,a.getSigner)(l.pk),E=(0,a.getHasher)(l.hash);return{type:l,secretKey:n.sk,publicKey:n.pk,address:n.pk?(0,i.fromPublicKey)(n.pk,l):n.address,hash(b,_=1,A="hex"){return E(b,_,A)},sign(b,_=!0,A="hex"){if(!n.sk)throw new Error("Cannot sign data without a secretKey");if(_){const R=E(b,1);return h.sign(R,n.sk,A)}return h.sign(b,n.sk,A)},async verify(b,_,A=!0,R){if(!n.pk)throw new Error("Cannot verify data without a publicKey");const H=A?E(b,1):b;return h.verify(H,_,n.pk,R)},ethHash(b){if(typeof h.ethHash!="function")throw new Error("ethHash is not supported by signer");return h.ethHash(b)},ethSign(b,_=!0){if(!n.sk)throw new Error("Cannot sign data without a secretKey");if(typeof h.ethHash!="function")throw new Error("ethSign is not supported by signer");return _?h.ethSign(h.ethHash(b),(0,e.toHex)(n.sk)):h.ethSign(b,(0,e.toHex)(n.sk))},ethVerify(b,_,A=!0){if(typeof h.ethHash!="function")throw new Error("ethVerify is not supported by signer");const R=A?h.ethHash(b):b;return h.ethRecover(R,_)===this.address},toAddress(){return n.pk?(0,i.fromPublicKey)(n.pk,l):n.address},toJSON(){return{type:i.DidType.toJSON(l),sk:(0,e.toHex)(n.sk),pk:(0,e.toHex)(n.pk),address:this.address}}}}function c(n,o="default"){const l=(0,i.DidType)(o),h={sk:n,pk:(0,a.getSigner)(l.pk).getPublicKey(n)};return d(h,l)}function s(n,o="default"){return d({pk:n},(0,i.DidType)(o))}function m(n){return d({address:(0,i.toAddress)(n)},(0,i.toTypeInfo)(n))}function f(n="default"){const o=(0,i.DidType)(n),h=(0,a.getSigner)(o.pk).genKeyPair();return d({sk:h.secretKey,pk:h.publicKey},o)}function p(n){const o=i.DidType.fromJSON(n.type);return d(n,o)}function g(n,o=!0){return!(!n||typeof n!="object"||typeof n.verify!="function"||typeof n.toAddress!="function"||typeof n.toJSON!="function"||!n.type||!n.publicKey||o&&(!n.secretKey||typeof n.sign!="function"))}return Y}var at,Jt;function xn(){if(Jt)return at;Jt=1;const e=Gr(),a=dn(),{fromSecretKey:i,WalletType:d}=En(),{isHexStrict:c,toHex:s,toBuffer:m,stripHexPrefix:f}=ne(),{types:p}=a;return at={fromAppDid:(n,o,l={role:p.RoleType.ROLE_ACCOUNT},h=0)=>{if(!o)throw new Error("Cannot get user wallet with empty root sk");const E=a.Hasher.SHA3.hash256(m(n)),b=f(E).slice(0,16),_=b.slice(0,8),A=b.slice(8,16),R=parseInt(+`0x${_}`,10)&2147483647,H=parseInt(+`0x${A}`,10)&2147483647,T=f(c(o)?o:s(o)),j=e.fromMasterSeed(C.from(T,"hex")),O=`m/44'/260'/${R}'/${H}'/${h}`,S=j.derive(O),v=d(l),{pk:P=p.KeyType.ED25519}=v;let B;return P===p.KeyType.ED25519?B=a.Signer.Ed25519.genKeyPair("hex",S.privateKey).secretKey:B=s(S.privateKey),P===p.KeyType.ETHEREUM&&(B=B.slice(0,66)),i(B,v)}},at}var vr=xn();const Tn={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function wr({onCreated:e,onClose:a}){const[i,d]=I.useState(!1),{t:c,locale:s}=Be(),{api:m}=Pe(),{teamDid:f}=$e(),{control:p,handleSubmit:g,formState:{errors:n},watch:o,setValue:l}=xr({defaultValues:Tn,mode:"onChange"}),h=o("scope"),E=_=>{_!=="profile:read"&&l("scope",h.includes(_)?h.filter(A=>A!==_):[...h,_])},b=async _=>{d(!0);try{const A={..._,redirectUris:_.redirectUris,contacts:_.contacts?_.contacts.split(",").map(R=>R.trim()):[],scope:_.scope.join(" ")};await m.createOAuthClient({input:{teamDid:f,input:Xr(A,Jr)}}),e(A)}catch(A){De.error(A.message||"Failed to create OAuth App")}finally{d(!1)}};return r.jsxs(ut,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[r.jsxs(ft,{children:[c("oauth.client.register")," ",r.jsx(dt,{onClick:a,sx:{position:"absolute",right:8,top:8},children:r.jsx(ht,{})})]}),r.jsx(pt,{children:r.jsxs(me,{spacing:4,sx:{mt:2},children:[r.jsx(X,{variant:"h6",gutterBottom:!0,children:c("oauth.client.requiredInformation")}),r.jsx(k,{children:r.jsx(z,{name:"clientName",control:p,rules:{required:c("oauth.client.validate.clientName"),minLength:{value:3,message:c("oauth.client.validate.clientNameMinLength")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.name"),required:!0,fullWidth:!0,placeholder:c("oauth.client.input.clientNamePlaceholder"),error:!!n.clientName,helperText:n.clientName?.message}),r.jsx(M,{children:c("oauth.client.helperText.clientName")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"clientUri",control:p,rules:{required:c("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:c("oauth.client.validate.clientUriInvalid")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:c("oauth.client.input.clientUriPlaceholder"),error:!!n.clientUri,helperText:n.clientUri?.message}),r.jsx(M,{children:c("oauth.client.helperText.clientUri")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"redirectUris",control:p,rules:{required:c("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:c("oauth.client.validate.redirectUrisInvalid")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:c("oauth.client.input.redirectUrisPlaceholder"),error:!!n.redirectUris,helperText:n.redirectUris?.message}),r.jsxs(k,{sx:{display:"flex",gap:"2px"},children:[r.jsx(M,{children:c("oauth.client.helperText.redirectUris")}),r.jsx(M,{children:c("oauth.client.helperText.read")}),r.jsx(M,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:c("oauth.client.helperText.document")}),r.jsx(M,{children:c("oauth.client.helperText.more")})]})]})})}),r.jsxs(Lr,{variant:"outlined",sx:{p:2,display:"none"},children:[r.jsx(X,{variant:"subtitle2",gutterBottom:!0,children:c("oauth.client.input.permissions")}),r.jsx(k,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:r.jsx(yr,{children:Object.entries(re.OAUTH_SCOPES).map(([_,A])=>r.jsx(mr,{control:r.jsx(gr,{checked:h.includes(_),onChange:()=>E(_),disabled:_==="profile:read",color:"primary"}),label:r.jsx(k,{children:r.jsx(X,{variant:"body2",sx:{fontWeight:500},children:A})})},_))})})]}),r.jsx(yt,{}),r.jsx(X,{variant:"h6",gutterBottom:!0,children:c("oauth.client.optionalInformation")}),r.jsx(me,{children:r.jsx(z,{name:"contacts",control:p,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:c("oauth.client.validate.contacts")}},render:({field:_})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.contacts"),fullWidth:!0,placeholder:c("oauth.client.input.contactsPlaceholder"),error:!!n.contacts,helperText:n.contacts?.message}),r.jsx(M,{children:c("oauth.client.helperText.contacts")})]})})}),r.jsxs(me,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsx(z,{name:"tosUri",control:p,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:c("oauth.client.validate.tosUriInvalid")}},render:({field:_})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.tosUri"),fullWidth:!0,placeholder:c("oauth.client.input.tosUriPlaceholder"),error:!!n.tosUri,helperText:n.tosUri?.message}),r.jsx(M,{children:c("oauth.client.helperText.tosUri")})]})}),r.jsx(z,{name:"policyUri",control:p,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:c("oauth.client.validate.policyUriInvalid")}},render:({field:_})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{size:"small",..._,label:c("oauth.client.input.policyUri"),fullWidth:!0,placeholder:c("oauth.client.input.policyUriPlaceholder"),error:!!n.policyUri,helperText:n.policyUri?.message}),r.jsx(M,{children:c("oauth.client.helperText.policyUri")})]})})]}),n.error&&r.jsx(br,{severity:"error",children:n.error.message})]})}),r.jsxs(_r,{children:[r.jsx(He,{onClick:a,children:c("common.cancel")}),r.jsxs(He,{onClick:g(b),disabled:i,variant:"contained",color:"primary",children:[i?r.jsx(mt,{size:20,sx:{mr:1}}):null,c("oauth.client.registerButton")]})]})]})}wr.propTypes={onCreated:w.func.isRequired,onClose:w.func.isRequired};function St({scope:e="",...a}){if(!e)return null;const i=e.split(" ").filter(Boolean);return r.jsx(me,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(d=>r.jsx(Rr.Fragment,{children:r.jsx(qr,{title:re.OAUTH_SCOPES[d],children:r.jsx(q,{children:d})})},d))})}St.propTypes={scope:w.string};const Et=e=>{const{prefix:a}=Pe(),{blocklet:i}=Zr(),d=xt(a,"/api/media/upload",i.appPid),c=I.useCallback(m=>m?m.startsWith("http")?m:`${xt(a,"/api/media/upload",i.appPid)}/${m}`:"",[a,i.appPid]);return{clientLogoUrl:I.useMemo(()=>c(e),[e,c]),apiPath:d,getClientLogoUrl:c}},Hn=I.lazy(()=>Kr(()=>import("./index-CUQ2UhNw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(e=>({default:e.Uploader})));function Ur({client:e,onUpdate:a,onClose:i}){const[d,c]=I.useState(!1),{t:s,locale:m}=Be(),f=I.useRef(null),{api:p}=Pe(),{teamDid:g}=$e(),{control:n,handleSubmit:o,formState:{errors:l},watch:h,setValue:E,getValues:b}=xr({defaultValues:{clientName:e.clientName||"",clientUri:e.clientUri||"",redirectUris:Array.isArray(e.redirectUris)?e.redirectUris.join(","):"",scope:e.scope?e.scope.split(" "):["profile:read"],contacts:Array.isArray(e.contacts)?e.contacts.join(","):"",tosUri:e.tosUri||"",policyUri:e.policyUri||"",logoUri:e.logoUri||"",clientSecretExpiresAt:e.clientSecretExpiresAt||null},mode:"onChange"}),_=h("scope"),A=h("logoUri"),{clientLogoUrl:R,apiPath:H}=Et(A),T=S=>{S!=="profile:read"&&E("scope",_.includes(S)?_.filter(v=>v!==S):[..._,S])},j=async S=>{const v={clientId:e.clientId,clientName:S.clientName.trim(),clientUri:S.clientUri,redirectUris:S.redirectUris.split(",").map(P=>P.trim()).filter(Boolean),contacts:S.contacts?S.contacts.split(",").map(P=>P.trim()):[],scope:S.scope.join(" "),tosUri:S.tosUri,policyUri:S.policyUri,logoUri:S.logoUri,clientSecretExpiresAt:S.clientSecretExpiresAt?parseInt(S.clientSecretExpiresAt/1e3,10):null};await p.updateOAuthClient({input:{teamDid:g,input:v}})},O=async S=>{c(!0);try{await j(S),a(),i()}catch(v){De.error(v.message||s("oauth.client.updateFailed"))}finally{c(!1)}};return r.jsxs(ut,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[r.jsxs(ft,{children:[s("oauth.client.update")," ",r.jsx(dt,{onClick:i,sx:{position:"absolute",right:8,top:8},children:r.jsx(ht,{})})]}),r.jsx(pt,{children:r.jsxs(me,{spacing:3,sx:{mt:2},children:[r.jsxs(k,{sx:{mb:3},children:[r.jsx(X,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),r.jsxs(k,{children:[r.jsx(k,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:R?r.jsx(k,{children:r.jsx("img",{src:R,alt:"client-logo",style:{width:"100%",height:"100%"}})}):r.jsx(k,{onClick:()=>{f.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:r.jsx(Sr,{sx:{fontSize:40,color:"common.white"}})})}),r.jsx(He,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{f.current?.open()},children:s(R?"common.change":"common.upload")})]}),r.jsx(k,{sx:{display:"flex",alignItems:"center"},children:r.jsx(I.Suspense,{fallback:r.jsx(en,{}),children:r.jsx(Hn,{ref:f,locale:m,popup:!0,onUploadFinish:S=>{E("logoUri",S.data.filename),j(b()).then(()=>{a()}).catch(v=>{De.error(v.message||s("oauth.client.updateFailed"))}).finally(()=>{f.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:H,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),r.jsx(X,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),r.jsx(V,{label:"Client Id",fullWidth:!0,value:e.clientId,disabled:!0}),r.jsx(k,{children:r.jsx(z,{name:"clientName",control:n,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!l.clientName,helperText:l.clientName?.message}),r.jsx(M,{children:s("oauth.client.helperText.clientName")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"clientUri",control:n,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!l.clientUri,helperText:l.clientUri?.message}),r.jsx(M,{children:s("oauth.client.helperText.clientUri")})]})})}),r.jsx(k,{children:r.jsx(z,{name:"redirectUris",control:n,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!l.redirectUris,helperText:l.redirectUris?.message}),r.jsx(M,{children:s("oauth.client.helperText.redirectUris")})]})})}),r.jsx(z,{name:"clientSecretExpiresAt",control:n,render:({field:S})=>r.jsx(Qr,{placeholder:s("oauth.client.input.expireTime"),value:S.value*1e3,onChange:v=>{S.onChange(v)}})}),r.jsxs(k,{sx:{display:"none"},children:[r.jsx(X,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),r.jsx(k,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:r.jsx(yr,{children:Object.entries(re.OAUTH_SCOPES).map(([S,v])=>r.jsx(mr,{control:r.jsx(gr,{checked:_.includes(S),onChange:()=>T(S),disabled:S==="profile:read",color:"primary"}),label:r.jsx(k,{children:r.jsx(X,{variant:"body2",sx:{fontWeight:500},children:v})})},S))})})]}),r.jsx(yt,{}),r.jsx(X,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),r.jsx(k,{children:r.jsx(z,{name:"contacts",control:n,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:S})=>r.jsxs(r.Fragment,{children:[r.jsx(V,{...S,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!l.contacts,helperText:l.contacts?.message}),r.jsx(M,{children:s("oauth.client.helperText.contacts")})]})})}),r.jsxs(me,{direction:{xs:"column",sm:"row"},spacing:2,children:[r.jsx(z,{name:"tosUri",control:n,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:S})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{...S,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!l.tosUri,helperText:l.tosUri?.message}),r.jsx(M,{children:s("oauth.client.helperText.tosUri")})]})}),r.jsx(z,{name:"policyUri",control:n,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:S})=>r.jsxs(k,{sx:{width:"50%"},children:[r.jsx(V,{...S,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!l.policyUri,helperText:l.policyUri?.message}),r.jsx(M,{children:s("oauth.client.helperText.policyUri")})]})})]}),l.error&&r.jsx(br,{severity:"error",children:l.error.message})]})}),r.jsxs(_r,{children:[r.jsx(He,{onClick:i,children:s("common.cancel")}),r.jsx(He,{onClick:o(O),disabled:d,variant:"contained",color:"primary",children:d?r.jsx(mt,{size:16}):s("common.update")})]})]})}Ur.propTypes={client:w.shape({clientId:w.string.isRequired,clientName:w.string.isRequired,clientUri:w.string,redirectUris:w.arrayOf(w.string),scope:w.string,contacts:w.arrayOf(w.string),tosUri:w.string,policyUri:w.string,logoUri:w.string,clientSecretExpiresAt:w.number}).isRequired,onUpdate:w.func.isRequired,onClose:w.func.isRequired};function Ar({client:e,onUpdate:a,onClose:i}){return r.jsx(Ur,{client:e,onUpdate:d=>a(d),onClose:i})}Ar.propTypes={client:w.shape({clientId:w.string.isRequired,clientName:w.string.isRequired,clientUri:w.string,redirectUris:w.arrayOf(w.string),scope:w.string,contacts:w.arrayOf(w.string),tosUri:w.string,policyUri:w.string,logoUri:w.string,clientSecretExpiresAt:w.number}).isRequired,onUpdate:w.func.isRequired,onClose:w.func.isRequired};function Or({clientId:e,clientName:a,onDelete:i=()=>{},onClose:d=()=>{}}){const{t:c}=Be(),{api:s}=Pe(),{teamDid:m}=$e(),f=()=>{d()},p=async()=>{try{await s.deleteOAuthClient({input:{teamDid:m,clientId:e}}),i()}catch(n){De.error(n?.message)}finally{f()}},g={keyName:a,title:c("oauth.client.delete.title"),description:c("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:c("oauth.client.delete.description",{name:a}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:p,onCancel:f};return r.jsx(tn,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}Or.propTypes={clientId:w.string.isRequired,clientName:w.string.isRequired,onDelete:w.func,onClose:w.func};function Br({title:e,items:a}){return r.jsxs(k,{sx:{mb:3},children:[r.jsx(X,{variant:"h6",sx:{mb:1.5},children:e}),r.jsx(me,{spacing:1.5,children:a.map(({label:i,value:d})=>r.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:2},children:[r.jsx(X,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),r.jsx(X,{sx:{wordBreak:"break-all"},children:d||"-"})]},i))})]})}Br.propTypes={title:w.string.isRequired,items:w.arrayOf(w.shape({label:w.string.isRequired,value:w.any})).isRequired};function Pr({client:e,onClose:a}){const{t:i,locale:d}=Be(),{teamDid:c}=$e(),{clientName:s,clientId:m,clientSecret:f,redirectUris:p,scope:g,clientUri:n,logoUri:o,contacts:l,tosUri:h,policyUri:E,jwksUri:b,jwks:_,softwareId:A,softwareVersion:R,clientIdIssuedAt:H,clientSecretExpiresAt:T,updatedAt:j,createUser:O}=e,{clientLogoUrl:S}=Et(o),v=N=>{try{const ee=new URL(window.blocklet.appUrl);return ee.pathname=N,ee.toString()}catch{return"-"}},P=vr.fromAppDid(m,c),B=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:r.jsx(pr,{variant:"rounded",shape:"square",src:S,did:P.address,size:64})},{label:i("oauth.client.clientUri"),value:n?r.jsx(q,{children:n}):"-"},{label:i("oauth.client.clientId"),value:r.jsx(q,{children:m})},{label:i("oauth.client.clientSecret"),value:r.jsx(q,{children:f})},{label:i("oauth.client.redirectUris"),value:r.jsx(q,{children:(p||[]).join(", ")})},{label:i("oauth.client.scope"),value:r.jsx(St,{scope:g})},{label:i("oauth.client.createUser"),value:O?rn(O,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:r.jsx(q,{children:v("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:r.jsx(q,{children:v(`${re.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:l.length?r.jsx(q,{children:(l||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:h?r.jsx(q,{children:h}):"-"},{label:i("oauth.client.policyUri"),value:E?r.jsx(q,{children:E}):"-"},{label:i("oauth.client.jwksUri"),value:b},{label:i("oauth.client.jwks"),value:_},{label:i("oauth.client.softwareId"),value:A},{label:i("oauth.client.softwareVersion"),value:R}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:H?r.jsx(Ce,{value:H*1e3,type:"all",locale:d}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:T?r.jsx(Ce,{value:T*1e3,type:"all",locale:d}):"-"},{label:i("common.updatedAt"),value:j?r.jsx(Ce,{value:j,type:"all",locale:d}):"-"}]}].filter(Boolean);return r.jsxs(ut,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[r.jsxs(ft,{children:[i("oauth.client.oauthAppDetails"),r.jsx(dt,{onClick:a,sx:{position:"absolute",right:8,top:8},children:r.jsx(ht,{})})]}),r.jsx(pt,{children:r.jsx(k,{sx:{mt:1},children:B.map((N,ee)=>r.jsxs(k,{children:[r.jsx(Br,{title:N.title,items:N.items}),ee!==B.length-1&&r.jsx(yt,{sx:{my:2}})]},N.title))})})]})}Pr.propTypes={client:w.object.isRequired,onClose:w.func.isRequired};function jn(e){return r.jsx(Ce,{value:e*1e3})}function $r({selected:e=null,onClose:a}){return e?r.jsx(Pr,{client:e,onClose:a}):null}$r.propTypes={selected:w.object,onClose:w.func.isRequired};function kr({open:e,onCreated:a,onClose:i}){return e?r.jsx(wr,{onCreated:a,onClose:i}):null}kr.propTypes={open:w.bool.isRequired,onCreated:w.func.isRequired,onClose:w.func.isRequired};function si(){const[e,a]=I.useState({searchText:"",pageSize:10,page:1}),[i,d]=I.useState(null),[c,s]=I.useState(!1),m=I.useRef(null),{t:f,locale:p}=Be(),{api:g}=Pe(),{teamDid:n}=$e(),[o,l]=I.useState(null),[h,E]=I.useState(null),b=sn(),{getClientLogoUrl:_}=Et(),A=Yr(async()=>await g.getOAuthClients({input:{teamDid:n,paging:{page:e.page,pageSize:e.pageSize}}}),[e.page,e.pageSize]),{loading:R}=A,H=I.useMemo(()=>A.value?.list||[],[A.value?.list]),T=I.useMemo(()=>e.searchText?H.filter(S=>S.clientName.toLowerCase().includes(e.searchText.toLowerCase())||S.clientId.toLowerCase().includes(e.searchText.toLowerCase())||S.scope.toLowerCase().includes(e.searchText.toLowerCase())):H,[e.searchText,H]),j=I.useMemo(()=>[{label:f("oauth.client.name"),name:"clientName",options:{customBodyRender:(S,{rowIndex:v})=>{const P=T[v],B=_(P.logoUri),N=vr.fromAppDid(P.clientId,n);return r.jsx(k,{sx:{display:"flex",alignItems:"center",gap:2},children:r.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[r.jsx(pr,{variant:"rounded",shape:"square",did:N.address,src:B,size:48}),r.jsxs(me,{sx:{gap:.5},children:[r.jsx(k,{sx:{color:"text.primary"},children:P.clientName}),r.jsx(k,{sx:{color:"text.secondary"},children:P.clientUri})]})]})})}}},{label:f("oauth.client.clientId"),name:"clientId"},{label:f("oauth.client.scope"),name:"scope",options:{customBodyRender:S=>r.jsx(St,{scope:S})}},{label:f("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:jn}},{label:f("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:S=>S?r.jsx(Wr,{showDid:!0,did:S,cardType:zr.Detailed,infoType:Vr.Minimal,sx:{border:0,padding:0}}):f("oauth.client.openRegistration")}},{label:f("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(S,{rowIndex:v})=>{const P=T[v];return r.jsx(nn,{actions:[{icon:r.jsx(Mr,{}),text:f("common.edit"),onClick:B=>{B.stopPropagation(),l(P)}},{icon:r.jsx(Fr,{}),text:f("common.delete"),onClick:B=>{B.stopPropagation(),E(P)}}]})}}}],[T,f,_,n,l,E]),O=({page:S,rowsPerPage:v,searchText:P})=>{e.pageSize!==v?a(B=>({...B,searchText:"",pageSize:v,page:1})):e.page!==S+1?a(B=>({...B,searchText:"",page:S+1})):e.searchText!==P&&a(B=>({...B,searchText:P,page:1}))};return r.jsxs(k,{ref:m,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[b?r.jsx(Tt,{title:f("oauth.client.listTitle"),tooltipTitle:f("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${p}/oauth-service`}):null,r.jsx(Nr,{data:T,columns:j,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:e.page-1,rowsPerPage:e.pageSize,count:T.length,searchDebounceTime:400,onRowClick(S,{dataIndex:v},P){if(m.current?.contains(P.target)){const B=T[v];d(B)}}},onChange:O,title:b?null:r.jsx(Tt,{title:f("oauth.client.listTitle"),tooltipTitle:f("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${p}/oauth-service`}),customButtons:[r.jsxs(He,{variant:"contained",size:"small",onClick:()=>s(!0),children:[R?r.jsx(mt,{size:16}):r.jsx(Sr,{style:{fontSize:16}}),f("common.create")]},"add")],loading:!1,emptyNode:r.jsx(Ir,{children:f("oauth.client.empty")})}),r.jsx($r,{selected:i,onClose:()=>d(null)}),r.jsx(kr,{open:c,onCreated:()=>{s(!1),A.retry()},onClose:()=>s(!1)}),o&&r.jsx(Ar,{client:o,onUpdate:A.retry,onClose:()=>l(null)}),h&&r.jsx(Or,{...h,onDelete:A.retry,onClose:()=>E(null)})]})}export{si as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o}from"./vendor-react-Dvs43sk9.js";import{j as t,b4 as _,W as n,D as F,n as xe,b0 as ye,cw as be,cx as ve,cy as je,cz as we,ak as g,T as q,Q as ke,a$ as te,a3 as Ie,s as Me,J as Re,I as Ce,at as Ae}from"./vendor-mui-core-C2nSSl8u.js";import{a as D,b as O,h as Te}from"./vendor-hooks-CLY4g97Q.js";import{T as Q,a6 as Ne,aa as ne,G as re,a8 as Se}from"./vendor-ux-BEdmA2UN.js";import{t as $e}from"./server-logo-notext.svg-CKQB0tIp.js";import{B as ze}from"./bundle-avatar-DgaVgcWV.js";import{a as Le,g as se,i as ie,b as oe,c as V,M as ae,d as Ee,m as De,e as Be,f as Pe,h as qe,j as Ve,k as _e,l as Fe,n as Oe,N as He}from"./team-DrpyaDg_.js";import{R as Ue,J as We,C as G,a as H}from"./vendor-utils-DtY42AM-.js";import{c as Qe,Z as Ge}from"./index-DO37nRKU.js";import{B as Je,a as Ke,l as Xe}from"./index-BWFAeSHM.js";import{p as Ye}from"./util-BsoIGi_3.js";function le({blocklet:e,style:r={},size:s=40,...i}){const l=Le({blocklet:e,square:!0}),{variant:u}=i;return t.jsx(_,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...i,children:t.jsx("img",{src:l,alt:"",style:{width:s}})})}le.propTypes={blocklet:n.object.isRequired,style:n.object,size:n.oneOfType([n.number,n.string])};function Ze(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function J({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=Q(),[l,u]=o.useState(0);if(o.useEffect(()=>{let d;if(r){const p=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((p-y)/1e3)),b=()=>{u(k=>{const C=Math.random()*1e3;return parseFloat((k+C).toFixed(4))})};v<60?d=setInterval(b,1e3):v<60*60?d=setInterval(b,6e4):d=setInterval(b,36e5)}return()=>{clearInterval(d)}},[e,l,r]),!e)return"-";const m=Ze(e);return t.jsx(Ne,{value:m,locale:i,...s})}J.propTypes={value:n.any,shouldUpdate:n.bool};const et={error:je,warning:ve,info:be,success:ye};ce.propTypes={severity:n.oneOf(["error","warning","info","success"]).isRequired,size:n.number};function ce({severity:e="info",size:r=32}){const s=F(),l=D(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],u=et[e],m=xe(l,.1);return t.jsx(_,{sx:{width:r,height:r,bgcolor:m,color:l},children:t.jsx(u,{fontSize:"small"})})}const tt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},rt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},st={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},Z={comment:{icon:tt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:rt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:st,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:it,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};de.propTypes={activity:n.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:n.number};function de({activity:e,size:r=32}){const s=Z[e]||Z.comment,i=s.icon;return t.jsx(_,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:i}):t.jsx(ne,{icon:i})})}const U={avatar:n.string,fullName:n.string,did:n.string};function W({actor:e,size:r,teamDid:s="",inService:i=!1,showName:l=!1}){const u=D(()=>({...e,avatar:e?.avatar?Ye(e.avatar,s,i):null}),[e,s,i]),m=d=>{e&&(d.stopPropagation(),window.open(We(G(Qe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),d.customPreventRedirect=!0)};return t.jsxs(g,{onClick:m,role:"button",style:{cursor:"pointer"},title:e?.fullName||"",sx:{display:"flex",alignItems:"center",gap:1},children:[u.avatar?t.jsx(Je,{user:u,showDid:!0,cardType:Xe.AvatarOnly,infoType:Ke.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(_,{sx:{width:r,height:r}}),l&&t.jsx("span",{children:e?.fullName})]})}W.propTypes={actor:n.shape(U).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};K.propTypes={actors:n.oneOfType([n.shape(U),n.arrayOf(n.shape(U))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function K({actors:e,size:r=32,maxDisplay:s=9,teamDid:i="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const p=Array.isArray(e)?e:[e];return Ue(p,"did").filter(Boolean)},[e]);return d.length===1||!d.length?t.jsx(W,{actor:d[0],size:r,teamDid:i,inService:l,showName:u}):t.jsx(we,{total:d.length,renderSurplus:p=>p<100?t.jsxs("span",{children:["+",p]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:d.map((p,y)=>p?.avatar?t.jsx(W,{actor:p,size:r,teamDid:i,inService:l},p?.did||y):m)})}const ee=3;pe.propTypes={notification:n.object.isRequired,isMultiple:n.bool,blocklet:n.object,mountPoint:n.string,avatarFallback:n.node};ue.propTypes={notification:n.object.isRequired,mountPoint:n.string};he.propTypes={items:n.array.isRequired,activity:n.object.isRequired,blocklet:n.object,mountPoint:n.string,viewMoreLink:n.string,avatarFallback:n.node};function ue({notification:e,mountPoint:r=""}){const{activity:s}=e,{type:i,meta:l={}}=s||{},u=oe({activity:s,users:[e?.actorInfo],actors:[e?.activity?.actor],mountPoint:r});return H(s)||!s.type||!s.actor||H(s.target)?null:t.jsxs(g,{children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:.5},children:u}),l?t.jsx(ae,{meta:l,type:i}):null]})}function he({items:e,activity:r,blocklet:s,mountPoint:i="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),p=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=o.useContext(re),v=D(()=>!H(r.meta)&&Object.values(r.meta).some(a=>a!=null),[r]),b=oe({activity:r,users:e.map(a=>a?.actorInfo),actors:e.map(a=>a?.activity?.actor),mountPoint:i}),k=O(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:G(i,x.metaLink):null}),C=O((a,x)=>{if(!x)return;const h=k(x);h&&(window.open(h,"_blank"),a.customPreventRedirect=!0)}),S=e.length>ee,w=e.slice(0,ee);return t.jsxs(g,{sx:{width:"100%"},children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:3},children:b}),v?t.jsxs(g,{className:"sub-content",sx:{display:"flex",flexDirection:"column",gap:3},children:[w.map(a=>t.jsxs(g,{onClick:x=>C(x,a),sx:{display:"flex",flexDirection:"column",gap:1},children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[V(a)?t.jsx(K,{actors:a.actorInfo,size:32,teamDid:p}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(J,{value:a.createdAt,locale:y,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),a.activity.meta?t.jsx(g,{sx:{pl:5},children:t.jsx(ae,{meta:a.activity.meta,type:a.activity.type})}):null]},a.id)),S&&l?t.jsx(g,{sx:{mt:1,display:"flex",justifyContent:"center"},children:t.jsxs(ke,{size:"large",variant:"text",component:te,href:l,target:"_blank",rel:"noopener noreferrer",onClick:a=>{a.customPreventRedirect=!0},children:[d("notification.viewMore")," ",t.jsx(ne,{icon:Ee,style:{marginLeft:4}})]})}):null]}):null]})}function pe({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:i="",avatarFallback:l}){const u=D(()=>{if(!e.activity)return null;const m=se(e.activity);return m?.targetLink?ie(m?.targetLink)?m?.targetLink:G(i,m.targetLink):null},[e.activity,i]);return r?t.jsx(he,{items:e.items,activity:e.activity,blocklet:s,mountPoint:i,viewMoreLink:u,avatarFallback:l}):t.jsx(ue,{notification:e,mountPoint:i})}function me({notification:e}){const r=o.useMemo(()=>{const{actions:s,action:i}=e;let l=s??[];return!l.length&&i&&(l=[{name:"Visit",link:i}]),l},[e]);return r.length?t.jsx(g,{sx:{display:"flex",justifyContent:"start",flexWrap:"wrap",alignItems:"center",gap:1},children:r.map((s,i)=>t.jsxs(o.Fragment,{children:[t.jsx(te,{href:s.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:l=>{l.customPreventRedirect=!0},children:s.name},s.link),i<r.length-1?t.jsx(Ie,{orientation:"vertical",sx:{height:12,borderWidth:"1px"}}):null]},s.link))}):null}me.propTypes={notification:n.object.isRequired};const ot=Me(g)`
|
|
1
|
+
import{r as o}from"./vendor-react-Dvs43sk9.js";import{j as t,b4 as _,W as n,D as F,n as xe,b0 as ye,cw as be,cx as ve,cy as je,cz as we,ak as g,T as q,Q as ke,a$ as te,a3 as Ie,s as Me,J as Re,I as Ce,at as Ae}from"./vendor-mui-core-BkVXEDpj.js";import{a as D,b as O,h as Te}from"./vendor-hooks-CLY4g97Q.js";import{T as Q,a6 as Ne,ab as ne,G as re,a9 as $e}from"./vendor-ux-lckoR4gs.js";import{t as Se}from"./server-logo-notext.svg-CKQB0tIp.js";import{B as ze}from"./bundle-avatar-DQcnLf3o.js";import{a as Le,g as se,i as ie,b as oe,c as V,M as ae,d as Ee,m as De,e as Be,f as Pe,h as qe,j as Ve,k as _e,l as Fe,n as Oe,N as He}from"./team-BqbXtbtA.js";import{R as Ue,J as We,C as G,a as H}from"./vendor-utils-DtY42AM-.js";import{c as Qe,Z as Ge}from"./index-BWTQhZ4U.js";import{B as Je,o as Ke,l as Xe}from"./index-FcG9efoK.js";import{p as Ye}from"./util-jhRcmTca.js";function le({blocklet:e,style:r={},size:s=40,...i}){const l=Le({blocklet:e,square:!0}),{variant:u}=i;return t.jsx(_,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...i,children:t.jsx("img",{src:l,alt:"",style:{width:s}})})}le.propTypes={blocklet:n.object.isRequired,style:n.object,size:n.oneOfType([n.number,n.string])};function Ze(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function J({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=Q(),[l,u]=o.useState(0);if(o.useEffect(()=>{let d;if(r){const p=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((p-y)/1e3)),b=()=>{u(k=>{const C=Math.random()*1e3;return parseFloat((k+C).toFixed(4))})};v<60?d=setInterval(b,1e3):v<60*60?d=setInterval(b,6e4):d=setInterval(b,36e5)}return()=>{clearInterval(d)}},[e,l,r]),!e)return"-";const m=Ze(e);return t.jsx(Ne,{value:m,locale:i,...s})}J.propTypes={value:n.any,shouldUpdate:n.bool};const et={error:je,warning:ve,info:be,success:ye};ce.propTypes={severity:n.oneOf(["error","warning","info","success"]).isRequired,size:n.number};function ce({severity:e="info",size:r=32}){const s=F(),l=D(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],u=et[e],m=xe(l,.1);return t.jsx(_,{sx:{width:r,height:r,bgcolor:m,color:l},children:t.jsx(u,{fontSize:"small"})})}const tt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},rt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},st={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},Z={comment:{icon:tt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:rt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:st,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:it,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};de.propTypes={activity:n.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:n.number};function de({activity:e,size:r=32}){const s=Z[e]||Z.comment,i=s.icon;return t.jsx(_,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:i}):t.jsx(ne,{icon:i})})}const U={avatar:n.string,fullName:n.string,did:n.string};function W({actor:e,size:r,teamDid:s="",inService:i=!1,showName:l=!1}){const u=D(()=>({...e,avatar:e?.avatar?Ye(e.avatar,s,i):null}),[e,s,i]),m=d=>{e&&(d.stopPropagation(),window.open(We(G(Qe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),d.customPreventRedirect=!0)};return t.jsxs(g,{onClick:m,role:"button",style:{cursor:"pointer"},title:e?.fullName||"",sx:{display:"flex",alignItems:"center",gap:1},children:[u.avatar?t.jsx(Je,{user:u,showDid:!0,cardType:Xe.AvatarOnly,infoType:Ke.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(_,{sx:{width:r,height:r}}),l&&t.jsx("span",{children:e?.fullName})]})}W.propTypes={actor:n.shape(U).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};K.propTypes={actors:n.oneOfType([n.shape(U),n.arrayOf(n.shape(U))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function K({actors:e,size:r=32,maxDisplay:s=9,teamDid:i="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const p=Array.isArray(e)?e:[e];return Ue(p,"did").filter(Boolean)},[e]);return d.length===1||!d.length?t.jsx(W,{actor:d[0],size:r,teamDid:i,inService:l,showName:u}):t.jsx(we,{total:d.length,renderSurplus:p=>p<100?t.jsxs("span",{children:["+",p]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:d.map((p,y)=>p?.avatar?t.jsx(W,{actor:p,size:r,teamDid:i,inService:l},p?.did||y):m)})}const ee=3;pe.propTypes={notification:n.object.isRequired,isMultiple:n.bool,blocklet:n.object,mountPoint:n.string,avatarFallback:n.node};ue.propTypes={notification:n.object.isRequired,mountPoint:n.string};he.propTypes={items:n.array.isRequired,activity:n.object.isRequired,blocklet:n.object,mountPoint:n.string,viewMoreLink:n.string,avatarFallback:n.node};function ue({notification:e,mountPoint:r=""}){const{activity:s}=e,{type:i,meta:l={}}=s||{},u=oe({activity:s,users:[e?.actorInfo],actors:[e?.activity?.actor],mountPoint:r});return H(s)||!s.type||!s.actor||H(s.target)?null:t.jsxs(g,{children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:.5},children:u}),l?t.jsx(ae,{meta:l,type:i}):null]})}function he({items:e,activity:r,blocklet:s,mountPoint:i="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),p=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=o.useContext(re),v=D(()=>!H(r.meta)&&Object.values(r.meta).some(a=>a!=null),[r]),b=oe({activity:r,users:e.map(a=>a?.actorInfo),actors:e.map(a=>a?.activity?.actor),mountPoint:i}),k=O(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:G(i,x.metaLink):null}),C=O((a,x)=>{if(!x)return;const h=k(x);h&&(window.open(h,"_blank"),a.customPreventRedirect=!0)}),$=e.length>ee,w=e.slice(0,ee);return t.jsxs(g,{sx:{width:"100%"},children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:3},children:b}),v?t.jsxs(g,{className:"sub-content",sx:{display:"flex",flexDirection:"column",gap:3},children:[w.map(a=>t.jsxs(g,{onClick:x=>C(x,a),sx:{display:"flex",flexDirection:"column",gap:1},children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[V(a)?t.jsx(K,{actors:a.actorInfo,size:32,teamDid:p}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(J,{value:a.createdAt,locale:y,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),a.activity.meta?t.jsx(g,{sx:{pl:5},children:t.jsx(ae,{meta:a.activity.meta,type:a.activity.type})}):null]},a.id)),$&&l?t.jsx(g,{sx:{mt:1,display:"flex",justifyContent:"center"},children:t.jsxs(ke,{size:"large",variant:"text",component:te,href:l,target:"_blank",rel:"noopener noreferrer",onClick:a=>{a.customPreventRedirect=!0},children:[d("notification.viewMore")," ",t.jsx(ne,{icon:Ee,style:{marginLeft:4}})]})}):null]}):null]})}function pe({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:i="",avatarFallback:l}){const u=D(()=>{if(!e.activity)return null;const m=se(e.activity);return m?.targetLink?ie(m?.targetLink)?m?.targetLink:G(i,m.targetLink):null},[e.activity,i]);return r?t.jsx(he,{items:e.items,activity:e.activity,blocklet:s,mountPoint:i,viewMoreLink:u,avatarFallback:l}):t.jsx(ue,{notification:e,mountPoint:i})}function me({notification:e}){const r=o.useMemo(()=>{const{actions:s,action:i}=e;let l=s??[];return!l.length&&i&&(l=[{name:"Visit",link:i}]),l},[e]);return r.length?t.jsx(g,{sx:{display:"flex",justifyContent:"start",flexWrap:"wrap",alignItems:"center",gap:1},children:r.map((s,i)=>t.jsxs(o.Fragment,{children:[t.jsx(te,{href:s.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:l=>{l.customPreventRedirect=!0},children:s.name},s.link),i<r.length-1?t.jsx(Ie,{orientation:"vertical",sx:{height:12,borderWidth:"1px"}}):null]},s.link))}):null}me.propTypes={notification:n.object.isRequired};const ot=Me(g)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -9,7 +9,7 @@ import{r as o}from"./vendor-react-Dvs43sk9.js";import{j as t,b4 as _,W as n,D as
|
|
|
9
9
|
.empty-icon {
|
|
10
10
|
margin: 10px 0;
|
|
11
11
|
}
|
|
12
|
-
`;function fe({children:e=null,...r}){const s=Ge(),l=F().palette.mode==="dark";return t.jsxs(ot,{...r,children:[t.jsx("img",{src:`${s.imgPrefix}/${l?"all-done-dark":"all-done-light"}.svg`,alt:"All Done",width:120,height:120,style:{maxHeight:"100%",maxWidth:"100%"},onError:u=>{u.target.style.display="none"}}),t.jsx(g,{className:"empty-content",children:e})]})}fe.propTypes={color:n.string,children:n.any};at.propTypes={data:n.array,blockletMap:n.object,onReadBatch:n.func,inDialog:n.bool,highlightId:n.string,highlight:n.bool,type:n.oneOf(["server","service"])};ge.propTypes={notification:n.object,blocklet:n.object,onReadBatch:n.func,inDialog:n.bool,highlight:n.bool};P.propTypes={blocklet:n.object,size:n.number,showName:n.bool,hideDot:n.bool};function P({blocklet:e,size:r=40,showName:s=!1,hideDot:i=!1}){const l=e?.did||e?.meta?.did||"",u=(e?.alsoKnownAs||[]).concat(e?.appId||e?.appDid||e?.appPid||"");return t.jsxs(g,{className:"component-avatar",sx:{display:"flex",alignItems:"center",gap:i?"8px":"4px"},children:[!i&&t.jsx("span",{className:"dot"}),e?t.jsx(g,{children:u.includes(l)?t.jsx(le,{blocklet:e,size:r,style:{borderRadius:8}}):t.jsx(ze,{blocklet:e,ancestors:e.ancestors??[],size:r,style:{borderRadius:8}})}):t.jsx(
|
|
12
|
+
`;function fe({children:e=null,...r}){const s=Ge(),l=F().palette.mode==="dark";return t.jsxs(ot,{...r,children:[t.jsx("img",{src:`${s.imgPrefix}/${l?"all-done-dark":"all-done-light"}.svg`,alt:"All Done",width:120,height:120,style:{maxHeight:"100%",maxWidth:"100%"},onError:u=>{u.target.style.display="none"}}),t.jsx(g,{className:"empty-content",children:e})]})}fe.propTypes={color:n.string,children:n.any};at.propTypes={data:n.array,blockletMap:n.object,onReadBatch:n.func,inDialog:n.bool,highlightId:n.string,highlight:n.bool,type:n.oneOf(["server","service"])};ge.propTypes={notification:n.object,blocklet:n.object,onReadBatch:n.func,inDialog:n.bool,highlight:n.bool};P.propTypes={blocklet:n.object,size:n.number,showName:n.bool,hideDot:n.bool};function P({blocklet:e,size:r=40,showName:s=!1,hideDot:i=!1}){const l=e?.did||e?.meta?.did||"",u=(e?.alsoKnownAs||[]).concat(e?.appId||e?.appDid||e?.appPid||"");return t.jsxs(g,{className:"component-avatar",sx:{display:"flex",alignItems:"center",gap:i?"8px":"4px"},children:[!i&&t.jsx("span",{className:"dot"}),e?t.jsx(g,{children:u.includes(l)?t.jsx(le,{blocklet:e,size:r,style:{borderRadius:8}}):t.jsx(ze,{blocklet:e,ancestors:e.ancestors??[],size:r,style:{borderRadius:8}})}):t.jsx(Se,{width:r,height:r}),s&&t.jsx("span",{className:"component-name",children:e?.meta?.title})]})}function ge({notification:e,blocklet:r,onReadBatch:s=()=>{},inDialog:i=!1,highlight:l}){const{locale:u}=o.useContext(re),m=F(),d=Re(h=>h.breakpoints.down("md")),p=o.useRef(null),y=o.useMemo(()=>qe(e),[e]),v=o.useMemo(()=>Ve(e),[e]),b=o.useMemo(()=>V(e),[e]),k=o.useMemo(()=>e.items||[],[e]),C=o.useMemo(()=>k.length>0,[k]),$=o.useMemo(()=>v?C?k.map(h=>V(h)?h.actorInfo:{did:h.activity?.actor}).filter(Boolean):e.actorInfo??[]:[],[k,e.actorInfo,C,v]),w=o.useMemo(()=>r?.did||r?.meta?.did||"",[r]),a=o.useMemo(()=>_e(w,window.blocklet),[w]),x=O((h,S)=>{const A=Fe(h);if(A.length&&s(A.map(R=>R.id)),S&&!S.customPreventRedirect){const R=Oe(h,a);R&&typeof R=="string"&&window.open(R,"_blank","noopener,noreferrer")}});return t.jsxs(lt,{ref:p,className:"notification-row",id:e.id,isRead:y,inDialog:i,highlight:l,isMd:d,onClick:h=>x(e,h),children:[v?t.jsx(de,{activity:e.activity.type,size:d?24:32}):t.jsx(ce,{severity:e.severity,size:d?24:32}),t.jsxs(g,{className:"notification",sx:{display:"flex",flexDirection:"column",alignItems:"start"},children:[t.jsxs(g,{className:"header",sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:1,mb:1.5},children:[v&&b?t.jsx(K,{actors:$,teamDid:w,size:d?24:32,avatarFallback:t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32})}):t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32}),t.jsx(J,{value:e.createdAt,locale:u,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),v?t.jsx(pe,{notification:e,isMultiple:C,blocklet:r,mountPoint:a,avatarFallback:t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32})}):t.jsxs(t.Fragment,{children:[t.jsx(q,{variant:"body1",className:"title",sx:{color:"rgba(24, 24, 27, 1)",mt:0,mb:.5},children:e.title}),t.jsx(He,{notification:e,rows:i?0:2})]}),t.jsx(me,{notification:e})]}),e?.description&&e.severity==="error"&&t.jsx(g,{className:"copy-button",children:t.jsx(Ce,{size:"small",children:t.jsx($e,{sx:{fontSize:22},content:e?.description||""})})})]})}function at({data:e,blockletMap:r,onReadBatch:s=()=>{},inDialog:i=!1,highlightId:l,highlight:u=!1,type:m="service"}){const{t:d}=Q(),p=o.useRef(null),[y,v]=o.useState(!1),[b,k]=o.useState(!0),[C,$]=o.useState(!1),w=o.useRef(new Set),a=o.useRef(new Set),x=o.useRef(null),h=o.useRef(null),S=o.useRef(!1),A=o.useRef(null),R=o.useMemo(()=>i?e?.slice(0,5):e,[i,e]),z=o.useMemo(()=>De(R),[R]),L=o.useMemo(()=>{const c=new Map;return z&&z.length&&z.forEach(f=>{c.set(f.id,f)}),c},[z]);o.useEffect(()=>{const c=()=>{k(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",c),()=>{document.removeEventListener("visibilitychange",c)}},[]);const B=o.useCallback(()=>{if(!i&&w.current.size>0){const c=[];w.current.forEach(f=>{if(a.current.has(f))return;const I=L.get(f);if(I){const{receivers:T=[],items:N=[]}=I;if(T.length&&!T[0].read&&(c.push(f),a.current.add(f),N.length>0&&N.forEach(j=>{const M=j.id;M&&!a.current.has(M)&&(c.push(M),a.current.add(M))}),h.current)){const j=document.getElementById(f);j&&h.current.unobserve(j)}}}),c.length>0&&(s(c),setTimeout(()=>{v(!1)},300)),w.current.clear()}},[i,L,s]),X=o.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{B()},50)},[B]),E=o.useCallback(()=>{if(i||!p.current||!b)return;h.current&&h.current.disconnect();const c={root:null,rootMargin:"0px",threshold:.5},f=new IntersectionObserver(T=>{y&&T.forEach(N=>{const j=N.target.id;if(a.current.has(j))return;const M=L.get(j);if(M){const{receivers:Y=[]}=M;Y.length&&!Y[0].read&&(N.isIntersecting?(w.current.add(j),X()):w.current.delete(j))}})},c);h.current=f,Array.from(p.current.querySelectorAll(".notification-row")).filter(T=>{const N=T.id;if(a.current.has(N))return!1;const j=L.get(N);if(j){const{receivers:M=[]}=j;return M.length&&!M[0].read}return!1}).forEach(T=>{f.observe(T)}),S.current=!1},[y,i,b,L,X]);return o.useEffect(()=>{i||(S.current=!0,h.current&&b&&y&&setTimeout(()=>{E()},0))},[R,y,b,E,i]),o.useEffect(()=>{if(i||!p.current||!b)return;let c=window;if(m==="server"&&(c=document.getElementById("arc__dashboard-main")),!c){const I=document.getElementsByClassName("dashboard-main")[0];I&&(c=I)}if(!c)return;const f=I=>{I.isTrusted&&(y||v(!0),$(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{$(!1),B(),S.current&&E()},300))};return c.addEventListener("scroll",f,{passive:!0}),()=>{c.removeEventListener("scroll",f),x.current&&clearTimeout(x.current),A.current&&clearTimeout(A.current)}},[i,y,b,B,E,m]),o.useEffect(()=>(i||E(),()=>{h.current&&h.current.disconnect()}),[E,i]),Te(()=>{setTimeout(()=>{const c=Be(p.current),f=Pe(L,c);s(f.map(I=>I.id))},100)}),z?.length?t.jsx(g,{ref:p,sx:{display:"flex",flexDirection:"column",...i?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:z?.map(c=>{const f=c.source==="system"?r.get(c.entityId||c.sender):r.get(c.componentDid||c.sender);return c?.type?.toLowerCase()==="passthrough"?null:t.jsx(ge,{highlight:u&&l===c.id,inDialog:i,notification:c,blocklet:f,onReadBatch:s},c.id)})}):t.jsx(fe,{children:d("notification.allDone")})}const lt=Ae(g)`
|
|
13
13
|
@keyframes flash-bg {
|
|
14
14
|
0% {
|
|
15
15
|
background-color: ${e=>e.theme.palette.warning.light};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-react-Dvs43sk9.js";import{j as e,s as c,ak as a,b1 as i,W as l}from"./vendor-mui-core-
|
|
1
|
+
import"./vendor-react-Dvs43sk9.js";import{j as e,s as c,ak as a,b1 as i,W as l}from"./vendor-mui-core-BkVXEDpj.js";const t=c(a)(({theme:r})=>({backgroundColor:r.palette.background.default,"& .header-row":{display:"flex",justifyContent:"space-between",alignItems:"center",gap:r.spacing(1)},"& .right":{display:"flex",alignItems:"center",gap:r.spacing(1.5)},"& .tabs":{marginTop:r.spacing(2),"& .MuiButton-root":{border:"none",color:"#999","&.active":{color:"#222"}}},"@media (max-width: 900px)":{"& .header-row":{flexDirection:"column",alignItems:"flex-start"},"& .right":{flexDirection:"column",width:"100%",".search-always-open, .toolbar-btn-show, a, button, .MuiButtonGroup-root":{width:"100% !important"}}}}));function d({left:r=null,tabs:n=null,actions:s=null,...o}){return!r&&!n?e.jsx(t,{elevation:0,...o,children:e.jsxs(a,{className:"header-row",children:[e.jsx(a,{className:"left"}),e.jsx(i,{direction:"row",className:"right",children:s})]})}):r&&!n||!r&&n?e.jsx(t,{elevation:0,...o,children:e.jsxs(a,{className:"header-row",children:[e.jsx(a,{className:"left",children:r||n}),e.jsx(i,{direction:"row",className:"right",children:s})]})}):e.jsxs(t,{elevation:0,...o,children:[e.jsxs(a,{className:"header-row",children:[e.jsx(a,{className:"left",children:r}),e.jsx(i,{direction:"row",className:"right",children:s})]}),n&&e.jsx(a,{sx:{mt:2},children:n})]})}d.propTypes={left:l.node,tabs:l.node,actions:l.node};export{d as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./vendor-mui-core-BkVXEDpj.js";import"./vendor-react-Dvs43sk9.js";import{S as t}from"./studio-BtJ8IG1e.js";import"./vendor-ux-lckoR4gs.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./index-B19K9uJe.js";import"./index-BWTQhZ4U.js";import"./vendor-arcblock-Q5ECWsoh.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{at as fe,j as Y,W as te,J as Ye,bg as Xe,Q as Je,ak as _e,a6 as Le,cN as Ze,y as Fe,bb as We,M as Ue,cn as Qe,z as et}from"./vendor-mui-core-
|
|
1
|
+
import{at as fe,j as Y,W as te,J as Ye,bg as Xe,Q as Je,ak as _e,a6 as Le,cN as Ze,y as Fe,bb as We,M as Ue,cn as Qe,z as et}from"./vendor-mui-core-BkVXEDpj.js";import{u as tt}from"./useLocalStorage-DH_lecPn.js";import{p as De,a as it,d as rt,g as Ne,r as oe}from"./vendor-react-Dvs43sk9.js";import{d as st,n as Re}from"./vendor-utils-DtY42AM-.js";import{aC as nt,Z as $e,ap as ot}from"./index-BWTQhZ4U.js";import{T as at,D as Ae,F as ht,H as lt}from"./vendor-ux-lckoR4gs.js";import{B as ct}from"./bundle-avatar-DQcnLf3o.js";import"./vendor-arcblock-Q5ECWsoh.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";var ye={exports:{}},Be;function dt(){return Be||(Be=1,function(G,V){(function(j,K){G.exports=K()})(globalThis,()=>(()=>{var j={4567:function(R,s,o){var c=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=o(9042),d=o(9924),u=o(844),v=o(4725),h=o(2585),t=o(3656);let i=s.AccessibilityManager=class extends u.Disposable{constructor(e,r,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(p=>this._handleResize(p.rows))),this.register(this._terminal.onRender(p=>this._refreshRows(p.start,p.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(p=>this._handleChar(p))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
2
|
`))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let r=0;r<e;r++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,r){this._liveRegionDebouncer.refresh(e,r,this._terminal.rows)}_renderRows(e,r){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=r;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,r){const a=e.target,f=this._rowElements[r===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(r===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((r.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===a.node&&r.offset>a.offset)&&([r,a]=[a,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let A=E<b.length?b[E]:b.slice(-1)[0]+1;return A>=this._terminal.cols&&(++L,A=0),{row:L,column:A}},g=p(r),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=i=c([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],i)},3614:(R,s)=>{function o(d){return d.replace(/\r?\n/g,"\r")}function c(d,u){return u?"\x1B[200~"+d+"\x1B[201~":d}function _(d,u,v,h){d=c(d=o(d),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(d,!0),u.value=""}function n(d,u,v){const h=v.getBoundingClientRect(),t=d.clientX-h.left-10,i=d.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${i}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=c,s.copyHandler=function(d,u){d.clipboardData&&d.clipboardData.setData("text/plain",u.selectionText),d.preventDefault()},s.handlePasteEvent=function(d,u,v,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(d,u,v,h,t){n(d,u,v),t&&h.rightClickSelect(d),u.value=h.selectionText,u.select()}},7239:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,_,n){o.addEventListener(c,_,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(c,_,n))}}}},3551:function(R,s,o){var c=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),d=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(i,e,r,a,f){super(),this._element=i,this._mouseService=e,this._renderService=r,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const r=i.composedPath();for(let a=0;a<r.length;a++){const f=r[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(a=>{a?.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=i.y);let r=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(r=this._checkLinkProviderResult(a,i,r)):f.provideLinks(i.y,p=>{if(this._isMouseOut)return;const g=p?.map(l=>({link:l}));this._activeProviderReplies?.set(a,g),r=this._checkLinkProviderResult(a,i,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)})}_removeIntersectingLinks(i,e){const r=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<i?0:g.link.range.start.x,m=g.link.range.end.y>i?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(r.has(E)){f.splice(p--,1);break}r.add(E)}}}}_checkLinkProviderResult(i,e,r){if(!this._activeProviderReplies)return r;const a=this._activeProviderReplies.get(i);let f=!1;for(let p=0;p<i;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(g=>this._linkAtPosition(g.link,e));p&&(r=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(g){r=!0,this._handleNewLink(g);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;const a=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(i,e){const r=i.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-a-1,r.end.x,r.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(i,e){const r=i.range.start.y*this._bufferService.cols+i.range.start.x,a=i.range.end.y*this._bufferService.cols+i.range.end.x,f=e.y*this._bufferService.cols+e.x;return r<=f&&f<=a}_positionFromMouseEvent(i,e,r){const a=r.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,r,a,f){return{x1:i,y1:e,x2:r,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=c([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,s,o){var c=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),d=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,i){this._bufferService=h,this._optionsService=t,this._oscLinkService=i}provideLinks(h,t){const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void t(void 0);const e=[],r=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=i.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||i.hasContent(m)){if(i.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!r?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,A)=>r?r.activate(b,A,x):v(0,A),hover:(b,A)=>r?.hover?.(b,A,x),leave:(b,A)=>r?.leave?.(b,A,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e,A as s}from"./vendor-ux-lckoR4gs.js";const c=e("blocklet-services");s("blocklet-services");export{c as d};
|