@abtnode/blocklet-services 1.16.44-beta-20250520-004606-6cd8a0d3 → 1.16.44-beta-20250520-104453-912ed737

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.
Files changed (139) hide show
  1. package/dist/assets/{AdapterDayjs-D2uo6EnV.js → AdapterDayjs-Bck9Dv3l.js} +1 -1
  2. package/dist/assets/{ArrowDropDown-PfUV1pZb.js → ArrowDropDown-BleCy3ti.js} +1 -1
  3. package/dist/assets/{CheckCircle-zHdz-yvJ.js → CheckCircle-XrJDG94y.js} +1 -1
  4. package/dist/assets/{ChevronLeft-3zBX65MM.js → ChevronLeft-BlDLI-Qo.js} +1 -1
  5. package/dist/assets/{ChevronRight-BXgoqDfE.js → ChevronRight-DkPaON7R.js} +1 -1
  6. package/dist/assets/{DeleteOutline-BFB4Yy3c.js → DeleteOutline-Cj7UhBbF.js} +1 -1
  7. package/dist/assets/{Done-DboXobnH.js → Done-UEZFWnHj.js} +1 -1
  8. package/dist/assets/{Download-X3XR698Z.js → Download-CsoZ8yOi.js} +1 -1
  9. package/dist/assets/{Edit-Cl3SK-FJ.js → Edit-Bj4m2hpD.js} +1 -1
  10. package/dist/assets/{Error-CPi5ht0i.js → Error-BwUoSWOt.js} +1 -1
  11. package/dist/assets/{ExpandLess-D7OENe4H.js → ExpandLess-CjIzahHO.js} +1 -1
  12. package/dist/assets/{Google-Bl_7h7C7.js → Google-BON6upKi.js} +1 -1
  13. package/dist/assets/{InfoOutlined-BGorl_CI.js → InfoOutlined-uoMMChNE.js} +1 -1
  14. package/dist/assets/{Launch-5hxRq_We.js → Launch-rj4Kr2rA.js} +1 -1
  15. package/dist/assets/{LaunchOutlined-DCxTlWgy.js → LaunchOutlined-0gUfY-5D.js} +1 -1
  16. package/dist/assets/{MoreHoriz-Bncapj_R.js → MoreHoriz-3SNxR36h.js} +1 -1
  17. package/dist/assets/{PlayArrow-B19IPFeo.js → PlayArrow-BHO_DqT2.js} +1 -1
  18. package/dist/assets/{TuneOutlined-OuRuIP5i.js → TuneOutlined-BvtfOd23.js} +1 -1
  19. package/dist/assets/{ViewList-Bj0HBob4.js → ViewList-BvucdDXZ.js} +1 -1
  20. package/dist/assets/{access-control-BVDJgnnG.js → access-control-C9ZsDLlM.js} +1 -1
  21. package/dist/assets/{actions-B2RmHKJh.js → actions-BWSNMC_c.js} +1 -1
  22. package/dist/assets/{add-component-core-BLsjc3lE.js → add-component-core-Dd9KPcvp.js} +1 -1
  23. package/dist/assets/{add-resource-B0dZoJA8.js → add-resource-BHmsfuUO.js} +1 -1
  24. package/dist/assets/{addon-y9ZXCN0H.js → addon-CaGk2PdY.js} +1 -1
  25. package/dist/assets/{advanced-5oQIoiUN.js → advanced-DlILcrRl.js} +1 -1
  26. package/dist/assets/{appearance-58f9Dbcn.js → appearance-D1sGjeMk.js} +1 -1
  27. package/dist/assets/{audit-logs-fYqimPuZ.js → audit-logs-DfXh1JQZ.js} +1 -1
  28. package/dist/assets/{authorize-DC-SAlai.js → authorize-mEHpiCQH.js} +1 -1
  29. package/dist/assets/{base32-B42OVABo.js → base32-BnPQ4q4v.js} +1 -1
  30. package/dist/assets/{branding-DwHt5TFQ.js → branding-BHziMdwk.js} +2 -2
  31. package/dist/assets/{branding-eOJeN-jW.js → branding-CbgACClH.js} +2 -2
  32. package/dist/assets/{bundle-avatar-BoczFLNt.js → bundle-avatar-D7QQIJpo.js} +1 -1
  33. package/dist/assets/{button-C6SqoOU8.js → button-DXOAf3Np.js} +1 -1
  34. package/dist/assets/{click-to-copy-ClNoTzk4.js → click-to-copy-DtGgy9Ua.js} +1 -1
  35. package/dist/assets/{collapse-Dz_izL9k.js → collapse-iOiHn4dy.js} +1 -1
  36. package/dist/assets/{complete-B4rMuRkI.js → complete-CKdswLjZ.js} +1 -1
  37. package/dist/assets/{component-BzBSZbVF.js → component-amc-22MQ.js} +1 -1
  38. package/dist/assets/{config-tQft4lvg.js → config-B_jIm01w.js} +1 -1
  39. package/dist/assets/{config-CPFIXwk-.js → config-D3UduD_R.js} +1 -1
  40. package/dist/assets/{config-navigation-DdXZFw0Z.js → config-navigation-PoVJgHNU.js} +3 -3
  41. package/dist/assets/{config-space-CSZvQTns.js → config-space-D-DWHYER.js} +1 -1
  42. package/dist/assets/{confirm-hm6dpNbC.js → confirm-DaR0Yx39.js} +1 -1
  43. package/dist/assets/{connect-wIDYWNYf.js → connect-CVfkW49h.js} +1 -1
  44. package/dist/assets/connect-CvEHPjqh.js +5 -0
  45. package/dist/assets/{connect-to-Dwm_wvvo.js → connect-to-DrhAN5Nn.js} +1 -1
  46. package/dist/assets/{dashboard-BwU59vns.js → dashboard-B_QqB4aw.js} +3 -3
  47. package/dist/assets/{delete-confirm-BRkmB2tO.js → delete-confirm-DHB0S_Co.js} +1 -1
  48. package/dist/assets/{did-address-Ddg6Is1P.js → did-address-mv0Qw7hC.js} +1 -1
  49. package/dist/assets/domain-BR9srj-p.js +9 -0
  50. package/dist/assets/{domain-action-card-BnxgZfnv.js → domain-action-card-DtwNOaxH.js} +1 -1
  51. package/dist/assets/domains-Bg_t1pz-.js +1 -0
  52. package/dist/assets/dot-D3X4DSlo.js +7 -0
  53. package/dist/assets/{email-DhpxVPpg.js → email-DiuMAA8U.js} +1 -1
  54. package/dist/assets/{exchange-passport-3R6TCPya.js → exchange-passport-Bcw--2wm.js} +1 -1
  55. package/dist/assets/{fuel-C3Ao9T8_.js → fuel-BitXgq2D.js} +1 -1
  56. package/dist/assets/{gen-access-key-B5etX4Ba.js → gen-access-key-CrHniwdW.js} +1 -1
  57. package/dist/assets/{get-safe-url-DP-rZc23.js → get-safe-url-BRocR2aJ.js} +1 -1
  58. package/dist/assets/{get-safe-url-XcLmS0yc.js → get-safe-url-DYtntqqo.js} +1 -1
  59. package/dist/assets/{home-DtuKHXKD.js → home-jh95SgT7.js} +1 -1
  60. package/dist/assets/{iframe-BHwYGTAS.js → iframe-BlPuY8Pu.js} +1 -1
  61. package/dist/assets/{index-CmOE3ceE.js → index-BDcuaL48.js} +1 -1
  62. package/dist/assets/{index-DaoLXOw4.js → index-BO7CJLK3.js} +1 -1
  63. package/dist/assets/{index-CVDucF7E.js → index-BWshat_T.js} +1 -1
  64. package/dist/assets/{index-B6jePIag.js → index-BXkKeWVW.js} +1 -1
  65. package/dist/assets/{index-ToeWiBUL.js → index-B_y3Xcdb.js} +1 -1
  66. package/dist/assets/{index-DBsI6F1Z.js → index-Bi-YrbEk.js} +3 -3
  67. package/dist/assets/{index-Cb7iBSvd.js → index-Bv8sds6g.js} +1 -1
  68. package/dist/assets/{index-BKdJfp9x.js → index-CZOVduSH.js} +1 -1
  69. package/dist/assets/{index-Cd3oZl-N.js → index-Cgdb1aGn.js} +4 -4
  70. package/dist/assets/{index-C61DBznM.js → index-CleFkLt8.js} +1 -1
  71. package/dist/assets/{index-CFtGBtAw.js → index-CqRVUIz0.js} +1 -1
  72. package/dist/assets/{index-Dm4t4XH1.js → index-D0TzEmpA.js} +1 -1
  73. package/dist/assets/{index-DAEEDx1o.js → index-D3Od1Ju7.js} +1 -1
  74. package/dist/assets/{index-ND58NXzr.js → index-DO4zGWKz.js} +1 -1
  75. package/dist/assets/{index-C5_3pYA_.js → index-DYlN9Brg.js} +1 -1
  76. package/dist/assets/{index-kszsTfNH.js → index-RDZtjGNC.js} +1 -1
  77. package/dist/assets/{index-BzItMezw.js → index-YuW8IExe.js} +4 -4
  78. package/dist/assets/{index-sAnn-Wqb.js → index-c0hdujdn.js} +1 -1
  79. package/dist/assets/{index-BULZWXKq.js → index-hjv3dFXZ.js} +1 -1
  80. package/dist/assets/{invitation-qFWETxSc.js → invitation-BtuI3wbb.js} +1 -1
  81. package/dist/assets/{invite-Bg2Azggi.js → invite-CelTXbxx.js} +1 -1
  82. package/dist/assets/{issue-passport-DtnZs7_A.js → issue-passport-DGinrMdr.js} +1 -1
  83. package/dist/assets/{item-BYt6Ny1o.js → item-BhN-qZd_.js} +1 -1
  84. package/dist/assets/{landing-page-BiznyWTw.js → landing-page-D_TLvQ3s.js} +1 -1
  85. package/dist/assets/{layout-DE99yYfx.js → layout-0pbi4f6l.js} +1 -1
  86. package/dist/assets/{list-BkVwpX1t.js → list-C_1TcitB.js} +1 -1
  87. package/dist/assets/{list-UaF9rEdO.js → list-DKIkIMue.js} +2 -2
  88. package/dist/assets/localization-CpjVJ6VE.js +1 -0
  89. package/dist/assets/{log-D-KC9F0b.js → log-DnUF9orj.js} +1 -1
  90. package/dist/assets/{logger-GX3OECJW.js → logger-jMgD3u5g.js} +1 -1
  91. package/dist/assets/{login-D5-7Lt94.js → login-Boq_S2S7.js} +1 -1
  92. package/dist/assets/{login-oauth-callback-PDI2Klq3.js → login-oauth-callback-CuSXnq1m.js} +1 -1
  93. package/dist/assets/{logo-uploader-BNZB1sug.js → logo-uploader-DtAT8iaJ.js} +4 -4
  94. package/dist/assets/{lost-passport-kNOXw46l.js → lost-passport-DuJeKcGu.js} +1 -1
  95. package/dist/assets/{open-window-BEzzIgKH.js → open-window-DXP1LoPD.js} +1 -1
  96. package/dist/assets/{overview-qlJHwq1E.js → overview-DHcHPq6g.js} +1 -1
  97. package/dist/assets/{page-header-D9UEVC59.js → page-header-PO_g4wSK.js} +1 -1
  98. package/dist/assets/{passport-item-C7W2OqHa.js → passport-item-NMGbWwTG.js} +1 -1
  99. package/dist/assets/{permission-KYy-A4oZ.js → permission-BfddnDBs.js} +1 -1
  100. package/dist/assets/{preferences-DXEo6kgA.js → preferences-Nt4L8Zgv.js} +1 -1
  101. package/dist/assets/{profile-embed-faK_BKhI.js → profile-embed-C9nHKFrf.js} +1 -1
  102. package/dist/assets/{publish-resource-D8YEMAlU.js → publish-resource-BL83FldI.js} +1 -1
  103. package/dist/assets/{react-beautiful-dnd.esm-vpuu2z51.js → react-beautiful-dnd.esm-0e7VDGmi.js} +1 -1
  104. package/dist/assets/{runtime-CKW1HKn_.js → runtime-FDEoUn52.js} +1 -1
  105. package/dist/assets/sdk-CytUSheP.js +1 -0
  106. package/dist/assets/{security-Dt3PKq-c.js → security-BuN2nUoZ.js} +1 -1
  107. package/dist/assets/{session-CSqVp1zS.js → session-DUt5rVEy.js} +1 -1
  108. package/dist/assets/{setup-BlQH2Z6r.js → setup-BB0XLqW9.js} +3 -3
  109. package/dist/assets/{spaces-rexKSkSX.js → spaces-MprwX1Iq.js} +1 -1
  110. package/dist/assets/{start-_8paEixr.js → start-C7CIzLBY.js} +1 -1
  111. package/dist/assets/{starting-progress-CvmzmBMV.js → starting-progress-BJCVRFkE.js} +1 -1
  112. package/dist/assets/{status-BDhcfo0L.js → status-Bo92foK0.js} +1 -1
  113. package/dist/assets/{step-actions-iPiCkXbU.js → step-actions-D__rjlW_.js} +1 -1
  114. package/dist/assets/{studio-A7rMh4Xk.js → studio-kVKG7W3n.js} +1 -1
  115. package/dist/assets/{switch-control-BmaFq4ZK.js → switch-control-BgwZFVCJ.js} +1 -1
  116. package/dist/assets/{table-tips-DnNYXRDB.js → table-tips-nPiIcvAy.js} +1 -1
  117. package/dist/assets/{traffic-BMZEqBnG.js → traffic-Cd92p-Xb.js} +1 -1
  118. package/dist/assets/{transfer-2aML1rIB.js → transfer-U9z5JNMl.js} +1 -1
  119. package/dist/assets/{unsubscribe-BuBJl9gX.js → unsubscribe-BmAshFCd.js} +1 -1
  120. package/dist/assets/{use-blocklet-logo-2Y2A06qi.js → use-blocklet-logo-3VH4RBTr.js} +1 -1
  121. package/dist/assets/useAsync-CDjYBiwf.js +1 -0
  122. package/dist/assets/useAsync-dC0jHVWO.js +1 -0
  123. package/dist/assets/{useLocalStorage-BFO9aBYY.js → useLocalStorage-DotMjDUB.js} +1 -1
  124. package/dist/assets/{user-center-gbex4PJG.js → user-center-8aoMSkJ_.js} +1 -1
  125. package/dist/assets/{util-DMDaTiE0.js → util-CiTimo-i.js} +1 -1
  126. package/dist/assets/{util-xFBxHmZK.js → util-CuK9uaNS.js} +1 -1
  127. package/dist/assets/{vendor-arcblock-C99E80cF.js → vendor-arcblock-Ca95GLVH.js} +8 -22
  128. package/dist/assets/{vendor-ux-did-connect-Qap4yrMu.js → vendor-ux-did-connect-D0L9YnHn.js} +5 -5
  129. package/dist/assets/{wrap-locale-C4cvZ4CE.js → wrap-locale-QBHz1ECC.js} +1 -1
  130. package/dist/index.html +3 -3
  131. package/dist/service-worker.js +1 -1
  132. package/package.json +31 -31
  133. package/dist/assets/connect-BeFPxq9a.js +0 -5
  134. package/dist/assets/domain-hqA29r7o.js +0 -9
  135. package/dist/assets/domains-BkjwRhdu.js +0 -1
  136. package/dist/assets/dot-CdVWOAIG.js +0 -7
  137. package/dist/assets/localization-CTcPOuKl.js +0 -1
  138. package/dist/assets/sdk-B_abqbXe.js +0 -1
  139. package/dist/assets/useAsync-JBeeXlrl.js +0 -1
