@abtnode/blocklet-services 1.16.43-beta-20250424-125523-08a65a5c → 1.16.43-beta-20250427-132304-6da95c55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routes/oauth/client.js +2 -0
- package/api/routes/oauth/server.js +75 -0
- package/api/routes/user-session.js +5 -5
- package/api/routes/user.js +3 -2
- package/api/services/auth/session.js +23 -35
- package/api/services/oauth/server.js +31 -1
- package/api/util/attach-shared-utils.js +2 -2
- package/dist/assets/{AdapterDayjs-DT-SVlwP.js → AdapterDayjs-BUGplkxR.js} +1 -1
- package/dist/assets/{ArrowDropDown-D0s0w2rW.js → ArrowDropDown-B0sLkJoY.js} +1 -1
- package/dist/assets/{CheckCircle-BMPTHnwd.js → CheckCircle-BNrN9mgy.js} +1 -1
- package/dist/assets/{ChevronLeft-BV65HBup.js → ChevronLeft-Dq00IS01.js} +1 -1
- package/dist/assets/{ChevronRight-CSrWhu1k.js → ChevronRight-ZTqWK-Ga.js} +1 -1
- package/dist/assets/{Community-B6sqs6QK.js → Community-DZCTPNMP.js} +1 -1
- package/dist/assets/{DeleteOutline-BwlJCwaD.js → DeleteOutline-C2sY6hfm.js} +1 -1
- package/dist/assets/{Done-ClKUqna8.js → Done-JLiLhELm.js} +1 -1
- package/dist/assets/{Download-DydXtD3g.js → Download-Ch4RfGRW.js} +1 -1
- package/dist/assets/{Edit-Cydc64DB.js → Edit-CY6fFHQM.js} +1 -1
- package/dist/assets/{EditIcon-B3vzcBhw.js → EditIcon-Bi2cR-_u.js} +1 -1
- package/dist/assets/{Email-DscM5ZVr.js → Email-Dz2Eyqu0.js} +1 -1
- package/dist/assets/{Error-BUxloyCF.js → Error-CSFUqG0m.js} +1 -1
- package/dist/assets/{ExpandLess-D3psCjh2.js → ExpandLess-BiMmSOBl.js} +1 -1
- package/dist/assets/{Google-nw2S1BAe.js → Google-GOp5YvmZ.js} +1 -1
- package/dist/assets/{Holiday-COvP72sQ.js → Holiday-Lc6woG1j.js} +1 -1
- package/dist/assets/{InfoOutlined-K2cm3ASV.js → InfoOutlined-CQB5qKm-.js} +1 -1
- package/dist/assets/{Launch-DSlNzUJo.js → Launch-fxgQvk19.js} +1 -1
- package/dist/assets/{LaunchOutlined-DB41H1FZ.js → LaunchOutlined-BV4_W1pb.js} +1 -1
- package/dist/assets/{Location-DSdE-EW4.js → Location-B8EOY3d0.js} +1 -1
- package/dist/assets/{LockIcon-Yic1ETPw.js → LockIcon-fuTfhB_G.js} +1 -1
- package/dist/assets/{Meeting-DlfumstQ.js → Meeting-Epdyx36z.js} +1 -1
- package/dist/assets/{MoreHoriz-BWdkQIhx.js → MoreHoriz-CX_pwfPT.js} +1 -1
- package/dist/assets/{OffSick-CG2hJbSq.js → OffSick-VYgugWxu.js} +1 -1
- package/dist/assets/{Phone-DkIl-1KJ.js → Phone-KP65huHK.js} +1 -1
- package/dist/assets/{PlayArrow-DfQEcw-G.js → PlayArrow-DFH1Psjx.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-TVw9KuLr.js → QuestionMarkCircle-p6m3avKp.js} +1 -1
- package/dist/assets/{ServerLogo-DQ3yw9lw.js → ServerLogo-Bssx1Eou.js} +1 -1
- package/dist/assets/{Timezone-B77bSXNW.js → Timezone-Ce4E1Xey.js} +1 -1
- package/dist/assets/{TuneOutlined-8KrrUCQF.js → TuneOutlined-Dy2qPFGI.js} +1 -1
- package/dist/assets/{ViewList-Bql1EC1c.js → ViewList-e3CoNi3K.js} +1 -1
- package/dist/assets/{WorkingRemotely-DNUERtUR.js → WorkingRemotely-CXFJ6pz8.js} +1 -1
- package/dist/assets/{access-control-Bcd_n74E.js → access-control-B20P1UrY.js} +1 -1
- package/dist/assets/{actions-f0wKxzR1.js → actions-DA-6s_nQ.js} +1 -1
- package/dist/assets/{add-component-core-BUAlsG4_.js → add-component-core-DG9mQFsr.js} +1 -1
- package/dist/assets/{add-resource-Djfsmv61.js → add-resource-BoS5YkVy.js} +1 -1
- package/dist/assets/{addon-BkBy38_b.js → addon-Bcc-Xwbf.js} +1 -1
- package/dist/assets/{advanced-BPM38tnR.js → advanced-DTe2fs5L.js} +1 -1
- package/dist/assets/{appearance-DUNDV_8X.js → appearance-DYi32tlk.js} +1 -1
- package/dist/assets/{ar-wbCXBm9M.js → ar-CmhpkjwX.js} +1 -1
- package/dist/assets/{ar-BNaEJSr3.js → ar-DupP3pla.js} +1 -1
- package/dist/assets/{audit-logs-ClIsZeWB.js → audit-logs-CydL26ZC.js} +2 -2
- package/dist/assets/{authorize-Czqr5dx0.js → authorize-DUyL7MEU.js} +1 -1
- package/dist/assets/{base32-CXHhcaAE.js → base32-p9VcJrwv.js} +1 -1
- package/dist/assets/{branding-CDVXldZI.js → branding-CAMtNLMU.js} +1 -1
- package/dist/assets/{branding-Dr6iifVv.js → branding-_VO2ZZ3t.js} +2 -2
- package/dist/assets/{bundle-avatar-CXZCyfoQ.js → bundle-avatar-D0t7RLGx.js} +1 -1
- package/dist/assets/button-BeZibzB9.js +1 -0
- package/dist/assets/{click-to-copy-CYn1U-tf.js → click-to-copy-BGyXQL2i.js} +1 -1
- package/dist/assets/{complete-C-F4GC22.js → complete-BzCBoyhn.js} +1 -1
- package/dist/assets/{component-DsEe2qX3.js → component-5gjaNHCg.js} +1 -1
- package/dist/assets/{config-DYPbZpg_.js → config-1xq1_d84.js} +1 -1
- package/dist/assets/{config-A_My2cMO.js → config-Bh19ZUJ-.js} +1 -1
- package/dist/assets/{config-navigation-Bi-pxL5K.js → config-navigation-Dvjz9nAh.js} +3 -3
- package/dist/assets/{config-space-DVjhjgJC.js → config-space-CYg-72ab.js} +1 -1
- package/dist/assets/{confirm-BshZuFnD.js → confirm-DqvNmeoz.js} +1 -1
- package/dist/assets/{connect-BPsVsyF2.js → connect-Bbc2y5nS.js} +1 -1
- package/dist/assets/{connect-DQxK32G8.js → connect-DM2xKEWk.js} +1 -1
- package/dist/assets/{connect-to-DXXf0Nkb.js → connect-to-Ck5O2M1K.js} +1 -1
- package/dist/assets/{content-layout-AHDEW7YQ.js → content-layout-BPaAeaMQ.js} +1 -1
- package/dist/assets/{dashboard-CCzZLCC4.js → dashboard-8QXGSoVu.js} +3 -3
- package/dist/assets/{de-8GAnQkrt.js → de-Doy9B4I7.js} +1 -1
- package/dist/assets/{de-BsZVQmUM.js → de-TcDcBkI0.js} +1 -1
- package/dist/assets/{delete-confirm-DuoSMgmG.js → delete-confirm-_BzUlhv2.js} +1 -1
- package/dist/assets/{did-address-Cg-ez88b.js → did-address-DUThaBlf.js} +1 -1
- package/dist/assets/domain-action-card-D3w6jyPR.js +24 -0
- package/dist/assets/domain-ag7_Ivc1.js +9 -0
- package/dist/assets/domains-BDxEOJh6.js +1 -0
- package/dist/assets/{dot-tsWWWiOg.js → dot-BE1YP292.js} +1 -1
- package/dist/assets/{email-DWoydsl3.js → email-DKpgximx.js} +1 -1
- package/dist/assets/{empty-spinner-D_1iEwTc.js → empty-spinner-DmDm8XzF.js} +1 -1
- package/dist/assets/{es-ntlJbt-a.js → es-CDD0y3ur.js} +1 -1
- package/dist/assets/{es-DsjXdm2X.js → es-CruF8tDk.js} +1 -1
- package/dist/assets/{exchange-passport-DysHnVpr.js → exchange-passport-Izkf8qpM.js} +1 -1
- package/dist/assets/{fr-B-64BlVz.js → fr-Bajh_D8H.js} +1 -1
- package/dist/assets/{fr-Bv4B0MVB.js → fr-zYSSKlBw.js} +1 -1
- package/dist/assets/{fuel-TLPi2Hr-.js → fuel-CcBzY6Bt.js} +1 -1
- package/dist/assets/{gen-access-key-D4caSeDS.js → gen-access-key-DxKwgiGT.js} +1 -1
- package/dist/assets/{get-safe-url-Bz4L9R5-.js → get-safe-url-Bq9SFfX6.js} +1 -1
- package/dist/assets/{get-safe-url-Dex6FTwp.js → get-safe-url-DBsPGn--.js} +1 -1
- package/dist/assets/hi-BsP-0YrU.js +5 -0
- package/dist/assets/{hi-CY-kyCxp.js → hi-DOsApYK0.js} +1 -1
- package/dist/assets/{home-CBFACtB_.js → home-Bi8fA3jh.js} +1 -1
- package/dist/assets/{id-BT_84X-S.js → id-BderyGO5.js} +1 -1
- package/dist/assets/{id-DZBgOnwF.js → id-CY2FWdMB.js} +1 -1
- package/dist/assets/{iframe-B4jzt2b3.js → iframe-DZ181i8X.js} +1 -1
- package/dist/assets/{index-BplAimRX.js → index-B2yOcqTl.js} +2 -2
- package/dist/assets/{index-CSARD20E.js → index-BGgGfqEc.js} +1 -1
- package/dist/assets/{index-BG5LYRZd.js → index-BT0GBmWF.js} +1 -1
- package/dist/assets/{index-B0-4M8vb.js → index-B_vrglsK.js} +1 -1
- package/dist/assets/{index-BOEhBltr.js → index-BnmeT4Bk.js} +1 -1
- package/dist/assets/{index-CGe7n5Gc.js → index-C8QMe2NL.js} +2 -2
- package/dist/assets/{index-ARVZ7FJv.js → index-CGBZONPv.js} +1 -1
- package/dist/assets/{index-BowdADDJ.js → index-CHbpkZwO.js} +1 -1
- package/dist/assets/{index-NRj7GpkA.js → index-Cjjg2_Xp.js} +1 -1
- package/dist/assets/{index-Cks6t9cs.js → index-DKhrYmrN.js} +1 -1
- package/dist/assets/index-DNG6b9sp.js +224 -0
- package/dist/assets/{index-CVvs-hHV.js → index-DO3_1y-L.js} +15 -15
- package/dist/assets/{index-DPpP2Hz6.js → index-DO4cSlUf.js} +1 -1
- package/dist/assets/{index-DomukIqT.js → index-DcBUShKK.js} +1 -1
- package/dist/assets/{index-BXkEM7e9.js → index-Dl4W1N74.js} +1 -1
- package/dist/assets/{index-DO1hKTlI.js → index-DuH8q5ir.js} +1 -1
- package/dist/assets/{index-C3f1mXja.js → index-DyxFC42L.js} +3 -3
- package/dist/assets/{index-MbAvBCGD.js → index-EnQ254k3.js} +1 -1
- package/dist/assets/{index-Bdp7LpPc.js → index-SDdS_qt8.js} +1 -1
- package/dist/assets/{index-DKq7-33g.js → index-bb90BUf4.js} +2 -2
- package/dist/assets/{index-CU8fxqsS.js → index-mDKG4SiY.js} +1 -1
- package/dist/assets/index-n0Q-fETi.js +99 -0
- package/dist/assets/{index-3r4UtN8A.js → index-slEV_y-C.js} +1 -1
- package/dist/assets/{invitation-7bE4cIXB.js → invitation-BrAZQXQL.js} +1 -1
- package/dist/assets/{invite-COQN-rNg.js → invite-Cbz8B2uW.js} +1 -1
- package/dist/assets/{issue-passport-11S7tmQW.js → issue-passport-Dd_yyO08.js} +1 -1
- package/dist/assets/{item-BeeQ2vgS.js → item-nK3D7WH5.js} +1 -1
- package/dist/assets/{ja-BMmtgJml.js → ja-99RIjwwl.js} +1 -1
- package/dist/assets/{ja-8jRYJGVw.js → ja-BLPXqHM4.js} +1 -1
- package/dist/assets/{ko-ChmGYnnx.js → ko-8oFi6wHH.js} +1 -1
- package/dist/assets/{ko-C4pbuwv8.js → ko-Cxgk34co.js} +1 -1
- package/dist/assets/{landing-page-DfhVYZ3b.js → landing-page-BMM_oJb1.js} +1 -1
- package/dist/assets/{launch-result-message-CCo4xyOd.js → launch-result-message-C9huWJUf.js} +1 -1
- package/dist/assets/{layout-DToDlHEw.js → layout-Cw-hwCHs.js} +1 -1
- package/dist/assets/{list-ChvGKHw5.js → list-Dmtz4mRb.js} +1 -1
- package/dist/assets/{list-header-C7I2nEkf.js → list-header-CgF1S4js.js} +1 -1
- package/dist/assets/localization-DATb3Y_j.js +1 -0
- package/dist/assets/{log-DwhNr5TA.js → log-Chqr_or_.js} +1 -1
- package/dist/assets/{logger-DwVuCvCH.js → logger-zix81YaM.js} +1 -1
- package/dist/assets/{login-_FUfsuwA.js → login-DjB23H9M.js} +1 -1
- package/dist/assets/{login-oauth-callback-BfAWMSC0.js → login-oauth-callback-ILeP59KT.js} +1 -1
- package/dist/assets/{logo-uploader-CYJXgjdA.js → logo-uploader-CJrdpVcQ.js} +3 -3
- package/dist/assets/{lost-passport-bl0QaFCp.js → lost-passport-Do1Pl0xI.js} +1 -1
- package/dist/assets/{open-window-BTH_1q7i.js → open-window-D8MZhu_7.js} +1 -1
- package/dist/assets/{overview-D4gQwSex.js → overview-DLA9wj6a.js} +1 -1
- package/dist/assets/{page-header-DWEFpJCI.js → page-header-CWY8mxlT.js} +1 -1
- package/dist/assets/{passport-item-Z9x6DkU5.js → passport-item-CWtlyIE_.js} +1 -1
- package/dist/assets/{permission-CDRSpazM.js → permission-BGM09622.js} +1 -1
- package/dist/assets/{preferences-Dck4NebC.js → preferences-DYdbb0kG.js} +1 -1
- package/dist/assets/{profile-embed-CJdf2c_q.js → profile-embed-CeEMHxEc.js} +1 -1
- package/dist/assets/pt-BINIHul4.js +5 -0
- package/dist/assets/{pt-DjThuHre.js → pt-ChXuTrrd.js} +1 -1
- package/dist/assets/publish-resource-BEc_A5mC.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-CP-WHcip.js → react-beautiful-dnd.esm-ByydTUk4.js} +1 -1
- package/dist/assets/{relative-time-4f6xdgg-.js → relative-time-Djw-K4Zu.js} +1 -1
- package/dist/assets/ru-BifF7u-P.js +5 -0
- package/dist/assets/{ru-CI1dkyMC.js → ru-IkTTTY0K.js} +1 -1
- package/dist/assets/{runtime-r0b7mSwp.js → runtime-DXl0lfXF.js} +1 -1
- package/dist/assets/sdk-CTe6rL6c.js +1 -0
- package/dist/assets/{security-CLc8EI2b.js → security-BhkfG23R.js} +4 -4
- package/dist/assets/{session-CmpGpqja.js → session-VIMbdc9j.js} +1 -1
- package/dist/assets/{setup-C0tLi0hm.js → setup-BmYxTt6Z.js} +9 -3
- package/dist/assets/{shorten-label-CE57Fd6E.js → shorten-label-DFzv9EKX.js} +1 -1
- package/dist/assets/{simple-select-rdkVpCfB.js → simple-select-DlrdVbaI.js} +1 -1
- package/dist/assets/{slicedToArray-BBoi0da6.js → slicedToArray-CPl5_eGD.js} +1 -1
- package/dist/assets/{spaces-Cf25Nw85.js → spaces-WkJCApHO.js} +1 -1
- package/dist/assets/{start-CrRC75qe.js → start-CVexuuAk.js} +1 -1
- package/dist/assets/{status-BSBLuo2u.js → status-CygZ0LuY.js} +1 -1
- package/dist/assets/{step-actions-YXGJQMCB.js → step-actions-D_1PFeFs.js} +1 -1
- package/dist/assets/{studio-wUJ0pUIv.js → studio-Byjzwg8q.js} +1 -1
- package/dist/assets/{switch-control-D0bd_WCg.js → switch-control-5fEOPVKs.js} +1 -1
- package/dist/assets/th-CBxM23U5.js +5 -0
- package/dist/assets/{th-4Bnumejd.js → th-OF8xr--T.js} +1 -1
- package/dist/assets/{traffic-BhA3A82Z.js → traffic-T11hxc--.js} +1 -1
- package/dist/assets/{transfer-BmP7JwN2.js → transfer-ROpxn9LD.js} +1 -1
- package/dist/assets/{unsubscribe-zK0TSWH3.js → unsubscribe-Cd3XOnSp.js} +1 -1
- package/dist/assets/{use-app-logo-DAnHvb1d.js → use-app-logo-B8Kl9EZt.js} +1 -1
- package/dist/assets/{use-mobile-CwehvZ0f.js → use-mobile-C_flBrm-.js} +1 -1
- package/dist/assets/{use-mobile-KRs0Yv73.js → use-mobile-DlKplWTG.js} +1 -1
- package/dist/assets/{useLocalStorage-CNdV3Qx_.js → useLocalStorage-DldnaMbZ.js} +1 -1
- package/dist/assets/{user-center-CTXkd8hW.js → user-center-CzyCbtWm.js} +1 -1
- package/dist/assets/util-Bjy-tP7q.js +1 -0
- package/dist/assets/{util-DrL3FFCf.js → util-Dw9Eiuko.js} +1 -1
- package/dist/assets/{vendor-arcblock-JGYMkSwE.js → vendor-arcblock-ScFEr-lj.js} +5 -5
- package/dist/assets/{vendor-mui-core-8zafwTFh.js → vendor-mui-core-CQ38ohp2.js} +20 -20
- package/dist/assets/{vendor-mui-x-Df6DxoLi.js → vendor-mui-x-B0hsmEJ3.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-D2f9rdKK.js → vendor-ux-did-connect-BdkhddhO.js} +4 -4
- package/dist/assets/{vi-Bc6q0tph.js → vi-DCBJBc4G.js} +1 -1
- package/dist/assets/vi-DY_Y13jR.js +5 -0
- package/dist/assets/wrap-locale-DMTYAE64.js +1 -0
- package/dist/assets/{zh-_GYrLCB8.js → zh-BRAYg0sY.js} +1 -1
- package/dist/assets/{zh-DZlGQAU9.js → zh-BYRCoK6F.js} +1 -1
- package/dist/assets/{zh-tw-Be5lgYGX.js → zh-tw-BG0rlH8p.js} +1 -1
- package/dist/assets/{zh-tw-CLcDyLaC.js → zh-tw-D5-DkgwC.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/package.json +29 -29
- package/dist/assets/button-n0UOGLKx.js +0 -1
- package/dist/assets/domain-B57opALw.js +0 -9
- package/dist/assets/domain-action-card-DGNzWGpO.js +0 -24
- package/dist/assets/domains-DSFXU6AI.js +0 -1
- package/dist/assets/hi-DIf_hqVB.js +0 -5
- package/dist/assets/index-Birdle6P.js +0 -224
- package/dist/assets/index-DEAA6iri.js +0 -92
- package/dist/assets/localization-DfJCYesK.js +0 -1
- package/dist/assets/pt-CMeQ7KWn.js +0 -5
- package/dist/assets/publish-resource-CaRrvCS8.js +0 -1
- package/dist/assets/ru-8cWKcW3b.js +0 -5
- package/dist/assets/sdk-fuEXLKzh.js +0 -1
- package/dist/assets/th-DYYGBboI.js +0 -5
- package/dist/assets/util-C4Ha7L5d.js +0 -1
- package/dist/assets/vi-CfH0km8q.js +0 -5
- package/dist/assets/wrap-locale-5dMXj7tV.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,H as f,ag as _e,T as C,aa as w,
|
|
1
|
+
import{j as e,H as f,ag as _e,T as C,aa as w,cD as _,ad as $,cE as $e,a9 as g,ak as J,s as Se,ac as je,ao as et,cF as Me,a8 as ye,q as K,b4 as V,b5 as W,y as tt,ap as st,bb as Oe}from"./vendor-mui-core-CQ38ohp2.js";import{m as nt,i as Le,f as he}from"./vendor-hooks-DftG_2gV.js";import{r as j,h as ot}from"./vendor-react-DEoibe3W.js";import{c as F,O as at,a3 as rt,X as it,a4 as ct,v as lt,a5 as pe,M as dt}from"./vendor-arcblock-ScFEr-lj.js";import{Y as k,u as E,b2 as pt,j as T,b6 as Y,a5 as ut,r as Ce,bq as mt,B as ue,an as ht,C as Fe,ar as ft}from"./vendor-ux-did-connect-BdkhddhO.js";import{C as O,z,t as v,a2 as gt,ae as xt,ax as St}from"./index-DO3_1y-L.js";import{u as jt}from"./use-mobile-DlKplWTG.js";import{z as G,d as ze,a5 as yt,H as Ct,D as Pe,y as fe}from"./vendor-utils-BNHJB5U7.js";import"./api-BrU7j0QA.js";import{u as Ne,C as At,D as Bt,a as bt}from"./connect-to-Ck5O2M1K.js";import{b as kt,c as It,d as vt,i as Et,e as ge,f as Rt,h as Tt,j as Dt}from"./spaces-WkJCApHO.js";import{f as X}from"./format-error-BrmqJs5a.js";import{I as wt}from"./index-CGBZONPv.js";import{R as Ot}from"./index-CYeIiQ6Q.js";import{d as Ut}from"./MoreHoriz-CX_pwfPT.js";import{b as Mt}from"./dashboard-8QXGSoVu.js";import{d as Lt}from"./DeleteOutline-C2sY6hfm.js";import{g as Ue}from"./get-safe-url-DBsPGn--.js";import{S as Ft}from"./switch-control-5fEOPVKs.js";import{L as xe}from"./list-header-CgF1S4js.js";import{C as zt,u as Pt}from"./config-space-CYg-72ab.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./PlayArrow-DFH1Psjx.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";async function Nt({blockletDid:t,nodeApi:o,spaceGateways:n}){let s=!1;const i=await Promise.all(n.map(async a=>{let{name:r}=a;const p=await kt(a.endpoint);return!G(p)&&p!==r&&(r=p,s=!0),{...a,name:r}}));return s&&await Promise.all(i.filter(a=>a.did).map(a=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),i}function Jt({refresh:t}={}){var i;const{blocklet:o}=O(),n=(i=o==null?void 0:o.meta)==null?void 0:i.did,{api:s}=z();return nt(async()=>{if(!n)return[];const{spaceGateways:a}=await s.getBlockletSpaceGateways({input:{did:n}});return await Nt({blockletDid:n,nodeApi:s,spaceGateways:a})??[]},{refreshDeps:[n,t],onError(a){var r;(r=a==null?void 0:a.message)!=null&&r.includes("not logged")?console.warn(a):(console.error(a),k.error(X(a)))}})}function Je({deps:t,setLoading:o,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[i,a]=j.useState([]),{api:r}=z(),[p,c]=j.useMemo(()=>n?[v(n).startOf("day").toISOString(),v(n).endOf("day").toISOString()]:[v().startOf("year").toISOString(),v().endOf("day").toISOString()],[n]),m=ze(async()=>{try{if(o(!0),!s){a([]);return}const{backups:u}=await r.getBlockletBackups({input:{did:s.meta.did,startTime:p,endTime:c}});a(u??[])}catch(u){console.error(u),k.error(X(u))}finally{o(!1)}},1e3);return Le(async()=>{m()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:i}}function Qt({appDid:t}){const{backups:o}=Je(),[n,s]=j.useState({message:"",progress:0,completed:!1}),i=z(),{ws:{useSubscription:a}}=i;return a(F.BlockletEvents.backupProgress,r=>{t===(r==null?void 0:r.appDid)&&s(()=>({...r}))},[t]),j.useEffect(()=>{var r;if(o!=null&&o.length&&yt((r=o[0])==null?void 0:r.status)){const[p]=o;s(()=>({message:p.message,progress:p.progress,completed:p.progress>=100}))}},[o]),n}function Zt({deps:t=[],setLoading:o=()=>{}}={}){var p;const{blocklet:n}=O(),[s,i]=j.useState([]),{api:a}=z(),r=j.useCallback(ze(async()=>{var c;if(!a||!((c=n==null?void 0:n.meta)!=null&&c.did)){i([]);return}try{o(!0);const m=v(),x=m.subtract(1,"year"),{summary:u}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:x.toISOString(),endTime:m.toISOString()}});i(Array.isArray(u)?u:[])}catch(m){console.error("Failed to fetch backup summary:",m),k.error(X(m)),i([])}finally{o(!1)}},1e3),[]);return Le(async()=>(await r(),()=>{r.cancel()}),[(p=n==null?void 0:n.meta)==null?void 0:p.did].concat(t)),{backupSummary:s}}const Qe=j.createContext({}),{Provider:Ht,Consumer:Ns}=Qe;function Ae({children:t}){var Z;const{t:o}=E(),{api:n}=z(),{blocklet:s}=O(),[i,a]=j.useState(null),[r,p]=j.useState(!1),{data:c,loading:m,mutate:x}=Jt({refresh:r}),u=Ct(c),d=Qt({appDid:s==null?void 0:s.appDid}),y=j.useMemo(()=>It(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[b,B]=j.useState(!1),[S,l]=j.useState(!1),{backups:te}=Je({deps:[S,i],setLoading:B,backupDate:i}),[se,ne]=j.useState(!1),{backupSummary:oe}=Zt({deps:[se]}),[P,M]=j.useState(c==null?void 0:c.find(h=>h.endpoint===y)),R=(Z=s==null?void 0:s.settings)==null?void 0:Z.autoBackup,D=()=>{p(h=>!h)},ae=()=>{ne(h=>!h)},re=()=>{l(h=>!h)},Q=async h=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:h}})},q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(h,N)=>{try{x(I=>{const L=[...I];return L.push({...h,loading:!0}),L}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:h}}),y!==N&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),M(h),D(),k.success(o("storage.spaces.connectedWithName",{name:(h==null?void 0:h.name)??"DID Spaces"}))}catch(I){throw console.error(I),x(L=>[...L].filter(de=>de.did!==h.did)),I}},ce=async h=>{h&&(h.endpoint===y&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),R!=null&&R.enabled&&await Q({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:h==null?void 0:h.did}}),x(N=>{const I=[...N];return I.splice(I.indexOf(h),1),I}),M(h),D())},le=async h=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:h.did},spaceGateway:h}}),y!==h.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:h.endpoint}]}})]),k.success(o("storage.spaces.connectedWithName",{name:(h==null?void 0:h.name)??"DID Spaces"})),D()},A=h=>(h==null?void 0:h.endpoint)===y;return e.jsx(Ht,{value:{spaceGateways:c||[],selectedSpaceGateway:P,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:D,spaceGatewaysLoading:m,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:A,updateAutoBackup:Q,abortBlockletBackup:q,backupEndpoint:y,backupProgress:d,backups:te,backupSummary:oe,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:b,autoBackup:R},children:t})}Ae.propTypes={children:f.any.isRequired};Ae.defaultProps={};function U(){return j.useContext(Qe)}function ee({...t}){const{blocklet:o}=O(),{info:n}=z(),{t:s}=E(),i=Ne({blocklet:o}),a=gt(n),{spaceGateways:r,addSpaceGateway:p}=U(),c={checkFn:Pe.create({baseURL:fe(window.location.origin,xt())}).get,webWalletUrl:a,extraParams:{appPid:o.appPid,appDid:i.appDid,appName:i.appName,appDescription:i.appDescription,appUrl:i.appUrl,referrer:i.referrer,scopes:i.scopes,nodeDid:n.did}},m=async({endpoint:u,name:d,did:y})=>{const b=await vt(u);if(!await Et(b)){k.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(r.some(l=>l.endpoint===u)){k.error(s("storage.spaces.gateway.add.duplicate",{name:d}));return}await p({name:d,did:y,url:b,endpoint:u},u)},x=async({spaceGateway:u})=>{try{await m(u)}catch(d){console.error(d),k.error(X(d))}};return e.jsx(at,{...t,options:c,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Ze({...t}){const{t:o}=j.useContext(pt),{blocklet:n,loadingDiskInfo:s,actions:i}=O();if(j.useEffect(()=>{i==null||i.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const a=(c,m,x)=>e.jsxs(C,{children:[c," ",e.jsx("strong",{children:m?St(m):"empty"})]}),r=n.environments.reduce((c,m)=>(c[m.key]=m.value,c),{}),p=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:a(r.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:a(r.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:a(r.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:a(r.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Kt,{component:"div",...t,children:p.map(c=>e.jsx(wt,{valueComponent:"div",nameWidth:120,name:c.name,children:c.value},c.key))})}return s?e.jsx(w,{}):e.jsx(C,{children:o("blocklet.diskInfo.empty")})}const Kt=_e(C)``;function Be(){const{t}=E(),{setBackupDate:o,backupSummary:n}=U(),s=rt({key:"lg"}),i=j.useRef(null),a=j.useCallback(c=>{o(c)},[o]),r=j.useMemo(()=>{const c=v().subtract(1,"year"),m=v().add(1,"day"),x=new Map(n.map(d=>[d.date,{date:d.date,successCount:d.successCount,errorCount:d.errorCount}])),u=[];for(let d=c.clone();v(d).isBefore(m);d=d.add(1,"day")){const y=d.format("YYYY-MM-DD");u.push(x.get(y)||{date:y,successCount:0,errorCount:0})}return u},[n]),p=j.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:10},tooltip:{formatter:d=>{const{date:y,successCount:b,errorCount:B}=r[d.dataIndex]||{date:d.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${y}</div>`,`<div>${t("common.succeeded")}: ${b}</div>`,`<div>${t("common.failed")}: ${B}</div>`].join(`
|
|
2
2
|
`)},borderWidth:0,padding:[8,10],textStyle:{fontSize:14},extraCssText:"border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);"},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:_[600]},{min:-9,max:-6,color:_[500]},{min:-6,max:-3,color:_[400]},{min:-3,max:-1,color:_[300]},{min:0,max:0,color:"#ecedf0"},{min:1,max:3,color:$[300]},{min:3,max:6,color:$[400]},{min:6,max:9,color:$[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:$[600]}],orient:"horizontal",left:"center",bottom:10,itemWidth:12,itemHeight:12,textStyle:{color:"#666",fontSize:12}},calendar:{top:30,left:40,right:5,bottom:20,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:4,borderColor:"#fff",borderRadius:0,color:"#fff"},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:12,fontSize:14,color:"rgb(31, 35, 40)",fontWeight:"400"},monthLabel:{show:!0,nameMap:"cn",align:"left",color:"rgb(31, 35, 40)",fontWeight:"400",fontSize:16,position:"start"},yearLabel:{show:!1},range:[v().subtract(1,"year").format("YYYY-MM-DD"),v().format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:r.map(d=>[d.date,d.errorCount?-d.errorCount:d.successCount]),label:{show:!1},itemStyle:{borderWidth:1.5,borderColor:"#fff",borderRadius:5,color:"#ecedf0"},emphasis:{itemStyle:{borderWidth:2.5,borderColor:$e[200],color:"inherit"}}}}),[r,t]);return j.useEffect(()=>{i.current&&s&&setTimeout(()=>{i.current.scrollLeft=i.current.scrollWidth},100)},[s,r]),e.jsxs(e.Fragment,{children:[e.jsx(g,{ref:i,sx:{overflowX:s?"visible":"hidden",overflowY:"hidden"},children:e.jsx(g,{sx:{minWidth:s?"1600px":"100%",height:"240px"},children:e.jsx(Ot,{option:p,style:{height:"100%",width:"100%",padding:"8px"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&a(c.data[0])}}})})}),e.jsx(g,{display:"flex",justifyContent:"flex-end",mr:s?2:5,mb:2,mt:.5,children:e.jsxs(J,{direction:s?"column":"row",spacing:s?2:1,alignItems:"flex-end",width:"100%",justifyContent:s?"flex-start":"flex-end",children:[e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.failed"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#8B5000",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#A36200",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#C17700",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#E29000",borderRadius:.5})]}),e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.without"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#ecedf0",borderRadius:.5,border:"1px solid #e0e1e4"})]}),e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.succeeded"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#9be9a8",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#40c463",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#30a14e",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#216e39",borderRadius:.5})]})]})})]})}Be.propTypes={};const Vt=Se(({className:t,...o})=>e.jsx(je,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function be({status:t,message:o,createdAt:n}){const{t:s}=E(),i=t===T.BACKUPS.STATUS.PROGRESS&&v().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=i&&s("common.timeoutError"),r=t===T.BACKUPS.STATUS.PROGRESS&&!i,p=t===T.BACKUPS.STATUS.SUCCEEDED&&!i;return r?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(w,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):p?e.jsx(Y,{type:"success",children:s("common.succeeded")}):e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(Y,{type:"error",children:s("common.failed")})," ",e.jsx(je,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||a,children:e.jsx(Me,{children:e.jsx(it,{style:{width:"24px",height:"24px"},color:"error"})})})]})}be.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};be.defaultProps={message:""};function ke({metadata:t}){const{t:o}=E();if(G(t))return e.jsx(Y,{type:"success",children:o("common.succeeded")});const n=t.count||0,s=t.size||0,i=ct(s,{iec:!0}),a=e.jsxs(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[o("common.fileCount"),": ",n]}),e.jsxs(C,{variant:"body2",children:[o("common.fileSize"),": ",i]})]});return e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(Y,{type:"success",children:o("common.succeeded")})," ",e.jsx(Vt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(Me,{children:e.jsx(lt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ke.propTypes={metadata:f.object};ke.defaultProps={metadata:{}};function Ie(){const{t,locale:o}=E(),{spaceGateways:n,backups:s,backupsLoading:i}=U(),a=j.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:p=>{var B;const{targetUrl:c,targetName:m,status:x,createdAt:u}=s[p],d=x===T.BACKUPS.STATUS.PROGRESS&&v().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,y=x===T.BACKUPS.STATUS.SUCCEEDED&&!d,b=m||((B=n.find(S=>c==null?void 0:c.includes(ge(S==null?void 0:S.endpoint))))==null?void 0:B.name)||"Unknown DID Space";return y?e.jsx(et,{fontSize:"16px",href:c,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:p=>{const c=t(p===0?"common.auto":"common.manual");return e.jsx(Y,{children:c})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:p=>v(p).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:p=>G(p)?"":v(p).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:p=>{const c=(s==null?void 0:s[p])??{},{status:m,message:x,createdAt:u,metadata:d}=c,y=m===T.BACKUPS.STATUS.PROGRESS&&v().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,b=m===T.BACKUPS.STATUS.PROGRESS&&!y,B=m===T.BACKUPS.STATUS.SUCCEEDED&&!y;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(w,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):B?e.jsx(ke,{metadata:d}):e.jsx(be,{status:m,message:x,createdAt:u})}}}],[s,n,t]),r=j.useMemo(()=>!(s!=null&&s.length),[s]);return e.jsx(e.Fragment,{children:r?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(ut,{title:"",loading:i,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Ie.propTypes={};var He=function(o){return e.jsxs("svg",{...o,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonz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Fknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};He.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Ke(){const{t}=E();return e.jsxs(g,{children:[e.jsxs(g,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(g,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(He,{viewBox:"0 0 228 258",style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsxs(g,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(Be,{})]})]}),e.jsx(Ie,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ze,{})]})}Ke.propTypes={};var ve={},Wt=ye;Object.defineProperty(ve,"__esModule",{value:!0});var Ve=ve.default=void 0,Yt=Wt(Ce()),Gt=e;Ve=ve.default=(0,Yt.default)((0,Gt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ee={},Xt=ye;Object.defineProperty(Ee,"__esModule",{value:!0});var We=Ee.default=void 0,qt=Xt(Ce()),_t=e;We=Ee.default=(0,qt.default)((0,_t.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Re={},$t=ye;Object.defineProperty(Re,"__esModule",{value:!0});var Ye=Re.default=void 0,es=$t(Ce()),ts=e;Ye=Re.default=(0,es.default)((0,ts.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function Te({spaceGateway:t,onConfirm:o,onCancel:n}){const{t:s}=E(),[i,a]=j.useState(!1),[r,p]=j.useState(!1),c=(u,d)=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),a(d)},m=async u=>{try{u==null||u.stopPropagation(),p(!0),await(o==null?void 0:o(t)),a(!1)}catch(d){console.error(d),k.error(`${s("storage.space.gateway.delete.failed")}: ${X(d)}`)}finally{a(!1),p(!1)}},x=u=>{c(u,!1),n==null||n(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:u=>c(u,!0),children:[e.jsx(V,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(W,{style:{color:"red"},children:s("common.delete")})]}),e.jsx(mt,{title:s("storage.spaces.gateway.delete.title"),open:i,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:r}},onConfirm:m,onCancel:x,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Te.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};Te.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function De({spaceGateway:t,selected:o,onDelete:n,onConnect:s,enableSwitchToSpace:i,backupInProgress:a,...r}){const{abortBlockletBackup:p}=U(),[c,m]=j.useState(null),{t:x}=E(),[u,d]=j.useState(!1),y=(S,l)=>{S.stopPropagation(),S.preventDefault(),m(l&&S.currentTarget)},b=async S=>{try{d(!0),y(S,!1),await s(t)}catch(l){console.error(l),k.error(l.message)}finally{d(!1)}},B=async S=>{try{d(!0),y(S,!1),await p()}catch(l){console.error(l),k.error(l.message)}finally{d(!1)}};return e.jsxs(e.Fragment,{children:[u||t!=null&&t.loading?e.jsx(w,{sx:{ml:1},size:"24px"}):e.jsx(tt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>y(S,!0),...r,children:e.jsx(Ut,{})}),e.jsxs(st,{id:"simple-menu",anchorEl:c,keepMounted:!0,open:!!c,onClose:S=>y(S,!1),children:[e.jsxs(K,{onClick:S=>{y(S,!1),window.open(Ue(t.endpoint?Rt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx(W,{children:x("common.open")})]}),e.jsxs(K,{onClick:S=>{y(S,!1),window.open(Ue(Tt(t.endpoint),{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ye,{fontSize:"small"})}),e.jsx(W,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!o&&i&&e.jsxs(K,{onClick:b,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(We,{fontSize:"small"})}),e.jsx(W,{children:x("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:B,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Mt,{fontSize:"small"})}),e.jsx(W,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Te,{spaceGateway:t,onConfirm:async()=>{m(null),await(n==null?void 0:n(t))},onCancel:()=>m(null)})]})]})}De.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};De.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const ss=Se(({className:t,...o})=>e.jsx(je,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function we({spaceGateway:t,spaceStatus:o,selected:n,onConnected:s,onDeleted:i,onBackedUp:a}){const{t:r,locale:p}=E(),{blocklet:c}=O(),{api:m,info:{did:x}}=z(),{appDid:u,appName:d,appDescription:y,scopes:b,appUrl:B,referrer:S}=Ne({blocklet:c}),{backupProgress:l,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:ne,refreshBackups:oe}=U(),[P,M]=j.useState(!1),[R,D]=j.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:r("storage.spaces.authorize.title",{appName:d},p),scan:r("storage.spaces.authorize.scan",{appName:d},p),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:r("storage.spaces.authorize.success")})},onClose:()=>{D(A=>({...A,open:!1}))}}),ae=n&&!P&&o===pe.DISCONNECTED,re=n&&!P&&!t.loading&&o===pe.CONNECTED,Q=n&&P&&o===pe.CONNECTED&&(l==null?void 0:l.progress)>=0,q=async()=>{try{if(await Dt(t==null?void 0:t.endpoint)){await m.configBlocklet({input:{did:[c.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),k.success(r("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s==null||s(null,t);return}}catch(A){console.error(A),s==null||s(A,t);return}D(A=>({...A,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Pe.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:d,appDescription:y,scopes:b,appUrl:B,referrer:S,nodeDid:x,spaceDid:t.did}}))},ie=async(A,Z)=>{const h=Z(A.endpoint),N=ge(h),I=A.space?Z(A.space):{};if(t.did&&N!==t.did){D(de=>({...de,open:!1}));const H=r("storage.spaces.gateway.switch.failedForMismatchSpace",{name:I!=null&&I.name?I.name:""});k.error(H),s==null||s(new Error(H),t);return}const L={...t,name:I.name??"DID Space",did:I.did??ge(h),endpoint:h};await te(L),D(H=>({...H,open:!1})),s==null||s(null,L)},ce=async()=>{try{if(P)return;M(!0),await m.backupBlocklet({input:{appDid:c.appDid,to:"spaces"}})}catch(A){console.error(A),k.error(A.message),a==null||a(A,t)}finally{M(!0)}},le=async()=>{try{await se(t),k.success(r("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),i==null||i(null,t)}catch(A){console.error(A),i==null||i(A,t)}};return j.useEffect(()=>{l!=null&&l.completed?(n&&((l==null?void 0:l.progress)===100?(k.success(r("storage.spaces.backupSuccessfully")),a==null||a(null,t)):l.message&&(a==null||a(new Error(l==null?void 0:l.message),t)),l.progress=0,l.message=""),M(!1),setTimeout(()=>{ne(),oe()},1e3)):l.progress&&M(!0)},[l]),e.jsxs(e.Fragment,{children:[e.jsxs(g,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[re&&e.jsx(ue,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:r("storage.spaces.strategy.backupNow")}),ae&&e.jsx(ue,{className:"action-btn",variant:"outlined",size:"small",onClick:q,children:r("storage.spaces.disconnected.reconnectNow")}),Q&&e.jsx(ss,{title:(l==null?void 0:l.message)&&e.jsx(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:l.message})}),children:e.jsxs(ue,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(w,{variant:"determinate",value:l==null?void 0:l.progress,size:14,sx:{mr:1}}),l==null?void 0:l.progress,"%"]})}),e.jsx(ht,{forceConnected:!1,saveConnect:!1,prefix:R.prefix,open:R.open,popup:!0,action:R.action,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:ie,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.messages,locale:p},"get-endpoint")]}),e.jsx(De,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:q,enableSwitchToSpace:(l==null?void 0:l.completed)||G(l==null?void 0:l.message),backupInProgress:Q})]})}we.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};we.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ge({...t}){const{t:o}=E();return e.jsxs(g,{...t,children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:o("storage.spaces.backup.records")})}),e.jsx(Be,{}),e.jsx(Ie,{})]})}Ge.propTypes={};function Xe({...t}){const{t:o}=E(),{autoBackup:n,updateAutoBackup:s}=U(),i=async()=>{try{const a=!(n!=null&&n.enabled);await s({enabled:a}),k.success(o(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){k.error(a.message)}};return e.jsx(Ft,{checked:!!(n!=null&&n.enabled),onChange:i,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Xe.propTypes={};function ns(){const{t}=E(),{spaceGateways:o,spaceGatewaysLoading:n,spaceGatewayIsSelected:s}=U(),i=n&&!(o!=null&&o.length),a=({spaceGateway:r,spaceStatus:p,selected:c,refresh:m})=>e.jsx(we,{spaceGateway:r,spaceStatus:p,selected:c,onConnected:()=>m(),onBackedUp:x=>x&&m()});return e.jsxs(g,{display:"flex",flexDirection:"column",children:[e.jsx(xe,{sx:{button:{fontSize:"revert",fontWeight:500}},left:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Xe,{}),e.jsx(ee,{})]})}),e.jsx(g,{mt:2,children:i?e.jsx(g,{display:"flex",justifyContent:"center",children:e.jsx(w,{})}):e.jsx(Oe,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(r=>e.jsx(Oe,{item:!0,xs:12,md:6,children:e.jsx(dt,{endpoint:r.endpoint,selected:s(r),action:a},r.endpoint)}))})})}),e.jsx(Ge,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ze,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=U();return t?e.jsx(Fe,{relative:"parent",children:e.jsx(w,{})}):G(o)?e.jsx(Ke,{}):e.jsx(ns,{})}function as(){return e.jsx(Ae,{children:e.jsx(os,{})})}function rs(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:n,hasStorageEndpoint:s,loading:i,storageEndpoint:a}=Pt(),r=he(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return i?e.jsx(Fe,{relative:"parent",children:e.jsx(w,{})}):e.jsxs(g,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(At,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(Bt,{}),e.jsx(g,{sx:r,children:e.jsx(bt,{onConnect:n,storageEndpoint:a})})]})}function is(){const{t}=E();return e.jsxs(zt,{children:[e.jsxs(J,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(rs,{})]})}function qe({navOrientation:t,...o}){const{t:n,locale:s}=E(),{blocklet:i}=O(),a=jt({key:"md"}),[r,p]=ot(),c=r.get("tab")||"backup",m=a?"horizontal":t,x=he(()=>{var l;const B=[{label:n("common.backup"),value:"backup"}],S=(l=i==null?void 0:i.capabilities)==null?void 0:l.didSpace;return(S===F.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===F.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&B.push({label:n("common.storage"),value:"storage"}),B},[s,m]),d=he(()=>({backup:e.jsx(as,{}),storage:e.jsx(is,{})}))[c],y=B=>{p(S=>(B==="backup"?S.delete("tab"):S.set("tab",B),S))};if(x.length<=1)return e.jsx(me,{children:d});const b=e.jsx(ft,{tabs:x,current:c,orientation:m,onChange:y,sx:[{borderRight:1,height:"100%",borderColor:"divider"},m==="horizontal"&&{borderRight:0}]});if(m==="vertical")return e.jsx(g,{...o,children:e.jsxs(J,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(g,{sx:{flexShrink:0},children:e.jsx(xe,{left:b})}),e.jsx(g,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:d})})]})});if(m==="horizontal")return e.jsxs(g,{...o,children:[e.jsx(xe,{left:b}),e.jsx(me,{sx:{mt:2},children:d})]})}qe.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};qe.defaultProps={navOrientation:"vertical"};const me=Se(g)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as A,v as R,p as w,e as p}from"./index-
|
|
1
|
+
import{d as A,v as R,p as w,e as p}from"./index-CHbpkZwO.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as ne,Y as U,bZ as Ee,b_ as Ue,i as le,I as K,bX as We,bY as Me,ab as _e,ac as $e,aa as Ve,b$ as Ne,b4 as Ce,j as he,r as He,b2 as X,c0 as xe,al as je,B as z,bM as Je,a4 as Ke,c1 as Ze,a5 as Ge,a1 as Ye,_ as Xe,ar as De}from"./vendor-ux-did-connect-D2f9rdKK.js";import{u as p,a as se,f as te,c as Qe}from"./vendor-hooks-DftG_2gV.js";import{r as R}from"./vendor-react-DEoibe3W.js";import{j as e,a9 as m,bs as W,bo as E,O,y as $,H as N,T as fe,I as ae,X as re,ag as Re,ak as J,cA as et,a8 as tt,e as be,aa as ge,a5 as Ae,ac as nt}from"./vendor-mui-core-8zafwTFh.js";import{I as Y,a6 as st,b as qe,C as ot,n as G,aH as at,y as rt,z as it}from"./vendor-utils-BNHJB5U7.js";import{z as H,C as V,E as oe,F as I,aD as Fe}from"./index-CVvs-hHV.js";import{S as ie}from"./switch-control-D0bd_WCg.js";import{S as C}from"./dashboard-CCzZLCC4.js";import{K as lt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{K as Pe,Q as ct,c as dt}from"./vendor-arcblock-JGYMkSwE.js";import{I as ut}from"./index-ARVZ7FJv.js";import{b as mt}from"./base32-CXHhcaAE.js";import{u as pt}from"./use-mobile-CwehvZ0f.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CNdV3Qx_.js";import"./confirm-BshZuFnD.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DfQEcw-G.js";import"./get-safe-url-Bz4L9R5-.js";import"./session-CmpGpqja.js";import"./index-DomukIqT.js";import"./InfoOutlined-K2cm3ASV.js";import"./dot-tsWWWiOg.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-KRs0Yv73.js";const ce={enabled:!1,domain:"",clientId:"",clientSecret:""};function ht(){var b,y,i;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(b=r==null?void 0:r.meta)==null?void 0:b.did,w=Object.assign({...ce},((i=(y=r==null?void 0:r.settings)==null?void 0:y.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ce))}),d=h("enabled"),k=p(async a=>{var T,o;try{const{blocklet:j}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:a})}}),u=Object.assign({...ce},((o=(T=j==null?void 0:j.settings)==null?void 0:T.oauth)==null?void 0:o.auth0)||{});l(u),U.success(n("oauth.saveSuccess"))}catch(j){U.error(j.message||n("oauth.saveFailed"))}}),L=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.domainDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientSecretDescription")),v=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:a})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(C,{title:n("oauth.auth0.domain"),children:e.jsx(I,{name:"domain",control:f,rules:{validate:d?L:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?x:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?g:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const de={enabled:!1,clientId:"",clientSecret:""};function xt(){var v,b,y;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...de},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),j=Object.assign({...de},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.github)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.github.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.github.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function ft(){var v,b,y;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...ue},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),j=Object.assign({...ue},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.google)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.google.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.google.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function gt(){var i,a,T;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(i=r==null?void 0:r.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(a=r==null?void 0:r.settings)==null?void 0:a.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async o=>{var j,u;try{const{blocklet:P}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({apple:o})}}),A=Object.assign({...me},((u=(j=P==null?void 0:P.settings)==null?void 0:j.oauth)==null?void 0:u.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(P){U.error(P.message||n("oauth.saveFailed"))}}),L=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.keyIdDescription")),v=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.authKeyDescription")),b=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.bundleIdDescription")),y=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:o})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:o.value,...o})})})}),e.jsx(C,{title:n("oauth.apple.teamId"),children:e.jsx(I,{name:"teamId",control:f,rules:{validate:d?L:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.bundleId"),children:e.jsx(I,{name:"bundleId",control:f,rules:{validate:d?b:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.serviceId"),children:e.jsx(I,{name:"serviceId",control:f,rules:{validate:d?x:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.keyId"),children:e.jsx(I,{name:"keyId",control:f,rules:{validate:d?g:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.authKey"),children:e.jsx(I,{name:"authKey",control:f,rules:{validate:d?v:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const jt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ve({title:S,id:r,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=R.useState(t),l=R.useRef(null),d=R.useRef(null),[{handlerId:k},L]=Ee({accept:"dragItem",collect(y){return{handlerId:y.getHandlerId()}},hover(y,i){var _,Q;if(!l.current)return;const a=y.index,T=s;if(a===T)return;const o=(_=l.current)==null?void 0:_.getBoundingClientRect(),j=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),u=(j.bottom-j.top)/2,A=i.getClientOffset().y-o.top;a<T&&A<u||a>T&&A>u||(w(a,T),y.index=T)}}),[{isDragging:x},g]=Ue({item:{index:s,type:"dragItem"},collect:y=>({isDragging:y.isDragging()}),end:f});g(d),L(l);const v=x?.5:1,b=p(y=>{y.preventDefault(),y.stopPropagation(),h(!c)});return e.jsxs(m,{ref:l,children:[e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:le.backgroundsBgSubtileHover}},ref:d,"data-handler-id":k,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:le.textMuted,"&:hover":{color:le.textSubtitle}},children:e.jsx(K,{fontSize:20,icon:jt})}),e.jsx(fe,{sx:{flex:1},children:S}),e.jsx(ae,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:lt,style:{transform:"scale(1.5)"}})})]}),e.jsx(re,{})]}),e.jsx(m,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}ve.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};ve.defaultProps={defaultExpand:!1};const bt=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:_e}),component:e.jsx(xt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:$e}),component:e.jsx(ft,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Ve}),component:e.jsx(gt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ne}),component:e.jsx(ht,{})}],vt=["github","google","apple","auth0"];function yt(){var k,L;const{api:S}=H(),{blocklet:r}=V(),n=(k=r==null?void 0:r.meta)==null?void 0:k.did,s=((L=r==null?void 0:r.settings)==null?void 0:L.oauth)||{},w=Object.keys(s).sort((x,g)=>{var v,b,y;return((v=s[x])==null?void 0:v.order)!==void 0&&((b=s[g])==null?void 0:b.order)!==void 0?s[x].order-s[g].order:((y=s[x])==null?void 0:y.order)!==void 0?-1:1});for(const x of vt)w.includes(x)||w.push(x);const t=se(w.reduce((x,g,v)=>Object.assign(x,{[g]:v}),{})),f=te(()=>{const x=[...bt];return x.sort((g,v)=>t[g.name]-t[v.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(v=>{g[v]={order:x[v]}}),await S.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const v=f[x],b=f[g];t[v.name]=g,t[b.name]=x}),d=p(async()=>{await h(t)});return e.jsx(m,{sx:{".section-left":{width:"160px"}},children:e.jsx(We,{backend:Me,...c,children:f.map((x,g)=>e.jsx(ve,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const Z={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function M(S){return e.jsx(ct,{...S,sx:{transform:"scale(0.75)"}})}function pe(S,r=!1){const n=r?S.ttl*86400:S.ttl/86400;return{...S,ttl:n}}function St(){var o,j;const{api:S}=H(),{blocklet:r}=V(),n=(o=r==null?void 0:r.meta)==null?void 0:o.did,s=st({},Z,((j=r==null?void 0:r.settings)==null?void 0:j.session)||{});qe(s.ttl)&&(s.ttl=Z.ttl),qe(s.cacheTtl)&&(s.cacheTtl=Z.cacheTtl),s.phone||(s.phone=Z.phone),s.email||(s.email=Z.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=oe({defaultValues:Y(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=ne(),d=h("email.enabled"),k=h("phone.enabled"),L=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:v,remove:b}=Fe({control:t,name:"email.domainBlackList"}),{fields:y,append:i,remove:a}=Fe({control:t,name:"email.domainWhiteList"}),T=p(async u=>{var P;try{const{blocklet:A}=await S.updateAppSessionConfig({input:{did:n,config:ot(pe(u,!0),["phone"])}}),_=Object.assign({},Z,Y(((P=A==null?void 0:A.settings)==null?void 0:P.session)||{},["ttl","cacheTtl","email","phone"]));c(pe(_)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(wt,{onSubmit:w(T),children:e.jsxs(J,{direction:"column",gap:6,children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(m,{component:re,my:3})]}),e.jsxs(J,{gap:2,children:[e.jsx(C,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enabled",control:t,render:({field:u})=>e.jsx(M,{...u,checked:u.value})})})}),d&&e.jsxs(J,{direction:"column",ml:2,children:[e.jsx(C,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireVerified",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireUnique",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.trustOauthProviders",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainBlackList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),L&&e.jsxs(m,{children:[g.map((u,P)=>e.jsxs(J,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainBlackList.${P}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>b(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>v(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(C,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainWhiteList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),x&&e.jsxs(m,{children:[y.map((u,P)=>e.jsxs(J,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainWhiteList.${P}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>a(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(C,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.enabled",control:t,disabled:!0,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),k&&e.jsxs(J,{direction:"column",ml:2,mt:1,children:[e.jsx(C,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireVerified",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireUnique",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(m,{component:re,my:3}),e.jsx(J,{direction:"column",spacing:2,children:e.jsx(I,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:u})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(C,{title:l("blocklet.config.session.ttl",{day:u.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{maxWidth:500,ml:1},children:e.jsx(et,{...u,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(m,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const wt=Re.form`
|
|
1
|
+
import{u as ne,Y as U,bZ as Ee,b_ as Ue,i as le,I as K,bX as We,bY as Me,ab as _e,ac as $e,aa as Ve,b$ as Ne,b4 as Ce,j as he,r as He,b2 as X,c0 as xe,al as je,B as z,bM as Je,a4 as Ke,c1 as Ge,a5 as Ze,a1 as Ye,_ as Xe,ar as De}from"./vendor-ux-did-connect-BdkhddhO.js";import{u as p,a as se,f as te,c as Qe}from"./vendor-hooks-DftG_2gV.js";import{r as R}from"./vendor-react-DEoibe3W.js";import{j as e,a9 as m,bs as W,bo as E,O,y as $,H as N,T as fe,I as ae,X as re,ag as Re,ak as J,cG as et,a8 as tt,e as be,aa as ge,a5 as Ae,ac as nt}from"./vendor-mui-core-CQ38ohp2.js";import{I as Y,a6 as st,b as qe,C as ot,n as Z,aH as at,y as rt,z as it}from"./vendor-utils-BNHJB5U7.js";import{z as H,C as V,E as oe,F as I,aD as Fe}from"./index-DO3_1y-L.js";import{S as ie}from"./switch-control-5fEOPVKs.js";import{S as C}from"./dashboard-8QXGSoVu.js";import{K as lt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{K as Pe,Q as ct,c as dt}from"./vendor-arcblock-ScFEr-lj.js";import{I as ut}from"./index-CGBZONPv.js";import{b as mt}from"./base32-p9VcJrwv.js";import{u as pt}from"./use-mobile-DlKplWTG.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";const ce={enabled:!1,domain:"",clientId:"",clientSecret:""};function ht(){var b,y,i;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(b=r==null?void 0:r.meta)==null?void 0:b.did,w=Object.assign({...ce},((i=(y=r==null?void 0:r.settings)==null?void 0:y.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ce))}),d=h("enabled"),k=p(async a=>{var T,o;try{const{blocklet:j}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:a})}}),u=Object.assign({...ce},((o=(T=j==null?void 0:j.settings)==null?void 0:T.oauth)==null?void 0:o.auth0)||{});l(u),U.success(n("oauth.saveSuccess"))}catch(j){U.error(j.message||n("oauth.saveFailed"))}}),L=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.domainDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.auth0.clientSecretDescription")),v=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:a})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(C,{title:n("oauth.auth0.domain"),children:e.jsx(I,{name:"domain",control:f,rules:{validate:d?L:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?x:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?g:v},render:({field:a})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[a.name],helperText:((T=c.errors[a.name])==null?void 0:T.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const de={enabled:!1,clientId:"",clientSecret:""};function xt(){var v,b,y;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...de},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),j=Object.assign({...de},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.github)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.github.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.github.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function ft(){var v,b,y;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(v=r==null?void 0:r.meta)==null?void 0:v.did,w=Object.assign({...ue},((y=(b=r==null?void 0:r.settings)==null?void 0:b.oauth)==null?void 0:y.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var a,T;try{const{blocklet:o}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),j=Object.assign({...ue},((T=(a=o==null?void 0:o.settings)==null?void 0:a.oauth)==null?void 0:T.google)||{});l(j),U.success(n("oauth.saveSuccess"))}catch(o){U.error(o.message||n("oauth.saveFailed"))}}),L=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.google.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?L:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.google.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var a;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((a=c.errors[i.name])==null?void 0:a.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function gt(){var i,a,T;const{api:S}=H(),{blocklet:r}=V(),{t:n}=ne(),s=(i=r==null?void 0:r.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(a=r==null?void 0:r.settings)==null?void 0:a.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=oe({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async o=>{var j,u;try{const{blocklet:P}=await S.configOAuth({input:{did:s,oauth:JSON.stringify({apple:o})}}),A=Object.assign({...me},((u=(j=P==null?void 0:P.settings)==null?void 0:j.oauth)==null?void 0:u.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(P){U.error(P.message||n("oauth.saveFailed"))}}),L=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.keyIdDescription")),v=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.authKeyDescription")),b=p(o=>o!=null&&o.trim()?!0:n("oauth.apple.bundleIdDescription")),y=p(()=>!0);return e.jsx(m,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:o})=>e.jsx(W,{control:e.jsx(ie,{sx:{ml:1},checked:o.value,...o})})})}),e.jsx(C,{title:n("oauth.apple.teamId"),children:e.jsx(I,{name:"teamId",control:f,rules:{validate:d?L:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.bundleId"),children:e.jsx(I,{name:"bundleId",control:f,rules:{validate:d?b:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.serviceId"),children:e.jsx(I,{name:"serviceId",control:f,rules:{validate:d?x:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.keyId"),children:e.jsx(I,{name:"keyId",control:f,rules:{validate:d?g:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.authKey"),children:e.jsx(I,{name:"authKey",control:f,rules:{validate:d?v:y},render:({field:o})=>{var j;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...o,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[o.name],helperText:((j=c.errors[o.name])==null?void 0:j.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const jt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ve({title:S,id:r,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=R.useState(t),l=R.useRef(null),d=R.useRef(null),[{handlerId:k},L]=Ee({accept:"dragItem",collect(y){return{handlerId:y.getHandlerId()}},hover(y,i){var _,Q;if(!l.current)return;const a=y.index,T=s;if(a===T)return;const o=(_=l.current)==null?void 0:_.getBoundingClientRect(),j=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),u=(j.bottom-j.top)/2,A=i.getClientOffset().y-o.top;a<T&&A<u||a>T&&A>u||(w(a,T),y.index=T)}}),[{isDragging:x},g]=Ue({item:{index:s,type:"dragItem"},collect:y=>({isDragging:y.isDragging()}),end:f});g(d),L(l);const v=x?.5:1,b=p(y=>{y.preventDefault(),y.stopPropagation(),h(!c)});return e.jsxs(m,{ref:l,children:[e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:le.backgroundsBgSubtileHover}},ref:d,"data-handler-id":k,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:le.textMuted,"&:hover":{color:le.textSubtitle}},children:e.jsx(K,{fontSize:20,icon:jt})}),e.jsx(fe,{sx:{flex:1},children:S}),e.jsx(ae,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:lt,style:{transform:"scale(1.5)"}})})]}),e.jsx(re,{})]}),e.jsx(m,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}ve.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};ve.defaultProps={defaultExpand:!1};const bt=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:_e}),component:e.jsx(xt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:$e}),component:e.jsx(ft,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Ve}),component:e.jsx(gt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ne}),component:e.jsx(ht,{})}],vt=["github","google","apple","auth0"];function yt(){var k,L;const{api:S}=H(),{blocklet:r}=V(),n=(k=r==null?void 0:r.meta)==null?void 0:k.did,s=((L=r==null?void 0:r.settings)==null?void 0:L.oauth)||{},w=Object.keys(s).sort((x,g)=>{var v,b,y;return((v=s[x])==null?void 0:v.order)!==void 0&&((b=s[g])==null?void 0:b.order)!==void 0?s[x].order-s[g].order:((y=s[x])==null?void 0:y.order)!==void 0?-1:1});for(const x of vt)w.includes(x)||w.push(x);const t=se(w.reduce((x,g,v)=>Object.assign(x,{[g]:v}),{})),f=te(()=>{const x=[...bt];return x.sort((g,v)=>t[g.name]-t[v.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(v=>{g[v]={order:x[v]}}),await S.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const v=f[x],b=f[g];t[v.name]=g,t[b.name]=x}),d=p(async()=>{await h(t)});return e.jsx(m,{sx:{".section-left":{width:"160px"}},children:e.jsx(We,{backend:Me,...c,children:f.map((x,g)=>e.jsx(ve,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const G={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function M(S){return e.jsx(ct,{...S,sx:{transform:"scale(0.75)"}})}function pe(S,r=!1){const n=r?S.ttl*86400:S.ttl/86400;return{...S,ttl:n}}function St(){var o,j;const{api:S}=H(),{blocklet:r}=V(),n=(o=r==null?void 0:r.meta)==null?void 0:o.did,s=st({},G,((j=r==null?void 0:r.settings)==null?void 0:j.session)||{});qe(s.ttl)&&(s.ttl=G.ttl),qe(s.cacheTtl)&&(s.cacheTtl=G.cacheTtl),s.phone||(s.phone=G.phone),s.email||(s.email=G.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=oe({defaultValues:Y(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=ne(),d=h("email.enabled"),k=h("phone.enabled"),L=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:v,remove:b}=Fe({control:t,name:"email.domainBlackList"}),{fields:y,append:i,remove:a}=Fe({control:t,name:"email.domainWhiteList"}),T=p(async u=>{var P;try{const{blocklet:A}=await S.updateAppSessionConfig({input:{did:n,config:ot(pe(u,!0),["phone"])}}),_=Object.assign({},G,Y(((P=A==null?void 0:A.settings)==null?void 0:P.session)||{},["ttl","cacheTtl","email","phone"]));c(pe(_)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(wt,{onSubmit:w(T),children:e.jsxs(J,{direction:"column",gap:6,children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(m,{component:re,my:3})]}),e.jsxs(J,{gap:2,children:[e.jsx(C,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(M,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enabled",control:t,render:({field:u})=>e.jsx(M,{...u,checked:u.value})})})}),d&&e.jsxs(J,{direction:"column",ml:2,children:[e.jsx(C,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireVerified",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireUnique",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.trustOauthProviders",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainBlackList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),L&&e.jsxs(m,{children:[g.map((u,P)=>e.jsxs(J,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainBlackList.${P}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>b(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>v(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(C,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainWhiteList",control:t,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),x&&e.jsxs(m,{children:[y.map((u,P)=>e.jsxs(J,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainWhiteList.${P}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ae,{onClick:()=>a(P),children:e.jsx(Ce,{})})]},u.id)),e.jsx($,{startIcon:e.jsx(Pe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(C,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.enabled",control:t,disabled:!0,render:({field:u})=>e.jsx(W,{sx:{mt:1},control:e.jsx(M,{...u,checked:u.value})})})})}),k&&e.jsxs(J,{direction:"column",ml:2,mt:1,children:[e.jsx(C,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireVerified",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireUnique",control:t,render:({field:u})=>e.jsx(W,{control:e.jsx(M,{...u,checked:u.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(fe,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(m,{component:re,my:3}),e.jsx(J,{direction:"column",spacing:2,children:e.jsx(I,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:u})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(C,{title:l("blocklet.config.session.ttl",{day:u.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{maxWidth:500,ml:1},children:e.jsx(et,{...u,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(m,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const wt=Re.form`
|
|
2
2
|
max-width: 1536px;
|
|
3
3
|
|
|
4
4
|
.advanced-config {
|
|
@@ -38,7 +38,7 @@ import{u as ne,Y as U,bZ as Ee,b_ as Ue,i as le,I as K,bX as We,bY as Me,ab as _
|
|
|
38
38
|
.form-item {
|
|
39
39
|
margin-top: 0;
|
|
40
40
|
}
|
|
41
|
-
`;var ye={},kt=tt;Object.defineProperty(ye,"__esModule",{value:!0});var Se=ye.default=void 0,Tt=kt(He()),Lt=e;Se=ye.default=(0,Tt.default)((0,Lt.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"}),"Stars");const It={width:24,height:24,body:'<path fill="currentColor" d="M6 12.05q0 1.125.425 2.188T7.75 16.2l.25.25V15q0-.425.288-.713T9 14q.425 0 .713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.713-.288T4 19q0-.425.288-.713T5 18h1.75l-.4-.35q-1.3-1.15-1.825-2.625T4 12.05Q4 9.7 5.2 7.787T8.425 4.85q.35-.2.738-.025t.512.575q.125.375-.013.75t-.487.575q-1.45.8-2.313 2.213T6 12.05Zm12-.1q0-1.125-.425-2.187T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10q-.425 0-.713-.288T14 9V5q0-.425.288-.713T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6h-1.75l.4.35q1.225 1.225 1.788 2.663T20 11.95q0 2.35-1.2 4.263t-3.225 2.937q-.35.2-.737.025t-.513-.575q-.125-.375.013-.75t.487-.575q1.45-.8 2.313-2.212T18 11.95Z"/>'},{DEFAULT_IP_DOMAIN_SUFFIX:Ct,SLOT_FOR_IP_DNS_SITE:Dt,DEFAULT_DID_DOMAIN:qt}=he,{encode:Oe}=mt,Ft=S=>`${Oe(S.meta.did)}-${Dt}.${Ct}`,Pt=({did:S,didDomain:r=qt})=>`${Oe(S)}.${r}`;var Rt={getIpDnsDomainForBlocklet:Ft,getDidDomainForBlocklet:Pt};const At=R.forwardRef((S,r)=>{var b,y;const{t:n}=R.useContext(X),{blocklet:s}=V(),{api:w}=H(),t=se({loadingReject:!1,loadingApprove:!1,mode:"view",show:!1,data:{},callback:G}),f=be(),c=((y=(b=f==null?void 0:f.transitions)==null?void 0:b.duration)==null?void 0:y.leavingScreen)||300,h=p(()=>{t.mode="view",t.data={},t.callback=G}),l=p(()=>{t.show=!1,setTimeout(()=>{h()},c)}),d=p(i=>{t.mode="view",t.show=!0,t.data=i}),k=p((i,a=G)=>{t.mode="approve",t.show=!0,t.data=i,t.callback=a});R.useImperativeHandle(r,()=>({open:d,close:l,approve:k}),[d,l,k]);const L=te(()=>{if(!t.show)return[];t.data.migratedFrom=[t.data.appId,t.data.appPid];const i=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return t.data.isMaster!==!1&&at(i,"appliedAt","status"),i.map(a=>{const T=n(`federated.info.${a}`);let o=t.data[a];if(a==="appName"&&t.data.isMaster&&(o=e.jsxs(m,{children:[e.jsx(Ae,{component:Se}),o]})),["appId","appPid","serverId"].includes(a)&&(o=e.jsx(xe,{children:o})),["appUrl"].includes(a)&&(o=e.jsx(m,{component:"a",href:o,target:"_blank",children:o})),["appLogo"].includes(a)){const j=rt(`https://${Rt.getDidDomainForBlocklet({did:t.data.appPid})}`,"/.well-known/service/blocklet/logo");try{const u=new URL(j);u.searchParams.set("imageFilter","resize"),u.searchParams.set("w","80"),u.searchParams.set("h","80"),o=e.jsx("img",{src:u.href,width:"60",height:"60",alt:t.data.appName})}catch{o=e.jsx("img",{src:j,width:"60",height:"60",alt:t.data.appName})}}return a==="status"&&(o=o&&n(`federated.status.${o}`)),a==="migratedFrom"&&(o=(t.data.migratedFrom||[]).filter(P=>![t.data.appId,t.data.appPid].includes(P)).map(P=>e.jsx(xe,{children:P}))),it(o)&&(o="-"),{name:T,value:o}})},[t.data]),x=t.mode==="approve",g=p(async()=>{try{t.loadingReject=!0,await w.auditFederatedLogin({input:{memberPid:t.data.appPid,did:s.appPid,status:"rejected"}}),l(),t==null||t.callback(!1)}finally{t.loadingReject=!1}}),v=p(async()=>{try{t.loadingApprove=!0,await w.auditFederatedLogin({input:{memberPid:t.data.appPid,did:s.appPid,status:"approved"}}),l(),t==null||t.callback(!0)}finally{t.loadingApprove=!1}});return e.jsx(je,{open:t.show,title:n(x?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:l,actions:x?e.jsxs(e.Fragment,{children:[e.jsxs($,{color:"error",variant:"contained",onClick:g,disabled:t.loadingReject,children:[t.loadingReject?e.jsx(ge,{size:16,color:"grey"}):null,n("common.reject")]}),e.jsxs($,{variant:"contained",onClick:v,disabled:t.loadingApprove,children:[t.loadingApprove?e.jsx(ge,{size:16,color:"grey"}):null,n("common.approve")]})]}):e.jsx($,{variant:"outlined",onClick:l,children:n("common.close")}),children:L.map(i=>e.jsx(ut,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:i.name,children:i.value},i.name))})}),Be=R.forwardRef((S,r)=>{var d,k;const n=be(),s=((k=(d=n==null?void 0:n.transitions)==null?void 0:d.duration)==null?void 0:k.leavingScreen)||300,{t:w}=R.useContext(X),t=se({show:!1,data:{link:""}}),f=p(()=>{t.data.link=""}),c=p(()=>{t.show=!1,setTimeout(()=>{f()},s)}),h=p(({link:L})=>{t.show=!0,t.data.link=L});R.useImperativeHandle(r,()=>({open:h,close:c}),[h,c]);const l=p(()=>{Qe(t.data.link),c()});return e.jsxs(je,{open:t.show,title:w("federated.joinFederatedLogin"),onClose:c,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:l,children:w("common.copyAndClose")}),children:[e.jsx(m,{mb:1,children:w("federated.inviteJoinFederatedLoginDescription")}),e.jsx(m,{sx:{"& .copy-button":{display:"none !important"}},children:e.jsx(Je,{language:"shell",style:{marginBottom:0},children:t.data.link})})]})});function we({mode:S}){var Q,ke,Te,Le,Ie;const r=R.useRef(null),n=R.useRef(null),{t:s,locale:w}=R.useContext(X),{blocklet:t,actions:{refreshBlocklet:f}}=V(),{confirmApi:c,confirmHolder:h}=Ke(),{api:l}=H(),d=((Q=t.settings.federated)==null?void 0:Q.sites)||[],k=((ke=t.settings.federated)==null?void 0:ke.config)||{},L=k.isMaster!==!1,x=d.find(D=>D.appPid===t.appPid),g=se({loadingSync:!1}),v=p(D=>{var q;(q=n.current)==null||q.open(D)}),b=p(D=>{var q;(q=n.current)==null||q.approve(D,f)}),y=p(D=>{c.open({title:s("federated.removeFederatedLogin"),content:s("federated.removeFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(q){await l.quitFederatedLogin({input:{did:t.appPid,targetDid:D.appPid}}),q()}})}),i=p(D=>{c.open({title:s("federated.disableFederatedLogin"),content:s("federated.disableFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(q){await l.auditFederatedLogin({input:{memberPid:D.appPid,did:t.appPid,status:"revoked"}}),q()}})}),a=p(D=>{c.open({title:s("federated.enableFederatedLogin"),content:s("federated.enableFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),async onConfirm(q){await l.auditFederatedLogin({input:{memberPid:D.appPid,did:t.appPid,status:"approved"}}),q()}})}),T=te(()=>{const D=[{label:s("common.name"),name:"appName",options:{customBodyRenderLite:q=>{const F=d[q],ee=F.isMaster!==!1;return e.jsx(m,{display:"inline-block",children:e.jsxs(m,{component:"a",display:"flex",alignItems:"center",href:F.appUrl,target:"_blank",onClick:B=>{B.stopPropagation()},children:[ee&&e.jsx(Ae,{component:Se,style:{marginRight:"4px"}}),F.appName]})})}}},{label:s("common.did"),name:"appId",options:{customBodyRenderLite:q=>{const F=d[q];return e.jsx(xe,{children:F.appId})}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:q=>{const F=d[q],ee=F.isMaster!==!1;return e.jsx(m,{children:ee?"-":s(`federated.status.${F.status}`)})}}}];return L&&D.push({label:s("common.actions"),name:"actions",options:{customBodyRenderLite:q=>{const F=d[q],ee=F.isMaster!==!1;return e.jsx(m,{display:"flex",gap:1,children:ee?e.jsxs(e.Fragment,{children:[F.status==="rejected"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation()},children:s("federated.status.rejected")}),F.status==="revoked"&&e.jsx(z,{variant:"contained",color:"secondary",size:"small",onClick:B=>{B.stopPropagation()},children:s("federated.status.revoked")})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation(),y(F)},children:s("federated.quitMember")},"quiteSite"),F.status==="pending"&&e.jsx(z,{variant:"contained",color:"primary",size:"small",onClick:B=>{B.stopPropagation(),b(F)},children:s("federated.status.pending")},"auditSite"),F.status==="approved"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation(),i(F)},style:{whiteSpace:"nowrap"},children:s("federated.revoke")},"revokeSite"),F.status==="revoked"&&e.jsx(z,{variant:"contained",color:"warning",size:"small",onClick:B=>{B.stopPropagation(),a(F)},style:{whiteSpace:"nowrap"},children:s("federated.approve")},"approveSite")]})})}}}),D},[k.appId,d,L,s]),o=te(()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(D,{dataIndex:q}){const F=d[q];v(F)}}),[]),j=p(()=>{var q;const D=t.environments.find(F=>F.key===dt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);D!=null&&D.value?(q=r.current)==null||q.open({link:D.value}):U.error(s("federated.failedToGetFederatedLoginLink"))},[(Ie=(Le=(Te=t.site)==null?void 0:Te.domainAliases)==null?void 0:Le[0])==null?void 0:Ie.href]),u=p(()=>{c.open({title:s("federated.quitFederatedLogin"),content:s("federated.quitFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(D){await l.quitFederatedLogin({input:{did:t.appPid}}),D()}})}),P=p(()=>{c.open({title:s("federated.disbandFederatedLogin"),content:s("federated.disbandFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(D){await l.disbandFederatedLogin({input:{did:t.appPid}}),D()}})}),A=p(async()=>{try{g.loadingSync=!0,await Promise.all([await l.syncFederatedConfig({input:{did:t.appPid}}),Ze(500)]),U.success(s("common.succeeded"))}finally{g.loadingSync=!1}}),_=[];return x.status!=="pending"&&_.push(e.jsx(nt,{title:s("federated.syncConfig"),children:e.jsx(ae,{size:"small",onClick:A,disabled:g.loadingSync,sx:[{"@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},g.loadingSync?{animation:"spin 1s linear infinite"}:{}],children:e.jsx(K,{icon:It,style:{fontSize:24}})},"syncConfig")})),S==="master"?(_.push(e.jsx(z,{size:"small",variant:"contained",onClick:j,sx:{ml:1},children:s("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),_.push(e.jsx(z,{color:"error",size:"small",variant:"contained",onClick:P,sx:{ml:1},children:s("federated.disbandFederatedLogin")},"disbandFederatedLogin"))):_.push(e.jsx(z,{size:"small",variant:"contained",color:"error",onClick:u,sx:{ml:1},children:s("federated.quitFederatedLogin")},"quitFederatedLogin")),e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"main-table",locale:w,data:d,columns:T,customButtons:_,title:e.jsx(m,{className:"table-toolbar-left",children:s("oauth.federated")}),options:o}),h,e.jsx(Be,{ref:r}),e.jsx(At,{ref:n})]})}we.propTypes={mode:N.oneOf(["member","master"])};we.defaultProps={mode:"member"};const Ot=R.forwardRef((S,r)=>{var g,v;const{t:n}=R.useContext(X),{api:s}=H(),{blocklet:w}=V(),t=w==null?void 0:w.appPid,f=be(),c=((v=(g=f==null?void 0:f.transitions)==null?void 0:g.duration)==null?void 0:v.leavingScreen)||300,h=se({loading:!1,show:!1,appUrl:"",appUrlError:"",callback:G}),l=p(()=>{h.appUrl="",h.appUrlError="",h.callback=G}),d=p(()=>{h.show=!1,setTimeout(()=>{l()},c)}),k=p((b=G)=>{h.show=!0,h.callback=b});R.useImperativeHandle(r,()=>({open:k,close:d}),[k,d]);const L=p(b=>{if(!b)throw new Error(n("federated.federatedJoinAppUrlRequired"));if(!Ye(b))throw new Error(n("federated.federatedJoinAppUrlInvalid"))}),x=p(async()=>{try{L(h.appUrl),h.loading=!0;const b=await s.joinFederatedLogin({input:{did:t,appUrl:h.appUrl}});h.show=!1,d(),h==null||h.callback(b)}catch(b){h.appUrlError=b.message}finally{h.loading=!1}});return e.jsxs(je,{open:h.show,title:n("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:e.jsxs(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,disabled:h.loading,children:[h.loading?e.jsx(ge,{size:16,sx:{mr:1},color:"grey"}):null,n("common.confirm")]}),children:[e.jsx(m,{mb:1,children:n("federated.joinFederatedLoginDescription")}),e.jsx(O,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:n("federated.federatedJoinAppUrl"),label:n("federated.federatedJoinAppUrl"),value:h.appUrl,error:!!h.appUrlError,helperText:h.appUrlError||"eg: https://www.arcblock.io",onChange:b=>{h.appUrl=b.target.value}})]})});function Bt(){var c,h,l,d,k;const S=R.useRef(null),r=R.useRef(null),{t:n}=R.useContext(X),{blocklet:s,actions:{refreshBlocklet:w}}=V(),t=p(()=>{var x,g,v,b;const L=(v=(g=(x=s.site)==null?void 0:x.domainAliases)==null?void 0:g[0])==null?void 0:v.href;if(L)try{const y=new URL(L);(b=S.current)==null||b.open({link:y.origin})}catch{U.error(n("federated.failedToGetFederatedLoginLink"))}},[(l=(h=(c=s.site)==null?void 0:c.domainAliases)==null?void 0:h[0])==null?void 0:l.href]),f=p(()=>{var L;(L=r.current)==null||L.open(()=>{w()})});if(((d=s.settings.federated)==null?void 0:d.sites.length)>0){const L=((k=s.settings.federated)==null?void 0:k.config.isMaster)!==!1;return e.jsx(we,{mode:L?"master":"member"})}return e.jsxs(e.Fragment,{children:[e.jsxs(m,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[e.jsx(z,{variant:"contained",onClick:t,children:n("federated.inviteJoinFederatedLogin")}),e.jsx(re,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),e.jsx(z,{variant:"outlined",onClick:f,children:n("federated.joinFederatedLogin")})]}),e.jsx(Be,{ref:S}),e.jsx(Ot,{ref:r})]})}function ze({orientation:S="horizontal"}){const{t:r}=R.useContext(X),n=pt({key:"lg"}),s=[{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.commonSettings")}),value:"settings"},{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.federated")}),value:"federated"},{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.oauth")}),value:"oauth"},{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.moreLogin")}),value:"more"}],[w,t]=R.useState(s[0].value),f=te(()=>({oauth:e.jsx(yt,{}),federated:e.jsx(Bt,{}),more:e.jsx(Xe,{children:r("oauth.comingSoon")}),settings:e.jsx(St,{})}),[r]);return S==="vertical"?e.jsx(zt,{children:e.jsxs(J,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(m,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(De,{tabs:s,current:w,orientation:n?"horizontal":"vertical",onChange:t,sx:{borderRight:n?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(m,{sx:{flexGrow:1,minWidth:0},children:e.jsx(m,{maxWidth:"1200px",children:f[w]})})]})}):e.jsxs(m,{children:[e.jsx(De,{tabs:s,current:w,onChange:t}),e.jsx(m,{marginTop:"10px",children:f[w]})]})}ze.propTypes={orientation:N.oneOf(["horizontal","vertical"])};ze.defaultProps={orientation:"horizontal"};const zt=Re.div`
|
|
41
|
+
`;var ye={},kt=tt;Object.defineProperty(ye,"__esModule",{value:!0});var Se=ye.default=void 0,Tt=kt(He()),Lt=e;Se=ye.default=(0,Tt.default)((0,Lt.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"}),"Stars");const It={width:24,height:24,body:'<path fill="currentColor" d="M6 12.05q0 1.125.425 2.188T7.75 16.2l.25.25V15q0-.425.288-.713T9 14q.425 0 .713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.713-.288T4 19q0-.425.288-.713T5 18h1.75l-.4-.35q-1.3-1.15-1.825-2.625T4 12.05Q4 9.7 5.2 7.787T8.425 4.85q.35-.2.738-.025t.512.575q.125.375-.013.75t-.487.575q-1.45.8-2.313 2.213T6 12.05Zm12-.1q0-1.125-.425-2.187T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10q-.425 0-.713-.288T14 9V5q0-.425.288-.713T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6h-1.75l.4.35q1.225 1.225 1.788 2.663T20 11.95q0 2.35-1.2 4.263t-3.225 2.937q-.35.2-.737.025t-.513-.575q-.125-.375.013-.75t.487-.575q1.45-.8 2.313-2.212T18 11.95Z"/>'},{DEFAULT_IP_DOMAIN_SUFFIX:Ct,SLOT_FOR_IP_DNS_SITE:Dt,DEFAULT_DID_DOMAIN:qt}=he,{encode:Oe}=mt,Ft=S=>`${Oe(S.meta.did)}-${Dt}.${Ct}`,Pt=({did:S,didDomain:r=qt})=>`${Oe(S)}.${r}`;var Rt={getIpDnsDomainForBlocklet:Ft,getDidDomainForBlocklet:Pt};const At=R.forwardRef((S,r)=>{var b,y;const{t:n}=R.useContext(X),{blocklet:s}=V(),{api:w}=H(),t=se({loadingReject:!1,loadingApprove:!1,mode:"view",show:!1,data:{},callback:Z}),f=be(),c=((y=(b=f==null?void 0:f.transitions)==null?void 0:b.duration)==null?void 0:y.leavingScreen)||300,h=p(()=>{t.mode="view",t.data={},t.callback=Z}),l=p(()=>{t.show=!1,setTimeout(()=>{h()},c)}),d=p(i=>{t.mode="view",t.show=!0,t.data=i}),k=p((i,a=Z)=>{t.mode="approve",t.show=!0,t.data=i,t.callback=a});R.useImperativeHandle(r,()=>({open:d,close:l,approve:k}),[d,l,k]);const L=te(()=>{if(!t.show)return[];t.data.migratedFrom=[t.data.appId,t.data.appPid];const i=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return t.data.isMaster!==!1&&at(i,"appliedAt","status"),i.map(a=>{const T=n(`federated.info.${a}`);let o=t.data[a];if(a==="appName"&&t.data.isMaster&&(o=e.jsxs(m,{children:[e.jsx(Ae,{component:Se}),o]})),["appId","appPid","serverId"].includes(a)&&(o=e.jsx(xe,{children:o})),["appUrl"].includes(a)&&(o=e.jsx(m,{component:"a",href:o,target:"_blank",children:o})),["appLogo"].includes(a)){const j=rt(`https://${Rt.getDidDomainForBlocklet({did:t.data.appPid})}`,"/.well-known/service/blocklet/logo");try{const u=new URL(j);u.searchParams.set("imageFilter","resize"),u.searchParams.set("w","80"),u.searchParams.set("h","80"),o=e.jsx("img",{src:u.href,width:"60",height:"60",alt:t.data.appName})}catch{o=e.jsx("img",{src:j,width:"60",height:"60",alt:t.data.appName})}}return a==="status"&&(o=o&&n(`federated.status.${o}`)),a==="migratedFrom"&&(o=(t.data.migratedFrom||[]).filter(P=>![t.data.appId,t.data.appPid].includes(P)).map(P=>e.jsx(xe,{children:P}))),it(o)&&(o="-"),{name:T,value:o}})},[t.data]),x=t.mode==="approve",g=p(async()=>{try{t.loadingReject=!0,await w.auditFederatedLogin({input:{memberPid:t.data.appPid,did:s.appPid,status:"rejected"}}),l(),t==null||t.callback(!1)}finally{t.loadingReject=!1}}),v=p(async()=>{try{t.loadingApprove=!0,await w.auditFederatedLogin({input:{memberPid:t.data.appPid,did:s.appPid,status:"approved"}}),l(),t==null||t.callback(!0)}finally{t.loadingApprove=!1}});return e.jsx(je,{open:t.show,title:n(x?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:l,actions:x?e.jsxs(e.Fragment,{children:[e.jsxs($,{color:"error",variant:"contained",onClick:g,disabled:t.loadingReject,children:[t.loadingReject?e.jsx(ge,{size:16,color:"grey"}):null,n("common.reject")]}),e.jsxs($,{variant:"contained",onClick:v,disabled:t.loadingApprove,children:[t.loadingApprove?e.jsx(ge,{size:16,color:"grey"}):null,n("common.approve")]})]}):e.jsx($,{variant:"outlined",onClick:l,children:n("common.close")}),children:L.map(i=>e.jsx(ut,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:i.name,children:i.value},i.name))})}),Be=R.forwardRef((S,r)=>{var d,k;const n=be(),s=((k=(d=n==null?void 0:n.transitions)==null?void 0:d.duration)==null?void 0:k.leavingScreen)||300,{t:w}=R.useContext(X),t=se({show:!1,data:{link:""}}),f=p(()=>{t.data.link=""}),c=p(()=>{t.show=!1,setTimeout(()=>{f()},s)}),h=p(({link:L})=>{t.show=!0,t.data.link=L});R.useImperativeHandle(r,()=>({open:h,close:c}),[h,c]);const l=p(()=>{Qe(t.data.link),c()});return e.jsxs(je,{open:t.show,title:w("federated.joinFederatedLogin"),onClose:c,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:l,children:w("common.copyAndClose")}),children:[e.jsx(m,{mb:1,children:w("federated.inviteJoinFederatedLoginDescription")}),e.jsx(m,{sx:{"& .copy-button":{display:"none !important"}},children:e.jsx(Je,{language:"shell",style:{marginBottom:0},children:t.data.link})})]})});function we({mode:S}){var Q,ke,Te,Le,Ie;const r=R.useRef(null),n=R.useRef(null),{t:s,locale:w}=R.useContext(X),{blocklet:t,actions:{refreshBlocklet:f}}=V(),{confirmApi:c,confirmHolder:h}=Ke(),{api:l}=H(),d=((Q=t.settings.federated)==null?void 0:Q.sites)||[],k=((ke=t.settings.federated)==null?void 0:ke.config)||{},L=k.isMaster!==!1,x=d.find(D=>D.appPid===t.appPid),g=se({loadingSync:!1}),v=p(D=>{var q;(q=n.current)==null||q.open(D)}),b=p(D=>{var q;(q=n.current)==null||q.approve(D,f)}),y=p(D=>{c.open({title:s("federated.removeFederatedLogin"),content:s("federated.removeFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(q){await l.quitFederatedLogin({input:{did:t.appPid,targetDid:D.appPid}}),q()}})}),i=p(D=>{c.open({title:s("federated.disableFederatedLogin"),content:s("federated.disableFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(q){await l.auditFederatedLogin({input:{memberPid:D.appPid,did:t.appPid,status:"revoked"}}),q()}})}),a=p(D=>{c.open({title:s("federated.enableFederatedLogin"),content:s("federated.enableFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),async onConfirm(q){await l.auditFederatedLogin({input:{memberPid:D.appPid,did:t.appPid,status:"approved"}}),q()}})}),T=te(()=>{const D=[{label:s("common.name"),name:"appName",options:{customBodyRenderLite:q=>{const F=d[q],ee=F.isMaster!==!1;return e.jsx(m,{display:"inline-block",children:e.jsxs(m,{component:"a",display:"flex",alignItems:"center",href:F.appUrl,target:"_blank",onClick:B=>{B.stopPropagation()},children:[ee&&e.jsx(Ae,{component:Se,style:{marginRight:"4px"}}),F.appName]})})}}},{label:s("common.did"),name:"appId",options:{customBodyRenderLite:q=>{const F=d[q];return e.jsx(xe,{children:F.appId})}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:q=>{const F=d[q],ee=F.isMaster!==!1;return e.jsx(m,{children:ee?"-":s(`federated.status.${F.status}`)})}}}];return L&&D.push({label:s("common.actions"),name:"actions",options:{customBodyRenderLite:q=>{const F=d[q],ee=F.isMaster!==!1;return e.jsx(m,{display:"flex",gap:1,children:ee?e.jsxs(e.Fragment,{children:[F.status==="rejected"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation()},children:s("federated.status.rejected")}),F.status==="revoked"&&e.jsx(z,{variant:"contained",color:"secondary",size:"small",onClick:B=>{B.stopPropagation()},children:s("federated.status.revoked")})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation(),y(F)},children:s("federated.quitMember")},"quiteSite"),F.status==="pending"&&e.jsx(z,{variant:"contained",color:"primary",size:"small",onClick:B=>{B.stopPropagation(),b(F)},children:s("federated.status.pending")},"auditSite"),F.status==="approved"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation(),i(F)},style:{whiteSpace:"nowrap"},children:s("federated.revoke")},"revokeSite"),F.status==="revoked"&&e.jsx(z,{variant:"contained",color:"warning",size:"small",onClick:B=>{B.stopPropagation(),a(F)},style:{whiteSpace:"nowrap"},children:s("federated.approve")},"approveSite")]})})}}}),D},[k.appId,d,L,s]),o=te(()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(D,{dataIndex:q}){const F=d[q];v(F)}}),[]),j=p(()=>{var q;const D=t.environments.find(F=>F.key===dt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);D!=null&&D.value?(q=r.current)==null||q.open({link:D.value}):U.error(s("federated.failedToGetFederatedLoginLink"))},[(Ie=(Le=(Te=t.site)==null?void 0:Te.domainAliases)==null?void 0:Le[0])==null?void 0:Ie.href]),u=p(()=>{c.open({title:s("federated.quitFederatedLogin"),content:s("federated.quitFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(D){await l.quitFederatedLogin({input:{did:t.appPid}}),D()}})}),P=p(()=>{c.open({title:s("federated.disbandFederatedLogin"),content:s("federated.disbandFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(D){await l.disbandFederatedLogin({input:{did:t.appPid}}),D()}})}),A=p(async()=>{try{g.loadingSync=!0,await Promise.all([await l.syncFederatedConfig({input:{did:t.appPid}}),Ge(500)]),U.success(s("common.succeeded"))}finally{g.loadingSync=!1}}),_=[];return x.status!=="pending"&&_.push(e.jsx(nt,{title:s("federated.syncConfig"),children:e.jsx(ae,{size:"small",onClick:A,disabled:g.loadingSync,sx:[{"@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},g.loadingSync?{animation:"spin 1s linear infinite"}:{}],children:e.jsx(K,{icon:It,style:{fontSize:24}})},"syncConfig")})),S==="master"?(_.push(e.jsx(z,{size:"small",variant:"contained",onClick:j,sx:{ml:1},children:s("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),_.push(e.jsx(z,{color:"error",size:"small",variant:"contained",onClick:P,sx:{ml:1},children:s("federated.disbandFederatedLogin")},"disbandFederatedLogin"))):_.push(e.jsx(z,{size:"small",variant:"contained",color:"error",onClick:u,sx:{ml:1},children:s("federated.quitFederatedLogin")},"quitFederatedLogin")),e.jsxs(e.Fragment,{children:[e.jsx(Ze,{className:"main-table",locale:w,data:d,columns:T,customButtons:_,title:e.jsx(m,{className:"table-toolbar-left",children:s("oauth.federated")}),options:o}),h,e.jsx(Be,{ref:r}),e.jsx(At,{ref:n})]})}we.propTypes={mode:N.oneOf(["member","master"])};we.defaultProps={mode:"member"};const Ot=R.forwardRef((S,r)=>{var g,v;const{t:n}=R.useContext(X),{api:s}=H(),{blocklet:w}=V(),t=w==null?void 0:w.appPid,f=be(),c=((v=(g=f==null?void 0:f.transitions)==null?void 0:g.duration)==null?void 0:v.leavingScreen)||300,h=se({loading:!1,show:!1,appUrl:"",appUrlError:"",callback:Z}),l=p(()=>{h.appUrl="",h.appUrlError="",h.callback=Z}),d=p(()=>{h.show=!1,setTimeout(()=>{l()},c)}),k=p((b=Z)=>{h.show=!0,h.callback=b});R.useImperativeHandle(r,()=>({open:k,close:d}),[k,d]);const L=p(b=>{if(!b)throw new Error(n("federated.federatedJoinAppUrlRequired"));if(!Ye(b))throw new Error(n("federated.federatedJoinAppUrlInvalid"))}),x=p(async()=>{try{L(h.appUrl),h.loading=!0;const b=await s.joinFederatedLogin({input:{did:t,appUrl:h.appUrl}});h.show=!1,d(),h==null||h.callback(b)}catch(b){h.appUrlError=b.message}finally{h.loading=!1}});return e.jsxs(je,{open:h.show,title:n("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:e.jsxs(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,disabled:h.loading,children:[h.loading?e.jsx(ge,{size:16,sx:{mr:1},color:"grey"}):null,n("common.confirm")]}),children:[e.jsx(m,{mb:1,children:n("federated.joinFederatedLoginDescription")}),e.jsx(O,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:n("federated.federatedJoinAppUrl"),label:n("federated.federatedJoinAppUrl"),value:h.appUrl,error:!!h.appUrlError,helperText:h.appUrlError||"eg: https://www.arcblock.io",onChange:b=>{h.appUrl=b.target.value}})]})});function Bt(){var c,h,l,d,k;const S=R.useRef(null),r=R.useRef(null),{t:n}=R.useContext(X),{blocklet:s,actions:{refreshBlocklet:w}}=V(),t=p(()=>{var x,g,v,b;const L=(v=(g=(x=s.site)==null?void 0:x.domainAliases)==null?void 0:g[0])==null?void 0:v.href;if(L)try{const y=new URL(L);(b=S.current)==null||b.open({link:y.origin})}catch{U.error(n("federated.failedToGetFederatedLoginLink"))}},[(l=(h=(c=s.site)==null?void 0:c.domainAliases)==null?void 0:h[0])==null?void 0:l.href]),f=p(()=>{var L;(L=r.current)==null||L.open(()=>{w()})});if(((d=s.settings.federated)==null?void 0:d.sites.length)>0){const L=((k=s.settings.federated)==null?void 0:k.config.isMaster)!==!1;return e.jsx(we,{mode:L?"master":"member"})}return e.jsxs(e.Fragment,{children:[e.jsxs(m,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[e.jsx(z,{variant:"contained",onClick:t,children:n("federated.inviteJoinFederatedLogin")}),e.jsx(re,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),e.jsx(z,{variant:"outlined",onClick:f,children:n("federated.joinFederatedLogin")})]}),e.jsx(Be,{ref:S}),e.jsx(Ot,{ref:r})]})}function ze({orientation:S="horizontal"}){const{t:r}=R.useContext(X),n=pt({key:"lg"}),s=[{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.commonSettings")}),value:"settings"},{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.federated")}),value:"federated"},{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.oauth")}),value:"oauth"},{label:e.jsx(m,{textAlign:"center",width:"100%",children:r("oauth.moreLogin")}),value:"more"}],[w,t]=R.useState(s[0].value),f=te(()=>({oauth:e.jsx(yt,{}),federated:e.jsx(Bt,{}),more:e.jsx(Xe,{children:r("oauth.comingSoon")}),settings:e.jsx(St,{})}),[r]);return S==="vertical"?e.jsx(zt,{children:e.jsxs(J,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(m,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(De,{tabs:s,current:w,orientation:n?"horizontal":"vertical",onChange:t,sx:{borderRight:n?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(m,{sx:{flexGrow:1,minWidth:0},children:e.jsx(m,{maxWidth:"1200px",children:f[w]})})]})}):e.jsxs(m,{children:[e.jsx(De,{tabs:s,current:w,onChange:t}),e.jsx(m,{marginTop:"10px",children:f[w]})]})}ze.propTypes={orientation:N.oneOf(["horizontal","vertical"])};ze.defaultProps={orientation:"horizontal"};const zt=Re.div`
|
|
42
42
|
.MuiTab-root {
|
|
43
43
|
text-align: left;
|
|
44
44
|
align-items: flex-start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,ag as r}from"./vendor-mui-core-
|
|
1
|
+
import{j as t,ag as r}from"./vendor-mui-core-CQ38ohp2.js";import{r as s}from"./vendor-react-DEoibe3W.js";import{b2 as a}from"./vendor-ux-did-connect-BdkhddhO.js";import{R as e}from"./vendor-arcblock-ScFEr-lj.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";function x(){const{t:o}=s.useContext(a);return t.jsx(n,{style:{paddingTop:"25vh"},children:t.jsx(e,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const n=r.main``;export{x as default};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import{r as C}from"./vendor-react-DEoibe3W.js";import{u as I,V as M,j as oe,B as N,b2 as xe,al as ce,bM as ae,b4 as fe,az as ge,bt as ye,c0 as he,a5 as je}from"./vendor-ux-did-connect-BdkhddhO.js";import{r as le}from"./passport-item-CWtlyIE_.js";import{l as B,z as $,aF as be,C as Ce,f as ke}from"./index-DO3_1y-L.js";import{u as _}from"./dashboard-8QXGSoVu.js";import{j as e,H as j,bo as O,br as V,bn as G,q as H,a9 as f,ak as Q,O as F,aa as Y,bs as ve,bS as Ke,ag as P,T as z,ac as re,aj as Te}from"./vendor-mui-core-CQ38ohp2.js";import{K as Ae,Y as Se}from"./vendor-arcblock-ScFEr-lj.js";import{T as de}from"./index-Dl4W1N74.js";import{C as me}from"./confirm-DqvNmeoz.js";import{_ as we}from"./vendor-utils-BNHJB5U7.js";import{C as E}from"./click-to-copy-BGyXQL2i.js";import{D as De}from"./delete-confirm-_BzUlhv2.js";import{d as Ie}from"./Edit-CY6fFHQM.js";import{P as Re}from"./permission-BGM09622.js";import{m as Be,G as $e}from"./vendor-hooks-DftG_2gV.js";import{U as _e,C as ze,I as Ne}from"./index-B_vrglsK.js";import{B as Pe}from"./bundle-avatar-D0t7RLGx.js";import{p as Le}from"./util-Dw9Eiuko.js";import{W as ie}from"./did-address-DUThaBlf.js";import{f as Ue}from"./format-error-BrmqJs5a.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./AdapterDayjs-BUGplkxR.js";import"./Phone-KP65huHK.js";import"./Location-B8EOY3d0.js";import"./Email-Dz2Eyqu0.js";import"./Timezone-Ce4E1Xey.js";import"./base32-p9VcJrwv.js";function J({value:t}){const{t:s,locale:u}=I(),l=new Date;return new Date(t)<l?e.jsxs("span",{style:{color:"red"},children:[e.jsx(M,{value:t,locale:u}),`${s("setting.accessKey.expired",{time:""})}`]}):B(t,u)}J.propTypes={value:j.string.isRequired};function X({value:t,onChange:s,...u}){const{t:l}=I(),d=C.useMemo(()=>[{value:"signature",title:l("setting.accessKey.signature"),description:l("setting.accessKey.signatureDesc")},{value:"simple",title:l("setting.accessKey.simple"),description:l("setting.accessKey.simpleDesc")}],[l]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...u,children:[e.jsx(V,{children:l("setting.accessKey.authType")}),e.jsx(G,{value:t,onChange:s,fullWidth:!0,label:l("setting.accessKey.authType"),children:d.map(n=>e.jsx(H,{value:n.value,children:e.jsxs(f,{children:[e.jsx("span",{children:n.title}),e.jsx(f,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:n.description})]})},n.value))})]})}X.propTypes={value:j.string.isRequired,onChange:j.func.isRequired};const U=()=>{const t=oe.RBAC_CONFIG.roles.filter(d=>d.passport),{inService:s}=$(),{roles:u}=_(),l=[...t,...s?u:[]];return we(l,"name").filter(d=>d.name!==oe.ROLES.OWNER)};function Z(t){const{remark:s,onCreate:u}=t,{api:l}=$(),{teamDid:d}=_(),{t:n}=I(),[v,g]=C.useState(!1),[i,c]=C.useState(null),T=U(),k=()=>{g(!1),c(null)},b=async a=>{const{remark:y,passport:m,authType:o}=a;g(!0);const p=await l.createAccessKey({input:{teamDid:d,remark:y.trim(),passport:m,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:o}}),{data:w}=p;u(w),c(null),g(!1)},x={title:`${n("common.create")} ${n("accessKey")}`,description:(a,y,m)=>e.jsxs(Q,{gap:3,children:[e.jsx(F,{label:n("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:o=>{y({...a,remark:o.target.value,__disableConfirm:!a.passport||!o.target.value.trim()}),o.target.value.trim()?m(""):m(n("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(V,{children:n("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:o=>{const p=o.target.value;m(null),y({...a,passport:p,__disableConfirm:!a.remark||!p})},fullWidth:!0,label:n("setting.accessKey.passport"),disabled:v,children:T.map(o=>e.jsx(H,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(X,{value:a.authType,onChange:o=>{y({...a,authType:o.target.value})}}),e.jsx(de,{placeholder:n("setting.accessKey.expireTime"),value:a.expireAt,onChange:o=>{y({...a,expireAt:o,__disableConfirm:!a.passport||!a.remark||!o})}})]}),confirm:n("common.confirm"),cancel:n("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:b,onCancel:k};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>c(x),className:"rule-action",children:[v?e.jsx(Y,{size:16}):e.jsx(Ae,{style:{fontSize:16}}),n("common.create")]}),i&&e.jsx(me,{title:i.title,description:i.description,confirm:i.confirm,color:i.color,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}Z.propTypes={remark:j.string,onCreate:j.func};Z.defaultProps={onCreate:()=>{},remark:""};function ee(t){const{onConfirm:s,accessKeyId:u,accessKeySecret:l,hideSecret:d}=t,{t:n}=C.useContext(xe),[v,g]=C.useState(!1),[i,c]=C.useState(()=>d),T=()=>{c(!i)},k=a=>{g(a.target.checked)},b=C.useMemo(()=>{var a;return d?`const Client = require('@abtnode/client');
|
|
2
|
+
|
|
3
|
+
const client = new Client(fullEndpoint);
|
|
4
|
+
client.setAuthAccessKey({
|
|
5
|
+
accessKeyId: "${u}",
|
|
6
|
+
accessKeySecret: "${l}",
|
|
7
|
+
});
|
|
8
|
+
`:`curl -H "Authorization: Bearer ${l}" "${(a=window.blocklet)==null?void 0:a.appUrl}/.well-known/service/api/did/session"`},[d,u,l]),x=C.useMemo(()=>{var a;return d?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${u} --access-secret ${l} {blockletPath}/.blocklet/bundle;`:null},[d,u,l]);return e.jsxs(ce,{title:n("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(N,{disabled:d?!v:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:n("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(We,{children:n(d?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(q,{children:[e.jsx(W,{children:n("setting.accessKey.accessKeyId")}),e.jsx(E,{children:u})]}),e.jsxs(q,{children:[e.jsx(W,{children:n("setting.accessKey.accessKeySecret")}),i?e.jsx(N,{"data-cy":"show-secret-btn",color:"primary",onClick:T,children:n("setting.accessKey.showSecret")}):e.jsx(E,{children:l})]}),!i&&e.jsxs(q,{children:[e.jsx(W,{children:`Access Key ${n("setting.accessKey.usage")}`}),e.jsx(ae,{code:b,language:"javascript"}),x&&e.jsx(ae,{code:x,language:"bash"})]}),d&&e.jsx("div",{children:e.jsx(ve,{value:"end",disabled:i,control:e.jsx(Ke,{checked:v,onChange:k}),label:n("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}ee.propTypes={accessKeyId:j.string.isRequired,accessKeySecret:j.string.isRequired,onConfirm:j.func,hideSecret:j.bool};ee.defaultProps={onConfirm:()=>{},hideSecret:!0};const W=P.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
margin-bottom: 8px;
|
|
14
|
+
`,q=P.div`
|
|
15
|
+
margin-bottom: 24px;
|
|
16
|
+
`,We=P.div`
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
`;function te(t){const{t:s,locale:u}=I(),{api:l}=$(),{teamDid:d}=_(),[n,v]=C.useState(!1),[g,i]=C.useState(null),{accessKeyId:c,time:T,remark:k,onDelete:b=()=>{}}=t,x=()=>{v(!1),i(null)},a=async()=>{v(!0);try{await l.deleteAccessKey({input:{teamDid:d,accessKeyId:c}}),b()}catch(o){console.error(o)}finally{v(!1),i(null)}},y=o=>({key:`<b>${c}</b>`,name:`<b>${k}</b>`,time:B(o,u),timeAge:Se(new Date(o),be(u))}),m={keyName:k,title:s("setting.accessKey.title"),description:T?`${s("setting.accessKey.description",y(T))}`:`${s("setting.accessKey.descriptionNoTime",{key:`<b>${c}</b>`,name:`<b>${k}</b>`})}`,confirmPlaceholder:s("setting.accessKey.confirm_desc",{name:k}),confirm:s("common.delConfirm"),cancel:s("common.cancel"),onConfirm:a,onCancel:x};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",onClick:o=>{o.stopPropagation(),i(m)},size:"small",className:"rule-action",color:"error",children:[n?e.jsx(Y,{size:16}):e.jsx(fe,{style:{fontSize:16}}),s("common.delete")]}),g&&e.jsx(De,{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})]})}te.propTypes={accessKeyId:j.string.isRequired,time:j.string.isRequired,remark:j.string.isRequired,onDelete:j.func};te.defaultProps={onDelete:()=>{}};function se(t){const{accessKeyId:s,remark:u,onUpdate:l,passport:d,expireAt:n,authType:v}=t,{api:g}=$(),{teamDid:i}=_(),{t:c}=I(),[T,k]=C.useState(!1),[b,x]=C.useState(null),a=U(),y=()=>{k(!1),x(null)},m=async p=>{const{accessKeyId:w,remark:R="",passport:h,expireAt:D,authType:L}=p;k(!0),await g.updateAccessKey({input:{teamDid:i,accessKeyId:w,remark:R.trim(),passport:h,expireAt:D?new Date(D).getTime():null,authType:L}}),l(),x(null),k(!1)},o={title:`${c("common.update")} ${c("accessKey")}`,description:(p,w,R)=>e.jsxs(Q,{gap:3,children:[e.jsx(F,{label:c("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:p.accessKeyId,disabled:!0}),e.jsx(F,{label:c("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:p.remark,onChange:h=>{w({...p,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(c("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(V,{children:c("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"update-access-key-select-passport",value:p.passport,onChange:h=>{const D=h.target.value;R(null),w({...p,passport:D,__disableConfirm:!p.remark||!D})},fullWidth:!0,label:c("setting.accessKey.passport"),disabled:T,children:a.map(h=>e.jsx(H,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:h.description})]})},h.name))})]}),e.jsx(X,{disabled:!0,value:p.authType,onChange:h=>{w({...p,authType:h.target.value})}}),e.jsx(de,{placeholder:c("setting.accessKey.expireTime"),value:p.expireAt,onChange:h=>{w({...p,expireAt:h,__disableConfirm:!p.passport||!p.remark||!h})}})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),color:"primary",params:{accessKeyId:s,remark:u,passport:d,expireAt:n,authType:v},onConfirm:m,onCancel:y};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",onClick:p=>{p.stopPropagation(),x(o)},size:"small",className:"rule-action",color:"primary",children:[T?e.jsx(Y,{size:16}):e.jsx(Ie,{style:{fontSize:16}}),c("common.update")]}),b&&e.jsx(me,{title:b.title,description:b.description,confirm:b.confirm,color:b.color,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]})}se.propTypes={accessKeyId:j.string.isRequired,remark:j.string,passport:j.string,expireAt:j.string,authType:j.string,onUpdate:j.func};se.defaultProps={onUpdate:()=>{},remark:"",passport:"",expireAt:"",authType:"signature"};function ne({accessKey:t,onCancel:s}){const{t:u}=I();return e.jsx(ce,{title:u("accessKey"),onClose:s,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(qe,{children:e.jsx(pe,{accessKey:t})})})}ne.propTypes={accessKey:j.object.isRequired,onCancel:j.func.isRequired};ne.defaultProps={};const qe=P(f)`
|
|
20
|
+
margin-top: -16px;
|
|
21
|
+
|
|
22
|
+
.tabs {
|
|
23
|
+
margin-left: 0;
|
|
24
|
+
margin-right: 0;
|
|
25
|
+
}
|
|
26
|
+
`;function pe({accessKey:t}){var a,y;const{t:s,locale:u}=I(),{api:l}=$(),{teamDid:d}=_(),{blocklet:n}=Ce(),v=U(),g=C.useCallback(async m=>m?(await l.getUser({input:{teamDid:d,user:{did:m}}})).user:null,[l,d]),i=Be(()=>g(t.createdBy),{}),c=((n==null?void 0:n.children)||[]).find(m=>{var o;return((o=m==null?void 0:m.meta)==null?void 0:o.did)===t.componentDid}),T=C.useMemo(()=>{var m;return Le((m=i==null?void 0:i.data)==null?void 0:m.avatar,d,!0)},[(a=i==null?void 0:i.data)==null?void 0:a.avatar,d]),k=v.find(m=>m.name===t.passport),b=k?k.title:t.passport,x=[{title:s("common.baseInfo"),items:[{label:s("setting.accessKey.accessKeyId"),content:e.jsx(ie,{did:t.accessKeyId,showQrcode:!0})},...t.authType==="simple"?[{label:s("setting.accessKey.accessKeySecret"),content:e.jsx(E,{children:`blocklet-${ge.toBase58(t.accessKeyPublic)}`})}]:[],{label:s("common.role"),content:e.jsx(f,{children:le(b,t.passport)})},{label:s("common.createdVia"),content:t.createdVia},{label:s("common.createdBy"),content:i!=null&&i.data?e.jsx(f,{sx:{display:"flex",alignItems:"center",".MuiAvatar-root":{width:32,height:32}},children:e.jsx(_e,{user:{...i.data,avatar:T},showDid:!0,cardType:ze.Detailed,infoType:Ne.Minimal,sx:{border:0,padding:0}})}):t.createdBy?e.jsx(ie,{did:t.createdBy,showQrcode:!0}):"-"}]},{title:s("common.timeInfo"),items:[{label:s("common.createdAt"),content:t.createdAt?B(t.createdAt,u):"-"},{label:s("common.lastUsedAt"),content:t.lastUsedAt?B(t.lastUsedAt,u):"-"},{label:s("common.expiredAt"),content:t.expireAt?e.jsx(J,{value:t.expireAt}):s("common.neverExpired")}]},{title:s("common.otherInfo"),items:[{label:s("setting.accessKey.authType"),content:t.authType},{label:s("common.remark"),content:t.remark},...t.authType!=="signature"?[{label:s("setting.accessKey.resourceType"),content:t.resourceType||"-"},{label:s("setting.accessKey.resourceId"),content:t.resourceId||"-"}]:[],...c?[{label:s("setting.accessKey.component"),content:e.jsxs(f,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Pe,{blocklet:c,ancestors:[n]}),e.jsx(f,{ml:"16px",sx:{minWidth:0},children:e.jsxs(f,{className:"component-header",children:[e.jsx(f,{className:"component-name",children:ke.getDisplayName(c,!0)}),e.jsx(f,{className:"component-version",children:(y=c==null?void 0:c.meta)==null?void 0:y.version})]})})]},c)}]:[]]}];return e.jsx(Me,{gap:3,children:e.jsx(f,{className:"info-area",children:x.map(m=>e.jsxs(f,{mb:3,children:[e.jsx(z,{variant:"h6",sx:{mb:1.5},children:m.title}),e.jsx(f,{className:"info-grid",children:m.items.map(o=>e.jsxs(f,{className:"info-item",children:[e.jsx(f,{className:"info-label",children:e.jsx(z,{variant:"subtitle2",color:"textSecondary",children:o.label})}),e.jsx(f,{children:o.content})]},o.label))})]},m.title))})})}pe.propTypes={accessKey:j.object.isRequired};const Me=P(Q)`
|
|
27
|
+
.info-card {
|
|
28
|
+
margin-bottom: 24px;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.card-content {
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: 32px;
|
|
35
|
+
padding: 24px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.passport-image {
|
|
39
|
+
width: 150px;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
transition: transform 0.2s ease-in-out;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
transform: scale(1.05);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.info-area {
|
|
50
|
+
flex: 1;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.info-header {
|
|
56
|
+
padding-bottom: 16px;
|
|
57
|
+
border-bottom: 1px solid #eee;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.info-grid {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: 12px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.info-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
gap: 8px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.info-label {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 8px;
|
|
75
|
+
width: 140px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.logs-card {
|
|
79
|
+
.card-header {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: 8px;
|
|
83
|
+
padding: 16px 24px;
|
|
84
|
+
border-bottom: 1px solid #eee;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.MuiTimeline-root {
|
|
88
|
+
padding: 24px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.MuiTimelineContent-root {
|
|
92
|
+
padding: 0px 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.MuiTimelineDot-root {
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`;function St(){var D,L;const{t,locale:s}=I(),{api:u,inService:l}=$(),{teamDid:d}=_(),[n,v]=C.useState({}),[g,i]=C.useState(null),c=U(),T=C.useRef(null),k=`access-keys-${d}`,b=ye(k),[x,a]=C.useState({searchText:b.searchText||"",pageSize:b.rowsPerPage||10,page:1}),y=$e(async()=>await u.getAccessKeys({input:{teamDid:d,paging:{page:x.page,pageSize:x.pageSize}}}),[x.page,x.pageSize]),{loading:m,error:o}=y,p=C.useMemo(()=>{var r;return((r=y.value)==null?void 0:r.list)||[]},[(D=y.value)==null?void 0:D.list]),w=C.useMemo(()=>[{label:t("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:A})=>{const K=p[A];return e.jsx(f,{display:"flex",alignItems:"center",gap:2,children:e.jsx(z,{children:K.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(he,{showDidLogo:!1,children:r})}},{label:t("common.role"),name:"passport",options:{customBodyRender:r=>{const A=c.find(S=>S.name===r),K=A?A.title:r;return e.jsx(f,{children:le(K,r)})}}},{label:t("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(z,{children:r})}},{label:t("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(z,{children:t(`setting.accessKey.${r}`)})}},{label:t("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(re,{title:B(r,s),children:r?e.jsx(M,{value:r,locale:s}):"-"})}},{label:t("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(re,{title:B(r,s),children:r?e.jsx(M,{value:r,locale:s}):"-"})}},{label:t("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>r?e.jsx(J,{value:r}):t("common.neverExpired")}},{label:t("common.actions"),name:"actions",width:100,options:{customBodyRender:(r,{rowIndex:A})=>{const K=p[A];return e.jsxs(f,{display:"flex",gap:1,children:[e.jsx(se,{...K,onUpdate:y.retry}),e.jsx(te,{accessKeyId:K.accessKeyId,time:K.lastUsedAt,remark:K.remark||"N/A",onDelete:y.retry})]})}}}],[p,s,t,y.retry,c]),R=({page:r,rowsPerPage:A,searchText:K})=>{x.pageSize!==A?a(S=>({...S,searchText:"",pageSize:A,page:1})):x.page!==r+1?a(S=>({...S,searchText:"",page:r+1})):x.searchText!==K&&a(S=>({...S,searchText:K,page:1}))},h=x.searchText?p.filter(r=>r.accessKeyId.toLowerCase().includes(x.searchText.toLowerCase())||(r.remark||"").toLowerCase().includes(x.searchText.toLowerCase())):p;return o?e.jsx(Te,{severity:"error",children:Ue(o)}):e.jsxs(f,{ref:T,sx:{".custom-toobar-btns":{gap:"8px"}},children:[e.jsx(je,{durable:k,durableKeys:["page","rowsPerPage"],data:h,columns:w,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:x.page-1,rowsPerPage:x.pageSize,count:((L=y.value)==null?void 0:L.count)||0,searchDebounceTime:600,onRowClick(r,{dataIndex:A},K){var S;if((S=T.current)!=null&&S.contains(K.target)){const ue=h[A];i(ue)}}},loading:m,onChange:R,customButtons:[e.jsx(Re,{permission:l?"":"mutate_accessKey",children:e.jsx(Z,{onCreate:r=>{const{accessKeyId:A,accessKeySecret:K,authType:S}=r;v({show:!0,accessKeyId:A,accessKeySecret:K,authType:S})}})})]}),n.show&&e.jsx(ee,{hideSecret:n.authType==="signature",onConfirm:()=>{y.retry(),v({show:!1})},...n}),g&&e.jsx(ne,{onCancel:()=>i(null),accessKey:g})]})}export{St as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,aa as h,a9 as c,H as d,ag as g}from"./vendor-mui-core-
|
|
1
|
+
import{j as t,aa as h,a9 as c,H as d,ag as g}from"./vendor-mui-core-CQ38ohp2.js";import{r as y}from"./vendor-react-DEoibe3W.js";import{b2 as v,C as w,B as m}from"./vendor-ux-did-connect-BdkhddhO.js";import{P}from"./page-header-CWY8mxlT.js";import{C as T}from"./index-DO3_1y-L.js";import{u as B}from"./config-space-CYg-72ab.js";import{C as E,D as b,a as D}from"./connect-to-Ck5O2M1K.js";import{S as u}from"./step-actions-D_1PFeFs.js";import{S as N}from"./layout-Cw-hwCHs.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./spaces-WkJCApHO.js";import"./api-BrU7j0QA.js";import"./DeleteOutline-C2sY6hfm.js";import"./format-error-BrmqJs5a.js";import"./use-mobile-C_flBrm-.js";import"./content-layout-BPaAeaMQ.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=T(),{spaceGateway:f,settingStorageEndpoint:C,updateSpaceGateway:j,hasStorageEndpoint:S,loading:o,storageEndpoint:s}=B();return o?t.jsx(w,{relative:"parent",children:t.jsx(h,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:f,settingStorageEndpoint:C}):t.jsx(b,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(D,{onConnect:j,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=g(N)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as i,ag as f,j as s,bI as D,a9 as N,aa as A}from"./vendor-mui-core-
|
|
1
|
+
import{H as i,ag as f,j as s,bI as D,a9 as N,aa as A}from"./vendor-mui-core-CQ38ohp2.js";import{a as E,l as $,u as b,m as M}from"./vendor-hooks-DftG_2gV.js";import{a as q,R as F}from"./vendor-arcblock-ScFEr-lj.js";import{r as m}from"./vendor-react-DEoibe3W.js";import{b2 as H,al as U,u as j,aR as B,j as O,b3 as S,X as Y}from"./vendor-ux-did-connect-BdkhddhO.js";import{t as W,v as X,w as L,x as z}from"./index-DO3_1y-L.js";import{y as V}from"./vendor-utils-BNHJB5U7.js";import{u as J}from"./use-passport-id-B-b-_oYF.js";import{u as K}from"./session-VIMbdc9j.js";import{b as G}from"./sdk-CTe6rL6c.js";import{d as Q}from"./CheckCircle-BNrN9mgy.js";import{w as Z}from"./wrap-locale-DMTYAE64.js";function P({invitation:e,createPassportSvg:a,passportColor:c}){const[p,n]=m.useState(!1),{t}=m.useContext(H),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:W(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,l]),x=m.useCallback(()=>{n(!0)},[]),r=m.useCallback(()=>{n(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ee,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(q,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx(U,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:r,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(o=>s.jsx("li",{style:{listStyle:"circle"},children:o.description},o.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(D,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}P.propTypes={invitation:i.object.isRequired,createPassportSvg:i.func.isRequired,passportColor:i.string};P.defaultProps={passportColor:"auto"};const ee=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,a9 as g}from"./vendor-mui-core-
|
|
1
|
+
import{j as i,a9 as g}from"./vendor-mui-core-CQ38ohp2.js";import{f as x,r as u}from"./vendor-react-DEoibe3W.js";import{u as v}from"./vendor-hooks-DftG_2gV.js";import{I as w}from"./invitation-BrAZQXQL.js";import{L as I}from"./landing-page-BMM_oJb1.js";import{u as S,aT as T,j}from"./vendor-ux-did-connect-BdkhddhO.js";import{H as P}from"./vendor-arcblock-ScFEr-lj.js";import{g as k}from"./get-safe-url-Bq9SFfX6.js";import{u as E,d as L,c as R,s as W,a as C}from"./index-DO3_1y-L.js";import"./vendor-utils-BNHJB5U7.js";import"./use-passport-id-B-b-_oYF.js";import"./session-VIMbdc9j.js";import"./sdk-CTe6rL6c.js";import"./CheckCircle-BNrN9mgy.js";import"./wrap-locale-DMTYAE64.js";import"./lottie-web-jYmAQWuC.js";function y(c){var r;const m=x(),{searchParams:s}=new URL(window.location.href),{api:p,session:d}=E(),{t:f}=S(),a=s.get("inviteId"),n=s.get("redirect"),h=u.useCallback(async()=>{const{data:t}=await L.get("invitation",{params:{inviteId:a}});return t},[a]),l=v(async(t,o=e=>e)=>{t&&(W(o(t.sessionToken)),C(o(t.refreshToken)),t.visitorId&&T(o(t.visitorId))),await d.refresh(),setTimeout(()=>{if(n){const e=decodeURIComponent(n);e.startsWith(j.WELLKNOWN_SERVICE_PATH_PREFIX)?m(e,{replace:!0}):window.location.href=k(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(I,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(P,{children:i.jsx("title",{children:f("pageTitle.invite")})}),i.jsx(g,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(w,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:t=>R({...t}),onLoginSuccess:l,inService:!0})})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aa as w,a9 as v}from"./vendor-mui-core-
|
|
1
|
+
import{j as e,aa as w,a9 as v}from"./vendor-mui-core-CQ38ohp2.js";import{a as T,m as I,u as p}from"./vendor-hooks-DftG_2gV.js";import{I as P}from"./invitation-BrAZQXQL.js";import{L as j}from"./landing-page-BMM_oJb1.js";import{u as k,aT as R,j as S}from"./vendor-ux-did-connect-BdkhddhO.js";import{H as L}from"./vendor-arcblock-ScFEr-lj.js";import{g as E}from"./get-safe-url-Bq9SFfX6.js";import{u as C,c as W,s as F,a as N}from"./index-DO3_1y-L.js";import{f as H}from"./vendor-react-DEoibe3W.js";import"./vendor-utils-BNHJB5U7.js";import"./use-passport-id-B-b-_oYF.js";import"./session-VIMbdc9j.js";import"./sdk-CTe6rL6c.js";import"./CheckCircle-BNrN9mgy.js";import"./wrap-locale-DMTYAE64.js";import"./lottie-web-jYmAQWuC.js";function Q(f){var m;const{searchParams:a}=new URL(window.location.href),{api:r,session:d}=C(),u=H(),{t:h}=k(),n=a.get("id"),c=a.get("redirect"),g=T({state:""}),s=I(async()=>{if(!n)return null;const{data:t}=await r.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),x=p(async(t,i=o=>o)=>{t&&(t.sessionToken&&F(i(t.sessionToken)),t.refreshToken&&N(i(t.refreshToken)),t.visitorId&&R(i(t.visitorId)),await d.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.href=E(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return s.loading?e.jsx(w,{}):e.jsxs(j,{did:(m=window.blocklet)==null?void 0:m.appPid,children:[e.jsx(L,{children:e.jsx("title",{children:h("pageTitle.issuePassport")})}),e.jsx(v,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(P,{...f,action:"issue-passport",getDataFn:l,checkFn:r.get,createPassportSvg:W,onLoginSuccess:x,inService:!0,status:g.state})})]})}export{Q as default};
|