@abtnode/blocklet-services 1.16.43-beta-20250508-132430-79f0da2d → 1.16.43-beta-20250509-094134-34c76f98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/services/auth/session.js +9 -12
- package/dist/assets/{AdapterDayjs-DdJ4VT-y.js → AdapterDayjs-DWoymUZR.js} +1 -1
- package/dist/assets/{ArrowDropDown-eLxSrK0e.js → ArrowDropDown-oIFrKvRQ.js} +1 -1
- package/dist/assets/{CheckCircle-DxRgzKvx.js → CheckCircle-DKTlmPGr.js} +1 -1
- package/dist/assets/{ChevronLeft-B15pinY6.js → ChevronLeft-CFwnl5kG.js} +1 -1
- package/dist/assets/{ChevronRight-B2sjje0T.js → ChevronRight-8T5vdE8C.js} +1 -1
- package/dist/assets/{Community-HWgwjOzD.js → Community-BUrh_Kqh.js} +1 -1
- package/dist/assets/{DeleteOutline-DYyAnzFX.js → DeleteOutline-1ZpdOBb4.js} +1 -1
- package/dist/assets/{Done-CiSqPhhR.js → Done-1iBqzwts.js} +1 -1
- package/dist/assets/{Download-Zxb7WMKn.js → Download-BZiCoF-V.js} +1 -1
- package/dist/assets/{Edit-RoUmIPTL.js → Edit-BGameSEw.js} +1 -1
- package/dist/assets/{EditIcon-_JnvyTnF.js → EditIcon-Tb4i_lkD.js} +1 -1
- package/dist/assets/{Email-22EBBQEA.js → Email-DVjqqt2m.js} +1 -1
- package/dist/assets/{Error-C782OBuj.js → Error-DmLM9r9y.js} +1 -1
- package/dist/assets/{ExpandLess-CJztBroj.js → ExpandLess-mzw0LYV7.js} +1 -1
- package/dist/assets/{Google-DwaWO1n0.js → Google-DknSY4FA.js} +1 -1
- package/dist/assets/{Holiday-Lj9LTNQ5.js → Holiday-Aqm_6mkn.js} +1 -1
- package/dist/assets/{InfoOutlined-BCqZENBx.js → InfoOutlined-BMdv5FNj.js} +1 -1
- package/dist/assets/{Launch-BbLsJvEN.js → Launch-BGXBIBAE.js} +1 -1
- package/dist/assets/{LaunchOutlined-BdTDYYqz.js → LaunchOutlined-C1cAhHQM.js} +1 -1
- package/dist/assets/{Location-R9yMI3QX.js → Location-9D-5nMVA.js} +1 -1
- package/dist/assets/{LockIcon-DEqu2BZe.js → LockIcon-DJgkKDXB.js} +1 -1
- package/dist/assets/{Meeting-CYNfXiDR.js → Meeting-Drc_0V1u.js} +1 -1
- package/dist/assets/{MoreHoriz-Bp9phGCA.js → MoreHoriz-KJHmH0lv.js} +1 -1
- package/dist/assets/{OffSick-BWarRVS4.js → OffSick-C991mOvw.js} +1 -1
- package/dist/assets/{Phone-Df90pdBA.js → Phone-BfBgFKKG.js} +1 -1
- package/dist/assets/{PlayArrow-qTn22j6x.js → PlayArrow-CY4IxSfG.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DV5837_n.js → QuestionMarkCircle-dkY86QWO.js} +1 -1
- package/dist/assets/{ServerLogo-7OspbhQZ.js → ServerLogo-BTwLn5Zv.js} +1 -1
- package/dist/assets/{Timezone-BfjUkoy7.js → Timezone-BWB21Pdc.js} +1 -1
- package/dist/assets/{TuneOutlined-BkH0zJXZ.js → TuneOutlined-BEZh1SVU.js} +1 -1
- package/dist/assets/{ViewList-BBNBkCo1.js → ViewList-BwVW4Mbn.js} +1 -1
- package/dist/assets/{WorkingRemotely-C3lk6KRk.js → WorkingRemotely-DHNo6euv.js} +1 -1
- package/dist/assets/{access-control-DVj3Uudk.js → access-control-BULUPRVa.js} +1 -1
- package/dist/assets/{actions-CcV0Tb1p.js → actions-7FcWNRsN.js} +1 -1
- package/dist/assets/{add-component-core-BxVPX1qJ.js → add-component-core-BMiZ7LE5.js} +13 -13
- package/dist/assets/{add-resource-CR93luK2.js → add-resource-j8u2ovZD.js} +1 -1
- package/dist/assets/{addon-igarTbiO.js → addon-vARTsq3u.js} +1 -1
- package/dist/assets/advanced-u-DAzAIF.js +14 -0
- package/dist/assets/api-BjteVZFg.js +1 -0
- package/dist/assets/{appearance-CuEL_wAd.js → appearance-DROrcrHA.js} +1 -1
- package/dist/assets/{audit-logs-DXfN0Akp.js → audit-logs-CcVb9ghw.js} +2 -2
- package/dist/assets/{authorize-DyX7LBCN.js → authorize-ChpWebj3.js} +1 -1
- package/dist/assets/{base32-sa8QWx2s.js → base32-HzVjc8tz.js} +1 -1
- package/dist/assets/{branding-B8w6MlXP.js → branding-BbyygUCZ.js} +2 -2
- package/dist/assets/{branding-CVWmoAus.js → branding-Be5nWHmr.js} +1 -1
- package/dist/assets/{bundle-avatar-DJNl27pn.js → bundle-avatar-CkhAjy4c.js} +1 -1
- package/dist/assets/button-Bk6R99H4.js +1 -0
- package/dist/assets/click-to-copy-CzMRt9dA.js +1 -0
- package/dist/assets/{cloneDeep-DBPWtvi_.js → cloneDeep-UpFQ2VNg.js} +1 -1
- package/dist/assets/{complete-jXf2IsN1.js → complete-B8pYAeSZ.js} +1 -1
- package/dist/assets/{component-DFHLfmfe.js → component-B79RqFMg.js} +1 -1
- package/dist/assets/{config-E-Dkdpbo.js → config-Cr_HvxTH.js} +1 -1
- package/dist/assets/{config-navigation-BbbAAFTA.js → config-navigation-BEcY6Wrz.js} +3 -3
- package/dist/assets/{config-space-B3L4cc62.js → config-space-CxYC75c6.js} +1 -1
- package/dist/assets/{config-DIa982AP.js → config-zGEZcVMw.js} +1 -1
- package/dist/assets/{confirm-CHZbNj0g.js → confirm-qyOtSX3L.js} +1 -1
- package/dist/assets/{connect-60F826H5.js → connect-D3ZxLXkG.js} +1 -1
- package/dist/assets/{connect-xMiXau0y.js → connect-sAGOXOYo.js} +1 -1
- package/dist/assets/{connect-to-Do1R8dL3.js → connect-to-DjFFSoXW.js} +1 -1
- package/dist/assets/{content-layout-clTZd0qL.js → content-layout-HQq6mBBk.js} +1 -1
- package/dist/assets/{dashboard-BjhEdRo6.js → dashboard-CuF4binC.js} +12 -12
- package/dist/assets/{delete-confirm-D-jVITSf.js → delete-confirm-DQ_YJQpj.js} +1 -1
- package/dist/assets/{did-address-anPrguG7.js → did-address-Dd9R3pkY.js} +1 -1
- package/dist/assets/{domain-CYWI_G__.js → domain-B2_scx4B.js} +1 -1
- package/dist/assets/{domain-action-card-CDfoYMjV.js → domain-action-card-DE7xLk29.js} +1 -1
- package/dist/assets/domains-bZXw9tDX.js +1 -0
- package/dist/assets/{dot-Bc3KtmUA.js → dot-B5LFAb8e.js} +1 -1
- package/dist/assets/{email-CQL_CvUV.js → email-CWYkPTia.js} +1 -1
- package/dist/assets/{empty-spinner-Bm-LVesB.js → empty-spinner-g1Jw7iuj.js} +1 -1
- package/dist/assets/{exchange-passport-nsHr64lM.js → exchange-passport-BbC_bBga.js} +1 -1
- package/dist/assets/{fuel-BEbwZqYG.js → fuel-BdagEU33.js} +1 -1
- package/dist/assets/{gen-access-key-DsEy5ZlI.js → gen-access-key-Cf76OFN7.js} +1 -1
- package/dist/assets/get-safe-url-Dh8rhVin.js +1 -0
- package/dist/assets/get-safe-url-_fT029s-.js +1 -0
- package/dist/assets/{home-DUvgZ0gR.js → home-BSxVGonp.js} +1 -1
- package/dist/assets/{iframe-D7qMCC0L.js → iframe-DXRYs3PX.js} +1 -1
- package/dist/assets/{index-iTlCZ1FK.js → index-B9xM_Hng.js} +1 -1
- package/dist/assets/{index-BUwaZJ5Y.js → index-BFsMuPKK.js} +4 -4
- package/dist/assets/{index-DFkZuM1_.js → index-BPuJmMx-.js} +1 -1
- package/dist/assets/{index-DyU89GO9.js → index-BQJa9ZJC.js} +1 -1
- package/dist/assets/{index-Bpz-SuLt.js → index-BSuIcvk6.js} +12 -12
- package/dist/assets/{index-CiWjpC34.js → index-Bs1kxR8_.js} +1 -1
- package/dist/assets/{index-DiZbt9Ww.js → index-C-RHInKj.js} +4 -4
- package/dist/assets/{index-hgktawrH.js → index-CXDRY0Gs.js} +1 -1
- package/dist/assets/{index-B1yanBlZ.js → index-Cc-_2bD1.js} +1 -1
- package/dist/assets/{index-w68bai-3.js → index-Cy1Hvxt0.js} +1 -1
- package/dist/assets/{index-BJfBmMvG.js → index-CzGXBMFc.js} +1 -1
- package/dist/assets/{index-Pu5My3eU.js → index-DEsvwKlq.js} +1 -1
- package/dist/assets/{index-CYz41Upz.js → index-DF0z_zii.js} +1 -1
- package/dist/assets/{index-OVTGvi9j.js → index-DW75AsWb.js} +1 -1
- package/dist/assets/{index-BmpX2Oqa.js → index-Djpx18Tz.js} +2 -2
- package/dist/assets/{index-DQncaTCr.js → index-DpW-Ik8u.js} +9 -9
- package/dist/assets/{index-egCz4jdE.js → index-TE82Z_py.js} +1 -1
- package/dist/assets/{index-DBajhv2h.js → index-aMtQhU6T.js} +18 -18
- package/dist/assets/{index-CZqp_6Zr.js → index-aQxEawZE.js} +14 -14
- package/dist/assets/{index-Ctbrsvlm.js → index-cs-08BqN.js} +4 -4
- package/dist/assets/{index-0ncGiO4u.js → index-ftkgQlGr.js} +1 -1
- package/dist/assets/{index-DZ9Jqm_w.js → index-m_po8k60.js} +2 -2
- package/dist/assets/{index-pvu3nbgn.js → index-mbuQZLIX.js} +1 -1
- package/dist/assets/{index-B6vKQTr4.js → index-yiU4BWrm.js} +1 -1
- package/dist/assets/{invitation-DqKIvv6t.js → invitation-B8tJTJsE.js} +1 -1
- package/dist/assets/{invite-uMWH0SpB.js → invite-EdScAUQO.js} +1 -1
- package/dist/assets/{issue-passport-BurnsPQZ.js → issue-passport-CStwxDqe.js} +1 -1
- package/dist/assets/{item-C69diC1y.js → item-B4NAOVBY.js} +2 -2
- package/dist/assets/{landing-page-CUkHfAZ5.js → landing-page-CBb5_s7o.js} +1 -1
- package/dist/assets/{launch-result-message-CiDoyZ_1.js → launch-result-message-mW7oxgKT.js} +1 -1
- package/dist/assets/{layout-CLOmXrMq.js → layout-uc9mKcbg.js} +1 -1
- package/dist/assets/{list-D69IwVXI.js → list-BK68Cxh8.js} +8 -8
- package/dist/assets/{list-header-D9r1Z68x.js → list-header-D4MXeBc7.js} +1 -1
- package/dist/assets/localization-CJlgb0T8.js +1 -0
- package/dist/assets/{log-CskQJ4o-.js → log-BdBIH8S_.js} +1 -1
- package/dist/assets/{logger-D6jfI5U_.js → logger-DCttRmHI.js} +1 -1
- package/dist/assets/{login-DWvvPy3b.js → login-CKa2oQPz.js} +1 -1
- package/dist/assets/{login-oauth-callback-gLyMSemT.js → login-oauth-callback-DVRZRaip.js} +1 -1
- package/dist/assets/{logo-uploader-D5rcqbIA.js → logo-uploader-DRH-fnyc.js} +3 -3
- package/dist/assets/{lost-passport-BWY_TJIl.js → lost-passport-ClMglNv0.js} +1 -1
- package/dist/assets/{omit-CM6MPIu5.js → omit-D2k92RIF.js} +1 -1
- package/dist/assets/{open-window-DKiwPBLK.js → open-window-Cu3fShwR.js} +1 -1
- package/dist/assets/{overview-DedgPJyh.js → overview-D5q1KD9x.js} +1 -1
- package/dist/assets/{page-header-D7vhn9dN.js → page-header-C1NOmuYB.js} +1 -1
- package/dist/assets/{passport-item-B45OGe4c.js → passport-item-CjxzZUKR.js} +1 -1
- package/dist/assets/{permission-6aZ4MNgh.js → permission-DzaDpKIW.js} +1 -1
- package/dist/assets/preferences-Dmcgwjhp.js +1 -0
- package/dist/assets/profile-embed-DsYLFLkt.js +1 -0
- package/dist/assets/publish-resource--xDHKiTt.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DPnGSgvn.js → react-beautiful-dnd.esm-CrdGz16R.js} +1 -1
- package/dist/assets/{relative-time-CKENJIpb.js → relative-time-tY0x-ayF.js} +1 -1
- package/dist/assets/{runtime-Dfcxeun4.js → runtime-CRViKGyG.js} +1 -1
- package/dist/assets/sdk-D0dqnQoQ.js +1 -0
- package/dist/assets/{security-zb06EOxl.js → security-fwRPOvQx.js} +1 -1
- package/dist/assets/{session-Ir9UAnhf.js → session-xl6Fb2Wm.js} +1 -1
- package/dist/assets/{setup-Pi8eih8l.js → setup-KZaDiyeL.js} +3 -3
- package/dist/assets/{shorten-label-DTcisg7Q.js → shorten-label-srsBvHNw.js} +1 -1
- package/dist/assets/{simple-select-DpNtA3N5.js → simple-select-DyL9G1FX.js} +1 -1
- package/dist/assets/{slicedToArray-CM_xB2K2.js → slicedToArray-B3Jznk0w.js} +1 -1
- package/dist/assets/{spaces-DfgQftqB.js → spaces-BtThOmfG.js} +1 -1
- package/dist/assets/{start-CnF5I9iM.js → start-DNZ-ulwN.js} +1 -1
- package/dist/assets/{starting-progress-CUkPGiLq.js → starting-progress-CN1sTPnO.js} +1 -1
- package/dist/assets/{status-w7wNdwd8.js → status-kLLmMBy7.js} +1 -1
- package/dist/assets/{step-actions-CvAYbv4K.js → step-actions-DSriMOaL.js} +1 -1
- package/dist/assets/{studio-mvCiDQFy.js → studio-CqjHflyE.js} +1 -1
- package/dist/assets/{switch-control-BP0JyiwP.js → switch-control-DsHfwUN7.js} +1 -1
- package/dist/assets/{traffic-Bo3Bp96o.js → traffic-38eCC37i.js} +1 -1
- package/dist/assets/{transfer-DsERsnl1.js → transfer-zdDZ9_KG.js} +1 -1
- package/dist/assets/{unsubscribe-l6QkVxmr.js → unsubscribe-DiFsgDJ8.js} +1 -1
- package/dist/assets/use-blocklet-logo-OwFyCoUV.js +1 -0
- package/dist/assets/{use-mobile-BleYjZfN.js → use-mobile-B-WdQWoB.js} +1 -1
- package/dist/assets/{use-mobile-BnYZ5d8f.js → use-mobile-PBkFclTq.js} +1 -1
- package/dist/assets/{useAsync-BTtZas5A.js → useAsync-DV3NyLhI.js} +1 -1
- package/dist/assets/{useLocalStorage-C7usthsI.js → useLocalStorage-DeyICx-h.js} +1 -1
- package/dist/assets/{user-center-CSjvhqGU.js → user-center-D-0-UOTc.js} +1 -1
- package/dist/assets/{util-CRVGSd5f.js → util-CZd-jYUF.js} +1 -1
- package/dist/assets/{util-CKfiFLd5.js → util-DStpLP3f.js} +1 -1
- package/dist/assets/{vendor-arcblock-Bi9JkCAO.js → vendor-arcblock-CORkwLwW.js} +5 -5
- package/dist/assets/{vendor-hooks-zv9Oe7Yx.js → vendor-hooks-rDgu5KV9.js} +1 -1
- package/dist/assets/{vendor-mui-core-FzKVVAue.js → vendor-mui-core-DMvlMpwf.js} +1 -1
- package/dist/assets/{vendor-mui-x-B9zuOzS0.js → vendor-mui-x-mcVodcG2.js} +1 -1
- package/dist/assets/vendor-utils-rHXShPKm.js +208 -0
- package/dist/assets/vendor-ux-did-connect-akcz-Ldw.js +2296 -0
- package/dist/assets/{wrap-locale-BmmKAsYR.js → wrap-locale-NyChvVhT.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/service-worker.js +1 -1
- package/package.json +30 -30
- package/dist/assets/advanced-C22Mc4mt.js +0 -14
- package/dist/assets/api-DPHyou8y.js +0 -1
- package/dist/assets/button-D0USBc4l.js +0 -1
- package/dist/assets/click-to-copy-Dhxc_blG.js +0 -1
- package/dist/assets/domains-D-YYFzTK.js +0 -1
- package/dist/assets/get-safe-url-CH0a4wzx.js +0 -1
- package/dist/assets/get-safe-url-Cn647BYQ.js +0 -1
- package/dist/assets/localization-CAh5vCty.js +0 -1
- package/dist/assets/preferences-DU_A8Q43.js +0 -1
- package/dist/assets/profile-embed-B8hvxRm0.js +0 -1
- package/dist/assets/publish-resource-riTnsr3y.js +0 -1
- package/dist/assets/sdk-DUAPwTSQ.js +0 -1
- package/dist/assets/use-blocklet-logo-BiDCl8v3.js +0 -2
- package/dist/assets/vendor-utils-lR6P1BXz.js +0 -208
- package/dist/assets/vendor-ux-did-connect-CaDmrsW1.js +0 -2296
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m as oe}from"./vendor-hooks-
|
|
1
|
+
import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m as oe}from"./vendor-hooks-rDgu5KV9.js";import{j as e,aa as g,H as w,ah as H,E as pt,T as E,X as ut,al as te,ad as Y,ab as M,ak as Me,a9 as mt,I as q,O as W,q as ie,N as ft,bs as $e,co as Oe,cp as ee,bV as We,br as qe,by as ht,bt as xt,bS as gt,v as yt,y as jt,bo as vt,s as bt}from"./vendor-mui-core-DMvlMpwf.js";import{u as L,am as U,as as Ct,_ as F,a7 as xe,j as G,aN as St,B as _,r as Tt,a0 as ge,bv as He,h as wt,b7 as Pt,bP as Fe,bi as It,bu as Rt}from"./vendor-ux-did-connect-akcz-Ldw.js";import{z as A,l as ne,t as Ue,U as J,C as Dt,ac as kt,f as Ft,b as re,aw as At,R as Ge}from"./index-BFsMuPKK.js";import{w as Nt,c as Lt,M as ye,$ as X}from"./vendor-arcblock-CORkwLwW.js";import{W as je}from"./did-address-Dd9R3pkY.js";import{u as $}from"./dashboard-CuF4binC.js";import{r as ve,a as be,b as Ce,c as le,d as Bt,e as Ve,u as zt,f as _t}from"./passport-item-CjxzZUKR.js";import{p as Ke}from"./util-CZd-jYUF.js";import{w as V,P as Ye}from"./permission-DzaDpKIW.js";import{C as Et}from"./Google-DknSY4FA.js";import{M as Z,aA as Mt,K as $t}from"./vendor-utils-rHXShPKm.js";import{E as ce}from"./EditIcon-Tb4i_lkD.js";import{C as Se}from"./confirm-qyOtSX3L.js";import{L as Ze}from"./list-header-D4MXeBc7.js";import{f as se}from"./format-error-BrmqJs5a.js";import{_ as Ot}from"./useSetState-CWq0AVWn.js";import{L as Wt}from"./LockIcon-DJgkKDXB.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DeyICx-h.js";import"./PlayArrow-CY4IxSfG.js";import"./get-safe-url-_fT029s-.js";import"./session-xl6Fb2Wm.js";import"./use-blocklet-logo-OwFyCoUV.js";import"./InfoOutlined-BMdv5FNj.js";import"./dot-B5LFAb8e.js";import"./useAsync-DV3NyLhI.js";import"./use-mobile-PBkFclTq.js";import"./index-mbuQZLIX.js";import"./Phone-BfBgFKKG.js";import"./Location-9D-5nMVA.js";import"./Email-DVjqqt2m.js";import"./Timezone-BWB21Pdc.js";import"./base32-HzVjc8tz.js";import"./cloneDeep-UpFQ2VNg.js";const Ae="info";function Te({createPassportSvg:c,passport:o,onCancel:d,onSwitchPassport:f}){const{t:u}=L(),l=dt({tab:Ae}),h={info:{label:u("common.basicInfo"),value:Ae,component:()=>e.jsx(Je,{passport:o,createPassportSvg:c})},logs:{label:u("common.logs"),value:"logs",component:()=>e.jsx(et,{passport:o})},related:{label:u("team.passport.related"),value:"related",component:()=>e.jsx(tt,{passport:o,onSwitchPassport:f})}},s=Object.values(h).map(({label:n,value:t})=>({label:n,value:t})).filter(n=>n.value==="related"?o.parentDid:!0),m=h[l.tab]||h.info,a=n=>{l.tab=n};return e.jsx(U,{title:u("common.passport"),onClose:d,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(qt,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Ct,{tabs:s,current:l.tab,onChange:a,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(m.component,{})})]})})}Te.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};Te.defaultProps={onSwitchPassport:()=>{}};const qt=H(g)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|
|
@@ -9,7 +9,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
9
9
|
.body {
|
|
10
10
|
margin-top: 24px;
|
|
11
11
|
}
|
|
12
|
-
`;function Je({createPassportSvg:c,passport:o}){var m,a,n,t;const{t:d,locale:f}=L(),{teamDid:u}
|
|
12
|
+
`;function Je({createPassportSvg:c,passport:o}){var m,a,n,t;const{t:d,locale:f}=L(),{teamDid:u}=$(),{inService:l}=A(),h=[{items:[{label:d("common.role"),content:ve(o.title)},{label:d("common.did"),content:e.jsx(je,{did:o.id})},{label:d("team.passport.status"),content:be(o.status)},{label:d("common.type"),content:e.jsx(g,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(o.type||[]).map(r=>e.jsx(pt,{label:r,variant:"outlined",size:"small",sx:{borderRadius:1}},r))})}]}],s=[{title:d("team.passport.owner"),items:[{label:d("team.passport.owner"),content:e.jsx(g,{children:Ce(o.user,l)})}]},{title:d("common.timeInfo"),items:[{label:d("team.passport.issuanceTime"),content:o.issuanceDate?ne(o.issuanceDate,f):"-"},{label:d("team.member.lastLogin"),content:o.lastLoginAt?ne(o.lastLoginAt,f):"-"},{label:d("common.expires"),content:o.expirationDate?ne(o.expirationDate,f):"-"}]},{title:d("blocklet.overview.source"),items:[{label:d("blocklet.overview.source"),content:le(o.source)}]}];return e.jsxs(Ht,{gap:3,children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",overflow:"hidden",gap:5},children:[e.jsx(g,{sx:{display:"flex",p:1},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(m=o.user)==null?void 0:m.fullName,ownerDid:(a=o.user)==null?void 0:a.did,ownerAvatarUrl:(n=o.user)!=null&&n.avatar?Ke((t=o.user)==null?void 0:t.avatar,u,l):"",revoked:o.revoked,width:"200px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(g,{className:"info-area",children:h.map(r=>e.jsxs(g,{children:[r.title&&e.jsx(E,{variant:"h6",sx:{mb:2},children:r.title}),e.jsx(g,{className:"info-grid",sx:{gap:"12px !important"},children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",sx:{maxWidth:40},children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]}),e.jsx(ut,{}),e.jsx(g,{className:"info-area",children:s.map(r=>e.jsxs(g,{children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:r.title}),e.jsx(g,{className:"info-grid",children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]})}Je.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired};const Ht=H(te)`
|
|
13
13
|
.info-card {
|
|
14
14
|
margin-bottom: 24px;
|
|
15
15
|
overflow: hidden;
|
|
@@ -83,7 +83,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
83
83
|
margin: 0;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
`,Qe=10,Xe=1;function et({passport:c}){const{api:o}=A(),{teamDid:d}=O(),{t:f,locale:u}=L(),[l,h]=S.useState({pageSize:Qe,page:Xe}),{data:s,loading:m}=oe(async()=>{const y={teamDid:d,query:{passportId:c.id},paging:{page:l.page,pageSize:l.pageSize}},x=await o.getPassportLogs({input:y});return{logs:x.passportLogs||[],total:x.paging.total}},{refreshDeps:[l.page,l.pageSize],onError:y=>F.error(y.message)}),a=S.useMemo(()=>(s==null?void 0:s.logs)||[],[s==null?void 0:s.logs]),n=y=>{var x,p,v,j,T,C,I,D,N;return y.action===G.PASSPORT_LOG_ACTION.APPROVE||y.action===G.PASSPORT_LOG_ACTION.REVOKE?(p=(x=y==null?void 0:y.metadata)==null?void 0:x.operator)!=null&&p.fullName?`${f("common.operator")}: ${(j=(v=y==null?void 0:y.metadata)==null?void 0:v.operator)==null?void 0:j.fullName}`:null:y.action===G.PASSPORT_LOG_ACTION.ISSUE&&((T=y.metadata)==null?void 0:T.action)===G.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?(I=(C=y==null?void 0:y.metadata)==null?void 0:C.inviter)!=null&&I.fullName?`${f("common.inviter")}: ${(N=(D=y==null?void 0:y.metadata)==null?void 0:D.inviter)==null?void 0:N.fullName}`:null:`passportId: ${y.passportId}`},t=S.useMemo(()=>[{label:f("common.action"),name:"action",options:{customBodyRender:(y,{rowIndex:x})=>{var v;const p=a[x];return e.jsx(Y,{title:n(p),children:`${y} ${(v=p.metadata)!=null&&v.action?`(${p.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:y=>e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:y||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(y,{rowIndex:x})=>{const p=a[x];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[p.operatorUa&&e.jsx(g,{children:Bt(p.operatorUa)}),p.operatorUa&&e.jsx(Y,{title:p.operatorUa,children:e.jsx(Nt,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:f("common.createdAt"),name:"createdAt",options:{customBodyRender:y=>ne(y,u)}}],[f,u,a]),r=({page:y,rowsPerPage:x})=>{l.pageSize!==x?h(p=>({...p,pageSize:x,page:1})):l.page!==y+1&&h(p=>({...p,page:y+1}))},i={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:l.page-1,rowsPerPage:l.pageSize,count:(s==null?void 0:s.total)||0};return m?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsx(g,{children:e.jsx(xe,{className:"logs-table",verticalKeyWidth:100,locale:u,data:a,columns:t,options:i,loading:m,onChange:r})})}et.propTypes={passport:w.object.isRequired};function tt({passport:c,onSwitchPassport:o}){const{api:d}=A(),{teamDid:f}=O(),{t:u,locale:l}=L(),[h,s]=S.useState({pageSize:Qe,page:Xe}),{data:m,loading:a}=oe(async()=>{const x={teamDid:f,passportId:c.parentDid,paging:{page:h.page,pageSize:h.pageSize}},p=await d.getRelatedPassports({input:x});return{passports:p.passports||[],total:p.paging.total}},{refreshDeps:[h.page,h.pageSize],onError:x=>F.error(x.message)}),n=S.useMemo(()=>(m==null?void 0:m.passports)||[],[m==null?void 0:m.passports]),t=S.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:ve}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:Ce}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:x=>Ve(x,l)}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:le}}],[u,l]),r=({page:x,rowsPerPage:p})=>{h.pageSize!==p?s(v=>({...v,pageSize:p,page:1})):h.page!==x+1&&s(v=>({...v,page:x+1}))},i=S.useRef(null),y={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:h.page-1,rowsPerPage:h.pageSize,count:(m==null?void 0:m.total)||0,onRowClick(x,{dataIndex:p},v){var j;if((j=i.current)!=null&&j.contains(v.target)){const T=n[p];o(T)}}};return a?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsxs(te,{spacing:1,children:[e.jsx(Me,{severity:"warning",children:u("team.passport.relatedDescription")}),e.jsx(g,{ref:i,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(xe,{className:"related-table",verticalKeyWidth:100,locale:l,data:n.filter(x=>x.id!==c.id),columns:t,options:y,loading:a,onChange:r})})]})}tt.propTypes={passport:w.object.isRequired,onSwitchPassport:w.func.isRequired};function de({onCancel:c,onSuccess:o}){const{api:d}=A(),{blocklet:f}=Dt(),{t:u}=L(),[l,h]=S.useState(!1),s=(f.environments.find(r=>r.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",m=s==="auto"?St.getPassportColorFromDid(f.appDid):s,[a,n]=S.useState(m),t=async()=>{const r=[{key:Lt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:a}];try{h(!0),await d.configBlocklet({input:{did:f.meta.did,configs:r}}),o()}catch(i){F.error(i.message)}finally{h(!1)}};return e.jsx(U,{title:u("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:u("common.cancel")}),e.jsxs(_,{onClick:t,color:"primary",disabled:l,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[l&&e.jsx(M,{size:16}),u("common.save")]})]}),children:e.jsxs(g,{display:"flex",justifyContent:"center",alignItems:"center",className:"dialog-content",children:[e.jsx(Et,{disableAlpha:!0,color:a,onChange:r=>n(r.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:kt({scope:"passport",role:"owner",title:"Owner",issuer:Ft.getDisplayName(f),issuerDid:f.appDid,ownerName:"Your Name",ownerDid:f.appDid,preferredColor:a})}})]})})}const Ut=V(de,"mutate_team"),Gt=V(de,"",J);function Vt(c){const{inService:o}=A();return o?e.jsx(Gt,{...c}):e.jsx(Ut,{...c})}de.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired};de.defaultProps={};var Q=function(c){return e.jsx("svg",{...c,children:e.jsx("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})})};Q.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};Q.displayName="delete";var we={},Kt=mt;Object.defineProperty(we,"__esModule",{value:!0});var Pe=we.default=void 0,Yt=Kt(Tt()),Zt=e;Pe=we.default=(0,Yt.default)((0,Zt.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var st=function(o){return e.jsx("svg",{...o,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};st.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Jt=(c,o)=>c?!o.some(d=>!d.from.passport||!d.to.role):!1;function Ie({onCancel:c,onSuccess:o,data:d,trustedPassports:f}){const{api:u}=A(),{roles:l,teamDid:h}=O(),{t:s}=L(),[m,a]=S.useState(!1),[n,t]=S.useState(d.issuerDid||""),[r,i]=S.useState(d.remark||""),[y,x]=S.useState(Z(d.mappings)||[]),p=f.findIndex(j=>j.issuerDid===d.issuerDid),v=async()=>{if(m)return;const j={issuerDid:n,remark:r,mappings:y.map(C=>({...C,to:{...C.to,ttl:C.to.ttl||0}}))},T=[...f];p===-1?T.unshift(j):T[p]=j;try{a(!0),await u.configTrustedPassports({input:{teamDid:h,trustedPassports:T}}),await re(800),a(!1),F.success(s("common.saveSuccess")),o()}catch(C){a(!1),F.error(se(C))}};return e.jsx(U,{title:s("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(q,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>v(),color:"primary",disabled:!Jt(n,y)||!r||m,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[m&&e.jsx(M,{size:16}),s("common.save")]})]}),children:e.jsx(Qt,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:s("team.passport.issuerDid"),value:n,onChange:j=>{t(j.target.value)}}),e.jsx(W,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:s("common.remark"),value:r,onChange:j=>{i(j.target.value)}}),e.jsxs(g,{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(g,{className:"dialog-h1",children:s("team.passport.mappingRule")}),e.jsx(g,{children:e.jsx(_,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{x(j=>{const T=[...j];return T.unshift({from:{passport:""},to:{role:G.ROLES.GUEST}}),T})},children:s("team.add")})})]}),e.jsxs(g,{className:"list",mt:-.5,children:[y.map((j,T)=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",my:3,children:[e.jsxs(g,{display:"flex",alignItems:"center",flexGrow:1,children:[e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small","data-cy":`input-${T}-from`,placeholder:"Issuer’s Passport Name/ID",value:j.from.passport,onChange:C=>{const{value:I}=C.target;x(D=>{const N=[...D];return N[T].from.passport=I,N})}})}),e.jsx(g,{flexShrink:0,mx:4,children:e.jsx(st,{})}),e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:C=>{x(I=>{const D=[...I];return D[T].to.role=C.target.value,D})},variant:"outlined",children:l.filter(C=>C.name!=="owner").map(C=>e.jsx(ie,{value:C.name,"data-cy":`passport-mapping-select-option-${C.name}`,children:e.jsx("span",{children:C.title||C.name})},C.name))})})]}),e.jsx(g,{flexShrink:0,ml:4,children:e.jsx(q,{onClick:()=>{x(C=>{const I=[...C];return I.splice(T,1),I})},size:"large",children:e.jsx(Q,{})})})]},`mapping-${T}`)),!y.length&&e.jsx(g,{my:2,color:"text.secondary",fontSize:"16px",children:e.jsx(ge,{children:s("common.empty")})})]})]})})})}Ie.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedPassports:w.array,data:w.object};Ie.defaultProps={data:{},trustedPassports:[]};const Qt=H.div`
|
|
86
|
+
`,Qe=10,Xe=1;function et({passport:c}){const{api:o}=A(),{teamDid:d}=$(),{t:f,locale:u}=L(),[l,h]=S.useState({pageSize:Qe,page:Xe}),{data:s,loading:m}=oe(async()=>{const y={teamDid:d,query:{passportId:c.id},paging:{page:l.page,pageSize:l.pageSize}},x=await o.getPassportLogs({input:y});return{logs:x.passportLogs||[],total:x.paging.total}},{refreshDeps:[l.page,l.pageSize],onError:y=>F.error(y.message)}),a=S.useMemo(()=>(s==null?void 0:s.logs)||[],[s==null?void 0:s.logs]),n=y=>{var x,p,v,j,T,C,I,D,N;return y.action===G.PASSPORT_LOG_ACTION.APPROVE||y.action===G.PASSPORT_LOG_ACTION.REVOKE?(p=(x=y==null?void 0:y.metadata)==null?void 0:x.operator)!=null&&p.fullName?`${f("common.operator")}: ${(j=(v=y==null?void 0:y.metadata)==null?void 0:v.operator)==null?void 0:j.fullName}`:null:y.action===G.PASSPORT_LOG_ACTION.ISSUE&&((T=y.metadata)==null?void 0:T.action)===G.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?(I=(C=y==null?void 0:y.metadata)==null?void 0:C.inviter)!=null&&I.fullName?`${f("common.inviter")}: ${(N=(D=y==null?void 0:y.metadata)==null?void 0:D.inviter)==null?void 0:N.fullName}`:null:`passportId: ${y.passportId}`},t=S.useMemo(()=>[{label:f("common.action"),name:"action",options:{customBodyRender:(y,{rowIndex:x})=>{var v;const p=a[x];return e.jsx(Y,{title:n(p),children:`${y} ${(v=p.metadata)!=null&&v.action?`(${p.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:y=>e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:y||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(y,{rowIndex:x})=>{const p=a[x];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[p.operatorUa&&e.jsx(g,{children:Bt(p.operatorUa)}),p.operatorUa&&e.jsx(Y,{title:p.operatorUa,children:e.jsx(Nt,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:f("common.createdAt"),name:"createdAt",options:{customBodyRender:y=>ne(y,u)}}],[f,u,a]),r=({page:y,rowsPerPage:x})=>{l.pageSize!==x?h(p=>({...p,pageSize:x,page:1})):l.page!==y+1&&h(p=>({...p,page:y+1}))},i={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:l.page-1,rowsPerPage:l.pageSize,count:(s==null?void 0:s.total)||0};return m?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsx(g,{children:e.jsx(xe,{className:"logs-table",verticalKeyWidth:100,locale:u,data:a,columns:t,options:i,loading:m,onChange:r})})}et.propTypes={passport:w.object.isRequired};function tt({passport:c,onSwitchPassport:o}){const{api:d}=A(),{teamDid:f}=$(),{t:u,locale:l}=L(),[h,s]=S.useState({pageSize:Qe,page:Xe}),{data:m,loading:a}=oe(async()=>{const x={teamDid:f,passportId:c.parentDid,paging:{page:h.page,pageSize:h.pageSize}},p=await d.getRelatedPassports({input:x});return{passports:p.passports||[],total:p.paging.total}},{refreshDeps:[h.page,h.pageSize],onError:x=>F.error(x.message)}),n=S.useMemo(()=>(m==null?void 0:m.passports)||[],[m==null?void 0:m.passports]),t=S.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:ve}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:Ce}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:x=>Ve(x,l)}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:le}}],[u,l]),r=({page:x,rowsPerPage:p})=>{h.pageSize!==p?s(v=>({...v,pageSize:p,page:1})):h.page!==x+1&&s(v=>({...v,page:x+1}))},i=S.useRef(null),y={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:h.page-1,rowsPerPage:h.pageSize,count:(m==null?void 0:m.total)||0,onRowClick(x,{dataIndex:p},v){var j;if((j=i.current)!=null&&j.contains(v.target)){const T=n[p];o(T)}}};return a?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsxs(te,{spacing:1,children:[e.jsx(Me,{severity:"warning",children:u("team.passport.relatedDescription")}),e.jsx(g,{ref:i,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(xe,{className:"related-table",verticalKeyWidth:100,locale:l,data:n.filter(x=>x.id!==c.id),columns:t,options:y,loading:a,onChange:r})})]})}tt.propTypes={passport:w.object.isRequired,onSwitchPassport:w.func.isRequired};function de({onCancel:c,onSuccess:o}){const{api:d}=A(),{blocklet:f}=Dt(),{t:u}=L(),[l,h]=S.useState(!1),s=(f.environments.find(r=>r.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",m=s==="auto"?St.getPassportColorFromDid(f.appDid):s,[a,n]=S.useState(m),t=async()=>{const r=[{key:Lt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:a}];try{h(!0),await d.configBlocklet({input:{did:f.meta.did,configs:r}}),o()}catch(i){F.error(i.message)}finally{h(!1)}};return e.jsx(U,{title:u("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:u("common.cancel")}),e.jsxs(_,{onClick:t,color:"primary",disabled:l,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[l&&e.jsx(M,{size:16}),u("common.save")]})]}),children:e.jsxs(g,{display:"flex",justifyContent:"center",alignItems:"center",className:"dialog-content",children:[e.jsx(Et,{disableAlpha:!0,color:a,onChange:r=>n(r.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:kt({scope:"passport",role:"owner",title:"Owner",issuer:Ft.getDisplayName(f),issuerDid:f.appDid,ownerName:"Your Name",ownerDid:f.appDid,preferredColor:a})}})]})})}const Ut=V(de,"mutate_team"),Gt=V(de,"",J);function Vt(c){const{inService:o}=A();return o?e.jsx(Gt,{...c}):e.jsx(Ut,{...c})}de.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired};de.defaultProps={};var Q=function(c){return e.jsx("svg",{...c,children:e.jsx("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})})};Q.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};Q.displayName="delete";var we={},Kt=mt;Object.defineProperty(we,"__esModule",{value:!0});var Pe=we.default=void 0,Yt=Kt(Tt()),Zt=e;Pe=we.default=(0,Yt.default)((0,Zt.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var st=function(o){return e.jsx("svg",{...o,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};st.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Jt=(c,o)=>c?!o.some(d=>!d.from.passport||!d.to.role):!1;function Ie({onCancel:c,onSuccess:o,data:d,trustedPassports:f}){const{api:u}=A(),{roles:l,teamDid:h}=$(),{t:s}=L(),[m,a]=S.useState(!1),[n,t]=S.useState(d.issuerDid||""),[r,i]=S.useState(d.remark||""),[y,x]=S.useState(Z(d.mappings)||[]),p=f.findIndex(j=>j.issuerDid===d.issuerDid),v=async()=>{if(m)return;const j={issuerDid:n,remark:r,mappings:y.map(C=>({...C,to:{...C.to,ttl:C.to.ttl||0}}))},T=[...f];p===-1?T.unshift(j):T[p]=j;try{a(!0),await u.configTrustedPassports({input:{teamDid:h,trustedPassports:T}}),await re(800),a(!1),F.success(s("common.saveSuccess")),o()}catch(C){a(!1),F.error(se(C))}};return e.jsx(U,{title:s("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(q,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>v(),color:"primary",disabled:!Jt(n,y)||!r||m,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[m&&e.jsx(M,{size:16}),s("common.save")]})]}),children:e.jsx(Qt,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:s("team.passport.issuerDid"),value:n,onChange:j=>{t(j.target.value)}}),e.jsx(W,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:s("common.remark"),value:r,onChange:j=>{i(j.target.value)}}),e.jsxs(g,{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(g,{className:"dialog-h1",children:s("team.passport.mappingRule")}),e.jsx(g,{children:e.jsx(_,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{x(j=>{const T=[...j];return T.unshift({from:{passport:""},to:{role:G.ROLES.GUEST}}),T})},children:s("team.add")})})]}),e.jsxs(g,{className:"list",mt:-.5,children:[y.map((j,T)=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",my:3,children:[e.jsxs(g,{display:"flex",alignItems:"center",flexGrow:1,children:[e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small","data-cy":`input-${T}-from`,placeholder:"Issuer’s Passport Name/ID",value:j.from.passport,onChange:C=>{const{value:I}=C.target;x(D=>{const N=[...D];return N[T].from.passport=I,N})}})}),e.jsx(g,{flexShrink:0,mx:4,children:e.jsx(st,{})}),e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(W,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:C=>{x(I=>{const D=[...I];return D[T].to.role=C.target.value,D})},variant:"outlined",children:l.filter(C=>C.name!=="owner").map(C=>e.jsx(ie,{value:C.name,"data-cy":`passport-mapping-select-option-${C.name}`,children:e.jsx("span",{children:C.title||C.name})},C.name))})})]}),e.jsx(g,{flexShrink:0,ml:4,children:e.jsx(q,{onClick:()=>{x(C=>{const I=[...C];return I.splice(T,1),I})},size:"large",children:e.jsx(Q,{})})})]},`mapping-${T}`)),!y.length&&e.jsx(g,{my:2,color:"text.secondary",fontSize:"16px",children:e.jsx(ge,{children:s("common.empty")})})]})]})})})}Ie.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedPassports:w.array,data:w.object};Ie.defaultProps={data:{},trustedPassports:[]};const Qt=H.div`
|
|
87
87
|
.dialog-h1 {
|
|
88
88
|
font-size: 18px;
|
|
89
89
|
}
|
|
@@ -95,7 +95,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
`;function pe({onCancel:c,hasPermission:o}){const{api:d}=A(),{teamDid:f,trustedPassports:u}
|
|
98
|
+
`;function pe({onCancel:c,hasPermission:o}){const{api:d}=A(),{teamDid:f,trustedPassports:u}=$(),{t:l}=L(),[h,s]=S.useState(null),[m,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(""),y=async p=>{if(m)return;const v=u.findIndex(T=>T.issuerDid===p);v===-1&&F.error("Cannot find passports");const j=[...u];j.splice(v,1);try{a(!0),await d.configTrustedPassports({input:{teamDid:f,trustedPassports:j}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(!1)}catch(T){a(!1),F.error(T.message)}},x=u.filter(p=>!r||p.issuerDid.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ss,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedPassportIssuers")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchIssuerDid"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(p=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexShrink:0,children:[e.jsx(je,{copyable:!1,size:16,did:p.issuerDid,showDidLogo:!1}),!!p.remark&&e.jsx(g,{pl:3.5,fontSize:12,maxWidth:"300px",children:p.remark})]}),e.jsx(g,{color:"gray",ml:"28px",flexGrow:1,children:p.mappings&&p.mappings.length?`${p.mappings.length} ${l("team.passport.mappingRule")}`:l("team.passport.defaultRule")}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx(q,{onClick:()=>t({mode:"update",data:Z(p)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(ce,{})}),e.jsx(q,{"data-cy":"delete-mapping-rule",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:p.issuerDid}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(p.issuerDid),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},p.issuerDid)),!u.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Ie,{mode:n.mode,data:n.data,trustedPassports:Z(u),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}pe.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};pe.defaultProps={hasPermission:!1};const Xt=V(pe,"mutate_team"),es=V(pe,"",J);function ts(c){const{inService:o}=A();return o?e.jsx(es,{...c}):e.jsx(Xt,{...c})}const ss=H.div`
|
|
99
99
|
.list {
|
|
100
100
|
.MuiIconButton-root {
|
|
101
101
|
svg {
|
|
@@ -103,7 +103,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
`;var rs=Mt();const Ne=Ee(rs);function Re({onCancel:c,onSuccess:o,data:d,trustedFactories:f}){var x,p,v;const{api:u}=A(),{roles:l,teamDid:h}
|
|
106
|
+
`;var rs=Mt();const Ne=Ee(rs);function Re({onCancel:c,onSuccess:o,data:d,trustedFactories:f}){var x,p,v;const{api:u}=A(),{roles:l,teamDid:h}=$(),{t:s}=L(),[m,a]=Ot({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:d.factoryAddress||"",remark:d.remark||"",role:((x=d.passport)==null?void 0:x.role)||"member",ttlPolicy:((p=d.passport)==null?void 0:p.ttlPolicy)||"never",ttl:Ne(+((v=d.passport)==null?void 0:v.ttl)||365*24*60*60*1e3),error:""}),n=f.findIndex(j=>j.factoryAddress===d.factoryAddress),t=async()=>{if(m.loading)return;const{factoryAddress:j,remark:T,role:C,ttlPolicy:I,ttl:D}=m,N={factoryAddress:j,remark:T,passport:{role:C,ttlPolicy:I,ttl:I==="never"?0:Ne(D)}},k=[...f];n===-1?k.unshift(N):k[n]=N;try{a({loading:!0}),await u.configTrustedFactories({input:{teamDid:h,trustedFactories:k}}),await re(800),F.success(s("common.saveSuccess")),o()}catch(B){console.error(B),F.error(se(B))}finally{a({loading:!1})}};S.useEffect(()=>{const j=m.fetched.find(C=>C.address===m.factoryAddress),T=m.errored.find(C=>C.address===m.factoryAddress);wt.isValid(m.factoryAddress)&&!m.fetching&&!j&&!T&&(a({fetching:!0}),At(G.MAIN_CHAIN_ENDPOINT).getFactoryState({address:m.factoryAddress}).then(I=>{I.state?a({fetching:!1,fetched:[...m.fetched.filter(D=>D.address!==m.factoryAddress),I.state],remark:I.state.name}):a({fetching:!1,errored:[...m.errored.filter(D=>D.address!==m.factoryAddress),{address:m.factoryAddress}],error:s("team.passport.factory404",m)})}).catch(I=>{console.error(I),a({fetching:!1,error:se(I)})}))},[m.factoryAddress,m.fetching]);let r=m.error;const i=m.factoryAddress?m.errored.find(j=>j.address===m.factoryAddress):null;!r&&i&&(r=s("team.passport.factory404",m));const y=m.factoryAddress?m.fetched.find(j=>j.address===m.factoryAddress):null;return!r&&y&&(r=y.description),r||(r=s("team.passport.factoryAddressTip")),e.jsx(U,{title:s("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(q,{onClick:c,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>t(),color:"primary",disabled:!m.factoryAddress||!m.remark||!m.role||m.loading||m.error||i,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[m.loading&&e.jsx(M,{size:16}),s("common.save")]})]}),children:e.jsx(as,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(W,{fullWidth:!0,error:!!m.error||!!i,"data-cy":"input-factory-address",label:s("team.passport.factoryAddress"),helperText:r,value:m.factoryAddress,InputProps:{endAdornment:m.fetching?e.jsx(ft,{position:"end",children:e.jsx(M,{size:16})}):null},onChange:j=>{a({factoryAddress:j.target.value,error:""})}}),e.jsx(W,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:s("common.remark"),value:m.remark,onChange:j=>{a({remark:j.target.value})}}),e.jsx(W,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:s("team.passport.role"),select:!0,value:m.role,onChange:j=>{a({role:j.target.value})},variant:"outlined",children:l.filter(j=>j.name!=="owner").map(j=>e.jsx(ie,{value:j.name,"data-cy":`passport-role-select-option-${j.name}`,children:e.jsx("span",{children:j.title||j.name})},j.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx($e,{children:s("team.passport.ttl")}),e.jsxs(Oe,{color:"primary",size:"small",value:m.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(j,T)=>a({ttlPolicy:T}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(Y,{title:s("team.passport.ttlNeverTip"),children:e.jsx(E,{children:s("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(Y,{title:s("team.passport.ttlMintTip"),children:e.jsx(E,{children:s("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(Y,{title:s("team.passport.ttlExchangeTip"),children:e.jsx(E,{children:s("team.passport.ttlExchange")})})})]}),m.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:m.ttl,onChange:j=>{a({ttl:j.target.value})}}),e.jsx(qe,{children:s("team.passport.ttlTip")})]})]})]})})})}Re.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedFactories:w.array,data:w.object};Re.defaultProps={data:{},trustedFactories:[]};const as=H.div`
|
|
107
107
|
.dialog-h1 {
|
|
108
108
|
font-size: 18px;
|
|
109
109
|
}
|
|
@@ -115,7 +115,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
`;function ue({onCancel:c,hasPermission:o}){const{api:d}=A(),{teamDid:f,trustedFactories:u}
|
|
118
|
+
`;function ue({onCancel:c,hasPermission:o}){const{api:d}=A(),{teamDid:f,trustedFactories:u}=$(),{t:l}=L(),[h,s]=S.useState(null),[m,a]=S.useState(!1),[n,t]=S.useState(null),[r,i]=S.useState(""),y=async p=>{if(!m)try{a(!0),await d.configTrustedFactories({input:{teamDid:f,trustedFactories:u.filter(v=>v.factoryAddress!==p)}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(null)}catch(v){a(!1),F.error(v.message)}},x=u.filter(p=>!r||p.factoryAddress.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedFactoriesTip")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(p=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexGrow:1,children:[e.jsx(je,{copyable:!1,did:p.factoryAddress,size:16,showDidLogo:!1}),!!p.remark&&e.jsx(g,{fontSize:12,maxWidth:"300px",children:p.remark})]}),e.jsx(g,{color:"gray",mr:"24px",children:e.jsx(Pt,{type:"success",children:p.passport.role})}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx(q,{onClick:()=>t({mode:"update",data:Z(p)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(ce,{})}),e.jsx(q,{"data-cy":"delete-trusted-factory",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:p.factoryAddress}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(p.factoryAddress),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},p.factoryAddress)),!u.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Re,{data:n.data,trustedFactories:Z(u),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}ue.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};ue.defaultProps={hasPermission:!1};const ns=V(ue,"mutate_team"),os=V(ue,"",J);function is(c){const{inService:o}=A();return o?e.jsx(os,{...c}):e.jsx(ns,{...c})}const ls=H.div`
|
|
119
119
|
.list {
|
|
120
120
|
.MuiIconButton-root {
|
|
121
121
|
svg {
|
|
@@ -128,7 +128,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
128
128
|
*
|
|
129
129
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
130
130
|
* @license MIT
|
|
131
|
-
*/var ds=function(c){return c!=null&&(nt(c)||ps(c)||!!c._isBuffer)};function nt(c){return!!c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c)}function ps(c){return typeof c.readFloatLE=="function"&&typeof c.slice=="function"&&nt(c.slice(0,0))}(function(){var c=cs,o=Le.utf8,d=ds,f=Le.bin,u=function(l,h){l.constructor==String?h&&h.encoding==="binary"?l=f.stringToBytes(l):l=o.stringToBytes(l):d(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var s=c.bytesToWords(l),m=l.length*8,a=1732584193,n=-271733879,t=-1732584194,r=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[m>>>5]|=128<<m%32,s[(m+64>>>9<<4)+14]=m;for(var y=u._ff,x=u._gg,p=u._hh,v=u._ii,i=0;i<s.length;i+=16){var j=a,T=n,C=t,I=r;a=y(a,n,t,r,s[i+0],7,-680876936),r=y(r,a,n,t,s[i+1],12,-389564586),t=y(t,r,a,n,s[i+2],17,606105819),n=y(n,t,r,a,s[i+3],22,-1044525330),a=y(a,n,t,r,s[i+4],7,-176418897),r=y(r,a,n,t,s[i+5],12,1200080426),t=y(t,r,a,n,s[i+6],17,-1473231341),n=y(n,t,r,a,s[i+7],22,-45705983),a=y(a,n,t,r,s[i+8],7,1770035416),r=y(r,a,n,t,s[i+9],12,-1958414417),t=y(t,r,a,n,s[i+10],17,-42063),n=y(n,t,r,a,s[i+11],22,-1990404162),a=y(a,n,t,r,s[i+12],7,1804603682),r=y(r,a,n,t,s[i+13],12,-40341101),t=y(t,r,a,n,s[i+14],17,-1502002290),n=y(n,t,r,a,s[i+15],22,1236535329),a=x(a,n,t,r,s[i+1],5,-165796510),r=x(r,a,n,t,s[i+6],9,-1069501632),t=x(t,r,a,n,s[i+11],14,643717713),n=x(n,t,r,a,s[i+0],20,-373897302),a=x(a,n,t,r,s[i+5],5,-701558691),r=x(r,a,n,t,s[i+10],9,38016083),t=x(t,r,a,n,s[i+15],14,-660478335),n=x(n,t,r,a,s[i+4],20,-405537848),a=x(a,n,t,r,s[i+9],5,568446438),r=x(r,a,n,t,s[i+14],9,-1019803690),t=x(t,r,a,n,s[i+3],14,-187363961),n=x(n,t,r,a,s[i+8],20,1163531501),a=x(a,n,t,r,s[i+13],5,-1444681467),r=x(r,a,n,t,s[i+2],9,-51403784),t=x(t,r,a,n,s[i+7],14,1735328473),n=x(n,t,r,a,s[i+12],20,-1926607734),a=p(a,n,t,r,s[i+5],4,-378558),r=p(r,a,n,t,s[i+8],11,-2022574463),t=p(t,r,a,n,s[i+11],16,1839030562),n=p(n,t,r,a,s[i+14],23,-35309556),a=p(a,n,t,r,s[i+1],4,-1530992060),r=p(r,a,n,t,s[i+4],11,1272893353),t=p(t,r,a,n,s[i+7],16,-155497632),n=p(n,t,r,a,s[i+10],23,-1094730640),a=p(a,n,t,r,s[i+13],4,681279174),r=p(r,a,n,t,s[i+0],11,-358537222),t=p(t,r,a,n,s[i+3],16,-722521979),n=p(n,t,r,a,s[i+6],23,76029189),a=p(a,n,t,r,s[i+9],4,-640364487),r=p(r,a,n,t,s[i+12],11,-421815835),t=p(t,r,a,n,s[i+15],16,530742520),n=p(n,t,r,a,s[i+2],23,-995338651),a=v(a,n,t,r,s[i+0],6,-198630844),r=v(r,a,n,t,s[i+7],10,1126891415),t=v(t,r,a,n,s[i+14],15,-1416354905),n=v(n,t,r,a,s[i+5],21,-57434055),a=v(a,n,t,r,s[i+12],6,1700485571),r=v(r,a,n,t,s[i+3],10,-1894986606),t=v(t,r,a,n,s[i+10],15,-1051523),n=v(n,t,r,a,s[i+1],21,-2054922799),a=v(a,n,t,r,s[i+8],6,1873313359),r=v(r,a,n,t,s[i+15],10,-30611744),t=v(t,r,a,n,s[i+6],15,-1560198380),n=v(n,t,r,a,s[i+13],21,1309151649),a=v(a,n,t,r,s[i+4],6,-145523070),r=v(r,a,n,t,s[i+11],10,-1120210379),t=v(t,r,a,n,s[i+2],15,718787259),n=v(n,t,r,a,s[i+9],21,-343485551),a=a+j>>>0,n=n+T>>>0,t=t+C>>>0,r=r+I>>>0}return c.endian([a,n,t,r])};u._ff=function(l,h,s,m,a,n,t){var r=l+(h&s|~h&m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._gg=function(l,h,s,m,a,n,t){var r=l+(h&m|s&~m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._hh=function(l,h,s,m,a,n,t){var r=l+(h^s^m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._ii=function(l,h,s,m,a,n,t){var r=l+(s^(h|~m))+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._blocksize=16,u._digestsize=16,rt.exports=function(l,h){if(l==null)throw new Error("Illegal argument "+l);var s=c.wordsToBytes(u(l,h));return h&&h.asBytes?s:h&&h.asString?f.bytesToString(s):c.bytesToHex(s)}})();var us=rt.exports;const ms=Ee(us);function me({teamDid:c,onCancel:o,onSuccess:d,onError:f,mode:u,item:l}){var D,N;const{api:h}=A(),[s,m]=S.useState(!1),[a,n]=S.useState(""),{t}=L(),[r,i]=S.useState(l.title||""),[y,x]=S.useState(l.description||""),[p,v]=S.useState(((D=l==null?void 0:l.extra)==null?void 0:D.display)||"builtin"),[j,T]=S.useState((N=l==null?void 0:l.extra)!=null&&N.types?l.extra.types.join(","):""),C=async()=>{const k=r.trim();if(!k){n(t("team.passport.error.titleEmpty"));return}if(k.length>64){n(t("team.passport.error.titleTooLong",{length:64}));return}const B=y.replace(/\n/g," ");if(!B){n(t("team.passport.error.descriptionEmpty"));return}const K=u==="create"?ms(k):l.name;n(null),m(!0);try{if(u==="create"){const R={teamDid:c,name:K,title:k,description:B};p==="custom"&&(R.extra=JSON.stringify({display:"custom",types:j.split(",")})),await h.createRole({input:R})}else{const R={teamDid:c,role:{name:K,title:k,description:B}};await h.updateRole({input:R})}d()}catch(R){const b=se(R);n(b),f(R)}finally{m(!1)}},I=e.jsxs("div",{children:[u==="update"&&e.jsx(E,{component:"div",style:{paddingTop:16},children:e.jsx(W,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:l.name,disabled:!0})}),e.jsx(E,{component:"div",style:{marginTop:16},children:e.jsx(W,{label:t("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:r,onChange:k=>{n(null),i(k.target.value)},disabled:u==="update"||s,helperText:t("team.passport.create.titleTip")})}),e.jsx(E,{component:"div",style:{marginTop:16,marginBottom:16},children:e.jsx(W,{label:t("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:y,onChange:k=>{n(null),x(k.target.value)},disabled:s,multiline:!0,rows:3})}),u==="create"&&e.jsxs("div",{style:{marginBottom:16},children:[e.jsx(Oe,{children:t("common.display")}),e.jsxs($e,{color:"primary",size:"small",value:p,exclusive:!0,style:{marginTop:16},disabled:s,onChange:(k,B)=>v(B),"data-cy":"input-role-display",children:[e.jsx(ee,{value:"builtin","data-cy":"input-role-display-builtin",children:e.jsx(E,{children:t("team.passport.displayBuiltin")})}),e.jsx(ee,{value:"custom","data-cy":"input-role-display-custom",children:e.jsx(E,{children:t("team.passport.displayCustom")})})]}),p==="custom"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:j,disabled:s,onChange:k=>{T(k.target.value)}}),e.jsx(qe,{children:t("team.passport.typesTip")})]})]})]});return e.jsxs(U,{title:u==="create"?t("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:o,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:o,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{"data-cy":"mutate-role-confirm",onClick:C,color:"primary",disabled:s,variant:"contained",autoFocus:!0,children:[s&&e.jsx(M,{size:16}),t(u==="create"?"common.create":"common.update")]})]}),children:[e.jsx(ht,{component:"div",children:I}),!!a&&e.jsx(Me,{severity:"error",variant:"icon",style:{width:"100%",margin:0},children:a})]})}me.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,mode:w.oneOf(["create","update"]),item:w.object};me.defaultProps={onError:()=>{},mode:"create",item:{}};function fe({onCancel:c,onSuccess:o,onDelete:d,roleName:f,hasPermission:u}){const{api:l}=A(),{roles:h,permissions:s,teamDid:m,refresh:a,isNodeTeam:n}=O(),{t}=L(),[r,i]=S.useState([]),[y,x]=S.useState(!1),[p,v]=S.useState(null),[j,T]=S.useState(!1),C=Z(h.find(R=>R.name===f)),I=Ge(f),D=async R=>{if(!j)try{T(!0),await l.deleteRole({input:{teamDid:m,name:R}}),d()}catch(b){F.error(b.message)}finally{T(!1),v(null)}},N=async(R,b)=>{const z=(await l.getPermissionsByRole({input:{teamDid:R,role:{name:b}}})).permissions||[],$=s.map(ae=>({...ae,bind:z.some(lt=>lt.name===ae.name)}));i($)},k=async()=>{T(!0);const R=r.filter(b=>b.bind).map(b=>b.name);try{await l.updatePermissionsForRole({input:{teamDid:m,roleName:C.name,grantNames:R}}),F.success(t("common.saveSuccess")),o()}catch(b){F.error(se(b))}finally{T(!1)}};S.useEffect(()=>{m&&f&&N(m,f)},[m,f]);const B=n||!u;let K=null;return n&&(K=e.jsxs("div",{className:"bind",children:[e.jsx("div",{className:"title",children:t("common.permission")}),e.jsx("div",{className:"list",children:r.filter(R=>B?R.bind:!0).map(R=>e.jsx("div",{className:"item",children:e.jsx(xt,{control:e.jsx(gt,{disabled:B,checked:R.bind,onChange:()=>{i(b=>b.map(P=>(P.name===R.name&&(P.bind=!P.bind),P)))},name:R.name}),label:R.description})}))})]})),e.jsxs(U,{title:t("common.passport"),onClose:c,open:!0,fullWidth:!0,toolbar:u&&!I&&e.jsxs(e.Fragment,{children:[e.jsx(q,{onClick:()=>x(C),"data-cy":`edit-passport-${C.name}`,size:"large",children:e.jsx(ce,{fill:"#bfbfbf"})}),e.jsx(q,{onClick:()=>v({title:t("team.passport.delete.title"),description:t("team.passport.delete.description",{name:C.title}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>{D(C.name)},onCancel:()=>{T(!1),v(null)}}),"data-cy":`delete-passport-${C.name}`,size:"large",children:e.jsx(Q,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:n&&!B&&e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{onClick:k,color:"primary",disabled:j||!C,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[j&&e.jsx(M,{size:16}),t("common.save")]})]}),children:[e.jsxs(gs,{children:[!C&&e.jsx(ys,{children:e.jsx(M,{})}),C&&e.jsxs("div",{className:"dialog-content",children:[e.jsxs("div",{className:"header",children:[e.jsx("div",{className:"title",children:C.title}),e.jsx("div",{className:"description",style:{marginTop:n?16:48},children:C.description})]}),K]})]}),y&&e.jsx(me,{teamDid:m,onCancel:()=>x(null),onSuccess:()=>{x(null),a()},mode:"update",roleName:y.name,item:y}),p&&e.jsx(Se,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}const fs=V(fe,"mutate_team"),hs=V(fe,"",J);function xs(c){const{inService:o}=A();return o?e.jsx(hs,{...c}):e.jsx(fs,{...c})}fe.propTypes={roleName:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onDelete:w.func.isRequired,hasPermission:w.bool};fe.defaultProps={hasPermission:!1};const gs=H.div`
|
|
131
|
+
*/var ds=function(c){return c!=null&&(nt(c)||ps(c)||!!c._isBuffer)};function nt(c){return!!c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c)}function ps(c){return typeof c.readFloatLE=="function"&&typeof c.slice=="function"&&nt(c.slice(0,0))}(function(){var c=cs,o=Le.utf8,d=ds,f=Le.bin,u=function(l,h){l.constructor==String?h&&h.encoding==="binary"?l=f.stringToBytes(l):l=o.stringToBytes(l):d(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var s=c.bytesToWords(l),m=l.length*8,a=1732584193,n=-271733879,t=-1732584194,r=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[m>>>5]|=128<<m%32,s[(m+64>>>9<<4)+14]=m;for(var y=u._ff,x=u._gg,p=u._hh,v=u._ii,i=0;i<s.length;i+=16){var j=a,T=n,C=t,I=r;a=y(a,n,t,r,s[i+0],7,-680876936),r=y(r,a,n,t,s[i+1],12,-389564586),t=y(t,r,a,n,s[i+2],17,606105819),n=y(n,t,r,a,s[i+3],22,-1044525330),a=y(a,n,t,r,s[i+4],7,-176418897),r=y(r,a,n,t,s[i+5],12,1200080426),t=y(t,r,a,n,s[i+6],17,-1473231341),n=y(n,t,r,a,s[i+7],22,-45705983),a=y(a,n,t,r,s[i+8],7,1770035416),r=y(r,a,n,t,s[i+9],12,-1958414417),t=y(t,r,a,n,s[i+10],17,-42063),n=y(n,t,r,a,s[i+11],22,-1990404162),a=y(a,n,t,r,s[i+12],7,1804603682),r=y(r,a,n,t,s[i+13],12,-40341101),t=y(t,r,a,n,s[i+14],17,-1502002290),n=y(n,t,r,a,s[i+15],22,1236535329),a=x(a,n,t,r,s[i+1],5,-165796510),r=x(r,a,n,t,s[i+6],9,-1069501632),t=x(t,r,a,n,s[i+11],14,643717713),n=x(n,t,r,a,s[i+0],20,-373897302),a=x(a,n,t,r,s[i+5],5,-701558691),r=x(r,a,n,t,s[i+10],9,38016083),t=x(t,r,a,n,s[i+15],14,-660478335),n=x(n,t,r,a,s[i+4],20,-405537848),a=x(a,n,t,r,s[i+9],5,568446438),r=x(r,a,n,t,s[i+14],9,-1019803690),t=x(t,r,a,n,s[i+3],14,-187363961),n=x(n,t,r,a,s[i+8],20,1163531501),a=x(a,n,t,r,s[i+13],5,-1444681467),r=x(r,a,n,t,s[i+2],9,-51403784),t=x(t,r,a,n,s[i+7],14,1735328473),n=x(n,t,r,a,s[i+12],20,-1926607734),a=p(a,n,t,r,s[i+5],4,-378558),r=p(r,a,n,t,s[i+8],11,-2022574463),t=p(t,r,a,n,s[i+11],16,1839030562),n=p(n,t,r,a,s[i+14],23,-35309556),a=p(a,n,t,r,s[i+1],4,-1530992060),r=p(r,a,n,t,s[i+4],11,1272893353),t=p(t,r,a,n,s[i+7],16,-155497632),n=p(n,t,r,a,s[i+10],23,-1094730640),a=p(a,n,t,r,s[i+13],4,681279174),r=p(r,a,n,t,s[i+0],11,-358537222),t=p(t,r,a,n,s[i+3],16,-722521979),n=p(n,t,r,a,s[i+6],23,76029189),a=p(a,n,t,r,s[i+9],4,-640364487),r=p(r,a,n,t,s[i+12],11,-421815835),t=p(t,r,a,n,s[i+15],16,530742520),n=p(n,t,r,a,s[i+2],23,-995338651),a=v(a,n,t,r,s[i+0],6,-198630844),r=v(r,a,n,t,s[i+7],10,1126891415),t=v(t,r,a,n,s[i+14],15,-1416354905),n=v(n,t,r,a,s[i+5],21,-57434055),a=v(a,n,t,r,s[i+12],6,1700485571),r=v(r,a,n,t,s[i+3],10,-1894986606),t=v(t,r,a,n,s[i+10],15,-1051523),n=v(n,t,r,a,s[i+1],21,-2054922799),a=v(a,n,t,r,s[i+8],6,1873313359),r=v(r,a,n,t,s[i+15],10,-30611744),t=v(t,r,a,n,s[i+6],15,-1560198380),n=v(n,t,r,a,s[i+13],21,1309151649),a=v(a,n,t,r,s[i+4],6,-145523070),r=v(r,a,n,t,s[i+11],10,-1120210379),t=v(t,r,a,n,s[i+2],15,718787259),n=v(n,t,r,a,s[i+9],21,-343485551),a=a+j>>>0,n=n+T>>>0,t=t+C>>>0,r=r+I>>>0}return c.endian([a,n,t,r])};u._ff=function(l,h,s,m,a,n,t){var r=l+(h&s|~h&m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._gg=function(l,h,s,m,a,n,t){var r=l+(h&m|s&~m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._hh=function(l,h,s,m,a,n,t){var r=l+(h^s^m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._ii=function(l,h,s,m,a,n,t){var r=l+(s^(h|~m))+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._blocksize=16,u._digestsize=16,rt.exports=function(l,h){if(l==null)throw new Error("Illegal argument "+l);var s=c.wordsToBytes(u(l,h));return h&&h.asBytes?s:h&&h.asString?f.bytesToString(s):c.bytesToHex(s)}})();var us=rt.exports;const ms=Ee(us);function me({teamDid:c,onCancel:o,onSuccess:d,onError:f,mode:u,item:l}){var D,N;const{api:h}=A(),[s,m]=S.useState(!1),[a,n]=S.useState(""),{t}=L(),[r,i]=S.useState(l.title||""),[y,x]=S.useState(l.description||""),[p,v]=S.useState(((D=l==null?void 0:l.extra)==null?void 0:D.display)||"builtin"),[j,T]=S.useState((N=l==null?void 0:l.extra)!=null&&N.types?l.extra.types.join(","):""),C=async()=>{const k=r.trim();if(!k){n(t("team.passport.error.titleEmpty"));return}if(k.length>64){n(t("team.passport.error.titleTooLong",{length:64}));return}const B=y.replace(/\n/g," ");if(!B){n(t("team.passport.error.descriptionEmpty"));return}const K=u==="create"?ms(k):l.name;n(null),m(!0);try{if(u==="create"){const R={teamDid:c,name:K,title:k,description:B};p==="custom"&&(R.extra=JSON.stringify({display:"custom",types:j.split(",")})),await h.createRole({input:R})}else{const R={teamDid:c,role:{name:K,title:k,description:B}};await h.updateRole({input:R})}d()}catch(R){const b=se(R);n(b),f(R)}finally{m(!1)}},I=e.jsxs("div",{children:[u==="update"&&e.jsx(E,{component:"div",style:{paddingTop:16},children:e.jsx(W,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:l.name,disabled:!0})}),e.jsx(E,{component:"div",style:{marginTop:16},children:e.jsx(W,{label:t("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:r,onChange:k=>{n(null),i(k.target.value)},disabled:u==="update"||s,helperText:t("team.passport.create.titleTip")})}),e.jsx(E,{component:"div",style:{marginTop:16,marginBottom:16},children:e.jsx(W,{label:t("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:y,onChange:k=>{n(null),x(k.target.value)},disabled:s,multiline:!0,rows:3})}),u==="create"&&e.jsxs("div",{style:{marginBottom:16},children:[e.jsx($e,{children:t("common.display")}),e.jsxs(Oe,{color:"primary",size:"small",value:p,exclusive:!0,style:{marginTop:16},disabled:s,onChange:(k,B)=>v(B),"data-cy":"input-role-display",children:[e.jsx(ee,{value:"builtin","data-cy":"input-role-display-builtin",children:e.jsx(E,{children:t("team.passport.displayBuiltin")})}),e.jsx(ee,{value:"custom","data-cy":"input-role-display-custom",children:e.jsx(E,{children:t("team.passport.displayCustom")})})]}),p==="custom"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:j,disabled:s,onChange:k=>{T(k.target.value)}}),e.jsx(qe,{children:t("team.passport.typesTip")})]})]})]});return e.jsxs(U,{title:u==="create"?t("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:o,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:o,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{"data-cy":"mutate-role-confirm",onClick:C,color:"primary",disabled:s,variant:"contained",autoFocus:!0,children:[s&&e.jsx(M,{size:16}),t(u==="create"?"common.create":"common.update")]})]}),children:[e.jsx(ht,{component:"div",children:I}),!!a&&e.jsx(Me,{severity:"error",variant:"icon",style:{width:"100%",margin:0},children:a})]})}me.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,mode:w.oneOf(["create","update"]),item:w.object};me.defaultProps={onError:()=>{},mode:"create",item:{}};function fe({onCancel:c,onSuccess:o,onDelete:d,roleName:f,hasPermission:u}){const{api:l}=A(),{roles:h,permissions:s,teamDid:m,refresh:a,isNodeTeam:n}=$(),{t}=L(),[r,i]=S.useState([]),[y,x]=S.useState(!1),[p,v]=S.useState(null),[j,T]=S.useState(!1),C=Z(h.find(R=>R.name===f)),I=Ge(f),D=async R=>{if(!j)try{T(!0),await l.deleteRole({input:{teamDid:m,name:R}}),d()}catch(b){F.error(b.message)}finally{T(!1),v(null)}},N=async(R,b)=>{const z=(await l.getPermissionsByRole({input:{teamDid:R,role:{name:b}}})).permissions||[],O=s.map(ae=>({...ae,bind:z.some(lt=>lt.name===ae.name)}));i(O)},k=async()=>{T(!0);const R=r.filter(b=>b.bind).map(b=>b.name);try{await l.updatePermissionsForRole({input:{teamDid:m,roleName:C.name,grantNames:R}}),F.success(t("common.saveSuccess")),o()}catch(b){F.error(se(b))}finally{T(!1)}};S.useEffect(()=>{m&&f&&N(m,f)},[m,f]);const B=n||!u;let K=null;return n&&(K=e.jsxs("div",{className:"bind",children:[e.jsx("div",{className:"title",children:t("common.permission")}),e.jsx("div",{className:"list",children:r.filter(R=>B?R.bind:!0).map(R=>e.jsx("div",{className:"item",children:e.jsx(xt,{control:e.jsx(gt,{disabled:B,checked:R.bind,onChange:()=>{i(b=>b.map(P=>(P.name===R.name&&(P.bind=!P.bind),P)))},name:R.name}),label:R.description})}))})]})),e.jsxs(U,{title:t("common.passport"),onClose:c,open:!0,fullWidth:!0,toolbar:u&&!I&&e.jsxs(e.Fragment,{children:[e.jsx(q,{onClick:()=>x(C),"data-cy":`edit-passport-${C.name}`,size:"large",children:e.jsx(ce,{fill:"#bfbfbf"})}),e.jsx(q,{onClick:()=>v({title:t("team.passport.delete.title"),description:t("team.passport.delete.description",{name:C.title}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>{D(C.name)},onCancel:()=>{T(!1),v(null)}}),"data-cy":`delete-passport-${C.name}`,size:"large",children:e.jsx(Q,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:n&&!B&&e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{onClick:k,color:"primary",disabled:j||!C,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[j&&e.jsx(M,{size:16}),t("common.save")]})]}),children:[e.jsxs(gs,{children:[!C&&e.jsx(ys,{children:e.jsx(M,{})}),C&&e.jsxs("div",{className:"dialog-content",children:[e.jsxs("div",{className:"header",children:[e.jsx("div",{className:"title",children:C.title}),e.jsx("div",{className:"description",style:{marginTop:n?16:48},children:C.description})]}),K]})]}),y&&e.jsx(me,{teamDid:m,onCancel:()=>x(null),onSuccess:()=>{x(null),a()},mode:"update",roleName:y.name,item:y}),p&&e.jsx(Se,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}const fs=V(fe,"mutate_team"),hs=V(fe,"",J);function xs(c){const{inService:o}=A();return o?e.jsx(hs,{...c}):e.jsx(fs,{...c})}fe.propTypes={roleName:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onDelete:w.func.isRequired,hasPermission:w.bool};fe.defaultProps={hasPermission:!1};const gs=H.div`
|
|
132
132
|
.header {
|
|
133
133
|
.title {
|
|
134
134
|
font-weight: 400;
|
|
@@ -177,7 +177,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
177
177
|
justify-content: center;
|
|
178
178
|
align-items: center;
|
|
179
179
|
height: 200px;
|
|
180
|
-
`,Be=S.memo(({field:c,value:o,copyable:d})=>{const{local:f}=L();return o?e.jsxs(g,{display:"flex",alignItems:"center",gap:1,onClick:u=>u.stopPropagation(),children:[c?e.jsxs(Fe,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[c,":"]}):null,e.jsx(Fe,{variant:"body1",children:e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx(Y,{title:o,children:e.jsx("span",{className:"value-ellipsis",children:o})}),d?e.jsx(It,{content
|
|
180
|
+
`,Be=S.memo(({field:c,value:o,copyable:d})=>{const{local:f}=L();return o?e.jsxs(g,{display:"flex",alignItems:"center",gap:1,onClick:u=>u.stopPropagation(),children:[c?e.jsxs(Fe,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[c,":"]}):null,e.jsx(Fe,{variant:"body1",children:e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx(Y,{title:o,children:e.jsx("span",{className:"value-ellipsis",children:o})}),d?e.jsx(It,{content:$t(o),locale:f,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null});function De({createPassportSvg:c}){const{inService:o}=A(),{roles:d,teamIssuerDid:f,teamName:u,refresh:l,passportColor:h,teamDid:s,isNodeTeam:m}=$(),{t:a}=L(),[n,t]=S.useState(!1),[r,i]=S.useState(!1),y=yt(p=>p.breakpoints.down("md")),x=S.useCallback(p=>p&&!G.ROLES[p.toUpperCase()],[]);return e.jsxs(js,{sx:{mt:0},children:[e.jsx(g,{display:"flex",justifyContent:"flex-end",children:!m&&e.jsxs(jt,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),a("team.passport.create.title")]})}),e.jsx(g,{className:"list",children:d.map(p=>e.jsxs(g,{"data-cy":`passport-${p.name}`,sx:{display:"flex",justifyContent:"space-between"},className:"item",display:"flex",alignItems:"center",onClick:()=>i(p),children:[e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:c({title:p.title,issuer:u,issuerDid:f,ownerName:"Your Name",ownerDid:f,preferredColor:h,width:"150px"})}}),e.jsxs(g,{ml:3,className:"title",children:[e.jsx(Be,{value:p.title}),x(p.name)?e.jsx(Be,{value:p.name,copyable:!0}):null]})]}),!y&&e.jsx(g,{className:"description",children:p.description}),e.jsx(Ye,{permission:o?"":"mutate_team",role:o?J:[],children:e.jsx("div",{className:"action",children:Ge(p.name)?e.jsx(Wt,{}):e.jsx(ce,{})})})]},p.name))}),r&&e.jsx(xs,{onCancel:()=>i(!1),onSuccess:()=>{i(!1),l()},onDelete:()=>{i(!1),l()},mode:"update",roleName:r.name,item:r}),n&&e.jsx(me,{teamDid:s,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const js=H(g)`
|
|
181
181
|
.list {
|
|
182
182
|
.item {
|
|
183
183
|
padding: 12px;
|
|
@@ -215,7 +215,7 @@ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m
|
|
|
215
215
|
fill: ${({theme:c})=>c.palette.text.secondary};
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
`;De.propTypes={createPassportSvg:w.func.isRequired};De.defaultProps={};function ke({createPassportSvg:c}){const{t:o}=L(),{api:d,inService:f}=A(),{teamDid:u,refresh:l,enablePassportIssuance:h,isNodeTeam:s}
|
|
218
|
+
`;De.propTypes={createPassportSvg:w.func.isRequired};De.defaultProps={};function ke({createPassportSvg:c}){const{t:o}=L(),{api:d,inService:f}=A(),{teamDid:u,refresh:l,enablePassportIssuance:h,isNodeTeam:s}=$(),[m,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(!1),[y,x]=S.useState(!1),[p,v]=S.useState(!1),j=async T=>{if(T.stopPropagation(),!y){x(!0);try{await d.configPassportIssuance({input:{teamDid:u,enable:!h}}),l(),await re(800),F.success(o("common.configSuccess"))}catch(C){F.error(C.message)}finally{x(!1)}}};return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,sx:{ml:1},children:[e.jsx(Ye,{permission:f?"":"mutate_team",role:f?J:[],children:e.jsx(X,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(X.Item,{onClick:()=>t(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(g,{children:[o("team.passport.trustedPassportIssuers"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(X.Item,{onClick:()=>i(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(g,{children:[o("team.passport.configFactories"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configFactoriesTip")})]})}),e.jsx(X.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(g,{display:"flex",alignItems:"center",children:[y&&e.jsx(M,{size:16,style:{marginRight:8}}),e.jsxs(g,{children:[o(h?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(g,{fontSize:12,color:"#888",children:o(h?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!s&&e.jsx(X.Item,{onClick:()=>a(!0),"data-cy":"config-passport-color",children:e.jsxs(g,{children:[o("team.passport.configColor"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(_,{variant:"outlined",onClick:()=>{v(!0)},children:o("team.passport.view")})})}),n&&e.jsx(ts,{onCancel:()=>t(!1)}),r&&e.jsx(is,{onCancel:()=>i(!1)}),m&&e.jsx(Vt,{onCancel:()=>a(!1),onSuccess:()=>a(!1)}),p&&e.jsx(U,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:o("team.passport.view"),children:e.jsx(De,{createPassportSvg:c,onCancel:()=>v(!1)})})]})}ke.propTypes={createPassportSvg:w.func.isRequired};ke.defaultProps={};const ze="$all",_e="",ot=ct.memo(({createPassportSvg:c,passport:o,teamDid:d,inService:f})=>{var u,l,h,s;return e.jsx(g,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(u=o.user)==null?void 0:u.fullName,ownerDid:(l=o.user)==null?void 0:l.did,ownerAvatarUrl:(h=o.user)!=null&&h.avatar?Ke((s=o.user)==null?void 0:s.avatar,d,f):"",revoked:o.revoked,width:"36px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}})});ot.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired,teamDid:w.string.isRequired,inService:w.bool.isRequired};function it({createPassportSvg:c}){const{api:o}=A(),{teamDid:d}=$(),{t:f,locale:u}=L(),{SYSTEM_ROLES:l}=zt(),{inService:h}=A(),[s,m]=S.useState(!1),a=`passports-${d}`,n=Rt(a),[t,r]=S.useState({role:ze,status:_e,searchText:n.searchText||"",pageSize:n.rowsPerPage||10,page:n.page?n.page+1:1}),{data:i,loading:y}=oe(async()=>(await o.getPassportRoleCounts({input:{teamDid:d}})).counts||[],{refreshDeps:[d]}),{data:x,loading:p}=oe(async()=>{const b={};t.role!==ze&&(b.role=t.role),t.status&&(b.status=t.status);const P=await o.getPassportsByRole({input:{teamDid:d,query:b,paging:{page:t.page,pageSize:t.pageSize}}});return{passports:P.passports||[],total:P.paging.total}},{refreshDeps:[t.role,t.status,t.page,t.pageSize],onError:b=>F.error(b.message)}),v=b=>{const P=i==null?void 0:i.find(z=>z.key===b);return(P==null?void 0:P.value)||0},j=S.useMemo(()=>Object.keys(l).map(b=>({name:b,title:l[b],num:v(b)})),[i,v]),T=S.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:(b,{rowIndex:P})=>{const z=x==null?void 0:x.passports[P];return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ot,{createPassportSvg:c,passport:z,teamDid:d}),e.jsx(g,{children:ve(z.title)})]})}}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:b=>Ce(b,h)}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:b=>Ve(b,u)}},{label:f("common.address"),name:"id",options:{customBodyRender:_t}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:(b,{rowIndex:P})=>{const z=x==null?void 0:x.passports[P];return z.parentDid?le("recover"):le(z.source)}}}],[f,u,x==null?void 0:x.passports,d,c,h]),C=b=>{r(P=>({...P,role:b,page:1}))},I=({page:b,rowsPerPage:P,searchText:z})=>{t.pageSize!==P?r(O=>({...O,searchText:"",pageSize:P,page:1})):t.page!==b+1?r(O=>({...O,searchText:"",page:b+1})):t.searchText!==z&&r(O=>({...O,searchText:z,page:1}))},D=S.useRef(null),N=(x==null?void 0:x.passports)||[],k=t.searchText?N.filter(b=>{var P;return b.id.includes(t.searchText)||(((P=b==null?void 0:b.user)==null?void 0:P.fullName)||"").includes(t.searchText)}):N,B={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(b,{dataIndex:P},z){var O;if((O=D.current)!=null&&O.contains(z.target)){const ae=x==null?void 0:x.passports[P];m(ae)}},page:t.page-1,rowsPerPage:t.pageSize,count:(x==null?void 0:x.total)||0,searchDebounceTime:600},K=b=>{r(P=>({...P,status:b.target.value,page:1}))},R=e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(g,{sx:{fontSize:16,fontWeight:400},children:[f("team.passport.status"),":"]}),e.jsxs(vt,{size:"small",value:t.status,onChange:K,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(ie,{value:_e,children:f("common.all")}),Object.values(G.PASSPORT_STATUS).map(b=>e.jsx(ie,{value:b,sx:{py:1},children:f(`team.passport.statusMap.${b}`)},b))]})]});return y?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(M,{})})}):e.jsxs(vs,{children:[e.jsxs(g,{className:"main",display:"flex",sx:{mt:0,gap:3},children:[e.jsx(g,{className:"left",children:e.jsx(g,{className:"tabs",children:j.map(b=>e.jsxs(g,{className:`tab ${t.role===b.name?"active":""}`,onClick:()=>C(b.name),children:[e.jsx("span",{className:"text",children:b.title}),e.jsx(g,{sx:{color:"text.secondary"},children:b.num})]},b.name))})}),e.jsx(g,{ref:D,className:"right",children:e.jsx(xe,{className:"main-table",verticalKeyWidth:100,locale:u,durable:a,durableKeys:["page","rowsPerPage"],data:k,columns:T,options:B,loading:p,onChange:I,customButtons:[e.jsx(ke,{createPassportSvg:c})],title:R})})]}),s&&e.jsx(Te,{createPassportSvg:c,onCancel:()=>m(null),passport:s,onSwitchPassport:m})]})}it.propTypes={createPassportSvg:w.func.isRequired};it.defaultProps={};const vs=bt(g)`
|
|
219
219
|
.main {
|
|
220
220
|
.left {
|
|
221
221
|
width: 256px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,aa as r,H as i,T as a}from"./vendor-mui-core-
|
|
1
|
+
import{j as o,aa as r,H as i,T as a}from"./vendor-mui-core-DMvlMpwf.js";import{L as f,r as g}from"./vendor-react-DEoibe3W.js";import"./index-BFsMuPKK.js";import"./vendor-arcblock-CORkwLwW.js";import"./vendor-ux-did-connect-akcz-Ldw.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";const p=(e,t)=>[e,...Array.isArray(t)?t:[t]],l=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function n({sx:e,...t}){const s=p({display:"flex",flexWrap:"wrap",mx:-1},e);return o.jsx(r,{sx:s,...t})}n.propTypes={sx:i.object};n.defaultProps={sx:{}};function w({icon:e}){const[t,s]=g.useState(!1);return!e||t?null:typeof e=="string"?o.jsx(r,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>s(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function u({title:e,desc:t,extra:s,cover:c,icon:d,to:x,sx:h}){const m=p({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return o.jsx(r,{sx:m,children:o.jsx(r,{component:f,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:o.jsxs(r,{children:[o.jsxs(r,{sx:{position:"relative"},children:[c,d&&o.jsx(r,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:o.jsx(w,{icon:d})})]}),o.jsx(a,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...l()},children:e}),t&&o.jsx(a,{variant:"body2",sx:{my:1,...l(),color:"text.secondary"},children:t}),s]})})})}u.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const k="/.well-known/service/static/assets/doc-board-bg-DWZHV9Ng.png";function b({board:e,sx:t,...s}){return o.jsx(u,{date:e.createdAt,sx:t,to:e.link,title:e.title,desc:e.desc,cover:o.jsx(r,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:o.jsx(r,{component:"img",src:k,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...s})}b.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function C(){const e=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:"https://www.arcblock.io/docs/blocklet-developer/en/getting-started"},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:"https://www.arcblock.io/docs/createblocklet/en/quick-start"},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:"https://www.arcblock.io/docs/launcher/en/launcher-welcome"},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:"https://www.arcblock.io/docs/did-spaces/en/did-spaces-getting-started"},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:"https://www.arcblock.io/docs/did-wallet/en/get-started"},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:"https://www.arcblock.io/docs/did-domain/en/did-domain-faq"},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:"https://www.arcblock.io/docs/blockchain/en/blockchain-how-to-guides"},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:"https://www.arcblock.io/docs/did-connect/en/developer-guides"}];return o.jsx(n,{children:e.map(t=>o.jsx(b,{board:t},t.id))})}export{C as default};
|