@abtnode/blocklet-services 1.17.8-beta-20260119-034126-467341b7 → 1.17.8-beta-20260121-102603-f9d0176f
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-CYW0YvmK.js → AdapterDayjs-QqQc9YbA.js} +1 -1
- package/dist/assets/{Google-DKRt92nm.js → Google-PffSpBc2.js} +1 -1
- package/dist/assets/{LottiePlayer.modern-CeQuigIa.js → LottiePlayer.modern-CE8erevJ.js} +1 -1
- package/dist/assets/access-control-B6JglGtO.js +14 -0
- package/dist/assets/actions-Do5Z9cxZ.js +64 -0
- package/dist/assets/{add-component-core-nc1ps0ni.js → add-component-core-CLOpD7CB.js} +21 -21
- package/dist/assets/add-resource-ipDE-D6W.js +1 -0
- package/dist/assets/{addon-DfWedLEC.js → addon-CrVdMlFe.js} +1 -1
- package/dist/assets/advanced-C3qjZMWH.js +14 -0
- package/dist/assets/{aigne-6nMSoyeQ.js → aigne-CeD5Xo7t.js} +1 -1
- package/dist/assets/api-BMcHDEnt.js +1 -0
- package/dist/assets/appearance-BJuIABu8.js +1 -0
- package/dist/assets/{ar-DOhYGTlW.js → ar-xXK-6slW.js} +1 -1
- package/dist/assets/audit-logs-DxVzMUJK.js +35 -0
- package/dist/assets/authorize-BxQgoA5F.js +1 -0
- package/dist/assets/{base-chart-DcZV4ZCI.js → base-chart-CQOyckBN.js} +1 -1
- package/dist/assets/{base32-7iZvvdX8.js → base32-CyUpiYTu.js} +1 -1
- package/dist/assets/bind-account-D5gBazop.js +1 -0
- package/dist/assets/branding-CDPvtKJm.js +40 -0
- package/dist/assets/{branding-CwSyd5WC.js → branding-CtbvPvdK.js} +3 -3
- package/dist/assets/branding-Dv3-0Q39.js +1 -0
- package/dist/assets/bundle-avatar-2ugE80w1.js +1 -0
- package/dist/assets/button-d8gvZuHP.js +1 -0
- package/dist/assets/{click-to-copy-BgIYUMoo.js → click-to-copy-CgakrWoh.js} +1 -1
- package/dist/assets/{cloneDeep-YxES7wNt.js → cloneDeep-q2Jbqwkh.js} +1 -1
- package/dist/assets/complete-B_lyTPVv.js +39 -0
- package/dist/assets/{component-CuKviNC8.js → component-pjnMydek.js} +37 -37
- package/dist/assets/config-BcCR6bUQ.js +1 -0
- package/dist/assets/config-BsWCoWa6.js +32 -0
- package/dist/assets/{config-D1OcHGlN.js → config-CyDF6KG9.js} +6 -6
- package/dist/assets/{config-navigation-hDihVsjx.js → config-navigation-B36NPLt0.js} +11 -11
- package/dist/assets/{config-space-DfstlHnF.js → config-space-DUkjNtdL.js} +1 -1
- package/dist/assets/{confirm-CdVn5WdC.js → confirm-CoDiNrSj.js} +1 -1
- package/dist/assets/{connect-CT2vMz6l.js → connect--GxmDNr3.js} +3 -3
- package/dist/assets/{connect-Dy0Y8HRB.js → connect-SOuN9k8I.js} +1 -1
- package/dist/assets/connect-ULEL84iL.js +1 -0
- package/dist/assets/connect-to-DnBUF-KE.js +1 -0
- package/dist/assets/{create-passport-svg-hldNORaB.js → create-passport-svg-BSRyjG0k.js} +1 -1
- package/dist/assets/{createClass-CgfWUrk8.js → createClass-DKvdNmc_.js} +1 -1
- package/dist/assets/dashboard-CkDdshHQ.js +93 -0
- package/dist/assets/{de-CtKPdGk6.js → de-CzlQlDUl.js} +1 -1
- package/dist/assets/{delete-confirm-CkiUXocp.js → delete-confirm-Cq9MJasT.js} +1 -1
- package/dist/assets/{did-address-CG36eCOx.js → did-address-CtvTDc_I.js} +1 -1
- package/dist/assets/{domain-CDTeLbkZ.js → domain-BOIdkJ_V.js} +1 -1
- package/dist/assets/domain-action-card-DuiLZ6sE.js +28 -0
- package/dist/assets/domains-C5GLc_A-.js +1 -0
- package/dist/assets/email-DN8lH7fV.js +17 -0
- package/dist/assets/engine-Crd5Z3lP.js +1 -0
- package/dist/assets/{es-BSYtSZPg.js → es-BpsyeJfJ.js} +1 -1
- package/dist/assets/exchange-passport-BvS_8Ud6.js +1 -0
- package/dist/assets/{fallback-D-IHOW-7.js → fallback-CuXkR699.js} +1 -1
- package/dist/assets/{form-Co-tgocU.js → form-CZjONW3r.js} +3 -3
- package/dist/assets/{form-text-input-CPLafaTk.js → form-text-input-BT3t62-a.js} +1 -1
- package/dist/assets/{fr-C35fi7h9.js → fr-BawgvFA1.js} +1 -1
- package/dist/assets/{fuel-BFx1ShM2.js → fuel-dijAR437.js} +1 -1
- package/dist/assets/gen-access-key-DaJCt-T5.js +1 -0
- package/dist/assets/gen-simple-access-key-DLZy8UKi.js +1 -0
- package/dist/assets/get-safe-url-czY77v8f.js +1 -0
- package/dist/assets/hi-ClGNxnSL.js +5 -0
- package/dist/assets/home-ChU7yi5l.js +1 -0
- package/dist/assets/{id-DoVb0JYr.js → id-_HQ0of3E.js} +1 -1
- package/dist/assets/{iframe-DUzp97tk.js → iframe-CYVXxx1r.js} +1 -1
- package/dist/assets/index-5RRpshJe.js +200 -0
- package/dist/assets/index-5Sys1Zsb.js +6 -0
- package/dist/assets/{index-Di2nSesc.js → index-B4A3W4qJ.js} +1 -1
- package/dist/assets/index-B4EOqUNT.js +1 -0
- package/dist/assets/{index-D1Fa760B.js → index-B5VPb4FA.js} +1 -1
- package/dist/assets/{index-C_kNXHsF.js → index-B9YNNXOw.js} +1 -1
- package/dist/assets/index-BDSBuO5S.js +7 -0
- package/dist/assets/{index-2M4w6J9r.js → index-BOoRVhLj.js} +3 -3
- package/dist/assets/{index-Bo9KtpTY.js → index-BVTsYhIX.js} +1 -1
- package/dist/assets/index-Boc2cNQ7.js +150 -0
- package/dist/assets/{index-D6pCyJv8.js → index-C2O2gJSR.js} +1 -1
- package/dist/assets/{index-8RHrVCC6.js → index-C3UXSk-k.js} +1 -1
- package/dist/assets/index-C6vJzTmT.js +81 -0
- package/dist/assets/index-CD7hq5dy.js +124 -0
- package/dist/assets/{index-3H6a5edM.js → index-CNlJloMN.js} +1 -1
- package/dist/assets/{index-D3BuekEe.js → index-CVuESID5.js} +5 -5
- package/dist/assets/{index-CEJb82tA.js → index-CZ-qZTKi.js} +1 -1
- package/dist/assets/{index-VKjWmvRV.js → index-Ci7zZ36D.js} +1 -1
- package/dist/assets/{index-CfvGuvbD.js → index-D7Er4cge.js} +1 -1
- package/dist/assets/{index-C1fKsLzf.js → index-D8oCzSQW.js} +1 -1
- package/dist/assets/{index-BUhEyicQ.js → index-DF1j89BT.js} +1 -1
- package/dist/assets/{index-DH4rC-7M.js → index-DGZbt7_m.js} +1 -1
- package/dist/assets/index-DKeuwD_Y.js +242 -0
- package/dist/assets/{index-DFUM0Pvk.js → index-Dn9eNAe6.js} +1 -1
- package/dist/assets/index-DswHt4-F.js +88 -0
- package/dist/assets/{index-DqcciDRh.js → index-Dvc-Bpkc.js} +2 -2
- package/dist/assets/index-NHiSMvgy.js +120 -0
- package/dist/assets/{index-Cx0E03Bs.js → index-WzGP4BGm.js} +1 -1
- package/dist/assets/{index-CqCXPf7W.js → index-Zxy2t-7f.js} +1 -1
- package/dist/assets/index-iOa1BVMr.js +280 -0
- package/dist/assets/index-s8xAfo-W.js +1 -0
- package/dist/assets/index-tRQj1y79.js +6 -0
- package/dist/assets/{index-ZzcJ7eKO.js → index-uUS1eXYF.js} +1 -1
- package/dist/assets/index-yoaLEniz.js +832 -0
- package/dist/assets/info-outline-rounded-DovRYvXo.js +1 -0
- package/dist/assets/{invitation-BP8hOEFv.js → invitation-DAWt0g1f.js} +3 -3
- package/dist/assets/{invitations-C8aZLxdl.js → invitations-B18y415k.js} +2 -2
- package/dist/assets/invite-DNSyQ-zG.js +1 -0
- package/dist/assets/issue-passport-Dd43b9Se.js +1 -0
- package/dist/assets/item-Cr70mAvV.js +1 -0
- package/dist/assets/{ja-DZPUwZ9l.js → ja-LErFaY57.js} +1 -1
- package/dist/assets/{ko-q4i4r9g6.js → ko-D4ub28je.js} +1 -1
- package/dist/assets/{landing-page-JLA-ZD1t.js → landing-page-CZoTtLnc.js} +1 -1
- package/dist/assets/layout-U4Obhm5w.js +29 -0
- package/dist/assets/list-BD3g0v2E.js +2 -0
- package/dist/assets/{list-3MUy-8Ol.js → list-D-9AeBju.js} +3 -3
- package/dist/assets/localization-ByZI4mSj.js +1 -0
- package/dist/assets/{log-Bq445Z1e.js → log-BWxaKOTA.js} +1 -1
- package/dist/assets/logger-B962sOsB.js +1 -0
- package/dist/assets/login-BWZaWrBW.js +1 -0
- package/dist/assets/login-method-item-aEisznLn.js +1 -0
- package/dist/assets/{login-oauth-callback-Bext19kc.js → login-oauth-callback-CB-osgdG.js} +1 -1
- package/dist/assets/{logo-uploader-CyZuvhwV.js → logo-uploader-DOPycN59.js} +1 -1
- package/dist/assets/{lost-passport-BiYg3QQI.js → lost-passport-H1fCptmJ.js} +2 -2
- package/dist/assets/metadata-DftwYKum.js +55 -0
- package/dist/assets/{nav-menu-DSdXRbfg.js → nav-menu-D7Sf6VZj.js} +1 -1
- package/dist/assets/{omit-Dq0FLBY8.js → omit-vVhnMpHQ.js} +1 -1
- package/dist/assets/{open-window-Dyu79ome.js → open-window-By98Pw1o.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DzUsy6q0.js → over-due-invoice-payment-DeFNS-Us.js} +1 -1
- package/dist/assets/overview-DEkktSML.js +116 -0
- package/dist/assets/passport-BxMVp3TG.js +1 -0
- package/dist/assets/passport-item-CIv8Q8Ng.js +1 -0
- package/dist/assets/{permission-CvrrGfG6.js → permission-B22pCnUb.js} +1 -1
- package/dist/assets/preferences-BY_s4EkY.js +1 -0
- package/dist/assets/profile-embed-DUKyv_oX.js +1 -0
- package/dist/assets/provider-icon-DbnLu_85.js +1 -0
- package/dist/assets/pt-BU7pvSz6.js +5 -0
- package/dist/assets/{publish-resource-CMuHIOUf.js → publish-resource-Be5Gs98x.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-CWJ5I9Zv.js → react-beautiful-dnd.esm-D7zp9L4b.js} +1 -1
- package/dist/assets/ru-CtjyU-qF.js +5 -0
- package/dist/assets/{runtime-B_ZLP4FF.js → runtime-MjoLSEeg.js} +1 -1
- package/dist/assets/{sanitize-Bzl4lTuH.js → sanitize-BHeUjEo7.js} +1 -1
- package/dist/assets/sdk-Dy-R7tw7.js +1 -0
- package/dist/assets/security-BtD9TnGk.js +22 -0
- package/dist/assets/session-UEzmH-IS.js +1 -0
- package/dist/assets/setup-Bts0WUxD.js +24 -0
- package/dist/assets/simple-select-C6gRUbia.js +1 -0
- package/dist/assets/{spaces-ix8u0ZiI.js → spaces-DtMVp8Fn.js} +1 -1
- package/dist/assets/start-Dabk9waT.js +187 -0
- package/dist/assets/{starting-progress-CWp5fTY0.js → starting-progress-Ds2lnMge.js} +1 -1
- package/dist/assets/{status-Dn_LKaNp.js → status-CicPnfGJ.js} +1 -1
- package/dist/assets/{step-actions-DIZRcnXf.js → step-actions-CnJCnymc.js} +1 -1
- package/dist/assets/{studio-CVIa8-XY.js → studio-D7qZJqJ7.js} +1 -1
- package/dist/assets/{switch-control-BRjXGc1d.js → switch-control-C5gj6NIz.js} +1 -1
- package/dist/assets/{switch-BbyTGEOo.js → switch-qh9YpwMi.js} +1 -1
- package/dist/assets/{table-tips-Dvmdodc5.js → table-tips-BSl1oNMX.js} +1 -1
- package/dist/assets/team-Djzt5BWc.js +146 -0
- package/dist/assets/th-C0DkNnMF.js +5 -0
- package/dist/assets/theme-mode-toggle-Jvn37gNg.js +1 -0
- package/dist/assets/traffic-BtuX1qMz.js +1 -0
- package/dist/assets/transfer-UdrQjD9F.js +16 -0
- package/dist/assets/unsubscribe-Bj2S8OkH.js +1 -0
- package/dist/assets/{use-app-logo-IRizt64R.js → use-app-logo-DyU2iSXF.js} +1 -1
- package/dist/assets/{use-blocklet-logo-Cf1j7pQz.js → use-blocklet-logo-ys-h-CV_.js} +1 -1
- package/dist/assets/{use-window-close-Dpj5UcYT.js → use-window-close-CT9brY7I.js} +1 -1
- package/dist/assets/{useAsync-CkKfnulP.js → useAsync-DbIyJl2v.js} +1 -1
- package/dist/assets/{useAsync-DfiOQMQ_.js → useAsync-WuOY1bFS.js} +1 -1
- package/dist/assets/{useAsyncRetry-C4R9ufi-.js → useAsyncRetry-cAGDIsw4.js} +1 -1
- package/dist/assets/{useLocalStorage-BQfIniHX.js → useLocalStorage-D8kgfBAn.js} +1 -1
- package/dist/assets/{user-center-6K47tx8j.js → user-center-DLgnUI1s.js} +5 -5
- package/dist/assets/{user-follower-BwzTutxU.js → user-follower-BbQfOSyh.js} +4 -4
- package/dist/assets/util-BCpVIbwL.js +1 -0
- package/dist/assets/util-tg9hB6_c.js +1 -0
- package/dist/assets/{vendor-arcblock-Dll6qxMT.js → vendor-arcblock-Xw2zMy0D.js} +1 -1
- package/dist/assets/{vendor-hooks-DAZ1H6Va.js → vendor-hooks-164oA5kM.js} +1 -1
- package/dist/assets/vendor-utils-BbcnEeJI.js +23 -0
- package/dist/assets/{vendor-ux-CLT2i3Pv.js → vendor-ux-BGqHwkOM.js} +10 -10
- package/dist/assets/vi-nXB9zTif.js +5 -0
- package/dist/assets/wait-connect-BED_xYYA.js +1 -0
- package/dist/assets/wallet-hidden-topbar-dnCLvPpW.js +68 -0
- package/dist/assets/wizard-C6DvqdjM.js +8 -0
- package/dist/assets/wizard-components-1u7l8zuE.js +52 -0
- package/dist/assets/wrap-locale-C2lxMNe7.js +1 -0
- package/dist/assets/{zh-G2I44gfs.js → zh-DK-_Edsp.js} +1 -1
- package/dist/assets/zh-QEwKQjt8.js +1 -0
- package/dist/assets/{zh-tw-C4Juvs-i.js → zh-tw-Us2SjBNr.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +24 -24
- package/dist/assets/access-control-RI6LQbSm.js +0 -14
- package/dist/assets/actions-BlWED76c.js +0 -64
- package/dist/assets/add-resource-BVOdOQSW.js +0 -1
- package/dist/assets/advanced-CuKHqbLO.js +0 -14
- package/dist/assets/api-B8JXuhVp.js +0 -1
- package/dist/assets/appearance-C9TkbSjV.js +0 -1
- package/dist/assets/audit-logs-DKGke9hI.js +0 -35
- package/dist/assets/authorize-DkSqywe8.js +0 -1
- package/dist/assets/bind-account-DOwM9Nhe.js +0 -1
- package/dist/assets/branding-Cak2s8bn.js +0 -1
- package/dist/assets/branding-lcfxmmPp.js +0 -40
- package/dist/assets/bundle-avatar-DwiOyeMO.js +0 -1
- package/dist/assets/button-uUU4Wycr.js +0 -1
- package/dist/assets/complete-Udiv_yFp.js +0 -39
- package/dist/assets/config-6IwEgT3b.js +0 -32
- package/dist/assets/config-CJwxv2uK.js +0 -1
- package/dist/assets/connect-DA7RO2yv.js +0 -1
- package/dist/assets/connect-to-CQMUbQkH.js +0 -1
- package/dist/assets/dashboard-BvI3ii8Z.js +0 -93
- package/dist/assets/domain-action-card-kMPYS2Nj.js +0 -28
- package/dist/assets/domains-TI6o1CvX.js +0 -1
- package/dist/assets/email-DHRHueET.js +0 -17
- package/dist/assets/engine-D_fEFx9_.js +0 -1
- package/dist/assets/exchange-passport-Cc872mjQ.js +0 -1
- package/dist/assets/gen-access-key-DrgLVRbm.js +0 -1
- package/dist/assets/gen-simple-access-key-B24d6k7g.js +0 -1
- package/dist/assets/get-safe-url-beob4f2C.js +0 -1
- package/dist/assets/hi-5fpYJkiW.js +0 -5
- package/dist/assets/home-Dw18IODa.js +0 -1
- package/dist/assets/index--WQuhwJL.js +0 -6
- package/dist/assets/index-B-8044Gs.js +0 -280
- package/dist/assets/index-B6l4xGy5.js +0 -7
- package/dist/assets/index-BOPR4Iyc.js +0 -88
- package/dist/assets/index-BeunkI-Z.js +0 -242
- package/dist/assets/index-Bpic07NM.js +0 -200
- package/dist/assets/index-C4ZzROeE.js +0 -120
- package/dist/assets/index-CXp5SI_f.js +0 -832
- package/dist/assets/index-DKzBOJCu.js +0 -81
- package/dist/assets/index-DL0wTcgx.js +0 -1
- package/dist/assets/index-DWHFecw2.js +0 -150
- package/dist/assets/index-DcW3jqfL.js +0 -6
- package/dist/assets/index-Vf51dp11.js +0 -124
- package/dist/assets/index-bEFOmVth.js +0 -1
- package/dist/assets/info-outline-rounded-DlgANjBB.js +0 -1
- package/dist/assets/invite-Cd5zEHFb.js +0 -1
- package/dist/assets/issue-passport-D7zqv3Al.js +0 -1
- package/dist/assets/item-DNj7ORqk.js +0 -1
- package/dist/assets/layout-Cwvm7lmD.js +0 -29
- package/dist/assets/list-BSXHuqLM.js +0 -2
- package/dist/assets/localization-Dond4H78.js +0 -1
- package/dist/assets/logger-CCAAJ2Xo.js +0 -1
- package/dist/assets/login-dc2t9Qyo.js +0 -1
- package/dist/assets/login-method-item-CyTsqz88.js +0 -1
- package/dist/assets/metadata-B2-Ltdko.js +0 -55
- package/dist/assets/overview-0TBmi-_i.js +0 -116
- package/dist/assets/passport-BhEaZ-sr.js +0 -1
- package/dist/assets/passport-item-DHwif94N.js +0 -1
- package/dist/assets/preferences-BBSWzZiT.js +0 -1
- package/dist/assets/profile-embed-shcOdRUI.js +0 -1
- package/dist/assets/provider-icon-DO2PqSth.js +0 -1
- package/dist/assets/pt-BFCHl6F1.js +0 -5
- package/dist/assets/ru-CSTl62kK.js +0 -5
- package/dist/assets/sdk-CktKu_IW.js +0 -1
- package/dist/assets/security-DHRU8k0u.js +0 -22
- package/dist/assets/session-Bp3LV7zJ.js +0 -1
- package/dist/assets/setup-B6-Ei_3X.js +0 -24
- package/dist/assets/simple-select-nI-W90c_.js +0 -1
- package/dist/assets/start-oRp78RMQ.js +0 -187
- package/dist/assets/team-BTz28XqK.js +0 -146
- package/dist/assets/th-D75Dlluo.js +0 -5
- package/dist/assets/theme-mode-toggle-D3bcd10D.js +0 -1
- package/dist/assets/traffic-Cea69sMW.js +0 -1
- package/dist/assets/transfer-BydXCVCg.js +0 -16
- package/dist/assets/unsubscribe-BjAjx-Fl.js +0 -1
- package/dist/assets/util-DkTwHdRu.js +0 -1
- package/dist/assets/util-DySzCymV.js +0 -1
- package/dist/assets/vendor-utils-BzQg432x.js +0 -23
- package/dist/assets/vi-D1mKYrmb.js +0 -5
- package/dist/assets/wait-connect-q0_7mz_u.js +0 -1
- package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +0 -68
- package/dist/assets/wizard-C5Kl-g70.js +0 -8
- package/dist/assets/wizard-components-DQrlaeeW.js +0 -52
- package/dist/assets/wrap-locale-5DJTJTXP.js +0 -1
- package/dist/assets/zh-CJ9vCpmv.js +0 -1
|
@@ -1,93 +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-DrCTi6nm.css"),window.__toCdnUrl("assets/index-ed1TwQco.css"),window.__toCdnUrl("assets/add-component-core-D4DUnQj0.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as i,X as y,b4 as Xe,al as _,G as F,L as ce,ai as Je,ap as ts,bq as ns,I as et,ak as os,aT as tt,br as Dn,bs as Tn,bt as An,an as we,a7 as Z,bb as Be,bu as Gt,V as ie,aL as Mn,T as B,s as Pt,as as ss,n as We,b3 as Rn,Z as Pn,bv as rs,bw as is,bx as as,R as St,by as ls,bz as cs,bA as us,bB as ds,bC as ps,bD as fs,bE as ms,bF as hs,bG as gs,bH as bs,aO as xs,aP as vs,a4 as ys,M as ws,aM as Ss,aN as ks,bI as js,bJ as _s,bK as Qt,bL as Xt,bM as Cs}from"./vendor-mui-core-CV-FnYH_.js";import{r as m,u as On,g as Es,L as Ot,i as Is,a as Ls,m as Ds}from"./vendor-react-DX7tU9aY.js";import{V as G,W as V,c as T,w as Ts,o as N,X as As,Y as $n,M as de,Z as Nn,_ as Ms,$ as Rs,u as Bn,F as $t,x as nt,a0 as Ps,a1 as Os,y as Jt,a2 as en,r as $s,v as Ns,D as Bs,B as he,A as Hs,C as zs,P as Us,G as lt,a3 as ct,k as tn,a4 as Fs,f as Vs,a5 as Ws,a6 as Hn,a7 as Ys,U as nn,a8 as qs,a9 as Ks}from"./index-CXp5SI_f.js";import{o as Ye}from"./vendor-arcblock-Dll6qxMT.js";import{W as R,b5 as Nt,Q as J,b8 as zn,b9 as Zs,ba as Gs,b4 as Un,Y as ke,al as Qs,bb as Xs,z as Js,A as er,bc as tr,M as Fn,b6 as on,bd as nr,_ as I,a6 as or}from"./vendor-ux-CLT2i3Pv.js";import{a as K,b as Vn,d as Bt,t as sr,r as rr}from"./vendor-hooks-DAZ1H6Va.js";import{a6 as ir,r as Wn,a7 as ar,i as lr,F as Yn,z as te,$ as cr,e as ur}from"./vendor-utils-BzQg432x.js";import{u as ot}from"./session-Bp3LV7zJ.js";import{f as Ht}from"./index-DBs9Ljax.js";import{i as dr,u as pr,M as fr,a as mr,b as je,T as hr,N as gr}from"./team-BTz28XqK.js";import{D as br,u as ne}from"./useAsyncRetry-C4R9ufi-.js";import{u as qn}from"./useSetState-CUbypYGT.js";import{k as xr}from"./fallback-D-IHOW-7.js";import{x as vr,d as yr}from"./index-3H6a5edM.js";import{s as wr,L as Sr,N as kr,P as jr,p as _r,A as Cr,W as Er,v as ut,z as Ir,t as Lr,n as Dr}from"./wallet-hidden-topbar-joIVZ1nl.js";import{M as Tr}from"./use-blocklet-logo-Cf1j7pQz.js";import"./zh-CJ9vCpmv.js";import{O as Ar}from"./over-due-invoice-payment-DzUsy6q0.js";import{u as sn}from"./useLocalStorage-BQfIniHX.js";import{C as rn}from"./confirm-CdVn5WdC.js";import{g as dt}from"./get-safe-url-beob4f2C.js";import{c as an}from"./passport-BhEaZ-sr.js";import{M as Mr}from"./provider-icon-DO2PqSth.js";import{g as Rr}from"./spaces-ix8u0ZiI.js";const Kn=m.createContext({});function Zn({children:e,type:t="blocklets"}){const[n,s]=m.useState([]),o=m.useRef([]),r=c=>{if(!o.current.includes(c)){const u=[...o.current,c];s(u),o.current=u}},a=c=>{if(o.current.includes(c)){const u=o.current.filter(d=>d!==c);s(u),o.current=u}},l=c=>{const u=n.filter(p=>c.find(f=>f===p));ir(u,n).forEach(p=>a(p))};return i.jsx(Kn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:r,removeDeletingDid:a,matchDeletingDid:l},children:e})}Zn.propTypes={type:y.string,children:y.node.isRequired};function vc(){return m.useContext(Kn)}const Pr=e=>{const t={};let n=null;return N.forEachBlockletSync(e,s=>{t[s.meta.bundleDid]?n=N.getDisplayName(s,!0):s.meta.bundleDid&&(t[s.meta.bundleDid]=!0)}),n},Or=(e,t,n)=>{const{hostname:s,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(s);if(!a)return o;const l=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(T.DEFAULT_DID_DOMAIN))||"").replace(`.${T.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(s,`${u}-${l}.${T.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function $r(){const{t:e}=R(),{api:t}=ot(),{blocklet:n}=G(),{inService:s}=V(),[o,r]=m.useState(!1),[a,l]=m.useState(5),c=n&&n.structVersion!==T.APP_STRUCT_VERSION,u=()=>{try{if(N.isBlockletRunning(n)){J.error(e("blocklet.migrate.tip.running"));return}const f=Pr(n);if(f){J.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}r(!0)}catch(f){J.error(Ht(f))}},d=()=>{const f=Or(window.location,n,s);setTimeout(()=>{window.location.href=f},5e3),l(5),setInterval(()=>{l(g=>g-1)},1e3)},p=()=>r(!1);return[c&&i.jsxs(Xe,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(Nt,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>i.jsx(_,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&i.jsx(Ts,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:300*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:As(n,!0),title:N.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:p},"connect")]}function Nr(){const e=F();return[...e.breakpoints.keys].reverse().reduce((n,s)=>{const o=ce(e.breakpoints.up(s));return!n&&o?s:n},null)||"xs"}function Br(e){return i.jsx(Je,{...e,children:i.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function Hr(e){return i.jsx(Je,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function zr(e){return i.jsx(Je,{...e,children:i.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function Ur(e){return i.jsx(Je,{...e,children:i.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const Re={fontSize:20,marginInlineEnd:8},Fr={success:i.jsx(Br,{style:Re}),warning:i.jsx(Hr,{style:Re}),error:i.jsx(zr,{style:Re}),info:i.jsx(Ur,{style:Re})},Vr={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Gn({keyId:e,notification:t={},viewAllUrl:n,content:s=null},o){const r=F(),a=Fr[t.severity],{closeSnackbar:l}=zn(),c=()=>l(e),u=On(),d=()=>{l(e),u(n)},p=K(()=>dr(t),[t]),f=K(()=>t?.activity,[t]),g=pr({activity:f,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:r.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),h=Nr();return i.jsxs(_,{component:Zs,ref:o,sx:[{...r.typography.body2,display:"flex",backgroundColor:r.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",width:Vr[h]},t.severity==="success"?{backgroundColor:`${ts[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${r.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${r.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${ns[700]} !important`}:{}],children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(Yr,{onClick:d,sx:{flex:1},children:i.jsx(_,{children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:g}),f.meta?i.jsx(fr,{meta:f.meta,type:f.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),s||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(_,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(et,{"aria-label":"close",color:"inherit",onClick:c,size:"large",children:i.jsx(_,{component:os,sx:{fontSize:20}})},"close")})]})}const Wr=m.forwardRef(Gn);Gn.propTypes={viewAllUrl:y.string.isRequired,keyId:y.number.isRequired,notification:y.object.isRequired,content:y.node};const Yr=tt.div`
|
|
3
|
-
cursor: pointer;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
.title {
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
text-overflow: ellipsis;
|
|
9
|
-
display: -webkit-box;
|
|
10
|
-
-webkit-line-clamp: 2;
|
|
11
|
-
-webkit-box-orient: vertical;
|
|
12
|
-
font-weight: bold;
|
|
13
|
-
}
|
|
14
|
-
.desc {
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
text-overflow: ellipsis;
|
|
17
|
-
display: -webkit-box;
|
|
18
|
-
-webkit-line-clamp: 3;
|
|
19
|
-
-webkit-box-orient: vertical;
|
|
20
|
-
word-break: break-word;
|
|
21
|
-
}
|
|
22
|
-
`;var D=function(t,n,s){return Dn.call(n,"css")?i.jsx(Tn,An(t,n),s):i.jsx(t,n,s)},Pe=function(t,n,s){return Dn.call(n,"css")?i.jsxs(Tn,An(t,n),s):i.jsxs(t,n,s)};const Qn=Object.freeze({left:0,top:0,width:16,height:16}),qe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),_e=Object.freeze({...Qn,...qe}),kt=Object.freeze({..._e,body:"",hidden:!1});function qr(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const s=((e.rotate||0)+(t.rotate||0))%4;return s&&(n.rotate=s),n}function ln(e,t){const n=qr(e,t);for(const s in kt)s in qe?s in e&&!(s in n)&&(n[s]=qe[s]):s in t?n[s]=t[s]:s in e&&(n[s]=e[s]);return n}function Kr(e,t){const n=e.icons,s=e.aliases||Object.create(null),o=Object.create(null);function r(a){if(n[a])return o[a]=[];if(!(a in o)){o[a]=null;const l=s[a]&&s[a].parent,c=l&&r(l);c&&(o[a]=[l].concat(c))}return o[a]}return Object.keys(n).concat(Object.keys(s)).forEach(r),o}function Zr(e,t,n){const s=e.icons,o=e.aliases||Object.create(null);let r={};function a(l){r=ln(s[l]||o[l],r)}return a(t),n.forEach(a),ln(e,r)}function Gr(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const s=Kr(e);for(const o in s){const r=s[o];r&&(t(o,Zr(e,o,r)),n.push(o))}return n}const xe=/^[a-z0-9]+(-[a-z0-9]+)*$/,fe=(e,t,n,s="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;s=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const l=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:s,prefix:c,name:l};return t&&!He(u)?null:u}const r=o[0],a=r.split("-");if(a.length>1){const l={provider:s,prefix:a.shift(),name:a.join("-")};return t&&!He(l)?null:l}if(n&&s===""){const l={provider:s,prefix:"",name:r};return t&&!He(l,n)?null:l}return null},He=(e,t)=>e?!!((e.provider===""||e.provider.match(xe))&&(t&&e.prefix===""||e.prefix.match(xe))&&e.name.match(xe)):!1,Qr={provider:"",aliases:{},not_found:{},...Qn};function pt(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Xr(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!pt(e,Qr))return null;const n=t.icons;for(const o in n){const r=n[o];if(!o.match(xe)||typeof r.body!="string"||!pt(r,kt))return null}const s=t.aliases||Object.create(null);for(const o in s){const r=s[o],a=r.parent;if(!o.match(xe)||typeof a!="string"||!n[a]&&!s[a]||!pt(r,kt))return null}return t}const Ke=Object.create(null);function Jr(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function U(e,t){const n=Ke[e]||(Ke[e]=Object.create(null));return n[t]||(n[t]=Jr(e,t))}function zt(e,t){return Xr(t)?Gr(t,(n,s)=>{s?e.icons[n]=s:e.missing.add(n)}):[]}function ei(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function ti(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Ke)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Ke[o]||{})).forEach(a=>{const l=U(o,a);n=n.concat(Object.keys(l.icons).map(c=>(o!==""?"@"+o+":":"")+a+":"+c))})}),n}let Ut=!1;function ni(e){return Ut}function Ce(e){const t=typeof e=="string"?fe(e,!0,Ut):e;if(t){const n=U(t.provider,t.prefix),s=t.name;return n.icons[s]||(n.missing.has(s)?null:void 0)}}function oi(e,t){const n=fe(e,!0,Ut);if(!n)return!1;const s=U(n.provider,n.prefix);return ei(s,n.name,t)}function Xn(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!He({provider:t,prefix:n,name:"a"}))return!1;const s=U(t,n);return!!zt(s,e)}function si(e){return!!Ce(e)}function ri(e){const t=Ce(e);return t?{..._e,...t}:null}const Jn=Object.freeze({width:null,height:null}),eo=Object.freeze({...Jn,...qe}),ii=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ai=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function jt(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const s=e.split(ii);if(s===null||!s.length)return e;const o=[];let r=s.shift(),a=ai.test(r);for(;;){if(a){const l=parseFloat(r);isNaN(l)?o.push(r):o.push(Math.ceil(l*t*n)/n)}else o.push(r);if(r=s.shift(),r===void 0)return o.join("");a=!a}}const li=e=>e==="unset"||e==="undefined"||e==="none";function st(e,t){const n={..._e,...e},s={...eo,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,s].forEach(h=>{const x=[],v=h.hFlip,j=h.vFlip;let b=h.rotate;v?j?b+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):j&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let k;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:k=o.height/2+o.top,x.unshift("rotate(90 "+k.toString()+" "+k.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:k=o.width/2+o.left,x.unshift("rotate(-90 "+k.toString()+" "+k.toString()+")");break}b%2===1&&(o.left!==o.top&&(k=o.left,o.left=o.top,o.top=k),o.width!==o.height&&(k=o.width,o.width=o.height,o.height=k)),x.length&&(r='<g transform="'+x.join(" ")+'">'+r+"</g>")});const a=s.width,l=s.height,c=o.width,u=o.height;let d,p;a===null?(p=l===null?"1em":l==="auto"?u:l,d=jt(p,c/u)):(d=a==="auto"?c:a,p=l===null?jt(d,u/c):l==="auto"?u:l);const f={},g=(h,x)=>{li(x)||(f[h]=x.toString())};return g("width",d),g("height",p),f.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:f,body:r}}const ci=/\sid="(\S+)"/g,ui="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let di=0;function to(e,t=ui){const n=[];let s;for(;s=ci.exec(e);)n.push(s[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(r=>{const a=typeof t=="function"?t(r):t+(di++).toString(),l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const ae={local:!0,session:!0},no={local:new Set,session:new Set};let Ft=!1;function pi(e){Ft=e}const cn="iconify2",Se="iconify",oo=Se+"-count",un=Se+"-version",so=36e5,fi=168;function _t(e,t){try{return e.getItem(t)}catch{}}function Vt(e,t,n){try{return e.setItem(t,n),!0}catch{}}function dn(e,t){try{e.removeItem(t)}catch{}}function Ct(e,t){return Vt(e,oo,t.toString())}function Et(e){return parseInt(_t(e,oo))||0}let Oe=typeof window>"u"?{}:window;function ro(e){const t=e+"Storage";try{if(Oe&&Oe[t]&&typeof Oe[t].length=="number")return Oe[t]}catch{}ae[e]=!1}function io(e,t){const n=ro(e);if(!n)return;const s=_t(n,un);if(s!==cn){if(s){const l=Et(n);for(let c=0;c<l;c++)dn(n,Se+c.toString())}Vt(n,un,cn),Ct(n,0);return}const o=Math.floor(Date.now()/so)-fi,r=l=>{const c=Se+l.toString(),u=_t(n,c);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,l))return!0}catch{}dn(n,c)}};let a=Et(n);for(let l=a-1;l>=0;l--)r(l)||(l===a-1?(a--,Ct(n,a)):no[e].add(l))}function ao(){if(!Ft){pi(!0);for(const e in ae)io(e,t=>{const n=t.data,s=t.provider,o=n.prefix,r=U(s,o);if(!zt(r,n).length)return!1;const a=n.lastModified||-1;return r.lastModifiedCached=r.lastModifiedCached?Math.min(r.lastModifiedCached,a):a,!0})}}function lo(e,t){switch(e){case"local":case"session":ae[e]=t;break;case"all":for(const n in ae)ae[n]=t;break}}const It=Object.create(null);function co(e,t){It[e]=t}function Lt(e){return It[e]||It[""]}function Wt(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const rt=Object.create(null),ge=["https://api.simplesvg.com","https://api.unisvg.com"],ze=[];for(;ge.length>0;)ge.length===1||Math.random()>.5?ze.push(ge.shift()):ze.push(ge.pop());rt[""]=Wt({resources:["https://api.iconify.design"].concat(ze)});function uo(e,t){const n=Wt(t);return n===null?!1:(rt[e]=n,!0)}function it(e){return rt[e]}function mi(){return Object.keys(rt)}const hi=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Ze=hi();function gi(e){Ze=e}function bi(){return Ze}function xi(e,t){const n=it(e);if(!n)return 0;let s;if(!n.maxURL)s=0;else{let o=0;n.resources.forEach(a=>{o=Math.max(o,a.length)});const r=t+".json?icons=";s=n.maxURL-o-n.path.length-r.length}return s}function vi(e){return e===404}const yi=(e,t,n)=>{const s=[],o=xi(e,t),r="icons";let a={type:r,provider:e,prefix:t,icons:[]},l=0;return n.forEach((c,u)=>{l+=c.length+1,l>=o&&u>0&&(s.push(a),a={type:r,provider:e,prefix:t,icons:[]},l=c.length),a.icons.push(c)}),s.push(a),s};function wi(e){if(typeof e=="string"){const t=it(e);if(t)return t.path}return"/"}const Si=(e,t,n)=>{if(!Ze){n("abort",424);return}let s=wi(t.provider);switch(t.type){case"icons":{const r=t.prefix,l=t.icons.join(","),c=new URLSearchParams({icons:l});s+=r+".json?"+c.toString();break}case"custom":{const r=t.uri;s+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;Ze(e+s).then(r=>{const a=r.status;if(a!==200){setTimeout(()=>{n(vi(a)?"abort":"next",a)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},ki={prepare:yi,send:Si};function ji(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let s={provider:"",prefix:"",name:""};return e.forEach(o=>{if(s.name===o.name&&s.prefix===o.prefix&&s.provider===o.provider)return;s=o;const r=o.provider,a=o.prefix,l=o.name,c=n[r]||(n[r]=Object.create(null)),u=c[a]||(c[a]=U(r,a));let d;l in u.icons?d=t.loaded:a===""||u.missing.has(l)?d=t.missing:d=t.pending;const p={provider:r,prefix:a,name:l};d.push(p)}),t}function po(e,t){e.forEach(n=>{const s=n.loaderCallbacks;s&&(n.loaderCallbacks=s.filter(o=>o.id!==t))})}function _i(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const s=e.provider,o=e.prefix;t.forEach(r=>{const a=r.icons,l=a.pending.length;a.pending=a.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(e.icons[u])a.loaded.push({provider:s,prefix:o,name:u});else if(e.missing.has(u))a.missing.push({provider:s,prefix:o,name:u});else return n=!0,!0;return!1}),a.pending.length!==l&&(n||po([e],r.id),r.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),r.abort))})}))}let Ci=0;function Ei(e,t,n){const s=Ci++,o=po.bind(null,n,s);if(!t.pending.length)return o;const r={id:s,icons:t,callback:e,abort:o};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(r)}),o}function Ii(e,t=!0,n=!1){const s=[];return e.forEach(o=>{const r=typeof o=="string"?fe(o,t,n):o;r&&s.push(r)}),s}var Li={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Di(e,t,n,s){const o=e.resources.length,r=e.random?Math.floor(Math.random()*o):e.index;let a;if(e.random){let S=e.resources.slice(0);for(a=[];S.length>1;){const C=Math.floor(Math.random()*S.length);a.push(S[C]),S=S.slice(0,C).concat(S.slice(C+1))}a=a.concat(S)}else a=e.resources.slice(r).concat(e.resources.slice(0,r));const l=Date.now();let c="pending",u=0,d,p=null,f=[],g=[];typeof s=="function"&&g.push(s);function h(){p&&(clearTimeout(p),p=null)}function x(){c==="pending"&&(c="aborted"),h(),f.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),f=[]}function v(S,C){C&&(g=[]),typeof S=="function"&&g.push(S)}function j(){return{startTime:l,payload:t,status:c,queriesSent:u,queriesPending:f.length,subscribe:v,abort:x}}function b(){c="failed",g.forEach(S=>{S(void 0,d)})}function k(){f.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),f=[]}function L(S,C,A){const O=C!=="success";switch(f=f.filter(E=>E!==S),c){case"pending":break;case"failed":if(O||!e.dataAfterTimeout)return;break;default:return}if(C==="abort"){d=A,b();return}if(O){d=A,f.length||(a.length?P():b());return}if(h(),k(),!e.random){const E=e.resources.indexOf(S.resource);E!==-1&&E!==e.index&&(e.index=E)}c="completed",g.forEach(E=>{E(A)})}function P(){if(c!=="pending")return;h();const S=a.shift();if(S===void 0){if(f.length){p=setTimeout(()=>{h(),c==="pending"&&(k(),b())},e.timeout);return}b();return}const C={status:"pending",resource:S,callback:(A,O)=>{L(C,A,O)}};f.push(C),u++,p=setTimeout(P,e.rotate),n(S,t,C.callback)}return setTimeout(P),j}function fo(e){const t={...Li,...e};let n=[];function s(){n=n.filter(l=>l().status==="pending")}function o(l,c,u){const d=Di(t,l,c,(p,f)=>{s(),u&&u(p,f)});return n.push(d),d}function r(l){return n.find(c=>l(c))||null}return{query:o,find:r,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:s}}function pn(){}const ft=Object.create(null);function Ti(e){if(!ft[e]){const t=it(e);if(!t)return;const n=fo(t),s={config:t,redundancy:n};ft[e]=s}return ft[e]}function mo(e,t,n){let s,o;if(typeof e=="string"){const r=Lt(e);if(!r)return n(void 0,424),pn;o=r.send;const a=Ti(e);a&&(s=a.redundancy)}else{const r=Wt(e);if(r){s=fo(r);const a=e.resources?e.resources[0]:"",l=Lt(a);l&&(o=l.send)}}return!s||!o?(n(void 0,424),pn):s.query(t,o,n)().abort}function Ai(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const s in ae)io(s,o=>{const r=o.data;return o.provider!==e.provider||r.prefix!==e.prefix||r.lastModified===t});return!0}function Mi(e,t){Ft||ao();function n(s){let o;if(!ae[s]||!(o=ro(s)))return;const r=no[s];let a;if(r.size)r.delete(a=Array.from(r).shift());else if(a=Et(o),!Ct(o,a+1))return;const l={cached:Math.floor(Date.now()/so),provider:e.provider,data:t};return Vt(o,Se+a.toString(),JSON.stringify(l))}t.lastModified&&!Ai(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function fn(){}function Ri(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,_i(e)}))}function Pi(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:s}=e,o=e.iconsToLoad;delete e.iconsToLoad;let r;if(!o||!(r=Lt(n)))return;r.prepare(n,s,o).forEach(l=>{mo(n,l,c=>{if(typeof c!="object")l.icons.forEach(u=>{e.missing.add(u)});else try{const u=zt(e,c);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),Mi(e,c)}catch(u){console.error(u)}Ri(e)})})}))}const Oi=e=>{const n=U(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},Yt=(e,t)=>{const n=Ii(e,!0,ni()),s=ji(n);if(!s.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(s.loaded,s.missing,s.pending,fn)}),()=>{c=!1}}const o=Object.create(null),r=[];let a,l;return s.pending.forEach(c=>{const{provider:u,prefix:d}=c;if(d===l&&u===a)return;a=u,l=d,r.push(U(u,d));const p=o[u]||(o[u]=Object.create(null));p[d]||(p[d]=[])}),s.pending.forEach(c=>{const{provider:u,prefix:d,name:p}=c,f=U(u,d),g=f.pendingIcons||(f.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][d].push(p))}),r.forEach(c=>{const{provider:u,prefix:d}=c;o[u][d].length&&Pi(c,o[u][d])}),t?Ei(t,s,r):fn},$i=e=>new Promise((t,n)=>{const s=typeof e=="string"?fe(e,!0):e;if(!s){n(e);return}Yt([s||e],o=>{if(o.length&&s){const r=Ce(s);if(r){t({..._e,...r});return}}n(e)})});function ho(e,t){const n={...e};for(const s in t){const o=t[s],r=typeof o;s in Jn?(o===null||o&&(r==="string"||r==="number"))&&(n[s]=o):r===typeof n[s]&&(n[s]=s==="rotate"?o%4:o)}return n}const at={...eo,inline:!1},mt="iconify",Dt="iconify-inline",oe="iconifyData"+Date.now();let le=[];function Ee(e){for(let t=0;t<le.length;t++){const n=le[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function go(e,t=!1){let n=Ee(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},le.push(n),n)}function Ni(){if(document.documentElement)return go(document.documentElement);le.push({node:()=>document.documentElement})}function Bi(e){le=le.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function Ie(){return le}function Hi(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let ve=null;const zi={childList:!0,subtree:!0,attributes:!0};function bo(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,ve&&ve(e)}))}function Ui(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let s=0;s<t.length;s++){const o=t[s];if(o.addedNodes&&o.addedNodes.length>0||o.type==="attributes"&&o.target[oe]!==void 0){n.paused||bo(e);return}}}function xo(e,t){e.observer.instance.observe(t,zi)}function Ge(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(Ui.bind(null,e)),xo(e,n),t.paused||bo(e))}function mn(){Ie().forEach(Ge)}function vo(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function Fi(e){const t=ve!==null;if(ve!==e&&(ve=e,t&&Ie().forEach(vo)),t){mn();return}Hi(mn)}function Tt(e){(e?[e]:Ie()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function Vi(e){if(e){const t=Ee(e);t&&Tt(t)}else Tt()}function At(e){(e?[e]:Ie()).forEach(t=>{if(!t.observer){Ge(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const s=typeof t.node=="function"?t.node():t.node;if(s)n.instance?xo(t,s):Ge(t);else return}})}function Wi(e){if(e){const t=Ee(e);t&&At(t)}else At()}function yo(e,t=!1){const n=go(e,t);return Ge(n),n}function wo(e){const t=Ee(e);t&&(vo(t),Bi(e))}function Yi(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,s=t.customisations;for(const o in at)if(n[o]!==s[o])return!0;return!1}function qi(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function s(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:s(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?s(r):0)}}return t}const Ki=/[\s,]+/;function Zi(e,t){t.split(Ki).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Gi=["width","height"],Qi=["inline","hFlip","vFlip"];function Xi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function Ji(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&fe(t,!0);if(!n)return null;const s={...at,inline:e.classList&&e.classList.contains(Dt)};Gi.forEach(l=>{const c=e.getAttribute("data-"+l);c&&(s[l]=c)});const o=e.getAttribute("data-rotate");typeof o=="string"&&(s.rotate=qi(o));const r=e.getAttribute("data-flip");typeof r=="string"&&Zi(s,r),Qi.forEach(l=>{const c="data-"+l,u=Xi(e.getAttribute(c),c);typeof u=="boolean"&&(s[l]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:s,mode:a}}const ea="svg."+mt+", i."+mt+", span."+mt+", i."+Dt+", span."+Dt;function ta(e){const t=[];return e.querySelectorAll(ea).forEach(n=>{const s=n[oe]||n.tagName.toLowerCase()!=="svg"?Ji(n):null;s&&t.push({node:n,props:s})}),t}function So(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in t)n+=" "+s+'="'+t[s]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let ye;function na(){try{ye=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ye=null}}function oa(e){return ye===void 0&&na(),ye?ye.createHTML(e):e}function ko(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function jo(e,t,n,s){const o=e.classList;if(s){const a=s.classList;Array.from(a).forEach(l=>{o.add(l)})}const r=[];return t.forEach(a=>{o.contains(a)?n.has(a)&&r.push(a):(o.add(a),r.push(a))}),n.forEach(a=>{t.has(a)||o.remove(a)}),r}function _o(e,t,n){const s=e.style;(n||[]).forEach(r=>{s.removeProperty(r)});const o=[];for(const r in t)s.getPropertyValue(r)||(o.push(r),s.setProperty(r,t[r]));return o}function Co(e,t,n){let s;try{s=document.createElement("span")}catch{return e}const o=t.customisations,r=st(n,o),a=e[oe],l=So(to(r.body),{"aria-hidden":"true",role:"img",...r.attributes});s.innerHTML=oa(l);const c=s.childNodes[0],u=e.attributes;for(let h=0;h<u.length;h++){const x=u.item(h),v=x.name;v!=="class"&&!c.hasAttribute(v)&&c.setAttribute(v,x.value)}const d=ko(t.icon),p=jo(c,d,new Set(a&&a.addedClasses),e),f=_o(c,o.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),g={...t,status:"loaded",addedClasses:p,addedStyles:f};return c[oe]=g,e.parentNode&&e.parentNode.replaceChild(c,e),c}function sa(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ra(e){return"data:image/svg+xml,"+sa(e)}function ia(e){return'url("'+ra(e)+'")'}const aa={display:"inline-block"},Mt={"background-color":"currentColor"},Eo={"background-color":"transparent"},hn={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},gn={"-webkit-mask":Mt,mask:Mt,background:Eo};for(const e in gn){const t=gn[e];for(const n in hn)t[e+"-"+n]=hn[n]}function bn(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function la(e,t,n,s){const o=t.customisations,r=st(n,o),a=r.attributes,l=e[oe],c=So(r.body,{...a,width:n.width+"",height:n.height+""}),u=ko(t.icon),d=jo(e,u,new Set(l&&l.addedClasses)),f={"--svg":ia(c),width:bn(a.width),height:bn(a.height),...aa,...s?Mt:Eo};o.inline&&(f["vertical-align"]="-0.125em");const g=_o(e,f,l&&l.addedStyles),h={...t,status:"loaded",addedClasses:d,addedStyles:g};return e[oe]=h,e}let $e=!1;function ca(){$e||($e=!0,setTimeout(()=>{$e&&($e=!1,pe())}))}function pe(e,t=!1){const n=Object.create(null);function s(o,r){const{provider:a,prefix:l,name:c}=o,u=U(a,l),d=u.icons[c];if(d)return{status:"loaded",icon:d};if(u.missing.has(c))return{status:"missing"};if(r&&!Oi(o)){const p=n[a]||(n[a]=Object.create(null));(p[l]||(p[l]=new Set)).add(c)}return{status:"loading"}}(e?[e]:Ie()).forEach(o=>{const r=typeof o.node=="function"?o.node():o.node;if(!r||!r.querySelectorAll)return;let a=!1,l=!1;function c(u,d,p){if(l||(l=!0,Tt(o)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,g=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof g=="boolean"){la(u,d,{..._e,...p},g);return}}Co(u,d,p)}ta(r).forEach(({node:u,props:d})=>{const p=u[oe];if(!p){const{status:g,icon:h}=s(d.icon,!0);if(h){c(u,d,h);return}a=a||g==="loading",u[oe]={...d,status:g};return}let f;if(Yi(p,d)){if(f=s(d.icon,p.name!==d.name),!f.icon){a=a||f.status==="loading",Object.assign(p,{...d,status:f.status});return}}else{if(p.status!=="loading")return;if(f=s(d.icon,!1),!f.icon){p.status=f.status;return}}c(u,d,f.icon)}),o.temporary&&!a?wo(r):t&&a?yo(r,!0):l&&o.observer&&At(o)});for(const o in n){const r=n[o];for(const a in r){const l=r[a];Yt(Array.from(l).map(c=>({provider:o,prefix:a,name:c})),ca)}}}function ua(e){const t=Ee(e);t?pe(t):pe({node:e,temporary:!0},!0)}function Io(e,t,n=!1){const s=Ce(e);if(!s)return null;const o=fe(e),r=ho(at,t||{}),a=Co(document.createElement("span"),{name:e,icon:o,customisations:r},s);return n?a.outerHTML:a}function da(){return"3.1.1"}function pa(e,t){return Io(e,t,!1)}function fa(e,t){return Io(e,t,!0)}function ma(e,t){const n=Ce(e);if(!n)return null;const s=ho(at,t||{});return st(n,s)}function ha(e){e?ua(e):pe()}if(typeof document<"u"&&typeof window<"u"){Ni();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(s=>{try{(typeof s!="object"||s===null||s instanceof Array||typeof s.icons!="object"||typeof s.prefix!="string"||!Xn(s))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{Fi(pe),pe()})}function ga(e,t){lo(e,t!==!1)}function ba(e){lo(e,!0)}co("",ki);if(typeof document<"u"&&typeof window<"u"){ao();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const s="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;uo(n,o)||console.error(s)}catch{console.error(s)}}}}const xa={getAPIConfig:it,setAPIModule:co,sendAPIQuery:mo,setFetch:gi,getFetch:bi,listAPIProviders:mi},va={_api:xa,addAPIProvider:uo,loadIcons:Yt,loadIcon:$i,iconExists:si,getIcon:ri,listIcons:ti,addIcon:oi,addCollection:Xn,replaceIDs:to,calculateSize:jt,buildIcon:st,getVersion:da,renderSVG:pa,renderHTML:fa,renderIcon:ma,scan:ha,observe:yo,stopObserving:wo,pauseObserver:Vi,resumeObserver:Wi,enableCache:ga,disableCache:ba};try{self.Iconify===void 0&&(self.Iconify=va)}catch{}function Lo({children:e,style:t={},...n}){return i.jsx(Gs,{style:t,...n,children:e})}Lo.propTypes={children:y.any.isRequired,style:y.object};const $={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},Ue={added:$.grey,waiting:$.yellow,downloading:$.yellow,extracting:$.yellow,downloaded:$.grey,installing:$.yellow,installed:$.grey,starting:$.yellow,running:$.running,stopping:$.yellow,stopped:$.reverse,error:$.error,upgrading:$.yellow,restarting:$.yellow,corrupted:$.error,deleting:$.yellow,resource:$.primary},xn={added:"primary",waiting:"info",downloading:"info",extracting:"info",downloaded:"primary",installing:"info",installed:"primary",starting:"info",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"info",restarting:"info",corrupted:"error",deleting:"warning",resource:"primary"};function Do({isResource:e=!1,status:t,variant:n="tag",progress:s=0,tip:o="",...r}){const{t:a}=m.useContext(Un),l=N.isInProgress(t);let c=e&&t==="stopped"?"resource":t;xn[c]||(c="installed");const u=a(`blocklet.status.${c}`);return n==="pin"?i.jsx(we,{title:a("blocklet.statusTip",{status:u}),children:i.jsxs(_,{...r,sx:[{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:[i.jsx(_,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Ue[c]}}),i.jsx(_,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Ue[c]}})]})}):n==="dot"?i.jsx(we,{title:a("blocklet.statusTip",{status:u}),children:i.jsx(br,{color:Ue[c],...r})}):i.jsxs(Lo,{type:xn[c],...r,children:[l&&i.jsx(Z,{size:12,color:"inherit",style:{marginRight:5}}),u,o&&i.jsx("span",{style:{marginLeft:5},children:o}),c==="downloading"&&s?i.jsx("div",{style:{marginLeft:5},children:`${s} %`}):null]})}Do.propTypes={status:y.string.isRequired,variant:y.oneOf(["dot","tag","pin"]),source:y.string,progress:y.number,isResource:y.bool,tip:y.string};function To({infos:e=[]}){const{t}=R(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(o=>{n.searchParams.set(o.label,o.value)});const s=e.map(o=>`* ${o.label}: ${o.value}`).join(`
|
|
23
|
-
`);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<!--
|
|
28
|
-
[Server Info]
|
|
29
|
-
${s}
|
|
30
|
-
* Page: ${window.location.href}
|
|
31
|
-
-->
|
|
32
|
-
`),D(_,{sx:{mx:{xs:0,md:2}},children:D(Be,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}To.propTypes={infos:y.arrayOf(y.shape({label:y.string,value:y.string}))};var ht,vn;function ya(){return vn||(vn=1,ht={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}}),ht}var gt,yn;function wa(){return yn||(yn=1,gt={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}}),gt}var bt,wn;function Ao(){if(wn)return bt;wn=1;const e=new Map;return bt={registerLang:(s,o)=>{e.set(s,o)},getLang:(s="en_US")=>e.get(s)||e.get("en_US")},bt}var xt,Sn;function Sa(){return Sn||(Sn=1,xt=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}}),xt}var vt,kn;function ka(){if(kn)return vt;kn=1;const e=Sa(),{getLang:t}=Ao(),n=(o,r)=>r===1?o:`${o}s`,s=1e-7;return vt=(o,r={})=>{if(!Number.isFinite(o))throw new TypeError("Expected a finite number");r.colonNotation&&(r.compact=!1,r.formatSubMilliseconds=!1,r.separateMilliseconds=!1,r.verbose=!1),r.compact&&(r.secondsDecimalDigits=0,r.millisecondsDecimalDigits=0);const a=t(r.locale),l=[],c=(p,f)=>{const g=Math.floor(p*10**f+s);return(Math.round(g)/10**f).toFixed(f)},u=(p,f,g)=>{if((l.length===0||!r.colonNotation)&&p===0&&!(r.colonNotation&&f==="minute"))return;const{long:h}=a[f]||t("en_US")[f],{short:x}=a[f]||t("en_US")[f];let v=(g||p||"0").toString(),j,b;if(r.colonNotation){j=l.length>0?":":"",b="";const k=v.includes(".")?v.split(".")[0].length:v.length,L=l.length>0?2:1;v="0".repeat(Math.max(0,L-k))+v}else j="",r.locale==="zh_CN"?Object.values(d).filter(k=>k>0).length>1?!d.days&&!d.hours&&d.minutes&&r.compact?b=h:b=x:d.minutes?b=h:b=x:b=r.verbose?` ${n(h,p)}`:x;l.push(j+v+b)},d=e(o);if(u(Math.trunc(d.days/365),"year"),u(d.days%365,"day"),u(d.hours,"hour"),u(d.minutes,"minute"),r.separateMilliseconds||r.formatSubMilliseconds||!r.colonNotation&&o<1e3)if(u(d.seconds,"second"),r.formatSubMilliseconds)u(d.milliseconds,"millisecond"),u(d.microseconds,"microsecond"),u(d.nanoseconds,"nanosecond");else{const p=d.milliseconds+d.microseconds/1e3+d.nanoseconds/1e6,f=typeof r.millisecondsDecimalDigits=="number"?r.millisecondsDecimalDigits:0,g=p>=1?Math.round(p):Math.ceil(p),h=f?p.toFixed(f):g;u(Number.parseFloat(h,10),"millisecond",h)}else{const p=o/1e3%60,f=typeof r.secondsDecimalDigits=="number"?r.secondsDecimalDigits:1,g=c(p,f),h=r.keepDecimalsOnWholeSeconds?g:g.replace(/\.0+$/,"");u(Number.parseFloat(h,10),"second",h)}if(l.length===0){const p=(a.millisecond||t("en_US").millisecond).long,f=(a.millisecond||t("en_US").millisecond).short;return r.locale==="zh_CN"?`0${r.verbose?`${p}`:f}`:`0${r.verbose?` ${p}s`:f}`}if(r.compact)return l[0];if(typeof r.unitCount=="number"){const p=r.colonNotation?"":" ";return l.slice(0,Math.max(r.unitCount,1)).join(p)}return r.colonNotation?l.join(""):l.join(" ")},vt}var yt,jn;function ja(){if(jn)return yt;jn=1;const e=ya(),t=wa(),{registerLang:n}=Ao(),s=ka();return n("en_US",e),n("zh_CN",t),s.registerLang=n,yt=s,yt}var _a=ja();const Mo=Es(_a);function ee({children:e}){return ce(n=>n.breakpoints.down("md"))?i.jsx(we,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:i.jsx(_,{sx:{display:"flex",alignItems:"center",gap:1},children:i.jsx(Gt,{fontSize:"small"})})}):i.jsxs(_,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(Gt,{fontSize:"small"}),e]})}ee.propTypes={children:y.node.isRequired};const Ca="https://launcher.arcblock.io/",Ea=720*60*60*1e3;function Ro({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:s="",retention:o=0,sx:r={},...a}){const{t:l,locale:c}=R(),u=V(),[d,p]=qn({safeIframeRef:null,popoverAnchorEl:null}),f=m.useRef(null),g=F(),h=ce(S=>S.breakpoints.down("md")),x=h?"mobile":"desktop",v=ne(async()=>{const[S,C]=await Promise.all([u.api.getLauncherSession({input:{launcherSessionId:s,launcherUrl:e}}),$n({launcherUrl:e||Ca,nftDid:n,launcherSessionId:s,locale:c,theme:g.palette.mode})]);if(S?.error)throw new Error(S.error);return{launcherSession:S.launcherSession,subscriptionURL:C}},[c]);if(v.loading)return i.jsx(ie,{label:i.jsxs(ee,{children:[!h&&l("expiration.desktop.loading"),i.jsx(Z,{size:16})]}),variant:"success",sx:{cursor:"pointer",...r},...a,retention:o});if(v.error)return console.error(v.error),i.jsx(ie,{label:i.jsx(ee,{children:l(`expiration.${x}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...r},...a,retention:o,onClick:()=>v.retry()});const j=S=>{p({popoverAnchorEl:S.currentTarget})},b=()=>{p({popoverAnchorEl:null})},k=v.value?.launcherSession;let L="success";[T.LAUNCH_SESSION_STATUS.overdue,T.LAUNCH_SESSION_STATUS.canceled,T.LAUNCH_SESSION_STATUS.terminated].includes(v.value?.launcherSession?.status)&&(L="error");let P=null;if(k.expirationDate&&!k.subscription){const S=de(k.expirationDate).diff(de(),"ms");P=l(`expiration.${x}.tips.${L}`,{validity:Mo(S,{locale:Nn(c),compact:!0,verbose:!0})}),S>0&&S<=Ea&&(L="warning")}return i.jsxs(i.Fragment,{children:[i.jsx(ie,{label:i.jsx(ee,{children:P||k?.subscription?.product?.name||l("common.subscription")}),color:L,variant:L!=="success"?"contained":"outlined",sx:{cursor:"pointer",...r},...a,retention:o,onClick:j}),i.jsx(Mn,{id:"popover-info",open:!!d.popoverAnchorEl,anchorEl:d.popoverAnchorEl,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(_,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:i.jsx("iframe",{ref:f,title:l("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:v.value?.subscriptionURL})})})]})}Ro.propTypes={chainHost:y.string.isRequired,nftId:y.string,launcherSessionId:y.string,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};const Ia=720*60*60*1e3,La="https://launcher.arcblock.io/";function Po({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:s="",sx:o={},retention:r=0,...a}){const{t:l,locale:c}=R(),[u,d]=qn({safeIframeRef:null,popoverAnchorEl:null}),p=m.useRef(null),f=ce(S=>S.breakpoints.down("md")),g=V(),h=f?"mobile":"desktop",x=ne(async()=>{const[S,C]=await Promise.all([g.api.getLauncherSession({input:{launcherSessionId:s||n,launcherUrl:e}}),$n({launcherUrl:e||La,nftDid:n,launcherSessionId:s,locale:c})]);if(S?.error)throw new Error(S.error);return{launcherSession:S.launcherSession,subscriptionURL:C}},[c]);if(x.loading)return i.jsx(ie,{label:i.jsxs(ee,{children:[!f&&l("expiration.desktop.loading"),i.jsx(Z,{size:16})]}),variant:"success",sx:{cursor:"pointer",...o},...a,retention:r});if(x.error)return console.error(x.error),i.jsx(ie,{label:i.jsx(ee,{children:l(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...o},...a,retention:r,onClick:()=>x.retry()});const v=x.value?.launcherSession?.expirationDate,j=de(v).isBefore(de()),b=de(v).diff(de(),"ms");let k="success";b<=Ia&&(k="warning"),j&&(k="error");const L=S=>{d({popoverAnchorEl:S.currentTarget})},P=()=>{d({popoverAnchorEl:null})};return i.jsxs(i.Fragment,{children:[x.value?.launcherSession?.subscription&&i.jsx(ie,{label:i.jsx(ee,{children:l("expiration.desktop.nextInvoice",{date:Ms(v,c)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...o},...a,retention:r,onClick:L}),!x.value?.launcherSession?.subscription&&i.jsx(ie,{label:i.jsx(ee,{children:l(`expiration.${h}.tips.${k}`,{validity:Mo(b,{locale:Nn(c),compact:!0,verbose:!0})})}),color:k,variant:k!=="success"?"contained":"outlined",sx:{cursor:"pointer",...o},...a,retention:r,onClick:L}),i.jsx(Mn,{id:"popover-info",open:!!u.popoverAnchorEl,anchorEl:u.popoverAnchorEl,onClose:P,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(_,{sx:{width:{xs:"360px",md:"450px"}},children:i.jsx("iframe",{ref:p,title:l("common.subscription"),width:"100%",height:"600px",style:{border:0},src:x.value?.subscriptionURL})})})]})}Po.propTypes={chainHost:y.string.isRequired,nftId:y.string,launcherSessionId:y.string,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};var Fe={exports:{}},Da=Fe.exports,_n;function Ta(){return _n||(_n=1,(function(e,t){(function(n,s){e.exports=s(Wn())})(Da,(function(n){function s(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=s(n),r={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,l){return l==="W"?a+"週":a+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(a,l){var c=100*a+l;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r}))})(Fe)),Fe.exports}Ta();var Ve={exports:{}},Aa=Ve.exports,Cn;function Ma(){return Cn||(Cn=1,(function(e,t){(function(n,s){e.exports=s(Wn())})(Aa,(function(n){function s(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=s(n),r={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a){return a+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(a){return a<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return o.default.locale(r,null,!0),r}))})(Ve)),Ve.exports}Ma();const Ra=(e="")=>e.startsWith("http:")||e.startsWith("https:"),Pa=e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}};Pt("span")(({theme:e,color:t})=>({position:"relative",display:"inline-block",width:e.spacing(1),height:e.spacing(1),borderRadius:"50%",backgroundColor:t,marginRight:e.spacing(1)}));const Ne=Pt(_)(({theme:e})=>({position:"relative",display:"inline-flex",alignItems:"center",height:e.spacing(3),paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),border:"1px solid",borderColor:e.palette.divider,borderRadius:e.shape.borderRadius*.5,fontSize:12,overflow:"hidden","& .app-badge-label":{display:"inline-flex",gap:e.spacing(1),alignItems:"center",lineHeight:e.spacing(3),marginLeft:e.spacing(-1.5),paddingLeft:e.spacing(1.5),marginRight:e.spacing(1),fontSize:12,backgroundColor:e.palette.grey[100],color:e.palette.text.secondary,"&::after":{content:'""',height:e.spacing(3),borderRight:"1px solid",borderColor:e.palette.divider,backgroundColor:e.palette.grey[100]}},"& .app-badge-value":{color:e.palette.text.primary,fontSize:12}}));function Le({loading:e=!1,children:t=null,to:n="",...s}){const o=i.jsx(Ne,{className:"app-badge",component:n?"a":"div",href:n,...s,children:t});if(e)return i.jsx(ss,{variant:"rounded",children:o});if(n){if(Ra(n)){const r=Pa(n)?"_self":"_blank";return i.jsx(Ne,{className:"app-badge",component:"a",href:n,target:r,rel:"noreferrer noopener",...s,children:t})}return i.jsx(Ne,{className:"app-badge",component:Ot,to:n,...s,children:t})}return i.jsx(Ne,{className:"app-badge",component:"div",...s,children:t})}function wt({icon:e="",label:t="",value:n="",loading:s=!1,...o}){return i.jsxs(Le,{loading:s,...o,children:[t&&i.jsxs(B,{className:"app-badge-label",children:[e&&i.jsx(ke,{icon:e}),t]}),i.jsx(B,{className:"app-badge-value",children:n})]})}function Oa({label:e="",value:t=void 0,trueValue:n=!0,falseValue:s=!1,loading:o=!1,onChange:r=void 0,...a}){const l=F();let c=!1;const u=Vn(()=>r?.(!c));return t===n?c=!0:t===s?c=!1:c=!!t,i.jsxs(Le,{loading:o,sx:{cursor:"pointer",backgroundColor:c?"primary.main":"grey.100",borderColor:c?"primary.main":"divider",transition:"background-color 0.3s ease"},onClick:u,...a,children:[i.jsx(B,{sx:{fontWeight:400,paddingLeft:c?0:l.spacing(2.5),paddingRight:c?l.spacing(2.5):0,color:c?"common.white":"text.secondary",transition:"color 0.3s ease"},children:e}),i.jsx(_,{sx:{width:l.spacing(2.5),height:l.spacing(2.5),borderRadius:`${l.shape.borderRadius*.5}px`,backgroundColor:"common.white",position:"absolute",top:"50%",left:c?`calc(100% - ${l.spacing(3)})`:l.spacing(.5),transform:"translateY(-50%)",transition:"left 0.3s ease",boxShadow:1}})]})}const Qe={primary:e=>e.palette.primary,info:e=>e.palette.info,success:e=>e.palette.success,error:e=>e.palette.error,warning:e=>e.palette.warning},Oo=(e,t)=>{if(Qe[t]){const n=Qe[t](e).main;return We(n,.1)}return We(t,.1)},Rt=(e,t)=>Qe[t]?Qe[t](e).main:t;function $a({icon:e="",value:t="",color:n="info",loading:s=!1,...o}){const r=F(),a=Rt(r,n),l=Oo(r,n);return i.jsxs(Le,{loading:s,sx:{borderColor:We(a,.2),bgcolor:l},...o,children:[i.jsx(ke,{icon:e||"lucide:orbit",style:{marginRight:6}}),i.jsxs(B,{className:"app-badge-value",style:{color:a},children:["v ",t]})]})}const Na=Pt("span")(({theme:e,color:t})=>({position:"relative",display:"inline-block",width:e.spacing(1),height:e.spacing(1),borderRadius:"50%",backgroundColor:t,marginRight:e.spacing(1)}));function Ba({value:e="",color:t="primary",loading:n=!1,...s}){const o=F(),r=Rt(o,t),a=Oo(o,t);return i.jsxs(Le,{loading:n,sx:{borderColor:We(r,.2),bgcolor:a},...s,children:[i.jsx(Na,{color:Rt(o,t)}),i.jsx(B,{className:"app-badge-value",style:{color:r},children:e})]})}function Ha({value:e="",loading:t=!1,...n}){const s=K(()=>`DID:${Qs(e)?"ETH":"ABT"}`,[e]);return i.jsxs(Le,{loading:t,...n,children:[i.jsx(B,{className:"app-badge-label",children:s}),i.jsx(B,{className:"app-badge-value",children:i.jsx(Xs,{inline:!0,size:14,compact:!0,responsive:!1,children:e})})]})}Bt.extend(Js);Bt.extend(er);const za=(e,t=0)=>{if(typeof e!="number")return"";const n=Math.abs(e);let s,o="";return n>=1e12?(o="T",s=`${(e/1e12).toFixed(t)}`):n>=1e9?(o="B",s=`${(e/1e9).toFixed(t)}`):n>=1e6?(o="M",s=`${(e/1e6).toFixed(t)}`):n>=1e3?(o="K",s=`${(e/1e3).toFixed(t)}`):s=e.toString(),t>0&&(s=s.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")),`${s}${o}`},Ua=(e,t="en")=>e?Bt(e).locale(t).fromNow():"",Fa={switch:Oa,version:$a,state:Ba,did:Ha};function Va(e){const{locale:t="en"}=R()||{};if(e.variant==="number"){const{value:n,round:s=0,...o}=e,r=za(Number(n),s);return i.jsx(wt,{value:r,...o})}if(e.variant==="time"){const{value:n,...s}=e,o=Ua(n,t);return i.jsx(wt,{value:o,...s})}if(e.variant){const n=Fa[e.variant];if(n)return i.jsx(n,{...e})}return i.jsx(wt,{...e})}const $o=m.createContext({inService:!1,currentTab:"",TabComponent:null,navItem:void 0,updateAppInfo:()=>{}}),be=(e,t,n="en")=>{const s=e?.[t];return lr(s)?s[n]||s.en:s},Wa=(e,t="",n="en")=>{const s=t==="/"?["/"]:t.split("/").filter(Boolean);let o=null,r=0;return e.forEach(a=>{const l=be(a,"link",n)||"",c=l==="/"?["/"]:l.split("/").filter(Boolean);if(c.length>s.length)return;let u=!0;for(let d=0;d<c.length;d++)if(c[d]!==s[d]){u=!1;break}u&&c.length>r&&(o=a,r=c.length)}),o};function Ya({path:e=window?.location?.pathname||"",currentTab:t="",meta:n=void 0,children:s=null}){const{locale:o="en"}=R()||{},r=ar(e),a=r.startsWith(T.WELLKNOWN_BLOCKLET_ADMIN_PATH),l=K(()=>Object.assign({},window.blocklet,n),[n]),c=K(()=>{const g=l.navigation?.filter(b=>Array.isArray(b.section)?b.section.includes("dashboard"):b.section==="dashboard"),h=g?.flatMap(b=>b.items||[]),x=Wa(h,r,o);if(!x)return;const v=g.find(b=>b.id===x.parent);let j=be(x,"title",o)||"";return a||(j=`${be(v,"title",o)||""} - ${j}`),{id:x.id,parent:x.parent,title:j,link:be(x,"link",o)||"",description:be(x,"description",o)||""}},[e,a,o,l]),[u,d]=m.useState({}),p=Vn(g=>{d(h=>({...h,...g}))}),f=m.useMemo(()=>{const{tabs:g=[]}=u,h=g.find(j=>j.value===t);let x=t,v=null;return!h&&g.length>0?(x=g[0].value,v=g[0].render||null):v=h?.render||null,{...u,inService:a,navItem:c,currentTab:x,TabComponent:v,updateAppInfo:p}},[u,c,a,t,p]);return i.jsx($o.Provider,{value:f,children:s})}function W(){return m.useContext($o)}function No(){return ce(e=>e.breakpoints.down("md"))}function En({sx:e={}}){const t=No();return i.jsx(_,{sx:{mx:t?-2:-3,borderBottom:"1px solid",borderColor:"divider",mt:1.5,mb:1,...e}})}function qa({onTabChange:e=void 0}){const t=No(),{inService:n,navItem:s,icon:o=void 0,name:r="",description:a=void 0,actions:l=void 0,badges:c=[],tabs:u=[],currentTab:d="",updateAppInfo:p}=W();return m.useEffect(()=>{n||p({name:s?.title||"",description:s?.description||""})},[s?.title,s?.description,n,p]),r?i.jsxs(_,{className:"app-header",sx:{mt:3,mb:3},children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center",gap:1},children:[o&&i.jsx(_,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),i.jsxs(Rn,{sx:{flexGrow:1},children:[i.jsx(B,{variant:"h1",sx:{mb:.5},children:r}),a&&i.jsx(B,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6,"& a":{color:"primary.main"},maxWidth:980},children:a})]}),!t&&l&&i.jsx(_,{sx:{ml:1},children:l})]}),c.length>0&&i.jsx(_,{sx:{display:"flex",flexWrap:"wrap",gap:1,alignItems:"center",mt:2},children:c.map((f,g)=>m.isValidElement(f)?f:i.jsx(Va,{...f},f.label||g))}),t&&l&&i.jsx(_,{sx:{mt:t?2:0},children:l}),u.length<=1&&i.jsx(En,{}),u.length>1&&i.jsxs(i.Fragment,{children:[i.jsx(tr,{tabs:u,current:d,onChange:e,scrollButtons:"auto",sx:{mt:2.5}}),i.jsx(En,{sx:{mt:0}})]})]}):null}function Bo({meta:e=void 0,fallbackUrl:t=ut,invalidPathFallback:n=null,headerAddons:s=void 0,sessionManagerProps:o={showRole:!0,onLogout:()=>{window.location.href=ut}},links:r=[],showDomainWarningDialog:a=!0,appPath:l=void 0,appTab:c=void 0,onAppTabChange:u=void 0,children:d=void 0,...p}){wr();const f=m.use(Rs)?.session?.user,g=f?.role,{locale:h,defaultLocale:x}=R()||{},v=m.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return Sr(C)}catch(A){return console.error("Failed to format blocklet info",A,C),C}},[e]),{localizedNav:j,flattened:b,matchedIndex:k}=m.useMemo(()=>{let C=kr({navigation:v?.navigation?.dashboard,locale:h,defaultLocale:x})||[];C=jr(C,g),C=_r(C,E=>{let se=null;return E.icon&&(E.icon.startsWith("http")||E.icon.startsWith("data:")?se=i.jsx(Fn,{src:E.icon}):se=i.jsx("iconify-icon",{height:"100%",width:"100%",icon:E.icon})),{id:E.id,title:E.title,url:E.link,icon:se,external:!0,children:E.items}},"items");const A=Cr(C).filter(E=>!!E.url),O=Er(A.map(E=>E.url));return O!==-1&&(A[O].active=!0),{localizedNav:C,flattened:A,matchedIndex:O}},[v,h,x,g]),L=typeof r=="function"?r(j):[...j,...r],P=Tr({meta:e});if(m.useLayoutEffect(()=>{f&&!b?.length&&t&&(window.location.href=t)},[t]),m.useLayoutEffect(()=>{f&&b?.length&&k===-1&&n&&n()},[n,b,k]),!v.appName)return null;const{appName:S}=v;return i.jsx(vr,{title:S,fullWidth:!0,sidebarWidth:128,legacy:!1,links:L,...p,headerProps:{homeLink:ut,logo:i.jsx("img",{src:P,alt:"logo"}),addons:i.jsx(Ir,{formattedBlocklet:v,addons:s,sessionManagerProps:o,showDomainWarningDialog:a}),...p.headerProps},children:i.jsxs(Ya,{path:l,currentTab:c,meta:e,children:[i.jsx(qa,{onTabChange:u}),d]})})}Bo.propTypes={meta:Dr,fallbackUrl:y.string,invalidPathFallback:y.func,headerAddons:y.oneOfType([y.func,y.node]),sessionManagerProps:Lr,links:y.oneOfType([y.array,y.func]),showDomainWarningDialog:y.bool,appPath:y.string,appTab:y.string,onAppTabChange:y.func,children:y.node};const Ka={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'},Za="/.well-known/service/onboard/bind-account";function Ho({onFinished:e=()=>{},show:t=!1,onChangeVisible:n=()=>{},loadingText:s="",defaultPath:o=Za,...r}){const[a,l]=m.useState(t),[c,u]=m.useState(!1),[d,p]=m.useState(()=>{const k=localStorage.getItem("wizard-current-url");return k?.includes("/.well-known/service/onboard")?k:o}),f=m.useRef(e),g=m.useRef(),h=m.useRef(null),{locale:x}=R(),v=F(),j=ce(v.breakpoints.down("sm"));if(f.current=e,g.current=()=>{if(h.current?.contentWindow)try{const k=new URL(h.current.contentWindow.location.href).pathname;localStorage.setItem("wizard-current-url",k),p(k)}catch(k){p(o),console.warn("Failed to save wizard URL:",k)}localStorage.setItem("wizard-completed","true"),l(!1),n(!1)},m.useEffect(()=>{t!==a&&l(t)},[t]),m.useEffect(()=>{!a&&c&&u(!1)},[a]),m.useEffect(()=>{const k=L=>{if(L.origin!==window.location.origin)return;const{type:P,data:S}=L.data||{};switch(P){case"wizard.loaded":u(!0);break;case"wizard.finished":{l(!1),p(o),localStorage.removeItem("wizard-current-url"),localStorage.setItem("wizard-completed","true"),f.current?.(S);break}case"wizard.close":{g.current();break}}};return window.addEventListener("message",k),()=>{window.removeEventListener("message",k)}},[]),m.useEffect(()=>{localStorage.getItem("wizard-completed")||l(!0)},[]),!a)return null;const b=Yn(te(window.location.origin,d),{locale:x});return i.jsxs(Pn,{id:"wizard-dialog",open:a,onClose:()=>g.current(),fullWidth:!0,maxWidth:j?!1:"md",fullScreen:j,...r,slotProps:cr({},{paper:{sx:{margin:0,borderRadius:0,position:"relative",overflow:"hidden",...j?{borderRadius:0}:{borderRadius:1,height:"720px"}}}},r.slotProps),sx:{"& .MuiBackdrop-root":{backgroundColor:"rgba(0, 0, 0, 0.5)"},...r.sx},children:[i.jsx("iframe",{ref:h,id:"wizard-iframe",src:b,title:"Setup Wizard",style:{width:"100%",height:"100%",border:0,padding:0,margin:0,opacity:c?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>u(!0)}),c?null:i.jsx(_,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:"background.paper"},children:i.jsxs(_,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:1},children:[i.jsx(Z,{}),typeof s=="string"?i.jsx(B,{variant:"body1",children:s}):s]})})]})}Ho.propTypes={onFinished:y.func,show:y.bool,onChangeVisible:y.func,loadingText:y.node,defaultPath:y.string,...Pn.propTypes};const Ga={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 21L21 6l-3-3L3 18l3 3m9-15l3 3M9 3a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2m10 10a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2"/>'};function Qa(){const{session:e}=Bn(),[t,n]=m.useState(!1),[s,o]=m.useState(!1),{t:r}=R(),a=m.useMemo(()=>!!localStorage.getItem("wizard-finished"),[]);return m.useMemo(()=>e.user?.role&&$t.includes(e.user.role),[e])?i.jsxs(i.Fragment,{children:[i.jsx(we,{title:r("setup.wizardTooltip"),open:t,placement:"bottom",arrow:!0,children:i.jsx(et,{size:"small",onClick:()=>{o(!0),n(!1)},sx:{display:{xs:"none",md:"flex"},color:"text.secondary",...t&&{backgroundColor:"action.hover","@keyframes pulse":{"0%":{opacity:.8},"50%":{opacity:.5},"100%":{opacity:.8}},animation:"pulse 2s infinite"}},children:i.jsx(ke,{icon:Ga,height:20})})},`wizard-toggle-${t}`),i.jsx(Ho,{show:s,loadingText:i.jsxs(_,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,maxWidth:"80vw"},children:[i.jsx(on,{variant:"h4",sx:{fontWeight:"bold"},children:r("setup.wizardLoading")}),!a&&i.jsx(on,{variant:"body2",sx:{textAlign:"center"},children:r("setup.wizardSubTitle")})]}),slotProps:{paper:{sx:{height:{xs:"100vh",md:"750px"}}}},onChangeVisible:c=>{o(c),!c&&s&&n(!0)},onClose:void 0,onFinished:()=>{o(!1),n(!1)}},"wizard-modal")]}):null}function Xa(){const{inFullPage:e,toggleFullPage:t}=yr();return D(et,{onClick:t,children:e?D(is,{sx:{transform:"scale(1.3)"}}):D(as,{sx:{transform:"scale(1.3)"}})})}function zo({children:e=null,title:t="",appPath:n=void 0,appTab:s=void 0,onAppTabChange:o=void 0}){const{t:r}=R(),{loading:a,error:l,actions:{refreshBlocklet:c},env:u,blocklet:d}=nt(),{info:p,imgPrefix:f}=Ps(),g=Is(),h=ce(C=>C.breakpoints.down("md")),x=F(),{appId:v,version:j}=u,b=[{label:"App ID",value:v},{label:"App Version",value:j},{label:"App Bundle Name",value:d?.meta?.bundleName},{label:"Server Id",value:p.did},{label:"Server Version",value:p.version}],k=C=>{const A=Array.isArray(C)?C:[C];if(A.unshift(D(Qa,{})),h||A.unshift(D(Xa,{})),d){const O={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};Os(d)?A.unshift(D(Ro,{chainHost:d?.controller?.chainHost,nftId:d?.controller?.nftId,launcherSessionId:d?.controller?.launcherSessionId,launcherUrl:d?.controller?.launcherUrl,sx:O})):p.ownerNft&&p.launcher&&A.unshift(D(Po,{chainHost:p.launcher.chainHost,launcherUrl:p.launcher.url,nftId:p.ownerNft.did,launcherSessionId:p.ownerNft.launcherSessionId,sx:O}))}return A},L=mr({blocklet:d}),P={logo:L?D("img",{src:L,alt:"logo"}):null,brandAddon:D(_,{children:d&&Pe(_,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,py:.5,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[D(we,{title:N.isRunning(d?.status)?void 0:r(`blocklet.status.${d?.status}`),children:D(_,{sx:{bgcolor:Ue[d?.status],width:8,height:8,borderRadius:"50%"}})}),D(_,{sx:{color:"text.secondary",maxWidth:h?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.getDisplayName(d)}),D(_,{component:ke,icon:Ka,sx:{color:"text.secondary"}})]})})};return Pe(Ja,{legacy:!1,fullWidth:!0,headerAddons:k,headerProps:P,links:C=>C?.map(O=>(O.children=O.children?.map(E=>{if(E.id==="/team/aigne"){const se=f?te(f,"/aigne-hub.png"):"/aigne-hub.pg";return{...E,icon:D(Fn,{src:se,alt:"AIGNE Hub",style:x.palette.mode==="dark"?{filter:"invert(1)"}:{},fallback:E.icon})}}return E}),O)),title:t,footerProps:{addon:D(To,{infos:b})},appPath:n,appTab:s,onAppTabChange:o,children:[!d&&a&&D(Ye,{relative:"parent",children:D(Z,{})}),!d&&l&&Pe(Ye,{relative:"parent",children:[Pe(_,{sx:{display:"flex",alignItems:"center"},children:[D(rs,{color:"error",sx:{marginRight:1}}),Ht(l)]}),D(Nt,{onClick:()=>c(),children:D("span",{style:{textDecoration:"underline"},children:r("common.retry")})})]}),!!d&&D(_,{sx:{flex:1,display:"flex",flexDirection:"column"},children:D(nr,{FallbackComponent:xr,resetKeys:[g.pathname],children:e})})]})}zo.propTypes={children:y.any,title:y.string,appPath:y.string,appTab:y.string,onAppTabChange:y.func};const Ja=tt(Bo)`
|
|
33
|
-
.header-addons .locales {
|
|
34
|
-
max-height: 400px;
|
|
35
|
-
overflow-y: auto;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.header-brand-addon {
|
|
39
|
-
display: block;
|
|
40
|
-
}
|
|
41
|
-
`;function el(){const{t:e,locale:t}=R(),{blocklet:n,launcherSession:s,refreshSubscription:o}=nt(),{connectApi:r,session:a,api:l}=Bn(),[c,u]=m.useState(!1),[d,p]=m.useState(""),[f,g]=sr({subscriptionURL:"#"});if(m.useEffect(()=>{(Jt(n,s)||en(s))&&$s({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(j=>{g({subscriptionURL:j})}).catch(j=>{console.error("get subscription url error:",j)})},[n,s]),m.useEffect(()=>{if(n.controller?.launcherUrl){const j=te(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(j).then(b=>b.json()).then(b=>{const k=b.componentMountPoints?.find(P=>P.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,L=te(n.controller.launcherUrl,k);p(L)})}},[n.controller?.launcherUrl]),!n||!s)return"";let h=null,x="",v="error";return Ns(s)?(h=Bs(s)?i.jsx(Be,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):i.jsx(St,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),x=e("blocklet.suspendedCausedByPastDue",{deadline:he(s?.reservedUntil,t)})):en(s)?(h=i.jsx(Be,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),x=e("blocklet.willBeSuspendedSoon",{deadline:he((s?.subscription?.cancel_at||0)*1e3,t)}),v="warning"):Jt(n,s)?(h=i.jsx(Be,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),x=e("blocklet.suspendedCausedByExpired",{deadline:he(s?.reservedUntil,t),canceledAt:he((s?.subscription?.canceled_at||0)*1e3,t)})):Hs(n,s)&&(h=i.jsx(Ot,{to:te(T.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),x=e("blocklet.suspendedCausedByTerminated",{canceledAt:he(s?.terminatedAt,t),deadline:zs(s?.terminatedAt,t)})),x?i.jsxs(i.Fragment,{children:[i.jsxs(Xe,{severity:v,sx:{mb:1},children:[x,i.jsx(B,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:h})]}),c&&d&&s&&i.jsx(Us,{session:a,connect:r,baseUrl:d,authToken:s.subscription.authToken,children:i.jsx(Ar,{dialogProps:{open:c,onClose:()=>u(!1)},subscriptionId:s.subscription.id,successToast:!0,onPaid:()=>{l.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}const tl=e=>m.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.33 8.207A11.52 11.52 0 0 1 23.504 26.34H8.496A11.52 11.52 0 0 1 9.33 8.207zM16 3.52a14.08 14.08 0 0 0-8.76 25.102c.226.18.506.278.796.278h15.928c.29 0 .57-.098.797-.278A14.08 14.08 0 0 0 16 3.52zm5.883 10.072a1.28 1.28 0 0 0-1.81-1.81l-2.205 2.205a4.124 4.124 0 1 0 1.81 1.81l2.205-2.205zm-7.447 4.073a1.564 1.564 0 1 1 3.128 0 1.564 1.564 0 0 1-3.129 0z",fill:"currentColor"})),Uo={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 9l3 3l-3 3m5 0h3"/><path d="M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></g>'},nl={display:"inline-flex",width:"26px",height:"26px",paddingRight:"3px"};function ol(e){return i.jsx("span",{style:nl,children:i.jsx(ke,{icon:Uo,width:"100%",height:"100%",...e})})}const re={Start:ls,Stop:cs,Restart:us,Reload:bs,Remove:ds,Config:gs,Log:hs,Group:ms,Cancel:ps,Dashboard:tl,Overview:fs,LogIcon:ol,TerminalIcon:Uo},In=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),s=new URLSearchParams(n.searchParams),o=new URL(te(n.origin,t));return o.search=s.toString(),o.toString()},sl="internal",rl="external";function Fo({blocklet:e,onStart:t,onComplete:n,variant:s="menu",source:o="blocklet-list",hasPermission:r=!1,getComponentUrl:a=null,useBlockletUrlEvaluation:l=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const u=V(),[d,p]=m.useState(null),[f,g]=m.useState(null),[h,x]=m.useState(!1),[v,j]=m.useState(null),{t:b}=m.useContext(Un),[k]=sn("skip-blocklet-setup",!1),{loading:L,recommendedUrl:P}=l(e),[S]=sn("blocklet-type-filter",sl),C=N.isInProgress(e.status),[A,O]=m.useState(!1);m.useEffect(()=>{if(!e?.controller)return;O(e?.controller?.status?.value===lt.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const M=await u.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(M?.error){console.error("get launcher session failed",M.error);return}O([T.LAUNCH_SESSION_STATUS.overdue,T.LAUNCH_SESSION_STATUS.canceled,T.LAUNCH_SESSION_STATUS.terminated].includes(M?.launcherSession?.status))}catch(M){console.error("call getLauncherSession error",M)}})()},[]);const{inService:E}=u,se=o==="blocklet-detail",me=(w,M,z=!1)=>async()=>{const Q=async Ae=>{t({action:w,blocklet:e}),x(!0),g(w);let Me=!1;try{if(w==="remove")await M(Ae);else if(w==="start"){if(!N.hasRunnableComponent(e)){J.error(b("blocklet.noComponent"));return}if(!E&&!k&&!e.settings?.initialized&&e.mode!==lt.BLOCKLET_MODES.DEVELOPMENT){if(!P||!tn(P)){J.error(b("blocklet.gotoVisitError"));return}const H=Fs(u.info),Zt=new URL(P);Zt.searchParams.set("serverUrl",H),window.open(dt(Zt.href,{allowDomains:null})),n({action:w,blocklet:e});return}const q=e.children.filter(H=>!N.isInProgress(H.status)&&H.status!=="running"&&!N.isInProgress(H.greenStatus)&&H.greenStatus!=="running").map(H=>H.meta.did),ue={did:e.meta.did,componentDids:q};await M({input:ue})}else if(["stop","restart","reload"].includes(w)){const q=e.children.filter(H=>N.isBlockletRunning(H)).map(H=>H.meta.did),ue={did:e.meta.did,componentDids:q};await M({input:ue})}else{const q={did:e.meta.did};await M({input:q})}w==="remove"?Me=!0:await Vs(1e3),w==="reload"&&J.success(b("blocklet.reloadSuccess")),j(null),n({action:w,blocklet:e})}catch(q){const ue=`Blocklet ${w} failed: ${Ht(q)}`;throw n({action:w,blocklet:e,error:new Error(ue)}),new Error(ue)}finally{Me||x(!1)}},X=()=>{x(!1),j(null)},Te=N.getDisplayName(e,!0),Jo=e.mode===lt.BLOCKLET_MODES.DEVELOPMENT?{description:()=>i.jsx(B,{component:"div",children:i.jsx(B,{gutterBottom:!0,children:b("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ae,Me)=>i.jsxs(B,{component:"div",children:[i.jsx(B,{gutterBottom:!0,children:b("blocklet.action.removeApplicationDescription")}),i.jsxs(_s,{name:"removeType",value:Ae.removeType,onChange:q=>Me({...Ae,removeType:q.target.value}),children:[i.jsx(Qt,{value:"backup",control:i.jsx(Xt,{}),label:b("blocklet.action.removeApplicationAfterBackup")}),i.jsx(Qt,{value:"complete",control:i.jsx(Xt,{}),label:b("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},es={stop:{title:`${b("common.stop")} ${Te}`,description:b("blocklet.action.stopDescription"),confirm:b("blocklet.action.confirmStop"),cancel:b("common.cancel"),onConfirm:Q,onCancel:X},restart:{title:`${b("common.restart")} ${Te}`,description:b("blocklet.action.restartDescription"),confirm:b("blocklet.action.confirmRestart"),cancel:b("common.cancel"),onConfirm:Q,onCancel:X},remove:{title:`${b("common.remove")} ${Te}`,confirm:b("blocklet.action.confirmRemove"),cancel:b("common.cancel"),onConfirm:Q,onCancel:X,...Jo},cancelDownload:{title:`${b("common.cancel")}`,description:b("blocklet.action.cancelDownloadDescription",{name:Te}),confirm:b("common.confirm"),cancel:b("common.cancel"),onConfirm:Q,onCancel:X}};z?j(es[w]):await Q()},qo=!!d,Ko=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}p(w.currentTarget)},Zo=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}p(null)},qt=async(w,M)=>{try{M.stopPropagation(),M.preventDefault()}catch{}if(typeof w.handler=="function")try{x(!0),g(w.action),await w.handler()}catch(z){console.error(`Blocklet ${w.name} failed: `,z)}finally{x(!1),p(null)}else p(null)},Go=!E&&N.isDeletableBlocklet(e)?{action:"remove",icon:re.Remove,name:b("common.remove"),handler:me("remove",async({removeType:w})=>{w==="backup"&&await u.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await u.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:C}:null,Qo={action:"remove",icon:({sx:w,...M})=>i.jsx(re.Cancel,{sx:{...w,paddingRight:"2px",zoom:.95},...M}),name:b("common.cancel"),handler:me("cancelDownload",u.api.cancelDownloadBlocklet,!0)},Xo=N.getAppMissingConfigs(e),Kt=(w="dashboard")=>{const M=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),z=a?.({mountPoint:M,blocklet:e});if(!z||!tn(z)){J.error(b("blocklet.gotoVisitError"));return}const Q=e?.site?.domainAliases;w==="logs"?window.open(dt(In(z,`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/developers/logs`),{allowDomains:Q?.map(X=>X.value)})):window.open(dt(In(z,`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:Q?.map(X=>X.value)}))};let De=[{action:"start",icon:re.Start,inExternal:!0,name:b("common.start"),handler:me("start",u.api.startBlocklet),disabled:A||e.children.every(w=>N.isBlockletRunning(w))||ct(e.status)||L||C},{action:"stop",icon:re.Stop,inExternal:!0,name:b("common.stop"),handler:me("stop",u.api.stopBlocklet,!0),disabled:!["running","starting","error"].includes(e.status)},{action:"restart",inExternal:!0,icon:re.Restart,name:b("common.restart"),handler:me("restart",u.api.restartBlocklet,!0),disabled:A||e.status!=="running"},ct(e.status)?Qo:Go,{separator:!0},E?null:{action:"dashboard",icon:({style:w,...M})=>i.jsx(re.Dashboard,{...M,style:{...w,width:"26px",height:"26px",paddingRight:"3px"}}),name:b("sidebar.dashboard"),handler:Kt},!E&&!se?{action:"logs",icon:re.LogIcon,name:b("common.logs"),handler:()=>Kt("logs")}:null].filter(Boolean);return S===rl&&(De=De.filter(w=>w.inExternal)),s==="menu"?i.jsxs(Ln,{"data-cy":"blocklet-actions",children:[i.jsx(et,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:Ko,size:"small",disabled:!r||!ct(e.status)&&h,children:i.jsx(xs,{})}),i.jsxs(vs,{id:"actions-menu",anchorEl:d,keepMounted:!0,open:qo,onClose:Zo,PaperProps:{},children:[Xo.length>0&&i.jsxs(Xe,{style:{maxWidth:"400px"},severity:"error",children:[b("blocklet.config.missingRequired"),i.jsx("br",{}),i.jsx(Ot,{to:`/blocklets/${e.meta.did}/components`,children:b("blocklet.config.gotoFix")})]}),De.map((w,M)=>w.separator?i.jsx(ys,{},`separator-${M}`):i.jsxs(ws,{dense:!0,onClick:z=>qt(w,z),disabled:h||w.disabled,"data-cy":`${w.action}-blocklet`,children:[i.jsx(Ss,{style:{minWidth:24},children:f===w.action&&h?i.jsx(Z,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{fontSize:"small"})}),i.jsx(ks,{primary:w.name})]},w.name))]}),v&&i.jsx(rn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):i.jsxs(Ln,{"data-cy":"blocklet-actions",...c,children:[i.jsx(js,{children:De.filter(w=>!w.separator&&!w.onlyInMenu).map(w=>i.jsxs(Nt,{title:w.name,"data-cy":`${w.action}-blocklet`,onClick:()=>qt(w),disabled:!!w.disabled||h,children:[f===w.action&&h?i.jsx(Z,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{}),i.jsx("span",{className:"blocklet-action-text",children:w.name})]},w.name))}),v&&i.jsx(rn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}Fo.propTypes={getComponentUrl:y.func,blocklet:y.object.isRequired,onStart:y.func.isRequired,onComplete:y.func.isRequired,variant:y.oneOf(["menu","group"]),source:y.oneOf(["blocklet-list","blocklet-detail"]),hasPermission:y.bool,useBlockletUrlEvaluation:y.func};const Ln=tt.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
|
|
45
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
46
|
-
.MuiButton-root {
|
|
47
|
-
padding: 4px;
|
|
48
|
-
font-size: 10px;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`,il=m.memo(Fo);function Y({component:e=void 0}){const{blocklet:t}=G();return e?i.jsx(_,{className:"page-content",children:i.jsx(m.Suspense,{fallback:i.jsx(Ye,{relative:"parent",children:i.jsx(Z,{})}),children:m.isValidElement(e)?e:Ls.createElement(e,{blocklet:t})})}):null}Y.propTypes={component:y.any};const al=m.lazy(()=>I(()=>import("./overview-0TBmi-_i.js"),__vite__mapDeps([0,1]),import.meta.url)),ll=m.lazy(()=>I(()=>import("./component-CuKviNC8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),cl=m.lazy(()=>I(()=>import("./advanced-CuKHqbLO.js"),__vite__mapDeps([0,1]),import.meta.url));function ul(){const e=F(),{info:t,inService:n}=V(),{t:s}=R(),{navItem:o,updateAppInfo:r,TabComponent:a}=W(),{blocklet:l,actions:{refreshBlocklet:c}}=G(),u=!l||Ws(l.status)?[]:N.getAppMissingConfigs(l),p=!!(n?window.env?.gateway?.wafPolicy?.enabled:t?.routing.wafPolicy?.enabled)&&(l?.settings?.gateway?.wafPolicy?.enabled??!0);m.useEffect(()=>{r({name:o?.title||"",description:o?.description||s("navigation.overviewDesc")})},[o,s,r]),m.useEffect(()=>{r({actions:l?i.jsx(il,{className:"page-actions",hasPermission:!0,blocklet:l,onStart:()=>{},onComplete:({error:h}={})=>{h&&J.error(h.message)},variant:"group"}):null})},[l,r]),m.useEffect(()=>{const g=[];l&&g.push(i.jsx(Do,{"data-cy":"blocklet-status","status-blocklet-did":l.meta?.did,status:l.status,source:l.source,progress:l.progress,style:{lineHeight:e.spacing(3),height:e.spacing(3)}},"blocklet-status")),g.push({label:"WAF",value:p?"ON":"OFF",to:`${o?.link}/settings`}),r({badges:g})},[l,r,p,o?.link,e]);const f=m.useMemo(()=>[{label:s("common.overview"),value:"overview",render:al},{label:i.jsx(Cs,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!u.length,children:s("common.components")}),labelText:s("common.components"),value:"components",render:ll},{label:s("common.globalSettings"),value:"settings",render:i.jsx(cl,{blocklet:l,onUpdate:c})}],[s,u.length,l,c]);return m.useEffect(()=>{r({tabs:f})},[f,r]),i.jsx(Y,{component:a})}const dl=m.lazy(()=>I(()=>import("./traffic-Cea69sMW.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),pl=m.lazy(()=>I(()=>import("./audit-logs-DKGke9hI.js"),__vite__mapDeps([0,1,2]),import.meta.url)),fl=m.lazy(()=>I(()=>import("./log-Bq445Z1e.js"),__vite__mapDeps([0,1]),import.meta.url)),ml=m.lazy(()=>I(()=>import("./runtime-B_ZLP4FF.js"),__vite__mapDeps([0,1]),import.meta.url));function hl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o,client:r,did:a}=G(),{teamDid:l}=je(),{api:c}=V(),u=o?.meta?.did,d=ne(()=>c.getBlockletBaseInfo({input:{teamDid:l}}),[l,c]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.operationsDesc")})},[t,e,n]),m.useEffect(()=>{const f=[],{totalRequests:g=0,failedRequests:h=0}=d.value?.traffic??{},{cpuUsage:x=0,memoryUsage:v=0}=d.value?.appRuntimeInfo??{};f.push({variant:"number",label:e("analytics.traffic.totalRequests"),value:g,round:0,to:`${t.link}/analytics`,loading:d.loading}),f.push({variant:"number",label:e("analytics.traffic.failedRequests"),value:h,round:0,to:`${t.link}/analytics`,loading:d.loading}),f.push({label:e("blocklet.runtimeInfo.cpuUsage"),value:`${x.toFixed(1)}%`,to:`${t.link}/performance`,loading:d.loading}),f.push({label:e("blocklet.runtimeInfo.memoryUsage"),value:Hn(v),to:`${t.link}/performance`,loading:d.loading}),n({badges:f})},[n,d.value,d.loading,t?.link,e]);const p=m.useMemo(()=>[o?.children?.length&&o.structVersion===T.APP_STRUCT_VERSION&&{label:e("common.logs"),value:"logs",render:fl},{label:e("common.auditLogs"),value:"audit-logs",render:i.jsx(pl,{scope:u,categories:["blocklet","team","security","certificates","gateway"]})},{label:e("common.performance"),value:"performance",render:i.jsx(ml,{client:r,did:a})},{label:e("common.analytics"),value:"analytics",render:i.jsx(dl,{client:r,did:a})}].filter(Boolean),[e,o,r,a,u]);return m.useEffect(()=>{n({tabs:p})},[p,n]),i.jsx(Y,{component:s})}const gl=m.lazy(()=>I(()=>import("./index-B6l4xGy5.js"),__vite__mapDeps([0,1]),import.meta.url)),bl=m.lazy(()=>I(()=>import("./index-DWHFecw2.js"),__vite__mapDeps([0,1]),import.meta.url)),xl=m.lazy(()=>I(()=>import("./list-BSXHuqLM.js"),__vite__mapDeps([0,1]),import.meta.url));function vl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{api:o}=V(),{teamDid:r}=je(),{session:a}=ot(),l=m.useMemo(()=>a?.user?.role&&$t.includes(a.user.role),[a]),c=ne(()=>o.getBlockletBaseInfo({input:{teamDid:r}}),[r,o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.integrationsDesc")})},[t,e,n]),m.useEffect(()=>{const d=[],{webhooks:p=0,accessKeys:f=0,oauthApps:g=0}=c.value?.integrations??{};d.push({variant:"number",label:"Webhooks",value:p,to:`${t.link}/webhooks`,loading:c.loading}),d.push({variant:"number",label:"API Keys",value:f,to:`${t.link}/access-keys`,loading:c.loading}),d.push({variant:"number",label:"OAuth Apps",value:g,to:`${t.link}/oauth`,loading:c.loading}),n({badges:d})},[n,c.value,c.loading,t.link]);const u=m.useMemo(()=>[l&&{label:"Webhooks",value:"webhooks",render:i.jsx(gl,{})},{label:e("common.accessKeys"),value:"access-keys",render:i.jsx(bl,{})},{label:e("common.oauth"),value:"oauth",render:i.jsx(xl,{})}].filter(Boolean),[l,e]);return m.useEffect(()=>{n({tabs:u})},[u,n]),i.jsx(Y,{component:s})}var Vo=function(t){return i.jsx("svg",{...t,children:i.jsx("path",{d:"M79.425.7c5.688 0 10.3 4.612 10.3 10.3v43.234c0 5.689-4.612 10.3-10.3 10.3H11.156c-5.688 0-10.3-4.611-10.3-10.3v-.215h4.6v.215a5.7 5.7 0 0 0 5.7 5.7h68.269a5.7 5.7 0 0 0 5.7-5.7V11a5.7 5.7 0 0 0-5.7-5.7H11.156a5.7 5.7 0 0 0-5.7 5.7v.49h-4.6V11C.856 5.312 5.468.7 11.156.7h68.269ZM11.293 17.691c2.945 0 5.495.62 7.65 1.86 2.182 1.211 3.879 2.929 5.088 5.154 1.21 2.225 1.814 4.845 1.814 7.86 0 2.985-.604 5.577-1.814 7.774a12.78 12.78 0 0 1-5.088 5.112c-2.155 1.211-4.706 1.818-7.65 1.818H1V17.69h10.293ZM35.206 47.27h-5.324V17.69h5.324V47.27ZM50.883 17.69c2.944 0 5.494.62 7.65 1.86 2.182 1.21 3.878 2.929 5.087 5.154 1.21 2.225 1.815 4.846 1.815 7.86 0 2.985-.606 5.577-1.815 7.774a12.78 12.78 0 0 1-5.087 5.112c-2.156 1.211-4.706 1.818-7.65 1.818H40.59V17.69h10.293Zm22.595 19.066a2.98 2.98 0 1 1-.001 5.958 2.98 2.98 0 0 1 .001-5.958ZM6.325 42.494h4.812c2.97 0 5.257-.874 6.861-2.62 1.604-1.775 2.405-4.211 2.405-7.31 0-3.126-.801-5.591-2.405-7.394-1.604-1.803-3.89-2.704-6.861-2.704H6.324v20.028Zm39.59 0h4.81c2.971 0 5.26-.873 6.863-2.62 1.603-1.775 2.405-4.211 2.405-7.31 0-3.126-.801-5.591-2.405-7.394-1.604-1.803-3.892-2.704-6.862-2.704h-4.81v20.028Zm27.564-19.637a2.978 2.978 0 1 1 0 5.957 2.978 2.978 0 0 1 0-5.957Z",fill:"currentColor"})})};Vo.defaultProps={viewBox:"0 0 24 17",xmlns:"http://www.w3.org/2000/svg"};function Wo({width:e=24,color:t="black",backgroundColor:n="transparent"}){return i.jsx(_,{component:"span",sx:{width:e,display:"inline-block",verticalAlign:"middle",color:t,backgroundColor:n,fontSize:0},children:i.jsx(Vo,{viewBox:"0 0 90 65",xmlns:"http://www.w3.org/2000/svg",style:{position:"relative",top:-1,lineHeight:1}})})}Wo.propTypes={width:y.number,color:y.string,backgroundColor:y.string};const yl=m.lazy(()=>I(()=>import("./index-B-8044Gs.js"),__vite__mapDeps([0,1]),import.meta.url)),wl=m.lazy(()=>I(()=>import("./index-DcW3jqfL.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),Sl=m.lazy(()=>I(()=>import("./index-Bpic07NM.js"),__vite__mapDeps([0,1]),import.meta.url)),kl=m.lazy(()=>I(()=>import("./index-DKzBOJCu.js"),__vite__mapDeps([0,1]),import.meta.url)),jl=m.lazy(()=>I(()=>import("./security-DHRU8k0u.js"),__vite__mapDeps([0,1]),import.meta.url));function _l(){const{t:e,locale:t}=R(),{navItem:n,updateAppInfo:s,TabComponent:o}=W(),{blocklet:r}=G(),{api:a}=V(),{teamDid:l}=je(),c=m.useMemo(()=>ur(r,"settings.org.enabled",!1),[r]),u=ne(()=>a.getBlockletBaseInfo({input:{teamDid:l}}),[l,a]),d=ne(async()=>{if(!r?.meta?.did)return null;const{securityRules:h}=await a.getBlockletSecurityRules({input:{did:r.meta.did,includeDisabled:!0}});return h.find(x=>x.id===T.SECURITY_RULE_DEFAULT_ID)},[r?.meta?.did,a]),p=m.useMemo(()=>{const h=r?.settings?.authentication||{};return Object.keys(h).filter(v=>h[v]?.enabled).sort((v,j)=>(h[v]?.order||0)-(h[j]?.order||0)).map(v=>({name:v,title:or[v]||v}))},[r?.settings?.authentication]),f=m.useMemo(()=>(r?.settings?.federated?.sites||[]).length>0,[r?.settings?.federated?.sites]);m.useEffect(()=>{const h=e("navigation.didConnectDesc"),x=e("common.poweredBy",{brand:"$placeholder"}),v=h?h.slice(-1):"",[j,b]=x.split("$placeholder");s({name:n?.title||"",description:i.jsxs("span",{children:[h," ",j,i.jsxs("a",{href:`https://www.didconnect.io/${t}`,target:"_blank",style:{color:"#5bbec5"},rel:"noreferrer",children:[i.jsx(Wo,{color:"#5bbec5"})," Connect"]}),b," ",v]})})},[n,e,t,s]),m.useEffect(()=>{const h=[],{users:x=0}=u.value?.user??{},{passports:v=0}=u.value?.passport??{};h.push({variant:"number",label:e("common.members"),value:x,to:`${n.link}/members`,round:0}),h.push({variant:"number",label:e("team.member.passports"),value:v,to:`${n.link}/passports`,round:0}),p.length>0&&h.push({label:e("authentication.loginProviders"),value:i.jsx(Rn,{component:"span",direction:"row",spacing:.5,children:p.map(b=>i.jsx(Mr,{provider:b.name,sx:{width:12,height:12}},b.name))}),to:`${n.link}/settings`}),h.push({label:e("authentication.federated"),value:f?"ON":"OFF",to:`${n.link}/settings`});const j=d.value?.accessPolicy?.name;j&&h.push({label:e("accessPolicy.title"),value:j,to:`${n.link}/security`}),s({badges:h})},[s,u.value,u.loading,e,p,f,d.value,d.loading,n.link]);const g=m.useMemo(()=>[{label:e("common.members"),value:"members",render:i.jsx(yl,{type:"blocklet",createPassportSvg:an})},c&&{label:e("common.orgs"),value:"orgs",render:i.jsx(wl,{editable:!1,mode:"dashboard",layout:"table"})},{label:e("team.member.passports"),value:"passports",render:i.jsx(Sl,{createPassportSvg:an})},{label:e("common.setting"),value:"settings",render:i.jsx(kl,{orientation:"vertical"})},{label:e("common.policies"),value:"security",render:i.jsx(jl,{})}].filter(Boolean),[e,c]);return m.useEffect(()=>{s({tabs:g})},[g,s]),i.jsx(Y,{component:o})}const Cl=m.lazy(()=>I(()=>import("./domains-TI6o1CvX.js"),__vite__mapDeps([0,1]),import.meta.url)),El=m.lazy(()=>I(()=>import("./branding-CwSyd5WC.js"),__vite__mapDeps([0,1]),import.meta.url)),Il=m.lazy(()=>I(()=>import("./appearance-C9TkbSjV.js"),__vite__mapDeps([0,1]),import.meta.url)),Ll=m.lazy(()=>I(()=>import("./config-navigation-hDihVsjx.js"),__vite__mapDeps([0,1]),import.meta.url));function Dl(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o,actions:{refreshBlocklet:r}}=G(),a=m.useMemo(()=>o?{domainCount:(o?.site?.domainAliases||[]).length}:null,[o]),l=m.useMemo(()=>o?.settings?.theme?.name??"Default",[o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.websiteDesc")})},[t,e,n]),m.useEffect(()=>{const u=[],{domainCount:d=0}=a;u.push({variant:"number",label:e("common.domains"),value:d,to:`${t.link}/domains`}),u.push({label:e("common.theme"),value:l,to:`${t.link}/theming`}),n({badges:u})},[n,a,l,e,t.link]);const c=m.useMemo(()=>[{label:e("common.domains"),value:"domains",render:Cl},{label:e("common.branding"),value:"branding",render:i.jsx(El,{blocklet:o,onUpdate:r})},{label:e("common.theming"),value:"theming",render:i.jsx(Il,{})},{label:e("common.navigation"),value:"navigation",render:Ll}],[e,o,r]);return m.useEffect(()=>{n({tabs:c})},[c,n]),i.jsx(Y,{component:s})}const Tl=m.lazy(()=>I(()=>import("./index-C4ZzROeE.js"),__vite__mapDeps([0,1]),import.meta.url)),Al=m.lazy(()=>I(()=>import("./index-ZzcJ7eKO.js"),__vite__mapDeps([0,1]),import.meta.url));function Ml(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{blocklet:o}=G(),{session:r}=ot(),{teamDid:a}=je(),l=m.useMemo(()=>r?.user?.role&&$t.includes(r.user.role),[r]),c=ne(async()=>(await Ys.get(`${T.WELLKNOWN_BLOCKLET_HEALTH_PATH}/notification`,{params:{since:"24h"}})).data?.data,[a]),u=m.useMemo(()=>{const p=o?.settings?.notification||{},f=[];return f.push({name:"Email",icon:"lucide:mail",enabled:p.email?.enabled}),f.push({name:"Push Kit",icon:"lucide:bell",enabled:p.pushKit?.enabled}),f.push({name:"Wallet",icon:"lucide:wallet",enabled:!0}),f.push({name:"Webhook",icon:"lucide:webhook",enabled:!0}),f},[o]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.websiteDesc")})},[t,e,n]),m.useEffect(()=>{const p=[],f=c.value?.channels||[];let g=0,h=0;Object.values(f).forEach(x=>{g+=x.state?.total??0,h+=x.state?.success??0}),p.push({label:`${e("notification.sendStatus.success")}(24h)`,value:i.jsxs("span",{children:[h," / ",g]}),to:`${t.link}/notifications`}),u.forEach(x=>{p.push({label:x.name,value:x.enabled?"ON":"OFF",to:`${t.link}/settings`})}),n({badges:p})},[n,u,c.value,e,t.link]);const d=m.useMemo(()=>[{label:e("notification.history"),value:"notifications",render:l?i.jsx(Tl,{blocklet:o}):i.jsx(nn,{status:403})},{label:e("common.settings"),value:"settings",render:l?i.jsx(Al,{}):i.jsx(nn,{status:403})}].filter(Boolean),[l,e,o]);return m.useEffect(()=>{n({tabs:d})},[d,n]),i.jsx(Y,{component:s})}const Rl=m.lazy(()=>I(()=>import("./config-D1OcHGlN.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),Pl=m.lazy(()=>I(()=>import("./index-bEFOmVth.js"),__vite__mapDeps([0,1]),import.meta.url));function Ol(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W();m.useEffect(()=>{const r=t?.description||i.jsx(_,{dangerouslySetInnerHTML:{__html:e("navigation.aigneDesc",{aigneHubUrl:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",mcpUrl:"https://modelcontextprotocol.io/"})}});n({name:t?.title||"",description:r})},[t,e,n]),m.useEffect(()=>{n({badges:[]})},[n]);const o=m.useMemo(()=>[{label:e("setup.steps.aigne"),value:"aigne-config",render:i.jsx(_,{sx:{maxWidth:1536},children:i.jsx(Rl,{})})},{label:e("common.mcpServers"),value:"mcp-servers",render:i.jsx(Pl,{})}],[e]);return m.useEffect(()=>{n({tabs:o})},[o,n]),i.jsx(Y,{component:s})}const $l=e=>m.createElement("svg",{viewBox:"0 0 24 17",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M79.4248 0.700195C85.1132 0.700234 89.7244 5.31169 89.7246 11V54.2344C89.7244 59.9227 85.1132 64.5341 79.4248 64.5342H11.1562C5.46786 64.5342 0.856682 59.9227 0.856445 54.2344V54.0186H5.45605V54.2344C5.45629 57.3822 8.00837 59.9336 11.1562 59.9336H79.4248C82.5726 59.9336 85.1248 57.3822 85.125 54.2344V11C85.1248 7.8522 82.5727 5.29984 79.4248 5.2998H11.1562C8.00837 5.2998 5.45629 7.85217 5.45605 11V11.4893H0.856445V11C0.856676 5.31166 5.46786 0.700195 11.1562 0.700195H79.4248ZM11.293 17.6914C14.2375 17.6914 16.7876 18.3114 18.9434 19.5508C21.1254 20.762 22.8219 22.4798 24.0312 24.7051C25.2406 26.9304 25.8447 29.5504 25.8447 32.5645C25.8447 35.5502 25.2405 38.1418 24.0312 40.3389C22.8219 42.536 21.1255 44.2399 18.9434 45.4512C16.7875 46.6624 14.2375 47.2686 11.293 47.2686H1V17.6914H11.293ZM35.2061 47.2686H29.8818V17.6914H35.2061V47.2686ZM50.8828 17.6914C53.8272 17.6914 56.3774 18.3114 58.5332 19.5508C60.7151 20.7619 62.4108 22.48 63.6201 24.7051C64.8295 26.9304 65.4346 29.5505 65.4346 32.5645C65.4346 35.5503 64.8295 38.1417 63.6201 40.3389C62.4108 42.5359 60.7152 44.2399 58.5332 45.4512C56.3774 46.6624 53.8272 47.2685 50.8828 47.2686H40.5898V17.6914H50.8828ZM73.4785 36.7568C75.1235 36.7568 76.457 38.0913 76.457 39.7363C76.4568 41.3811 75.1234 42.7148 73.4785 42.7148C71.8338 42.7147 70.5003 41.381 70.5 39.7363C70.5 38.0914 71.8336 36.757 73.4785 36.7568ZM6.32422 42.4941H11.1357C14.1064 42.4941 16.3934 41.6204 17.9971 39.874C19.6008 38.0994 20.4023 35.663 20.4023 32.5645C20.4023 29.4378 19.6008 26.9727 17.9971 25.1699C16.3934 23.3674 14.1063 22.4659 11.1357 22.4658H6.32422V42.4941ZM45.9141 42.4941H50.7246C53.6954 42.4941 55.9832 41.6205 57.5869 39.874C59.1905 38.0994 59.9922 35.6628 59.9922 32.5645C59.9922 29.4378 59.1906 26.9727 57.5869 25.1699C55.9832 23.3672 53.6954 22.4658 50.7246 22.4658H45.9141V42.4941ZM73.4785 22.8574C75.1235 22.8574 76.457 24.1909 76.457 25.8359C76.457 27.4809 75.1235 28.8145 73.4785 28.8145C71.8336 28.8143 70.5 27.4808 70.5 25.8359C70.5 24.191 71.8337 22.8576 73.4785 22.8574Z",fill:"currentColor"}));function Yo({width:e=24,color:t="black",backgroundColor:n="transparent"}){return i.jsx(_,{component:"span",sx:{width:e,display:"inline-block",verticalAlign:"middle",color:t,backgroundColor:n,fontSize:0},children:i.jsx($l,{viewBox:"0 0 90 65",xmlns:"http://www.w3.org/2000/svg",style:{position:"relative",top:-1,lineHeight:1}})})}Yo.propTypes={width:y.number,color:y.string,backgroundColor:y.string};function Nl(){const{api:e}=V(),{blocklet:t}=G(),{data:n,loading:s}=rr(()=>e.getBlocklet({input:{did:t?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!t?.meta?.did,refreshDeps:[t?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}const Bl=m.lazy(()=>I(()=>import("./index--WQuhwJL.js"),__vite__mapDeps([0,1]),import.meta.url));function Hl(){const{palette:e}=F(),{t,locale:n}=R(),{navItem:s,updateAppInfo:o,TabComponent:r}=W(),{blocklet:a}=G(),{blocklet:l,loading:c}=Nl(),u=m.useMemo(()=>!!Rr(a?.environments),[a?.environments]);m.useEffect(()=>{const p=t("navigation.didSpacesDesc"),f=t("common.poweredBy",{brand:"$placeholder"}),g=p?p.slice(-1):"",[h,x]=f.split("$placeholder");o({name:s?.title||"",description:i.jsxs("span",{children:[p," ",h,i.jsxs("a",{href:`https://www.didspaces.com/${n}`,target:"_blank",style:{color:"#876bf4"},rel:"noreferrer",children:[i.jsx(Yo,{color:"#876bf4"})," Spaces"]}),x," ",g]})})},[s,t,n,o]),m.useEffect(()=>{const p=[];p.push({variant:"state",value:t(u?"storage.spaces.connected.tag":"storage.spaces.disconnected.tag"),color:u?"success":e.text.secondary,loading:c}),p.push({label:t("blocklet.runtimeInfo.dataStorage"),value:Hn(l?.diskInfo?.data??0),loading:c}),o({badges:p})},[o,u,l,c,t,e]);const d=m.useMemo(()=>[{label:t("common.backup"),value:"did-spaces",render:i.jsx(Bl,{navOrientation:"horizontal"})}],[t]);return m.useEffect(()=>{o({tabs:d})},[d,o]),i.jsx(Y,{component:r})}const zl=m.lazy(()=>I(()=>import("./index-BeunkI-Z.js"),__vite__mapDeps([0,1,2]),import.meta.url));function Ul(){const{t:e}=R(),{navItem:t,updateAppInfo:n,TabComponent:s}=W(),{teamDid:o}=je(),{api:r}=V(),a=ne(()=>r.getBlockletBaseInfo({input:{teamDid:o}}),[o,r]);m.useEffect(()=>{n({name:t?.title||"",description:t?.description||e("navigation.publishDesc")})},[t,e,n]),m.useEffect(()=>{const c=[],{blocklets:u=0,releases:d=0}=a.value?.studio??{};c.push({variant:"number",label:e("common.blocklets"),value:u,round:0,loading:a.loading}),c.push({variant:"number",label:e("common.releases"),value:d,round:0,loading:a.loading}),n({badges:c})},[n,a.value,a.loading,e]);const l=m.useMemo(()=>[{label:e("common.blocklets"),value:"publish",render:i.jsx(zl,{})}],[e]);return m.useEffect(()=>{n({tabs:l})},[l,n]),i.jsx(Y,{component:s})}const Fl=new Map([["overview",ul],["operations",hl],["integrations",vl],["did-connect",_l],["website",Dl],["notification",Ml],["aigne",Ol],["did-spaces",Hl],["publish",Ul]]),Vl=te(T.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),Wl=e=>{const{enqueueSnackbar:t}=zn(),n=m.useCallback(s=>Yn(Vl,{id:s.id,severity:s.severity||"all",componentDid:s.source==="system"?"system":s.componentDid||"all"}),[]);Ks(`${e}/${T.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,s=>{const o=n(s),{severity:r,description:a}=s||{},l=["error","warning"].includes(r)||s.sticky;s.source==="system"&&t(a,{variant:r,autoHideDuration:l?null:5e3,anchorOrigin:{vertical:"top",horizontal:"center"},content:c=>i.jsx(Wr,{viewAllUrl:o,keyId:c,notification:s,content:i.jsx(gr,{notification:s,minimal:!0,rows:0})})})},[],"user")};function Yl(){const{t:e}=R(),t=On(),{app:n="overview",tab:s}=Ds(),{blocklet:o,refreshFlag:r}=nt(),{session:a}=ot(),l=K(()=>a?.user?.did,[a]);Wl(l);const c=Fl.get(n),u=K(()=>te(T.WELLKNOWN_BLOCKLET_ADMIN_PATH,n),[n]),d=K(()=>(o?.site?.domainAliases||[]).map(h=>h.value),[o]),p=K(()=>{if(!o)return!0;try{const h=o.configs?.find(v=>v.key==="BLOCKLET_APP_URL")?.value;if(!h||!d.length)return!0;const{host:x}=new URL(h);return d.some(v=>v===x)}catch{return!1}},[o,d]),f=m.useCallback(h=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${n}/${h}`)},[t,n]),g=o?i.jsx(Zn,{type:"components",children:i.jsx(c,{})}):i.jsx(Ye,{relative:"parent",children:i.jsx(Z,{})});return i.jsx(hr,{children:i.jsx(zo,{appPath:u,appTab:s,onAppTabChange:f,children:i.jsxs(Kl,{children:[!p&&i.jsx(Xe,{severity:"warning",sx:{mb:2,py:2},action:i.jsxs(_,{sx:{display:"flex",gap:1,alignItems:"center"},children:[i.jsx(St,{size:"small",onClick:()=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/branding`)},children:e("invalidAppUrl.viewConfig")}),i.jsx(St,{variant:"contained",size:"small",onClick:()=>{t(`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/domains`)},children:e("invalidAppUrl.viewDomains")})]}),children:e("invalidAppUrl.desc")}),i.jsx($r,{}),i.jsx(el,{}),g]})},`${r}`)})}function ql(){const{blocklet:e}=nt(),t=e?.meta?.did;return m.useEffect(()=>{const n=qs();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Yl,{})}const Kl=tt.main`
|
|
52
|
-
.page-header {
|
|
53
|
-
display: flex;
|
|
54
|
-
justify-content: space-between;
|
|
55
|
-
align-items: center;
|
|
56
|
-
flex-wrap: wrap;
|
|
57
|
-
gap: 16px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.page-title {
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
|
|
64
|
-
.page-link {
|
|
65
|
-
font-size: 15px;
|
|
66
|
-
margin-top: 8px;
|
|
67
|
-
margin-left: 8px;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
72
|
-
.page-header {
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
align-items: flex-start;
|
|
75
|
-
.page-actions,
|
|
76
|
-
.MuiButtonGroup-root {
|
|
77
|
-
width: 100%;
|
|
78
|
-
}
|
|
79
|
-
.MuiButtonGroup-root {
|
|
80
|
-
.MuiButtonBase-root {
|
|
81
|
-
flex: 1;
|
|
82
|
-
}
|
|
83
|
-
.blocklet-action-text {
|
|
84
|
-
display: none;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.page-title {
|
|
90
|
-
margin-bottom: 15px;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`,yc=Object.freeze(Object.defineProperty({__proto__:null,default:ql},Symbol.toStringTag,{value:"Module"}));export{Do as B,Lo as W,Bo as Z,Nl as a,re as b,yc as d,xn as m,Mo as p,vc as u};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import{F as bn,T as vn,W as A,aO as Cn,Q as E,b5 as te,aQ as wn,bF as ze}from"./vendor-ux-CLT2i3Pv.js";import{j as e,dg as Ne,cO as Rn,al as h,a7 as z,bg as Sn,T as S,b4 as ye,G as H,L as ie,an as L,aL as $e,X as t,cr as _e,M as Oe,aM as An,aN as Tn,cP as kn,bX as In,ck as Pn,dh as qn,di as En,b3 as W,P as We,bQ as Ln,bR as Fn,aT as Mn,bb as Bn,bW as Un,dj as zn,dk as Nn,dl as $n,dm as ke,dn as _,dp as _n,A as On,n as Wn,b6 as Hn,dq as Vn,ct as Gn}from"./vendor-mui-core-CV-FnYH_.js";import{z as ee,F as Qn,a as Xn,e as Kn,ad as je,av as Yn,aw as Zn,n as X}from"./vendor-utils-BzQg432x.js";import{r as j,e as He,g as Jn}from"./vendor-react-DX7tU9aY.js";import{u as se}from"./useSetState-CUbypYGT.js";import{t as et,r as nt,b as K,x as tt,F as it}from"./vendor-hooks-DAZ1H6Va.js";import{aY as Ve,aL as Ge,bO as st,bP as Qe,W as F,V as oe,G as Ie,f as ot,_ as Pe,bQ as rt,F as at,a1 as lt,bR as Xe,al as fe,bS as Ke,av as ct,bT as dt,bU as mt,o as xe,a$ as ut,bV as pt}from"./index-CXp5SI_f.js";import{w as Ye}from"./permission-CvrrGfG6.js";import{u as ft,D as qe}from"./useAsyncRetry-C4R9ufi-.js";import{C as re}from"./confirm-CdVn5WdC.js";import{A as xt}from"./actions-DydkTgA0.js";import{D as ht}from"./delete-confirm-CkiUXocp.js";import{o as Ee}from"./vendor-arcblock-Dll6qxMT.js";import{u as gt}from"./use-mobile-CyUZDIaX.js";import{u as Dt}from"./useAsync-CkKfnulP.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-Di2nSesc.js";import{g as jt,p as Le}from"./util-DySzCymV.js";import{C as bt}from"./click-to-copy-BgIYUMoo.js";const vt=Ve({});vt.interceptors.request.use(n=>{const i=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=i||"",n.url=ee("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=bn()),n},n=>Promise.reject(n));const Ze=(...n)=>Ve(...n),Ct=(n,i)=>i?n?[n,...Array.isArray(i)?i:[i]]:i:n,wt=(n,{width:i=600,height:o=700,name:a="did-domain:popup"}={})=>{const s=window.screenX+(window.innerWidth-i)/2,r=window.screenY+(window.innerHeight-o)/2,u=[`left=${s}`,`top=${r}`,`width=${i}`,`height=${o}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,u.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Qn(n,{opener:window.location.origin}),l},Rt="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Je=async n=>{if(!n||!n?.trim())return null;const i=Ze(),o=new URL(n);o.pathname="__blocklet__.js",o.searchParams.set("type","json");const{data:a}=await i.get(o.toString()),s=a?.componentMountPoints?.find(m=>m.did===Rt),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},St=Ge({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),At=Ge({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),Tt={zh:At,en:St},kt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Je(n);if(!a)return null;const s=Ze({baseURL:a.api}),{data:r}=await s.post("/payment/session",{delegatee:i,delegateePk:o});return{sessionId:r.sessionId,baseURL:a.base}};function It({delegatee:n,delegateePk:i,didDomainURL:o,locale:a,title:s="",onSuccess:r=()=>{},...u}){const{t:l}=A(),[m,p]=et({currentState:1}),f=j.useRef(null),c=nt(async()=>{const d=await kt({didDomainURL:o,delegatee:n,delegateePk:i});return d},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(d){console.error(d)}}),g=K(d=>{d.data.type==="didDomain.success"&&(r?.({nftDid:d.data?.nftDid,domain:d.data?.domain,chainHost:d.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});tt(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(d){console.warn("Failed to close popup",d)}});const y=K(()=>{p({currentState:1})}),x=K(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=K(({sessionId:d,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",d),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=wt(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),y())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{loading:c.loading,onClick:x,variant:"contained",startIcon:e.jsx(Rn,{}),...u,children:s||l("buy.button.title")}),e.jsxs(Cn,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:y,children:[!c.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(z,{size:50}),m.currentState===4&&e.jsx(Sn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(S,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(S,{children:l("buy.status.success")})]}),c.error&&e.jsx(ye,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function Pt(n){return e.jsx(vn,{locale:n.locale,translations:Tt,children:e.jsx(It,{...n})})}function qt({nftDid:n,didDomainURL:i,locale:o,sx:a={}}){const{t:s}=A(),[r,u]=se({safeIframeRef:null,popoverAnchorEl:null}),l=j.useRef(null),m=H(),p=ie(m.breakpoints.down("md")),f=x=>{u({popoverAnchorEl:x.currentTarget})},c=()=>{u({popoverAnchorEl:null})},g=it(async()=>{const x=await Je(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(z,{});const y=ee(g.value,`/embed/domain?nft-did=${n}&locale=${o}`);return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:s("embed.iconTip"),children:e.jsx(h,{component:"img",src:ee(i,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},Ct({cursor:"pointer"},a)]})}),e.jsx($e,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:s("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:y})})]})}const Et=n=>["waiting","creating","renewaling"].includes(n);function en({siteId:n,domain:i,onAdd:o=()=>{},children:a=null,did:s,issuing:r=!1,setIssuing:u=()=>{}}){const{t:l}=A(),[m,p]=j.useState(!1),{inService:f}=F(),[c,g]=j.useState(null),{api:y,ws:{useSubscription:x}}=F(),{mode:b,actions:{refreshDomainStatus:d}}=oe(),w=ft(async()=>{const{cert:k}=await y.findCertificateByDomain({input:{domain:i,did:s}});return k}),C=(k,R)=>{k.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(R==="success"?E.success(l("setup.domain.genCertSuccess",{domain:k.domain})):R==="error"&&E.error(l("setup.domain.genCertFailed",{domain:k.domain,message:k.message}))))};if(j.useEffect(()=>{w.loading||u(Et(w.value?.status))},[w.loading,w.value?.status,u]),x(Ie.BlockletEvents.certError,k=>C(k,"error")),x(Ie.BlockletEvents.certIssued,k=>{w.retry(),d(k.domain),C(k,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await y.issueLetsEncryptCert({input:{siteId:n,domain:i,did:s,inBlockletSetup:b==="setup"}}),o(),u(!0)}catch(k){console.error(k),u(!1)}finally{p(!1),g(null)}},M={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},U=k=>{k.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(z,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:U}),c&&e.jsx(re,{color:"primary",title:c.title,description:c.description,confirm:c.confirm,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}en.propTypes={domain:t.string.isRequired,did:t.string.isRequired,siteId:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function nn({domain:n,domainStatus:i,did:o,onAdd:a=()=>{},children:s=null,issuing:r=!1,setIssuing:u=()=>{},...l}){return st(n)||!Qe(n)||Xn(i)||i?.isHttps?"":e.jsx(en,{...l,domain:n,did:o,onAdd:a,issuing:r,setIssuing:u,children:s})}nn.propTypes={domain:t.string.isRequired,domainStatus:t.shape({isHttps:t.bool}).isRequired,did:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function tn({id:n,domain:i,children:o=null,teamDid:a="",onDelete:s=null}){const{t:r}=A(),[u,l]=j.useState(!1),[m,p]=j.useState(null),{api:f}=F(),c=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:n,domainAlias:i,teamDid:a}}),s?.(),await ot(2e3)}catch(b){E.error(b.message)}finally{p(null),l(!1)}},y={keyName:i,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:i}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:i}),confirm:r("common.delete"),onConfirm:g,onCancel:c},x=b=>{b.stopPropagation(),p(y)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:u,open:x}):e.jsxs(te,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[u?e.jsx(z,{size:16}):e.jsx(_e,{style:{fontSize:16}}),r("common.delete")]}),m&&e.jsx(ht,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}tn.propTypes={id:t.string.isRequired,domain:t.string.isRequired,children:t.any,teamDid:t.string,onDelete:t.func};function sn({site:n,domain:i,blocklet:o,onDelete:a=()=>{}}){const{t:s}=A(),r=i.value===window.location.hostname;return e.jsx(xt,{"data-cy":"domain-actions",size:"large",actions:[({close:u})=>e.jsx(tn,{id:n.id,domain:i.value,teamDid:o?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(L,{title:r?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:i.isProtected||r,dense:!0,onClick:m=>{u(),l(m)},"data-cy":"action-toggle-block",children:[e.jsx(An,{style:{minWidth:24,marginRight:8},children:e.jsx(_e,{})}),e.jsx(Tn,{primary:s("common.delete")})]},"remove")})})})]})}sn.propTypes={site:t.object.isRequired,domain:t.object.isRequired,blocklet:t.object.isRequired,onDelete:t.func};const ae=t.shape({href:t.string,accessibility:t.shape({loading:t.bool,accessible:t.bool}),domainStatus:t.shape({isHttps:t.bool,matchedCert:t.object}),dns:t.shape({resolved:t.bool,ip:t.string})});function on({certificate:n={}}){const[i,o]=j.useState(null),a=F(),{t:s,locale:r}=A(),u=p=>{o(p.currentTarget)},l=()=>{o(null)},m=!!i;return e.jsxs(e.Fragment,{children:[e.jsx(kn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:u,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx($e,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(In,{children:e.jsxs(Pn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(S,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(S,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(S,{component:"div",children:`${s("common.issuer")}: ${Kn(n,"issuer.commonName","")}`}),e.jsx(S,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(S,{component:"div",children:`${s("router.cert.expiryOn")}: ${Pe(n.validTo,r)}`})]})]})})})]})}on.propTypes={certificate:t.object};function ne({domain:n,filters:i=["domain","http"]}){const{t:o}=A(),{value:a,domainStatus:s}=n;if(!Qe(a))return null;let r=null,u=null;const{isHttps:l,matchedCert:m}=s,{dns:{ip:p,isDnsResolved:f,isCnameMatch:c}={}}=s,g=f&&c;rt(a)||(g||p==="127.0.0.1"?r=e.jsx(L,{title:o("router.domain.verify.ok"),children:e.jsx(qe,{color:"success"})}):r=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(qe,{color:"error"})})),g?l?u=e.jsx(on,{certificate:m}):u=e.jsx(L,{title:o("router.domain.https.bad"),children:e.jsx(qn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):u=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(En,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const y=i.map(x=>x==="domain"?r:x==="http"?u:null);return j.createElement(j.Fragment,null,...y)}ne.propTypes={domain:ae.isRequired,filters:t.array};const Lt=Ye(be,"mutate_blocklets"),Ft=Ye(be,"",at);function fi(n){const{inService:i}=F(),{blocklet:o,loadingRuntimeInfo:a}=oe();let s=Lt;return i&&(s=Ft),e.jsx(s,{...n,blocklet:o,inService:i,loadingRuntimeInfo:a})}const Fe="nft-domain";function be({hasPermission:n=!1,blocklet:i,loadingRuntimeInfo:o=!1,inService:a=!1,showAllDomains:s=!1,updateBlockletDomainAliases:r=()=>{},systemTips:u=null}){const{t:l}=A(),m=ie(d=>d.breakpoints.down("md")),p=j.useMemo(()=>{let d=n;return lt(i)&&(d=d&&a),d},[n,a,i]),{site:f}=i,c=j.useMemo(()=>Xe(i.site?.domainAliases),[i.site?.domainAliases]),g=j.useMemo(()=>c.filter(d=>!fe.isCustomDomain(d.value)),[c]),y=j.useMemo(()=>c.filter(d=>fe.isCustomDomain(d.value)),[c]),x=j.useMemo(()=>y.filter(d=>d.type!==Fe),[y]),b=j.useMemo(()=>y.filter(d=>d.type===Fe),[y]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{sx:{gap:3},children:[!!b.length&&e.jsx(J,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:b,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!x.length&&e.jsx(J,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:x,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(h,{children:[u,e.jsx(J,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:i,site:f,mobile:m,updateBlockletDomainAliases:r})]})]}),!c.length&&(o?e.jsx(z,{size:16}):e.jsx(wn,{children:l("common.empty")}))]})}be.propTypes={hasPermission:t.bool,blocklet:t.object.isRequired,loadingRuntimeInfo:t.bool,inService:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func,systemTips:t.node};function Y({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}Y.propTypes={children:t.node};function he({domain:n,children:i,suffix:o=null,...a}){const{t:s,locale:r}=A(),u=H(),{href:l,accessibility:m,value:p}=n,f=j.useCallback(()=>e.jsx(ze,{content:je(p),locale:r,style:{marginLeft:"4px",color:u.palette.text.secondary,fontSize:"0.8em"}}),[p,r,u]);return!m||m.loading?e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),f(),e.jsx(Y,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(z,{size:13,style:{fontSize:"13px"}})})})]}):m.accessible?e.jsxs(me,{component:"span",...a,children:[e.jsx(h,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})})}),f(),e.jsx(Y,{children:o})]}):e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),!n.loading&&f(),e.jsx(Y,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
|
|
2
|
-
display: inline-block;
|
|
3
|
-
vertical-align: middle;
|
|
4
|
-
|
|
5
|
-
& > span {
|
|
6
|
-
line-height: 24px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&,
|
|
10
|
-
& > * {
|
|
11
|
-
color: ${({theme:n})=>n.palette.text.primary};
|
|
12
|
-
font-size: 18px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&,
|
|
16
|
-
& > * {
|
|
17
|
-
word-break: break-all;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
svg {
|
|
21
|
-
vertical-align: text-top;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.status {
|
|
25
|
-
margin-left: 8px;
|
|
26
|
-
font-size: 13px;
|
|
27
|
-
}
|
|
28
|
-
`;function ge({hasMutatePermission:n,site:i,domain:o,blocklet:a,onDelete:s}){return n&&!o.isProtected?e.jsx(sn,{site:i,domain:o,blocklet:a,onDelete:s}):null}ge.propTypes={hasMutatePermission:t.bool.isRequired,site:t.object.isRequired,domain:ae.isRequired,blocklet:t.object.isRequired,onDelete:t.func.isRequired};function Z({siteId:n,domain:i,blocklet:o,hasMutatePermission:a}){const{info:s}=F(),{t:r,locale:u}=A(),[l,m]=j.useState(!1);return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:.5,button:{lineHeight:1}},children:[i.type==="nft-domain"&&e.jsx(qt,{locale:u,nftDid:i.nftDid,didDomainURL:s.nftDomainUrl}),e.jsx(h,{sx:{display:"flex",mt:"-1px"},children:e.jsx(ne,{domain:i,filters:["http"]},`${i.value}-http`)}),a&&i.canGenerateCertificate&&e.jsx(nn,{siteId:n,domain:i.value,domainStatus:i.domainStatus,did:o.meta.did,issuing:l,setIssuing:m,children:({open:p})=>e.jsx(te,{sx:{padding:0},size:"small",onClick:f=>p(f),children:r("router.cert.genLetsEncryptCert.title")})})]})}Z.propTypes={siteId:t.string.isRequired,domain:ae.isRequired,blocklet:t.object.isRequired,hasMutatePermission:t.bool.isRequired};function J({title:n,description:i,domains:o=[],hasMutatePermission:a,blocklet:s,site:r,mobile:u,showAllDomains:l=!1,updateBlockletDomainAliases:m=()=>{}}){const[p,f]=j.useState(!1),c=j.useMemo(()=>l||p?o:o.slice(0,1),[o,p,l]),g=o.length>1,y=x=>a&&!x.isProtected;return e.jsx(We,{elevation:0,sx:{p:3,pb:l?3:1.5,display:"flex",alignItems:"flex-start",gap:3,borderRadius:2,border:"1px solid",borderColor:"divider",transition:"box-shadow 0.2s ease-in-out"},children:e.jsxs(W,{sx:{width:1},children:[e.jsxs(h,{sx:{mb:1.5},children:[e.jsx(S,{variant:"h6",children:n}),e.jsx(S,{sx:{fontSize:12,color:"text.secondary",mt:.5},children:i})]}),c.map((x,b)=>e.jsxs(W,{children:[b!==0&&e.jsx(h,{sx:{my:.75,width:1,height:"1px"}}),!u&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(h,{sx:{height:28,display:"flex",alignItems:"center"},children:e.jsx(ne,{domain:x,filters:["domain"]},`${x.value}-domain`)}),e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,svg:{width:"1em",height:"1em"},img:{width:"0.9em",height:"0.9em"}},children:[e.jsx(he,{domain:x,target:"_blank",children:x.value}),e.jsx(h,{sx:{mt:"2px"},children:e.jsx(Z,{siteId:s.site?.id,domain:x,blocklet:s,hasMutatePermission:a})})]})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(ge,{hasMutatePermission:a,site:r,domain:x,blocklet:s,onDelete:()=>m(x,"delete")})})]}),u&&e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",gap:1},children:[e.jsx(h,{sx:{height:28,display:"flex",alignItems:"center"},children:e.jsx(ne,{domain:x,filters:["domain"]},`${x.value}-domain`)}),e.jsx(he,{domain:x,target:"_blank",suffix:y(x)?null:e.jsx(h,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"space-between",svg:{width:"1em",height:"1rem"},img:{width:"0.9rem",height:"0.9rem"}},children:e.jsx(Z,{siteId:s.site?.id,domain:x,blocklet:s,hasMutatePermission:a})}),children:x.value})]}),y(x)&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",ml:"18px"},children:[e.jsx(h,{sx:{display:"flex",alignItems:"center"},children:e.jsx(Z,{siteId:s.site?.id,domain:x,blocklet:s,hasMutatePermission:a})}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(ge,{hasMutatePermission:a,site:r,domain:x,blocklet:s,onDelete:()=>m(x,"delete")})})]})]})]},x.value)),g&&!l&&e.jsx(te,{onClick:()=>f(!p),sx:{p:0,mt:.5,alignSelf:"center"},children:p?e.jsx(Ln,{}):e.jsx(Fn,{})})]})})}J.propTypes={title:t.string.isRequired,description:t.string.isRequired,domains:t.array.isRequired,hasMutatePermission:t.bool.isRequired,blocklet:t.object.isRequired,site:t.object.isRequired,mobile:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func};const rn=j.createContext({}),{Provider:Mt,Consumer:xi}=rn;function Bt({children:n}){const[i,o]=se({domain:"",error:null}),{locale:a}=A(),s={error:i.error,domain:i.domain,setError:r=>{o({error:r})},setDomain:r=>{const u=je(r),l=Ke(u,a);o({domain:u,error:l})}};return e.jsx(Mt,{value:{value:s},children:n})}function Ut(){const{value:n}=j.useContext(rn);return n}var ue,Me;function zt(){if(Me)return ue;Me=1;const{joinURL:n}=ct(),i=dt(),o="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p";return ue={DID_DOMAIN_SERVICE_DID:o,getDidDomainServiceURL:async s=>{if(!s||!s?.trim())return null;const r=new URL(s);r.pathname="__blocklet__.js",r.searchParams.set("type","json");const{data:u}=await i.get(r.toString()),l=u?.componentMountPoints?.find(c=>c.did===o),m=new URL(s);m.pathname=l?.mountPoint;const p=m.toString(),f=n(p,"/api");return{base:p,api:f,domain:n(f,"/domains")}}},ue}var Nt=zt();const $t=He(Yn),_t=He(Zn);var pe,Be;function Ot(){if(Be)return pe;Be=1;const n=$t,i=_t;function o(s){return!s||typeof s!="string"?!1:s.split(".").length===2}return pe={isTopLevelDomain:o,formatTopLevelDidDomain:s=>{const r=n(i(s));return r&&(o(r)?`www.${r}`:r)}},pe}var Ue=Ot(),Wt=mt();const Ht=Jn(Wt);function an({domain:n="",resolvedTarget:i,...o}){const{t:a,locale:s}=A();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...o,children:[e.jsxs(h,{sx:{display:"flex",flexWrap:"wrap"},children:[a("router.domain.setup.tipStart"),n&&e.jsx(h,{sx:{mx:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:n}),a("router.domain.setup.tipEnd"),":"]}),e.jsxs(W,{sx:{gap:.5,"&>div":{mb:0},marginTop:"12px"},children:[e.jsx(De,{label:a("router.domain.setup.recordType"),value:"CNAME",locale:s}),e.jsx(De,{label:a("router.domain.setup.recordValue"),value:i,locale:s})]})]})}an.propTypes={domain:t.string,resolvedTarget:t.string.isRequired};function De({locale:n,label:i,value:o}){const a=ie(r=>r.breakpoints.down("md")),s=H();return e.jsx(yt,{name:i,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(S,{component:"span",sx:[{color:"primary.main",overflow:"auto"},a?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"}],children:o}),e.jsx(ze,{content:o,locale:n,style:{marginLeft:"4px",color:s.palette.text.secondary}})]})})}De.propTypes={locale:t.string.isRequired,label:t.string.isRequired,value:t.string.isRequired};function ln({children:n=null,href:i="",sx:o=null,showIcon:a=!1,...s}){const r=H();return e.jsxs(Bn,{href:i,target:"_blank",...s,sx:{display:"inline-flex",alignItems:"center",color:"text.primary",":hover":{color:r.palette.primary.main},...o},children:[n,a&&e.jsx(Un,{fontSize:"small",sx:{ml:"4px",fontSize:"1rem"}})]})}ln.propTypes={children:t.node,sx:t.object,href:t.string,showIcon:t.bool};function cn({records:n}){return e.jsx(zn,{component:h,sx:{".MuiTableCell-root":{color:"text.primary"}},children:e.jsxs(Nn,{children:[e.jsx($n,{children:e.jsxs(ke,{children:[e.jsx(_,{children:"Type"}),e.jsx(_,{children:"Name"}),e.jsx(_,{children:"Data"})]})}),e.jsx(_n,{children:n.map(i=>e.jsxs(ke,{children:[e.jsx(_,{children:i.type}),e.jsx(_,{children:i.name}),e.jsx(_,{sx:{wordBreak:"break-word"},children:e.jsx(bt,{children:i.data})})]},i.name))})]})})}cn.propTypes={records:t.array.isRequired};function dn({url:n,domain:i=""}){const{t:o}=A();return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(S,{component:"h3",variant:"h6",children:o("setting.dns.step1Title")}),e.jsxs(S,{component:"section",children:[o("setting.dns.step1Desc1"),e.jsx(ln,{href:"https://lookup.icann.org/",target:"_blank",children:"ICANN"})]})]}),e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(S,{component:"h3",variant:"h6",children:o("setting.dns.step2Title",{url:n})}),e.jsx(S,{component:"section",children:o("setting.dns.step2Desc")})]}),e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(S,{component:"h3",variant:"h6",children:o("setting.dns.step3Title")}),e.jsx(S,{component:"section",children:o("setting.dns.step3Desc")}),e.jsx(cn,{records:[{type:"CNAME",name:jt(n),data:i}]})]})]})}dn.propTypes={url:t.string.isRequired,domain:t.string};const mn=j.createContext();function Vt({children:n}){const{t:i}=A(),{api:o}=F(),{blocklet:a}=oe(),[s,r]=j.useState(null),u=j.useCallback(async(p,f)=>{try{const c=await o.getBlocklet({input:{domain:p,did:a?.meta?.did}});return c?.blocklet?new Promise(g=>{r({title:i("setting.domain.conflictTitle",{domain:p}),description:i("setting.domain.conflictDescription",{domain:p,title:c.blocklet.meta?.title,from:c.blocklet.meta?.title,to:a.meta?.title}),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:async()=>{r(null),await f?.(),g(!0)},onCancel:()=>{r(null),g(!1)}})}):!1}catch(c){return console.error(c),E.error(N(c)),!1}},[o,i,a]),l=j.useCallback(()=>s?e.jsx(re,{title:s.title,description:s.description,confirm:s.confirm,cancel:s.cancel,onConfirm:s.onConfirm,onCancel:s.onCancel}):null,[s]),m=j.useMemo(()=>({checkConflict:u}),[u]);return e.jsxs(mn.Provider,{value:m,children:[n,l()]})}function un(){return j.useContext(mn)}function pn({siteId:n,teamDid:i,cnameDomain:o,defaultCustomDomain:a="",onInputDomain:s=X,appId:r="",appPk:u="",onSuccess:l=X,onError:m=X,disabled:p=!1,autoFocus:f=!0,inBlockletSetup:c=!1,shouldCheckDomain:g=!1,onStateChange:y=X,currentIp:x="",...b}){const{t:d,locale:w}=A(),{api:C,info:q}=F(),{blocklet:B}=oe(),M=Ut(),U=H(),k=gt({key:"sm"}),[R,P]=se({submittingDomain:!1,domain:a,error:null,type:q?.nftDomainUrl?"nftDomain":"inputDomain",showDnsTip:!1}),le=xe.getDisplayName(B),{checkConflict:ve}=un(),{connectApi:gn}=ut(),V=Dt(()=>Nt.getDidDomainServiceURL(q?.nftDomainUrl));if(q?.nftDomainUrl&&V.loading)return e.jsx(h,{...b,onError:m,currentIp:x,children:e.jsx(Ee,{relative:"parent",children:e.jsx(z,{})})});if(V.error)return e.jsx(h,{...b,onError:m,currentIp:x,children:e.jsx(Ee,{relative:"parent",children:V.error.message})});const Ce=V.value,ce=()=>{P({invalidDNSDomain:null})},we=async(D,v,T=!1)=>{await C.addDomainAlias({input:{id:n,domainAlias:D,teamDid:i,inBlockletSetup:!0,force:T}}),P({submittingDomain:!1}),l({domain:D,type:"inputDomain",canGenerateCertificate:!v})},de=async(D,v)=>{y(d("setting.domain.addingDomain"));try{await we(D,v,!1)}catch(T){if(console.error(T),ce(),N(T).includes("already exists")){await ve(D,()=>we(D,v,!0));return}E.error(N(T))}},Re=async({domain:D,type:v,nftDid:T,chainHost:O})=>{try{if(!g){if(v==="inputDomain"){await de(D);return}l({domain:D,type:v,nftDid:T,chainHost:O});return}y({text:d("setting.domain.checkingResolvable")});let I=30;const $=3e3,jn=I*1e3/$,Te=setInterval(()=>{if(I<=0){clearInterval(Te);return}y({text:`${d("setting.domain.checkingResolvable")} (${I--}s)`})},1e3),G=await Ht(()=>C.getDomainDNS({input:{teamDid:i,domain:D}}),{retries:jn,minTimeout:$,maxTimeout:$,onFailedAttempt:console.error});if(clearInterval(Te),!G?.isDnsResolved||!G?.isCnameMatch){let Q="";if(G.isDnsResolved?G.isCnameMatch||(Q=d("setting.domain.resolvedAddressError",{domain:D,curDomain:o})):Q=d("setting.domain.cannotResolve",{domain:D}),v==="nftDomain"){E.error(Q),l({domain:D,type:"nftDomain"});return}y({text:""}),P({invalidDNSDomain:{domain:D,error:Q},domain:D,type:v,submittingDomain:!1});return}if(v==="nftDomain"){l({domain:D,type:"nftDomain"});return}await de(D)}catch(I){E.error(I.message),y({text:""}),P({submittingDomain:!1})}},Se=async({domain:D,nftDid:v,chainHost:T,force:O})=>{let I=Le(D);I=Ue.formatTopLevelDidDomain(I),P({submittingDomain:!0}),await C.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:I,nftDid:v,chainHost:T,teamDid:i,inBlockletSetup:c,force:O}});const $="nftDomain";P({type:$}),await Re({domain:I,type:$,nftDid:v,chainHost:T})},Dn=async({domain:D,nftDid:v,chainHost:T,isDomainOwner:O})=>{if(!O){const I=d("router.domainAlias.addDomainNFT.authorizeFailed");E.error(I),P({submittingDomain:!1,error:I});return}try{await Se({domain:D,nftDid:v,chainHost:T,force:!1})}catch(I){if(console.error(I),ce(),N(I).includes("already exists")){await ve(D,()=>Se({domain:D,nftDid:v,chainHost:T,force:!0}));return}E.error(N(I))}finally{P({submittingDomain:!1})}},yn=async()=>{try{P({submittingDomain:!0});const D=Le(R.domain);if(q.nftDomainUrl&&Ce&&(await C.isDidDomain({input:{domain:D}})).value===!0){gn.openPopup({prefix:"/connect-to-did-domain",custom:!0,locale:w,extraParams:{provider:"wallet",delegatee:r,delegateePk:u,domain:Ue.formatTopLevelDidDomain(R.domain),appName:le,appUrl:xe.getAppUrl(B)},message:{title:d("router.domainAlias.addDomainNFT.connect.title",{appName:le}),scan:d("router.domainAlias.addDomainNFT.connect.scan",{domain:R.domain,appName:le}),confirm:d("router.domainAlias.addDomainNFT.connect.confirm"),success:d("router.domainAlias.addDomainNFT.connect.success")},onSuccess:Dn,onError:T=>{E.error(T.message),P({submittingDomain:!1})},onClose:()=>P({submittingDomain:!1}),checkTimeout:60*5e3},{baseUrl:Ce.base,locale:w});return}await Re({domain:D,type:R.type})}catch(D){P({submittingDomain:!1}),M.setError(D.message)}},Ae=M.error||R.error;return e.jsx(h,{...b,onError:m,currentIp:x,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{component:"form",onSubmit:D=>{D.preventDefault(),yn()},sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(S,{sx:{color:U.palette.text.primary},children:d("router.domainAlias.add.tips")}),e.jsx(On,{sx:{display:"block",marginTop:"8px"},label:d("router.domainAlias.add.domainDescription"),helperText:R.type==="inputDomain"&&Ae||d("router.domainAlias.add.helperText"),fullWidth:!0,disabled:p,value:R.domain,size:"small",variant:"outlined",error:!!Ae&&R.type==="inputDomain",onChange:D=>{const v=je(D.target?.value);M.setDomain(v);const T=Ke(v,w);P({domain:v,error:T,type:"inputDomain"}),s({domain:v,error:T,type:"inputDomain"})},autoFocus:f,onBlur:()=>{M.domain||(P({error:null}),M.setError(null))},slotProps:{htmlInput:{"data-cy":"domain-name-input"}}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Ne,{"data-cy":"confirm-add-domain",fullWidth:k,variant:"contained",loading:R.submittingDomain,type:"submit",children:d("common.add")})}),e.jsx(h,{sx:{backgroundColor:()=>Wn(U.palette.primary.light,.1),borderRadius:"8px",padding:"12px"},children:d("router.domainAlias.addDomainNFT.topLevelDidDomainHint")}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:U.palette.primary.main},onClick:()=>P({showDnsTip:!R.showDnsTip}),children:[e.jsx(Hn,{fontSize:"1em"}),d("router.domainAlias.showTipHint")]}),R.showDnsTip&&e.jsx(an,{domain:R.domain,resolvedTarget:o,style:{marginTop:"4px"}})]}),R.invalidDNSDomain&&e.jsx(re,{maxWidth:"md",title:d("common.reminder"),description:e.jsxs(W,{sx:{gap:2},children:[e.jsx(ye,{severity:"warning",children:d("setting.domain.invalidDNSReminder",{error:R.invalidDNSDomain.error})}),e.jsx(dn,{url:R.domain,domain:o})]}),color:"primary",confirm:d("setting.domain.continueAdd"),onConfirm:()=>de(R.invalidDNSDomain.domain,R.type),onCancel:ce})]})})}pn.propTypes={siteId:t.string.isRequired,currentIp:t.string,teamDid:t.string.isRequired,cnameDomain:t.string.isRequired,defaultCustomDomain:t.string,onInputDomain:t.func,onSuccess:t.func,appId:t.string,appPk:t.string,disabled:t.bool,autoFocus:t.bool,inBlockletSetup:t.bool,shouldCheckDomain:t.bool,onStateChange:t.func,onError:t.func};function fn({id:n,children:i=null,title:o="",teamDid:a="",systemDomains:s,appId:r=null,appPk:u,onAddDomainAlias:l=()=>{},...m}){const{t:p}=A(),[f,c]=se({loading:!1,confirmSetting:null}),g=s.find(d=>fe.isDidDomain(d)),y=()=>{c({loading:!1,confirmSetting:null})},x={title:o||p("router.domainAlias.add.title"),description:function(w,C,q){return e.jsx(pn,{siteId:n,teamDid:a,cnameDomain:g,onSuccess:B=>{l(B),c({confirmSetting:null})},onInputDomain:({domain:B,type:M,error:U})=>{C({...w,domain:B,type:M,__disableConfirm:!!U}),q(U)},appId:r,appPk:u,...m})},confirm:p("common.confirm"),cancel:p("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:y},b=d=>{d.stopPropagation(),c({confirmSetting:x})};return e.jsxs(e.Fragment,{children:[typeof i=="function"?i({loading:f.loading,open:b}):e.jsxs(Oe,{onClick:b,className:"rule-action","data-cy":"action-add-domain-alias",children:[f.loading?e.jsx(z,{size:16}):e.jsx(Vn,{style:{fontSize:18,marginRight:5}}),p("router.domainAlias.add.title")]}),f.confirmSetting&&e.jsx(re,{title:f.confirmSetting.title,description:f.confirmSetting.description,confirm:f.confirmSetting.confirm,cancel:f.confirmSetting.cancel,params:f.confirmSetting.params,onCancel:f.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:f.loading,maxWidth:"sm"})]})}fn.propTypes={id:t.string.isRequired,children:t.any,title:t.string,teamDid:t.string,systemDomains:t.arrayOf(t.string).isRequired,appId:t.string,appPk:t.string.isRequired,onAddDomainAlias:t.func};function Gt(n){return e.jsx(Bt,{children:e.jsx(fn,{...n})})}function xn({appId:n,appPk:i,siteId:o,inBlockletSetup:a,teamDid:s,sx:r={},onAddDomainAlias:u=()=>{},...l}){const{api:m,info:p}=F(),{locale:f,t:c}=A(),{checkConflict:g}=un(),y=async({domain:b,nftDid:d,chainHost:w,force:C})=>{const q={id:o,type:"nft-domain",domainAlias:b,nftDid:d,chainHost:w,teamDid:s,inBlockletSetup:a,force:C};return await m.addDomainAlias({input:q}),q},x=async({domain:b,nftDid:d,chainHost:w})=>{try{const C=await y({domain:b,nftDid:d,chainHost:w,force:!1});u(C)}catch(C){if(N(C).includes("already exists")){await g(b,()=>y({domain:b,nftDid:d,chainHost:w,force:!0}));return}E.error(N(C))}};return e.jsx(Pt,{delegatee:n,delegateePk:i,didDomainURL:p.nftDomainUrl,onSuccess:x,locale:f,variant:"outlined",sx:r,title:c("router.domainAlias.addDomainNFT.buy"),...l})}xn.propTypes={appId:t.string.isRequired,appPk:t.string.isRequired,siteId:t.string.isRequired,inBlockletSetup:t.bool.isRequired,teamDid:t.string.isRequired,sx:t.object,onAddDomainAlias:t.func};function Qt({blocklet:n,bugDidDomainProps:i={},connectDomainProps:o={},updateBlockletDomainAliases:a=()=>{}}){const{t:s}=A(),{info:r}=F(),u=ie(c=>c.breakpoints.down("md")),{site:l}=n,m=j.useMemo(()=>Xe(n.site?.domainAliases),[n.site?.domainAliases]),p=n.environments?.find(c=>c.key==="BLOCKLET_APP_PK")?.value,f=pt(m);return e.jsx(Vt,{children:e.jsx(hn,{action:e.jsxs(h,{sx:{display:"flex",alignItems:u?"stretch":"center",flexDirection:u?"column":"row",gap:1},children:[r.nftDomainUrl&&e.jsx(xn,{variant:"contained",appId:n.appPid,appPk:p,siteId:l.id,inBlockletSetup:!1,teamDid:n.meta.did,onAddDomainAlias:c=>{const g={value:c.domainAlias,isProtected:!1,type:c.type,nftDid:c.nftDid,chainHost:c.chainHost,accessibility:{loading:!0}};a(g)},...i}),e.jsx(Gt,{id:l.id,title:s("common.connectExistingDomain"),teamDid:n.meta?.did,appId:n.appPid,appPk:p,systemDomains:f?.map(c=>c.value),onAddDomainAlias:c=>{const g={value:c.domain,isProtected:!1,type:c.type==="nftDomain"?"nft-domain":"",nftDid:c.nftDid,chainHost:c.chainHost,accessibility:{loading:!0},canGenerateCertificate:c.canGenerateCertificate===void 0?!0:c.canGenerateCertificate};a(g)},...o,children:({open:c})=>e.jsxs(te,{variant:"outlined",sx:{borderColor:"#ddd",color:"text.primary","&:hover":{bgcolor:g=>g.palette.primary.main,color:g=>g.palette.primary.contrastText}},"data-cy":"add-domain-alias",onClick:c,disabled:xe.isInProgress(n.status),children:[e.jsx(Gn,{style:{fontSize:"1.3em",marginRight:4}}),s("common.connectExistingDomain")]})})]})})})}Qt.propTypes={blocklet:t.object.isRequired,bugDidDomainProps:t.object,connectDomainProps:t.object,updateBlockletDomainAliases:t.func};function hn({action:n}){const{t:i}=A();return e.jsxs(We,{elevation:0,sx:{p:3,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsx(h,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(h,{sx:{flex:1,width:0,mb:1.5},children:[e.jsx(S,{variant:"h6",children:i("common.bugOrConnectDomain")}),e.jsx(S,{sx:{fontSize:12,color:"text.secondary",mt:.5},children:i("common.bugOrConnectDomainTip")})]})}),n]})}hn.propTypes={action:t.element.isRequired};export{Bt as D,Qt as a,fi as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m}from"./vendor-react-DX7tU9aY.js";import{W as n}from"./vendor-ux-CLT2i3Pv.js";import{V as l,W as p,a1 as c,o as u}from"./index-CXp5SI_f.js";import{a as x,b as d}from"./domain-action-card-kMPYS2Nj.js";import{j as t,al as k,b3 as f,b4 as h}from"./vendor-mui-core-CV-FnYH_.js";import"./vendor-utils-BzQg432x.js";import"./vendor-hooks-DAZ1H6Va.js";import"./vendor-arcblock-Dll6qxMT.js";import"./useSetState-CUbypYGT.js";import"./permission-CvrrGfG6.js";import"./session-Bp3LV7zJ.js";import"./useAsyncRetry-C4R9ufi-.js";import"./useAsync-DfiOQMQ_.js";import"./confirm-CdVn5WdC.js";import"./index-DBs9Ljax.js";import"./actions-DydkTgA0.js";import"./delete-confirm-CkiUXocp.js";import"./click-to-copy-BgIYUMoo.js";import"./use-mobile-CyUZDIaX.js";import"./useAsync-CkKfnulP.js";import"./index-Di2nSesc.js";import"./util-DySzCymV.js";import"./engine-D_fEFx9_.js";function H(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=l(),{inService:r}=p(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{gap:3,maxWidth:820},children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}export{H as default};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{W as M,af as q,_ as w,Q as E,Z as Q,aS as Z,bx as J}from"./vendor-ux-CLT2i3Pv.js";import{j as t,b3 as f,bg as X,ch as ee,T as b,R as T,bb as te,al as B,A as $,a7 as se,aT as ie}from"./vendor-mui-core-CV-FnYH_.js";import{r as n,j as ne}from"./vendor-react-DX7tU9aY.js";import{ad as g}from"./vendor-utils-BzQg432x.js";import{C as oe}from"./isEmail-BwGDo3Ws.js";import{K as re}from"./landing-page-JLA-ZD1t.js";import{u as ae,m as h,n as O,c as j,H as ce}from"./index-CXp5SI_f.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-beob4f2C.js";import"./vendor-hooks-DAZ1H6Va.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./vendor-arcblock-Dll6qxMT.js";const le=ie.form`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
gap: 24px;
|
|
7
|
-
width: 100%;
|
|
8
|
-
|
|
9
|
-
input[type='number']::-webkit-inner-spin-button,
|
|
10
|
-
input[type='number']::-webkit-outer-spin-button {
|
|
11
|
-
-webkit-appearance: none;
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
div.Mui-focused input {
|
|
15
|
-
caret-color: ${p=>p.theme.palette.primary.main};
|
|
16
|
-
}
|
|
17
|
-
`,ue=p=>{try{if(!p)return null;const o=J(p).toString();return oe(o)?o:null}catch{return null}};function we(){const p=n.useRef(null),{session:o,connectApi:K}=ae(),{t:s,locale:l}=M(),[y,P]=n.useState(o.user?.email||""),[r,A]=n.useState(""),[x,v]=n.useState(!1),[W,H]=n.useState(!1),[c,z]=n.useState(!1),[F,I]=n.useState(!1),[C,N]=n.useState(!1),{wallet:u}=q(),[a]=ne(),R=a.get("inviter")||localStorage.getItem("inviter"),d=a.get("updateKyc")==="1";n.useEffect(()=>{const i=a.get("subject"),e=ue(i);e&&P(e)},[]),n.useEffect(()=>{o.user?.emailVerified&&d&&(I(!0),setTimeout(()=>{if(u&&h()){w(()=>import("./index-qpadg6GT.js").then(i=>i.i),[],import.meta.url).then(i=>{i.call("arcClosePage")});return}window.location.href=D(a.get("redirect")||"/")},1e3))},[o.user,d,u,a]);const G=n.useCallback(async i=>{i.preventDefault(),v(!0);try{await O.post(`/kyc/email/send?locale=${l}`,{email:y}),z(!0),E.success(s("login.issueKyc.codeSentSuccess"))}catch(e){E.error(_(e)),document.getElementById("email-input")?.focus()}finally{v(!1)}},[y,l,s]),S=n.useCallback(async i=>{i&&i.preventDefault(),v(!0);try{await O.post(`/kyc/email/verify?locale=${l}`,{code:r}),I(!0),K.open({locale:l,action:"issue-kyc",extraParams:{code:r,updateKyc:a.get("updateKyc")||"0",inviter:R||""},className:"connect",popup:!0,saveConnect:!1,forceConnected:!0,hideCloseButton:!0,messages:{title:s("login.issueKyc.claim"),scan:s("login.issueKyc.scan"),confirm:s("login.issueKyc.confirm"),success:s("login.issueKyc.success")},useSocket:!0,onSuccess:()=>{N(!0),K.close(),d?(o.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(u&&h()){w(()=>import("./index-qpadg6GT.js").then(e=>e.i),[],import.meta.url).then(e=>{e.call("arcClosePage")});return}window.location.href=D(a.get("redirect")||"/")},1e3)):u&&h()&&w(()=>import("./index-qpadg6GT.js").then(e=>e.i),[],import.meta.url).then(e=>{e.call("arcClosePage")})},onError:e=>{E.error(_(e))}})}catch(e){I(!1),E.error(_(e)),document.getElementById(`code-input-${g(r).length-1}`)?.focus()}finally{v(!1)}},[r,l,a,d,u,R]);n.useEffect(()=>{c&&g(r).length===j.VERIFY_CODE_LENGTH&&S()},[r,S,c]);const Y=n.useCallback(()=>{H(!0),K.open({locale:l,action:"update-kyc",className:"connect",popup:!0,saveConnect:!1,forceConnected:!0,hideCloseButton:!0,messages:{title:s("login.updateKyc.title"),scan:s("login.updateKyc.scan"),confirm:s("login.updateKyc.confirm"),success:s("login.updateKyc.success")},useSocket:!0,onSuccess:()=>{o.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(u&&h()){w(()=>import("./index-qpadg6GT.js").then(i=>i.i),[],import.meta.url).then(i=>{i.call("arcClosePage")});return}window.location.href=D(a.get("redirect")||"/")},2e3)},onError:i=>{E.error(_(i))}})},[l,a,u]),k=n.useCallback(i=>{if(!c)return;i.preventDefault();const e=g(i.clipboardData.getData("text/plain").slice(0,j.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(e))return;A(e.padEnd(j.VERIFY_CODE_LENGTH," "));const m=document.getElementById(`code-input-${e.length}`);m&&m.focus()},[c]);n.useEffect(()=>(document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}),[k]);const V=h()?s("login.issueKyc.issueTitle"):s("login.issueKyc.verifyTitle"),U=h()?s("login.issueKyc.issueAction"):s("login.issueKyc.verifyAction");return t.jsxs(re,{did:window.blocklet?.appPid,children:[t.jsx(ce,{children:t.jsxs("title",{children:[V," | ",window.blocklet?.appName]})}),t.jsxs(f,{direction:"column",sx:{justifyContent:"center",alignItems:"center",width:"560px",px:2,boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[t.jsxs(f,{spacing:1,sx:{justifyContent:"center",alignItems:"center",mb:3},children:[C?t.jsx(X,{sx:{fontSize:72},color:"success"}):t.jsx(ee,{sx:{fontSize:72},color:"primary"}),t.jsx(b,{variant:"h5",sx:{textAlign:"center"},children:V}),!C&&t.jsx(b,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:s("login.issueKyc.pageDescription")}),C&&t.jsx(b,{variant:"body1",sx:{textAlign:"center"},children:s("login.issueKyc.success")}),C&&t.jsx(T,{variant:"contained",color:"primary",component:te,href:"/",size:"large",children:s("login.issueKyc.backToHome")}),!C&&o.user&&t.jsxs(f,{direction:"column",sx:{justifyContent:"center",alignItems:"center"},children:[t.jsx(b,{variant:"body2",sx:{color:"info.main",textAlign:"center",mt:1},children:s("login.issueKyc.issueTarget",{action:U})}),t.jsxs(f,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",width:"100%",maxWidth:360},children:[t.jsx(Q,{did:o.user.did,responsive:!0,copyable:!0,showQrcode:!1}),t.jsx(Z,{locale:l,session:o,showRole:!0,showManageBlocklet:!1})]})]})]}),t.jsx(B,{ref:p,sx:{width:"100%"},children:!F&&!W&&t.jsxs(le,{onSubmit:c?S:G,children:[!c&&t.jsx($,{type:"email",id:"email-input",placeholder:s("login.issueKyc.emailPlaceholder"),sx:{width:"100%",maxWidth:360},value:y,onChange:i=>P(i.target.value),disabled:x,required:!0}),c&&t.jsxs(f,{direction:"column",spacing:2,sx:{justifyContent:"center",alignItems:"center"},children:[t.jsx(b,{variant:"body2",sx:{textAlign:"center"},children:s("login.issueKyc.codeSentMessage",{email:y})}),t.jsx(B,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(j.VERIFY_CODE_LENGTH)].map((i,e)=>t.jsx($,{value:g(r[e])||"",type:"number",sx:{width:"14%"},onChange:m=>{const L=r.split("");L[e]=m.target.value,A(L.join("")),m.target.value&&e<5&&document.getElementById(`code-input-${e+1}`)?.focus()},onKeyDown:m=>{m.key==="Backspace"&&!g(r[e])&&e>0&&document.getElementById(`code-input-${e-1}`)?.focus()},disabled:x,required:!0,id:`code-input-${e}`,autoComplete:"off",slotProps:{htmlInput:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"}}},`code-input-${e}`))})]}),t.jsxs(f,{direction:"row",spacing:2,sx:{justifyContent:d?"space-between":"center",alignItems:"center",width:"100%",maxWidth:360},children:[d&&t.jsx(T,{variant:"text",disabled:x,onClick:Y,size:"large",children:s("login.updateKyc.button")}),t.jsx(T,{type:"submit",size:"large",variant:"contained",disabled:x||!y||c&&g(r).length!==j.VERIFY_CODE_LENGTH,sx:{width:d?"auto":"100%"},children:x?t.jsx(se,{size:24}):s(c?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{we as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bh as e}from"./index-CXp5SI_f.js";var i=e();export{i as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,a7 as P,al as E}from"./vendor-mui-core-CV-FnYH_.js";import{r as T,u as j}from"./vendor-react-DX7tU9aY.js";import{o as k}from"./vendor-arcblock-Dll6qxMT.js";import{W,Q as d,b3 as C}from"./vendor-ux-CLT2i3Pv.js";import{w as I,c as R,l as S,b,e as v}from"./index-CXp5SI_f.js";import{K as U}from"./landing-page-JLA-ZD1t.js";import{w as L}from"./wrap-locale-5DJTJTXP.js";import{g as N}from"./get-safe-url-beob4f2C.js";import"./vendor-hooks-DAZ1H6Va.js";import"./vendor-utils-BzQg432x.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./index-DL0wTcgx.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=T.useContext(n),{t:s,locale:h}=W(),f=j(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(r,w)=>{o(r,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=N(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=r=>{d.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(k,{children:e.jsx(P,{})}):e.jsx(U,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(I,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:600*1e3,webWalletUrl:a,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=L(_);function z(){const n=C(),a=(o,t)=>{o.sessionToken&&(b(t(o.sessionToken)),v(t(o.refreshToken)))};return e.jsx(B,{SessionContext:S,webWalletUrl:n,onSuccess:a})}export{z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as E,j as e,R as S,ci as P,bg as R,al as r,T as c,a7 as _}from"./vendor-mui-core-CV-FnYH_.js";import{u as I,s as L,c as N,U as p,j as U,aH as W}from"./index-CXp5SI_f.js";import{o as z}from"./vendor-arcblock-Dll6qxMT.js";import{b4 as A}from"./vendor-ux-CLT2i3Pv.js";import{i as T,b as y}from"./vendor-hooks-DAZ1H6Va.js";import{u as D,r as i,j as F}from"./vendor-react-DX7tU9aY.js";import{K as a}from"./landing-page-JLA-ZD1t.js";import{z as H}from"./vendor-utils-BzQg432x.js";import{u as K}from"./use-window-close-Dpj5UcYT.js";import"./use-blocklet-logo-Cf1j7pQz.js";function Z(){const m=D(),l=i.useRef(null),{t:s,locale:d}=i.useContext(A),{api:x,connectApi:f}=I(),[h]=F(),w=E(),b=K(),n=T({ready:!1,success:!1,error:null,invalidSession:!1}),k=()=>{try{const o=new URL(window.location.href);if(o.hash.includes("invalid")){n.invalidSession=!0;return}const u=o.searchParams.get("__connect_url__"),v=U(u);if(!W(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>k(),[]);const C=y(o=>{n.error=o.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=y(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),t=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:t},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:H(window.location.origin,N.WELLKNOWN_SERVICE_PATH_PREFIX,L),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,t]);const j=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:j})},"invalid");if(n.error){const o=n.error,u=j;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:o,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&b(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:w.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:t}),description:`${s("connectCli.successDesc",{source:t})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(z,{children:e.jsx(_,{})})}export{Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,al as c,T as C,V as Q,a7 as M,b3 as X,R as W,bb as Z,G as ee,b4 as K,cg as O,bg as se}from"./vendor-mui-core-CV-FnYH_.js";import{r as u,u as ne,j as te}from"./vendor-react-DX7tU9aY.js";import{aE as oe,aI as re,aJ as ie,aK as ae,u as ce,n as le,j as F,U as ue,a7 as de,c as pe}from"./index-CXp5SI_f.js";import{n as z,ae as he,z as $}from"./vendor-utils-BzQg432x.js";import{a as xe,i as J,b as p,y as fe,A as ge}from"./vendor-hooks-DAZ1H6Va.js";import{M as H,Y as me,bl as je,W as Y,P as ye,a1 as G,a4 as we}from"./vendor-ux-CLT2i3Pv.js";import{o as Ce}from"./vendor-arcblock-Dll6qxMT.js";import{K as be}from"./landing-page-JLA-ZD1t.js";import{u as Ae}from"./use-window-close-Dpj5UcYT.js";import"./use-blocklet-logo-Cf1j7pQz.js";function Se({requestAppInfo:t,currentAppInfo:f}){return e.jsxs(c,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(c,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(H,{src:f.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(c,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(c,{className:"dot"}),e.jsx(c,{className:"dot"}),e.jsx(c,{className:"dot"})]}),e.jsx(H,{src:t.appLogo,alt:t.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(C,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(c,{component:"span",sx:{color:"primary.main"},children:t.appName})]})]})}function ve({user:t,switchPassport:f}){const b=xe(()=>(t?.passports||[])?.find(j=>j.name===t.role||j.role===t.role),[t?.passports,t?.role]);return e.jsx(Q,{label:b?.title||t?.role||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.100",backgroundColor:"transparent",textTransform:"capitalize",pr:1,pl:.5,"&:active":{boxShadow:"none"}},clickable:!0,deleteIcon:e.jsx(me,{icon:je,color:"inherit"}),onDelete:f,onClick:f})}const ze=u.memo(ve),Te={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function _e({session:t,requestAppInfo:f,currentAppInfo:b,children:j=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:o=!1,hideCancel:L=!1,hideButton:T=!1,notThisText:I=void 0,authorizeText:r=void 0,connectText:l=void 0,cancelText:P=void 0,useAnotherText:A=void 0,slotProps:h=void 0,onConnect:R=z,onAuthorize:g=z,onSwitchConnect:_=z,onSwitchPassport:S=z,onCancel:E=z,ref:U,disableAuthorizeButton:k=!1}){const i=J({loading:!1}),{locale:v="en"}=Y()||{},m=p((B,w={})=>ye(Te,B,v,"en",w)),x=p(()=>{i.loading=!1}),D=p(()=>{i.loading=!0,R?.(x)}),q=p(()=>{i.loading=!0,_?.(x)}),n=p(()=>{i.loading=!0,g?.(x)}),a=p(()=>{i.loading=!0,S?.(x)}),d=p(()=>{E?.()});if(u.useImperativeHandle(U,()=>({closeLoading:x})),t.loading||!t.initialized)return e.jsx(Ce,{children:e.jsx(M,{})});const y=s??t?.user;return e.jsx(be,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(c,{...h?.root,sx:G({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(oe,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(c,{...h?.contentContainer,sx:G({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Se,{requestAppInfo:f,currentAppInfo:b}),y?e.jsxs(e.Fragment,{children:[e.jsx(re,{user:y,showDid:!0,cardType:ae.Detailed,infoType:ie.Minimal,renderTopRightContent:()=>e.jsx(ze,{user:y,switchPassport:a})}),e.jsx(c,{})]}):null,j,T?null:e.jsxs(e.Fragment,{children:[e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(X,{direction:"row",spacing:2,children:[L?null:e.jsx(W,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:d,sx:{color:"grey.500"},children:P||m("cancel")}),y&&!o?e.jsxs(W,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:i.loading||k,children:[i.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,r||m("authorize")]}):e.jsxs(W,{variant:"contained",size:"large",fullWidth:!0,disabled:i.loading||k,onClick:D,children:[i.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,l||m("connect")]})]})]}),N||!y?null:e.jsx(c,{sx:{textAlign:"center"},children:e.jsxs(C,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||m("notThis")," ",e.jsx(Z,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:A||m("useAnother")})]})})]})})})})}const ke=$(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),V=3e3;function Me(){const t=u.useRef(null),[f,b]=u.useState(),[j]=fe({targetDate:f}),{session:s}=ce(),N=ee(),o=J({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,T]=ge("currentUserInfo",{defaultValue:null}),I=ne(),{t:r}=Y(),[l]=te(),P=Ae(),[,A]=u.useState(!0),[h,R]=u.useState({appName:l.get("cli")?l.get("appName")??r("aigne.cli"):"",appLogo:l.get("cli")?l.get("appLogo"):""}),g=l.get("required_roles")||"",_=u.useMemo(()=>{const n=g.split(",")||[];if(n.length===0)return n;const a=he([s.user?.role,(s.user?.passports||[]).map(d=>d.role)].flat().filter(Boolean));return a.length===0?a:n.filter(d=>a.includes(d.toLocaleLowerCase().trim()))},[s.user,g]),S=_.join(","),E=s.user&&g?_.length>0:!0,U=async()=>{A(!0);try{const n=l.get("__url__"),a=n?F(n):null;if(!a){A(!1);return}const d="__blocklet__.js?type=json",B=new URL(a).origin,{data:w}=await de.get($(B,d));R({appName:w?.appName,appUrl:w?.appUrl,appLogo:$(w?.appUrl,w?.appLogo)})}catch(n){console.error(n)}finally{A(!1)}};u.useEffect(()=>{s.user&&T(s.user)},[s.user]);const k=()=>{U(),s.user&&T(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){o.invalidSession=!0;return}const a=n.searchParams.get("__token__"),d=a?F(a):null;if(!d)throw new Error("No token");o.token=d,o.ready=!0}catch(n){o.invalidSession=!0,o.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};u.useLayoutEffect(()=>k(),[]);const i=window.blocklet,v=l.get("source")||"Generate Access Key",m=p(async n=>{try{await le.post("/access-key/authorize",{source:v,sid:o.token,requiredRoles:S}),o.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),l.has("closeOnSuccess")&&(b(Date.now()+V),setTimeout(()=>P(),V))}catch(a){console.error(a)}finally{n()}}),x=p(()=>{s.login()}),D=p(()=>{window.close()});u.useEffect(()=>{s.initialized&&!s.user&&(we()||x())},[s?.user,s?.initialized,x]),u.useEffect(()=>{s.open||t.current?.closeLoading?.()},[s.open]);const q=()=>o.error?e.jsxs(K,{severity:"error",children:[e.jsx(O,{children:r("aigne.notAuthorized")}),o.error]}):o.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(se,{style:{color:N.palette.success.main,fontSize:72}}),title:r("connectCli.success",{source:v}),description:`${r("connectCli.successDesc",{source:v})} ${l.has("closeOnSuccess")?r("connectCli.closeDelay",{seconds:Math.ceil(j/1e3)}):""}`}):e.jsxs(K,{severity:"info",children:[e.jsx(O,{children:r("aigne.connectTo",{appName:i.appName})}),g&&e.jsx(C,{component:"li",variant:"body2",children:S?r("aigne.accessTips.switchPassport",{required_roles:S}):r("aigne.accessTips.switchPassportRequired",{required_roles:g})}),e.jsx(C,{component:"li",variant:"body2",children:r("aigne.accessTips.tips1",{appName:h.appName,accessAppName:i.appName})}),e.jsx(C,{component:"li",variant:"body2",children:r("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(C,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:r("aigne.accessTips.tips3",{url:ke,accessAppName:i.appName})}})]});return e.jsx(_e,{ref:t,session:s,requestAppInfo:h,currentAppInfo:i,userInfo:L,onAuthorize:m,onConnect:x,onSwitchConnect:s.switchDid,onCancel:D,hideAuthorize:!!o.error,hideSwitchConnect:o.success,hideButton:o.success,authorizeText:r("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!E,children:q()})}export{Me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aG as t}from"./index-CXp5SI_f.js";import{Q as e}from"./vendor-ux-CLT2i3Pv.js";function c(...o){try{return t(...o)}catch(r){throw e.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
|