@@ -1 +1 @@
1
- import{j as e,T as w,be as y,e as P,v as z,aa as n,H as t}from"./vendor-mui-core-Bh-qMRq3.js";import{h as A,be as C,bf as E,X as j,bg as L}from"./vendor-ux-did-connect-Qap4yrMu.js";import{s as M}from"./vendor-arcblock-C99E80cF.js";import{f as R}from"./vendor-hooks-DpwFseeF.js";function H({linkProps:r,showExtra:o,...a}){return e.jsxs(w,{...a,children:["Powered by"," ",e.jsx(y,{href:"https://www.arcblock.io",target:"_blank",...r,children:"ArcBlock"}),"'s"," ",e.jsx(y,{href:"https://www.blocklet.io",target:"_blank",...r,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function k({did:r,children:o,title:a,description:d,actions:u,logo:i,logoSize:c,poweredBy:x,termsOfUse:m,standalone:v}){const s=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{},{palette:g}=P(),f=z(l=>l.breakpoints.down("lg")),I=M({meta:s}),T=R(()=>{const l=s.appPid,b=A.isEthereumDid(l),D=b?void 0:C(l);return b?E(l):D.color},[s==null?void 0:s.appPid]);if(!r)return o;a===void 0&&(a=s.appName),d===void 0&&(d=s.appDescription),i===void 0&&(i=I||""),typeof i=="string"&&(i?i=e.jsx(n,{sx:{height:c,maxHeight:c,objectFit:"contain"},component:"img",src:i,alt:`${s.appName}'s logo`}):i=e.jsx(j,{size:c,did:r,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx(H,{linkProps:{color:g.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!f,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!f&&(p=e.jsx(n,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:r,variant:"rounded"})}));const B=!!o;let h=!v;return f&&(h=!B),e.jsxs(n,{sx:{width:"100vw",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, ${L(T,.3)} 10%, ${g.background.default} 50%)`,position:"relative"},children:[e.jsxs(n,{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(n,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(n,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(w,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:a}),d?e.jsx(n,{variant:"h5",sx:{mb:2,color:"text.secondary"},children:d}):null,u?e.jsx(n,{sx:{mt:8},children:u}):null,m?e.jsx(n,{sx:{mt:-1,color:"grey"},children:m}):null]}):null,p]}),e.jsx(n,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}k.propTypes={did:t.string.isRequired,children:t.any.isRequired,title:t.any,description:t.any,logo:t.any,logoSize:t.number,actions:t.any,poweredBy:t.any,termsOfUse:t.any,standalone:t.bool};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:50,standalone:!1};export{k as L};
1
+ import{j as e,T as w,be as y,e as P,v as z,aa as n,H as t}from"./vendor-mui-core-Bh-qMRq3.js";import{h as A,be as C,bf as E,X as j,bg as L}from"./vendor-ux-did-connect-D0L9YnHn.js";import{s as M}from"./vendor-arcblock-Ca95GLVH.js";import{f as R}from"./vendor-hooks-DpwFseeF.js";function H({linkProps:r,showExtra:o,...a}){return e.jsxs(w,{...a,children:["Powered by"," ",e.jsx(y,{href:"https://www.arcblock.io",target:"_blank",...r,children:"ArcBlock"}),"'s"," ",e.jsx(y,{href:"https://www.blocklet.io",target:"_blank",...r,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function k({did:r,children:o,title:a,description:d,actions:u,logo:i,logoSize:c,poweredBy:x,termsOfUse:m,standalone:v}){const s=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{},{palette:g}=P(),f=z(l=>l.breakpoints.down("lg")),I=M({meta:s}),T=R(()=>{const l=s.appPid,b=A.isEthereumDid(l),D=b?void 0:C(l);return b?E(l):D.color},[s==null?void 0:s.appPid]);if(!r)return o;a===void 0&&(a=s.appName),d===void 0&&(d=s.appDescription),i===void 0&&(i=I||""),typeof i=="string"&&(i?i=e.jsx(n,{sx:{height:c,maxHeight:c,objectFit:"contain"},component:"img",src:i,alt:`${s.appName}'s logo`}):i=e.jsx(j,{size:c,did:r,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx(H,{linkProps:{color:g.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!f,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!f&&(p=e.jsx(n,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:r,variant:"rounded"})}));const B=!!o;let h=!v;return f&&(h=!B),e.jsxs(n,{sx:{width:"100vw",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, ${L(T,.3)} 10%, ${g.background.default} 50%)`,position:"relative"},children:[e.jsxs(n,{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(n,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(n,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(w,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:a}),d?e.jsx(n,{variant:"h5",sx:{mb:2,color:"text.secondary"},children:d}):null,u?e.jsx(n,{sx:{mt:8},children:u}):null,m?e.jsx(n,{sx:{mt:-1,color:"grey"},children:m}):null]}):null,p]}),e.jsx(n,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}k.propTypes={did:t.string.isRequired,children:t.any.isRequired,title:t.any,description:t.any,logo:t.any,logoSize:t.number,actions:t.any,poweredBy:t.any,termsOfUse:t.any,standalone:t.bool};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:50,standalone:!1};export{k as L};
@@ -1,4 +1,4 @@
1
- import{j as r,ah as m}from"./vendor-mui-core-Bh-qMRq3.js";import{C as c}from"./content-layout--sy9JlYZ.js";import{a as p,Y as s}from"./vendor-ux-did-connect-Qap4yrMu.js";import{c as i}from"./vendor-arcblock-C99E80cF.js";import{I as u}from"./index-BzItMezw.js";const d=m(c)`
1
+ import{j as r,ah as m}from"./vendor-mui-core-Bh-qMRq3.js";import{C as c}from"./content-layout--sy9JlYZ.js";import{a as p,Y as s}from"./vendor-ux-did-connect-D0L9YnHn.js";import{c as i}from"./vendor-arcblock-Ca95GLVH.js";import{I as u}from"./index-YuW8IExe.js";const d=m(c)`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{r as p}from"./vendor-react-DEoibe3W.js";import{H as o,j as r,bc as ee,e as M,be as ae,aa as h,ah as L,T as S,v as W,X as le,bK as Me,ad as tt,bL as rt,aq as nt,ai as st,a9 as $e,m as it,bY as ot,y as at,s as lt,I as ct}from"./vendor-mui-core-Bh-qMRq3.js";import{f as z,u as se,m as dt}from"./vendor-hooks-DpwFseeF.js";import{a as ce,V as ut,h as pt,aI as ht,j as Pe,y as B,W as de,b1 as ue,b5 as ft,r as Ae,I as Ne,bh as mt}from"./vendor-ux-did-connect-Qap4yrMu.js";import{S as gt}from"./index-C849wD9b.js";import{B as xt}from"./bundle-avatar-BoczFLNt.js";import{a as yt,g as pe,b as he,c as U,s as Q,H as vt,u as ze,M as Le,d as X,e as bt,m as jt,i as wt}from"./use-blocklet-logo-2Y2A06qi.js";import{A as O,ag as kt,z as De,b as D,a0 as Rt}from"./vendor-utils-rHXShPKm.js";import{u as Y,p as It,h as J,f as Ee,w as Tt}from"./vendor-arcblock-C99E80cF.js";import{d as Ct}from"./InfoOutlined-BGorl_CI.js";import{d as St}from"./CheckCircle-zHdz-yvJ.js";import{U as Mt,C as $t,I as Pt}from"./index-sAnn-Wqb.js";import{p as At}from"./util-DMDaTiE0.js";import{A as Nt}from"./index-BzItMezw.js";function fe({blocklet:e,style:t,size:s,...n}){const a=yt({blocklet:e,square:!0}),{variant:c}=n;return r.jsx(ee,{variant:c||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:r.jsx("img",{src:a,alt:"",style:{width:s}})})}fe.propTypes={blocklet:o.object.isRequired,style:o.object,size:o.oneOfType([o.number,o.string])};fe.defaultProps={style:{},size:40};function zt(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function te({value:e,shouldUpdate:t=!1,...s}){const{locale:n}=ce(),[a,c]=p.useState(0);if(p.useEffect(()=>{let l;if(t){const u=new Date(e).getTime(),y=Date.now(),m=Math.abs(Math.floor((u-y)/1e3)),b=()=>{c(j=>{const k=Math.random()*1e3;return parseFloat((j+k).toFixed(4))})};m<60?l=setInterval(b,1e3):m<60*60?l=setInterval(b,6e4):l=setInterval(b,36e5)}return()=>{clearInterval(l)}},[e,a,t]),!e)return"-";const i=zt(e);return r.jsx(ut,{value:i,locale:n,...s})}te.propTypes={value:o.any,shouldUpdate:o.bool};te.defaultProps={value:"",shouldUpdate:!1};const Lt=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Dt=e=>e.every(t=>t.type==="text"),Et=e=>e.every(t=>t.type==="image"),_t=e=>kt(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(s=>{var n,a,c;return(c=(a=(n=s==null?void 0:s.data)==null?void 0:n.text)==null?void 0:a.trim)==null?void 0:c.call(a)})),Ht=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(s=>s.type===t)},qt=(e,t)=>{try{const s=pt.toTypeInfo(e);if(!(s.role!==void 0&&s.role!==ht.types.RoleType.ACCOUNT))return;const a=O(Pe.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return De(a,{did:e,locale:t})}catch(s){console.error(s);return}},Wt=(e,t)=>{var n;const s=(n=t==null?void 0:t.componentMountPoints)==null?void 0:n.find(a=>a.did===e);return s==null?void 0:s.mountPoint},Ut=(e,t)=>{var a,c,i;if(!e)return null;if(((a=e.actions)==null?void 0:a.length)===1)return e.actions[0].link||null;const s=pe(e.activity),n=(s==null?void 0:s.metaLink)||(s==null?void 0:s.targetLink);if(n)return he(n)?n:O(t,n);if(((c=e.attachments)==null?void 0:c.length)===1){const l=e.attachments[0];if(l.type==="link")return((i=l.data)==null?void 0:i.url)||null}return null},ie=e=>{const{receivers:t=[]}=e;return t.length?t.every(s=>s.read):!0};function Bt(e){const t=e.getBoundingClientRect(),s=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,a=t.height,c=t.width;let i=0;t.top>=0&&t.bottom<=n?i=a:t.top<0&&t.bottom>0&&t.bottom<=n?i=t.bottom:t.top>=0&&t.top<n&&t.bottom>n?i=n-t.top:t.top<0&&t.bottom>n&&(i=n);let l=0;return t.left>=0&&t.right<=s?l=c:t.left<0&&t.right>0&&t.right<=s?l=t.right:t.left>=0&&t.left<s&&t.right>s?l=s-t.left:t.left<0&&t.right>s&&(l=s),i*l/(a*c)>=.5}const Ot=e=>{if(!e)return[];const t=[],s=5,n=Array.from(e.querySelectorAll(".notification-row")),a=n.length;for(let c=0;c<a;c+=s){const i=n.slice(c,c+s);let l=!0;for(const u of i){const y=u.id;if(Bt(u))t.push(y);else{l=!1;break}}if(!l)break}return t},_e=e=>{var s;const t=[];return e&&((s=e.items)!=null&&s.length?e.items.forEach(n=>{ie(n)||t.push(n)}):ie(e)||t.push(e)),t},Ft=(e,t)=>{let s=[];return t.length&&t.forEach(n=>{const a=e.get(n);a&&(s=s.concat(_e(a)))}),s},E=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),F=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`/.well-known/service/proxy?url=${e}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function He({attachment:e}){const{data:t}=e,s=M();let n="";try{n=new URL(t.url).host}catch{n=t.url}return r.jsxs(ae,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:a=>{a.customPreventRedirect=!0},children:[!!n&&r.jsx("span",{className:"url",children:n}),!!t.title&&r.jsx(h,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&r.jsx(h,{className:"description",style:{whiteSpace:"unset",color:s.palette.text.secondary},children:t.description}),!!t.image&&r.jsx(B,{src:Y.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.image))})]})}He.propTypes={attachment:o.object.isRequired};function qe({attachment:e}){const{data:t}=e;return r.jsx(B,{src:Y.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.url))})}qe.propTypes={attachment:o.object.isRequired};function We({attachment:e,...t}){var l;const{data:s}=e,n=((l=s.color)==null?void 0:l.toLowerCase())||t.color,a=s.size||t.size,c=s.fontWeight||t.fontWeight||400;let i="14px";return a==="small"?i="12px":a==="normal"?i="14px":a==="big"?i="16px":a==="large"&&(i="18px"),r.jsx(Vt,{className:"title",style:{fontSize:i,color:n,whiteSpace:"unset",fontWeight:c},children:s.text})}We.propTypes={attachment:o.object.isRequired};const Vt=L.span`
1
+ import{r as p}from"./vendor-react-DEoibe3W.js";import{H as o,j as r,bc as ee,e as M,be as ae,aa as h,ah as L,T as S,v as W,X as le,bK as Me,ad as tt,bL as rt,aq as nt,ai as st,a9 as $e,m as it,bY as ot,y as at,s as lt,I as ct}from"./vendor-mui-core-Bh-qMRq3.js";import{f as z,u as se,m as dt}from"./vendor-hooks-DpwFseeF.js";import{a as ce,V as ut,h as pt,aI as ht,j as Pe,y as B,W as de,b1 as ue,b5 as ft,r as Ae,I as Ne,bh as mt}from"./vendor-ux-did-connect-D0L9YnHn.js";import{S as gt}from"./index-C849wD9b.js";import{B as xt}from"./bundle-avatar-D7QQIJpo.js";import{a as yt,g as pe,b as he,c as U,s as Q,H as vt,u as ze,M as Le,d as X,e as bt,m as jt,i as wt}from"./use-blocklet-logo-3VH4RBTr.js";import{A as O,ag as kt,z as De,b as D,a0 as Rt}from"./vendor-utils-rHXShPKm.js";import{u as Y,p as It,h as J,f as Ee,w as Tt}from"./vendor-arcblock-Ca95GLVH.js";import{d as Ct}from"./InfoOutlined-uoMMChNE.js";import{d as St}from"./CheckCircle-XrJDG94y.js";import{U as Mt,C as $t,I as Pt}from"./index-c0hdujdn.js";import{p as At}from"./util-CiTimo-i.js";import{A as Nt}from"./index-YuW8IExe.js";function fe({blocklet:e,style:t,size:s,...n}){const a=yt({blocklet:e,square:!0}),{variant:c}=n;return r.jsx(ee,{variant:c||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:r.jsx("img",{src:a,alt:"",style:{width:s}})})}fe.propTypes={blocklet:o.object.isRequired,style:o.object,size:o.oneOfType([o.number,o.string])};fe.defaultProps={style:{},size:40};function zt(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function te({value:e,shouldUpdate:t=!1,...s}){const{locale:n}=ce(),[a,c]=p.useState(0);if(p.useEffect(()=>{let l;if(t){const u=new Date(e).getTime(),y=Date.now(),m=Math.abs(Math.floor((u-y)/1e3)),b=()=>{c(j=>{const k=Math.random()*1e3;return parseFloat((j+k).toFixed(4))})};m<60?l=setInterval(b,1e3):m<60*60?l=setInterval(b,6e4):l=setInterval(b,36e5)}return()=>{clearInterval(l)}},[e,a,t]),!e)return"-";const i=zt(e);return r.jsx(ut,{value:i,locale:n,...s})}te.propTypes={value:o.any,shouldUpdate:o.bool};te.defaultProps={value:"",shouldUpdate:!1};const Lt=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Dt=e=>e.every(t=>t.type==="text"),Et=e=>e.every(t=>t.type==="image"),_t=e=>kt(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(s=>{var n,a,c;return(c=(a=(n=s==null?void 0:s.data)==null?void 0:n.text)==null?void 0:a.trim)==null?void 0:c.call(a)})),Ht=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(s=>s.type===t)},qt=(e,t)=>{try{const s=pt.toTypeInfo(e);if(!(s.role!==void 0&&s.role!==ht.types.RoleType.ACCOUNT))return;const a=O(Pe.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return De(a,{did:e,locale:t})}catch(s){console.error(s);return}},Wt=(e,t)=>{var n;const s=(n=t==null?void 0:t.componentMountPoints)==null?void 0:n.find(a=>a.did===e);return s==null?void 0:s.mountPoint},Ut=(e,t)=>{var a,c,i;if(!e)return null;if(((a=e.actions)==null?void 0:a.length)===1)return e.actions[0].link||null;const s=pe(e.activity),n=(s==null?void 0:s.metaLink)||(s==null?void 0:s.targetLink);if(n)return he(n)?n:O(t,n);if(((c=e.attachments)==null?void 0:c.length)===1){const l=e.attachments[0];if(l.type==="link")return((i=l.data)==null?void 0:i.url)||null}return null},ie=e=>{const{receivers:t=[]}=e;return t.length?t.every(s=>s.read):!0};function Bt(e){const t=e.getBoundingClientRect(),s=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,a=t.height,c=t.width;let i=0;t.top>=0&&t.bottom<=n?i=a:t.top<0&&t.bottom>0&&t.bottom<=n?i=t.bottom:t.top>=0&&t.top<n&&t.bottom>n?i=n-t.top:t.top<0&&t.bottom>n&&(i=n);let l=0;return t.left>=0&&t.right<=s?l=c:t.left<0&&t.right>0&&t.right<=s?l=t.right:t.left>=0&&t.left<s&&t.right>s?l=s-t.left:t.left<0&&t.right>s&&(l=s),i*l/(a*c)>=.5}const Ot=e=>{if(!e)return[];const t=[],s=5,n=Array.from(e.querySelectorAll(".notification-row")),a=n.length;for(let c=0;c<a;c+=s){const i=n.slice(c,c+s);let l=!0;for(const u of i){const y=u.id;if(Bt(u))t.push(y);else{l=!1;break}}if(!l)break}return t},_e=e=>{var s;const t=[];return e&&((s=e.items)!=null&&s.length?e.items.forEach(n=>{ie(n)||t.push(n)}):ie(e)||t.push(e)),t},Ft=(e,t)=>{let s=[];return t.length&&t.forEach(n=>{const a=e.get(n);a&&(s=s.concat(_e(a)))}),s},E=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),F=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`/.well-known/service/proxy?url=${e}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function He({attachment:e}){const{data:t}=e,s=M();let n="";try{n=new URL(t.url).host}catch{n=t.url}return r.jsxs(ae,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:a=>{a.customPreventRedirect=!0},children:[!!n&&r.jsx("span",{className:"url",children:n}),!!t.title&&r.jsx(h,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&r.jsx(h,{className:"description",style:{whiteSpace:"unset",color:s.palette.text.secondary},children:t.description}),!!t.image&&r.jsx(B,{src:Y.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.image))})]})}He.propTypes={attachment:o.object.isRequired};function qe({attachment:e}){const{data:t}=e;return r.jsx(B,{src:Y.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.url))})}qe.propTypes={attachment:o.object.isRequired};function We({attachment:e,...t}){var l;const{data:s}=e,n=((l=s.color)==null?void 0:l.toLowerCase())||t.color,a=s.size||t.size,c=s.fontWeight||t.fontWeight||400;let i="14px";return a==="small"?i="12px":a==="normal"?i="14px":a==="big"?i="16px":a==="large"&&(i="18px"),r.jsx(Vt,{className:"title",style:{fontSize:i,color:n,whiteSpace:"unset",fontWeight:c},children:s.text})}We.propTypes={attachment:o.object.isRequired};const Vt=L.span`
2
2
  width: 100%;
3
3
  display: -webkit-box;
4
4
  -webkit-box-orient: vertical;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DBsI6F1Z.js","assets/vendor-ux-did-connect-Qap4yrMu.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-mui-core-Bh-qMRq3.js","assets/vendor-hooks-DpwFseeF.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-C99E80cF.js","assets/index-Bs1kxR8_.js","assets/index-BzItMezw.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as b,b as ve}from"./vendor-react-DEoibe3W.js";import{a as F,d as H,j as K,Y as M,X as ne,V as $,b3 as ye,a5 as Ce,_ as we}from"./vendor-ux-did-connect-Qap4yrMu.js";import{H as n,j as e,D as G,aj as X,I as Q,t as Y,al as z,T as I,aa as p,O as T,bq as y,bK as Te,bQ as oe,bs as se,bR as ae,X as J,ak as ce,z as ue,y as E,ab as Z,ad as ke}from"./vendor-mui-core-Bh-qMRq3.js";import{O as de,_ as Se}from"./vendor-arcblock-C99E80cF.js";import{d as Ie}from"./Edit-Cl3SK-FJ.js";import{_ as Re}from"./dot-CdVWOAIG.js";import{l as pe}from"./index-C5_3pYA_.js";import{A as _,ay as he,az as S,D as qe}from"./index-BzItMezw.js";import{u as B}from"./dashboard-BwU59vns.js";import{o as Ae,c as Oe,A as re}from"./vendor-utils-rHXShPKm.js";import{E as Pe}from"./empty-spinner-BZw_ShnT.js";import{C as v}from"./click-to-copy-ClNoTzk4.js";import{D as Ne}from"./delete-confirm-BRkmB2tO.js";import{b as We}from"./passport-item-C7W2OqHa.js";import{A as ze}from"./actions-B2RmHKJh.js";import{T as le}from"./table-tips-DnNYXRDB.js";import{u as De}from"./use-mobile-JEGQfLZ2.js";import"./vendor-hooks-DpwFseeF.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-JBeeXlrl.js";import"./useLocalStorage-BFO9aBYY.js";import"./index-8eXqqyHQ.js";import"./confirm-hm6dpNbC.js";import"./PlayArrow-B19IPFeo.js";import"./get-safe-url-XcLmS0yc.js";import"./session-CSqVp1zS.js";import"./use-blocklet-logo-2Y2A06qi.js";import"./InfoOutlined-BGorl_CI.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-ZAS6Si4t.js";import"./index-sAnn-Wqb.js";import"./Phone--BSu-btI.js";import"./Location-By12Z3Te.js";import"./Email-CdSNK0eA.js";import"./Timezone-YZ0dMUEr.js";import"./did-address-Ddg6Is1P.js";import"./util-DMDaTiE0.js";import"./base32-B42OVABo.js";import"./MoreHoriz-Bncapj_R.js";const Le={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function me({onCreated:r,onClose:d}){const[t,m]=b.useState(!1),{t:l,locale:s}=F(),{api:g}=_(),{teamDid:h}=B(),{control:f,handleSubmit:A,formState:{errors:a},watch:k,setValue:x}=he({defaultValues:Le,mode:"onChange"}),w=k("scope"),R=c=>{c!=="profile:read"&&x("scope",w.includes(c)?w.filter(u=>u!==c):[...w,c])},N=async c=>{m(!0);try{const u={...c,redirectUris:c.redirectUris,contacts:c.contacts?c.contacts.split(",").map(O=>O.trim()):[],scope:c.scope.join(" ")};await g.createOAuthClient({input:{teamDid:h,input:Ae(u,Oe)}}),r(u)}catch(u){M.error(u.message||"Failed to create OAuth App")}finally{m(!1)}};return e.jsxs(G,{open:!0,onClose:d,maxWidth:"md",fullWidth:!0,children:[e.jsxs(X,{children:[l("oauth.client.register")," ",e.jsx(Q,{onClick:d,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsxs(z,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:f,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!a.clientName,helperText:(u=a.clientName)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:f,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!a.clientUri,helperText:(u=a.clientUri)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:f,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!a.redirectUris,helperText:(u=a.redirectUris)==null?void 0:u.message}),e.jsxs(p,{sx:{display:"flex",gap:"2px"},children:[e.jsx(y,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(y,{children:l("oauth.client.helperText.read")}),e.jsx(y,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(y,{children:l("oauth.client.helperText.more")})]})]})}})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(K.OAUTH_SCOPES).map(([c,u])=>e.jsx(se,{control:e.jsx(ae,{checked:w.includes(c),onChange:()=>R(c),disabled:c==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:u})})},c))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(z,{children:e.jsx(S,{name:"contacts",control:f,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!a.contacts,helperText:(u=a.contacts)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.contacts")})]})}})}),e.jsxs(z,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:c})=>{var u;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!a.tosUri,helperText:(u=a.tosUri)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:c})=>{var u;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!a.policyUri,helperText:(u=a.policyUri)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.policyUri")})]})}})]}),a.error&&e.jsx(ce,{severity:"error",children:a.error.message})]})}),e.jsxs(ue,{children:[e.jsx(E,{onClick:d,children:l("common.cancel")}),e.jsxs(E,{onClick:A(N),disabled:t,variant:"contained",color:"primary",children:[t?e.jsx(Z,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}me.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function V({scope:r,...d}){if(!r)return null;const t=r.split(" ").filter(Boolean);return e.jsx(z,{direction:"row",flexWrap:"wrap",gap:1,...d,children:t.map(m=>e.jsx(ve.Fragment,{children:e.jsx(ke,{title:K.OAUTH_SCOPES[m],children:e.jsx(v,{children:m})})},m))})}V.propTypes={scope:n.string};V.defaultProps={scope:""};const ee=r=>{const{prefix:d}=_(),{blocklet:t}=qe(),m=re(d,"/api/media/upload",t.appPid),l=b.useCallback(g=>g?g.startsWith("http")?g:`${re(d,"/api/media/upload",t.appPid)}/${g}`:"",[d,t.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:m,getClientLogoUrl:l}},Ee=b.lazy(()=>Se(()=>import("./index-DBsI6F1Z.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function xe({client:r,onUpdate:d,onClose:t}){const[m,l]=b.useState(!1),{t:s,locale:g}=F(),h=b.useRef(null),{api:f}=_(),{teamDid:A}=B(),{control:a,handleSubmit:k,formState:{errors:x},watch:w,setValue:R,getValues:N}=he({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||""},mode:"onChange"}),c=w("scope"),u=w("logoUri"),{clientLogoUrl:O,apiPath:W}=ee(u),q=o=>{o!=="profile:read"&&R("scope",c.includes(o)?c.filter(i=>i!==o):[...c,o])},D=async o=>{const i={clientId:r.clientId,clientName:o.clientName.trim(),clientUri:o.clientUri,redirectUris:o.redirectUris.split(",").map(C=>C.trim()).filter(Boolean),contacts:o.contacts?o.contacts.split(",").map(C=>C.trim()):[],scope:o.scope.join(" "),tosUri:o.tosUri,policyUri:o.policyUri,logoUri:o.logoUri};await f.updateOAuthClient({input:{teamDid:A,input:i}})},L=async o=>{l(!0);try{await D(o),d(),t()}catch(i){M.error(i.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(G,{open:!0,onClose:t,maxWidth:"md",fullWidth:!0,children:[e.jsxs(X,{children:[s("oauth.client.update")," ",e.jsx(Q,{onClick:t,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsxs(z,{spacing:3,sx:{mt:2},children:[e.jsxs(p,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(p,{children:[e.jsx(p,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:O?e.jsx(p,{children:e.jsx("img",{src:O,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(p,{onClick:()=>{var o;(o=h.current)==null||o.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(de,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(E,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{var o;(o=h.current)==null||o.open()},children:s(O?"common.change":"common.upload")})]}),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Pe,{}),children:e.jsx(Ee,{ref:h,locale:g,popup:!0,onUploadFinish:o=>{R("logoUri",o.data.filename),D(N()).then(()=>{d()}).catch(i=>{M.error(i.message||s("oauth.client.updateFailed"))}).finally(()=>{var i;(i=h.current)==null||i.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:W,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")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(T,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:a,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!x.clientName,helperText:(i=x.clientName)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:a,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!x.clientUri,helperText:(i=x.clientUri)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:a,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!x.redirectUris,helperText:(i=x.redirectUris)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.redirectUris")})]})}})}),e.jsxs(p,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(K.OAUTH_SCOPES).map(([o,i])=>e.jsx(se,{control:e.jsx(ae,{checked:c.includes(o),onChange:()=>q(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:i})})},o))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(p,{children:e.jsx(S,{name:"contacts",control:a,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!x.contacts,helperText:(i=x.contacts)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.contacts")})]})}})}),e.jsxs(z,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>{var i;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{...o,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!x.tosUri,helperText:(i=x.tosUri)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>{var i;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{...o,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!x.policyUri,helperText:(i=x.policyUri)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.policyUri")})]})}})]}),x.error&&e.jsx(ce,{severity:"error",children:x.error.message})]})}),e.jsxs(ue,{children:[e.jsx(E,{onClick:t,children:s("common.cancel")}),e.jsx(E,{onClick:k(L),disabled:m,variant:"contained",color:"primary",children:m?e.jsx(Z,{size:16}):s("common.update")})]})]})}xe.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function je({client:r,onUpdate:d,onClose:t}){return e.jsx(xe,{client:r,onUpdate:m=>d(m),onClose:t})}je.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function te(r){const{t:d}=F(),{api:t}=_(),{teamDid:m}=B(),{clientId:l,clientName:s,onDelete:g=()=>{},onClose:h=()=>{}}=r,f=()=>{h()},A=async()=>{try{await t.deleteOAuthClient({input:{teamDid:m,clientId:l}}),g()}catch(k){M.error(k==null?void 0:k.message)}finally{f()}},a={keyName:s,title:d("oauth.client.delete.title"),description:d("oauth.client.delete.description",{name:`<b>${s}</b>`}),confirmPlaceholder:d("oauth.client.delete.description",{name:s}),confirm:d("common.delConfirm"),cancel:d("common.cancel"),onConfirm:A,onCancel:f};return e.jsx(Ne,{keyName:a.keyName,title:a.title,description:a.description,confirmPlaceholder:a.confirmPlaceholder,confirm:a.confirm,cancel:a.cancel,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})}te.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};te.defaultProps={onDelete:()=>{},onClose:()=>{}};function ge({title:r,items:d}){return e.jsxs(p,{mb:3,children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(z,{spacing:1.5,children:d.map(({label:t,value:m})=>e.jsxs(p,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:t}),e.jsx(I,{sx:{wordBreak:"break-all"},children:m||"-"})]},t))})]})}ge.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function fe({client:r,onClose:d}){const{t,locale:m}=F(),{teamDid:l}=B(),{clientName:s,clientId:g,clientSecret:h,redirectUris:f,scope:A,clientUri:a,logoUri:k,contacts:x,tosUri:w,policyUri:R,jwksUri:N,jwks:c,softwareId:u,softwareVersion:O,clientIdIssuedAt:W,clientSecretExpiresAt:q,updatedAt:D,createUser:L}=r,{clientLogoUrl:o}=ee(k),i=j=>{try{const P=new URL(window.blocklet.appUrl);return P.pathname=j,P.toString()}catch{return"-"}},C=pe.fromAppDid(g,l),U=[{title:t("common.baseInfo"),items:[{label:t("oauth.client.name"),value:s},{label:t("oauth.client.logoUri"),value:e.jsx(ne,{variant:"rounded",shape:"square",src:o,did:C.address,size:64})},{label:t("oauth.client.clientUri"),value:a?e.jsx(v,{children:a}):"-"},{label:t("oauth.client.clientId"),value:e.jsx(v,{children:g})},{label:t("oauth.client.clientSecret"),value:e.jsx(v,{children:h})},{label:t("oauth.client.redirectUris"),value:e.jsx(v,{children:(f||[]).join(", ")})},{label:t("oauth.client.scope"),value:e.jsx(V,{scope:A})},{label:t("oauth.client.createUser"),value:L?We(L,!0):t("oauth.client.openRegistration")}]},{title:t("oauth.client.oauthEndpoints"),items:[{label:t("oauth.client.openidConfiguration"),value:e.jsx(v,{children:i("/.well-known/openid-configuration")})},{label:t("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/authorize")})},{label:t("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/token")})},{label:t("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/userinfo")})},{label:t("oauth.client.jwksUri"),value:e.jsx(v,{children:i("/.well-known/service/oauth/jwks")})},{label:t("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/register")})},{label:t("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/logout")})}]},{title:t("oauth.client.metaContact"),items:[{label:t("oauth.client.contacts"),value:x.length?e.jsx(v,{children:(x||[]).join(", ")}):"-"},{label:t("oauth.client.tosUri"),value:w?e.jsx(v,{children:w}):"-"},{label:t("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:t("oauth.client.jwksUri"),value:N},{label:t("oauth.client.jwks"),value:c},{label:t("oauth.client.softwareId"),value:u},{label:t("oauth.client.softwareVersion"),value:O}]},{title:t("common.timeInfo"),items:[{label:t("oauth.client.clientIdIssuedAt"),value:W?e.jsx($,{value:W*1e3,type:"all",locale:m}):"-"},{label:t("oauth.client.clientSecretExpiresAt"),value:q?e.jsx($,{value:q*1e3,type:"all",locale:m}):"-"},{label:t("common.updatedAt"),value:D?e.jsx($,{value:D,type:"all",locale:m}):"-"}]}].filter(Boolean);return e.jsxs(G,{open:!0,onClose:d,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(X,{children:[t("oauth.client.oauthAppDetails"),e.jsx(Q,{onClick:d,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsx(p,{mt:1,children:U.map((j,P)=>e.jsxs(p,{children:[e.jsx(ge,{title:j.title,items:j.items}),P!==U.length-1&&e.jsx(J,{sx:{my:2}})]},j.title))})})]})}fe.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Fe(r){return e.jsx($,{value:r*1e3})}function ie({selected:r,onClose:d}){return r?e.jsx(fe,{client:r,onClose:d}):null}ie.propTypes={selected:n.object,onClose:n.func.isRequired};ie.defaultProps={selected:null};function Ue({open:r,onCreated:d,onClose:t}){return r?e.jsx(me,{onCreated:d,onClose:t}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function kt(){var o;const[r,d]=b.useState({searchText:"",pageSize:10,page:1}),[t,m]=b.useState(null),[l,s]=b.useState(!1),g=b.useRef(null),{t:h,locale:f}=F(),{api:A}=_(),{teamDid:a}=B(),[k,x]=b.useState(null),[w,R]=b.useState(null),N=De(),{getClientLogoUrl:c}=ee(),u=Re(async()=>await A.getOAuthClients({input:{teamDid:a,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:O}=u,W=b.useMemo(()=>{var i;return((i=u.value)==null?void 0:i.list)||[]},[(o=u.value)==null?void 0:o.list]),q=b.useMemo(()=>r.searchText?W.filter(i=>i.clientName.toLowerCase().includes(r.searchText.toLowerCase())||i.clientId.toLowerCase().includes(r.searchText.toLowerCase())||i.scope.toLowerCase().includes(r.searchText.toLowerCase())):W,[r.searchText,W]),D=b.useMemo(()=>[{label:h("oauth.client.name"),name:"clientName",options:{customBodyRender:(i,{rowIndex:C})=>{const U=q[C],j=c(U.logoUri),P=pe.fromAppDid(U.clientId,a);return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(p,{display:"flex",alignItems:"center",gap:2,sx:{cursor:"pointer"},onClick:be=>{be.stopPropagation(),window.open(U.clientUri,"_blank")},children:[e.jsx(ne,{variant:"rounded",shape:"square",did:P.address,src:j,size:48}),e.jsxs(z,{gap:.5,children:[e.jsx(p,{sx:{color:"text.primary"},children:U.clientName}),e.jsx(p,{sx:{color:"text.secondary"},children:U.clientUri})]})]})})}}},{label:h("oauth.client.clientId"),name:"clientId"},{label:h("oauth.client.scope"),name:"scope",options:{customBodyRender:i=>e.jsx(V,{scope:i})}},{label:h("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Fe}},{label:h("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(i,{rowIndex:C})=>{const U=q[C];return e.jsx(ze,{actions:[{icon:e.jsx(Ie,{}),text:h("common.edit"),onClick:j=>{j.stopPropagation(),x(U)}},{icon:e.jsx(ye,{}),text:h("common.delete"),onClick:j=>{j.stopPropagation(),R(U)}}]})}}}],[q,h,c,a,x,R]),L=({page:i,rowsPerPage:C,searchText:U})=>{r.pageSize!==C?d(j=>({...j,searchText:"",pageSize:C,page:1})):r.page!==i+1?d(j=>({...j,searchText:"",page:i+1})):r.searchText!==U&&d(j=>({...j,searchText:U,page:1}))};return e.jsxs(p,{ref:g,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[N?e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}):null,e.jsx(Ce,{data:q,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:q.length,searchDebounceTime:400,onRowClick(i,{dataIndex:C},U){var j;if((j=g.current)!=null&&j.contains(U.target)){const P=q[C];m(P)}}},onChange:L,title:N?null:e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}),customButtons:[e.jsxs(E,{variant:"contained",size:"small",onClick:()=>s(!0),children:[O?e.jsx(Z,{size:16}):e.jsx(de,{style:{fontSize:16}}),h("common.create")]},"add")],loading:!1,emptyNode:e.jsx(we,{children:h("oauth.client.empty")})}),e.jsx(ie,{selected:t,onClose:()=>m(null)}),e.jsx(Ue,{open:l,onCreated:()=>{s(!1),u.retry()},onClose:()=>s(!1)}),k&&e.jsx(je,{client:k,onUpdate:u.retry,onClose:()=>x(null)}),w&&e.jsx(te,{...w,onDelete:u.retry,onClose:()=>R(null)})]})}export{kt as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bi-YrbEk.js","assets/vendor-ux-did-connect-D0L9YnHn.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-mui-core-Bh-qMRq3.js","assets/vendor-hooks-DpwFseeF.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-Ca95GLVH.js","assets/index-Bs1kxR8_.js","assets/index-YuW8IExe.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{r as b,b as ve}from"./vendor-react-DEoibe3W.js";import{a as F,d as H,j as K,Y as M,X as ne,V as $,b3 as ye,a5 as Ce,_ as we}from"./vendor-ux-did-connect-D0L9YnHn.js";import{H as n,j as e,D as G,aj as X,I as Q,t as Y,al as z,T as I,aa as p,O as T,bq as y,bK as Te,bQ as oe,bs as se,bR as ae,X as J,ak as ce,z as ue,y as E,ab as Z,ad as ke}from"./vendor-mui-core-Bh-qMRq3.js";import{O as de,_ as Se}from"./vendor-arcblock-Ca95GLVH.js";import{d as Ie}from"./Edit-Bj4m2hpD.js";import{_ as Re}from"./dot-D3X4DSlo.js";import{l as pe}from"./index-DYlN9Brg.js";import{A as _,ay as he,az as S,D as qe}from"./index-YuW8IExe.js";import{u as B}from"./dashboard-B_QqB4aw.js";import{o as Ae,c as Oe,A as re}from"./vendor-utils-rHXShPKm.js";import{E as Pe}from"./empty-spinner-BZw_ShnT.js";import{C as v}from"./click-to-copy-DtGgy9Ua.js";import{D as Ne}from"./delete-confirm-DHB0S_Co.js";import{b as We}from"./passport-item-NMGbWwTG.js";import{A as ze}from"./actions-BWSNMC_c.js";import{T as le}from"./table-tips-nPiIcvAy.js";import{u as De}from"./use-mobile-ZAS6Si4t.js";import"./vendor-hooks-DpwFseeF.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-CDjYBiwf.js";import"./useLocalStorage-DotMjDUB.js";import"./index-8eXqqyHQ.js";import"./confirm-DaR0Yx39.js";import"./PlayArrow-BHO_DqT2.js";import"./get-safe-url-DYtntqqo.js";import"./session-DUt5rVEy.js";import"./use-blocklet-logo-3VH4RBTr.js";import"./InfoOutlined-uoMMChNE.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-JEGQfLZ2.js";import"./index-c0hdujdn.js";import"./Phone--BSu-btI.js";import"./Location-By12Z3Te.js";import"./Email-CdSNK0eA.js";import"./Timezone-YZ0dMUEr.js";import"./did-address-mv0Qw7hC.js";import"./util-CiTimo-i.js";import"./base32-BnPQ4q4v.js";import"./MoreHoriz-3SNxR36h.js";const Le={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function me({onCreated:r,onClose:d}){const[t,m]=b.useState(!1),{t:l,locale:s}=F(),{api:g}=_(),{teamDid:h}=B(),{control:f,handleSubmit:A,formState:{errors:a},watch:k,setValue:x}=he({defaultValues:Le,mode:"onChange"}),w=k("scope"),R=c=>{c!=="profile:read"&&x("scope",w.includes(c)?w.filter(u=>u!==c):[...w,c])},N=async c=>{m(!0);try{const u={...c,redirectUris:c.redirectUris,contacts:c.contacts?c.contacts.split(",").map(O=>O.trim()):[],scope:c.scope.join(" ")};await g.createOAuthClient({input:{teamDid:h,input:Ae(u,Oe)}}),r(u)}catch(u){M.error(u.message||"Failed to create OAuth App")}finally{m(!1)}};return e.jsxs(G,{open:!0,onClose:d,maxWidth:"md",fullWidth:!0,children:[e.jsxs(X,{children:[l("oauth.client.register")," ",e.jsx(Q,{onClick:d,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsxs(z,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:f,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!a.clientName,helperText:(u=a.clientName)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:f,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!a.clientUri,helperText:(u=a.clientUri)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:f,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!a.redirectUris,helperText:(u=a.redirectUris)==null?void 0:u.message}),e.jsxs(p,{sx:{display:"flex",gap:"2px"},children:[e.jsx(y,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(y,{children:l("oauth.client.helperText.read")}),e.jsx(y,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(y,{children:l("oauth.client.helperText.more")})]})]})}})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(K.OAUTH_SCOPES).map(([c,u])=>e.jsx(se,{control:e.jsx(ae,{checked:w.includes(c),onChange:()=>R(c),disabled:c==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:u})})},c))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(z,{children:e.jsx(S,{name:"contacts",control:f,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:c})=>{var u;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!a.contacts,helperText:(u=a.contacts)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.contacts")})]})}})}),e.jsxs(z,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:c})=>{var u;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!a.tosUri,helperText:(u=a.tosUri)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:c})=>{var u;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{size:"small",...c,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!a.policyUri,helperText:(u=a.policyUri)==null?void 0:u.message}),e.jsx(y,{children:l("oauth.client.helperText.policyUri")})]})}})]}),a.error&&e.jsx(ce,{severity:"error",children:a.error.message})]})}),e.jsxs(ue,{children:[e.jsx(E,{onClick:d,children:l("common.cancel")}),e.jsxs(E,{onClick:A(N),disabled:t,variant:"contained",color:"primary",children:[t?e.jsx(Z,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}me.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function V({scope:r,...d}){if(!r)return null;const t=r.split(" ").filter(Boolean);return e.jsx(z,{direction:"row",flexWrap:"wrap",gap:1,...d,children:t.map(m=>e.jsx(ve.Fragment,{children:e.jsx(ke,{title:K.OAUTH_SCOPES[m],children:e.jsx(v,{children:m})})},m))})}V.propTypes={scope:n.string};V.defaultProps={scope:""};const ee=r=>{const{prefix:d}=_(),{blocklet:t}=qe(),m=re(d,"/api/media/upload",t.appPid),l=b.useCallback(g=>g?g.startsWith("http")?g:`${re(d,"/api/media/upload",t.appPid)}/${g}`:"",[d,t.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:m,getClientLogoUrl:l}},Ee=b.lazy(()=>Se(()=>import("./index-Bi-YrbEk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function xe({client:r,onUpdate:d,onClose:t}){const[m,l]=b.useState(!1),{t:s,locale:g}=F(),h=b.useRef(null),{api:f}=_(),{teamDid:A}=B(),{control:a,handleSubmit:k,formState:{errors:x},watch:w,setValue:R,getValues:N}=he({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||""},mode:"onChange"}),c=w("scope"),u=w("logoUri"),{clientLogoUrl:O,apiPath:W}=ee(u),q=o=>{o!=="profile:read"&&R("scope",c.includes(o)?c.filter(i=>i!==o):[...c,o])},D=async o=>{const i={clientId:r.clientId,clientName:o.clientName.trim(),clientUri:o.clientUri,redirectUris:o.redirectUris.split(",").map(C=>C.trim()).filter(Boolean),contacts:o.contacts?o.contacts.split(",").map(C=>C.trim()):[],scope:o.scope.join(" "),tosUri:o.tosUri,policyUri:o.policyUri,logoUri:o.logoUri};await f.updateOAuthClient({input:{teamDid:A,input:i}})},L=async o=>{l(!0);try{await D(o),d(),t()}catch(i){M.error(i.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(G,{open:!0,onClose:t,maxWidth:"md",fullWidth:!0,children:[e.jsxs(X,{children:[s("oauth.client.update")," ",e.jsx(Q,{onClick:t,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsxs(z,{spacing:3,sx:{mt:2},children:[e.jsxs(p,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(p,{children:[e.jsx(p,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:O?e.jsx(p,{children:e.jsx("img",{src:O,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(p,{onClick:()=>{var o;(o=h.current)==null||o.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(de,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(E,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{var o;(o=h.current)==null||o.open()},children:s(O?"common.change":"common.upload")})]}),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Pe,{}),children:e.jsx(Ee,{ref:h,locale:g,popup:!0,onUploadFinish:o=>{R("logoUri",o.data.filename),D(N()).then(()=>{d()}).catch(i=>{M.error(i.message||s("oauth.client.updateFailed"))}).finally(()=>{var i;(i=h.current)==null||i.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:W,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")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(T,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:a,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!x.clientName,helperText:(i=x.clientName)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:a,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!x.clientUri,helperText:(i=x.clientUri)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:a,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!x.redirectUris,helperText:(i=x.redirectUris)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.redirectUris")})]})}})}),e.jsxs(p,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(K.OAUTH_SCOPES).map(([o,i])=>e.jsx(se,{control:e.jsx(ae,{checked:c.includes(o),onChange:()=>q(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:i})})},o))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(p,{children:e.jsx(S,{name:"contacts",control:a,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:o})=>{var i;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...o,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!x.contacts,helperText:(i=x.contacts)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.contacts")})]})}})}),e.jsxs(z,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>{var i;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{...o,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!x.tosUri,helperText:(i=x.tosUri)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>{var i;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(T,{...o,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!x.policyUri,helperText:(i=x.policyUri)==null?void 0:i.message}),e.jsx(y,{children:s("oauth.client.helperText.policyUri")})]})}})]}),x.error&&e.jsx(ce,{severity:"error",children:x.error.message})]})}),e.jsxs(ue,{children:[e.jsx(E,{onClick:t,children:s("common.cancel")}),e.jsx(E,{onClick:k(L),disabled:m,variant:"contained",color:"primary",children:m?e.jsx(Z,{size:16}):s("common.update")})]})]})}xe.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function je({client:r,onUpdate:d,onClose:t}){return e.jsx(xe,{client:r,onUpdate:m=>d(m),onClose:t})}je.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function te(r){const{t:d}=F(),{api:t}=_(),{teamDid:m}=B(),{clientId:l,clientName:s,onDelete:g=()=>{},onClose:h=()=>{}}=r,f=()=>{h()},A=async()=>{try{await t.deleteOAuthClient({input:{teamDid:m,clientId:l}}),g()}catch(k){M.error(k==null?void 0:k.message)}finally{f()}},a={keyName:s,title:d("oauth.client.delete.title"),description:d("oauth.client.delete.description",{name:`<b>${s}</b>`}),confirmPlaceholder:d("oauth.client.delete.description",{name:s}),confirm:d("common.delConfirm"),cancel:d("common.cancel"),onConfirm:A,onCancel:f};return e.jsx(Ne,{keyName:a.keyName,title:a.title,description:a.description,confirmPlaceholder:a.confirmPlaceholder,confirm:a.confirm,cancel:a.cancel,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})}te.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};te.defaultProps={onDelete:()=>{},onClose:()=>{}};function ge({title:r,items:d}){return e.jsxs(p,{mb:3,children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(z,{spacing:1.5,children:d.map(({label:t,value:m})=>e.jsxs(p,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:t}),e.jsx(I,{sx:{wordBreak:"break-all"},children:m||"-"})]},t))})]})}ge.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function fe({client:r,onClose:d}){const{t,locale:m}=F(),{teamDid:l}=B(),{clientName:s,clientId:g,clientSecret:h,redirectUris:f,scope:A,clientUri:a,logoUri:k,contacts:x,tosUri:w,policyUri:R,jwksUri:N,jwks:c,softwareId:u,softwareVersion:O,clientIdIssuedAt:W,clientSecretExpiresAt:q,updatedAt:D,createUser:L}=r,{clientLogoUrl:o}=ee(k),i=j=>{try{const P=new URL(window.blocklet.appUrl);return P.pathname=j,P.toString()}catch{return"-"}},C=pe.fromAppDid(g,l),U=[{title:t("common.baseInfo"),items:[{label:t("oauth.client.name"),value:s},{label:t("oauth.client.logoUri"),value:e.jsx(ne,{variant:"rounded",shape:"square",src:o,did:C.address,size:64})},{label:t("oauth.client.clientUri"),value:a?e.jsx(v,{children:a}):"-"},{label:t("oauth.client.clientId"),value:e.jsx(v,{children:g})},{label:t("oauth.client.clientSecret"),value:e.jsx(v,{children:h})},{label:t("oauth.client.redirectUris"),value:e.jsx(v,{children:(f||[]).join(", ")})},{label:t("oauth.client.scope"),value:e.jsx(V,{scope:A})},{label:t("oauth.client.createUser"),value:L?We(L,!0):t("oauth.client.openRegistration")}]},{title:t("oauth.client.oauthEndpoints"),items:[{label:t("oauth.client.openidConfiguration"),value:e.jsx(v,{children:i("/.well-known/openid-configuration")})},{label:t("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/authorize")})},{label:t("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/token")})},{label:t("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/userinfo")})},{label:t("oauth.client.jwksUri"),value:e.jsx(v,{children:i("/.well-known/service/oauth/jwks")})},{label:t("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/register")})},{label:t("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:i("/.well-known/service/oauth/logout")})}]},{title:t("oauth.client.metaContact"),items:[{label:t("oauth.client.contacts"),value:x.length?e.jsx(v,{children:(x||[]).join(", ")}):"-"},{label:t("oauth.client.tosUri"),value:w?e.jsx(v,{children:w}):"-"},{label:t("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:t("oauth.client.jwksUri"),value:N},{label:t("oauth.client.jwks"),value:c},{label:t("oauth.client.softwareId"),value:u},{label:t("oauth.client.softwareVersion"),value:O}]},{title:t("common.timeInfo"),items:[{label:t("oauth.client.clientIdIssuedAt"),value:W?e.jsx($,{value:W*1e3,type:"all",locale:m}):"-"},{label:t("oauth.client.clientSecretExpiresAt"),value:q?e.jsx($,{value:q*1e3,type:"all",locale:m}):"-"},{label:t("common.updatedAt"),value:D?e.jsx($,{value:D,type:"all",locale:m}):"-"}]}].filter(Boolean);return e.jsxs(G,{open:!0,onClose:d,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(X,{children:[t("oauth.client.oauthAppDetails"),e.jsx(Q,{onClick:d,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsx(p,{mt:1,children:U.map((j,P)=>e.jsxs(p,{children:[e.jsx(ge,{title:j.title,items:j.items}),P!==U.length-1&&e.jsx(J,{sx:{my:2}})]},j.title))})})]})}fe.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Fe(r){return e.jsx($,{value:r*1e3})}function ie({selected:r,onClose:d}){return r?e.jsx(fe,{client:r,onClose:d}):null}ie.propTypes={selected:n.object,onClose:n.func.isRequired};ie.defaultProps={selected:null};function Ue({open:r,onCreated:d,onClose:t}){return r?e.jsx(me,{onCreated:d,onClose:t}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function kt(){var o;const[r,d]=b.useState({searchText:"",pageSize:10,page:1}),[t,m]=b.useState(null),[l,s]=b.useState(!1),g=b.useRef(null),{t:h,locale:f}=F(),{api:A}=_(),{teamDid:a}=B(),[k,x]=b.useState(null),[w,R]=b.useState(null),N=De(),{getClientLogoUrl:c}=ee(),u=Re(async()=>await A.getOAuthClients({input:{teamDid:a,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:O}=u,W=b.useMemo(()=>{var i;return((i=u.value)==null?void 0:i.list)||[]},[(o=u.value)==null?void 0:o.list]),q=b.useMemo(()=>r.searchText?W.filter(i=>i.clientName.toLowerCase().includes(r.searchText.toLowerCase())||i.clientId.toLowerCase().includes(r.searchText.toLowerCase())||i.scope.toLowerCase().includes(r.searchText.toLowerCase())):W,[r.searchText,W]),D=b.useMemo(()=>[{label:h("oauth.client.name"),name:"clientName",options:{customBodyRender:(i,{rowIndex:C})=>{const U=q[C],j=c(U.logoUri),P=pe.fromAppDid(U.clientId,a);return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(p,{display:"flex",alignItems:"center",gap:2,sx:{cursor:"pointer"},onClick:be=>{be.stopPropagation(),window.open(U.clientUri,"_blank")},children:[e.jsx(ne,{variant:"rounded",shape:"square",did:P.address,src:j,size:48}),e.jsxs(z,{gap:.5,children:[e.jsx(p,{sx:{color:"text.primary"},children:U.clientName}),e.jsx(p,{sx:{color:"text.secondary"},children:U.clientUri})]})]})})}}},{label:h("oauth.client.clientId"),name:"clientId"},{label:h("oauth.client.scope"),name:"scope",options:{customBodyRender:i=>e.jsx(V,{scope:i})}},{label:h("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Fe}},{label:h("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(i,{rowIndex:C})=>{const U=q[C];return e.jsx(ze,{actions:[{icon:e.jsx(Ie,{}),text:h("common.edit"),onClick:j=>{j.stopPropagation(),x(U)}},{icon:e.jsx(ye,{}),text:h("common.delete"),onClick:j=>{j.stopPropagation(),R(U)}}]})}}}],[q,h,c,a,x,R]),L=({page:i,rowsPerPage:C,searchText:U})=>{r.pageSize!==C?d(j=>({...j,searchText:"",pageSize:C,page:1})):r.page!==i+1?d(j=>({...j,searchText:"",page:i+1})):r.searchText!==U&&d(j=>({...j,searchText:U,page:1}))};return e.jsxs(p,{ref:g,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[N?e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}):null,e.jsx(Ce,{data:q,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:q.length,searchDebounceTime:400,onRowClick(i,{dataIndex:C},U){var j;if((j=g.current)!=null&&j.contains(U.target)){const P=q[C];m(P)}}},onChange:L,title:N?null:e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}),customButtons:[e.jsxs(E,{variant:"contained",size:"small",onClick:()=>s(!0),children:[O?e.jsx(Z,{size:16}):e.jsx(de,{style:{fontSize:16}}),h("common.create")]},"add")],loading:!1,emptyNode:e.jsx(we,{children:h("oauth.client.empty")})}),e.jsx(ie,{selected:t,onClose:()=>m(null)}),e.jsx(Ue,{open:l,onCreated:()=>{s(!1),u.retry()},onClose:()=>s(!1)}),k&&e.jsx(je,{client:k,onUpdate:u.retry,onClose:()=>x(null)}),w&&e.jsx(te,{...w,onDelete:u.retry,onClose:()=>R(null)})]})}export{kt as default};
@@ -0,0 +1 @@
1
+ import{j as o}from"./vendor-mui-core-Bh-qMRq3.js";import"./vendor-react-DEoibe3W.js";import{S as t}from"./studio-kVKG7W3n.js";import"./vendor-ux-did-connect-D0L9YnHn.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-DpwFseeF.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Ca95GLVH.js";import"./TuneOutlined-BvtfOd23.js";function d(){return o.jsx(t,{children:"Coming soon..."})}export{d as default};