@abtnode/blocklet-services 1.17.8-beta-20260104-120132-cb5b1914 → 1.17.8-beta-20260106-113136-b3c09e14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-DyRP0A_7.js → AdapterDayjs-DafRMFLg.js} +1 -1
- package/dist/assets/Community-3AO97CCq.js +1 -0
- package/dist/assets/{Google-Bjq5o7qL.js → Google-DRu937I3.js} +1 -1
- package/dist/assets/Holiday-CqSw2e8m.js +1 -0
- package/dist/assets/Meeting-DKbNRI16.js +1 -0
- package/dist/assets/OffSick-BvEREz3_.js +1 -0
- package/dist/assets/WorkingRemotely-DNtYHcSB.js +1 -0
- package/dist/assets/{access-control-Cv1j0YWJ.js → access-control-cgo5Z15_.js} +1 -1
- package/dist/assets/{add-component-core-8nx00xJP.js → add-component-core-BfzNEcS5.js} +7 -7
- package/dist/assets/{add-resource-B3-VwSQg.js → add-resource-CYRgZ1ps.js} +1 -1
- package/dist/assets/addon-qN24wAb4.js +14 -0
- package/dist/assets/advanced-1Vu6rcXU.js +14 -0
- package/dist/assets/{aigne-Dehkd-7B.js → aigne-D6MrXXCU.js} +1 -1
- package/dist/assets/api-DwxIBXZs.js +1 -0
- package/dist/assets/{appearance-CkrEEbhp.js → appearance-DOQHBg9p.js} +1 -1
- package/dist/assets/arrow-down.svg-7ME6T1BL.js +1 -0
- package/dist/assets/{audit-logs-XPxQHo2y.js → audit-logs-ISyoqJFp.js} +2 -2
- package/dist/assets/{authorize-ByHCjaXS.js → authorize-B9RLEFal.js} +1 -1
- package/dist/assets/{base-chart-ChBZtUEG.js → base-chart-DhxjAyBU.js} +1 -1
- package/dist/assets/base32-_D4eWUeh.js +1 -0
- package/dist/assets/bind-account-CLIjYy96.js +1 -0
- package/dist/assets/{branding-CBzX3Xum.js → branding-C81Kt22j.js} +1 -1
- package/dist/assets/{branding-khY0G2TO.js → branding-iwUveEf5.js} +2 -2
- package/dist/assets/branding-myiZl37D.js +1 -0
- package/dist/assets/{bundle-avatar-Dtpi1uSw.js → bundle-avatar-Cc_6nw01.js} +1 -1
- package/dist/assets/button-D-lyR9BW.js +1 -0
- package/dist/assets/{click-to-copy-BEM1P78p.js → click-to-copy-CMo42VnK.js} +1 -1
- package/dist/assets/cloneDeep-BY8zW7hH.js +1 -0
- package/dist/assets/{complete-CuyAiV3B.js → complete-CJ_buCAS.js} +4 -4
- package/dist/assets/{component-nxxcEAFR.js → component-Dip3v1Iq.js} +3 -3
- package/dist/assets/config-44sI5I0w.js +53 -0
- package/dist/assets/{config-DOcJbRFr.js → config-D5KnWqfn.js} +1 -1
- package/dist/assets/{config-DweHAJPq.js → config-D8XZj8JI.js} +2 -2
- package/dist/assets/{config-navigation-BG6durqz.js → config-navigation-Ni0iczgA.js} +8 -8
- package/dist/assets/config-space-B6_f52sE.js +1 -0
- package/dist/assets/{confirm-BRnYfcDD.js → confirm-Lb1MrAdS.js} +1 -1
- package/dist/assets/connect-0OZVqJvc.js +1 -0
- package/dist/assets/connect-B9GQZEi7.js +5 -0
- package/dist/assets/connect-BV6BUhDJ.css +1 -0
- package/dist/assets/connect-JAX_oP3o.js +5 -0
- package/dist/assets/{connect-to-BEfFI4oa.js → connect-to-Djgj6TLg.js} +1 -1
- package/dist/assets/{create-passport-svg-BKhJ2ufW.js → create-passport-svg-5AYzBKFb.js} +1 -1
- package/dist/assets/createClass-DXYd7BIe.js +1 -0
- package/dist/assets/{dashboard-CDOqgUmx.js → dashboard-C0l2IWWH.js} +7 -7
- package/dist/assets/{delete-confirm-1vzcMsM2.js → delete-confirm-tbfLqDBI.js} +1 -1
- package/dist/assets/did-address-CsOJBoiY.js +1 -0
- package/dist/assets/{domain-D75xKDoP.js → domain-CnhOsdmM.js} +1 -1
- package/dist/assets/{domain-action-card-BgDPfYMr.js → domain-action-card-BsdHbhEi.js} +2 -2
- package/dist/assets/domains-DRP2VSvO.js +1 -0
- package/dist/assets/edit.svg-CTE5eATX.js +1 -0
- package/dist/assets/email-Dt_DGuhf.js +17 -0
- package/dist/assets/engine-BXGX_w-S.js +1 -0
- package/dist/assets/exchange-passport-DztKvBat.js +1 -0
- package/dist/assets/{form-BblKAylu.js → form-DoC8uBcB.js} +3 -3
- package/dist/assets/{form-text-input-C-JBHNfU.js → form-text-input-XjloVwBd.js} +2 -2
- package/dist/assets/{fuel-BPg61IpB.js → fuel-IaJHNPPW.js} +1 -1
- package/dist/assets/{gen-access-key-B-PvqBv6.js → gen-access-key-BJlDqEhI.js} +1 -1
- package/dist/assets/gen-simple-access-key-lyiUw0C-.js +1 -0
- package/dist/assets/get-safe-url-BiNPujaX.js +1 -0
- package/dist/assets/google-icon-vNOJy67F.js +1 -0
- package/dist/assets/{home-CT38dHBL.js → home-Bs_5YPbK.js} +1 -1
- package/dist/assets/{iframe-D119MMHU.js → iframe-Dqu4MSyW.js} +1 -1
- package/dist/assets/{index-BpWFE-ry.js → index-1HKgA-fz.js} +1 -1
- package/dist/assets/{index-CSCCjNba.js → index-B10SG1vs.js} +1 -1
- package/dist/assets/{index-sBtfsjBo.js → index-B4KKUWng.js} +2 -2
- package/dist/assets/{index-bCC4mzZc.js → index-B4YCnemd.js} +1 -1
- package/dist/assets/index-B6DWjLJS.js +281 -0
- package/dist/assets/{index-DSVwCr5p.js → index-B7_VUEoc.js} +2 -2
- package/dist/assets/index-B9LF8Bep.js +1 -0
- package/dist/assets/index-BDH_LtJL.js +1 -0
- package/dist/assets/{index-CGrk0HiP.js → index-BGhqVqit.js} +1 -1
- package/dist/assets/{index-DdojJXSn.js → index-BNhv-9xy.js} +3 -3
- package/dist/assets/{index-BNAs76qj.js → index-BSZtxRM0.js} +2 -2
- package/dist/assets/{index-BWCHnVga.js → index-BWDWEkUF.js} +1 -1
- package/dist/assets/{index-TzwTiNQ7.js → index-BWL6HE0j.js} +1 -1
- package/dist/assets/{index-E4Hos_Sx.js → index-B_SjLIbT.js} +7 -7
- package/dist/assets/{index-D1f4dwYF.js → index-BhhZ8IDZ.js} +13 -13
- package/dist/assets/{index-arhRQhsc.js → index-BkePHcyK.js} +9 -9
- package/dist/assets/{index-CfA9D2iF.js → index-BmXPp3DU.js} +1 -1
- package/dist/assets/{index-D1SIrheh.js → index-BsohFwTm.js} +1 -1
- package/dist/assets/index-CI_uwh_J.js +81 -0
- package/dist/assets/index-CQgzjKgB.js +1039 -0
- package/dist/assets/{index-8bzrOXqv.js → index-CRZM3CKo.js} +2 -2
- package/dist/assets/index-CbiyJRV7.js +1 -0
- package/dist/assets/{index-VaUGnCuU.js → index-Cp0b8q3A.js} +1 -1
- package/dist/assets/{index-BcIeEF3v.js → index-Cq6z7yeF.js} +4 -4
- package/dist/assets/index-DT5AXPVB.js +200 -0
- package/dist/assets/{index-DGbr3NAq.js → index-DctZHPFL.js} +1 -1
- package/dist/assets/{index-uODjznr3.js → index-Dfx19arA.js} +6 -6
- package/dist/assets/index-DhHvANH8.js +93 -0
- package/dist/assets/index-DrCTi6nm.css +1 -0
- package/dist/assets/{index-DoDx-vpV.js → index-G6Vk78zE.js} +3 -3
- package/dist/assets/{index-OTENuoZ0.js → index-TYwJnR0n.js} +23 -23
- package/dist/assets/{index-CIC0R_Qc.js → index-dbYkWwF4.js} +1 -1
- package/dist/assets/index-vP1T6V7V.js +120 -0
- package/dist/assets/info-outline-rounded-BIwvgXCK.js +1 -0
- package/dist/assets/invitation-CYFN9u5t.js +177 -0
- package/dist/assets/invitations-jY13RXbI.js +3 -0
- package/dist/assets/{invite-uHE_P5fP.js → invite-D72FvaiG.js} +1 -1
- package/dist/assets/{isURL-CRZ7iI7F.js → isURL-CJRImg0N.js} +2 -2
- package/dist/assets/issue-passport-BfqkJF3W.js +1 -0
- package/dist/assets/{item-BJSHAMwK.js → item-5ZWPft2s.js} +1 -1
- package/dist/assets/landing-page-DRtId3hN.js +1 -0
- package/dist/assets/{layout-D9M0eiNw.js → layout-Be1KH57_.js} +1 -1
- package/dist/assets/{list-DVUI92a2.js → list-CHI1rCEg.js} +3 -3
- package/dist/assets/list-CQtiNSih.js +2 -0
- package/dist/assets/localization-CKE-bHgd.js +1 -0
- package/dist/assets/lock.svg-CiT4rEpi.js +1 -0
- package/dist/assets/{log-DbdNMVuv.js → log-BfCFT05M.js} +1 -1
- package/dist/assets/logger-DU7baop2.js +1 -0
- package/dist/assets/login-BtsH3IvI.js +1 -0
- package/dist/assets/{login-oauth-callback-RLp-7ubu.js → login-oauth-callback-Ds4uYiRr.js} +1 -1
- package/dist/assets/{logo-uploader-BFMnNkRn.js → logo-uploader-lepUW_D7.js} +3 -3
- package/dist/assets/{lost-passport-CB5SFq30.js → lost-passport-BtN3h1ya.js} +2 -2
- package/dist/assets/omit-CCIQ0Qdi.js +1 -0
- package/dist/assets/{open-window-xMdq1GjU.js → open-window-CNt8gsrN.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DvKFY6t9.js → over-due-invoice-payment-7TbnqqKX.js} +1 -1
- package/dist/assets/{overview-DNVfcZQO.js → overview-Be3tncsL.js} +3 -3
- package/dist/assets/passport-CkJ4B4CG.js +1 -0
- package/dist/assets/passport-item-Bhbm8_m6.js +1 -0
- package/dist/assets/{permission-C0rLyhnq.js → permission-BHvrn0M5.js} +1 -1
- package/dist/assets/preferences-TFWtUYLy.js +1 -0
- package/dist/assets/profile-embed-B9f9hlSS.js +1 -0
- package/dist/assets/provider-icon-DQY2_LaP.js +1 -0
- package/dist/assets/publish-resource-CyvkVMG_.js +1 -0
- package/dist/assets/question-mark-circle.svg-GhTaklFN.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-BZjy3RlT.js → react-beautiful-dnd.esm-D0JKrMDl.js} +4 -4
- package/dist/assets/revoke.svg-DUoaRyPZ.js +1 -0
- package/dist/assets/runtime-npJC4gp_.js +1 -0
- package/dist/assets/{sanitize-yVk8VEIO.js → sanitize-C-shWbtD.js} +1 -1
- package/dist/assets/sdk-CoWDgSLO.js +1 -0
- package/dist/assets/security-nSKpCl8B.js +22 -0
- package/dist/assets/server-logo-notext.svg-BLAdvsmP.js +1 -0
- package/dist/assets/{session-5s-U-ruq.js → session-C2ZBRIpv.js} +1 -1
- package/dist/assets/{setup-DgF_JFoX.js → setup-krkSJpAg.js} +1 -1
- package/dist/assets/simple-select-i16Vwzvl.js +1 -0
- package/dist/assets/{spaces-BE9CZzeJ.js → spaces-BdZ_Rv3s.js} +1 -1
- package/dist/assets/start-y3zrboBQ.js +187 -0
- package/dist/assets/{starting-progress-MyalFKYG.js → starting-progress-DI-J-VlX.js} +2 -2
- package/dist/assets/status-B8pB_mTB.js +1 -0
- package/dist/assets/{step-actions-X2c_czAD.js → step-actions-B1ufIDaK.js} +1 -1
- package/dist/assets/{studio-BcQoXvqZ.js → studio-1jwq0HOw.js} +1 -1
- package/dist/assets/{switch-BjA8SIAh.js → switch-CetbUrYR.js} +1 -1
- package/dist/assets/{switch-control-D2RiXLWV.js → switch-control-_85hc9FG.js} +1 -1
- package/dist/assets/{table-tips-Dgzi4H1y.js → table-tips-CMt22HEy.js} +1 -1
- package/dist/assets/team-DDjNXwXE.js +146 -0
- package/dist/assets/{traffic-CvgJe_3z.js → traffic-mcbpWOFq.js} +1 -1
- package/dist/assets/transfer-C66c3bWd.js +16 -0
- package/dist/assets/unsubscribe-Cvz0OKhq.js +1 -0
- package/dist/assets/{use-app-logo-Cfo-T8ZY.js → use-app-logo-BuyF983S.js} +1 -1
- package/dist/assets/use-server-logo-Pbr_UuiI.js +1 -0
- package/dist/assets/{use-window-close-4WCUBrSc.js → use-window-close-B16QghYq.js} +1 -1
- package/dist/assets/{useAsync-DVl73fmG.js → useAsync-BVTh1KYj.js} +1 -1
- package/dist/assets/{useAsync-Dotoxibi.js → useAsync-ZGLJQow7.js} +1 -1
- package/dist/assets/{useAsyncRetry-r8dEPb-x.js → useAsyncRetry-BMmRgSGm.js} +1 -1
- package/dist/assets/{useLocalStorage-Cl1rEjxs.js → useLocalStorage-De-EuH_M.js} +1 -1
- package/dist/assets/user-center-DQSoqc_z.js +125 -0
- package/dist/assets/user-follower-TTyja_sV.js +32 -0
- package/dist/assets/{util-CDBgZOAd.js → util-DuMKfKo8.js} +1 -1
- package/dist/assets/{util-BNGEGQGN.js → util-Ff3hwYmy.js} +1 -1
- package/dist/assets/{vendor-arcblock-B1iA4v4a.js → vendor-arcblock-Cnwtqa7s.js} +19 -19
- package/dist/assets/{vendor-hooks-qxhUUbW5.js → vendor-hooks-BQWlJm53.js} +2 -2
- package/dist/assets/{vendor-utils-CxWN1dT3.js → vendor-utils-DCMKu06e.js} +3 -3
- package/dist/assets/{vendor-ux-jvAfFAl1.js → vendor-ux-B0gV9NvH.js} +92 -95
- package/dist/assets/{wait-connect-VFnD4S6k.js → wait-connect-CRZmfXOA.js} +1 -1
- package/dist/assets/{wizard-D6nEp8xR.js → wizard-B41kI39b.js} +1 -1
- package/dist/assets/{wizard-components-CQAhuCn-.js → wizard-components-Bn72hVOe.js} +2 -2
- package/dist/assets/wrap-locale-CF46rj6q.js +1 -0
- package/dist/assets/{zh-LGxmNDus.js → zh-BmX_fuoi.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +46 -46
- package/dist/assets/Community-CELsDteM.js +0 -1
- package/dist/assets/Holiday-DOCjSYjH.js +0 -1
- package/dist/assets/Meeting-BAXt_LiK.js +0 -1
- package/dist/assets/OffSick-BGEr8Nkc.js +0 -1
- package/dist/assets/WorkingRemotely-BcneAIXG.js +0 -1
- package/dist/assets/addon-DckWyYy3.js +0 -14
- package/dist/assets/advanced-BcLdGbJh.js +0 -14
- package/dist/assets/api-FQQlzPOP.js +0 -1
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +0 -1
- package/dist/assets/base32-BPZDlXZz.js +0 -1
- package/dist/assets/bind-account-DtN3r3bu.js +0 -1
- package/dist/assets/branding-Aq4o2tjp.js +0 -1
- package/dist/assets/button-D6aVYj2n.js +0 -1
- package/dist/assets/cloneDeep-C2rlAYcK.js +0 -1
- package/dist/assets/config-n9Go4CIg.js +0 -53
- package/dist/assets/config-space-DNGDnW7P.js +0 -1
- package/dist/assets/connect-B84DSta0.js +0 -1
- package/dist/assets/connect-CmaOf6IU.js +0 -5
- package/dist/assets/createClass-DXSToV70.js +0 -1
- package/dist/assets/did-address-B3eXeL7H.js +0 -1
- package/dist/assets/domains-BmgTqdar.js +0 -1
- package/dist/assets/edit.svg-RRSklUg-.js +0 -1
- package/dist/assets/email-0rfuUid8.js +0 -17
- package/dist/assets/engine-D-_cbl3F.js +0 -1
- package/dist/assets/exchange-passport-DtpDKfXH.js +0 -1
- package/dist/assets/gen-simple-access-key-BRpJnjDR.js +0 -1
- package/dist/assets/get-safe-url-xl2OarvZ.js +0 -1
- package/dist/assets/index-BMtr5-CV.js +0 -1
- package/dist/assets/index-BODmBNkm.js +0 -200
- package/dist/assets/index-C6oxUE_X.js +0 -281
- package/dist/assets/index-DUo9jXH_.js +0 -81
- package/dist/assets/index-DcjD74XY.js +0 -1
- package/dist/assets/index-DrVXX4fX.css +0 -1
- package/dist/assets/index-NWCpUGtr.js +0 -1039
- package/dist/assets/index-TG3kf9io.js +0 -120
- package/dist/assets/index-tfYDa2i6.js +0 -93
- package/dist/assets/invitation-CVulfNR5.js +0 -177
- package/dist/assets/invitations-CuhR5Qhr.js +0 -3
- package/dist/assets/issue-passport-CgdZdVEa.js +0 -1
- package/dist/assets/landing-page-Bu1ZaLGu.js +0 -1
- package/dist/assets/list-BYNjj68R.js +0 -2
- package/dist/assets/localization-CZX-M3IK.js +0 -1
- package/dist/assets/lock.svg-BgybwZNe.js +0 -1
- package/dist/assets/logger-Biwe4SzB.js +0 -1
- package/dist/assets/login-DUYsZ42N.js +0 -1
- package/dist/assets/omit-spWLSLbo.js +0 -1
- package/dist/assets/passport-BNRZfcVH.js +0 -1
- package/dist/assets/passport-item-Bf_kXmId.js +0 -1
- package/dist/assets/preferences-XGJx_7ht.js +0 -1
- package/dist/assets/profile-embed-DROgyynT.js +0 -1
- package/dist/assets/publish-resource-C3tnQoPG.js +0 -1
- package/dist/assets/question-mark-circle.svg-CByEVDhb.js +0 -1
- package/dist/assets/revoke.svg-CNl4LAbv.js +0 -1
- package/dist/assets/runtime-DiEn6rZ9.js +0 -1
- package/dist/assets/sdk-C45BrgFy.js +0 -1
- package/dist/assets/security-Ch3TxRbd.js +0 -22
- package/dist/assets/server-logo-notext.svg-xZ-i1SpD.js +0 -1
- package/dist/assets/simple-select-EppOca29.js +0 -1
- package/dist/assets/start-D6EkscL8.js +0 -187
- package/dist/assets/status-vSa6pwrP.js +0 -1
- package/dist/assets/team-D9lFN8Pe.js +0 -146
- package/dist/assets/transfer-IRaap94c.js +0 -16
- package/dist/assets/unsubscribe-7WUPZn-b.js +0 -1
- package/dist/assets/use-server-logo-Cv1kAPgB.js +0 -1
- package/dist/assets/user-center-BoGQKLvn.js +0 -125
- package/dist/assets/user-follower-D8NzTP2C.js +0 -32
- package/dist/assets/wrap-locale-qgV7mOv6.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as U,a as Ue}from"./vendor-react-CTtPmzVP.js";import{V as D,H,_ as ye,$ as re,b2 as V,aP as ve,au as Ce}from"./vendor-ux-jvAfFAl1.js";import{j as e,Y as M,b5 as K,I as X,aj as G,$ as Y,b6 as q,T as I,ak as c,z as w,F as C,c5 as Te,b$ as le,bX as ne,a5 as se,a3 as Z,aZ as oe,R as ae,Q as z,a6 as Q,W as n,am as we,bi as ce,cv as Se,cu as Ie}from"./vendor-mui-core-DnR6WYuU.js";import{Z as $,c as k,Y as Re,ba as Ee,bb as Ae,bc as ke}from"./index-NWCpUGtr.js";import{u as Pe}from"./useAsyncRetry-r8dEPb-x.js";import{r as We}from"./index-OTENuoZ0.js";import{b as B}from"./team-D9lFN8Pe.js";import{u as ue,C as S}from"./index.esm-Co8ZxFyk.js";import{o as Ne,b as qe,C as te}from"./vendor-utils-CxWN1dT3.js";import{T as Oe}from"./index-CSCCjNba.js";import{E as Le}from"./empty-spinner-BYDonf35.js";import{C as v}from"./click-to-copy-BEM1P78p.js";import{D as _e}from"./delete-confirm-1vzcMsM2.js";import{a as ze}from"./passport-item-Bf_kXmId.js";import{A as Fe}from"./actions-Dfiiwkit.js";import{T as ie}from"./table-tips-Dgzi4H1y.js";import{u as De}from"./use-mobile-BINJTzMb.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B1iA4v4a.js";import"./useAsync-Dotoxibi.js";import"./session-5s-U-ruq.js";import"./isURL-CRZ7iI7F.js";import"./use-app-logo-Cfo-T8ZY.js";import"./arrow-down.svg-C4FUKwt4.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DyRP0A_7.js";import"./confirm-BRnYfcDD.js";import"./index-DBs9Ljax.js";import"./ua-parser-DP5omx3I.js";import"./did-address-B3eXeL7H.js";import"./util-CDBgZOAd.js";import"./base32-BPZDlXZz.js";var de=We();const $e={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=U.useState(!1),{t:l,locale:s}=D(),{api:f}=$(),{teamDid:d}=B(),{control:y,handleSubmit:g,formState:{errors:u},watch:P,setValue:m}=ue({defaultValues:$e,mode:"onChange"}),T=P("scope"),R=o=>{o!=="profile:read"&&m("scope",T.includes(o)?T.filter(x=>x!==o):[...T,o])},W=async o=>{h(!0);try{const x={...o,redirectUris:o.redirectUris,contacts:o.contacts?o.contacts.split(",").map(A=>A.trim()):[],scope:o.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Ne(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(M,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(C,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(C,{children:l("oauth.client.helperText.read")}),e.jsx(C,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(C,{children:l("oauth.client.helperText.more")})]})]})})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([o,x])=>e.jsx(ne,{control:e.jsx(se,{checked:T.includes(o),onChange:()=>R(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:x})})},o))})})]}),e.jsx(Z,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(S,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(C,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(oe,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:a,children:l("common.cancel")}),e.jsxs(z,{onClick:g(W),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Q,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function J({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(Ue.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(v,{children:h})})},h))})}J.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=$(),{blocklet:i}=Re(),h=te(a,"/api/media/upload",i.appPid),l=U.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:U.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},Be=U.lazy(()=>ye(()=>import("./index-DoDx-vpV.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=U.useState(!1),{t:s,locale:f}=D(),d=U.useRef(null),{api:y}=$(),{teamDid:g}=B(),{control:u,handleSubmit:P,formState:{errors:m},watch:T,setValue:R,getValues:W}=ue({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),o=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:N}=ee(x),E=t=>{t!=="profile:read"&&R("scope",o.includes(t)?o.filter(p=>p!==t):[...o,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(M,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(K,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:s(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(U.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx(Be,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(W()).then(()=>{a()}).catch(p=>{H.error(p.message||s("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:N,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:u,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:u,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:u,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(C,{children:s("oauth.client.helperText.redirectUris")})]})})}),e.jsx(S,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:s("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(se,{checked:o.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(Z,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(S,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(C,{children:s("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(oe,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:P(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(Q,{size:16}):s("common.update")})]})]})}he.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=D(),{api:s}=$(),{teamDid:f}=B(),d=()=>{h()},y=async()=>{try{await s.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=D(),{teamDid:l}=B(),{clientName:s,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:P,contacts:m,tosUri:T,policyUri:R,jwksUri:W,jwks:o,softwareId:x,softwareVersion:A,clientIdIssuedAt:N,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(P),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),b=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(v,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(J,{scope:g})},{label:i("oauth.client.createUser"),value:_?ze(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(v,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(v,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:W},{label:i("oauth.client.jwks"),value:o},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:N?e.jsx(V,{value:N*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(M,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(K,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Y,{children:e.jsx(c,{sx:{mt:1},children:b.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==b.length-1&&e.jsx(Z,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function be({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}be.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function Tt(){const[r,a]=U.useState({searchText:"",pageSize:10,page:1}),[i,h]=U.useState(null),[l,s]=U.useState(!1),f=U.useRef(null),{t:d,locale:y}=D(),{api:g}=$(),{teamDid:u}=B(),[P,m]=U.useState(null),[T,R]=U.useState(null),W=De(),{getClientLogoUrl:o}=ee(),x=Pe(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,N=U.useMemo(()=>x.value?.list||[],[x.value?.list]),E=U.useMemo(()=>r.searchText?N.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):N,[r.searchText,N]),O=U.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],b=o(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:b,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(J,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Ee,{showDid:!0,did:t,cardType:ke.Detailed,infoType:Ae.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Se,{}),text:d("common.edit"),onClick:b=>{b.stopPropagation(),m(j)}},{icon:e.jsx(Ie,{}),text:d("common.delete"),onClick:b=>{b.stopPropagation(),R(j)}}]})}}}],[E,d,o,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(b=>({...b,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(b=>({...b,searchText:"",page:t+1})):r.searchText!==j&&a(b=>({...b,searchText:j,page:1}))};return e.jsxs(c,{ref:f,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[W?e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(ve,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const b=E[p];h(b)}}},onChange:_,title:W?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[A?e.jsx(Q,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ce,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(be,{open:l,onCreated:()=>{s(!1),x.retry()},onClose:()=>s(!1)}),P&&e.jsx(me,{client:P,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{Tt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-react-CTtPmzVP.js";import{S as t}from"./studio-BcQoXvqZ.js";import"./vendor-ux-jvAfFAl1.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./index-CGrk0HiP.js";import"./index-NWCpUGtr.js";import"./vendor-arcblock-B1iA4v4a.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t}from"./vendor-react-CTtPmzVP.js";const C=e=>t.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M11.7802 2.25C9.01277 2.25 6.76131 4.52104 6.76131 7.3125V10.35H5.75754C4.65038 10.35 3.75 11.2582 3.75 12.375V20.475C3.75 21.5918 4.65038 22.5 5.75754 22.5H17.8028C18.91 22.5 19.8103 21.5918 19.8103 20.475V12.375C19.8103 11.2582 18.91 10.35 17.8028 10.35H16.799V7.3125C16.799 4.52104 14.5476 2.25 11.7802 2.25ZM17.8028 12.375L17.8048 20.475H5.75754V12.375H17.8028ZM8.76886 10.35V7.3125C8.76886 5.63783 10.1199 4.275 11.7802 4.275C13.4404 4.275 14.7915 5.63783 14.7915 7.3125V10.35H8.76886Z"}));export{C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,D as s}from"./vendor-ux-jvAfFAl1.js";const o=e("blocklet-services");s("blocklet-services");export{o as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as p,T as I,W as r,am as F,Q as O,bt as pe,a6 as fe}from"./vendor-mui-core-DnR6WYuU.js";import{f as ge,a as ue,b as me,h as he}from"./vendor-hooks-qxhUUbW5.js";import{r as X,u as we}from"./vendor-react-CTtPmzVP.js";import{u as xe,z as ye,s as ke,c as _,a as Pe,H as $,b as be,d as je,e as ve,f as M,R as Te,g as Ie}from"./index-NWCpUGtr.js";import{C as A,b as R,J as Ce,c as Le}from"./vendor-utils-CxWN1dT3.js";import{o as _e}from"./vendor-arcblock-B1iA4v4a.js";import{$ as Re,J as We,V as G,Y as V,ab as Ae,W as Ee,Q as Ne,H as z,a7 as Se,am as B}from"./vendor-ux-jvAfFAl1.js";import{u as Ue}from"./use-passport-id-B-b-_oYF.js";import{g as J}from"./get-safe-url-xl2OarvZ.js";import{d as W}from"./logger-Biwe4SzB.js";import"./lottie-web-4koyQiv_.js";function Y({blocklet:c=window.blocklet}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(Re,{variant:"rounded",shape:"square",did:c.appPid,src:c.appLogo,size:80}),e.jsx(I,{component:"h2",variant:"h6",children:c.appName}),e.jsx(We,{did:c.appPid})]})}const De=X.memo(Y);Y.propTypes={blocklet:r.shape({appName:r.string,appLogo:r.string,appPid:r.string})};const qe=()=>window.blocklet?.componentMountPoints?.find(s=>s.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint;function Z({children:c=null,cta:s=null,...i}){return e.jsxs(p,{...i,children:[c?e.jsx(p,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:c}):null,s?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:s}):null]})}Z.propTypes={children:r.node,cta:r.node};function ee({passports:c=[],onConnect:s=()=>{},redirect:i,...y}){const{t:f}=G(),k=qe(),P=a=>{const m=a?.payable;return k&&m?A(k,`/api/redirect/checkout/${m}?redirect=${i}`):null};return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(De,{}),e.jsx(Z,{...y,cta:e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:f("login.accessLimit.title")}),e.jsx(I,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:f("login.accessLimit.description")}),e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:c?.map(a=>{const m=P(a);return m?e.jsx(F,{title:f("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"primary",variant:"contained",endIcon:e.jsx(pe,{}),href:m,target:"_blank",children:a.title||a.name})},a.name):e.jsx(F,{title:f("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"inherit",variant:"contained",onClick:s,children:a.title||a.name})},a.name)})}),e.jsxs(I,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(p,{component:"span",sx:{display:"inline-block",mr:1},children:f("login.accessLimit.alreadyHavePassport")}),e.jsx(p,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:s,children:f("common.connect")})]})]})})]})}ee.propTypes={passports:r.arrayOf(r.shape({name:r.string.isRequired,title:r.string,payable:r.string})),onConnect:r.func,onClose:r.func,redirect:r.string.isRequired};function Xe(){const c=X.useRef(null),{session:s}=xe(),{t:i,locale:y}=G(),{getPassportId:f}=Ue(),k=we(),P=V(),a=Ae(),{encryptKey:m,decrypt:ne}=ye(),b=ge(s),{searchParams:o}=new URL(window.location.href),h={passportId:f()},E=o.get("componentId"),N=o.get("authenticated"),te=o.get("sessionToken"),oe=o.get("csrfToken"),ie=o.get("refreshToken"),se=o.get("requiredRoles"),g=o.get("redirect"),d=o.get("forceConnected"),j=o.get("sourceAppPid"),C=o.get("origin"),S=o.get("autoConnectWebview"),U=o.get("popup"),D=o.get("showQuickConnect");let w=o.get("inviter");if(!w&&g)try{w=(g.startsWith("http")?new URL(g):new URL(g,window.location.origin)).searchParams.get("inviter")}catch{}w=w||localStorage.getItem("inviter"),E&&(h.componentId=E),P&&(h.visitorId=P),w&&(h.inviter=w),Le(j)||(j==="null"?h.sourceAppPid=null:j!==null&&(h.sourceAppPid=j));let q=[];try{q=JSON.parse(se)}catch{}const re=async n=>{const t=o.get("fromWallet");W("login page notifyWallet",{data:n,fromWallet:t,"browser.wallet":a.wallet}),n&&String(t)==="1"&&a.wallet&&await Promise.any([B.asyncCall("arcSetToken",n),M(3e3)])},v=n=>n&&(o.get("encrypted")?ne(n):n),H=async n=>{n&&await re(n),setTimeout(()=>{if(g){const t=decodeURIComponent(g);t.startsWith(_.WELLKNOWN_SERVICE_PATH_PREFIX)?k(t,{replace:!0}):window.location.replace(J(t))}else window.location.replace(window.env.pathPrefix||"/")},50)},ce=n=>{const t={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:V(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};W("bridge callArc: onLogin",t),B.callArc("onLogin",t)},Q=async(n,t)=>{const L=t(n.csrfToken),T=t(n.sessionToken),x=t(n.refreshToken),u=t(n.visitorId);W("login page onLogin",{result:n,decodeSessionToken:T,decodeRefreshToken:x,decodeVisitorId:u}),be(T),je(L),ve(x),n.visitorId&&Se(u),await s.refresh(),await M(100),ce(b.current);const l={};o.get("saveConnect")?(l.connected_did=b.current.user.did,l.connected_pk=b.current.user.pk,l.connected_wallet_os=b.current.walletOS,l.connected_app=Te()):(l.connected_did=o.get("connected_did"),l.connected_pk=o.get("connected_pk"),l.connected_app=o.get("connected_app"),l.connected_wallet_os=o.get("connected_wallet_os")),Ie(l,!0),H({sessionToken:T,refreshToken:x,visitorId:u})},ae=ue(()=>C==="switch-did"?d&&typeof d=="string"?{title:i("login.switchSpecifiedDid.title"),scan:i("login.switchSpecifiedDid.scan",{did:d}),confirm:i("login.switchSpecifiedDid.confirm"),success:i("login.switchSpecifiedDid.success")}:{title:i("login.switchDid.title"),scan:i("login.switchDid.scan"),confirm:i("login.switchDid.confirm"),success:i("login.switchDid.success")}:{title:i("login.connect.title"),scan:i("login.connect.scan"),confirm:i("login.connect.confirm"),success:i("login.connect.success")},[d,C,i]),K=me(()=>{const n=window?.blocklet,t={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:Q,onError:le,locale:y,messages:ae,extraParams:h,baseUrl:window.location.origin,prefix:A(window.location.origin,_.WELLKNOWN_SERVICE_PATH_PREFIX,ke)};d&&(t.forceConnected=d,t.extraParams.enableSwitchApp=!1,t.extraParams.forceConnected=d),t.options||(t.options={}),C==="switch-did"?t.options.showQuickConnect=!0:R(D)||([!1,"false"].includes(D)?t.options.showQuickConnect=!1:t.options.showQuickConnect=!0);const L=Ee();Ne()&&(t.extraParams.sourceAppPid=L.appPid);const x=A(window.location.origin,_.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),u={params:Pe(encodeURIComponent(JSON.stringify(t))),appPid:n?.appPid,appName:n?.appName,locale:y,redirect:window.location.href,_ek_:m};R(S)||(u.autoConnectWebview=S),R(U)||(u.popup=U),u.disableClose=!0;const l=J(Ce(x,u),{allowDomains:null});window.location.href=l});he(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){z.error("Unexpected login response from server: visitorId is required");return}Q({sessionToken:v(te),csrfToken:v(oe),refreshToken:v(ie),visitorId:v(n)},t=>t)}else!s.user||d&&s.user.did!==d?K():!N&&!o.get("sessionToken")&&H()});const le=n=>{z.error(n.message)},de=o.has("popup");if(s.loading||s.user){if(!N||o.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx($,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(_e,{children:de?null:e.jsx(fe,{})})]});const n=g?new URL(g,window.location.origin).href:window.location.href;return e.jsx(ee,{onConnect:K,passports:q,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx($,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:c})]})}export{Xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e}from"./vendor-react-CTtPmzVP.js";import{aq as r}from"./vendor-utils-CxWN1dT3.js";const t=e(r);export{t as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r}from"./create-passport-svg-BKhJ2ufW.js";import{C as t}from"./vendor-utils-CxWN1dT3.js";import{c as s}from"./index-NWCpUGtr.js";const e=o=>r({...o,issuerAvatarUrl:t(window.location.origin,s.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo")});export{e as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,b6 as b,b2 as k,T as m,am as M,W as s,s as T,U as $,ak as g,cI as f,cJ as x,cK as q,cL as N,cM as L,cN as R,cO as B}from"./vendor-mui-core-DnR6WYuU.js";import{V as h,b2 as F,aA as S}from"./vendor-ux-jvAfFAl1.js";import{ba as E,bb as P,bc as V}from"./index-NWCpUGtr.js";import{U as G}from"./ua-parser-DP5omx3I.js";import{a as w}from"./vendor-react-CTtPmzVP.js";import{a as H}from"./vendor-hooks-qxhUUbW5.js";import{W as j}from"./did-address-B3eXeL7H.js";import{p as J}from"./util-CDBgZOAd.js";import{b as K}from"./team-D9lFN8Pe.js";function Y(e){return!e||typeof e!="string"?"break-all":e.includes(" ")?"break-word":"break-all"}function C({logo:e="",name:r="",description:n="",size:l=40,variant:a="rounded",sx:d={},className:p="",logoName:u="",tooltip:o=null}){const i={width:l,height:l,...d},y=typeof r=="string"?r:e,v=t.jsxs(b,{direction:"row",spacing:1,className:`info-card-wrapper ${p}`,sx:{alignItems:"center",cursor:o?"pointer":"default"},children:[e?t.jsx(k,{src:e,alt:u??y,variant:a,sx:i}):t.jsx(k,{variant:a,sx:i,children:y?.slice(0,1)}),t.jsxs(b,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",wordBreak:Y(r),minWidth:{xs:100,sm:140}},children:[t.jsx(m,{variant:"body1",component:"div",sx:{color:"text.primary"},children:r}),n&&t.jsx(m,{variant:"subtitle1",sx:{color:"text.secondary"},children:n})]})]});return o?t.jsx(M,{title:o,placement:"top-start",slotProps:{tooltip:{sx:{bgcolor:c=>c.palette.mode==="dark"?"#2a2e37":"#ffffff",color:c=>c.palette.mode==="dark"?"#ffffff":c.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:c=>c.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:c=>c.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:c=>c.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:c=>c.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:v}):v}C.propTypes={logo:s.string,name:s.oneOfType([s.string,s.node]).isRequired,description:s.oneOfType([s.string,s.node]),size:s.oneOfType([s.number,s.string]),variant:s.oneOf(["square","rounded","circular"]),sx:s.object,className:s.string,logoName:s.string,tooltip:s.oneOfType([s.string,s.node])};function _(e){try{if(!e.trim())return{device:{icon:t.jsx(x,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:t.jsx(f,{fontSize:"small"}),text:"Unknown Browser"}};const n=new G(e).getResult();let l="";const a=e.split(/\s+/).find(o=>o.startsWith("arcwallet"));if(a){const o=a.split("/");o.length>1&&S.coerce(o[1])&&(l=S.coerce(o[1]).version)}const d=(()=>{const{type:o="",model:i=""}=n.device;return o==="mobile"?{icon:t.jsx(q,{fontSize:"small"}),text:i||"Mobile Device"}:o==="tablet"?{icon:t.jsx(N,{fontSize:"small"}),text:i||"Tablet"}:{icon:t.jsx(L,{fontSize:"small"}),text:i||"Desktop"}})(),p=(()=>{const{name:o="",version:i=""}=n.os;return o.toLowerCase().includes("mac")?{icon:t.jsx(R,{fontSize:"small"}),text:`${o} ${i}`}:o.toLowerCase().includes("ios")?{icon:t.jsx(R,{fontSize:"small"}),text:`${o} ${i}`}:o.toLowerCase().includes("android")?{icon:t.jsx(B,{fontSize:"small"}),text:`${o} ${i}`}:o.toLowerCase().includes("windows")?{icon:t.jsx(x,{fontSize:"small"}),text:`${o} ${i}`}:{icon:null,text:o?`${o} ${i}`:"Unknown OS"}})(),u=(()=>{const{name:o="",version:i=""}=n.browser;return{icon:t.jsx(f,{fontSize:"small"}),text:o?`${o} ${i}`:"Unknown Browser"}})();return{device:d,os:p,browser:u,...l?{walletVersion:{icon:null,text:l}}:{}}}catch(r){return console.error("Error parsing user agent:",r),{device:{icon:t.jsx(x,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:t.jsx(f,{fontSize:"small"}),text:"Unknown Browser"}}}}function z({ua:e}){const r=_(e);return t.jsx(b,{spacing:1,children:Object.entries(r).map(([n,{icon:l,text:a}])=>t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:l}),t.jsx(m,{variant:"body2",sx:{display:"flex"},children:a})]},n))})}z.propTypes={ua:s.string.isRequired};const Q=()=>{const{t:e}=h(),r={$all:e("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:r,formatRoleName:l=>{const a=(l||"").toLowerCase();return a.startsWith("$")?r[a]||a.slice(1):r[a]||a}}},X=(e,r=!1)=>{const n=r?1:.6;switch(e){case"owner":return`rgba(232, 222, 255, ${n})`;case"admin":return`rgba(227, 242, 253, ${n})`;case"member":return`rgba(232, 245, 233, ${n})`;case"guest":return`rgba(245, 245, 245, ${n})`;default:return`rgba(245, 245, 245, ${n})`}},Z=T($)(({role:e})=>({backgroundColor:X(e.toLowerCase()),color:"#000000"})),ee=e=>{switch(e){case"valid":return r=>r.palette.success.light;case"expired":return r=>r.palette.text.disabled;case"revoked":return r=>r.palette.error.light;default:return r=>r.palette.warning.light}},re=T($)(({theme:e,status:r})=>({backgroundColor:ee(r)(e),color:"#FFFFFF"}));function U({did:e}){return t.jsx(j,{size:14,responsive:!1,compact:!0,copyable:!1,did:e})}U.propTypes={did:s.string.isRequired};function I({timestamp:e,locale:r}){return t.jsx(g,{sx:{minWidth:"100px"},children:t.jsx(F,{value:e,locale:r})})}I.propTypes={timestamp:s.number.isRequired,locale:s.string.isRequired};function O({name:e="",role:r}){const{formatRoleName:n}=Q();return t.jsx(Z,{label:n(e||r),size:"small",role:e||r,sx:{borderRadius:1}})}O.propTypes={role:s.string.isRequired,name:s.string};function W({status:e}){const{t:r}=h();return t.jsx(re,{label:r(`team.passport.statusMap.${e}`),size:"small",status:e,sx:{borderRadius:1}})}W.propTypes={status:s.string.isRequired};function A({source:e}){const{t:r}=h();return e?r(`team.passport.sourceMaps.${e}`):"-"}A.propTypes={source:s.string.isRequired};function D({user:e,size:r="default",tooltip:n=!1,inService:l=!1}){const{teamDid:a}=K(),d=w.useMemo(()=>J(e.avatar,a,l),[e.avatar,a,l]),p=w.useMemo(()=>t.jsx(j,{did:e?.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[e?.did]),u=H(()=>({...e,avatar:d}),[e,d]);return r==="small"?t.jsx(C,{variant:"circular",logo:d,name:t.jsx(m,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:e.fullName||e.email}),...r==="small"?{tooltip:n?t.jsx(j,{did:e?.did}):!1,size:24}:{description:p,size:36}}):t.jsx(E,{user:u,avatarSize:r==="small"?24:36,cardType:V.Detailed,infoType:P.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})}D.propTypes={user:s.object.isRequired,size:s.string,tooltip:s.bool,inService:s.bool};const te=w.memo(D),ue=e=>t.jsx(U,{did:e}),me=(e,r)=>t.jsx(O,{name:e,role:r}),fe=e=>t.jsx(W,{status:e}),xe=(e,r)=>t.jsx(I,{timestamp:e,locale:r}),be=e=>t.jsx(A,{source:e}),ge=(e,r=!1)=>t.jsx(te,{user:e,inService:r}),we=e=>t.jsx(z,{ua:e});export{ge as a,fe as b,xe as c,be as d,we as e,ue as f,me as r,Q as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import{C as t}from"./vendor-utils-CxWN1dT3.js";import{I as s}from"./iframe-D119MMHU.js";import{c as e}from"./index-NWCpUGtr.js";import{S as m}from"./studio-BcQoXvqZ.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-jvAfFAl1.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B1iA4v4a.js";import"./index-CGrk0HiP.js";function L(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(m,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./vendor-mui-core-DnR6WYuU.js";import{$ as o}from"./user-center-BoGQKLvn.js";import{H as i}from"./index-NWCpUGtr.js";import{V as e}from"./vendor-ux-jvAfFAl1.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-hooks-qxhUUbW5.js";import"./vendor-utils-CxWN1dT3.js";import"./index-arhRQhsc.js";import"./arrow-down.svg-C4FUKwt4.js";import"./revoke.svg-CNl4LAbv.js";import"./index-uODjznr3.js";import"./index-bCC4mzZc.js";import"./vendor-arcblock-B1iA4v4a.js";import"./index-DdojJXSn.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BpWFE-ry.js";import"./lottie-web-4koyQiv_.js";function R(){const{t}=e();return r.jsxs(r.Fragment,{children:[r.jsx(i,{children:r.jsx("title",{children:t("pageTitle.userCenter")})}),r.jsx(o,{onlyProfile:!0,currentTab:"",disableAutoRedirect:!0})]})}export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as n,j as i,ak as l}from"./vendor-mui-core-DnR6WYuU.js";import{m as d,r as c}from"./vendor-react-CTtPmzVP.js";import{V as u,aL as h}from"./vendor-ux-jvAfFAl1.js";import g from"./index-D1f4dwYF.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./index-NWCpUGtr.js";import"./vendor-arcblock-B1iA4v4a.js";import"./confirm-BRnYfcDD.js";import"./index-DBs9Ljax.js";import"./session-5s-U-ruq.js";import"./did-address-B3eXeL7H.js";import"./empty-spinner-BYDonf35.js";import"./bundle-avatar-Dtpi1uSw.js";import"./shorten-label-C4py9TLA.js";import"./list-header-Cl3jykCe.js";import"./click-to-copy-BEM1P78p.js";import"./question-mark-circle.svg-CByEVDhb.js";import"./useSetState-L-f8mSga.js";import"./engine-D-_cbl3F.js";import"./api-FQQlzPOP.js";import"./vendor-mui-x-CQc01l4r.js";import"./react-beautiful-dnd.esm-BZjy3RlT.js";import"./raf-schd.esm-XXBRsnmf.js";import"./wait-connect-VFnD4S6k.js";import"./get-safe-url-xl2OarvZ.js";import"./item-BJSHAMwK.js";import"./delete-confirm-1vzcMsM2.js";import"./index-bCC4mzZc.js";import"./index-B0Q9wWG1.js";import"./index-CRAuhYSg.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function T(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as C}from"./vendor-react-CTtPmzVP.js";const r=e=>C.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},C.createElement("path",{d:"M9.92829 13.1334C9.66345 13.1334 9.43718 13.2175 9.2499 13.3853C9.06275 13.553 8.96862 13.756 8.96862 13.9953C8.96862 14.2651 9.06331 14.4767 9.2524 14.6307C9.44205 14.7847 9.66289 14.8624 9.91534 14.8624C10.172 14.8624 10.3959 14.7858 10.5875 14.6339C10.7789 14.4813 10.8746 14.2687 10.8746 13.9952C10.8746 13.7559 10.7831 13.5528 10.6 13.3852C10.4169 13.2177 10.1937 13.1334 9.92829 13.1334ZM12.6335 7.19985C12.3898 6.83002 12.0416 6.53427 11.5978 6.31997C11.1566 6.10763 10.6426 5.99999 10.0698 5.99999C9.45305 5.99999 8.90415 6.12893 8.43908 6.38333C7.97345 6.63815 7.61365 6.96509 7.36969 7.35497C7.12462 7.7468 7 8.14086 7 8.52656C7 8.73223 7.08577 8.92424 7.25398 9.09691C7.42302 9.27068 7.63328 9.35854 7.8789 9.35854C8.29803 9.35854 8.58362 9.11264 8.72899 8.6303C8.86141 8.23137 9.02474 7.92712 9.21355 7.7255C9.39123 7.53557 9.67946 7.43921 10.0698 7.43921C10.4065 7.43921 10.6721 7.53362 10.8829 7.72814C11.0906 7.92002 11.1916 8.14866 11.1916 8.42714C11.1916 8.56778 11.1588 8.69407 11.0929 8.81354C11.0229 8.93886 10.9356 9.05402 10.8335 9.1565C10.7256 9.26455 10.5475 9.42677 10.3041 9.64009C10.0206 9.88864 9.79183 10.1063 9.6253 10.287C9.45124 10.4749 9.31019 10.6957 9.20478 10.9431C9.09951 11.1922 9.04604 11.4895 9.04604 11.8272C9.04604 12.1153 9.12639 12.3384 9.28512 12.4903C9.44219 12.6407 9.63783 12.7172 9.86688 12.7172C10.3048 12.7172 10.5799 12.4779 10.6618 12.0301C10.7033 11.8439 10.7348 11.7138 10.7557 11.6399C10.7746 11.5727 10.802 11.5036 10.8373 11.4347C10.8715 11.3675 10.9257 11.2915 10.9988 11.2084C11.075 11.1205 11.1779 11.0175 11.304 10.9023C11.7759 10.4804 12.1088 10.1752 12.2935 9.99447C12.484 9.8083 12.6501 9.58426 12.7872 9.32916C12.9284 9.06808 13 8.76049 13 8.41587C13.0003 7.97989 12.8765 7.57038 12.6328 7.1993",fill:"currentColor"}),C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5ZM10 19C14.9706 19 19 14.9706 19 10C19 5.02944 14.9706 1 10 1C5.02944 1 1 5.02944 1 10C1 14.9706 5.02944 19 10 19Z",fill:"currentColor"}));export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./vendor-react-CTtPmzVP.js";const o=t=>e.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10C3.25 6.27208 6.27208 3.25 10 3.25C13.7279 3.25 16.75 6.27208 16.75 10C16.75 13.7279 13.7279 16.75 10 16.75C6.27208 16.75 3.25 13.7279 3.25 10ZM10 1.75C5.44365 1.75 1.75 5.44365 1.75 10C1.75 14.5564 5.44365 18.25 10 18.25C14.5563 18.25 18.25 14.5564 18.25 10C18.25 5.44365 14.5563 1.75 10 1.75ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L11.9697 13.0303C12.2626 13.3232 12.7374 13.3232 13.0303 13.0303C13.3232 12.7374 13.3232 12.2626 13.0303 11.9697L8.03033 6.96967Z"}));export{o as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v}from"./vendor-react-CTtPmzVP.js";import{D,n as B,j as t,W as r,ak as h,T as b,b4 as k,at as T,am as $,cs as O,ct as q}from"./vendor-mui-core-DnR6WYuU.js";import{B as V,p as Y}from"./dashboard-CDOqgUmx.js";import{V as L,au as Z,z as _,aP as J}from"./vendor-ux-jvAfFAl1.js";import{cm as w,al as C,Z as K,Y as P,r as f,bv as Q}from"./index-NWCpUGtr.js";import{H as X}from"./vendor-utils-CxWN1dT3.js";import{x as z}from"./index-DRYJ0xIl.js";import{B as N}from"./base-chart-ChBZtUEG.js";import{B as ee}from"./bundle-avatar-Dtpi1uSw.js";import"./vendor-arcblock-B1iA4v4a.js";import"./vendor-hooks-qxhUUbW5.js";import"./session-5s-U-ruq.js";import"./index-DBs9Ljax.js";import"./team-D9lFN8Pe.js";import"./isURL-CRZ7iI7F.js";import"./use-app-logo-Cfo-T8ZY.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./useSetState-L-f8mSga.js";import"./index-CGrk0HiP.js";import"./zh-LGxmNDus.js";import"./over-due-invoice-payment-DvKFY6t9.js";import"./useLocalStorage-Cl1rEjxs.js";import"./confirm-BRnYfcDD.js";import"./get-safe-url-xl2OarvZ.js";import"./passport-BNRZfcVH.js";import"./create-passport-svg-BKhJ2ufW.js";import"./spaces-BE9CZzeJ.js";import"./api-FQQlzPOP.js";import"./lottie-web-4koyQiv_.js";import"./index-D1SIrheh.js";function S({title:i="",cpus:y=[],currentLoad:s=0,history:p=[],empty:l=null,onHover:u=()=>{},hoverIndex:a=null}){const{t:d,locale:x}=L(),e=D(),n=`${i||d("common.cpu")} (${Math.floor(s||0)}%)`,o=100,m=80,c=H=>`${H}%`,M=[{max:m,color:B(e.palette.primary.main,e.palette.mode==="dark"?.15:.08)},{min:m,max:100,color:B(e.palette.warning.main,e.palette.mode==="dark"?.18:.12)},{min:100,color:B(e.palette.error.main,e.palette.mode==="dark"?.25:.18)}],j={silent:!0,symbol:["none","none"],data:[{yAxis:100,lineStyle:{color:e.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${c(100)}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:m,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${c(m)}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}}]},I=t.jsx("span",{children:`${d("system.cores")}: ${y?.length||0}`}),R=H=>w(Number(H),"HH:mm",x);return t.jsx(N,{title:n,total:o,history:p,valueFn:c,xAxisFormat:R,visualMapPieces:M,markLineData:j,extraInfo:I,empty:l,onHover:u,hoverIndex:a})}S.propTypes={title:r.string,cpus:r.array,currentLoad:r.number,history:r.array,empty:r.node,onHover:r.func,hoverIndex:r.number};function U({instanceCount:i=null,title:y="",total:s=null,used:p=null,history:l=[],empty:u=null,onHover:a=()=>{},hoverIndex:d=null}){const{t:x,locale:e}=L(),n=D(),o=!!s,m=s-p,c=o?`(${C(p)}, ${Math.floor(p/s*100)}%)`:"",M=`${y||x("common.memory")} ${c}`,j=Math.ceil(s*.8),I=g=>z(g,{short:!0,iec:!0}),R=[];i&&R.push({title:x("system.instances"),metric:i}),o&&R.push({title:x("system.free"),metric:I(m)});const H=[{max:j,color:B(n.palette.primary.main,n.palette.mode==="dark"?.15:.08)},{min:j,max:s,color:B(n.palette.warning.main,n.palette.mode==="dark"?.18:.12)},{min:s,color:B(n.palette.error.main,n.palette.mode==="dark"?.25:.18)}],F={silent:!0,symbol:["none","none"],data:[{yAxis:s,lineStyle:{color:n.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${I(s)}`,position:"insideEndTop",color:n.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:j,lineStyle:{color:n.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${I(j)}`,position:"insideEndTop",color:n.palette.text.secondary,padding:[2,4],borderRadius:2}}]},A=t.jsx(t.Fragment,{children:R.map((g,G)=>t.jsxs(h,{sx:{marginLeft:G===0?0:1,display:"inline-flex"},children:[g.title,": ",g.metric]},g.title))}),W=g=>w(Number(g),"HH:mm",e);return t.jsx(N,{title:M,total:s,history:l,valueFn:I,xAxisFormat:W,visualMapPieces:H,markLineData:F,extraInfo:A,empty:u,onHover:a,hoverIndex:d})}U.propTypes={title:r.string,instanceCount:r.number,total:r.number,used:r.number,history:r.array,empty:r.node,onHover:r.func,hoverIndex:r.number};function E({blocklet:i,cpuHistory:y=[],memoryHistory:s=[],...p}){const{t:l}=L(),{info:u}=K(),{runtimeHistory:a}=P(),[d,x]=v.useState(null),e=v.useCallback(o=>i.status!=="running"?t.jsx(b,{children:l("blocklet.runtimeInfo.noRunning")}):o.length?null:t.jsx(Z,{children:l("common.empty")}),[i.status,l]),n=v.useCallback(o=>{x(o)},[]);return a.length===0?t.jsx(b,{children:l("blocklet.runtimeInfo.noRunning")}):t.jsxs(te,{component:"div",...p,memoryHistory:s,cpuHistory:y,children:[t.jsxs(k,{className:"page-metrics",container:!0,spacing:5,children:[t.jsx(k,{sx:{pt:"16px !important"},size:12,children:t.jsx(b,{sx:{fontSize:"16px",fontWeight:"bold"},children:"CPU"})}),a?.map(o=>t.jsx(k,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:t.jsx(S,{title:`${o.name} CPU`,empty:e(o.cpu),currentLoad:o.appRuntimeInfo?.cpuUsage||0,cpus:o.appRuntimeInfo?.cpus||[],history:o.cpu,onHover:n,hoverIndex:d,style:{height:150}})},`${o.key}-cpu`))]}),t.jsxs(k,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[t.jsx(k,{sx:{pt:"16px !important"},size:12,children:t.jsx(b,{sx:{fontSize:"16px",fontWeight:"bold"},children:"Memory"})}),a?.map(o=>t.jsx(k,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:t.jsx(U,{title:`${o.name} Memory`,empty:e(o.memory),total:u.runtimeConfig?.blockletMaxMemoryLimit?z.parseSize(`${u.runtimeConfig.blockletMaxMemoryLimit*(o.key===i?.meta?.did?a.length-1:1)}MiB`):0,used:o.appRuntimeInfo?.memoryUsage||0,history:o.memory,onHover:n,hoverIndex:d,style:{height:150}})},`${o.key}-memory`))]})]})}E.propTypes={blocklet:r.object.isRequired,cpuHistory:r.arrayOf(r.shape({date:r.number,value:r.number})),memoryHistory:r.arrayOf(r.shape({date:r.number,value:r.number}))};const te=T(b)``;function Pe(){const{t:i,locale:y}=L(),[s,p]=v.useState(6),{blocklet:l,actions:{refreshBlocklet:u}}=P(),a=v.useMemo(()=>{const e=[];return f.forEachBlockletSync(l,(n,{ancestors:o,id:m,level:c})=>{n?.meta?.did&&n.meta.did!==l.meta.did&&e.push({type:"blocklet",groupId:l.meta.did,groupName:f.getDisplayName(l),id:m,name:f.getDisplayName(n,!0),blocklet:l,component:n,level:c-1>=0?c-1:0,runtimeInfo:n.runtimeInfo,ancestors:o})}),e},[l]);v.useEffect(()=>{u({hours:s});const e=setInterval(()=>{u({hours:s})},1e3*10);return()=>{clearInterval(e)}},[s]);const d=e=>Y(Number(e||0),{locale:Q(y)}),x=[{label:i("common.name"),name:"name",options:{customBodyRenderLite(e){const{name:n,component:o,level:m,ancestors:c}=a[e];return t.jsxs(h,{sx:{display:"flex",alignItems:"center",pl:m*2},children:[t.jsx(ee,{size:20,blocklet:o,ancestors:c}),t.jsx(h,{sx:{ml:1},children:n}),t.jsx(V,{variant:"pin",style:{marginLeft:8},status:f.isBlockletRunning(o)?"running":o.status,source:o.source,progress:o.progress})]})}}},{label:i("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?d(n?.uptime):t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?C(n?.memoryUsage||0):t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?`${(n?.cpuUsage||0).toFixed(1)}%`:t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(e){const{runtimeInfo:n}=a[e];return n?.uptime?t.jsxs(h,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(_,{icon:n?.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),t.jsx(h,{sx:{ml:1},children:n?.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:i("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?n?.pid:t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?n?.port:t.jsx($,{title:i("common.noData"),children:"--"})}}}];return t.jsxs(ne,{component:"div",children:[t.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2},children:[t.jsx(b,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:2},children:i("analytics.trend")}),t.jsx(O,{size:"small",exclusive:!0,value:s,onChange:(e,n)=>{X(n)&&p(n)},children:[1,3,6,12,24].map(e=>t.jsxs(q,{value:e,children:[e,"H"]},e))})]}),t.jsx(h,{children:t.jsx(E,{blocklet:l})}),t.jsx(h,{sx:{mt:3},children:t.jsx(J,{title:i("analytics.detail"),className:"monitor-table",locale:y,data:a,columns:x,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}const ne=T(b)``;export{Pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as o}from"./index-NWCpUGtr.js";const e=o();export{e as b};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{V as X,z as q,aU as oe,H as _,aL as de,w as ue,aP as me,aX as We}from"./vendor-ux-jvAfFAl1.js";import{g as te,q as K,b as S,a as fe,h as ve}from"./vendor-hooks-qxhUUbW5.js";import{r as A}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as b,am as O,I as L,bn as J,W as g,D as ne,z as D,A as Fe,Q as G,T as Ne,e1 as Le,e2 as Ve,M as Me,y as V,b$ as Q,bX as M,a5 as Y,F as Ue,U as $e,c5 as Xe,a7 as Ze,co as Ge,bW as Ce,bY as Pe,b6 as Ye,at as Ke}from"./vendor-mui-core-DnR6WYuU.js";import{Y as se,Z as re,c as T,aD as pe,cs as je}from"./index-NWCpUGtr.js";import{n as $,V as ee,I as Z,aA as Je,C as Qe,G as be,aB as ge,c as U,o as Se}from"./vendor-utils-CxWN1dT3.js";import{d as he,a as xe}from"./edit-rounded-CnMn6J-D.js";import{u as ye,C as N}from"./index.esm-Co8ZxFyk.js";import{S as ie}from"./simple-select-EppOca29.js";import{b as we}from"./team-D9lFN8Pe.js";import{l as eo}from"./arrow-down.svg-C4FUKwt4.js";import{A as He}from"./config-DOcJbRFr.js";import{u as oo}from"./use-mobile-BINJTzMb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B1iA4v4a.js";import"./session-5s-U-ruq.js";import"./isURL-CRZ7iI7F.js";import"./use-app-logo-Cfo-T8ZY.js";const to={width:24,height:24,body:'<path fill="currentColor" d="M11 14.2V6q0-.425.288-.713T12 5q.425 0 .713.288T13 6v8.2l2.9-2.9q.275-.275.7-.275t.7.275q.275.275.275.7t-.275.7l-4.6 4.6q-.3.3-.7.3t-.7-.3l-4.6-4.6q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l2.9 2.9Z"/>'},no={width:24,height:24,body:'<path fill="currentColor" d="m11 8.8l-2.9 2.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L13 8.8V17q0 .425-.288.713T12 18q-.425 0-.713-.288T11 17V8.8Z"/>'};function Re({enabled:o,showUp:t=!0,showDown:c=!0,showSwitch:r=!0,showDelete:n=!0,showEdit:l=!0,disableEdit:u=!1,disableSwitch:a=!1,onClickUp:i=()=>{},onClickDown:s=()=>{},onClickSwitch:f=()=>{},onClickDelete:h=()=>{},onClickEdit:H=()=>{}}){const{t:j}=X();return e.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:0},onClick:k=>k.stopPropagation(),children:[l?e.jsx(O,{title:j("common.edit"),children:e.jsx(L,{size:"small",onClick:H,color:"success",disabled:u,children:e.jsx(q,{icon:he,fontSize:18})})}):null,n?e.jsx(O,{title:j("common.delete"),children:e.jsx(L,{size:"small",onClick:h,color:"error",children:e.jsx(q,{icon:xe,fontSize:18})})}):null,r?e.jsx(O,{title:j(o?"common.enabled":"common.disabled"),children:e.jsx(J,{size:"small",checked:o,onClick:f,disabled:a})}):null,t?e.jsx(O,{title:j("common.moveUp"),children:e.jsx(L,{size:"small",onClick:i,disabled:u,children:e.jsx(q,{icon:no,fontSize:20})})}):null,c?e.jsx(O,{title:j("common.moveDown"),children:e.jsx(L,{size:"small",onClick:s,disabled:u,children:e.jsx(q,{icon:to,fontSize:20})})}):null]})}Re.propTypes={enabled:g.bool.isRequired,showUp:g.bool,showDown:g.bool,showSwitch:g.bool,showDelete:g.bool,showEdit:g.bool,disableEdit:g.bool,disableSwitch:g.bool,onClickUp:g.func,onClickDown:g.func,onClickSwitch:g.func,onClickDelete:g.func,onClickEdit:g.func};function Te({ref:o=null}){const{t}=A.useContext(oe),{blocklet:c}=se(),{api:r}=re(),n=c?.meta?.did,u=ne()?.transitions?.duration?.leavingScreen||300,a=te({mode:"add",show:!1,isDefaultRule:!1,callback:$,loadingButton:!1,get dialogTitle(){return this.mode==="edit"?t("securityRule.edit"):this.mode==="view"?t("securityRule.view"):t("securityRule.add")}}),i=K(async()=>{const{accessPolicies:p}=await r.getBlockletAccessPolicies({input:{did:n}});return ee(p,y=>y.isProtected?1:0)},{manual:!0}),s=K(async()=>{const{responseHeaderPolicies:p}=await r.getBlockletResponseHeaderPolicies({input:{did:n}});return ee(p,y=>y.isProtected?1:0)},{manual:!0}),{handleSubmit:f,control:h,watch:H,setValue:j,getValues:k,reset:E,formState:{errors:B}}=ye({mode:"onChange",defaultValues:{componentDid:"",pathPattern:"",responseHeaderPolicyId:"",accessPolicyId:"",remark:""}}),F=S(()=>{E(),a.mode="add"}),z=S(()=>{a.show=!1,setTimeout(()=>{F()},u)}),x=S((p,y=null)=>{a.loadingButton=!1,a.show=!0,y&&(a.isDefaultRule=y.id===T.SECURITY_RULE_DEFAULT_ID,a.mode="edit",j("componentDid",y.componentDid),j("pathPattern",y.pathPattern),j("responseHeaderPolicyId",y.responseHeaderPolicyId),j("accessPolicyId",y.accessPolicyId),j("remark",y.remark||"")),p?a.callback=p:a.mode="view",i.run(),s.run()});A.useImperativeHandle(o,()=>({open:x,close:z}),[x,z]);const d=S(()=>{const[p,y]=k(["accessPolicyId","responseHeaderPolicyId"]);return!p&&!y?t("securityRule.form.accessPolicyOrResponseHeaderPolicyRequired"):!0}),C=S(()=>{a.loadingButton=!1}),m=S(p=>{const y=d();if(y===!0){const le=a.isDefaultRule?Z(p,"componentDid"):p;a.loadingButton=!0,a.callback(le,{close:z,done:C})}else _.error(y)}),R=H("componentDid"),I=S(p=>{const y=p?.trim();if(!y)return t("common.requiredErrorText",{name:t("securityRule.form.pathPattern")});if(R){if(y.startsWith("/"))return t("securityRule.form.pathPatternErrorText")}else if(!y.startsWith("/")&&y!=="*")return t("securityRule.form.pathPatternErrorText");return!0}),v=S(p=>p?.trim()?!0:t("common.requiredErrorText",{name:t("securityRule.form.accessPolicy")})),P=S(p=>p?.trim()?!0:t("common.requiredErrorText",{name:t("securityRule.form.responseHeaderPolicy")})),w=fe(()=>{const y=(c?.children||[]).find(le=>le.meta.did===R);return y?.mountPoint?Je(y.mountPoint):null},[c,R]);return e.jsx(de,{open:a.show,title:a.dialogTitle,onClose:z,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(ue,{color:"primary",autoFocus:!0,variant:"contained",loading:a.loadingButton,loadingPosition:"start",onClick:f(m),children:t("common.confirm")}),children:e.jsxs("form",{noValidate:!0,autoComplete:"off",children:[a.isDefaultRule?null:e.jsx(N,{name:"componentDid",control:h,render:({field:p})=>e.jsx(ie,{fullWidth:!0,margin:"dense",size:"small",label:t("securityRule.form.component"),placeholder:t("securityRule.form.componentPlaceholder"),options:c.children.map(y=>({title:y.meta.title,value:y.meta.did,description:y.mountPoint})),error:!!B?.componentDid?.message,helperText:B?.componentDid?.message||"Choose belong to component",...Z(p,"ref"),readOnly:a.mode==="view"})}),e.jsx(N,{name:"pathPattern",control:h,rules:{validate:I},render:({field:p})=>e.jsx(D,{fullWidth:!0,required:!0,margin:"dense",size:"small",placeholder:t("securityRule.form.pathPatternPlaceholder"),label:t("securityRule.form.pathPattern"),error:!!B?.pathPattern?.message,helperText:B?.pathPattern?.message||"/abc/bcd or /abc or /abc/*",...p,disabled:a.isDefaultRule||a.mode==="view",slotProps:{input:{startAdornment:w?e.jsx(Fe,{position:"start",children:w}):null}}})}),e.jsx(N,{name:"accessPolicyId",control:h,rules:{validate:a.isDefaultRule?v:$},render:({field:p})=>e.jsx(ie,{fullWidth:!0,required:a.isDefaultRule,margin:"dense",size:"small",label:t("securityRule.form.accessPolicy"),placeholder:t("securityRule.form.accessPolicyPlaceholder"),options:(i.data||[]).map(y=>({value:y.id,title:y.name,description:y.description})),error:!!B?.accessPolicyId?.message,helperText:B?.accessPolicyId?.message||t("securityRule.form.accessPolicyHelperText"),...Z(p,"ref"),disabled:a.mode==="view"})}),e.jsx(N,{name:"responseHeaderPolicyId",control:h,rules:{validate:a.isDefaultRule?P:$},render:({field:p})=>e.jsx(ie,{fullWidth:!0,required:a.isDefaultRule,margin:"dense",size:"small",label:t("securityRule.form.responseHeaderPolicy"),placeholder:t("securityRule.form.responseHeaderPolicyPlaceholder"),options:(s.data||[]).map(y=>({title:y.name,value:y.id,description:y.description})),error:!!B?.responseHeaderPolicyId?.message,helperText:B?.responseHeaderPolicyId?.message||t("securityRule.form.responseHeaderPolicyHelperText"),...Z(p,"ref"),disabled:a.mode==="view"})}),e.jsx(N,{name:"remark",control:h,render:({field:p})=>e.jsx(D,{fullWidth:!0,multiline:!0,minRows:3,maxRows:7,size:"small",margin:"dense",placeholder:t("securityRule.form.remarkPlaceholder"),label:t("securityRule.form.remark"),helperText:B?.message,...p,disabled:a.mode==="view"})})]})})}Te.propTypes={ref:g.any};const W=async(o,t="Failed to saved")=>{try{await o()}catch(c){_.error(c?.message||t)}};function so(){const{t:o,locale:t}=X(),{blocklet:c}=se(),{api:r}=re(),n=c?.meta?.did,l=ne(),u=A.useRef(null),a=A.useRef(null),{confirmApi:i,confirmHolder:s}=pe(),f=K(async()=>{const{securityRules:v}=await r.getBlockletSecurityRules({input:{did:n,includeDisabled:!0}});return v}),h=v=>v.id===T.SECURITY_RULE_DEFAULT_ID,H=S(v=>(c?.children||[]).find(w=>w.meta.did===v)?.mountPoint),j=(f.data||[]).map(v=>{if(v.componentDid){const P=H(v.componentDid);v._disabled=P===void 0}return v}),k=j.filter(v=>!h(v)),E=S((v,P)=>{W(async()=>{const w=v.target.checked;await r.updateBlockletSecurityRule({input:{did:n,data:{id:P.id,enabled:w}}}),_.success(o("common.succeeded")),f.run()})}),B=S((v,P,w)=>{W(async()=>{const p=w-1,y=j[p];await Promise.all([r.updateBlockletSecurityRule({input:{did:n,data:{id:P.id,priority:y.priority}}}),r.updateBlockletSecurityRule({input:{did:n,data:{id:y.id,priority:P.priority}}})]),_.success(o("common.succeeded")),f.run()})}),F=S((v,P,w)=>{W(async()=>{const p=w+1,y=j[p];await Promise.all([r.updateBlockletSecurityRule({input:{did:n,data:{id:P.id,priority:y.priority}}}),r.updateBlockletSecurityRule({input:{did:n,data:{id:y.id,priority:P.priority}}})]),_.success(o("common.succeeded")),f.run()})}),z=S(()=>{u.current.open(async(v,{close:P,done:w})=>{await W(async()=>{await r.addBlockletSecurityRule({input:{did:n,data:v}}),_.success(o("common.succeeded")),f.run(),P()}),w()})}),x=S((v,P)=>{u.current.open(async(w,{close:p,done:y})=>{await W(async()=>{await r.updateBlockletSecurityRule({input:{did:n,data:{...w,id:P.id}}}),_.success(o("common.succeeded")),f.run(),p()}),y()},P)}),d=S((v,P)=>{i.open({title:o("securityRule.delete.title"),content:o("securityRule.delete.description"),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),onConfirm(w){W(async()=>{await r.deleteBlockletSecurityRule({input:{did:n,id:P.id}}),_.success(o("common.succeeded")),f.run(),w()})}})}),C=S(v=>{u.current.open((P,{close:w,done:p})=>{p(),w()},v)}),m={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(v,{dataIndex:P},w){if(a.current?.contains(w.target)){const p=j[P];C(p)}},setRowProps:(v,P)=>j[P]._disabled?{title:o("securityRule.useless"),style:{backgroundColor:l.palette.action.disabledBackground,cursor:"default"}}:{}},R=[e.jsx(G,{size:"small",variant:"outlined",onClick:()=>{f.run()},sx:{mr:1},children:o("common.refresh")},"refresh"),e.jsx(G,{size:"small",variant:"contained",onClick:z,children:o("common.add")})],I=[{label:o("securityRule.form.pathPattern"),name:"pathPattern",options:{customBodyRenderLite(v){const P=j[v];return e.jsx(b,{sx:{whiteSpace:"nowrap"},children:P.id===T.SECURITY_RULE_DEFAULT_ID?"Default":Qe(H(P.componentDid),P.pathPattern)})}}},{label:o("responseHeaderPolicy.title"),name:"responseHeaderPolicy",options:{customBodyRenderLite(v){return j[v].responseHeaderPolicy?.name}}},{label:o("accessPolicy.title"),name:"accessPolicyId",options:{customBodyRenderLite(v){return j[v].accessPolicy?.name}}},{label:o("securityRule.form.remark"),name:"remark"},{label:o("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(v){const P=j[v],w=h(P);return e.jsx(Re,{disableEdit:P._disabled,disableSwitch:P._disabled,enabled:P.enabled,showSwitch:!w,showDelete:!w,showUp:v>0&&!w,showDown:v<k.length-1&&!w,onClickSwitch:p=>{E(p,P,v)},onClickUp:p=>{B(p,P,v)},onClickDown:p=>{F(p,P,v)},onClickEdit:p=>{x(p,P,v)},onClickDelete:p=>{d(p,P,v)}})}}}].filter(Boolean);return e.jsxs(b,{sx:{display:"flex",flexDirection:"column",gap:2},ref:a,children:[e.jsx(me,{verticalKeyWidth:100,locale:t,title:e.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:1},children:[o("securityRule.title")," ",e.jsx(Ne,{variant:"body2",children:o("securityRule.sortByDescription")})]}),data:j,columns:I,customButtons:R,options:m,loading:f.loading}),e.jsx(Te,{ref:u}),s]})}const ke={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm0-2h14V7H5v12Zm7-2q-2.05 0-3.663-1.113T6 13q.725-1.775 2.337-2.888T12 9q2.05 0 3.663 1.113T18 13q-.725 1.775-2.337 2.888T12 17Zm0-2.5q-.625 0-1.063-.438T10.5 13q0-.625.438-1.063T12 11.5q.625 0 1.063.438T13.5 13q0 .625-.438 1.063T12 14.5Zm0 1q1.05 0 1.775-.725T14.5 13q0-1.05-.725-1.775T12 10.5q-1.05 0-1.775.725T9.5 13q0 1.05.725 1.775T12 15.5Z"/>'};function Ae({value:o,onChange:t,...c}){const r="roles",n="roles_reverse",{t:l,locale:u}=X(),a=[...He,{value:r,icon:Le,title:{zh:"指定通行证可访问",en:"Accessible to selected passports"},description:{zh:"只有指定的通行证可以访问",en:"Only specified passports can access"}},{value:n,icon:Ve,title:{zh:"指定通行证不可以访问",en:"Accessible to not selected passports"},description:{zh:"只有指定的通行证不可以访问",en:"Only specified passports can't access"}}];return e.jsx(D,{...c,label:l("blocklet.config.access.description"),select:!0,fullWidth:!0,value:o,onChange:t,sx:{"& .MuiInputBase-input":{width:"calc(100% - 46px)","& > .MuiBox-root:first-of-type":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},slotProps:{select:{renderValue:i=>{const s=a.find(f=>f.value===i);return s?e.jsxs(b,{children:[e.jsx(b,{component:s.icon,sx:{mr:1,fontSize:18,verticalAlign:"text-bottom",color:"text.secondary"}}),s.title[u]||s.title.en]}):null},IconComponent:i=>e.jsx(eo,{...i,width:20,height:20})}},children:a.map(i=>e.jsxs(Me,{value:i.value,sx:{display:"block","& .tip":{fontSize:"12px",color:`${({theme:s})=>s.palette.text.secondary}`}},children:[e.jsxs(b,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(b,{component:i.icon,sx:{mr:1,fontSize:18,verticalAlign:"text-bottom",color:"text.secondary"}}),e.jsx(b,{children:i.title[u]||i.title.en})]}),e.jsx(b,{className:"tip",children:i.description[u]||i.description.en})]}))})}Ae.propTypes={value:g.string,onChange:g.func};const Be=o=>{const t={name:o.name,description:o.description},{roles:c=null,reverse:r}=o;return c===null?r===!1&&(t.whoCanAccess=T.WHO_CAN_ACCESS.ALL,t.roles=null):c.length===0&&r===!0?(t.whoCanAccess=T.WHO_CAN_ACCESS.INVITED,t.roles=[]):ge(c,[T.WHO_CAN_ACCESS.OWNER])&&r===!1?(t.whoCanAccess=T.WHO_CAN_ACCESS.OWNER,t.roles=[T.WHO_CAN_ACCESS.OWNER]):ge(c,[T.WHO_CAN_ACCESS.OWNER,T.WHO_CAN_ACCESS.ADMIN])&&r===!1?(t.whoCanAccess=T.WHO_CAN_ACCESS.ADMIN,t.roles=[T.WHO_CAN_ACCESS.OWNER,T.WHO_CAN_ACCESS.ADMIN]):(t.whoCanAccess=r?"roles_reverse":"roles",t.roles=c),t},ro=o=>{const t={name:o.name,description:o.description},{roles:c=null,whoCanAccess:r}=o;return r==="roles"?(t.roles=c,t.reverse=!1):r==="roles_reverse"?(t.roles=c,t.reverse=!0):r===T.WHO_CAN_ACCESS.ALL?(t.roles=null,t.reverse=!1):r===T.WHO_CAN_ACCESS.INVITED?(t.roles=[],t.reverse=!0):r===T.WHO_CAN_ACCESS.OWNER?(t.roles=[T.WHO_CAN_ACCESS.OWNER],t.reverse=!1):r===T.WHO_CAN_ACCESS.ADMIN&&(t.roles=[T.WHO_CAN_ACCESS.OWNER,T.WHO_CAN_ACCESS.ADMIN],t.reverse=!1),t},lo=o=>o instanceof Object?{origin:o.origin?{override:o.origin?.override??!0,value:o.origin?.value?.join(`
|
|
2
|
-
`),smart:o.origin?.smart??!0}:void 0,methods:o.methods,allowedHeaders:o.allowedHeaders?{override:o.allowedHeaders?.override??!0,value:o.allowedHeaders?.value?.join(`
|
|
3
|
-
`)}:void 0,exposedHeaders:o.exposedHeaders?{override:o.exposedHeaders?.override??!0,value:o.exposedHeaders?.value?.join(`
|
|
4
|
-
`)}:void 0,maxAge:o.maxAge,optionsSuccessStatus:o.optionsSuccessStatus,preflightContinue:o.preflightContinue,credentials:o.credentials}:void 0,io=o=>o instanceof Object?{origin:{override:o.origin?.override,value:o.origin?.value?.split(`
|
|
5
|
-
`).filter(c=>c),smart:o.origin?.smart},methods:o.methods,allowedHeaders:{override:o.allowedHeaders?.override,value:o.allowedHeaders?.value?.split(`
|
|
6
|
-
`).filter(c=>c)},exposedHeaders:{override:o.exposedHeaders?.override,value:o.exposedHeaders?.value?.split(`
|
|
7
|
-
`).filter(c=>c)},maxAge:o.maxAge,optionsSuccessStatus:o.optionsSuccessStatus,preflightContinue:o.preflightContinue,credentials:o.credentials}:void 0,co=o=>o instanceof Object?{contentSecurityPolicy:o.contentSecurityPolicy,referrerPolicy:o.referrerPolicy,xFrameOptions:o.xFrameOptions,xPoweredBy:o.xPoweredBy,xXssProtection:o.xXssProtection}:void 0,ao=o=>o instanceof Object?{contentSecurityPolicy:o.contentSecurityPolicy,referrerPolicy:o.referrerPolicy,xFrameOptions:o.xFrameOptions,xPoweredBy:o.xPoweredBy,xXssProtection:o.xXssProtection}:void 0,uo=o=>{const t=be(o);if(o.securityHeader)try{t.securityHeader=JSON.parse(o.securityHeader)}catch{t.securityHeader=null}if(o.cors)try{t.cors=JSON.parse(o.cors)}catch{t.cors=null}return t};function Ie({ref:o=null}){const{t}=A.useContext(oe),{roles:c}=we(),n=ne()?.transitions?.duration?.leavingScreen||300,l=te({mode:"add",show:!1,loadingButton:!1,callback:$,get dialogTitle(){return this.mode==="edit"?t("accessPolicy.edit"):this.mode==="view"?t("accessPolicy.view"):t("accessPolicy.add")}}),{handleSubmit:u,control:a,watch:i,setValue:s,reset:f,formState:{errors:h}}=ye({mode:"onChange",defaultValues:{name:"",description:"",roles:null,whoCanAccess:"all"}}),H=S(()=>{f(),l.mode="add"}),j=S(()=>{l.show=!1,setTimeout(()=>{H()},n)}),k=S((m=$,R=null)=>{if(l.callback=m,l.loadingButton=!1,l.show=!0,R){R.id?l.mode="edit":l.mode="view";const I=Be(R);s("name",I.name),s("description",I.description),s("roles",I.roles),s("whoCanAccess",I.whoCanAccess)}});A.useImperativeHandle(o,()=>({open:k,close:j}),[k,j]);const E=S(()=>{l.loadingButton=!1}),B=S(m=>{l.loadingButton=!0,l.callback(ro(m),{close:j,done:E})}),F=S(m=>m?.trim()?!0:t("common.requiredErrorText",{name:t("accessPolicy.form.name")})),z=i("whoCanAccess"),x=l.mode==="view",d=S(m=>["roles","roles_reverse"].includes(z)&&(!m||m?.length===0)?t("common.requiredErrorText",{name:t("accessPolicy.form.roles")}):!0),C=S(m=>m?.trim()?!0:t("common.requiredErrorText",{name:t("accessPolicy.form.accessType")}));return e.jsx(de,{open:l.show,title:l.dialogTitle,onClose:j,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(ue,{color:"primary",autoFocus:!0,variant:"contained",onClick:u(B),loading:l.loadingButton,loadingPosition:"start",children:t("common.confirm")}),children:e.jsxs("form",{noValidate:!0,autoComplete:"off",children:[e.jsx(N,{name:"name",control:a,rules:{validate:F},render:({field:m})=>e.jsx(D,{fullWidth:!0,required:!0,margin:"dense",size:"small",disabled:x,placeholder:t("accessPolicy.form.namePlaceholder"),label:t("accessPolicy.form.name"),error:!!h?.name?.message,helperText:h?.name?.message||" ",...m})}),e.jsx(N,{name:"whoCanAccess",control:a,rules:{validate:C},render:({field:m})=>e.jsx(Ae,{required:!0,size:"small",margin:"dense",disabled:x,error:!!h?.whoCanAccess?.message,helperText:h?.whoCanAccess?.message||" ",...m})}),["roles","roles_reverse"].includes(z)?e.jsx(N,{name:"roles",rules:{validate:d},control:a,render:({field:m})=>e.jsxs(V,{variant:"standard",error:!!h?.roles?.message,children:[e.jsx(Q,{sx:{display:"flex",flexDirection:"row",mt:-3},children:c.map(R=>e.jsx(M,{control:e.jsx(Y,{disabled:x,size:"small",checked:m.value?.includes(R.name),sx:{p:.75},onChange:(I,v)=>{const P=m.value||[];v?m.onChange([...P,R.name]):m.onChange(P.filter(w=>w!==R.name))}}),label:R.title},R.name))}),e.jsx(Ue,{sx:{transform:"translateY(-8px)"},children:h?.roles?.message||" "})]})}):null,e.jsx(N,{name:"description",control:a,render:({field:m})=>e.jsx(D,{fullWidth:!0,multiline:!0,disabled:x,minRows:3,maxRows:7,margin:"dense",size:"small",placeholder:t("accessPolicy.form.descriptionPlaceholder"),label:t("accessPolicy.form.description"),helperText:h?.message,...m})})]})})}Ie.propTypes={ref:g.any};function mo(){const{t:o,locale:t}=X(),{blocklet:c}=se(),{api:r}=re(),{roles:n}=we(),l=c?.meta?.did,u=A.useRef(null),a=A.useRef(null),{confirmApi:i,confirmHolder:s}=pe(),f=()=>{},h=K(async()=>{const{accessPolicies:d}=await r.getBlockletAccessPolicies({input:{did:l}});return ee(d,C=>C.isProtected?1:0)}),H=h.data||[],j=S(()=>{a.current.open(async(d,{close:C,done:m})=>{await W(async()=>{await r.addBlockletAccessPolicy({input:{did:l,data:d}}),_.success(o("common.succeeded")),h.run(),C()}),m()})}),k=S(d=>{a.current.open(async(C,{close:m,done:R})=>{await W(async()=>{await r.updateBlockletAccessPolicy({input:{did:l,data:{...C,id:d.id}}}),_.success(o("common.succeeded")),h.run(),m()}),R()},d)}),E=S(d=>{a.current.open((C,{close:m,done:R})=>{R(),m()},Z(d,["id"]))}),B=S(d=>{i.open({title:o("accessPolicy.delete.title"),content:o("accessPolicy.delete.description"),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),onConfirm(C){W(async()=>{await r.deleteBlockletAccessPolicy({input:{did:l,id:d.id}}),_.success(o("common.succeeded")),h.run(),C()})}})}),F={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(d,{dataIndex:C},m){if(u.current?.contains(m.target)){const R=H[C];E(R)}}},z=[e.jsx(G,{size:"small",variant:"outlined",onClick:()=>{h.run()},sx:{mr:1},children:o("common.refresh")},"refresh"),e.jsx(G,{size:"small",variant:"contained",onClick:j,children:o("common.add")})],x=[{label:o("accessPolicy.form.name"),name:"name",options:{customBodyRenderLite(d){const C=H[d],m=C.isProtected?e.jsx(O,{title:"Built-in policy, can't edit",children:e.jsx(b,{component:q,icon:je,sx:{fontSize:16}})}):null;return e.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:.5},children:[m," ",C.name]})}}},{label:o("accessPolicy.form.roles"),name:"roles",options:{customBodyRenderLite(d){const C=H[d],m=Be(C);if([T.WHO_CAN_ACCESS.ALL,T.WHO_CAN_ACCESS.INVITED].includes(m.whoCanAccess)){const I=He.find(v=>v.value===m.whoCanAccess);return I.title?.[t]||I.title?.en}const R=n.filter(I=>C.reverse?!m.roles?.includes(I.name):m.roles?.includes(I.name));return e.jsx(b,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:R.map(I=>e.jsx(O,{title:I.description,children:e.jsx($e,{size:"small",label:I.title},I.name)}))})}}},{label:o("accessPolicy.form.description"),name:"description"},{label:o("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(d){const C=H[d];return e.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:0},onClick:m=>m.stopPropagation(),children:[C.isProtected?e.jsx(O,{title:o("common.view"),children:e.jsx(L,{size:"small",onClick:()=>{E(C,d)},children:e.jsx(q,{icon:ke,fontSize:18})})}):null,C.isProtected?null:e.jsx(O,{title:o("common.edit"),children:e.jsx(L,{size:"small",onClick:()=>{k(C,d)},color:"success",children:e.jsx(q,{icon:he,fontSize:18})})}),C.isProtected?null:e.jsx(O,{title:o("common.delete"),children:e.jsx(L,{size:"small",onClick:()=>{B(C,d)},color:"error",children:e.jsx(q,{icon:xe,fontSize:18})})})]})}}}].filter(Boolean);return e.jsxs(b,{sx:{display:"flex",flexDirection:"column",gap:2},ref:u,children:[e.jsx(me,{verticalKeyWidth:100,locale:t,title:o("accessPolicy.title"),data:H,columns:x,customButtons:z,options:F,loading:h.loading,onChange:f}),e.jsx(Ie,{ref:a}),s]})}const fo={width:24,height:24,body:'<path fill="currentColor" d="m12 15.375l-6-6l1.4-1.4l4.6 4.6l4.6-4.6l1.4 1.4l-6 6Z"/>'};function ce({title:o,actions:t,children:c=null,defaultValue:r=!0,value:n,onChange:l,showExpand:u=!0}){const a=!U(n),i=te({open:r}),s=fe(()=>a?n:i.open,[n,a,i.open]),f=S(()=>{a?l(!s):i.open=!i.open});return e.jsxs(Xe,{variant:"outlined",children:[e.jsxs(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",px:2,py:1,backgroundColor:"grey.50"},onClick:f,children:[e.jsx(b,{sx:{fontWeight:"bold"},children:o}),e.jsxs(b,{sx:{display:"flex",alignItems:"center"},children:[t,u?e.jsx(b,{component:q,icon:fo,sx:{transform:s?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease",fontSize:"2rem"}}):null]})]}),e.jsx(Ze,{in:s,children:e.jsx(Ge,{children:c})})]})}ce.propTypes={title:g.string.isRequired,defaultValue:g.bool,value:g.bool,actions:g.node,children:g.node,onChange:g.func,showExpand:g.bool};const ae={width:24,height:24,body:'<path fill="currentColor" d="M11.95 18q.525 0 .888-.363t.362-.887q0-.525-.362-.888t-.888-.362q-.525 0-.887.363t-.363.887q0 .525.363.888t.887.362Zm.05 4q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22Zm0-2q3.35 0 5.675-2.325T20 12q0-3.35-2.325-5.675T12 4Q8.65 4 6.325 6.325T4 12q0 3.35 2.325 5.675T12 20Zm0-8Zm.1-4.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.938t.75-.787q.575-.55.988-1.2t.412-1.45q0-1.275-1.038-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.113.638t.338.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2Z"/>'};function Oe({config:o={},onChange:t=()=>{},disabled:c=!1}){const r=["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],n={origin:{override:!1,value:"*",smart:!0},methods:{override:!1,value:[...r]},allowedHeaders:{override:!1,value:"*"},exposedHeaders:{override:!1,value:"*"},maxAge:{override:!1,value:void 0},optionsSuccessStatus:{override:!1,value:204},preflightContinue:{override:!1,value:!1},credentials:{override:!1,value:!1},...Se(o,U)},{t:l}=X(),u=(s,{override:f,value:h,smart:H})=>{const j={...n?.[s]};!U(H)&&s==="origin"&&(j.smart=H),U(f)||(j.override=f),U(h)||(j.value=h),t({...n,[s]:j})},a=[{title:l("responseHeaderPolicy.form.cors.origin"),override:n.origin.override,smart:n.origin.smart,name:"origin",required:!0,value:n.origin.value,content:e.jsx(V,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{multiline:!0,minRows:4,maxRows:10,disabled:c,variant:"outlined",size:"small",placeholder:l("responseHeaderPolicy.form.cors.originPlaceholder"),helperText:l("responseHeaderPolicy.form.cors.originHelperText"),value:n.origin.value,onChange:s=>{u("origin",{value:s.target.value})}})})},{title:l("responseHeaderPolicy.form.cors.methods"),name:"methods",override:n.methods.override,required:!0,value:n.methods.value,content:e.jsx(Q,{sx:{flexDirection:"row"},children:r.map(s=>e.jsx(M,{control:e.jsx(Y,{size:"small",disabled:c,checked:n.methods.value.includes(s),onChange:(f,h)=>{u("methods",{value:h?[...n.methods.value,s]:n.methods.value.filter(H=>H!==s)})}}),label:s},s))})},{title:l("responseHeaderPolicy.form.cors.allowedHeaders"),override:n.allowedHeaders.override,name:"allowedHeaders",value:n.allowedHeaders.value,content:e.jsx(V,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{multiline:!0,minRows:3,maxRows:7,disabled:c,variant:"outlined",size:"small",placeholder:l("responseHeaderPolicy.form.cors.allowedHeadersPlaceholder"),helperText:l("responseHeaderPolicy.form.cors.allowedHeadersHelperText"),value:n.allowedHeaders.value,onChange:s=>{u("allowedHeaders",{value:s.target.value})}})})},{title:l("responseHeaderPolicy.form.cors.exposedHeaders"),override:n.exposedHeaders.override,name:"exposedHeaders",value:n.exposedHeaders.value,content:e.jsx(V,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{multiline:!0,minRows:3,maxRows:7,disabled:c,variant:"outlined",size:"small",placeholder:l("responseHeaderPolicy.form.cors.exposedHeadersPlaceholder"),helperText:l("responseHeaderPolicy.form.cors.exposedHeadersHelperText"),value:n.exposedHeaders.value,onChange:s=>{u("exposedHeaders",{value:s.target.value})}})})},{title:l("responseHeaderPolicy.form.cors.maxAge"),override:n.maxAge.override,name:"maxAge",value:n.maxAge.value,content:e.jsx(V,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{type:"number",variant:"outlined",size:"small",disabled:c,value:n.maxAge.value,onChange:s=>{u("maxAge",{value:s.target.value})},helperText:l("responseHeaderPolicy.form.cors.maxAgeHelperText")})})},{title:l("responseHeaderPolicy.form.cors.optionsSuccessStatus"),override:n.optionsSuccessStatus.override,name:"optionsSuccessStatus",value:n.optionsSuccessStatus.value,content:e.jsx(V,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{type:"number",variant:"outlined",size:"small",disabled:c,value:n.optionsSuccessStatus.value,onChange:s=>{u("optionsSuccessStatus",{value:s.target.value})}})})},{title:l("responseHeaderPolicy.form.cors.preflightContinue"),override:n.preflightContinue.override,name:"preflightContinue",value:n.preflightContinue.value,control:e.jsx(J,{size:"small",disabled:c,checked:n.preflightContinue.value,onChange:(s,f)=>{u("preflightContinue",{value:f})}})},{title:l("responseHeaderPolicy.form.cors.credentials"),override:n.credentials.override,name:"credentials",value:n.credentials.value,control:e.jsx(J,{size:"small",disabled:c,checked:n.credentials.value,onChange:(s,f)=>{u("credentials",{value:f})}})}];ve(()=>{t(n)});const i={".PrivateSwitchBase-input+svg":{fontSize:"1rem"},".MuiCheckbox-sizeSmall":{p:.75},".MuiFormControlLabel-label":{fontSize:"0.8rem"}};return e.jsx(Q,{children:a.map((s,f)=>e.jsxs(A.Fragment,{children:[e.jsxs(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(M,{sx:{mt:f===0?0:1},control:s.control||e.jsx(b,{sx:{pl:1.35}}),label:s.title,required:s.required},`${s.name}_form`),e.jsxs(b,{children:[s.name==="origin"?e.jsx(M,{control:e.jsx(Y,{size:"small",checked:s.smart,color:"primary",disabled:c,onChange:()=>{u(s.name,{smart:!s.smart})}}),label:e.jsxs(e.Fragment,{children:[l("responseHeaderPolicy.form.cors.smartMode"),e.jsx(O,{title:l("responseHeaderPolicy.form.cors.smartModeHelperText"),children:e.jsx(b,{component:q,icon:ae,sx:{cursor:"pointer",color:"grey",ml:.5,fontSize:"1.1em"}})})]}),sx:i},`${s.name}_smart`):null,e.jsx(M,{control:e.jsx(Y,{size:"small",checked:s.override,color:"warning",disabled:c,onChange:()=>{u(s.name,{override:!s.override})}}),label:e.jsxs(e.Fragment,{children:[l("responseHeaderPolicy.form.originOverride"),e.jsx(O,{title:l("responseHeaderPolicy.form.originOverrideHelperText"),children:e.jsx(b,{component:q,icon:ae,sx:{cursor:"pointer",color:"grey",ml:.5,fontSize:"1.1em"}})})]}),sx:{...i,mr:0}},`${s.name}_override`)]})]}),s.content?e.jsx(b,{sx:{ml:3.5},children:s.content},`${s.name}_content`):null]},s.name))})}Oe.propTypes={config:g.object,onChange:g.func,disabled:g.bool};function qe({value:o,onChange:t=()=>{},disabled:c=!1}){const r="sameorigin",n=[{label:"DENY",value:"deny"},{label:"SAMEORIGIN (default)",value:"sameorigin"}],l=u=>{t({action:u.target.value})};return A.useEffect(()=>{o===!0&&t({action:r})},[o]),e.jsx(b,{children:e.jsx(V,{children:e.jsx(Ce,{row:!0,children:n.map(u=>e.jsx(M,{value:u.value,control:e.jsx(Pe,{size:"small",disabled:c,checked:u.value===o?.action,onChange:l,sx:{p:.75}}),label:u.label},u.value))})})})}qe.propTypes={value:g.oneOfType([g.string,g.bool]).isRequired,onChange:g.func,disabled:g.bool};function ze({value:o,onChange:t=()=>{},disabled:c=!1}){const r="strict-origin-when-cross-origin",n=[{label:"no-referrer",value:"no-referrer"},{label:"no-referrer-when-downgrade",value:"no-referrer-when-downgrade"},{label:"origin",value:"origin"},{label:"origin-when-cross-origin",value:"origin-when-cross-origin"},{label:"same-origin",value:"same-origin"},{label:"strict-origin",value:"strict-origin"},{label:"strict-origin-when-cross-origin (default)",value:"strict-origin-when-cross-origin"},{label:"unsafe-url",value:"unsafe-url"}],l=u=>{t({policy:u.target.value})};return A.useEffect(()=>{o===!0&&t({policy:r})},[o]),e.jsx(b,{children:e.jsx(V,{children:e.jsx(Ce,{children:n.map(u=>e.jsx(M,{value:u.value,control:e.jsx(Pe,{size:"small",disabled:c,checked:u.value===o?.policy,onChange:l,sx:{p:.75}}),label:u.label},u.value))})})})}ze.propTypes={value:g.oneOfType([g.string,g.bool]).isRequired,onChange:g.func,disabled:g.func};function Ee({value:o,onChange:t=()=>{},disabled:c=!1}){const r={"default-src":["'self'"],"base-uri":["'self'"],"font-src":["'self'","https:","data:"],"form-action":["'self'"],"frame-ancestors":["'self'"],"img-src":["'self'","data:"],"object-src":["'none'"],"script-src":["'self'"],"script-src-attr":["'none'"],"style-src":["'self'","https:","'unsafe-inline'"],"upgrade-insecure-requests":[]};function n(s){return Object.keys(s).map(f=>[f,s[f].filter(Boolean).join(" ")].filter(Boolean).join(" ")).filter(Boolean).join(`
|
|
8
|
-
`)}const l=n(o?.directives||r),[u,a]=A.useState(l),i=s=>{a(s.target.value);const f=s.target.value.split(`
|
|
9
|
-
`).reduce((h,H)=>{const[j,...k]=H.split(" ");return h[j]=k.filter(E=>E!==""),h},{});t({useDefaults:!1,directives:f})};return A.useEffect(()=>{o===!0&&(t({useDefaults:!1,directives:r}),a(n(r)))},[o]),e.jsx(b,{sx:{mt:1},children:e.jsx(V,{fullWidth:!0,children:e.jsx(D,{fullWidth:!0,multiline:!0,disabled:c,rows:12,size:"small",value:u,onChange:i})})})}Ee.propTypes={value:g.oneOfType([g.object,g.bool]).isRequired,onChange:g.func,disabled:g.bool};function _e({config:o={},onChange:t=()=>{},disabled:c=!1}){const r={contentSecurityPolicy:{override:!1,value:!1},referrerPolicy:{override:!1,value:!1},xFrameOptions:{override:!1,value:!1},xPoweredBy:{override:!1,value:!0},xXssProtection:{override:!1,value:!1},...Se(o,U)},{t:n}=X(),l=(i,{override:s,value:f})=>{const h={...r?.[i]};U(s)||(h.override=s),U(f)||(h.value=f),t({...r,[i]:h})},u=[{title:"Content-Security-Policy",name:"contentSecurityPolicy",override:r.contentSecurityPolicy.override,value:!!r.contentSecurityPolicy.value,content:e.jsx(Ee,{disabled:c,value:r.contentSecurityPolicy.value,onChange:i=>{l("contentSecurityPolicy",{value:i})}}),onChange(i){l("contentSecurityPolicy",{value:i})}},{title:"Referrer-Policy",name:"referrerPolicy",override:r.referrerPolicy.override,value:!!r.referrerPolicy.value,content:e.jsx(ze,{disabled:c,value:r.referrerPolicy.value,onChange:i=>{l("referrerPolicy",{value:i})}}),onChange(i){l("referrerPolicy",{value:i})}},{title:"X-Frame-Options",name:"xFrameOptions",override:r.xFrameOptions.override,value:!!r.xFrameOptions.value,content:e.jsx(qe,{disabled:c,value:r.xFrameOptions.value,onChange:i=>{l("xFrameOptions",{value:i})}}),onChange(i){l("xFrameOptions",{value:i})}},{title:"Disable X-Powered-By",name:"xPoweredBy",override:r.xPoweredBy.override,value:r.xPoweredBy.value,content:null,onChange(i){l("xPoweredBy",{value:i})}},{title:"X-XSS-Protection",name:"xXssProtection",override:r.xXssProtection.override,value:r.xXssProtection.value,content:null,onChange(i){l("xXssProtection",{value:i})}}];ve(()=>{t(r)});const a={".PrivateSwitchBase-input+svg":{fontSize:"1rem"},".MuiCheckbox-sizeSmall":{p:.75},".MuiFormControlLabel-label":{fontSize:"0.8rem"}};return e.jsx(Q,{children:u.map((i,s)=>e.jsxs(A.Fragment,{children:[e.jsxs(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(M,{sx:{mt:s===0?0:1},control:e.jsx(J,{size:"small",disabled:c,checked:i.value,onChange:()=>{i.onChange(!i.value)}},`${i.name}_switch`),label:i.title},`${i.name}_form`),i.value?e.jsx(M,{control:e.jsx(Y,{size:"small",checked:i.override,color:"warning",disabled:c,onChange:()=>{l(i.name,{override:!i.override})}}),label:e.jsxs(e.Fragment,{children:[n("responseHeaderPolicy.form.originOverride"),e.jsx(O,{title:n("responseHeaderPolicy.form.originOverrideHelperText"),children:e.jsx(b,{component:q,icon:ae,sx:{cursor:"pointer",color:"grey",ml:.5,fontSize:"1.1em"}})})]}),sx:{...a,mr:0}}):null]}),i.value&&i.content?e.jsx(b,{sx:{ml:3.7},children:i.content},`${i.name}_content`):null]},i.name))})}_e.propTypes={config:g.object,onChange:g.func,disabled:g.bool};function De({ref:o=null}){const{t}=A.useContext(oe),r=ne()?.transitions?.duration?.leavingScreen||300,n=te({mode:"add",show:!1,loadingButton:!1,callback:$,get dialogTitle(){return this.mode==="edit"?t("responseHeaderPolicy.edit"):this.mode==="view"?t("responseHeaderPolicy.view"):t("responseHeaderPolicy.add")},cors:null,securityHeader:null,enableCORS:!1}),{handleSubmit:l,control:u,setValue:a,reset:i,formState:{errors:s}}=ye({mode:"onChange",defaultValues:{name:"",description:""}}),f=S(()=>{i(),n.mode="add",n.enableCORS=!1,n.cors=null,n.securityHeader=null}),h=S(()=>{n.show=!1,setTimeout(()=>{f()},r)}),H=S((x=$,d=null)=>{n.callback=x,n.loadingButton=!1,n.show=!0,d&&(d.id?n.mode="edit":n.mode="view",a("name",d.name),a("description",d.description),n.cors=lo(d.cors),n.securityHeader=co(d.securityHeader),n.enableCORS=!!d.cors)});A.useImperativeHandle(o,()=>({open:H,close:h}),[H,h]);const j=S(()=>{n.loadingButton=!1}),k=n.mode==="view",E=S(x=>{const d=io(n.cors),C=ao(n.securityHeader),m=be({...x,cors:n.enableCORS?JSON.stringify(d):null,securityHeader:JSON.stringify(C)});n.loadingButton=!0,n.callback(m,{close:h,done:j})}),B=S(x=>x?.trim()?!0:t("common.requiredErrorText",{name:t("accessPolicy.form.name")})),F=x=>{n.securityHeader=x},z=x=>{n.cors=x};return e.jsx(de,{open:n.show,title:n.dialogTitle,onClose:h,PaperProps:{style:{minHeight:"unset",width:900,maxWidth:"100%"}},actions:e.jsx(ue,{color:"primary",autoFocus:!0,variant:"contained",onClick:l(E),loading:n.loadingButton,loadingPosition:"start",children:t("common.confirm")}),children:e.jsxs("form",{noValidate:!0,autoComplete:"off",children:[e.jsx(N,{name:"name",control:u,rules:{validate:B},render:({field:x})=>e.jsx(D,{fullWidth:!0,required:!0,size:"small",margin:"dense",disabled:k,placeholder:t("accessPolicy.form.namePlaceholder"),label:t("accessPolicy.form.name"),error:!!s?.name?.message,helperText:s?.name?.message||" ",...x})}),e.jsx(N,{name:"description",control:u,render:({field:x})=>e.jsx(D,{fullWidth:!0,multiline:!0,size:"small",margin:"dense",disabled:k,minRows:3,maxRows:7,placeholder:"Description",label:"Description",helperText:s?.description?.message||" ",...x})}),e.jsx(ce,{title:"Cross-origin resource sharing (CORS)",value:n.enableCORS,onChange:x=>{k||(n.enableCORS=x)},showExpand:!1,actions:e.jsx(J,{size:"small",disabled:k,checked:n.enableCORS}),children:e.jsx(Oe,{config:n.cors,onChange:z,disabled:k})}),e.jsx("br",{}),e.jsx(ce,{title:"Security Headers",children:e.jsx(_e,{config:n.securityHeader,onChange:F,disabled:k})})]})})}De.propTypes={ref:g.any};function po(){const{t:o,locale:t}=X(),{blocklet:c}=se(),{api:r}=re(),n=c?.meta?.did,l=A.useRef(null),u=A.useRef(null),{confirmApi:a,confirmHolder:i}=pe(),s=()=>{},f=K(async()=>{const{responseHeaderPolicies:x}=await r.getBlockletResponseHeaderPolicies({input:{did:n}});return ee(x.map(d=>uo(d)),d=>d.isProtected?1:0)}),h=f.data||[],H=S(()=>{l.current.open(async(x,{close:d,done:C})=>{await W(async()=>{await r.addBlockletResponseHeaderPolicy({input:{did:n,data:x}}),_.success(o("common.succeeded")),f.run(),d()}),C()})}),j=S(x=>{l.current.open((d,{close:C,done:m})=>{m(),C()},Z(x,["id"]))}),k=S(x=>{l.current.open(async(d,{close:C,done:m})=>{await W(async()=>{await r.updateBlockletResponseHeaderPolicy({input:{did:n,data:{...d,id:x.id}}}),_.success(o("common.succeeded")),f.run(),C()}),m()},x)}),E=S(x=>{a.open({title:o("responseHeaderPolicy.delete.title"),content:o("responseHeaderPolicy.delete.description"),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),onConfirm(d){W(async()=>{await r.deleteBlockletResponseHeaderPolicy({input:{did:n,id:x.id}}),_.success(o("common.succeeded")),f.run(),d()})}})}),B={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(x,{dataIndex:d},C){if(u.current?.contains(C.target)){const m=h[d];j(m)}}},F=[e.jsx(G,{size:"small",variant:"outlined",onClick:()=>{f.run()},sx:{mr:1},children:o("common.refresh")},"refresh"),e.jsx(G,{size:"small",variant:"contained",onClick:H,children:o("common.add")},"add")],z=[{label:o("common.name"),name:"name",options:{customBodyRenderLite(x){const d=h[x],C=d.isProtected?e.jsx(O,{title:"Built-in policy, can't edit",children:e.jsx(b,{component:q,icon:je,sx:{fontSize:16}})}):null;return e.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:.5},children:[C," ",d.name]})}}},{label:o("common.description"),name:"description"},{label:o("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(x){const d=h[x];return e.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:0},onClick:C=>C.stopPropagation(),children:[d.isProtected?e.jsx(O,{title:o("common.view"),children:e.jsx(L,{size:"small",onClick:()=>{j(d,x)},children:e.jsx(q,{icon:ke,fontSize:18})})}):null,d.isProtected?null:e.jsx(O,{title:o("common.edit"),children:e.jsx(L,{size:"small",onClick:()=>{k(d,x)},color:"success",children:e.jsx(q,{icon:he,fontSize:18})})}),d.isProtected?null:e.jsx(O,{title:o("common.delete"),children:e.jsx(L,{size:"small",onClick:()=>{E(d,x)},color:"error",children:e.jsx(q,{icon:xe,fontSize:18})})})]})}}}].filter(Boolean);return e.jsxs(b,{sx:{display:"flex",flexDirection:"column",gap:2},ref:u,children:[e.jsx(me,{verticalKeyWidth:100,locale:t,title:o("responseHeaderPolicy.title"),data:h,columns:z,customButtons:F,options:B,loading:f.loading,onChange:s}),e.jsx(De,{ref:l}),i]})}function qo(){const{t:o}=A.useContext(oe),t=oo({key:"lg"}),c=[{label:e.jsx(b,{sx:{textAlign:"center",width:"100%"},children:o("securityRule.title")}),value:"security"},{label:e.jsx(b,{sx:{textAlign:"center",width:"100%"},children:o("accessPolicy.title")}),value:"accessPolicy"},{label:e.jsx(b,{sx:{textAlign:"center",width:"100%"},children:o("responseHeaderPolicy.title")}),value:"responseHeaderPolicy"}],[r,n]=A.useState(c[0].value),l=fe(()=>({security:e.jsx(so,{}),accessPolicy:e.jsx(mo,{}),responseHeaderPolicy:e.jsx(po,{})}),[o]);return e.jsx(ho,{children:e.jsxs(Ye,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(b,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(We,{tabs:c,current:r,orientation:t?"horizontal":"vertical",onChange:n,sx:{borderRight:t?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(b,{sx:{flexGrow:1,minWidth:0},children:e.jsx(b,{children:l[r]})})]})})}const ho=Ke.div`
|
|
10
|
-
.MuiTab-root {
|
|
11
|
-
text-align: left;
|
|
12
|
-
align-items: flex-start;
|
|
13
|
-
font-weight: normal;
|
|
14
|
-
|
|
15
|
-
div {
|
|
16
|
-
text-align: left;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
.Mui-selected {
|
|
20
|
-
font-weight: bold;
|
|
21
|
-
}
|
|
22
|
-
`;export{qo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./vendor-react-CTtPmzVP.js";const l=L=>e.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...L},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),e.createElement("defs",null,e.createElement("linearGradient",{id:"paint0_linear_615_426",x1:31.72,y1:95.7208,x2:95.488,y2:34.3249,gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#0FA4B7"}),e.createElement("stop",{offset:.494757,stopColor:"#1DC1C7"}),e.createElement("stop",{offset:1,stopColor:"#2BE0D7"})),e.createElement("linearGradient",{id:"paint1_linear_615_426",x1:28.4374,y1:99.2464,x2:98.7613,y2:44.9372,gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#0FA4B7"}),e.createElement("stop",{offset:.494757,stopColor:"#1DC1C7"}),e.createElement("stop",{offset:1,stopColor:"#2BE0D7"}))));export{l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,y as S,x as I,bZ as O,M as c,ak as p,T as n,U as T,ca as W,F as z,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{l as M}from"./arrow-down.svg-C4FUKwt4.js";import{K as B}from"./vendor-ux-jvAfFAl1.js";function C({fullWidth:m=!1,multiple:a=!1,required:o=!1,label:x="",placeholder:j="",options:t=[],helperText:b="",error:v=!1,margin:u="",size:f,slotProps:y={},...h}){const g=t.find(l=>l.value===h.value)?.title;return e.jsxs(S,{margin:u,fullWidth:m,error:v,children:[e.jsx(I,{size:f,children:`${x}${o?"*":""}`}),e.jsxs(O,{multiple:a,sx:{"& .MuiInputBase-input":{width:"calc(100% - 46px)","& > .MuiBox-root:first-of-type":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},input:e.jsx(W,{defaultValue:g,sx:{flex:1},required:o,label:x,inputProps:{margin:u},size:f}),renderValue:l=>{if(a)return e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:l.map(i=>{const d=t.find(w=>w.value===i);return d&&d.title&&e.jsx(T,{size:"small",label:d.title},i)})});const r=t.find(i=>i.value===l);return r&&r.title&&e.jsxs(p,{children:[e.jsx(n,{component:"span",children:r.title}),e.jsx(n,{component:"span",variant:"body2",sx:{marginLeft:1,color:"text.secondary"},children:r.description})]})},IconComponent:l=>e.jsx(M,{...l,width:20,height:20}),...h,children:[e.jsx(c,{disabled:!0,children:e.jsx("em",{children:j})}),!o&&!a&&e.jsx(c,{value:"",children:"None"}),t.map(l=>l&&l.value&&e.jsx(c,{value:l.value,disabled:l.disabled||!1,children:e.jsxs(p,{sx:B({display:"flex",flexDirection:"column"},y?.optionItem?.sx),children:[e.jsx(n,{component:"span",children:l.title}),l.description&&e.jsx(n,{component:"span",variant:"body2",sx:{maxWidth:510,fontSize:12,whiteSpace:"normal",color:"text.secondary"},children:l.description})]})},l.value))]}),e.jsx(z,{children:b})]})}C.propTypes={error:s.bool,required:s.bool,multiple:s.bool,fullWidth:s.bool,label:s.string,placeholder:s.string,options:s.array,helperText:s.string,margin:s.string,size:s.string,textDirection:s.oneOf(["row","column"]),slotProps:s.object};export{C as S};
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import{D as V,J as q,j as t,a6 as G,bq as X,ak as c,bB as Q,at as T,aT as J,P as Y,bC as Z,bb as ee,W as w}from"./vendor-mui-core-DnR6WYuU.js";import{r as x,L as H}from"./vendor-react-CTtPmzVP.js";import{x as te,a as E}from"./vendor-hooks-qxhUUbW5.js";import{C as N}from"./vendor-utils-CxWN1dT3.js";import{V as K,H as U,K as ne,w as C,$ as oe,M as re}from"./vendor-ux-jvAfFAl1.js";import{W as se}from"./did-address-B3eXeL7H.js";import{o as ie,s as ae}from"./vendor-arcblock-B1iA4v4a.js";import{q as B,r as g,t as z,v as le,w as ce,x as D,n as de,c as L,u as pe,y as me,A as ue,B as he,P as ge,C as P,D as xe,E as A}from"./index-NWCpUGtr.js";import{H as fe}from"./addon-DckWyYy3.js";import{u as be}from"./use-server-logo-Cv1kAPgB.js";import{g as W}from"./get-safe-url-xl2OarvZ.js";import{O as ke}from"./over-due-invoice-payment-DvKFY6t9.js";import{p as ye,S as je,P as we}from"./starting-progress-MyalFKYG.js";import"./lottie-web-4koyQiv_.js";import"./question-mark-circle.svg-CByEVDhb.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./use-mobile-BINJTzMb.js";function F({appInfo:e,...r}){const[n,s]=x.useState(!1),l=q(f=>f.breakpoints.down("md"))?32:48;return n?t.jsx(oe,{did:e.publisher,size:l}):t.jsx(re,{src:e.icon,alt:e.title,width:l,height:l,...r,onError:()=>s(!0)})}F.propTypes={appInfo:w.object.isRequired};const M=(e,r)=>g.findComponentByIdV2(e,r)||e;function Ke(){const{t:e,locale:r}=K(),[n,s]=te({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:"",restart:!1}),a=localStorage.getItem("blocklet-server-url"),l=be({onClick:()=>{a&&window.open(W(a,{allowDomains:null}))}}),f=new URL(window.location.href),v=f.searchParams.get("componentId"),_=V(),j=q(o=>o.breakpoints.down("md")),b=()=>{const o=f.searchParams.get("redirect")||"/";window.location.href=W(decodeURIComponent(o))},k=()=>{const o=setInterval(()=>{B.get("/blocklet/detail?nocache=1").then(({data:i})=>{s(R=>({...R,blocklet:i}));const d=M(i,v);if(g.isBlockletRunning(d)){b();return}d.status!=="starting"&&!n.restart&&(s({blocklet:i,starting:!1}),i!==d&&s({component:d}),clearInterval(o))}).catch(i=>{s({loading:!1,restart:!1}),U.error(i.message)})},3e3)},$=()=>{s({restart:!0,starting:!0,loading:!0}),setTimeout(()=>{k()},10)};x.useEffect(()=>{s({loading:!0}),B.get("/blocklet/detail?nocache=1").then(({data:o})=>{const i=M(o,v);if(s({blocklet:o,loading:!1}),g.isBlockletRunning(i)){b();return}s({blocklet:o}),o!==i&&s({component:i}),i.status==="starting"&&(s({starting:!0}),k())}).catch(o=>{s({loading:!1}),U.error(o.message)})},[]);const u=x.useCallback(()=>{s({loading:!0,starting:!0});const o=n.blocklet;if(!o)return;const i={did:o?.meta.did};o.children.length>0&&(i.componentDids=o.children.map(d=>d.meta.did)),z.startBlocklet({input:i}).then(({blocklet:d})=>{s(R=>({...R,blocklet:d})),k()}).catch(d=>{U.error(d.message),s({loading:!1,starting:!1})})},[n.component,n.blocklet]);x.useEffect(()=>{n.blocklet?.controller&&(le({launcherUrl:n.blocklet.controller.launcherUrl,launcherSessionId:n.blocklet.controller.launcherSessionId,locale:r}).then(o=>{s({manageSubscriptionURL:o})}).catch(o=>{console.error("get manage subscription url error",o)}),z.getLauncherSession({input:{launcherSessionId:n.blocklet.controller.launcherSessionId,launcherUrl:n.blocklet.controller.launcherUrl}}).then(o=>{s({launcherSession:o.launcherSession})}).catch(o=>{console.error("get launcher session error",o)}))},[n.blocklet?.controller]);const p=E(()=>n.blocklet?.children?.length,[n.blocklet]),m=E(()=>n.blocklet?.children?.filter(o=>g.isBlockletRunning(o))?.length||0,[n.blocklet]),y=E(()=>p?m?Math.round(Math.max(m/p,.15)*100):5:0,[m,p]);if(!n.blocklet)return t.jsx(ie,{children:t.jsx(G,{})});const h={icon:`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(n.blocklet),publisher:n.blocklet.appDid},I=ne(ye,n.starting?{width:`${y}%`,"&::after":{width:`${y}%`},"&::before":{width:`${y}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${y}%`}}}}:{}),S=ce(n.blocklet)||D(n.launcherSession);return t.jsxs(Se,{children:[t.jsx(X,{styles:ve}),t.jsxs("header",{className:"root-header",children:[j?null:t.jsx("div",{className:"left",children:l}),t.jsx(ae,{sx:{background:j?_.palette.background.default:"transparent",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:t.jsx(fe,{SessionContext:de})})]}),t.jsxs(Pe,{elevation:0,children:[t.jsxs(Ce,{children:[t.jsx(F,{appInfo:h}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(c,{className:"app-info_name",children:h.title}),t.jsx(se,{size:14,className:"app-info_did",did:h.publisher})]})]}),(n.restart||!S)&&t.jsxs(t.Fragment,{children:[t.jsxs(c,{className:"title-box",children:[t.jsx(c,{className:"icon",children:t.jsx(Q,{})}),t.jsx(c,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(c,{className:"sub-title",children:n.starting?t.jsx(je,{blocklets:n.blocklet?.children??[]}):e("blocklet.startDescription",{name:n.component?g.getDisplayName(n.component,!0):g.getDisplayName(n.blocklet)})}),t.jsx(c,{sx:{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:t.jsx(we,{blocklets:n.blocklet?.children??[],status:n.starting?"starting":"",children:t.jsx(C,{sx:I,disabled:n.loading||n.starting,variant:"contained",color:"primary",size:"large",loading:n.starting,onClick:()=>u(),children:t.jsx("span",{style:{position:"relative",zIndex:2},children:n.starting?`(${m}/${p}) ${e("blocklet.starting")}`:e("blocklet.start")})})})})]}),S&&!n.restart&&t.jsx(O,{blocklet:n.blocklet,launcherSession:n.launcherSession,manageSubscriptionURL:n.manageSubscriptionURL,handleRestart:$}),t.jsx(c,{sx:{mt:5},children:t.jsx(H,{className:"footer-link",to:`${L.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function O({blocklet:e,launcherSession:r,manageSubscriptionURL:n,handleRestart:s}){const{t:a,locale:l}=K(),{connectApi:f,session:v}=pe(),{refreshSubscription:_}=me(),[j,b]=x.useState(!1),[k,$]=x.useState("");if(x.useEffect(()=>{if(e?.controller?.launcherUrl&&D(r)){const y=N(e.controller.launcherUrl,"__blocklet__.js?type=json");fetch(y).then(h=>h.json()).then(h=>{const I=h.componentMountPoints?.find(o=>o.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,S=N(e.controller.launcherUrl,I);$(S)})}},[e?.controller?.launcherUrl,r]),!e||!r)return"";const u=D(r),p=!u&&ue(e,r),m=!u&&he(e,r);return!p&&!m&&!u?"":t.jsxs(t.Fragment,{children:[j&&k&&r&&t.jsx(ge,{session:v,connect:f,baseUrl:k,authToken:r.subscription.authToken,children:t.jsx(ke,{dialogProps:{open:j,onClose:()=>b(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{B.post("/blocklet/start?fromSetup=1"),_(),s(),b(!1)}})}),t.jsxs(c,{className:"title-box",children:[t.jsx(Z,{className:"icon-error"}),t.jsxs(c,{className:"title error",children:[p&&a("blocklet.suspended"),m&&a("blocklet.terminated"),u&&a("blocklet.suspended")]})]}),t.jsxs(c,{className:"sub-title",children:[p&&a("blocklet.suspendedCausedByExpired",{deadline:P(r?.reservedUntil,l),canceledAt:P((r?.subscription?.canceled_at||0)*1e3,l)}),m&&a("blocklet.suspendedCausedByTerminated",{canceledAt:P(r?.terminatedAt,l),deadline:xe(r?.terminatedAt,l)}),u&&a("blocklet.suspendedCausedByPastDue",{deadline:P(r?.reservedUntil,l)})]}),t.jsxs(c,{sx:{mt:8},children:[u&&!A(r)&&t.jsx(C,{style:{minWidth:200},variant:"contained",color:"primary",size:"large",onClick:()=>b(!0),children:a("blocklet.payNow")}),(p||A(r))&&t.jsx(C,{component:ee,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:n||"#",children:a("blocklet.manageSubscription")}),m&&t.jsx(C,{component:H,to:N(L.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:a("common.backup")})]})]})}O.propTypes={blocklet:w.object.isRequired,launcherSession:w.object.isRequired,manageSubscriptionURL:w.string.isRequired,handleRestart:w.func.isRequired};const ve=J`
|
|
2
|
-
html,
|
|
3
|
-
body,
|
|
4
|
-
#app,
|
|
5
|
-
#app > .wrapper {
|
|
6
|
-
height: 100%;
|
|
7
|
-
}
|
|
8
|
-
`,Se=T.div`
|
|
9
|
-
width: 100vw;
|
|
10
|
-
height: 100%;
|
|
11
|
-
background: ${({theme:e})=>e.palette.mode==="dark"?e.palette.background.default:e.palette.grey[100]};
|
|
12
|
-
display: flex;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
align-items: center;
|
|
15
|
-
|
|
16
|
-
.root-header {
|
|
17
|
-
position: fixed;
|
|
18
|
-
z-index: 200;
|
|
19
|
-
top: 0;
|
|
20
|
-
display: flex;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 68px;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: flex-end;
|
|
25
|
-
padding: 24px;
|
|
26
|
-
max-width: 1245px;
|
|
27
|
-
|
|
28
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
29
|
-
padding: 14px 16px;
|
|
30
|
-
height: 56px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.left {
|
|
34
|
-
margin-top: 4px;
|
|
35
|
-
margin-right: auto;
|
|
36
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
37
|
-
margin-top: 0%;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.right {
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
45
|
-
button,
|
|
46
|
-
a {
|
|
47
|
-
padding-left: 8px;
|
|
48
|
-
padding-right: 8px;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`,Pe=T(Y)`
|
|
54
|
-
width: 80vw;
|
|
55
|
-
max-width: 1245px;
|
|
56
|
-
height: 80vh;
|
|
57
|
-
box-sizing: border-box;
|
|
58
|
-
padding: 32px;
|
|
59
|
-
&.MuiPaper-rounded {
|
|
60
|
-
border-radius: 8px;
|
|
61
|
-
}
|
|
62
|
-
position: relative;
|
|
63
|
-
display: flex;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
align-items: center;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
|
|
68
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
69
|
-
width: 100vw;
|
|
70
|
-
height: 100%;
|
|
71
|
-
left: 0;
|
|
72
|
-
top: 0;
|
|
73
|
-
padding: 32px 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.MuiIconButton-root {
|
|
77
|
-
svg {
|
|
78
|
-
fill: #888;
|
|
79
|
-
}
|
|
80
|
-
&.Mui-disabled {
|
|
81
|
-
opacity: 0.4;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.title-box {
|
|
86
|
-
display: flex;
|
|
87
|
-
align-items: center;
|
|
88
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
89
|
-
margin-top: 60px;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.icon {
|
|
94
|
-
display: inline-flex;
|
|
95
|
-
justify-content: center;
|
|
96
|
-
align-items: center;
|
|
97
|
-
width: 32px;
|
|
98
|
-
height: 32px;
|
|
99
|
-
border-radius: 100%;
|
|
100
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
101
|
-
color: ${e=>e.theme.palette.common.white};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.icon-error {
|
|
105
|
-
width: 32px;
|
|
106
|
-
height: 32px;
|
|
107
|
-
color: ${e=>e.theme.palette.error.main};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.title {
|
|
111
|
-
margin-left: 12px;
|
|
112
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
113
|
-
font-size: 24px;
|
|
114
|
-
font-weight: bolder;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.error {
|
|
118
|
-
color: ${e=>e.theme.palette.error.main};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.sub-title {
|
|
122
|
-
margin-top: 24px;
|
|
123
|
-
color: ${e=>e.theme.palette.grey[700]};
|
|
124
|
-
font-size: 16px;
|
|
125
|
-
max-width: 460px;
|
|
126
|
-
text-align: center;
|
|
127
|
-
word-break: break-word;
|
|
128
|
-
hyphens: auto;
|
|
129
|
-
|
|
130
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
131
|
-
padding: 0 32px;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.footer-link {
|
|
136
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
137
|
-
}
|
|
138
|
-
`,Ce=T.div`
|
|
139
|
-
display: flex;
|
|
140
|
-
align-items: center;
|
|
141
|
-
position: absolute;
|
|
142
|
-
left: 24px;
|
|
143
|
-
right: 24px;
|
|
144
|
-
top: 24px;
|
|
145
|
-
font-size: 16px;
|
|
146
|
-
font-weight: 500;
|
|
147
|
-
color: #222;
|
|
148
|
-
|
|
149
|
-
/* 禁止 app icon shrink */
|
|
150
|
-
> *:first-child {
|
|
151
|
-
flex: 0 0 auto;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.app-info_content {
|
|
155
|
-
padding-left: 16px;
|
|
156
|
-
overflow: hidden;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.app-info_name {
|
|
160
|
-
max-width: 100%;
|
|
161
|
-
padding-right: 32px;
|
|
162
|
-
line-height: 1;
|
|
163
|
-
white-space: nowrap;
|
|
164
|
-
overflow: hidden;
|
|
165
|
-
text-overflow: ellipsis;
|
|
166
|
-
font-weight: bold;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.app-info_did {
|
|
170
|
-
transform: translate(0, 2px);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.app-info_did .did-address__text {
|
|
174
|
-
color: #666;
|
|
175
|
-
font-size: 14px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
${e=>e.theme.breakpoints.down("md")} {
|
|
179
|
-
top: 12px;
|
|
180
|
-
.app-info_did {
|
|
181
|
-
transform: translate(0, 0);
|
|
182
|
-
}
|
|
183
|
-
.app-info_did .did-address__text {
|
|
184
|
-
font-size: 12px;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
`;export{Ke as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b}from"./vendor-react-CTtPmzVP.js";import{j as p,a6 as x,am as w,dw as P,bI as j,W as $}from"./vendor-mui-core-DnR6WYuU.js";import{x as k}from"./vendor-hooks-qxhUUbW5.js";import{B as d}from"./vendor-utils-CxWN1dT3.js";import{r as q}from"./omit-spWLSLbo.js";import{ce as V,cf as R}from"./index-NWCpUGtr.js";import{o as E,V as I}from"./vendor-ux-jvAfFAl1.js";var a={},h;function D(){if(h)return a;h=1;var u=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.signResponse=l,a.verifyResponse=S,a.verifyVault=_;const m=u(q),v=u(V()),n=R(),s=E();async function l(e,c){const o=(0,v.default)(e),y=await c.sign(o);return{...e,$signature:y}}function S(e,c){return e.$signature?c.verify((0,v.default)((0,m.default)(e,"$signature")),e.$signature):Promise.resolve(!1)}async function _(e,c,o=!1){if(!Array.isArray(e)||e.length===0){if(o)throw new Error("vaults list is empty");return""}for(let t=1;t<e.length;t++)if(e[t].at<=e[t-1].at){if(o)throw new Error("vaults are not in ascending order");return""}if(new Set(e.map(t=>t.did)).size!==e.length){if(o)throw new Error("vaults list has duplicate vaults");return""}for(let t=0;t<e.length;t++){const r=e[t];if(!(0,s.isFromPublicKey)(r.did,r.pk)){if(o)throw new Error(`vault did and pk mismatch: ${r.did}(${r.pk})`);return""}let f=d.from(`vault:${c}`);for(let i=0;i<=t;i++)f=d.concat([f,d.from(`:${e[i].did}`)]);if(!r.approverSig){if(o)throw new Error(`vault approve signature missing for ${r.did}`);return""}try{let i;if(t>0){const g=e[t-1];i=(0,n.fromPublicKey)(g.pk,(0,s.toTypeInfo)(g.did))}else{if(!r.approverPk||!r.approverDid||!(0,s.isFromPublicKey)(r.approverDid,r.approverPk)){if(o)throw new Error(`approver config missing for ${r.did}`);return""}i=(0,n.fromPublicKey)(r.approverPk,(0,s.toTypeInfo)(r.approverDid))}if(await i.verify(f,r.approverSig)===!1){if(o)throw new Error(`signature verify failed for ${r.did}`);return""}}catch(i){if(console.error(i),o)throw new Error(`vault approve verify failed: ${i.message}`);return""}if(!r.sig){if(o)throw new Error(`vault commit signature missing for ${r.did}`);return""}try{const i=(0,n.fromPublicKey)(r.pk,(0,s.toTypeInfo)(r.did));if(r.approverSig&&(f=d.concat([f,d.from(`:${r.approverSig}`)])),await i.verify(f,r.sig)===!1){if(o)throw new Error(`commit signature verify failed for ${r.did}`);return""}}catch(i){if(console.error(i),o)throw new Error(`vault commit verify failed: ${i.message}`);return""}}return e[e.length-1].did}return a}var K=D();function T({vaults:u,appPid:m}){const{t:v}=I(),[n,s]=k({verified:!1,verifying:!0,error:""});return b.useEffect(()=>{K.verifyVault(u,m,!0).then(l=>{s({verified:!!l,verifying:!1})}).catch(l=>{s({verified:!1,verifying:!1,error:l.message})})},[u,m,s]),n.verifying?p.jsx(x,{}):n.verified?p.jsx(w,{title:v("blocklet.config.vault.verified"),children:p.jsx(P,{fontSize:"small",color:"success"})}):p.jsx(w,{title:n.error,children:p.jsx(j,{color:"error"})})}T.propTypes={vaults:$.array.isRequired,appPid:$.string.isRequired};export{T as V};
|