@abtnode/blocklet-services 1.16.46-beta-20250708-074453-e1748586 → 1.16.46-beta-20250709-071942-1f57b2b8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-X0hNNolb.js → AdapterDayjs-BeqEJUig.js} +1 -1
- package/dist/assets/{Google-Bo2ohqwo.js → Google-C8DG_mDp.js} +1 -1
- package/dist/assets/{access-control-90k3s4Tc.js → access-control-X_NlM1AQ.js} +1 -1
- package/dist/assets/{add-component-core-fR1K_s-b.js → add-component-core-BNm8Sohm.js} +1 -1
- package/dist/assets/{add-resource-C4L5iiYR.js → add-resource-DbjUjkxV.js} +1 -1
- package/dist/assets/{addon-B_9u8Uap.js → addon-BkZEzLfU.js} +1 -1
- package/dist/assets/{advanced-B8Og-q_8.js → advanced-Bmq6xQB4.js} +1 -1
- package/dist/assets/api-CpYSt0CS.js +1 -0
- package/dist/assets/{appearance-CzutBxVy.js → appearance-CI7tP4v7.js} +1 -1
- package/dist/assets/{arrow-down.svg-ERMGqkAp.js → arrow-down.svg-DR5noAvr.js} +1 -1
- package/dist/assets/{audit-logs-CeCLVKmc.js → audit-logs-Bbodpxwp.js} +1 -1
- package/dist/assets/{authorize-DZ53nGXa.js → authorize-osbNauSJ.js} +1 -1
- package/dist/assets/{base-chart-DfvV1Wek.js → base-chart-BGpAbSkc.js} +1 -1
- package/dist/assets/{base32-D5SW9slW.js → base32-vvndof6f.js} +1 -1
- package/dist/assets/{branding-k1UuAgbL.js → branding-9qaGpptV.js} +2 -2
- package/dist/assets/{branding-DqrEqckw.js → branding-QpFA5gHx.js} +1 -1
- package/dist/assets/{bundle-avatar-DoaTu2bf.js → bundle-avatar-D1U8n6sJ.js} +1 -1
- package/dist/assets/{button-Cq26ea05.js → button-n_0p8lJU.js} +1 -1
- package/dist/assets/{click-to-copy-53HtxuZ-.js → click-to-copy-B6s5Z4cq.js} +1 -1
- package/dist/assets/{cloneDeep-C4F9EbDd.js → cloneDeep-wCAABKRh.js} +1 -1
- package/dist/assets/{complete-CTL412MW.js → complete-B3LQtNHp.js} +1 -1
- package/dist/assets/{component-Cr9ErCQn.js → component-CyoK1wFU.js} +3 -3
- package/dist/assets/{config-1BozCK2T.js → config-BgvCY9yW.js} +1 -1
- package/dist/assets/{config-CNQujUIY.js → config-Bl2vLfGW.js} +1 -1
- package/dist/assets/{config-navigation-DS3ENbD4.js → config-navigation-DcBcxC77.js} +3 -3
- package/dist/assets/{config-space-BJHf-Cd6.js → config-space-D2PSYekl.js} +1 -1
- package/dist/assets/{confirm-Cap-op6n.js → confirm-DAb9dboO.js} +1 -1
- package/dist/assets/{connect-Du7jX0Sh.js → connect-Ca67d-kp.js} +1 -1
- package/dist/assets/{connect--oxHn2U3.js → connect-geHS1TpW.js} +1 -1
- package/dist/assets/{connect-to-DFUayzYa.js → connect-to-2xYBexsb.js} +1 -1
- package/dist/assets/{createClass-0H_KUZSg.js → createClass-geNigj02.js} +1 -1
- package/dist/assets/{dashboard-D5VBBuOs.js → dashboard-DUhl5uLq.js} +3 -3
- package/dist/assets/{delete-confirm-C0sSftJX.js → delete-confirm-DxvPCnQ2.js} +1 -1
- package/dist/assets/{did-address-BbLERCPO.js → did-address-COwwd6H0.js} +1 -1
- package/dist/assets/{domain-tDz9aJ1p.js → domain-DsyzZKaj.js} +1 -1
- package/dist/assets/{domain-action-card-YTqBPBWZ.js → domain-action-card-BHqkche3.js} +1 -1
- package/dist/assets/domains-JuDH24L8.js +1 -0
- package/dist/assets/{dot-CSvzbUXF.js → dot-DLj9aDwC.js} +1 -1
- package/dist/assets/{email-CG37x_qj.js → email-ClGSUpWT.js} +1 -1
- package/dist/assets/engine-CR4ymPVp.js +1 -0
- package/dist/assets/{exchange-passport-DKVItvkK.js → exchange-passport-BUGi1VBV.js} +1 -1
- package/dist/assets/{form-CGJGxKNL.js → form-zxAQYYnY.js} +1 -1
- package/dist/assets/{fuel-DVQ9RgQl.js → fuel-BID4hifo.js} +1 -1
- package/dist/assets/{gen-access-key-CVqGSMOn.js → gen-access-key-BTM6ukrq.js} +1 -1
- package/dist/assets/get-safe-url-BK7rZ--W.js +1 -0
- package/dist/assets/{home-CjcckRlZ.js → home-B_RkpQaJ.js} +1 -1
- package/dist/assets/{iframe-CjdjlDtS.js → iframe-CubIsy36.js} +1 -1
- package/dist/assets/{index-QJUPJwU5.js → index-45FYp8zC.js} +2 -2
- package/dist/assets/{index-BnCifgrr.js → index-AI8jHnw9.js} +1 -1
- package/dist/assets/{index-CXr199vi.js → index-BUEUadKA.js} +1 -1
- package/dist/assets/{index-BpP1Znfh.js → index-BVAv5IrJ.js} +6 -6
- package/dist/assets/{index-1MoOycfF.js → index-BXjxtue_.js} +1 -1
- package/dist/assets/{index-CF0F1TwU.js → index-BiGUf0JP.js} +1 -1
- package/dist/assets/{index-M4aOFxEp.js → index-BsTbYUnM.js} +1 -1
- package/dist/assets/{index-CPh83bMS.js → index-Bst-lasJ.js} +1 -1
- package/dist/assets/{index-BqxH9RUX.js → index-Bzd_F7Ms.js} +1 -1
- package/dist/assets/{index-azWn8MOB.js → index-C-yjHI_C.js} +1 -1
- package/dist/assets/{index-vQRat2tv.js → index-C0PfwuMR.js} +1 -1
- package/dist/assets/{index-B2GXn548.js → index-C7l3rSL2.js} +1 -1
- package/dist/assets/{index-sx11rzaE.js → index-C9VaBr_O.js} +1 -1
- package/dist/assets/{index-Bd8jbR-Z.js → index-C_rFfbiq.js} +1 -1
- package/dist/assets/{index-DnIF_NYU.js → index-CpryIQED.js} +1 -1
- package/dist/assets/{index-DmmlDdES.js → index-CrE4cEyN.js} +1 -1
- package/dist/assets/{index-v4-5jfLi.js → index-Cs4ZeTTW.js} +1 -1
- package/dist/assets/{index-BwLbaIOO.js → index-CuOPtgTg.js} +1 -1
- package/dist/assets/{index-BEKYMIn1.js → index-D-Q3LAn6.js} +1 -1
- package/dist/assets/{index-m1CzDMXa.js → index-D3YocLxi.js} +1 -1
- package/dist/assets/{index-DyFP7QxB.js → index-Dk6JQKfz.js} +1 -1
- package/dist/assets/{index-WQwUkHG7.js → index-Ds6nmMCe.js} +1 -1
- package/dist/assets/{index-CeSZphll.js → index-Dtcv_nT6.js} +4 -4
- package/dist/assets/{index-wrdyuzbe.js → index-SJzJLNlA.js} +1 -1
- package/dist/assets/{index-SCzvv_RV.js → index-TG8FK0pk.js} +1 -1
- package/dist/assets/{index-DbIUA2zH.js → index-Wo9AdN6Y.js} +1 -1
- package/dist/assets/{index-BUiXC-M8.js → index-XuUrUf8b.js} +1 -1
- package/dist/assets/{index-wBG-OAs3.js → index-ZnnRM00W.js} +1 -1
- package/dist/assets/{index-D4YNeVBT.js → index-_X8imDSe.js} +3 -3
- package/dist/assets/{invitation-gz7ZaT6I.js → invitation-fbTXYMgC.js} +1 -1
- package/dist/assets/{invite-aUuSwMvb.js → invite-D1p1pcY6.js} +1 -1
- package/dist/assets/{issue-passport-CvpS7DxT.js → issue-passport-b9pA_OcP.js} +1 -1
- package/dist/assets/{item-CbTF-0Oa.js → item-c7_gTBTX.js} +1 -1
- package/dist/assets/{landing-page-D37ZgHkj.js → landing-page-CPsYV1SX.js} +1 -1
- package/dist/assets/{layout-BEzS8OOg.js → layout-DkHZoXcQ.js} +1 -1
- package/dist/assets/{list-BJA6szjY.js → list-BOhlf5Oo.js} +2 -2
- package/dist/assets/{list-BqHIXcPP.js → list-kq8swRwp.js} +1 -1
- package/dist/assets/localization-CZzoT5xp.js +1 -0
- package/dist/assets/{log-BQUD4DCn.js → log-CZOcHiO-.js} +1 -1
- package/dist/assets/logger-69zTMQoL.js +1 -0
- package/dist/assets/{login-C2QfPDRA.js → login-CMyDCkH6.js} +1 -1
- package/dist/assets/{login-oauth-callback-M7KZI2Od.js → login-oauth-callback-BN9Asi_d.js} +1 -1
- package/dist/assets/{logo-uploader-DN6GOOGh.js → logo-uploader-BeGnMM3a.js} +3 -3
- package/dist/assets/{lost-passport-CJIQWjW5.js → lost-passport--Rxl4BIv.js} +1 -1
- package/dist/assets/{omit-LyexeK2n.js → omit-C6lXG4Q2.js} +1 -1
- package/dist/assets/{open-window-DfDYFiaE.js → open-window-DmgdhkjX.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-Bd6FvSmz.js → over-due-invoice-payment-azmcP3Sx.js} +1 -1
- package/dist/assets/{overview-DjT71Ru7.js → overview-Chm9UqJe.js} +1 -1
- package/dist/assets/{passport-item-wFQM_IPn.js → passport-item-Byi-8gTO.js} +1 -1
- package/dist/assets/{permission-C8zjFCnE.js → permission-tBQugdD0.js} +1 -1
- package/dist/assets/{preferences-BfPbWKcX.js → preferences-DI-hndOF.js} +1 -1
- package/dist/assets/profile-embed-hoDmZwiP.js +1 -0
- package/dist/assets/{publish-resource-B6a9Z8Sv.js → publish-resource-CEjwTzjC.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Jbqi4QL3.js → react-beautiful-dnd.esm-rTL6rgJs.js} +1 -1
- package/dist/assets/{runtime-CPv3tqpJ.js → runtime-qJ1PldRM.js} +1 -1
- package/dist/assets/{sanitize-Be9_TGIg.js → sanitize-12ijS2UQ.js} +1 -1
- package/dist/assets/sdk-Dl0rUz88.js +1 -0
- package/dist/assets/{security-zyp6GX8Q.js → security-m1Vf67My.js} +1 -1
- package/dist/assets/{session-Ctfgia_m.js → session-CFTmeC0_.js} +1 -1
- package/dist/assets/{setup-CDOoR5tS.js → setup-w1nCUnw5.js} +3 -3
- package/dist/assets/{spaces-BaVWWOGx.js → spaces--oE74hBj.js} +1 -1
- package/dist/assets/{start-ic-fIO06.js → start-DQqIgvdd.js} +1 -1
- package/dist/assets/{starting-progress-DIeXw59f.js → starting-progress-Bq_gQVhf.js} +1 -1
- package/dist/assets/{status-DHHxfaoI.js → status-Bj5PpxMp.js} +1 -1
- package/dist/assets/{step-actions-Br-SRUy8.js → step-actions-BZsA_oSN.js} +1 -1
- package/dist/assets/{studio-BoDvKSdd.js → studio-CRXYSEnV.js} +1 -1
- package/dist/assets/{switch-control-gGb7roLA.js → switch-control-Cd3QShYo.js} +1 -1
- package/dist/assets/{table-tips-DCJRX0td.js → table-tips-CMqGfw3-.js} +1 -1
- package/dist/assets/{traffic-D1T3F5UM.js → traffic-PJIhaYTG.js} +1 -1
- package/dist/assets/{transfer-DJIdkLYb.js → transfer-B9hKmCer.js} +1 -1
- package/dist/assets/{unsubscribe-CzVwGQa2.js → unsubscribe-By-fRglQ.js} +1 -1
- package/dist/assets/{use-blocklet-logo-CjoRB6rM.js → use-blocklet-logo-CudOf_wh.js} +1 -1
- package/dist/assets/{useAsync-COkfundQ.js → useAsync-CaAq0Gts.js} +1 -1
- package/dist/assets/{useAsync-fxvoN33w.js → useAsync-Ct43XAf7.js} +1 -1
- package/dist/assets/{useLocalStorage-BrLsVuBH.js → useLocalStorage-C30Mdv9U.js} +1 -1
- package/dist/assets/{user-center-BTomYU5X.js → user-center-CxUqWFNC.js} +3 -3
- package/dist/assets/{user-center-Beq7bNaq.js → user-center-coYNhbvf.js} +3 -3
- package/dist/assets/{user-sessions-BxCDj69X.js → user-sessions-C5THsvtE.js} +1 -1
- package/dist/assets/{util-SCxpGcR7.js → util-Ba52lfC5.js} +1 -1
- package/dist/assets/{util-Dp7qZZRR.js → util-DakLk8kj.js} +1 -1
- package/dist/assets/{vendor-arcblock-Cvkavi6C.js → vendor-arcblock-DKbvje4v.js} +1 -1
- package/dist/assets/{vendor-hooks-CFpNP5Ql.js → vendor-hooks-CwHgeAuk.js} +1 -1
- package/dist/assets/{vendor-utils-Vke2d2wu.js → vendor-utils-CtD44yV-.js} +2 -2
- package/dist/assets/vendor-ux-BArADSzA.js +1568 -0
- package/dist/assets/{wrap-locale-DRH6wq1d.js → wrap-locale-ChQwQuJk.js} +1 -1
- package/dist/assets/{zh-D9byyq6s.js → zh-Bg0MRqOX.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +37 -37
- package/dist/assets/api-B7LEhzE2.js +0 -1
- package/dist/assets/domains-B-tnChYf.js +0 -1
- package/dist/assets/engine-BgdxJwhd.js +0 -1
- package/dist/assets/get-safe-url-DeteK1Tn.js +0 -1
- package/dist/assets/localization-Lor7sJD1.js +0 -1
- package/dist/assets/logger-Bohy94BY.js +0 -1
- package/dist/assets/profile-embed-C7Eh6vHi.js +0 -1
- package/dist/assets/sdk-D8T5YhY1.js +0 -1
- package/dist/assets/vendor-ux-D2yvD18l.js +0 -1568
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as v,a$ as b,J as I,O as P,ak as t}from"./vendor-mui-core-Bz-X9hX7.js";import{q as T,g as B,O as E,$ as j,P as O}from"./vendor-ux-
|
|
1
|
+
import{j as e,T as v,a$ as b,J as I,O as P,ak as t}from"./vendor-mui-core-Bz-X9hX7.js";import{q as T,g as B,O as E,$ as j,P as O}from"./vendor-ux-BArADSzA.js";import{f as $}from"./vendor-hooks-CwHgeAuk.js";import{a8 as A}from"./index-BVAv5IrJ.js";function C({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 W({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=P(l=>l.breakpoints.down("lg")),w=A({meta:r}),k=$(()=>{const l=r.appPid,u=T.isEthereumDid(l),D=u?void 0:B(l);return u?E(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(C,{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, ${O(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{W as K};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,at as m}from"./vendor-mui-core-Bz-X9hX7.js";import{C as p}from"./content-layout-U_bmDcVP.js";import{T as c,H as s}from"./vendor-ux-
|
|
1
|
+
import{j as a,at as m}from"./vendor-mui-core-Bz-X9hX7.js";import{C as p}from"./content-layout-U_bmDcVP.js";import{T as c,H as s}from"./vendor-ux-BArADSzA.js";import{W as d,M as i}from"./index-BVAv5IrJ.js";const u=m(p)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as b,a as be}from"./vendor-react-x2lQvn4m.js";import{T as z,H,_ as ye,$ as re,A as V,D as Ce,C as ve}from"./vendor-ux-D2yvD18l.js";import{j as e,a1 as M,bB as K,I as X,aj as G,a3 as Y,b1 as q,T as I,ak as c,G as w,F as v,b7 as Te,b5 as le,b6 as ne,C as oe,a7 as J,aX as se,W as ae,V as D,p as Q,$ as n,am as we,cf as ce,cg as Se,c9 as Ie}from"./vendor-mui-core-Bz-X9hX7.js";import{g as Re,a as Ee,l as Ae}from"./index-wBG-OAs3.js";import{u as ke}from"./dot-CSvzbUXF.js";import{r as We}from"./index-DyFP7QxB.js";import{_ as B,c as k,Y as Ne}from"./index-BpP1Znfh.js";import{u as $}from"./dashboard-D5VBBuOs.js";import{u as ue,C as S}from"./index.esm-BONQrRCU.js";import{o as Pe,b as qe,C as te}from"./vendor-utils-Vke2d2wu.js";import{T as Oe}from"./index-1MoOycfF.js";import{E as Le}from"./empty-spinner-Bi1Cb9b7.js";import{C}from"./click-to-copy-53HtxuZ-.js";import{D as _e}from"./delete-confirm-C0sSftJX.js";import{a as De}from"./passport-item-wFQM_IPn.js";import{A as Fe}from"./actions-DK8uxYzD.js";import{T as ie}from"./table-tips-DCJRX0td.js";import{u as ze}from"./use-mobile-BkNZycG6.js";import"./vendor-hooks-CFpNP5Ql.js";import"./lottie-web-4koyQiv_.js";import"./useAsync-fxvoN33w.js";import"./vendor-arcblock-Cvkavi6C.js";import"./useLocalStorage-BrLsVuBH.js";import"./index-DBs9Ljax.js";import"./confirm-Cap-op6n.js";import"./get-safe-url-DeteK1Tn.js";import"./session-Ctfgia_m.js";import"./use-blocklet-logo-CjoRB6rM.js";import"./useSetState-BWrXo9eH.js";import"./index-BUiXC-M8.js";import"./over-due-invoice-payment-Bd6FvSmz.js";import"./use-mobile-BgklPLaO.js";import"./arrow-down.svg-ERMGqkAp.js";import"./vendor-mui-x-Cgnunrow.js";import"./AdapterDayjs-X0hNNolb.js";import"./did-address-BbLERCPO.js";import"./util-Dp7qZZRR.js";import"./base32-D5SW9slW.js";var de=We();const Be={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=b.useState(!1),{t:l,locale:o}=z(),{api:f}=B(),{teamDid:d}=$(),{control:y,handleSubmit:g,formState:{errors:u},watch:W,setValue:m}=ue({defaultValues:Be,mode:"onChange"}),T=W("scope"),R=s=>{s!=="profile:read"&&m("scope",T.includes(s)?T.filter(x=>x!==s):[...T,s])},N=async s=>{h(!0);try{const x={...s,redirectUris:s.redirectUris,contacts:s.contacts?s.contacts.split(",").map(A=>A.trim()):[],scope:s.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Pe(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(M,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(v,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(v,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(v,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(v,{children:l("oauth.client.helperText.read")}),e.jsx(v,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${o}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(v,{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(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([s,x])=>e.jsx(ne,{control:e.jsx(oe,{checked:T.includes(s),onChange:()=>R(s),disabled:s==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:x})})},s))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(S,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(v,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:s})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(v,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:s})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(v,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(se,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(D,{onClick:a,children:l("common.cancel")}),e.jsxs(D,{onClick:g(N),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Q,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function Z({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(be.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(C,{children:h})})},h))})}Z.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=B(),{blocklet:i}=Ne(),h=te(a,"/api/media/upload",i.appPid),l=b.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},$e=b.lazy(()=>ye(()=>import("./index-D4YNeVBT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=b.useState(!1),{t:o,locale:f}=z(),d=b.useRef(null),{api:y}=B(),{teamDid:g}=$(),{control:u,handleSubmit:W,formState:{errors:m},watch:T,setValue:R,getValues:N}=ue({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||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),s=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:P}=ee(x),E=t=>{t!=="profile:read"&&R("scope",s.includes(t)?s.filter(p=>p!==t):[...s,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||o("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(M,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[o("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:o("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(D,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:o(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx($e,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(N()).then(()=>{a()}).catch(p=>{H.error(p.message||o("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:P,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:o("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:u,rules:{required:o("oauth.client.validate.clientName"),minLength:{value:3,message:o("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(v,{children:o("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:u,rules:{required:o("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:o("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(v,{children:o("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:u,rules:{required:o("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:o("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(v,{children:o("oauth.client.helperText.redirectUris")})]})})}),e.jsx(S,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:o("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:o("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(oe,{checked:s.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:o("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(S,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:o("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(v,{children:o("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:o("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:o("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(v,{children:o("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:o("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:o("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(v,{children:o("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(se,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(D,{onClick:i,children:o("common.cancel")}),e.jsx(D,{onClick:W(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(Q,{size:16}):o("common.update")})]})]})}he.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,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.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,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=z(),{api:o}=B(),{teamDid:f}=$(),d=()=>{h()},y=async()=>{try{await o.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{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})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=z(),{teamDid:l}=$(),{clientName:o,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:W,contacts:m,tosUri:T,policyUri:R,jwksUri:N,jwks:s,softwareId:x,softwareVersion:A,clientIdIssuedAt:P,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(W),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:o},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(C,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(C,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(C,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(C,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(Z,{scope:g})},{label:i("oauth.client.createUser"),value:_?De(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(C,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(C,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(C,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(C,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:N},{label:i("oauth.client.jwks"),value:s},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:P?e.jsx(V,{value:P*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(M,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(K,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsx(c,{sx:{mt:1},children:U.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==U.length-1&&e.jsx(J,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function Ue({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function Et(){const[r,a]=b.useState({searchText:"",pageSize:10,page:1}),[i,h]=b.useState(null),[l,o]=b.useState(!1),f=b.useRef(null),{t:d,locale:y}=z(),{api:g}=B(),{teamDid:u}=$(),[W,m]=b.useState(null),[T,R]=b.useState(null),N=ze(),{getClientLogoUrl:s}=ee(),x=ke(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,P=b.useMemo(()=>x.value?.list||[],[x.value?.list]),E=b.useMemo(()=>r.searchText?P.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):P,[r.searchText,P]),O=b.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],U=s(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:U,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(Z,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Re,{showDid:!0,did:t,cardType:Ae.Detailed,infoType:Ee.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Se,{}),text:d("common.edit"),onClick:U=>{U.stopPropagation(),m(j)}},{icon:e.jsx(Ie,{}),text:d("common.delete"),onClick:U=>{U.stopPropagation(),R(j)}}]})}}}],[E,d,s,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(U=>({...U,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(U=>({...U,searchText:"",page:t+1})):r.searchText!==j&&a(U=>({...U,searchText:j,page:1}))};return e.jsxs(c,{ref:f,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(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(Ce,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const U=E[p];h(U)}}},onChange:_,title:N?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(D,{variant:"contained",size:"small",onClick:()=>o(!0),children:[A?e.jsx(Q,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(ve,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(Ue,{open:l,onCreated:()=>{o(!1),x.retry()},onClose:()=>o(!1)}),W&&e.jsx(me,{client:W,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{Et as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-_X8imDSe.js","assets/index-BVAv5IrJ.js","assets/vendor-mui-core-Bz-X9hX7.js","assets/vendor-react-x2lQvn4m.js","assets/vendor-ux-BArADSzA.js","assets/vendor-utils-CtD44yV-.js","assets/vendor-hooks-CwHgeAuk.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-DKbvje4v.js","assets/index-DrVXX4fX.css","assets/index-MGxe3V9B.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as b,a as be}from"./vendor-react-x2lQvn4m.js";import{T as z,H,_ as ye,$ as re,A as V,D as Ce,C as ve}from"./vendor-ux-BArADSzA.js";import{j as e,a1 as M,bB as K,I as X,aj as G,a3 as Y,b1 as q,T as I,ak as c,G as w,F as v,b7 as Te,b5 as le,b6 as ne,C as oe,a7 as J,aX as se,W as ae,V as D,p as Q,$ as n,am as we,cf as ce,cg as Se,c9 as Ie}from"./vendor-mui-core-Bz-X9hX7.js";import{g as Re,a as Ee,l as Ae}from"./index-ZnnRM00W.js";import{u as ke}from"./dot-DLj9aDwC.js";import{r as We}from"./index-Dk6JQKfz.js";import{_ as B,c as k,Y as Ne}from"./index-BVAv5IrJ.js";import{u as $}from"./dashboard-DUhl5uLq.js";import{u as ue,C as S}from"./index.esm-BONQrRCU.js";import{o as Pe,b as qe,C as te}from"./vendor-utils-CtD44yV-.js";import{T as Oe}from"./index-BXjxtue_.js";import{E as Le}from"./empty-spinner-Bi1Cb9b7.js";import{C}from"./click-to-copy-B6s5Z4cq.js";import{D as _e}from"./delete-confirm-DxvPCnQ2.js";import{a as De}from"./passport-item-Byi-8gTO.js";import{A as Fe}from"./actions-DK8uxYzD.js";import{T as ie}from"./table-tips-CMqGfw3-.js";import{u as ze}from"./use-mobile-BkNZycG6.js";import"./vendor-hooks-CwHgeAuk.js";import"./lottie-web-4koyQiv_.js";import"./useAsync-Ct43XAf7.js";import"./vendor-arcblock-DKbvje4v.js";import"./useLocalStorage-C30Mdv9U.js";import"./index-DBs9Ljax.js";import"./confirm-DAb9dboO.js";import"./get-safe-url-BK7rZ--W.js";import"./session-CFTmeC0_.js";import"./use-blocklet-logo-CudOf_wh.js";import"./useSetState-BWrXo9eH.js";import"./index-XuUrUf8b.js";import"./over-due-invoice-payment-azmcP3Sx.js";import"./use-mobile-BgklPLaO.js";import"./arrow-down.svg-DR5noAvr.js";import"./vendor-mui-x-Cgnunrow.js";import"./AdapterDayjs-BeqEJUig.js";import"./did-address-COwwd6H0.js";import"./util-DakLk8kj.js";import"./base32-vvndof6f.js";var de=We();const Be={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=b.useState(!1),{t:l,locale:o}=z(),{api:f}=B(),{teamDid:d}=$(),{control:y,handleSubmit:g,formState:{errors:u},watch:W,setValue:m}=ue({defaultValues:Be,mode:"onChange"}),T=W("scope"),R=s=>{s!=="profile:read"&&m("scope",T.includes(s)?T.filter(x=>x!==s):[...T,s])},N=async s=>{h(!0);try{const x={...s,redirectUris:s.redirectUris,contacts:s.contacts?s.contacts.split(",").map(A=>A.trim()):[],scope:s.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Pe(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(M,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(v,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(v,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(v,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(v,{children:l("oauth.client.helperText.read")}),e.jsx(v,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${o}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(v,{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(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([s,x])=>e.jsx(ne,{control:e.jsx(oe,{checked:T.includes(s),onChange:()=>R(s),disabled:s==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:x})})},s))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(S,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:s})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(v,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:s})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(v,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:s})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...s,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(v,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(se,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(D,{onClick:a,children:l("common.cancel")}),e.jsxs(D,{onClick:g(N),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Q,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function Z({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(be.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(C,{children:h})})},h))})}Z.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=B(),{blocklet:i}=Ne(),h=te(a,"/api/media/upload",i.appPid),l=b.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},$e=b.lazy(()=>ye(()=>import("./index-_X8imDSe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=b.useState(!1),{t:o,locale:f}=z(),d=b.useRef(null),{api:y}=B(),{teamDid:g}=$(),{control:u,handleSubmit:W,formState:{errors:m},watch:T,setValue:R,getValues:N}=ue({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||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),s=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:P}=ee(x),E=t=>{t!=="profile:read"&&R("scope",s.includes(t)?s.filter(p=>p!==t):[...s,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||o("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(M,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[o("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:o("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(D,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:o(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx($e,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(N()).then(()=>{a()}).catch(p=>{H.error(p.message||o("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:P,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:o("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:u,rules:{required:o("oauth.client.validate.clientName"),minLength:{value:3,message:o("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(v,{children:o("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:u,rules:{required:o("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:o("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(v,{children:o("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:u,rules:{required:o("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:o("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(v,{children:o("oauth.client.helperText.redirectUris")})]})})}),e.jsx(S,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:o("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:o("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(oe,{checked:s.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:o("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(S,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:o("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:o("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(v,{children:o("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:o("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:o("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(v,{children:o("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:o("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:o("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(v,{children:o("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(se,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(D,{onClick:i,children:o("common.cancel")}),e.jsx(D,{onClick:W(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(Q,{size:16}):o("common.update")})]})]})}he.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,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.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,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=z(),{api:o}=B(),{teamDid:f}=$(),d=()=>{h()},y=async()=>{try{await o.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{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})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=z(),{teamDid:l}=$(),{clientName:o,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:W,contacts:m,tosUri:T,policyUri:R,jwksUri:N,jwks:s,softwareId:x,softwareVersion:A,clientIdIssuedAt:P,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(W),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:o},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(C,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(C,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(C,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(C,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(Z,{scope:g})},{label:i("oauth.client.createUser"),value:_?De(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(C,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(C,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(C,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(C,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(C,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:N},{label:i("oauth.client.jwks"),value:s},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:P?e.jsx(V,{value:P*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(M,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(K,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsx(c,{sx:{mt:1},children:U.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==U.length-1&&e.jsx(J,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function Ue({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function Et(){const[r,a]=b.useState({searchText:"",pageSize:10,page:1}),[i,h]=b.useState(null),[l,o]=b.useState(!1),f=b.useRef(null),{t:d,locale:y}=z(),{api:g}=B(),{teamDid:u}=$(),[W,m]=b.useState(null),[T,R]=b.useState(null),N=ze(),{getClientLogoUrl:s}=ee(),x=ke(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,P=b.useMemo(()=>x.value?.list||[],[x.value?.list]),E=b.useMemo(()=>r.searchText?P.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):P,[r.searchText,P]),O=b.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],U=s(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:U,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(Z,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Re,{showDid:!0,did:t,cardType:Ae.Detailed,infoType:Ee.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Se,{}),text:d("common.edit"),onClick:U=>{U.stopPropagation(),m(j)}},{icon:e.jsx(Ie,{}),text:d("common.delete"),onClick:U=>{U.stopPropagation(),R(j)}}]})}}}],[E,d,s,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(U=>({...U,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(U=>({...U,searchText:"",page:t+1})):r.searchText!==j&&a(U=>({...U,searchText:j,page:1}))};return e.jsxs(c,{ref:f,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(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(Ce,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const U=E[p];h(U)}}},onChange:_,title:N?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(D,{variant:"contained",size:"small",onClick:()=>o(!0),children:[A?e.jsx(Q,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(ve,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(Ue,{open:l,onCreated:()=>{o(!1),x.retry()},onClose:()=>o(!1)}),W&&e.jsx(me,{client:W,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{Et as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o}from"./vendor-react-x2lQvn4m.js";import{j as t,b4 as _,$ as n,J as O,n as xe,b0 as ye,cy as be,cz as ve,cA as je,cB as we,ak as g,T as q,V as ke,a$ as te,a7 as Ie,s as Me,O as Re,I as Ce,at as Ae}from"./vendor-mui-core-Bz-X9hX7.js";import{f as D,a as F,h as Te}from"./vendor-hooks-CFpNP5Ql.js";import{T as J,A as Ne,I as ne,b as re,S as $e}from"./vendor-ux-D2yvD18l.js";import{t as Se}from"./server-logo-notext.svg-BqCXmsOm.js";import{B as ze}from"./bundle-avatar-DoaTu2bf.js";import{a as Le,g as se,i as ie,b as oe,d as V,M as ae,e as Ee,m as De,f as Be,h as Pe,c as qe,j as Ve,k as _e,l as Oe,n as Fe,N as He}from"./use-blocklet-logo-CjoRB6rM.js";import{R as Ue,J as We,C as K,a as H}from"./vendor-utils-Vke2d2wu.js";import{c as Je,_ as Ke}from"./index-BpP1Znfh.js";import{g as Qe,a as Xe,l as Ge}from"./index-wBG-OAs3.js";import{p as Ye}from"./util-Dp7qZZRR.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 Q({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=J(),[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})}Q.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=O(),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(K(Je.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(Qe,{user:u,showDid:!0,cardType:Ge.AvatarOnly,infoType:Xe.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};X.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 X({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=O(),{t:d}=J(),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=F(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:K(i,x.metaLink):null}),C=F((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(X,{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(Q,{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:K(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,mt:1.5},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-x2lQvn4m.js";import{j as t,b4 as _,$ as n,J as O,n as xe,b0 as ye,cy as be,cz as ve,cA as je,cB as we,ak as g,T as q,V as ke,a$ as te,a7 as Ie,s as Me,O as Re,I as Ce,at as Ae}from"./vendor-mui-core-Bz-X9hX7.js";import{f as D,a as F,h as Te}from"./vendor-hooks-CwHgeAuk.js";import{T as J,A as Ne,I as ne,b as re,S as $e}from"./vendor-ux-BArADSzA.js";import{t as Se}from"./server-logo-notext.svg-BqCXmsOm.js";import{B as ze}from"./bundle-avatar-D1U8n6sJ.js";import{a as Le,g as se,i as ie,b as oe,d as V,M as ae,e as Ee,m as De,f as Be,h as Pe,c as qe,j as Ve,k as _e,l as Oe,n as Fe,N as He}from"./use-blocklet-logo-CudOf_wh.js";import{R as Ue,J as We,C as K,a as H}from"./vendor-utils-CtD44yV-.js";import{c as Je,_ as Ke}from"./index-BVAv5IrJ.js";import{g as Qe,a as Xe,l as Ge}from"./index-ZnnRM00W.js";import{p as Ye}from"./util-DakLk8kj.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 Q({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=J(),[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})}Q.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=O(),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(K(Je.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(Qe,{user:u,showDid:!0,cardType:Ge.AvatarOnly,infoType:Xe.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};X.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 X({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=O(),{t:d}=J(),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=F(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:K(i,x.metaLink):null}),C=F((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(X,{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(Q,{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:K(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,mt:1.5},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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./vendor-mui-core-Bz-X9hX7.js";import"./vendor-react-x2lQvn4m.js";import{S as t}from"./studio-CRXYSEnV.js";import"./vendor-ux-BArADSzA.js";import"./vendor-utils-CtD44yV-.js";import"./vendor-hooks-CwHgeAuk.js";import"./lottie-web-4koyQiv_.js";import"./index-XuUrUf8b.js";import"./index-BVAv5IrJ.js";import"./vendor-arcblock-DKbvje4v.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|