@abtnode/blocklet-services 1.16.43-beta-20250510-123357-65a2988c → 1.16.44-beta-20250512-155818-937e465d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/emails/_components/activity.js +2 -1
- package/api/index.js +5 -1
- package/api/libs/email.js +1 -1
- package/dist/assets/{AdapterDayjs-BiPHzcUP.js → AdapterDayjs-BD9H1lZ-.js} +1 -1
- package/dist/assets/{ArrowDropDown-Dghek9CI.js → ArrowDropDown-BrO-zDlb.js} +1 -1
- package/dist/assets/{CheckCircle-Dvhgeo9j.js → CheckCircle-Ds4QI0ey.js} +1 -1
- package/dist/assets/{ChevronLeft-DE33N57i.js → ChevronLeft-CnQaQ-rc.js} +1 -1
- package/dist/assets/{ChevronRight-BfbPIE2b.js → ChevronRight-a_2_x6Ew.js} +1 -1
- package/dist/assets/{Community-2MKVAbIk.js → Community-DW6DJTIs.js} +1 -1
- package/dist/assets/{DeleteOutline-B6efX_Fy.js → DeleteOutline-CFN4r-OG.js} +1 -1
- package/dist/assets/{Done-Ct5slWpT.js → Done-DqSE6KPe.js} +1 -1
- package/dist/assets/{Download-DKQGRFHf.js → Download-C_LRKzbG.js} +1 -1
- package/dist/assets/{Edit-BLsIdIOp.js → Edit-CbR4eoK8.js} +1 -1
- package/dist/assets/{EditIcon-CwTCQzs9.js → EditIcon-DxUWMw59.js} +1 -1
- package/dist/assets/{Email-DOy8vL0N.js → Email-DWueGk7t.js} +1 -1
- package/dist/assets/{Error-wpqrAfUT.js → Error-jEHdDLNk.js} +1 -1
- package/dist/assets/{ExpandLess-CJXkgMMr.js → ExpandLess-CkoEHpgk.js} +1 -1
- package/dist/assets/{Google-BbAgcDQ_.js → Google-DHEolkW-.js} +1 -1
- package/dist/assets/{Holiday-DT-VjgQP.js → Holiday-Dwvo6QkZ.js} +1 -1
- package/dist/assets/{InfoOutlined-Dy7jTc7H.js → InfoOutlined-DkG0jjos.js} +1 -1
- package/dist/assets/{Launch-DBKe0gh0.js → Launch-B-2Jomi6.js} +1 -1
- package/dist/assets/{LaunchOutlined-BIq6YUU8.js → LaunchOutlined-CXNijfqX.js} +1 -1
- package/dist/assets/{Location-C__VfR4D.js → Location-DUEOr9J2.js} +1 -1
- package/dist/assets/{LockIcon-DIGiHKHl.js → LockIcon-Cjg8jV1E.js} +1 -1
- package/dist/assets/{Meeting-Cn2X2Ix7.js → Meeting-CJaI_cKm.js} +1 -1
- package/dist/assets/{MoreHoriz-BxJelL2A.js → MoreHoriz-B6KdR0Y8.js} +1 -1
- package/dist/assets/{OffSick-Cnicwu8x.js → OffSick-C9VqqjrN.js} +1 -1
- package/dist/assets/{Phone-CoX1qzAs.js → Phone-DcHUzCa-.js} +1 -1
- package/dist/assets/{PlayArrow-C9IFmc-j.js → PlayArrow-BToG9L6q.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DCM9zW3a.js → QuestionMarkCircle-BPVDAm8U.js} +1 -1
- package/dist/assets/{ServerLogo-CfbYjQbP.js → ServerLogo-s6cfhx92.js} +1 -1
- package/dist/assets/{Timezone-CCdgxxpv.js → Timezone-B-Ho_Uno.js} +1 -1
- package/dist/assets/{TuneOutlined-CB7t_nGq.js → TuneOutlined-BR2H7Mxj.js} +1 -1
- package/dist/assets/{ViewList-B4hmqizo.js → ViewList-D8vtMKQz.js} +1 -1
- package/dist/assets/{WorkingRemotely-DWT54kH1.js → WorkingRemotely-lJ6DUMCR.js} +1 -1
- package/dist/assets/{access-control-RJu7xYI3.js → access-control-CCSlKYYz.js} +1 -1
- package/dist/assets/{actions-BCWb2ez1.js → actions-BjTeIzgS.js} +1 -1
- package/dist/assets/{add-component-core-DRAzXCeg.js → add-component-core-C7-Epxoj.js} +15 -15
- package/dist/assets/{add-resource-BDJuVU8K.js → add-resource-CJHw7ea0.js} +1 -1
- package/dist/assets/{addon-ygDS7Fug.js → addon--u4EErgw.js} +1 -1
- package/dist/assets/{advanced-CFME3Vrl.js → advanced-tG5IRVhQ.js} +1 -1
- package/dist/assets/{appearance-BqJwEmtt.js → appearance-bRLsRDs2.js} +1 -1
- package/dist/assets/audit-logs-B3-Fo3nR.js +35 -0
- package/dist/assets/{authorize-WekjQ3_M.js → authorize-DNTNbUhI.js} +1 -1
- package/dist/assets/{base32-BbrXtXL6.js → base32-_zEVBJUg.js} +1 -1
- package/dist/assets/{branding-CS-f1gMT.js → branding-By8KDk5Q.js} +6 -6
- package/dist/assets/{branding-BTfb8_b4.js → branding-hDeNkLC2.js} +2 -2
- package/dist/assets/{bundle-avatar-Db5l8MQ4.js → bundle-avatar-DYTLzqlT.js} +1 -1
- package/dist/assets/button-D8hoY4xw.js +1 -0
- package/dist/assets/click-to-copy-CFiGx48J.js +1 -0
- package/dist/assets/{collapse-Bn_BDlF9.js → collapse-QV_2gdtM.js} +1 -1
- package/dist/assets/{complete-BRApuFsV.js → complete-6R-n_Ra9.js} +2 -2
- package/dist/assets/{component-C7g4FGFm.js → component-Blsql2u0.js} +2 -2
- package/dist/assets/{config-C8AXD1JH.js → config-D6r2ZAFY.js} +2 -2
- package/dist/assets/{config-qG8JCIJ_.js → config-LE_EJolF.js} +1 -1
- package/dist/assets/{config-navigation-B7r4dV5S.js → config-navigation-B0nu0al4.js} +4 -4
- package/dist/assets/{config-space-CSKkMgqX.js → config-space-d34Deg7R.js} +1 -1
- package/dist/assets/{confirm-BvUfAlkx.js → confirm-DjTZImyg.js} +1 -1
- package/dist/assets/{connect-B2HOOYzS.js → connect-Cu2Ssv5A.js} +1 -1
- package/dist/assets/connect-K4ZmMu4L.js +5 -0
- package/dist/assets/{connect-to-BBtnljQ-.js → connect-to-BG15Vnyg.js} +1 -1
- package/dist/assets/{content-layout-DzqMXifY.js → content-layout-BzF-fNQz.js} +1 -1
- package/dist/assets/dashboard-BIOpvfj3.js +239 -0
- package/dist/assets/{delete-confirm-BBaXcAXg.js → delete-confirm-BzuBR6TW.js} +1 -1
- package/dist/assets/{did-address-BKBBjFqv.js → did-address-DjwPl1uy.js} +1 -1
- package/dist/assets/{domain-action-card-D-WETV-f.js → domain-action-card-Bcs_GWxq.js} +1 -1
- package/dist/assets/domain-wh85yL2O.js +9 -0
- package/dist/assets/domains-bzKFbARj.js +1 -0
- package/dist/assets/dot-C4hULxc0.js +7 -0
- package/dist/assets/{email-Bc5KLu5Q.js → email-BZVu6WP-.js} +1 -1
- package/dist/assets/{empty-spinner-BZlBh4vA.js → empty-spinner-n0_Ehns5.js} +1 -1
- package/dist/assets/{exchange-passport-DbNEDTaa.js → exchange-passport-8jdiPDph.js} +1 -1
- package/dist/assets/{fuel-DzWcrU-I.js → fuel-Dx_cnsCl.js} +1 -1
- package/dist/assets/{gen-access-key-D-ftFU9F.js → gen-access-key-CqKmmKML.js} +1 -1
- package/dist/assets/get-safe-url-B5RJTMjC.js +1 -0
- package/dist/assets/get-safe-url-Bk6PlU7n.js +1 -0
- package/dist/assets/{home-DXj5oFeO.js → home-DzCwBE8F.js} +1 -1
- package/dist/assets/{iframe-CIVgAJuH.js → iframe-DW7zzzTG.js} +1 -1
- package/dist/assets/{index-BemEiFHE.js → index-8CHxrfFP.js} +1 -1
- package/dist/assets/{index-CKheO_aT.js → index-B8r-LrrM.js} +1 -1
- package/dist/assets/{index-BMPpz8ni.js → index-B9nvthxv.js} +1 -1
- package/dist/assets/{index-BMD-pSqT.js → index-BDYaw77z.js} +1 -1
- package/dist/assets/{index-Ce2NSVmU.js → index-BIPRCLBG.js} +1 -1
- package/dist/assets/{index-DjLLC6N3.js → index-BYCeMwoO.js} +1 -1
- package/dist/assets/{index-D09AfnR1.js → index-Bju4sfVL.js} +1 -1
- package/dist/assets/{index-BVU8_1Ed.js → index-Btl_rz0J.js} +3 -3
- package/dist/assets/index-C-A13dEh.js +141 -0
- package/dist/assets/{index-g0L_1foA.js → index-C5SsKJ2n.js} +11 -11
- package/dist/assets/{index-CHDiquXf.js → index-CPfvVvHv.js} +11 -11
- package/dist/assets/{index-CUfP1M2j.js → index-Cc-e6lxg.js} +1 -1
- package/dist/assets/{index-wXCx8TFU.js → index-DcUhenm6.js} +1 -1
- package/dist/assets/{index-u-w3iMC9.js → index-DefO2n6z.js} +4 -4
- package/dist/assets/{index--HbH1n1_.js → index-DjEDWgGs.js} +1 -1
- package/dist/assets/{index-DF3gHUuW.js → index-Du38Vjy4.js} +4 -4
- package/dist/assets/{index-D64RNKdt.js → index-Dyl-XQ73.js} +6 -6
- package/dist/assets/{index-BmWVfEGP.js → index-HU4yqI-9.js} +1 -1
- package/dist/assets/index-Jnk92KZC.js +284 -0
- package/dist/assets/{index-Bxd86KLJ.js → index-SzdSxpkq.js} +4 -4
- package/dist/assets/index-USO5zFMh.js +55 -0
- package/dist/assets/{index-C0SLCehH.js → index-enM9Y412.js} +1 -1
- package/dist/assets/index-ioZVVJtg.js +113 -0
- package/dist/assets/{invitation-CKfllvl5.js → invitation-1bsb30Yz.js} +1 -1
- package/dist/assets/{invite-CCCSmPiy.js → invite-CALl83Zc.js} +1 -1
- package/dist/assets/{issue-passport-C3zUptls.js → issue-passport-BcStTsbv.js} +1 -1
- package/dist/assets/{item-CkcpHBHM.js → item-Bk_1JLeG.js} +1 -1
- package/dist/assets/{landing-page-q-KgqE9Q.js → landing-page-Due4o1uF.js} +1 -1
- package/dist/assets/{launch-result-message-BaU6oEsi.js → launch-result-message-DIYoykBK.js} +1 -1
- package/dist/assets/{layout-CyCulQBn.js → layout-D93HKT6w.js} +1 -1
- package/dist/assets/list-D96_O-GY.js +2 -0
- package/dist/assets/{list-header-CU9W30JD.js → list-header-HqBQs1yn.js} +1 -1
- package/dist/assets/list-rt6nku1-.js +236 -0
- package/dist/assets/localization-BUDtnbyU.js +1 -0
- package/dist/assets/{log-DNpJdgp3.js → log--AX8zo75.js} +1 -1
- package/dist/assets/{logger-CQ50TnpL.js → logger-BLZgTs_U.js} +1 -1
- package/dist/assets/{login-BKaJnfFX.js → login-WRcteY7r.js} +1 -1
- package/dist/assets/{login-oauth-callback-LJsgXC8E.js → login-oauth-callback-DZaPZfnA.js} +1 -1
- package/dist/assets/{logo-uploader-BYnd80uu.js → logo-uploader-CQCy6MG3.js} +3 -3
- package/dist/assets/{lost-passport-Bk0k4I4s.js → lost-passport-kJX7pEJj.js} +1 -1
- package/dist/assets/{open-window-DV0D-Mov.js → open-window--2G6Qjbq.js} +1 -1
- package/dist/assets/overview-CpKMiGEK.js +85 -0
- package/dist/assets/{page-header-CpNMTtn_.js → page-header-xyZktwBS.js} +1 -1
- package/dist/assets/{passport-item-BxfGrDcE.js → passport-item-CIvCqz_R.js} +1 -1
- package/dist/assets/{permission-BkNXA8B5.js → permission-BH1TY_tz.js} +1 -1
- package/dist/assets/{preferences-_jTjKHvU.js → preferences-CfmnTXfl.js} +1 -1
- package/dist/assets/{profile-embed-8w4_vg5a.js → profile-embed-ZtzRYgXv.js} +1 -1
- package/dist/assets/publish-resource-CCa5xfwz.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-Cq_dOQ2z.js → react-beautiful-dnd.esm-7PS2VwOi.js} +1 -1
- package/dist/assets/runtime-eXYlg9Cz.js +1 -0
- package/dist/assets/sdk-9eXJSWHG.js +1 -0
- package/dist/assets/section-Cv4udilp.js +41 -0
- package/dist/assets/{security-BQbSLSOe.js → security-DM8MeY05.js} +3 -3
- package/dist/assets/{session-6XaVDQaE.js → session-CHdTc1We.js} +1 -1
- package/dist/assets/setup-BEsU41BB.js +30 -0
- package/dist/assets/{shorten-label-Dq7bVuNa.js → shorten-label-Cng55547.js} +1 -1
- package/dist/assets/{simple-select-C-wGUGQR.js → simple-select-CP_Svi_D.js} +1 -1
- package/dist/assets/{slicedToArray-vWe02CJE.js → slicedToArray-C7EPqaHf.js} +1 -1
- package/dist/assets/{spaces-Cp7TgoZP.js → spaces-BVG-t3ND.js} +1 -1
- package/dist/assets/{start-CHmWCQE9.js → start-CIjuDAiX.js} +1 -1
- package/dist/assets/{starting-progress-CdpkXOrK.js → starting-progress-CiLZpNpg.js} +1 -1
- package/dist/assets/{status-46dMQnxA.js → status-CUMJd-nJ.js} +1 -1
- package/dist/assets/{step-actions-Bu3Q5M4V.js → step-actions-CeJCmiCS.js} +1 -1
- package/dist/assets/{studio-BbeHx14I.js → studio-DikseKRr.js} +1 -1
- package/dist/assets/{switch-control-D6CqAlDY.js → switch-control-C5i52ixk.js} +1 -1
- package/dist/assets/{traffic-CY9Vj6w7.js → traffic-B5x_6GvF.js} +2 -2
- package/dist/assets/{transfer-CSeo2FaW.js → transfer-CTEHVklh.js} +1 -1
- package/dist/assets/{unsubscribe-BLaMmgbM.js → unsubscribe-Bi2IV-2n.js} +1 -1
- package/dist/assets/{use-blocklet-logo-sEJnYyNL.js → use-blocklet-logo-BEy8Tnso.js} +2 -2
- package/dist/assets/{use-mobile-BAjFH6d8.js → use-mobile-Boa_xu9A.js} +1 -1
- package/dist/assets/{use-mobile-Bh8CHBbH.js → use-mobile-DyX6Fl8Z.js} +1 -1
- package/dist/assets/useAsync-C8ydfEEr.js +1 -0
- package/dist/assets/useAsync-CMWsznMW.js +1 -0
- package/dist/assets/{useLocalStorage-C6U1Aqya.js → useLocalStorage-DVnkpneF.js} +1 -1
- package/dist/assets/user-center-DcXdjtRX.js +76 -0
- package/dist/assets/{util-Bg0WSJ-t.js → util-CEAObyfj.js} +1 -1
- package/dist/assets/{util-RWes6RwK.js → util-MKllNgBs.js} +1 -1
- package/dist/assets/{vendor-arcblock-CN2B_oTr.js → vendor-arcblock-uz9DVywv.js} +45 -45
- package/dist/assets/{vendor-mui-core-UZpb7wT7.js → vendor-mui-core-D_bnq77o.js} +1 -1
- package/dist/assets/{vendor-mui-x-whuSO90H.js → vendor-mui-x-R-0SFz4c.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-TEE6cGq6.js → vendor-ux-did-connect-DHrruicZ.js} +136 -136
- package/dist/assets/{wrap-locale-DZ79GW_G.js → wrap-locale-B9TkXFQe.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/dist/share/shared-bridge.html +4 -4
- package/package.json +32 -32
- package/dist/assets/audit-logs-CtFZQHby.js +0 -35
- package/dist/assets/button-DotKXyjc.js +0 -1
- package/dist/assets/click-to-copy-BxhgzyYL.js +0 -1
- package/dist/assets/connect-DGPdKMcu.js +0 -5
- package/dist/assets/dashboard-C124DXmc.js +0 -279
- package/dist/assets/domain-DTrwCkop.js +0 -9
- package/dist/assets/domains-BxkmGeZE.js +0 -1
- package/dist/assets/dot-C05enzim.js +0 -7
- package/dist/assets/get-safe-url-2RcRY8gU.js +0 -1
- package/dist/assets/get-safe-url-CEvgWyL5.js +0 -1
- package/dist/assets/index-9ixwCOkw.js +0 -113
- package/dist/assets/index-B_fwtN9z.js +0 -55
- package/dist/assets/index-CyUXddLG.js +0 -284
- package/dist/assets/index-DsT9i24r.js +0 -141
- package/dist/assets/list-D1dIr8Je.js +0 -2
- package/dist/assets/list-TP-VNuzL.js +0 -236
- package/dist/assets/localization-BXLZxF1J.js +0 -1
- package/dist/assets/overview-UIMGVO1S.js +0 -85
- package/dist/assets/publish-resource-CcM3RwPR.js +0 -1
- package/dist/assets/relative-time-Cl7lOTkO.js +0 -1
- package/dist/assets/runtime-BVDdcpyT.js +0 -1
- package/dist/assets/sdk-7yPC_DtN.js +0 -1
- package/dist/assets/setup-CifjXQIf.js +0 -30
- package/dist/assets/useAsync-DV3NyLhI.js +0 -1
- package/dist/assets/user-center-BHyd-rRF.js +0 -76
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log--AX8zo75.js","assets/vendor-mui-core-D_bnq77o.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-DVnkpneF.js","assets/vendor-ux-did-connect-DHrruicZ.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-hooks-rDgu5KV9.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-DefO2n6z.js","assets/vendor-arcblock-uz9DVywv.js","assets/index-DOq-_YXu.css","assets/Download-C_LRKzbG.js","assets/bundle-avatar-DYTLzqlT.js","assets/log-D33dFtt_.css","assets/index-Jnk92KZC.js","assets/ViewList-D8vtMKQz.js","assets/index-BIPRCLBG.js","assets/Phone-DcHUzCa-.js","assets/Location-DUEOr9J2.js","assets/Email-DWueGk7t.js","assets/Timezone-B-Ho_Uno.js","assets/index-CPfvVvHv.js","assets/did-address-DjwPl1uy.js","assets/permission-BH1TY_tz.js","assets/session-CHdTc1We.js","assets/click-to-copy-CFiGx48J.js","assets/index-HU4yqI-9.js","assets/vendor-mui-x-R-0SFz4c.js","assets/AdapterDayjs-BD9H1lZ-.js","assets/format-error-BrmqJs5a.js","assets/useAsync-C8ydfEEr.js","assets/useAsync-CMWsznMW.js","assets/index-enM9Y412.js","assets/DeleteOutline-CFN4r-OG.js","assets/confirm-DjTZImyg.js","assets/util-CEAObyfj.js","assets/base32-_zEVBJUg.js","assets/sdk-9eXJSWHG.js","assets/actions-BjTeIzgS.js","assets/MoreHoriz-B6KdR0Y8.js","assets/shorten-label-Cng55547.js","assets/PlayArrow-BToG9L6q.js","assets/get-safe-url-Bk6PlU7n.js","assets/use-blocklet-logo-BEy8Tnso.js","assets/InfoOutlined-DkG0jjos.js","assets/dot-C4hULxc0.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-DyX6Fl8Z.js","assets/index-C-A13dEh.js","assets/ExpandLess-CkoEHpgk.js","assets/index-Du38Vjy4.js","assets/Error-jEHdDLNk.js","assets/empty-spinner-n0_Ehns5.js","assets/list-header-HqBQs1yn.js","assets/QuestionMarkCircle-BPVDAm8U.js","assets/index-DVQCgvFb.js","assets/index-BYCeMwoO.js","assets/api-BjteVZFg.js","assets/ChevronRight-a_2_x6Ew.js","assets/react-beautiful-dnd.esm-7PS2VwOi.js","assets/raf-schd.esm-B3j6BePR.js","assets/item-Bk_1JLeG.js","assets/Launch-B-2Jomi6.js","assets/Done-DqSE6KPe.js","assets/delete-confirm-BzuBR6TW.js","assets/ArrowDropDown-BrO-zDlb.js","assets/index-B8r-LrrM.js","assets/index-C0Iiqot3.css","assets/index-BDYaw77z.js","assets/overview-CpKMiGEK.js","assets/keyboard-arrow-down-rounded-DadBVmpO.js","assets/status-CUMJd-nJ.js","assets/omit-D2k92RIF.js","assets/spaces-BVG-t3ND.js","assets/domains-bzKFbARj.js","assets/domain-action-card-Bcs_GWxq.js","assets/util-MKllNgBs.js","assets/CheckCircle-Ds4QI0ey.js","assets/index-C5SsKJ2n.js","assets/passport-item-CIvCqz_R.js","assets/Google-DHEolkW-.js","assets/cloneDeep-UpFQ2VNg.js","assets/EditIcon-DxUWMw59.js","assets/LockIcon-Cjg8jV1E.js","assets/appearance-bRLsRDs2.js","assets/audit-logs-B3-Fo3nR.js","assets/index-ioZVVJtg.js","assets/collapse-QV_2gdtM.js","assets/section-Cv4udilp.js","assets/list-rt6nku1-.js","assets/traffic-B5x_6GvF.js","assets/iframe-DW7zzzTG.js","assets/LaunchOutlined-CXNijfqX.js","assets/ChevronLeft-CnQaQ-rc.js","assets/index-DcUhenm6.js","assets/use-mobile-Boa_xu9A.js","assets/config-navigation-B0nu0al4.js","assets/index-Bs1kxR8_.js","assets/slicedToArray-C7EPqaHf.js","assets/simple-select-CP_Svi_D.js","assets/index-DjEDWgGs.js","assets/connect-to-BG15Vnyg.js","assets/config-space-d34Deg7R.js","assets/index-ftkgQlGr.js","assets/switch-control-C5i52ixk.js","assets/index-USO5zFMh.js","assets/security-DM8MeY05.js","assets/config-LE_EJolF.js","assets/branding-By8KDk5Q.js","assets/logo-uploader-CQCy6MG3.js","assets/advanced-tG5IRVhQ.js","assets/runtime-eXYlg9Cz.js","assets/index-Dyl-XQ73.js","assets/Edit-CbR4eoK8.js","assets/list-D96_O-GY.js","assets/component-Blsql2u0.js","assets/TuneOutlined-BR2H7Mxj.js","assets/add-component-core-C7-Epxoj.js","assets/launch-result-message-DIYoykBK.js","assets/page-header-xyZktwBS.js","assets/index-Bju4sfVL.js","assets/content-layout-BzF-fNQz.js","assets/add-component-core-D-IRi6XF.css","assets/index-Cc-e6lxg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ie,u as An,p as os,h as Ge,f as $n,g as is,E as as,i as cs,H as ls,_ as R,R as us}from"./vendor-arcblock-uz9DVywv.js";import{H as x,j as o,a9 as B,ah as G,I as Ct,aq as ds,ak as Mn,X as _t,q as ps,b5 as fs,ab as ne,b6 as hs,bx as ms,T as z,bv as gs,bt as dn,bw as pn,aa as C,bJ as xs,v as Z,a6 as et,bK as vs,e as ee,ae as ys,bf as bs,ap as It,bL as On,ad as Ce,bM as ws,ar as js,ai as Ss,bN as Nn,bO as zn,bP as Un,E as ae,b4 as Bn,y as Cs,bh as _s}from"./vendor-mui-core-D_bnq77o.js";import{r as g,L as Hn,f as Vn,u as Is,l as ks}from"./vendor-react-DEoibe3W.js";import{r as H,b4 as Ts,b2 as kt,b5 as Es,B as Tt,j as $,a3 as fn,_ as Q,u as J,ao as Ps,m as Fn,k as Ls,d as Rs,h as Ds,aJ as As,Y as Et,b6 as $s,b7 as Ms,I as Os,C as Ke,b8 as Ns,b9 as zs,as as Us,a0 as Bs}from"./vendor-ux-did-connect-DHrruicZ.js";import{z as tt,f as N,A as it,B as Hs,b as Vs,C as Fs,D as qs,E as qn,t as he,F as Wn,G as Ws,n as ve,H as Gs,I as Ks,u as Qs,j as hn,g as Zs,J as mn,h as Xs,l as at,k as Js,m as Ys,K as eo,O as to,L as Be,e as Me,M as no,Q as ro,R as so,N as oo,T as io,c as gn}from"./index-DefO2n6z.js";import{af as ao,A as me,ag as co,z as Gn,b as He,ah as lo}from"./vendor-utils-rHXShPKm.js";import{_ as xn}from"./useLocalStorage-DVnkpneF.js";import{C as vn}from"./confirm-DjTZImyg.js";import{d as uo}from"./PlayArrow-BToG9L6q.js";import{g as yn}from"./get-safe-url-Bk6PlU7n.js";import{f as Pt}from"./format-error-BrmqJs5a.js";import{u as Kn}from"./session-CHdTc1We.js";import{f as ge,w as po}from"./vendor-hooks-rDgu5KV9.js";import{i as fo,u as ho,M as mo,c as _e,s as Qe,H as go,p as Qn,a as xo}from"./use-blocklet-logo-BEy8Tnso.js";import{d as vo}from"./InfoOutlined-DkG0jjos.js";import{_ as Zn,D as yo}from"./dot-C4hULxc0.js";import{_ as Xn}from"./useSetState-CWq0AVWn.js";import{u as bo}from"./use-mobile-DyX6Fl8Z.js";const Jn=g.createContext({});function Lt({children:e,type:t}){const[n,r]=g.useState([]),s=g.useRef([]),i=l=>{if(!s.current.includes(l)){const u=[...s.current,l];r(u),s.current=u}},a=l=>{if(s.current.includes(l)){const u=s.current.filter(d=>d!==l);r(u),s.current=u}},c=l=>{const u=n.filter(f=>l.find(p=>p===f));ao(u,n).forEach(f=>a(f))};return o.jsx(Jn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:i,removeDeletingDid:a,matchDeletingDid:c},children:e})}Lt.propTypes={type:x.string,children:x.node.isRequired};Lt.defaultProps={type:"blocklets"};function cl(){return g.useContext(Jn)}var Rt={},wo=B;Object.defineProperty(Rt,"__esModule",{value:!0});var Yn=Rt.default=void 0,jo=wo(H()),So=o;Yn=Rt.default=(0,jo.default)((0,So.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Dt={},Co=B;Object.defineProperty(Dt,"__esModule",{value:!0});var er=Dt.default=void 0,_o=Co(H()),Io=o;er=Dt.default=(0,_o.default)((0,Io.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var At={},ko=B;Object.defineProperty(At,"__esModule",{value:!0});var tr=At.default=void 0,To=ko(H()),Eo=o;tr=At.default=(0,To.default)((0,Eo.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var $t={},Po=B;Object.defineProperty($t,"__esModule",{value:!0});var nr=$t.default=void 0,Lo=Po(H()),Ro=o;nr=$t.default=(0,Lo.default)((0,Ro.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Mt={},Do=B;Object.defineProperty(Mt,"__esModule",{value:!0});var rr=Mt.default=void 0,Ao=Do(H()),$o=o;rr=Mt.default=(0,Ao.default)((0,$o.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var Ot={},Mo=B;Object.defineProperty(Ot,"__esModule",{value:!0});var sr=Ot.default=void 0,Oo=Mo(H()),No=o;sr=Ot.default=(0,Oo.default)((0,No.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var Nt={},zo=B;Object.defineProperty(Nt,"__esModule",{value:!0});var or=Nt.default=void 0,Uo=zo(H()),Bo=o;or=Nt.default=(0,Uo.default)((0,Bo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var zt=function(e){return o.jsx("svg",{...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};zt.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};zt.displayName="dashboard";var Ut={},Ho=B;Object.defineProperty(Ut,"__esModule",{value:!0});var ir=Ut.default=void 0,Vo=Ho(H()),Fo=o;ir=Ut.default=(0,Vo.default)((0,Fo.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const fe={Start:uo,Stop:Yn,Restart:er,Reload:tr,Remove:Ts,Config:nr,Log:rr,Group:sr,Cancel:or,Dashboard:zt,Overview:ir},qo=(e,t)=>{if(!e)return"";const n=new URL(e),r=new URLSearchParams(n.searchParams),s=new URL(me(n.origin,t));return s.search=r.toString(),s.toString()},Wo="internal",Go="external";function Bt({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:s,getComponentUrl:i,useBlockletUrlEvaluation:a,...c}){const l=tt(),[u,d]=g.useState(null),[f,p]=g.useState(null),[w,y]=g.useState(!1),[m,_]=g.useState(null),{t:h}=g.useContext(kt),[j]=xn("skip-blocklet-setup",!1),{loading:v,recommendedUrl:D}=a(e),[M]=xn("blocklet-type-filter",Wo),S=N.isInProgress(e.status),[T,I]=g.useState(!1);g.useEffect(()=>{var A,U;if(!(e!=null&&e.controller))return;I(((U=(A=e==null?void 0:e.controller)==null?void 0:A.status)==null?void 0:U.value)===ie.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var F,Y,se;try{const q=await l.api.getLauncherSession({input:{launcherSessionId:(F=e==null?void 0:e.controller)==null?void 0:F.launcherSessionId,launcherUrl:(Y=e==null?void 0:e.controller)==null?void 0:Y.launcherUrl}});if(q!=null&&q.error){console.error("get launcher session failed",q.error);return}I([$.LAUNCH_SESSION_STATUS.overdue,$.LAUNCH_SESSION_STATUS.canceled,$.LAUNCH_SESSION_STATUS.terminated].includes((se=q==null?void 0:q.launcherSession)==null?void 0:se.status))}catch(q){console.error("call getLauncherSession error",q)}})()},[]);const{inService:E}=l,k=(b,A,U=!1)=>async()=>{const F=async De=>{var $e;t({action:b,blocklet:e}),y(!0),p(b);let Ae=!1;try{if(b==="remove")await A(De);else if(b==="start"){if(!N.hasRunnableComponent(e)){Q.error(h("blocklet.noComponent"));return}if(!E&&!j&&!(($e=e.settings)!=null&&$e.initialized)&&e.mode!==ie.BLOCKLET_MODES.DEVELOPMENT){if(!D||!fn(D)){Q.error(h("blocklet.gotoVisitError"));return}const K=Hs(l.info),un=new URL(D);un.searchParams.set("serverUrl",K),window.open(yn(un.href,{allowDomains:null})),n({action:b,blocklet:e});return}const oe=e.children.filter(K=>!N.isInProgress(K.status)&&K.status!=="running").map(K=>K.meta.did),pe={did:e.meta.did,componentDids:oe};await A({input:pe})}else if(["stop","restart","reload"].includes(b)){const oe=e.children.filter(K=>K.status==="running").map(K=>K.meta.did),pe={did:e.meta.did,componentDids:oe};await A({input:pe})}else{const oe={did:e.meta.did};await A({input:oe})}b==="remove"?Ae=!0:await Vs(1e3),b==="reload"&&Q.success(h("blocklet.reloadSuccess")),_(null),n({action:b,blocklet:e})}catch(oe){const pe=`Blocklet ${b} failed: ${Pt(oe)}`;throw n({action:b,blocklet:e,error:new Error(pe)}),new Error(pe)}finally{Ae||y(!1)}},Y=()=>{y(!1),_(null)},se=N.getDisplayName(e,!0),q=e.mode===ie.BLOCKLET_MODES.DEVELOPMENT?{description:()=>o.jsx(z,{component:"div",children:o.jsx(z,{gutterBottom:!0,children:h("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(De,Ae)=>o.jsxs(z,{component:"div",children:[o.jsx(z,{gutterBottom:!0,children:h("blocklet.action.removeApplicationDescription")}),o.jsxs(gs,{name:"removeType",value:De.removeType,onChange:$e=>Ae({...De,removeType:$e.target.value}),children:[o.jsx(dn,{value:"backup",control:o.jsx(pn,{}),label:h("blocklet.action.removeApplicationAfterBackup")}),o.jsx(dn,{value:"complete",control:o.jsx(pn,{}),label:h("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},ss={stop:{title:`${h("common.stop")} ${se}`,description:h("blocklet.action.stopDescription"),confirm:h("blocklet.action.confirmStop"),cancel:h("common.cancel"),onConfirm:F,onCancel:Y},restart:{title:`${h("common.restart")} ${se}`,description:h("blocklet.action.restartDescription"),confirm:h("blocklet.action.confirmRestart"),cancel:h("common.cancel"),onConfirm:F,onCancel:Y},remove:{title:`${h("common.remove")} ${se}`,confirm:h("blocklet.action.confirmRemove"),cancel:h("common.cancel"),onConfirm:F,onCancel:Y,...q},cancelDownload:{title:`${h("common.cancel")}`,description:h("blocklet.action.cancelDownloadDescription",{name:se}),confirm:h("common.confirm"),cancel:h("common.cancel"),onConfirm:F,onCancel:Y}};U?_(ss[b]):await F()},P=!!u,de=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(b.currentTarget)},V=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(null)},Le=async(b,A)=>{try{A.stopPropagation(),A.preventDefault()}catch{}if(typeof b.handler=="function")try{y(!0),p(b.action),await b.handler()}catch(U){console.error(`Blocklet ${b.name} failed: `,U)}finally{y(!1),d(null)}else d(null)},es=!E&&N.isDeletableBlocklet(e)?{action:"remove",icon:fe.Remove,name:h("common.remove"),handler:k("remove",async({removeType:b})=>{b==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:S}:null,ts={action:"remove",icon:({sx:b,...A})=>o.jsx(fe.Cancel,{sx:{...b,paddingRight:"2px",zoom:.95},...A}),name:h("common.cancel"),handler:k("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ns=N.getAppMissingConfigs(e),rs=()=>{var F;const b=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),A=i==null?void 0:i({mountPoint:b,blocklet:e});if(!A||!fn(A)){Q.error(h("blocklet.gotoVisitError"));return}const U=(F=e==null?void 0:e.site)==null?void 0:F.domainAliases;window.open(yn(qo(A,".well-known/service/admin"),{allowDomains:U==null?void 0:U.map(Y=>Y.value)}))};let Re=[{action:"start",icon:fe.Start,inExternal:!0,name:h("common.start"),handler:k("start",l.api.startBlocklet),disabled:T||e.children.every(b=>b.status==="running")||it(e.status)||v||S},{action:"stop",icon:fe.Stop,inExternal:!0,name:h("common.stop"),handler:k("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:fe.Restart,name:h("common.restart"),handler:k("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},it(e.status)?ts:es,{separator:!0},E?null:{action:"dashboard",icon:({style:b,...A})=>o.jsx(fe.Dashboard,{...A,style:{...b,width:"26px",height:"26px",paddingRight:"3px"}}),name:h("sidebar.dashboard"),handler:rs}].filter(Boolean);return M===Go&&(Re=Re.filter(b=>b.inExternal)),r==="menu"?o.jsxs(bn,{"data-cy":"blocklet-actions",children:[o.jsx(Ct,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:de,size:"small",disabled:!s||!it(e.status)&&w,children:o.jsx(Es,{})}),o.jsxs(ds,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:P,onClose:V,PaperProps:{},children:[ns.length>0&&o.jsxs(Mn,{style:{maxWidth:"400px"},severity:"error",children:[h("blocklet.config.missingRequired"),o.jsx("br",{}),o.jsx(Hn,{to:`/blocklets/${e.meta.did}/components`,children:h("blocklet.config.gotoFix")})]}),Re.map((b,A)=>b.separator?o.jsx(_t,{},`separator-${A}`):o.jsxs(ps,{dense:!0,onClick:U=>Le(b,U),disabled:w||b.disabled,"data-cy":`${b.action}-blocklet`,children:[o.jsx(fs,{style:{minWidth:24},children:f===b.action&&w?o.jsx(ne,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{fontSize:"small"})}),o.jsx(hs,{primary:b.name})]},b.name))]}),m&&o.jsx(vn,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]}):o.jsxs(bn,{"data-cy":"blocklet-actions",...c,children:[o.jsx(ms,{children:Re.filter(b=>!b.separator&&!b.onlyInMenu).map(b=>o.jsxs(Tt,{title:b.name,"data-cy":`${b.action}-blocklet`,onClick:()=>Le(b),disabled:!!b.disabled||w,children:[f===b.action&&w?o.jsx(ne,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{}),o.jsx("span",{className:"blocklet-action-text",children:b.name})]},b.name))}),m&&o.jsx(vn,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}Bt.propTypes={getComponentUrl:x.func,blocklet:x.object.isRequired,onStart:x.func.isRequired,onComplete:x.func.isRequired,variant:x.oneOf(["menu","group"]),hasPermission:x.bool,useBlockletUrlEvaluation:x.func};Bt.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const bn=G.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
|
|
6
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
7
|
+
.MuiButton-root {
|
|
8
|
+
padding: 4px;
|
|
9
|
+
font-size: 10px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`,wn=g.memo(Bt),Ko=e=>{const t={};let n=null;return N.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=N.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},Qo=(e,t,n)=>{var i;const{hostname:r,href:s}=e;if(!t)return s;if(n){const c=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!c)return s;const l=c[0],d=((((i=t.site)==null?void 0:i.domainAliases)||[]).map(f=>f.value).filter(Boolean).find(f=>f.endsWith($.DEFAULT_DID_DOMAIN))||"").replace(`.${$.DEFAULT_DID_DOMAIN}`,"");return d?s.replace(r,`${d}-${l}.${$.DEFAULT_IP_DOMAIN_SUFFIX}`):s}return s.replace(t.meta.bundleDid,t.appPid)};function ar(){const{t:e}=J(),{api:t}=Kn(),{blocklet:n}=Fs(),{inService:r}=tt(),[s,i]=g.useState(!1),[a,c]=g.useState(5),l=n&&n.structVersion!==$.APP_STRUCT_VERSION,u=()=>{try{if(n.status==="running"){Q.error(e("blocklet.migrate.tip.running"));return}const p=Ko(n);if(p){Q.error(e("blocklet.migrate.tip.duplicate",{name:p}));return}i(!0)}catch(p){Q.error(Pt(p))}},d=()=>{const p=Qo(window.location,n,r);setTimeout(()=>{window.location.href=p},5e3),c(5),setInterval(()=>{c(w=>w-1)},1e3)},f=()=>i(!1);return[l&&o.jsxs(Mn,{severity:"warning",style:{margin:"12px 0"},children:[o.jsxs(C,{display:"flex",alignItems:"center",children:[o.jsx(Tt,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),o.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(p=>o.jsx(C,{display:"flex",alignItems:"center",children:e(`blocklet.migrate.intro.${p}`)},p))]},"alert"),n&&o.jsx(Ps,{popup:!0,open:s,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:qs(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:f},"connect")]}ar.propTypes={};function Zo(){const e=xs();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const s=Z(e.breakpoints.up(r));return!n&&s?r:n},null)||"xs"}function Xo(e){return o.jsx(et,{...e,children:o.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 Jo(e){return o.jsx(et,{...e,children:o.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function Yo(e){return o.jsx(et,{...e,children:o.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 ei(e){return o.jsx(et,{...e,children:o.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 Oe={fontSize:20,marginInlineEnd:8},ti={success:o.jsx(Xo,{style:Oe}),warning:o.jsx(Jo,{style:Oe}),error:o.jsx(Yo,{style:Oe}),info:o.jsx(ei,{style:Oe})},ni=vs(e=>{const t={xl:"400px",lg:"400px",md:"400px",sm:"300px"},n=e.palette.background.default;return{lessPadding:{paddingLeft:8*2.5},contentRoot:{...e.typography.body2,display:"flex",backgroundColor:n,color:"#fff",alignItems:"center",padding:"6px 16px",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)"},success:r=>({backgroundColor:`${ys[600]} !important`,width:t[r.breakpoint]}),error:r=>({backgroundColor:`${e.palette.error.dark} !important`,width:t[r.breakpoint]}),info:r=>({backgroundColor:`${e.palette.primary.main} !important`,width:t[r.breakpoint]}),warning:r=>({backgroundColor:`${bs[700]} !important`,width:t[r.breakpoint]}),icon:{fontSize:20},message:{display:"flex",alignItems:"center",padding:"8px 0",flex:1,width:0},action:{display:"flex",alignItems:"center",marginLeft:"auto",marginRight:-8,width:44}}});function Ht({keyId:e,notification:t={},viewAllUrl:n,content:r},s){var _,h,j;const i=ni({breakpoint:Zo()}),a=ee(),c=[i.contentRoot,i.lessPadding,i[t.severity]].join(" "),l=ti[t.severity],{closeSnackbar:u}=Fn(),d=()=>u(e),f=Vn(),p=()=>{u(e),f(n)},w=ge(()=>fo(t),[t]),y=ge(()=>t==null?void 0:t.activity,[t]),m=ho({activity:y,users:[t==null?void 0:t.actorInfo],actors:[(_=t==null?void 0:t.activity)==null?void 0:_.actor],extra:{linkColor:a.palette.primary.main,userDid:(j=(h=t==null?void 0:t.receivers)==null?void 0:h[0])==null?void 0:j.did}});return o.jsxs(Ls,{ref:s,className:c,children:[o.jsxs("div",{className:i.message,children:[l,o.jsx(si,{onClick:p,style:{width:"calc(100% - 30px)"},children:o.jsx(C,{children:w?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"title",children:m}),y.meta?o.jsx(mo,{meta:y.meta,type:y.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"title",children:t.title}),r||o.jsx("span",{className:"desc",children:t.description})]})})})]}),o.jsx("div",{className:i.action,children:o.jsx(Ct,{"aria-label":"close",color:"inherit",onClick:d,size:"large",children:o.jsx(Rs,{className:i.icon})},"close")})]})}const ri=g.forwardRef(Ht);Ht.propTypes={viewAllUrl:x.string.isRequired,keyId:x.number.isRequired,notification:x.object.isRequired,content:x.node};Ht.defaultProps={content:null};const si=G.div`
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
.title {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
display: -webkit-box;
|
|
20
|
+
-webkit-line-clamp: 1;
|
|
21
|
+
-webkit-box-orient: vertical;
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
}
|
|
24
|
+
.desc {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
display: -webkit-box;
|
|
28
|
+
-webkit-line-clamp: 3;
|
|
29
|
+
-webkit-box-orient: vertical;
|
|
30
|
+
word-break: break-word;
|
|
31
|
+
}
|
|
32
|
+
`;function cr({attachment:e}){const{data:t}=e,n=ee();let r="";try{r=new URL(t.url).host}catch{r=t.url}return o.jsxs(It,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:s=>{s.customPreventRedirect=!0},children:[!!r&&o.jsx("span",{className:"url",children:r}),!!t.title&&o.jsx(C,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&o.jsx(C,{className:"description",style:{whiteSpace:"unset",color:n.palette.text.secondary},children:t.description}),!!t.image&&o.jsx("img",{src:An.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}cr.propTypes={attachment:x.object.isRequired};function lr({attachment:e}){const{data:t}=e;return o.jsx("img",{src:An.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}lr.propTypes={attachment:x.object.isRequired};function ur({attachment:e,...t}){var c;const{data:n}=e,r=((c=n.color)==null?void 0:c.toLowerCase())||t.color,s=n.size||t.size,i=n.fontWeight||t.fontWeight||400;let a="14px";return s==="small"?a="12px":s==="normal"?a="14px":s==="big"?a="16px":s==="large"&&(a="18px"),o.jsx(oi,{className:"title",style:{fontSize:a,color:r,whiteSpace:"unset",fontWeight:i},children:n.text})}ur.propTypes={attachment:x.object.isRequired};const oi=G.span`
|
|
33
|
+
width: 100%;
|
|
34
|
+
display: -webkit-box;
|
|
35
|
+
-webkit-box-orient: vertical;
|
|
36
|
+
-webkit-line-clamp: 2;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
white-space: normal;
|
|
40
|
+
word-break: break-word;
|
|
41
|
+
`,ii=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},ai=e=>e.every(t=>t.type==="text"),ci=e=>e.every(t=>t.type==="image"),li=e=>co(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(n=>{var r,s,i;return(i=(s=(r=n==null?void 0:n.data)==null?void 0:r.text)==null?void 0:s.trim)==null?void 0:i.call(s)})),ui=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(n=>n.type===t)},di=(e,t)=>{try{const n=Ds.toTypeInfo(e);if(!(n.role!==void 0&&n.role!==As.types.RoleType.ACCOUNT))return;const s=me($.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return Gn(s,{did:e,locale:t})}catch(n){console.error(n);return}},le=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}});Vt.propTypes={locale:x.string,data:x.object.isRequired};Vt.defaultProps={locale:"en"};function Vt({locale:e="en",data:t}){const n={zh:"来自",en:"from"}[e]||"from",r={zh:"接收",en:"Received"}[e]||"Received",i=`https://${_e.getUrlHost(t.chainHost)||_e.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`,a=ee(),c=a.palette.mode==="dark";let l=t.amount;t.decimal&&(l=t.amount/10**t.decimal);const u=ge(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return o.jsx("a",{href:i,target:"_blank",rel:"noreferrer",onClick:d=>{d.customPreventRedirect=!0},children:o.jsxs(C,{display:"flex",flexDirection:"column",children:[o.jsxs(C,{sx:u,children:[o.jsx(z,{component:"div",sx:{fontWeight:700,color:a.palette.text.primary},children:r}),o.jsxs(z,{component:"div",align:"right",style:le(Qe.summaryStyle,c),flex:1,children:["+",l," ",t.symbol]})]}),o.jsxs(C,{sx:u,children:[o.jsx(z,{component:"div",style:le({...Qe.remarkStyle,fontSize:14},c),children:n}),o.jsx(C,{maxWidth:260,fontSize:14,children:o.jsx(Et,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}Ft.propTypes={locale:x.string,data:x.object.isRequired};Ft.defaultProps={locale:"en"};function Ft({locale:e,data:t}){var d,f;const n={zh:"接收",en:"Received"}[e]||"Received",r={zh:"来自",en:"from"}[e]||"from",s=_e.getUrlHost(t.chainHost)||_e.getChainHost(t.chainId),i=t.did||((f=(d=t==null?void 0:t.credential)==null?void 0:d.issuer)==null?void 0:f.id)||"",a=`https://${s}/explorer/assets/${i}`,l=ee().palette.mode==="dark",u=ge(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return o.jsx(C,{sx:{pr:1},children:o.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},onClick:p=>{p.customPreventRedirect=!0},rel:"noreferrer",children:o.jsxs(C,{display:"flex",flexDirection:"column",children:[o.jsxs(C,{sx:u,children:[o.jsx(z,{component:"div",sx:{fontWeight:700,color:"text.primary"},children:n}),o.jsx(z,{component:"div",align:"right",style:le(Qe.summaryStyle,l),children:"+1 Asset"})]}),i?o.jsxs(C,{sx:u,children:[o.jsx(z,{component:"div",style:le({...Qe.remarkStyle,fontSize:14},l),children:r}),o.jsx(C,{maxWidth:260,fontSize:14,children:o.jsx(Et,{did:i,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}dr.propTypes={data:x.object.isRequired,locale:x.string};function dr({data:e,locale:t="en"}){const r=ee().palette.mode==="dark";return o.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},onClick:s=>{s.customPreventRedirect=!0},rel:"noreferrer",children:[o.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),o.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[o.jsx("div",{style:le({marginBottom:"6px"},r),children:e.title}),o.jsx(C,{maxWidth:260,fontSize:10,children:o.jsx(Et,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}qt.propTypes={locale:x.string,data:x.object.isRequired};qt.defaultProps={locale:"en"};function qt({locale:e,data:t}){const n=_e.getChainHost(t.chainId),r=`https://${n}/explorer/txs/${t.hash}`,s={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",i={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash",a=ee(),c=a.palette.mode==="dark";return o.jsxs("a",{href:r,target:"_blank",style:le({textDecoration:"none",color:"initial",display:"block",fontSize:14},c),onClick:l=>{l.customPreventRedirect=!0},rel:"noreferrer",children:[o.jsx("h6",{style:{color:a.palette.text.secondary,margin:0},children:n}),o.jsx("p",{style:{color:a.palette.warning.main,margin:0},children:s}),o.jsxs("div",{style:{wordBreak:"break-all"},children:[i,": ",t.hash]})]})}function pr({attachment:e,...t}){const{local:n}=g.useContext(kt),r=Z(i=>i.breakpoints.down("md")),s=ee();return o.jsxs(pi,{...t,isMd:r,children:[e.type==="link"&&o.jsx(cr,{attachment:e,...t,isMd:r}),e.type==="image"&&o.jsx(lr,{attachment:e,isMd:r}),e.type==="text"&&o.jsx(ur,{attachment:e,isMd:r}),e.type==="token"&&o.jsx(Vt,{data:e.data,local:n,isMd:r}),e.type==="asset"||e.type==="vc"?o.jsx(Ft,{data:e.data,local:n,isMd:r}):null,e.type==="dapp"&&o.jsx(dr,{data:e.data,local:n,isMd:r}),e.type==="transaction"&&o.jsx(qt,{data:e.data,local:n,...t,isMd:r}),e.type==="divider"&&o.jsx(_t,{sx:{mb:1,mt:1},style:{color:s.palette.divider}})]})}const pi=G.div`
|
|
42
|
+
display: ${({sx:e={}})=>e.display||"flex"};
|
|
43
|
+
flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
|
|
44
|
+
gap: ${({sx:e={}})=>e.gap||1};
|
|
45
|
+
width: ${({isMd:e=!1})=>e?"100%":"auto"};
|
|
46
|
+
&:last-child {
|
|
47
|
+
margin-bottom: 0;
|
|
48
|
+
}
|
|
49
|
+
`;pr.propTypes={attachment:x.object.isRequired};function fr({data:e,...t}){const{items:n}=e;return o.jsx(fi,{...t,children:n.map(r=>o.jsxs(On,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[o.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[r.icon?o.jsx("img",{src:r.icon,alt:r.title,style:{width:16,height:16}}):null,o.jsxs(C,{className:"metric-name",display:"flex",alignItems:"center",children:[r.title,r.subtitle?o.jsx(Ce,{title:r.subtitle,arrow:!0,placement:"top",children:o.jsx(vo,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),o.jsxs(C,{className:"metric-number",sx:{color:r.content_color||"rgba(3, 7, 18, 1)"},children:[r.content,r.sub_content?o.jsxs("span",{className:"sub-content",style:{color:r.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",r.sub_content,")"]}):null]})]},r.title))})}const fi=G(C)`
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: flex-start;
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
gap: 16px;
|
|
54
|
+
.metric-number {
|
|
55
|
+
font-size: 18px;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
.sub-content {
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
margin-left: 4px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
.metric-name {
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
color: rgba(156, 163, 175, 1);
|
|
66
|
+
}
|
|
67
|
+
`;fr.propTypes={data:x.object.isRequired};function hr({data:e}){const{items:t}=e,n=Z(a=>a.breakpoints.down("sm")),r=Z(a=>a.breakpoints.down("md")),s=Z(a=>a.breakpoints.down("lg")),i=()=>n?1:r?3:s?4:6;return o.jsx(ws,{variant:"quilted",cols:i(),gap:8,rowHeight:128,sx:{margin:0},children:t.map(a=>{const c=a.cover||a.display;return c?o.jsx("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:o.jsx(js,{children:o.jsx("img",{src:c,alt:a.title||"",style:{borderRadius:"8px"}})})},c):null})})}hr.propTypes={data:x.object.isRequired};function Wt({data:e,feedType:t,...n}){return o.jsxs(hi,{...n,children:[t==="data-tracker"&&e.type==="table"&&o.jsx(fr,{data:e}),(t==="graphic"||t==="gallery")&&o.jsx(hr,{data:e})]})}const hi=G.div`
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
width: 100%;
|
|
71
|
+
margin-bottom: 4px;
|
|
72
|
+
&:last-child {
|
|
73
|
+
margin-bottom: 0;
|
|
74
|
+
}
|
|
75
|
+
`;Wt.propTypes={data:x.object.isRequired,feedType:x.string};Wt.defaultProps={feedType:"data-tracker"};Ve.propTypes={data:x.object.isRequired,style:x.object};function Ve({data:e,style:t={}}){const r=ee().palette.mode==="dark";return o.jsx(z,{style:le({color:r&&e.darkModeColor?e.darkModeColor:e.color||"initial",margin:0,whiteSpace:"pre-line!important",...t},r),children:e.text})}function mr({data:e}){const t=[];for(let n=0;n<(e==null?void 0:e.length);n+=2){const r=e[n],s=e[n+1];r&&s?t.push(o.jsxs(jn,{children:[o.jsx("td",{className:"label-col",children:o.jsx(Ve,{data:r.data,style:{whiteSpace:"nowrap"}})}),o.jsx("td",{className:"value-col",children:o.jsx(Ve,{data:s.data,style:{wordBreak:"break-all"}})})]},n)):r&&t.push(o.jsx(jn,{children:o.jsx("td",{className:"label-col",children:o.jsx(Ve,{data:r.data})})},n))}return o.jsx("table",{style:{width:"100%"},children:o.jsx("tbody",{children:t})})}mr.propTypes={data:x.array.isRequired};const jn=G.tr`
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
justify-content: flex-start;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: ${({theme:e})=>e.spacing(1)};
|
|
81
|
+
.label-col {
|
|
82
|
+
min-width: 130px;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
.value-col {
|
|
86
|
+
flex: 1;
|
|
87
|
+
}
|
|
88
|
+
`;function Gt({notification:e,severity:t,showSke:n=!0}){const{attachments:r,data:s,...i}=e,a=Z(d=>d.breakpoints.down("md"));if((!r||!r.length)&&He(s))return null;const c=ii(t),l=(d,f=!1)=>{if(!d&&!Array.isArray(d))return null;let p=d,w={},y="horizontal";f&&ai(d)&&(p=li(d),y="vertical",w={display:"flex",gap:8,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%",width:a||p.length===1?"100%":"28%"});const m=ui(p);return o.jsx(C,{sx:{width:"100%",display:"flex",gap:1,flexDirection:f?"row":"column",justifyContent:"flex-start",alignItems:f?"center":"unset",flexWrap:"wrap"},children:p.map((_,h)=>_.type==="section"?o.jsx(mr,{data:_.fields},h):o.jsxs(g.Fragment,{children:[o.jsx(pr,{attachment:_,style:w,...i}),!(a&&y==="vertical")&&m&&p.length>1&&h!==p.length-1?o.jsx(_t,{orientation:y,style:{color:$s.dividerColor},sx:y==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},h))})},u=ci(r);return o.jsx(mi,{children:o.jsxs("div",{className:"message-in-list",children:[r.length>0&&o.jsx("div",{className:"message-container",style:a?{width:"100%"}:{},children:u?l(r):o.jsx(On,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128,borderColor:c},children:l(r)})}),!He(s)&&o.jsx("div",{className:"message-container",children:o.jsx("div",{className:"data-container",children:o.jsx(Wt,{data:s,feedType:e.feedType})})}),r.length===0&&He(s)&&n&&o.jsx(Ss,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const mi=G.div`
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
.message-in-list {
|
|
92
|
+
padding: 8px 8px 8px 0;
|
|
93
|
+
display: flex;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
}
|
|
96
|
+
.message-title {
|
|
97
|
+
color: #25292f;
|
|
98
|
+
font-size: 18px;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
word-break: break-all;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.attach-ske {
|
|
104
|
+
position: relative;
|
|
105
|
+
margin-left: 10px;
|
|
106
|
+
&::after {
|
|
107
|
+
content: '';
|
|
108
|
+
position: absolute;
|
|
109
|
+
left: -10px;
|
|
110
|
+
top: 0;
|
|
111
|
+
height: 100%;
|
|
112
|
+
width: 4px;
|
|
113
|
+
background-color: ${e=>e.leftLineColor};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.message-body {
|
|
118
|
+
color: #25292f;
|
|
119
|
+
font-size: 16px;
|
|
120
|
+
word-break: break-all;
|
|
121
|
+
white-space: pre-line;
|
|
122
|
+
}
|
|
123
|
+
.message-container {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
justify-content: flex-start;
|
|
127
|
+
.data-container,
|
|
128
|
+
.attachment-container {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
.actions-container {
|
|
135
|
+
margin-top: 10px;
|
|
136
|
+
.actions-item {
|
|
137
|
+
margin-right: 8px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
`;Gt.propTypes={severity:x.string.isRequired,notification:x.object.isRequired,showSke:x.bool};Gt.defaultProps={showSke:!0};const ct=e=>os.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),gi=async(e,t)=>{const{type:n,did:r}=e;return $n.isSameAddr(n,"did")?await di(r,t)||Ge.getLink(e):Ge.getLink(e)},xi=async(e,t,n=!0)=>{const r=Ge.toTextList(e);return await Promise.all(r.map(async i=>{if(i instanceof Ge.Link){if(n){const a=await gi(i,t),{type:c,chainId:l,did:u}=i;return $n.isSameAddr(c,"dapp")?`<em style="font-weight:bold;" data-type="${c}" data-chain-id="${l}" data-did="${u}">${i.text}</em>`:a?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${a}">${i.text}</a>`:`<em style="font-weight:bold;" data-type="${c}" data-chain-id="${l}" data-did="${u}">${i.text}</em>`}return i.text}return i})).then(i=>i.join(""))};gr.propTypes={notification:x.object,rows:x.number,minimal:x.bool};function gr({notification:e,rows:t=2,minimal:n=!1}){const[r,s]=g.useState(!1),[i,a]=g.useState(""),{t:c,locale:l}=J(),{palette:u}=ee(),d=g.useMemo(()=>{const{attachments:h}=e||{};if(!h)return!1;try{return h.length>0}catch{return!1}},[e]),f=g.useMemo(()=>{const{blocks:h}=e||{};if(!h)return!1;try{return h.length>0}catch{return!1}},[e]),p=g.useMemo(()=>{const{description:h}=e||{};return!!h},[e]),w=g.useMemo(()=>{const{data:h}=e||{};return!He(h)},[e]),y=g.useMemo(()=>d||f||p||w,[d,f,p,w]);if(g.useEffect(()=>{xi((e==null?void 0:e.description)??"",l).then(h=>{a(h)})},[e==null?void 0:e.description,l]),!y)return null;const m=()=>t===0?"":r?`<span class='toggle-btn' data-name='toggle-expanded'>${c("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${c("common.expand")}</span>`,_=h=>{const{target:j}=h;j.getAttribute("data-name")==="toggle-expanded"&&(s(!r),h.customPreventRedirect=!0)};return o.jsxs(vi,{color:n?u.primary.contrastText:"",children:[o.jsx(C,{className:"text-container",component:"div",onClick:_,children:i&&(!r&&t>0?o.jsx(go,{basedOn:"letters",unsafeHTML:ct(i),maxLine:t,ellipsisHTML:ct(m())}):o.jsx(z,{component:"div",className:`content ${t===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important"},dangerouslySetInnerHTML:{__html:ct(`${i}${m()}`)}}))}),!n&&(d||w)?o.jsx(Gt,{severity:e.severity,notification:e}):null]})}const vi=G(C)`
|
|
141
|
+
width: 100%;
|
|
142
|
+
color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
|
|
143
|
+
.text-container {
|
|
144
|
+
word-wrap: break-word;
|
|
145
|
+
word-break: break-all;
|
|
146
|
+
color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
|
|
147
|
+
.toggle-btn {
|
|
148
|
+
display: inline-block;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
margin-left: 4px;
|
|
152
|
+
color: ${e=>e.theme.palette.secondary.main};
|
|
153
|
+
}
|
|
154
|
+
.content.ellipsis {
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
word-break: break-all;
|
|
158
|
+
display: block;
|
|
159
|
+
display: -webkit-box;
|
|
160
|
+
-webkit-box-orient: vertical;
|
|
161
|
+
-webkit-line-clamp: 2;
|
|
162
|
+
line-height: 1.25;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
`,yi=g.memo(gr);var L=function(t,n,r){return Nn.call(n,"css")?o.jsx(zn,Un(t,n),r):o.jsx(t,n,r)},Ne=function(t,n,r){return Nn.call(n,"css")?o.jsxs(zn,Un(t,n),r):o.jsxs(t,n,r)};/**
|
|
166
|
+
* (c) Iconify
|
|
167
|
+
*
|
|
168
|
+
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
|
169
|
+
* files at https://github.com/iconify/iconify
|
|
170
|
+
*
|
|
171
|
+
* Licensed under MIT.
|
|
172
|
+
*
|
|
173
|
+
* @license MIT
|
|
174
|
+
* @version 3.1.1
|
|
175
|
+
*/const xr=Object.freeze({left:0,top:0,width:16,height:16}),Ze=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ke=Object.freeze({...xr,...Ze}),pt=Object.freeze({...ke,body:"",hidden:!1});function bi(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Sn(e,t){const n=bi(e,t);for(const r in pt)r in Ze?r in e&&!(r in n)&&(n[r]=Ze[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function wi(e,t){const n=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function i(a){if(n[a])return s[a]=[];if(!(a in s)){s[a]=null;const c=r[a]&&r[a].parent,l=c&&i(c);l&&(s[a]=[c].concat(l))}return s[a]}return Object.keys(n).concat(Object.keys(r)).forEach(i),s}function ji(e,t,n){const r=e.icons,s=e.aliases||Object.create(null);let i={};function a(c){i=Sn(r[c]||s[c],i)}return a(t),n.forEach(a),Sn(e,i)}function Si(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),n.push(s)});const r=wi(e);for(const s in r){const i=r[s];i&&(t(s,ji(e,s,i)),n.push(s))}return n}const we=/^[a-z0-9]+(-[a-z0-9]+)*$/,ye=(e,t,n,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const c=s.pop(),l=s.pop(),u={provider:s.length>0?s[0]:r,prefix:l,name:c};return t&&!Fe(u)?null:u}const i=s[0],a=i.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Fe(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:i};return t&&!Fe(c,n)?null:c}return null},Fe=(e,t)=>e?!!((e.provider===""||e.provider.match(we))&&(t&&e.prefix===""||e.prefix.match(we))&&e.name.match(we)):!1,Ci={provider:"",aliases:{},not_found:{},...xr};function lt(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function _i(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!lt(e,Ci))return null;const n=t.icons;for(const s in n){const i=n[s];if(!s.match(we)||typeof i.body!="string"||!lt(i,pt))return null}const r=t.aliases||Object.create(null);for(const s in r){const i=r[s],a=i.parent;if(!s.match(we)||typeof a!="string"||!n[a]&&!r[a]||!lt(i,pt))return null}return t}const Xe=Object.create(null);function Ii(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function X(e,t){const n=Xe[e]||(Xe[e]=Object.create(null));return n[t]||(n[t]=Ii(e,t))}function Kt(e,t){return _i(t)?Si(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function ki(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(Xe)).forEach(s=>{(typeof s=="string"&&typeof t=="string"?[t]:Object.keys(Xe[s]||{})).forEach(a=>{const c=X(s,a);n=n.concat(Object.keys(c.icons).map(l=>(s!==""?"@"+s+":":"")+a+":"+l))})}),n}let Qt=!1;function Ei(e){return Qt}function Te(e){const t=typeof e=="string"?ye(e,!0,Qt):e;if(t){const n=X(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Pi(e,t){const n=ye(e,!0,Qt);if(!n)return!1;const r=X(n.provider,n.prefix);return ki(r,n.name,t)}function vr(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!Fe({provider:t,prefix:n,name:"a"}))return!1;const r=X(t,n);return!!Kt(r,e)}function Li(e){return!!Te(e)}function Ri(e){const t=Te(e);return t?{...ke,...t}:null}const yr=Object.freeze({width:null,height:null}),br=Object.freeze({...yr,...Ze}),Di=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ai=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ft(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 r=e.split(Di);if(r===null||!r.length)return e;const s=[];let i=r.shift(),a=Ai.test(i);for(;;){if(a){const c=parseFloat(i);isNaN(c)?s.push(i):s.push(Math.ceil(c*t*n)/n)}else s.push(i);if(i=r.shift(),i===void 0)return s.join("");a=!a}}const $i=e=>e==="unset"||e==="undefined"||e==="none";function nt(e,t){const n={...ke,...e},r={...br,...t},s={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(y=>{const m=[],_=y.hFlip,h=y.vFlip;let j=y.rotate;_?h?j+=2:(m.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),m.push("scale(-1 1)"),s.top=s.left=0):h&&(m.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),m.push("scale(1 -1)"),s.top=s.left=0);let v;switch(j<0&&(j-=Math.floor(j/4)*4),j=j%4,j){case 1:v=s.height/2+s.top,m.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:m.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:v=s.width/2+s.left,m.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}j%2===1&&(s.left!==s.top&&(v=s.left,s.left=s.top,s.top=v),s.width!==s.height&&(v=s.width,s.width=s.height,s.height=v)),m.length&&(i='<g transform="'+m.join(" ")+'">'+i+"</g>")});const a=r.width,c=r.height,l=s.width,u=s.height;let d,f;a===null?(f=c===null?"1em":c==="auto"?u:c,d=ft(f,l/u)):(d=a==="auto"?l:a,f=c===null?ft(d,u/l):c==="auto"?u:c);const p={},w=(y,m)=>{$i(m)||(p[y]=m.toString())};return w("width",d),w("height",f),p.viewBox=s.left.toString()+" "+s.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:p,body:i}}const Mi=/\sid="(\S+)"/g,Oi="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Ni=0;function wr(e,t=Oi){const n=[];let r;for(;r=Mi.exec(e);)n.push(r[1]);if(!n.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(i=>{const a=typeof t=="function"?t(i):t+(Ni++).toString(),c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const ce={local:!0,session:!0},jr={local:new Set,session:new Set};let Zt=!1;function zi(e){Zt=e}const Cn="iconify2",Ie="iconify",Sr=Ie+"-count",_n=Ie+"-version",Cr=36e5,Ui=168;function ht(e,t){try{return e.getItem(t)}catch{}}function Xt(e,t,n){try{return e.setItem(t,n),!0}catch{}}function In(e,t){try{e.removeItem(t)}catch{}}function mt(e,t){return Xt(e,Sr,t.toString())}function gt(e){return parseInt(ht(e,Sr))||0}let ze=typeof window>"u"?{}:window;function _r(e){const t=e+"Storage";try{if(ze&&ze[t]&&typeof ze[t].length=="number")return ze[t]}catch{}ce[e]=!1}function Ir(e,t){const n=_r(e);if(!n)return;const r=ht(n,_n);if(r!==Cn){if(r){const c=gt(n);for(let l=0;l<c;l++)In(n,Ie+l.toString())}Xt(n,_n,Cn),mt(n,0);return}const s=Math.floor(Date.now()/Cr)-Ui,i=c=>{const l=Ie+c.toString(),u=ht(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>s&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}In(n,l)}};let a=gt(n);for(let c=a-1;c>=0;c--)i(c)||(c===a-1?(a--,mt(n,a)):jr[e].add(c))}function kr(){if(!Zt){zi(!0);for(const e in ce)Ir(e,t=>{const n=t.data,r=t.provider,s=n.prefix,i=X(r,s);if(!Kt(i,n).length)return!1;const a=n.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,a):a,!0})}}function Tr(e,t){switch(e){case"local":case"session":ce[e]=t;break;case"all":for(const n in ce)ce[n]=t;break}}const xt=Object.create(null);function Er(e,t){xt[e]=t}function vt(e){return xt[e]||xt[""]}function Jt(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),be=["https://api.simplesvg.com","https://api.unisvg.com"],qe=[];for(;be.length>0;)be.length===1||Math.random()>.5?qe.push(be.shift()):qe.push(be.pop());rt[""]=Jt({resources:["https://api.iconify.design"].concat(qe)});function Pr(e,t){const n=Jt(t);return n===null?!1:(rt[e]=n,!0)}function st(e){return rt[e]}function Bi(){return Object.keys(rt)}const Hi=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Je=Hi();function Vi(e){Je=e}function Fi(){return Je}function qi(e,t){const n=st(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let s=0;n.resources.forEach(a=>{s=Math.max(s,a.length)});const i=t+".json?icons=";r=n.maxURL-s-n.path.length-i.length}return r}function Wi(e){return e===404}const Gi=(e,t,n)=>{const r=[],s=qi(e,t),i="icons";let a={type:i,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=s&&u>0&&(r.push(a),a={type:i,provider:e,prefix:t,icons:[]},c=l.length),a.icons.push(l)}),r.push(a),r};function Ki(e){if(typeof e=="string"){const t=st(e);if(t)return t.path}return"/"}const Qi=(e,t,n)=>{if(!Je){n("abort",424);return}let r=Ki(t.provider);switch(t.type){case"icons":{const i=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=i+".json?"+l.toString();break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let s=503;Je(e+r).then(i=>{const a=i.status;if(a!==200){setTimeout(()=>{n(Wi(a)?"abort":"next",a)});return}return s=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?n("abort",i):n("next",s)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",s)})},Zi={prepare:Gi,send:Qi};function Xi(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((s,i)=>s.provider!==i.provider?s.provider.localeCompare(i.provider):s.prefix!==i.prefix?s.prefix.localeCompare(i.prefix):s.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const i=s.provider,a=s.prefix,c=s.name,l=n[i]||(n[i]=Object.create(null)),u=l[a]||(l[a]=X(i,a));let d;c in u.icons?d=t.loaded:a===""||u.missing.has(c)?d=t.missing:d=t.pending;const f={provider:i,prefix:a,name:c};d.push(f)}),t}function Lr(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(s=>s.id!==t))})}function Ji(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 r=e.provider,s=e.prefix;t.forEach(i=>{const a=i.icons,c=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==s)return!0;const u=l.name;if(e.icons[u])a.loaded.push({provider:r,prefix:s,name:u});else if(e.missing.has(u))a.missing.push({provider:r,prefix:s,name:u});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Lr([e],i.id),i.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),i.abort))})}))}let Yi=0;function ea(e,t,n){const r=Yi++,s=Lr.bind(null,n,r);if(!t.pending.length)return s;const i={id:r,icons:t,callback:e,abort:s};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(i)}),s}function ta(e,t=!0,n=!1){const r=[];return e.forEach(s=>{const i=typeof s=="string"?ye(s,t,n):s;i&&r.push(i)}),r}var na={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ra(e,t,n,r){const s=e.resources.length,i=e.random?Math.floor(Math.random()*s):e.index;let a;if(e.random){let S=e.resources.slice(0);for(a=[];S.length>1;){const T=Math.floor(Math.random()*S.length);a.push(S[T]),S=S.slice(0,T).concat(S.slice(T+1))}a=a.concat(S)}else a=e.resources.slice(i).concat(e.resources.slice(0,i));const c=Date.now();let l="pending",u=0,d,f=null,p=[],w=[];typeof r=="function"&&w.push(r);function y(){f&&(clearTimeout(f),f=null)}function m(){l==="pending"&&(l="aborted"),y(),p.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),p=[]}function _(S,T){T&&(w=[]),typeof S=="function"&&w.push(S)}function h(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:p.length,subscribe:_,abort:m}}function j(){l="failed",w.forEach(S=>{S(void 0,d)})}function v(){p.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),p=[]}function D(S,T,I){const E=T!=="success";switch(p=p.filter(k=>k!==S),l){case"pending":break;case"failed":if(E||!e.dataAfterTimeout)return;break;default:return}if(T==="abort"){d=I,j();return}if(E){d=I,p.length||(a.length?M():j());return}if(y(),v(),!e.random){const k=e.resources.indexOf(S.resource);k!==-1&&k!==e.index&&(e.index=k)}l="completed",w.forEach(k=>{k(I)})}function M(){if(l!=="pending")return;y();const S=a.shift();if(S===void 0){if(p.length){f=setTimeout(()=>{y(),l==="pending"&&(v(),j())},e.timeout);return}j();return}const T={status:"pending",resource:S,callback:(I,E)=>{D(T,I,E)}};p.push(T),u++,f=setTimeout(M,e.rotate),n(S,t,T.callback)}return setTimeout(M),h}function Rr(e){const t={...na,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function s(c,l,u){const d=ra(t,c,l,(f,p)=>{r(),u&&u(f,p)});return n.push(d),d}function i(c){return n.find(l=>c(l))||null}return{query:s,find:i,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function kn(){}const ut=Object.create(null);function sa(e){if(!ut[e]){const t=st(e);if(!t)return;const n=Rr(t),r={config:t,redundancy:n};ut[e]=r}return ut[e]}function Dr(e,t,n){let r,s;if(typeof e=="string"){const i=vt(e);if(!i)return n(void 0,424),kn;s=i.send;const a=sa(e);a&&(r=a.redundancy)}else{const i=Jt(e);if(i){r=Rr(i);const a=e.resources?e.resources[0]:"",c=vt(a);c&&(s=c.send)}}return!r||!s?(n(void 0,424),kn):r.query(t,s,n)().abort}function oa(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in ce)Ir(r,s=>{const i=s.data;return s.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===t});return!0}function ia(e,t){Zt||kr();function n(r){let s;if(!ce[r]||!(s=_r(r)))return;const i=jr[r];let a;if(i.size)i.delete(a=Array.from(i).shift());else if(a=gt(s),!mt(s,a+1))return;const c={cached:Math.floor(Date.now()/Cr),provider:e.provider,data:t};return Xt(s,Ie+a.toString(),JSON.stringify(c))}t.lastModified&&!oa(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Tn(){}function aa(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ji(e)}))}function ca(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:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let i;if(!s||!(i=vt(n)))return;i.prepare(n,r,s).forEach(c=>{Dr(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=Kt(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(f=>{d.delete(f)}),ia(e,l)}catch(u){console.error(u)}aa(e)})})}))}const la=e=>{const n=X(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},Yt=(e,t)=>{const n=ta(e,!0,Ei()),r=Xi(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Tn)}),()=>{l=!1}}const s=Object.create(null),i=[];let a,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===a)return;a=u,c=d,i.push(X(u,d));const f=s[u]||(s[u]=Object.create(null));f[d]||(f[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:f}=l,p=X(u,d),w=p.pendingIcons||(p.pendingIcons=new Set);w.has(f)||(w.add(f),s[u][d].push(f))}),i.forEach(l=>{const{provider:u,prefix:d}=l;s[u][d].length&&ca(l,s[u][d])}),t?ea(t,r,i):Tn},ua=e=>new Promise((t,n)=>{const r=typeof e=="string"?ye(e,!0):e;if(!r){n(e);return}Yt([r||e],s=>{if(s.length&&r){const i=Te(r);if(i){t({...ke,...i});return}}n(e)})});function Ar(e,t){const n={...e};for(const r in t){const s=t[r],i=typeof s;r in yr?(s===null||s&&(i==="string"||i==="number"))&&(n[r]=s):i===typeof n[r]&&(n[r]=r==="rotate"?s%4:s)}return n}const ot={...br,inline:!1},dt="iconify",yt="iconify-inline",re="iconifyData"+Date.now();let ue=[];function Ee(e){for(let t=0;t<ue.length;t++){const n=ue[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function $r(e,t=!1){let n=Ee(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},ue.push(n),n)}function da(){if(document.documentElement)return $r(document.documentElement);ue.push({node:()=>document.documentElement})}function pa(e){ue=ue.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function Pe(){return ue}function fa(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let je=null;const ha={childList:!0,subtree:!0,attributes:!0};function Mr(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,je&&je(e)}))}function ma(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const s=t[r];if(s.addedNodes&&s.addedNodes.length>0||s.type==="attributes"&&s.target[re]!==void 0){n.paused||Mr(e);return}}}function Or(e,t){e.observer.instance.observe(t,ha)}function Ye(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(ma.bind(null,e)),Or(e,n),t.paused||Mr(e))}function En(){Pe().forEach(Ye)}function Nr(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 ga(e){const t=je!==null;if(je!==e&&(je=e,t&&Pe().forEach(Nr)),t){En();return}fa(En)}function bt(e){(e?[e]:Pe()).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 xa(e){if(e){const t=Ee(e);t&&bt(t)}else bt()}function wt(e){(e?[e]:Pe()).forEach(t=>{if(!t.observer){Ye(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?Or(t,r):Ye(t);else return}})}function va(e){if(e){const t=Ee(e);t&&wt(t)}else wt()}function zr(e,t=!1){const n=$r(e,t);return Ye(n),n}function Ur(e){const t=Ee(e);t&&(Nr(t),pa(e))}function ya(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const s in ot)if(n[s]!==r[s])return!0;return!1}function ba(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(n!==e){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/s,i%1===0?r(i):0)}}return t}const wa=/[\s,]+/;function ja(e,t){t.split(wa).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Sa=["width","height"],Ca=["inline","hFlip","vFlip"];function _a(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function Ia(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&ye(t,!0);if(!n)return null;const r={...ot,inline:e.classList&&e.classList.contains(yt)};Sa.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const s=e.getAttribute("data-rotate");typeof s=="string"&&(r.rotate=ba(s));const i=e.getAttribute("data-flip");typeof i=="string"&&ja(r,i),Ca.forEach(c=>{const l="data-"+c,u=_a(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:a}}const ka="svg."+dt+", i."+dt+", span."+dt+", i."+yt+", span."+yt;function Ta(e){const t=[];return e.querySelectorAll(ka).forEach(n=>{const r=n[re]||n.tagName.toLowerCase()!=="svg"?Ia(n):null;r&&t.push({node:n,props:r})}),t}function Br(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let Se;function Ea(){try{Se=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Se=null}}function Pa(e){return Se===void 0&&Ea(),Se?Se.createHTML(e):e}function Hr(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function Vr(e,t,n,r){const s=e.classList;if(r){const a=r.classList;Array.from(a).forEach(c=>{s.add(c)})}const i=[];return t.forEach(a=>{s.contains(a)?n.has(a)&&i.push(a):(s.add(a),i.push(a))}),n.forEach(a=>{t.has(a)||s.remove(a)}),i}function Fr(e,t,n){const r=e.style;(n||[]).forEach(i=>{r.removeProperty(i)});const s=[];for(const i in t)r.getPropertyValue(i)||(s.push(i),r.setProperty(i,t[i]));return s}function qr(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const s=t.customisations,i=nt(n,s),a=e[re],c=Br(wr(i.body),{"aria-hidden":"true",role:"img",...i.attributes});r.innerHTML=Pa(c);const l=r.childNodes[0],u=e.attributes;for(let y=0;y<u.length;y++){const m=u.item(y),_=m.name;_!=="class"&&!l.hasAttribute(_)&&l.setAttribute(_,m.value)}const d=Hr(t.icon),f=Vr(l,d,new Set(a&&a.addedClasses),e),p=Fr(l,s.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),w={...t,status:"loaded",addedClasses:f,addedStyles:p};return l[re]=w,e.parentNode&&e.parentNode.replaceChild(l,e),l}function La(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,"+La(e)}function Da(e){return'url("'+Ra(e)+'")'}const Aa={display:"inline-block"},jt={"background-color":"currentColor"},Wr={"background-color":"transparent"},Pn={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ln={"-webkit-mask":jt,mask:jt,background:Wr};for(const e in Ln){const t=Ln[e];for(const n in Pn)t[e+"-"+n]=Pn[n]}function Rn(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function $a(e,t,n,r){const s=t.customisations,i=nt(n,s),a=i.attributes,c=e[re],l=Br(i.body,{...a,width:n.width+"",height:n.height+""}),u=Hr(t.icon),d=Vr(e,u,new Set(c&&c.addedClasses)),p={"--svg":Da(l),width:Rn(a.width),height:Rn(a.height),...Aa,...r?jt:Wr};s.inline&&(p["vertical-align"]="-0.125em");const w=Fr(e,p,c&&c.addedStyles),y={...t,status:"loaded",addedClasses:d,addedStyles:w};return e[re]=y,e}let Ue=!1;function Ma(){Ue||(Ue=!0,setTimeout(()=>{Ue&&(Ue=!1,xe())}))}function xe(e,t=!1){const n=Object.create(null);function r(s,i){const{provider:a,prefix:c,name:l}=s,u=X(a,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(i&&!la(s)){const f=n[a]||(n[a]=Object.create(null));(f[c]||(f[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:Pe()).forEach(s=>{const i=typeof s.node=="function"?s.node():s.node;if(!i||!i.querySelectorAll)return;let a=!1,c=!1;function l(u,d,f){if(c||(c=!0,bt(s)),u.tagName.toUpperCase()!=="SVG"){const p=d.mode,w=p==="mask"||(p==="bg"?!1:p==="style"?f.body.indexOf("currentColor")!==-1:null);if(typeof w=="boolean"){$a(u,d,{...ke,...f},w);return}}qr(u,d,f)}Ta(i).forEach(({node:u,props:d})=>{const f=u[re];if(!f){const{status:w,icon:y}=r(d.icon,!0);if(y){l(u,d,y);return}a=a||w==="loading",u[re]={...d,status:w};return}let p;if(ya(f,d)){if(p=r(d.icon,f.name!==d.name),!p.icon){a=a||p.status==="loading",Object.assign(f,{...d,status:p.status});return}}else{if(f.status!=="loading")return;if(p=r(d.icon,!1),!p.icon){f.status=p.status;return}}l(u,d,p.icon)}),s.temporary&&!a?Ur(i):t&&a?zr(i,!0):c&&s.observer&&wt(s)});for(const s in n){const i=n[s];for(const a in i){const c=i[a];Yt(Array.from(c).map(l=>({provider:s,prefix:a,name:l})),Ma)}}}function Oa(e){const t=Ee(e);t?xe(t):xe({node:e,temporary:!0},!0)}function Gr(e,t,n=!1){const r=Te(e);if(!r)return null;const s=ye(e),i=Ar(ot,t||{}),a=qr(document.createElement("span"),{name:e,icon:s,customisations:i},r);return n?a.outerHTML:a}function Na(){return"3.1.1"}function za(e,t){return Gr(e,t,!1)}function Ua(e,t){return Gr(e,t,!0)}function Ba(e,t){const n=Te(e);if(!n)return null;const r=Ar(ot,t||{});return nt(n,r)}function Ha(e){e?Oa(e):xe()}if(typeof document<"u"&&typeof window<"u"){da();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(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!vr(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{ga(xe),xe()})}function Va(e,t){Tr(e,t!==!1)}function Fa(e){Tr(e,!0)}Er("",Zi);if(typeof document<"u"&&typeof window<"u"){kr();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const s=t[n];if(typeof s!="object"||!s||s.resources===void 0)continue;Pr(n,s)||console.error(r)}catch{console.error(r)}}}}const qa={getAPIConfig:st,setAPIModule:Er,sendAPIQuery:Dr,setFetch:Vi,getFetch:Fi,listAPIProviders:Bi},Wa={_api:qa,addAPIProvider:Pr,loadIcons:Yt,loadIcon:ua,iconExists:Li,getIcon:Ri,listIcons:Ti,addIcon:Pi,addCollection:vr,replaceIDs:wr,calculateSize:ft,buildIcon:nt,getVersion:Na,renderSVG:za,renderHTML:Ua,renderIcon:Ba,scan:Ha,observe:zr,stopObserving:Ur,pauseObserver:xa,resumeObserver:va,enableCache:Va,disableCache:Fa};try{self.Iconify===void 0&&(self.Iconify=Wa)}catch{}var en={},Ga=B;Object.defineProperty(en,"__esModule",{value:!0});var Kr=en.default=void 0,Ka=Ga(H()),Qa=o;Kr=en.default=(0,Ka.default)((0,Qa.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");function tn({infos:e}){const{t}=J(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(s=>{n.searchParams.set(s.label,s.value)});const r=e.map(s=>`* ${s.label}: ${s.value}`).join(`
|
|
176
|
+
`);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<!--
|
|
181
|
+
[Server Info]
|
|
182
|
+
${r}
|
|
183
|
+
* Page: ${window.location.href}
|
|
184
|
+
-->
|
|
185
|
+
`),L(C,{sx:{mx:{xs:0,md:2}},children:L(It,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}tn.propTypes={infos:x.arrayOf(x.shape({label:x.string,value:x.string}))};tn.defaultProps={infos:[]};var nn={},Za=B;Object.defineProperty(nn,"__esModule",{value:!0});var St=nn.default=void 0,Xa=Za(H()),Dn=o;St=nn.default=(0,Xa.default)([(0,Dn.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,Dn.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");function te({children:e}){return Z(n=>n.breakpoints.down("md"))?o.jsx(Ce,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:o.jsx(C,{sx:{display:"flex",alignItems:"center",gap:1},children:o.jsx(St,{fontSize:"small"})})}):o.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(St,{fontSize:"small"}),e]})}te.propTypes={children:x.node.isRequired};const Ja="https://launcher.arcblock.io/",Ya=30*24*60*60*1e3;function rn({launcherUrl:e,chainHost:t,nftId:n,launcherSessionId:r,...s}){var M,S,T,I,E,k;const{t:i,locale:a}=J(),c=tt(),[l,u]=Xn({safeIframeRef:null,popoverAnchorEl:null}),d=g.useRef(null),f=Z(P=>P.breakpoints.down("md")),{sx:p={},...w}=s,y=f?"mobile":"desktop",m=Zn(async()=>{const[P,de]=await Promise.all([c.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),qn({launcherUrl:e||Ja,nftDid:n,launcherSessionId:r,locale:a})]);if(P!=null&&P.error)throw new Error(P.error);return{launcherSession:P.launcherSession,subscriptionURL:de}},[a]);if(m.loading)return o.jsx(ae,{label:o.jsxs(te,{children:[!f&&i("expiration.desktop.loading"),o.jsx(ne,{size:16})]}),variant:"success",sx:{cursor:"pointer",...p},...w});if(m.error)return console.error(m.error),o.jsx(ae,{label:o.jsx(te,{children:i(`expiration.${y}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...p},...w,onClick:()=>m.retry()});const _=P=>{u({popoverAnchorEl:P.currentTarget})},h=()=>{u({popoverAnchorEl:null})},j=(M=m.value)==null?void 0:M.launcherSession;let v="success";[$.LAUNCH_SESSION_STATUS.overdue,$.LAUNCH_SESSION_STATUS.canceled,$.LAUNCH_SESSION_STATUS.terminated].includes((T=(S=m.value)==null?void 0:S.launcherSession)==null?void 0:T.status)&&(v="error");let D=null;if(j.expirationDate&&!j.subscription){const P=he(j.expirationDate).diff(he(),"ms");D=i(`expiration.${y}.tips.${v}`,{validity:Qn(P,{locale:Wn(a),compact:!0,verbose:!0})}),P>0&&P<=Ya&&(v="warning")}return o.jsxs(o.Fragment,{children:[o.jsx(ae,{label:o.jsx(te,{children:D||((E=(I=j==null?void 0:j.subscription)==null?void 0:I.product)==null?void 0:E.name)||i("common.subscription")}),color:v,variant:v!=="success"?"contained":"outlined",sx:{cursor:"pointer",...p},...w,onClick:_}),o.jsx(Bn,{id:"popover-info",open:!!l.popoverAnchorEl,anchorEl:l.popoverAnchorEl,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:o.jsx(C,{sx:{width:{xs:"360px",md:"450px"}},children:o.jsx("iframe",{ref:d,title:i("common.subscription"),width:"100%",height:"600px",style:{border:0},src:(k=m.value)==null?void 0:k.subscriptionURL})})})]})}rn.propTypes={chainHost:x.string.isRequired,nftId:x.string,launcherSessionId:x.string,sx:x.object,retention:x.number,launcherUrl:x.string.isRequired};rn.defaultProps={sx:{},retention:0,nftId:"",launcherSessionId:""};const ec=30*24*60*60*1e3,tc="https://launcher.arcblock.io/";function sn({launcherUrl:e,chainHost:t,nftId:n,launcherSessionId:r,...s}){var S,T,I,E,k,P,de;const{t:i,locale:a}=J(),[c,l]=Xn({safeIframeRef:null,popoverAnchorEl:null}),u=g.useRef(null),d=Z(V=>V.breakpoints.down("md")),f=tt(),{sx:p={},...w}=s,y=d?"mobile":"desktop",m=Zn(async()=>{const[V,Le]=await Promise.all([f.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),qn({launcherUrl:e||tc,nftDid:n,launcherSessionId:r,locale:a})]);if(V!=null&&V.error)throw new Error(V.error);return{launcherSession:V.launcherSession,subscriptionURL:Le}},[a]);if(m.loading)return o.jsx(ae,{label:o.jsxs(te,{children:[!d&&i("expiration.desktop.loading"),o.jsx(ne,{size:16})]}),variant:"success",sx:{cursor:"pointer",...p},...w});if(m.error)return console.error(m.error),o.jsx(ae,{label:o.jsx(te,{children:i(`expiration.${y}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...p},...w,onClick:()=>m.retry()});const _=(T=(S=m.value)==null?void 0:S.launcherSession)==null?void 0:T.expirationDate,h=he(_).isBefore(he()),j=he(_).diff(he(),"ms");let v="success";j<=ec&&(v="warning"),h&&(v="error");const D=V=>{l({popoverAnchorEl:V.currentTarget})},M=()=>{l({popoverAnchorEl:null})};return o.jsxs(o.Fragment,{children:[((E=(I=m.value)==null?void 0:I.launcherSession)==null?void 0:E.subscription)&&o.jsx(ae,{label:o.jsx(te,{children:i("expiration.desktop.nextInvoice",{date:Ws(_,a)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...p},...w,onClick:D}),!((P=(k=m.value)==null?void 0:k.launcherSession)!=null&&P.subscription)&&o.jsx(ae,{label:o.jsx(te,{children:i(`expiration.${y}.tips.${v}`,{validity:Qn(j,{locale:Wn(a),compact:!0,verbose:!0})})}),color:v,variant:v!=="success"?"contained":"outlined",sx:{cursor:"pointer",...p},...w,onClick:D}),o.jsx(Bn,{id:"popover-info",open:!!c.popoverAnchorEl,anchorEl:c.popoverAnchorEl,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:o.jsx(C,{sx:{width:{xs:"360px",md:"450px"}},children:o.jsx("iframe",{ref:u,title:i("common.subscription"),width:"100%",height:"600px",style:{border:0},src:(de=m.value)==null?void 0:de.subscriptionURL})})})]})}sn.propTypes={chainHost:x.string.isRequired,nftId:x.string,launcherSessionId:x.string,sx:x.object,retention:x.number,launcherUrl:x.string.isRequired};sn.defaultProps={sx:{},retention:0,nftId:"",launcherSessionId:""};var on={},nc=B;Object.defineProperty(on,"__esModule",{value:!0});var Qr=on.default=void 0,rc=nc(H()),sc=o;Qr=on.default=(0,rc.default)((0,sc.jsx)("path",{d:"M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"}),"Fullscreen");var an={},oc=B;Object.defineProperty(an,"__esModule",{value:!0});var Zr=an.default=void 0,ic=oc(H()),ac=o;Zr=an.default=(0,ic.default)((0,ac.jsx)("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit");const cc={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'};function cn({children:e,style:t,...n}){return o.jsx(Ms,{style:t,...n,children:e})}cn.propTypes={children:x.any.isRequired,style:x.object};cn.defaultProps={style:{}};const O={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",success:"#3ab39d",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},We={added:O.grey,waiting:O.yellow,downloading:O.yellow,extracting:O.yellow,downloaded:O.grey,installing:O.yellow,installed:O.grey,starting:O.yellow,running:O.running,stopping:O.yellow,stopped:O.reverse,error:O.error,upgrading:O.yellow,restarting:O.yellow,corrupted:O.error,deleting:O.yellow,resource:O.primary},lc={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 Xr({isResource:e,status:t,variant:n,source:r,progress:s,...i}){const{t:a}=g.useContext(kt),c=N.isInProgress(t),l=e&&t==="stopped"?"resource":t,u=a(`blocklet.status.${l}`);return n==="pin"?o.jsx(Ce,{title:a("blocklet.statusTip",{status:u}),children:o.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",...i,children:[o.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:We[l],style:{opacity:.15}}),o.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:We[l]})]})}):n==="dot"?o.jsx(Ce,{title:a("blocklet.statusTip",{status:u}),children:o.jsx(yo,{color:We[l],...i})}):o.jsxs(cn,{type:lc[l],...i,children:[c&&o.jsx(ne,{size:12,color:"inherit",style:{marginRight:5}}),u,l==="downloading"&&s?o.jsx("div",{style:{marginLeft:5},children:`${s} %`}):null]})}Xr.propTypes={status:x.string.isRequired,variant:x.oneOf(["dot","tag","pin"]),source:x.string,progress:x.number,isResource:x.bool};Xr.defaultProps={isResource:!1,variant:"tag",source:"",progress:0};function uc(){const{inFullPage:e,toggleFullPage:t}=cs();return L(Ct,{onClick:t,children:e?L(Zr,{sx:{transform:"scale(1.3)"}}):L(Qr,{sx:{transform:"scale(1.3)"}})})}function ln({children:e}){var _;const{t}=J(),{loading:n,error:r,actions:{refreshBlocklet:s},env:i,blocklet:a}=ve(),{info:c}=Gs(),l=Is(),u=Z(h=>h.breakpoints.down("md")),{appId:d,version:f}=i,p=[{label:"App ID",value:d},{label:"App Version",value:f},{label:"App Bundle Name",value:(_=a==null?void 0:a.meta)==null?void 0:_.bundleName},{label:"Server Id",value:c.did},{label:"Server Version",value:c.version}],w=h=>{var v,D,M,S;const j=Array.isArray(h)?h:[h];if(u||j.unshift(L(uc,{})),a){const T={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};Ks(a)?j.unshift(L(rn,{chainHost:(v=a==null?void 0:a.controller)==null?void 0:v.chainHost,nftId:(D=a==null?void 0:a.controller)==null?void 0:D.nftId,launcherSessionId:(M=a==null?void 0:a.controller)==null?void 0:M.launcherSessionId,launcherUrl:(S=a==null?void 0:a.controller)==null?void 0:S.launcherUrl,sx:T})):c.ownerNft&&c.launcher&&j.unshift(L(sn,{chainHost:c.launcher.chainHost,launcherUrl:c.launcher.url,nftId:c.ownerNft.did,launcherSessionId:c.ownerNft.launcherSessionId,sx:T}))}return j},y=xo({blocklet:a}),m={logo:y?L("img",{src:y,alt:"logo"}):null,brandAddon:L(C,{children:a&&Ne(C,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,sx:{py:1,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[L(Ce,{title:N.isRunning(a==null?void 0:a.status)?void 0:t(`blocklet.status.${a==null?void 0:a.status}`),children:L(C,{sx:{width:8,height:8,borderRadius:"50%"},bgcolor:We[a==null?void 0:a.status]})}),L(C,{sx:{lineHeight:1,color:"text.secondary",maxWidth:u?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.getDisplayName(a)}),L(C,{component:Os,icon:cc,sx:{color:"text.secondary"}})]})})};return Ne(dc,{legacy:!1,fullWidth:!0,headerAddons:w,headerProps:m,footerProps:{addon:L(tn,{infos:p})},children:[!a&&n&&L(Ke,{relative:"parent",children:L(ne,{})}),!a&&r&&Ne(Ke,{relative:"parent",children:[Ne(C,{display:"flex",alignItems:"center",children:[L(Kr,{color:"error",sx:{marginRight:1}}),Pt(r)]}),L(Tt,{onClick:()=>s(),children:L("span",{style:{textDecoration:"underline"},children:t("common.retry")})})]}),!!a&&L(C,{flex:1,padding:u?2:3,display:"flex",flexDirection:"column",children:L(Ns,{FallbackComponent:as,resetKeys:[l.pathname],children:e})})]})}ln.propTypes={children:x.any};ln.defaultProps={children:null};const dc=G(is)`
|
|
186
|
+
div.dashboard-content {
|
|
187
|
+
padding: 0;
|
|
188
|
+
}
|
|
189
|
+
.header-addons .locales {
|
|
190
|
+
max-height: 400px;
|
|
191
|
+
overflow-y: auto;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.header-brand-addon {
|
|
195
|
+
display: block;
|
|
196
|
+
}
|
|
197
|
+
`;function pc(){var _;const{t:e,locale:t}=J(),{blocklet:n,launcherSession:r,refreshSubscription:s}=ve(),{connectApi:i,session:a,api:c}=Qs(),[l,u]=g.useState(!1),[d,f]=g.useState(""),[p,w]=po({subscriptionURL:"#"});if(g.useEffect(()=>{var h,j;hn(n,r)&&Zs({launcherSessionId:(h=n==null?void 0:n.controller)==null?void 0:h.launcherSessionId,launcherUrl:(j=n==null?void 0:n.controller)==null?void 0:j.launcherUrl,locale:t}).then(v=>{w({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),g.useEffect(()=>{var h;if((h=n.controller)!=null&&h.launcherUrl){const j=me(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(j).then(v=>v.json()).then(v=>{var S,T;const D=(T=(S=v.componentMountPoints)==null?void 0:S.find(I=>I.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:T.mountPoint,M=me(n.controller.launcherUrl,D);f(M)})}},[(_=n.controller)==null?void 0:_.launcherUrl]),!mn(r)&&(!n||!r||!Xs(n)||r.status===$.LAUNCH_SESSION_STATUS.installed))return"";let y=null,m="";return mn(r)?(y=o.jsx(Cs,{onClick:()=>u(!0),children:e("blocklet.paynow")}),m=e("blocklet.suspendedCausedByExpired",{deadline:at(r==null?void 0:r.reservedUntil,t)})):hn(n,r)?(y=o.jsx(It,{href:p.subscriptionURL,children:e("blocklet.manageSubscription")}),m=e("blocklet.suspendedCausedByExpired",{deadline:at(r==null?void 0:r.reservedUntil,t)})):Js(n,r)&&(y=o.jsx(Hn,{to:me($.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),m=e("blocklet.suspendedCausedByTerminated",{canceledAt:at(r==null?void 0:r.terminatedAt,t),deadline:Ys(r==null?void 0:r.terminatedAt,t)})),o.jsxs(C,{component:zs,type:"error",sx:{"&> .alert-content":{display:"block"}},children:[l&&d&&r&&o.jsx(eo,{session:a,connect:i,baseUrl:d,authToken:r.subscription.authToken,children:o.jsx(to,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),s(),u(!1)}})}),m,o.jsx(z,{component:"span",sx:{marginLeft:"4px"},children:y})]})}const Jr=g.createContext({});function ll(){return g.useContext(Jr)}const{Provider:fc,Consumer:ul}=Jr,{did:W,appId:hc}=window.env;function mc({children:e}){var S,T;const{t,locale:n}=J(),{blocklet:r}=ve(),[s,i]=g.useState([]),[a,c]=g.useState([]),[l,u]=g.useState([]),d=N.getDisplayName(r),f=((S=((r==null?void 0:r.environments)||[]).find(I=>I.key===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:S.value)||"auto",p=(r==null?void 0:r.trustedPassports)||[],w=(r==null?void 0:r.trustedFactories)||[],y=(r==null?void 0:r.enablePassportIssuance)!==!1,m=async()=>{try{const I=await Me.doBatchQuery({getRoles:{input:{teamDid:W}},getPermissions:{input:{teamDid:W}},getInvitations:{input:{teamDid:W}}}),E=(I.getRoles.roles||[]).filter(k=>!$.RBAC_CONFIG.roles.some(P=>P.name===k.name&&(!P.passport||P.ci))).map(k=>(k.hasDescription=!!k.description,k.hasDescription||(k.description=t("team.passport.description",{teamName:d,title:k.title})),k));c(lo(E,[k=>no(k.name)],["desc"])),u(I.getPermissions.permissions||[]),i(I.getInvitations.invitations||[])}catch(I){Q.error(I.message)}},_=({did:I}={})=>{const E={teamDid:W,user:{did:I}};return Me.getUser({input:E})},h=({query:I,paging:E}={})=>{const k={teamDid:W};return E&&(k.paging=E),I&&(k.query=I),k.sort={lastLoginAt:-1},Me.getUsers({input:k})},j=()=>Me.getUsersCountPerRole({input:{teamDid:W}}),v=()=>m();g.useEffect(()=>{var I;(I=r==null?void 0:r.meta)!=null&&I.did&&m()},[(T=r==null?void 0:r.meta)==null?void 0:T.did]),g.useEffect(()=>{c(I=>I.map(E=>(E.hasDescription||(E.description=t("team.passport.description",{teamName:d,title:E.title})),{...E})))},[t,n]);const D=I=>{I.teamDid===W&&m()};Be(ie.TeamEvents.userAdded,D,[W]),Be(ie.TeamEvents.userRemoved,D,[W]),Be(ie.TeamEvents.userUpdated,D,[W]);const M={teamDid:W,teamIssuerDid:hc,teamName:d,invitations:s,roles:a,permissions:l,trustedPassports:p,trustedFactories:w,isNodeTeam:!1,enablePassportIssuance:y,refresh:v,passportColor:f,endpoint:window.location.origin,blocklet:r,api:{getUser:_,getUsers:h,getUsersCountPerRole:j}};return o.jsx(fc,{value:M,children:e})}const gc=g.lazy(()=>R(()=>import("./log--AX8zo75.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),xc=g.lazy(()=>R(()=>import("./index-Jnk92KZC.js"),__vite__mapDeps([15,2,1,5,4,6,7,8,10,16,9,11,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,3,42,43,44,45,46,47,48]))),vc=g.lazy(()=>R(()=>import("./index-C-A13dEh.js"),__vite__mapDeps([49,4,2,5,1,6,7,8,45,10,9,11,50,35,30,39,40,3,42,43,25,44,46,32,47,48]))),yc=g.lazy(()=>R(()=>import("./index-Du38Vjy4.js"),__vite__mapDeps([51,2,1,9,10,4,5,6,7,8,11,52,35,30,25,23,53,13,41,54,12,26,55,47,56,57,58,59,28,34,60,61,62,63,64,65,43,66,67,68,69]))),bc=g.lazy(()=>R(()=>import("./overview-CpKMiGEK.js"),__vite__mapDeps([70,1,2,4,5,6,7,8,10,45,71,44,25,9,11,33,46,32,23,72,73,74,58,3,35,30,42,43,47,48]))),wc=g.lazy(()=>R(()=>import("./domains-bzKFbARj.js"),__vite__mapDeps([75,2,4,5,1,6,7,8,9,10,11,76,50,24,25,46,32,35,30,39,40,65,26,77,47,45,31,33,78]))),jc=g.lazy(()=>R(()=>import("./index-C5SsKJ2n.js"),__vite__mapDeps([79,2,6,5,1,4,7,8,9,10,11,23,80,17,18,19,20,21,36,37,24,25,81,82,83,35,30,54,47,84,3,42,43,44,45,46,32,48]))),Sc=g.lazy(()=>R(()=>import("./appearance-bRLsRDs2.js"),__vite__mapDeps([85,5,2,4,1,6,7,8,9,10,11]))),Cc=g.lazy(()=>R(()=>import("./audit-logs-B3-Fo3nR.js"),__vite__mapDeps([86,4,2,5,1,6,7,8,36,37,3,9,10,11,67,68,45,41,69,35,30,42,43,25,44,46,32,47,48]))),_c=g.lazy(()=>R(()=>import("./index-ioZVVJtg.js"),__vite__mapDeps([87,2,1,5,4,6,7,8,9,10,11,44,25,88,89,41,33,90,57,13,45,78,17,18,19,20,21,36,37,23,91,46,32,92,93,94,59,95,30,28,29,96,3,35,42,43,47,48]))),Ic=g.lazy(()=>R(()=>import("./config-navigation-B0nu0al4.js"),__vite__mapDeps([97,2,4,5,1,6,7,8,73,82,10,98,9,11,99,100,66,58,44,25,60,61,92,30,3,35,42,43,45,46,32,47,48]))),kc=g.lazy(()=>R(()=>import("./index-DjEDWgGs.js"),__vite__mapDeps([101,1,2,6,5,10,4,7,8,9,11,96,58,102,103,74,34,30,33,104,40,43,105,54,3,35,42,25,44,45,46,32,47,48]))),Tc=g.lazy(()=>R(()=>import("./index-USO5zFMh.js"),__vite__mapDeps([106,4,2,5,1,6,7,8,10,9,11,105,89,71,33,37,96]))),Ec=g.lazy(()=>R(()=>import("./security-DM8MeY05.js"),__vite__mapDeps([107,4,2,5,1,6,7,8,9,10,11,100,108,96,3,35,30,42,43,25,44,45,46,32,47,48]))),Pc=g.lazy(()=>R(()=>import("./branding-By8KDk5Q.js"),__vite__mapDeps([109,2,1,4,5,6,7,8,10,64,110,56,83,66,9,11,24,25,44,89]))),Lc=g.lazy(()=>R(()=>import("./advanced-tG5IRVhQ.js"),__vite__mapDeps([111,2,1,9,10,4,5,6,7,8,11,24,25,35,30,47,89,26,33,23,72,73,3,42,43,44,45,46,32,48]))),Rc=g.lazy(()=>R(()=>import("./traffic-B5x_6GvF.js").then(e=>e.t),__vite__mapDeps([91,2,9,1,10,4,5,6,7,8,11,46,32,92,93,94,59,95,30,28,29]))),Dc=g.lazy(()=>R(()=>import("./runtime-eXYlg9Cz.js"),__vite__mapDeps([112,2,1,44,6,5,4,7,8,10,25,9,11,104,13,3,35,30,42,43,45,46,32,47,48]))),Ac=g.lazy(()=>R(()=>import("./index-Dyl-XQ73.js"),__vite__mapDeps([113,2,4,5,1,6,7,8,114,80,17,10,18,19,20,21,23,36,37,9,11,27,28,29,35,30,26,65,24,25,13,39,40,3,42,43,44,45,46,32,47,48]))),$c=g.lazy(()=>R(()=>import("./list-D96_O-GY.js"),__vite__mapDeps([115,2,4,5,1,6,7,8,10,114,46,32,22,9,11,53,26,65,35,30,80,17,18,19,20,21,23,36,37,39,40,3,42,43,25,44,45,47,48]))),Mc=g.lazy(()=>R(()=>import("./component-Blsql2u0.js"),__vite__mapDeps([116,1,2,5,4,6,7,8,10,9,11,117,105,24,25,114,99,95,61,26,59,94,66,30,118,62,63,64,34,65,35,43,23,119,120,103,74,58,110,56,121,88,81,82,67,68,98,33,3,77,96,122,102,123,84,45,92,13,42,39,40,44,46,32,47,48]))),Oc=g.lazy(()=>R(()=>import("./index-Cc-e6lxg.js"),__vite__mapDeps([124,1,2,9,10,4,5,6,7,8,11]))),Nc=me($.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),zc=e=>{const{enqueueSnackbar:t}=Fn(),n=g.useCallback(r=>Gn(Nc,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);Be(`${e}/${$.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const s=n(r),{severity:i,description:a}=r||{},c=["error","warning"].includes(i)||r.sticky;r.source==="system"&&t(a,{variant:i,autoHideDuration:c?null:5e3,content:l=>o.jsx(ri,{viewAllUrl:s,keyId:l,notification:r,content:o.jsx(yi,{notification:r,minimal:!0,rows:0})})})},[],"user")};function Yr({blocklet:e,isAdmin:t}){return t?o.jsx(_c,{blocklet:e}):o.jsx(us,{status:403})}Yr.propTypes={blocklet:x.object.isRequired,isAdmin:x.bool.isRequired};const Uc=e=>{var d,f;const{t}=J(),{blocklet:n,actions:{refreshBlocklet:r},client:s,did:i}=ve(),a=(d=n==null?void 0:n.meta)==null?void 0:d.did,c=!n||io(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:o.jsx(_s,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advanced"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"}],developers:[{label:t("common.logs"),value:"logs",show:((f=n==null?void 0:n.children)==null?void 0:f.length)&&n.structVersion===$.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:bc,components:Mc,members:o.jsx(xc,{type:"blocklet",createPassportSvg:gn}),passports:o.jsx(jc,{createPassportSvg:gn}),settings:o.jsx(Tc,{orientation:"vertical"}),security:o.jsx(Ec,{}),"did-spaces":o.jsx(kc,{navOrientation:"horizontal"}),domains:wc,branding:o.jsx(Pc,{blocklet:n,onUpdate:r}),theming:o.jsx(Sc,{}),navigation:Ic,sitemap:o.jsx(Bs,{children:t("common.comingSoon")}),notifications:o.jsx(Yr,{blocklet:n,isAdmin:e}),"audit-logs":o.jsx(Cc,{scope:a,categories:["blocklet","team","security","certificates","gateway"]}),analytics:o.jsx(Rc,{client:s,did:i}),advanced:o.jsx(Lc,{blocklet:n,onUpdate:r}),webhooks:o.jsx(vc,{}),"access-keys":o.jsx(Ac,{}),logs:gc,performance:o.jsx(Dc,{client:s,did:i}),docs:Oc,publish:o.jsx(yc,{}),oauth:o.jsx($c,{})};return{tabGroups:l,renders:u}};function Bc(){var h,j;const e=Vn(),{tab:t="overview",subtab:n}=ks(),{blocklet:r,refreshFlag:s}=ve(),{session:i}=Kn(),a=ge(()=>{var v;return(v=i==null?void 0:i.user)==null?void 0:v.did},[i]),c=bo(),l=ge(()=>{var v;return((v=i.user)==null?void 0:v.role)&&so.includes(i.user.role)},[i]);zc(a);const{tabGroups:u,renders:d}=Uc(l),f=v=>{e(`${$.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${v}`)},p=(u[t]||[]).filter(v=>v.show===void 0||v.show),w=((h=(p||[]).find(v=>v.value===n))==null?void 0:h.value)||((j=p==null?void 0:p[0])==null?void 0:j.value)||t,y=d[w]||d.overview,m=["overview"].includes(t),_=r?o.jsxs(Lt,{type:"components",children:[p.length>0&&o.jsxs(C,{mb:2,display:"flex",alignItems:"center",gap:2,children:[o.jsx(C,{flex:1,children:o.jsx(Us,{tabs:p,current:w,onChange:f,scrollButtons:"auto"})}),m&&!c&&o.jsx(C,{component:"div",className:"page-header",children:r?o.jsx(wn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:v}={})=>{v&&Q.error(v.message)},variant:"group"}):null})]}),o.jsx(C,{className:"page-content",children:o.jsx(g.Suspense,{fallback:o.jsx(Ke,{relative:"parent",children:o.jsx(ne,{})}),children:g.isValidElement(y)?y:o.jsx(y,{blocklet:r})})})]}):o.jsx(Ke,{relative:"parent",children:o.jsx(ne,{})});return o.jsx(oo,{children:o.jsx(mc,{children:o.jsx(ln,{children:o.jsxs(Vc,{children:[c&&m&&o.jsx(C,{component:"div",className:"page-header",mb:2,children:r?o.jsx(wn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:v}={})=>{v&&Q.error(v.message)},variant:"group"}):null}),o.jsx(ar,{}),o.jsx(pc,{}),_]})},`${s}`)})})}function Hc(){var r;const{blocklet:e}=ve(),{t}=J(),n=(r=e==null?void 0:e.meta)==null?void 0:r.did;return g.useEffect(()=>{const s=ro();return n&&s.connect(),()=>{n&&s.isConnected()&&s.disconnect()}},[n]),o.jsxs(o.Fragment,{children:[o.jsx(ls,{children:o.jsx("title",{children:t("pageTitle.dashboard")})}),o.jsx(Bc,{})]})}const Vc=G.main`
|
|
198
|
+
.page-header {
|
|
199
|
+
display: flex;
|
|
200
|
+
justify-content: space-between;
|
|
201
|
+
align-items: center;
|
|
202
|
+
flex-wrap: wrap;
|
|
203
|
+
gap: 16px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.page-title {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
|
|
210
|
+
.page-link {
|
|
211
|
+
font-size: 15px;
|
|
212
|
+
margin-top: 8px;
|
|
213
|
+
margin-left: 8px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
218
|
+
.page-header {
|
|
219
|
+
flex-direction: column;
|
|
220
|
+
align-items: flex-start;
|
|
221
|
+
.page-actions,
|
|
222
|
+
.MuiButtonGroup-root {
|
|
223
|
+
width: 100%;
|
|
224
|
+
}
|
|
225
|
+
.MuiButtonGroup-root {
|
|
226
|
+
.MuiButtonBase-root {
|
|
227
|
+
flex: 1;
|
|
228
|
+
}
|
|
229
|
+
.blocklet-action-text {
|
|
230
|
+
display: none;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.page-title {
|
|
236
|
+
margin-bottom: 15px;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
`,dl=Object.freeze(Object.defineProperty({__proto__:null,default:Hc},Symbol.toStringTag,{value:"Module"}));export{Xr as B,cn as W,er as a,nr as b,Yn as c,Kr as d,sr as e,fe as f,cl as g,dl as h,ll as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aa as r,ak as j,T as g,O as _,H as n}from"./vendor-mui-core-
|
|
1
|
+
import{j as e,aa as r,ak as j,T as g,O as _,H as n}from"./vendor-mui-core-D_bnq77o.js";import{u as b}from"./vendor-ux-did-connect-DHrruicZ.js";import{C as T}from"./click-to-copy-CFiGx48J.js";import{C as k}from"./confirm-DjTZImyg.js";function c({title:l,description:m,confirmPlaceholder:d,cancel:p,confirm:u,params:f,onCancel:C,onConfirm:y,keyName:t}){const{t:a}=b(),i={title:()=>e.jsx(r,{children:l}),description:(s,x)=>{const h=o=>{x({...o,__disableConfirm:o.__disableConfirm})};return e.jsxs(r,{children:[e.jsx(j,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),e.jsx(r,{sx:{my:3,b:{wordBreak:"break-word"}},dangerouslySetInnerHTML:{__html:m}}),e.jsxs(r,{style:{marginBottom:24},children:[a("common.click"),":",e.jsx(T,{"data-cy":"click-copy",children:t})]}),e.jsx(g,{component:"div",children:e.jsx(_,{label:d,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:s.inputVal,onChange:o=>{h({...s,inputVal:o.target.value,__disableConfirm:t!==o.target.value})}})})]})},confirm:u,cancel:p,onConfirm:y,onCancel:C,params:{inputVal:"",__disableConfirm:!0,...f}};return e.jsx(k,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})}c.propTypes={title:n.any.isRequired,keyName:n.any.isRequired,description:n.any.isRequired,confirmPlaceholder:n.any.isRequired,cancel:n.string,confirm:n.string,params:n.object,onCancel:n.func,onConfirm:n.func.isRequired};c.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}};export{c as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,ap as p,H as r}from"./vendor-mui-core-
|
|
1
|
+
import{j as s,ap as p,H as r}from"./vendor-mui-core-D_bnq77o.js";import{L as d}from"./vendor-react-DEoibe3W.js";import{Y as f}from"./vendor-ux-did-connect-DHrruicZ.js";function o({did:a,href:t,external:n,avatarProps:l,...i}){const e=s.jsx(f,{did:a,...i});return t?n?s.jsx(p,{target:"_blank",href:t,underline:"hover",children:e}):s.jsx(d,{to:t,children:e}):e}o.propTypes={did:r.string.isRequired,to:r.string,href:r.string,avatarProps:r.object,external:r.bool};o.defaultProps={to:"",href:"",avatarProps:{},external:!1};export{o as W};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as We,aB as At,ay as He,aq as Pt,u as I,am as It,_ as L,B as J,b4 as Ve,r as Ge,a0 as Tt,bj as Ke,by as kt,ap as Et,C as Le}from"./vendor-ux-did-connect-TEE6cGq6.js";import{j as e,ca as Qe,aa as h,ab as F,T as A,ak as pe,e as G,v as ee,ad as _,b4 as Xe,H as i,q as Ye,b5 as qt,b6 as Lt,a9 as Ze,bL as _t,bX as $t,ah as Mt,al as H,w as Je,ap as Ft,cb as Bt,cc as zt,cd as Nt,ce as _e,cf as O,cg as Ut,O as Ot,m as Wt}from"./vendor-mui-core-UZpb7wT7.js";import{A as Z,z as Ht,b as Vt,e as Gt,K as fe,au as Kt,av as Qt,n as $e}from"./vendor-utils-rHXShPKm.js";import{r as b,a as et,g as Xt}from"./vendor-react-DEoibe3W.js";import{d as Yt}from"./ExpandLess-CJXkgMMr.js";import{c as Me,l as Zt,r as Jt,Q as en,V as tn,M as nn}from"./vendor-arcblock-CN2B_oTr.js";import{aj as sn,ak as tt,z as M,C as xe,b as on,I as Fe,al as rn,U as an,K as ln,am as nt,ai as le,an as it,ao as cn,f as st,ap as dn}from"./index-u-w3iMC9.js";import{w as ot}from"./permission-BkNXA8B5.js";import{_ as un,D as Be}from"./dot-C05enzim.js";import{C as he}from"./confirm-BvUfAlkx.js";import{A as mn}from"./actions-BCWb2ez1.js";import{D as pn}from"./delete-confirm-BBaXcAXg.js";import{d as fn,a as xn,g as hn,p as ze}from"./util-RWes6RwK.js";import{_ as te}from"./useSetState-CWq0AVWn.js";import{d as gn}from"./InfoOutlined-Dy7jTc7H.js";import{_ as Dn}from"./useAsync-DV3NyLhI.js";import{f as rt}from"./format-error-BrmqJs5a.js";import{I as yn}from"./index-C0SLCehH.js";import{C as jn}from"./click-to-copy-BxhgzyYL.js";import{w as bn,m as vn,u as Y,s as Cn,y as wn}from"./vendor-hooks-rDgu5KV9.js";import{d as Rn}from"./CheckCircle-Dvhgeo9j.js";const Sn=We({});Sn.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=Z("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=At()),n},n=>Promise.reject(n));const at=(...n)=>We(...n),An=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,Pn=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const o=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,d=[`left=${o}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",r,d.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Ht(n,{opener:window.location.origin}),l},In="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",lt=async n=>{var m;if(!n||!(n!=null&&n.trim()))return null;const t=at(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),o=(m=r==null?void 0:r.componentMountPoints)==null?void 0:m.find(f=>f.did===In),a=new URL(n);a.pathname=o==null?void 0:o.mountPoint;const d=a.toString(),l=Z(d,"/api");return{base:d,api:l}},Tn=He({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"}}}),kn=He({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),En={zh:kn,en:Tn},qn=async({didDomainURL:n,delegatee:t,delegateePk:s})=>{const r=await lt(n);if(!r)return null;const o=at({baseURL:r.api}),{data:a}=await o.post("/payment/session",{delegatee:t,delegateePk:s});return{sessionId:a.sessionId,baseURL:r.base}};function ct({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:o,onSuccess:a,...d}){const{t:l}=I(),[m,f]=bn({currentState:1}),p=b.useRef(null),g=vn(async()=>{const c=await qn({didDomainURL:s,delegatee:n,delegateePk:t});return c},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(c){console.error(c)}}),y=Y(c=>{var D,v,w,E;c.data.type==="didDomain.success"&&(a==null||a({nftDid:(D=c.data)==null?void 0:D.nftDid,domain:(v=c.data)==null?void 0:v.domain,chainHost:(w=c.data)==null?void 0:w.chainHost}),(E=p.current)==null||E.close(),p.current=null,f({currentState:4}),setTimeout(()=>{f({currentState:8})},2e3))});Cn(()=>{var c;try{window.removeEventListener("message",y),(c=p.current)==null||c.close(),p.current=null}catch(D){console.warn("Failed to close popup",D)}});const u=Y(()=>{f({currentState:1})}),j=Y(()=>{if(f({currentState:2}),!g.data){console.error("Failed to create session");return}x({sessionId:g.data.sessionId,baseURL:g.data.baseURL})}),x=Y(({sessionId:c,baseURL:D})=>{window.addEventListener("message",y);const v=new URL(D);v.searchParams.set("sessionId",c),v.searchParams.set("locale",r),v.searchParams.set("embed","1"),p.current=Pn(v.toString());const w=setInterval(()=>{var E;(E=p.current)!=null&&E.closed&&(clearInterval(w),u())},1e3);return()=>clearInterval(w)});return e.jsxs(e.Fragment,{children:[e.jsx(Qe,{loading:g.loading,onClick:j,variant:"contained",startIcon:e.jsx(fn,{}),...d,children:o||l("buy.button.title")}),e.jsxs(It,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:u,children:[!g.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(F,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(A,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(A,{children:l("buy.status.success")})]}),g.error&&e.jsx(pe,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}const dt={onSuccess:()=>{},title:""};ct.defaultProps=dt;function ut(n){return e.jsx(Pt,{locale:n.locale,translations:En,children:e.jsx(ct,{...n})})}ut.defaultProps=dt;function mt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:o}=I(),[a,d]=te({safeIframeRef:null,popoverAnchorEl:null}),l=b.useRef(null),m=G(),f=ee(m.breakpoints.down("md")),p=j=>{d({popoverAnchorEl:j.currentTarget})},g=()=>{d({popoverAnchorEl:null})},y=wn(async()=>{const j=await lt(t);return j?j.base:null});if(!y.value)return null;if(y.loading)return e.jsx(F,{});const u=Z(y.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:o("embed.iconTip"),children:e.jsx(h,{component:"img",src:Z(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:p,sx:An({cursor:"pointer"},r)})}),e.jsx(Xe,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:o("common.subscription"),width:f?"320px":"400px",height:"350px",style:{border:0},src:u})})]})}mt.defaultProps={sx:{}};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var S,P;const{t}=I(),[s,r]=b.useState(!1),{inService:o}=M(),[a,d]=b.useState(null),{siteId:l,domain:m,onAdd:f,children:p,did:g,issuing:y,setIssuing:u}=n,{api:j,ws:{useSubscription:x}}=M(),{mode:c,actions:{refreshDomainStatus:D}}=xe(),v=un(async()=>{const{cert:R}=await j.findCertificateByDomain({input:{domain:m,did:g}});return R}),w=(R,K)=>{R.domain===m&&(u(!1),r(!1),o&&c!=="setup"&&(K==="success"?L.success(t("setup.domain.genCertSuccess",{domain:R.domain})):K==="error"&&L.error(t("setup.domain.genCertFailed",{domain:R.domain,message:R.message}))))};if(b.useEffect(()=>{var R;v.loading||u(Ln((R=v.value)==null?void 0:R.status))},[v.loading,(S=v.value)==null?void 0:S.status,u]),x(Me.BlockletEvents.certError,R=>w(R,"error")),x(Me.BlockletEvents.certIssued,R=>{v.retry(),D(R.domain),w(R,"success")}),v.loading||((P=v.value)==null?void 0:P.status)==="normal")return"";const E=()=>{r(!1),d(null)},$=async()=>{r(!0);try{await j.issueLetsEncryptCert({input:{siteId:l,domain:m,did:g,inBlockletSetup:c==="setup"}}),f(),u(!0)}catch(R){console.error(R),u(!1)}finally{r(!1),d(null)}},B={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(pe,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:$,onCancel:E},oe=R=>{R.stopPropagation(),d(B)};return e.jsxs(e.Fragment,{children:[y?e.jsx(_,{title:t("router.cert.issuing"),children:e.jsx(F,{size:13,style:{fontSize:"13px"}})}):p({loading:s,open:oe}),a&&e.jsx(he,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ge.propTypes={domain:i.string.isRequired,did:i.string.isRequired,siteId:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};ge.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function De(n){const{domain:t,domainStatus:s,...r}=n;return sn(t)||!tt(t)||Vt(s)||s!=null&&s.isHttps?"":e.jsx(ge,{domain:t,...r})}De.propTypes={domain:i.string.isRequired,domainStatus:i.shape({isHttps:i.bool}).isRequired,did:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};De.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function ye(n){const{t}=I(),[s,r]=b.useState(!1),[o,a]=b.useState(null),{id:d,domain:l,children:m,teamDid:f,onDelete:p}=n,{api:g}=M(),y=()=>{r(!1),a(null)},u=async()=>{r(!0);try{await g.deleteDomainAlias({input:{id:d,domainAlias:l,teamDid:f}}),p==null||p(),await on(2e3)}catch(c){L.error(c.message)}finally{a(null),r(!1)}},j={keyName:l,title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description",{domain:l}),confirmPlaceholder:t("router.domainAlias.delete.confirmPlaceholder",{domain:l}),confirm:t("common.delete"),onConfirm:u,onCancel:y},x=c=>{c.stopPropagation(),a(j)};return e.jsxs(e.Fragment,{children:[typeof m=="function"?m({loading:s,open:x}):e.jsxs(J,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(F,{size:16}):e.jsx(Ve,{style:{fontSize:16}}),t("common.delete")]}),o&&e.jsx(pn,{keyName:o.keyName,title:o.title,description:o.description,confirmPlaceholder:o.confirmPlaceholder,confirm:o.confirm,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}ye.propTypes={id:i.string.isRequired,domain:i.string.isRequired,children:i.any,teamDid:i.string,onDelete:i.func};ye.defaultProps={children:null,teamDid:"",onDelete:null};function je({site:n,domain:t,blocklet:s,onDelete:r}){const{t:o}=I(),a=t.value===window.location.hostname;return e.jsx(mn,{"data-cy":"domain-actions",size:"large",actions:[({close:d})=>{var l;return e.jsx(ye,{id:n.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,onDelete:r,children:({open:m})=>e.jsx(_,{title:a?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ye,{disabled:t.isProtected||a,dense:!0,onClick:f=>{d(),m(f)},"data-cy":"action-toggle-block",children:[e.jsx(qt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ve,{})}),e.jsx(Lt,{primary:o("common.delete")})]},"remove")})})})}]})}je.propTypes={site:i.object.isRequired,domain:i.object.isRequired,blocklet:i.object.isRequired,onDelete:i.func};je.defaultProps={onDelete:()=>{}};var be={},_n=Ze;Object.defineProperty(be,"__esModule",{value:!0});var pt=be.default=void 0,$n=_n(Ge()),Mn=e;pt=be.default=(0,$n.default)((0,Mn.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip");const ne=i.shape({href:i.string,accessibility:i.shape({loading:i.bool,accessible:i.bool}),domainStatus:i.shape({isHttps:i.bool,matchedCert:i.object}),dns:i.shape({resolved:i.bool,ip:i.string})});function ve({certificate:n}){const[t,s]=b.useState(null),r=M(),{t:o,locale:a}=I(),d=f=>{s(f.currentTarget)},l=()=>{s(null)},m=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(xn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:d,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(Xe,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(_t,{children:e.jsxs($t,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${r.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(A,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(A,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(A,{component:"div",children:`${o("common.issuer")}: ${Gt(n,"issuer.commonName","")}`}),e.jsx(A,{component:"div",children:`${o("router.cert.issuedOn")}: ${Fe(n.validFrom,a)}`}),e.jsx(A,{component:"div",children:`${o("router.cert.expiryOn")}: ${Fe(n.validTo,a)}`})]})]})})})]})}ve.propTypes={certificate:i.object};ve.defaultProps={certificate:{}};function V({domain:n,filters:t}){const{t:s}=I(),{value:r,domainStatus:o}=n;if(!tt(r))return null;let a=null,d=null;const{isHttps:l,matchedCert:m}=o;if(!rn(r)){const{dns:{ip:p,isDnsResolved:g,isCnameMatch:y}={}}=o;g&&y||p==="127.0.0.1"?a=e.jsx(_,{title:s("router.domain.verify.ok"),children:e.jsx(Be,{color:"success"})}):a=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(Be,{color:"error"})})}l?d=e.jsx(ve,{certificate:m}):d=e.jsx(_,{title:s("router.domain.https.bad"),children:e.jsx(pt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const f=t.map(p=>p==="domain"?a:p==="http"?d:null);return b.createElement(b.Fragment,null,...f)}V.propTypes={domain:ne.isRequired,filters:i.array};V.defaultProps={filters:["domain","http"]};const Fn=ot(ie,"mutate_blocklets"),Bn=ot(ie,"",an);function Pi(n){const{inService:t}=M(),{blocklet:s,loadingRuntimeInfo:r}=xe();let o=Fn;return t&&(o=Bn),e.jsx(o,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}const Ne="nft-domain";function ie({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,showAllDomains:o,updateBlockletDomainAliases:a,systemTips:d}){var c;const{t:l}=I(),m=ee(D=>D.breakpoints.down("md")),f=b.useMemo(()=>{let D=n;return ln(t)&&(D=D&&r),D},[n,r,t]),{site:p}=t,g=b.useMemo(()=>{var D;return nt((D=t.site)==null?void 0:D.domainAliases)},[(c=t.site)==null?void 0:c.domainAliases]),y=b.useMemo(()=>g.filter(D=>!le.isCustomDomain(D.value)),[g]),u=b.useMemo(()=>g.filter(D=>le.isCustomDomain(D.value)),[g]),j=b.useMemo(()=>u.filter(D=>D.type!==Ne),[u]),x=b.useMemo(()=>u.filter(D=>D.type===Ne),[u]);return e.jsxs(e.Fragment,{children:[e.jsxs(H,{gap:3,children:[!!x.length&&e.jsx(W,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:x,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!j.length&&e.jsx(W,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:j,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!y.length&&e.jsxs(h,{children:[d,e.jsx(W,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:y,hasMutatePermission:f,blocklet:t,site:p,mobile:m,updateBlockletDomainAliases:a})]})]}),!g.length&&(s?e.jsx(F,{size:16}):e.jsx(Tt,{children:l("common.empty")}))]})}ie.propTypes={hasPermission:i.bool,blocklet:i.object.isRequired,loadingRuntimeInfo:i.bool,inService:i.bool.isRequired,showAllDomains:i.bool,updateBlockletDomainAliases:i.func,systemTips:i.node};ie.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,showAllDomains:!1,updateBlockletDomainAliases:()=>{},systemTips:null};function ce({domain:n,children:t,...s}){const{t:r,locale:o}=I(),a=G(),{href:d,accessibility:l,value:m}=n,f=b.useCallback(()=>e.jsx(Ke,{content:fe(m),locale:o,style:{marginLeft:"4px",color:a.palette.text.secondary,fontSize:"0.8em"}}),[m,o,a]);return!l||l.loading?e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),f(),e.jsx(_,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(F,{size:13,style:{fontSize:"13px"}})})})]}):l.accessible?e.jsxs(ae,{component:"span",...s,children:[e.jsx(h,{component:"a",href:d,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})})}),f()]}):e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),!n.loading&&f()]})}ce.propTypes={domain:ne.isRequired,children:i.any.isRequired};const ae=Mt(h)`
|
|
1
|
+
import{aj as We,aB as At,ay as He,aq as Pt,u as I,am as It,_ as L,B as J,b4 as Ve,r as Ge,a0 as Tt,bi as Ke,bx as kt,ap as Et,C as Le}from"./vendor-ux-did-connect-DHrruicZ.js";import{j as e,ca as Qe,aa as h,ab as F,T as A,ak as pe,e as G,v as ee,ad as _,b4 as Xe,H as i,q as Ye,b5 as qt,b6 as Lt,a9 as Ze,bL as _t,bX as $t,ah as Mt,al as H,w as Je,ap as Ft,cb as Bt,cc as zt,cd as Nt,ce as _e,cf as O,cg as Ut,O as Ot,m as Wt}from"./vendor-mui-core-D_bnq77o.js";import{A as Z,z as Ht,b as Vt,e as Gt,K as fe,au as Kt,av as Qt,n as $e}from"./vendor-utils-rHXShPKm.js";import{r as b,a as et,g as Xt}from"./vendor-react-DEoibe3W.js";import{d as Yt}from"./ExpandLess-CkoEHpgk.js";import{c as Me,j as Zt,r as Jt,Q as en,V as tn,M as nn}from"./vendor-arcblock-uz9DVywv.js";import{ah as sn,ai as tt,z as M,C as xe,b as on,G as Fe,aj as rn,R as an,I as ln,ak as nt,ag as le,al as it,am as cn,f as st,an as dn}from"./index-DefO2n6z.js";import{w as ot}from"./permission-BH1TY_tz.js";import{_ as un,D as Be}from"./dot-C4hULxc0.js";import{C as he}from"./confirm-DjTZImyg.js";import{A as mn}from"./actions-BjTeIzgS.js";import{D as pn}from"./delete-confirm-BzuBR6TW.js";import{d as fn,a as xn,g as hn,p as ze}from"./util-MKllNgBs.js";import{_ as te}from"./useSetState-CWq0AVWn.js";import{d as gn}from"./InfoOutlined-DkG0jjos.js";import{u as Dn}from"./useAsync-C8ydfEEr.js";import{f as rt}from"./format-error-BrmqJs5a.js";import{I as yn}from"./index-enM9Y412.js";import{C as jn}from"./click-to-copy-CFiGx48J.js";import{w as bn,m as vn,u as Y,s as Cn,y as wn}from"./vendor-hooks-rDgu5KV9.js";import{d as Rn}from"./CheckCircle-Ds4QI0ey.js";const Sn=We({});Sn.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=Z("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=At()),n},n=>Promise.reject(n));const at=(...n)=>We(...n),An=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,Pn=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const o=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,d=[`left=${o}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",r,d.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Ht(n,{opener:window.location.origin}),l},In="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",lt=async n=>{var m;if(!n||!(n!=null&&n.trim()))return null;const t=at(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),o=(m=r==null?void 0:r.componentMountPoints)==null?void 0:m.find(f=>f.did===In),a=new URL(n);a.pathname=o==null?void 0:o.mountPoint;const d=a.toString(),l=Z(d,"/api");return{base:d,api:l}},Tn=He({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"}}}),kn=He({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),En={zh:kn,en:Tn},qn=async({didDomainURL:n,delegatee:t,delegateePk:s})=>{const r=await lt(n);if(!r)return null;const o=at({baseURL:r.api}),{data:a}=await o.post("/payment/session",{delegatee:t,delegateePk:s});return{sessionId:a.sessionId,baseURL:r.base}};function ct({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:o,onSuccess:a,...d}){const{t:l}=I(),[m,f]=bn({currentState:1}),p=b.useRef(null),g=vn(async()=>{const c=await qn({didDomainURL:s,delegatee:n,delegateePk:t});return c},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(c){console.error(c)}}),y=Y(c=>{var D,v,w,E;c.data.type==="didDomain.success"&&(a==null||a({nftDid:(D=c.data)==null?void 0:D.nftDid,domain:(v=c.data)==null?void 0:v.domain,chainHost:(w=c.data)==null?void 0:w.chainHost}),(E=p.current)==null||E.close(),p.current=null,f({currentState:4}),setTimeout(()=>{f({currentState:8})},2e3))});Cn(()=>{var c;try{window.removeEventListener("message",y),(c=p.current)==null||c.close(),p.current=null}catch(D){console.warn("Failed to close popup",D)}});const u=Y(()=>{f({currentState:1})}),j=Y(()=>{if(f({currentState:2}),!g.data){console.error("Failed to create session");return}x({sessionId:g.data.sessionId,baseURL:g.data.baseURL})}),x=Y(({sessionId:c,baseURL:D})=>{window.addEventListener("message",y);const v=new URL(D);v.searchParams.set("sessionId",c),v.searchParams.set("locale",r),v.searchParams.set("embed","1"),p.current=Pn(v.toString());const w=setInterval(()=>{var E;(E=p.current)!=null&&E.closed&&(clearInterval(w),u())},1e3);return()=>clearInterval(w)});return e.jsxs(e.Fragment,{children:[e.jsx(Qe,{loading:g.loading,onClick:j,variant:"contained",startIcon:e.jsx(fn,{}),...d,children:o||l("buy.button.title")}),e.jsxs(It,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:u,children:[!g.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(F,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(A,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(A,{children:l("buy.status.success")})]}),g.error&&e.jsx(pe,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}const dt={onSuccess:()=>{},title:""};ct.defaultProps=dt;function ut(n){return e.jsx(Pt,{locale:n.locale,translations:En,children:e.jsx(ct,{...n})})}ut.defaultProps=dt;function mt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:o}=I(),[a,d]=te({safeIframeRef:null,popoverAnchorEl:null}),l=b.useRef(null),m=G(),f=ee(m.breakpoints.down("md")),p=j=>{d({popoverAnchorEl:j.currentTarget})},g=()=>{d({popoverAnchorEl:null})},y=wn(async()=>{const j=await lt(t);return j?j.base:null});if(!y.value)return null;if(y.loading)return e.jsx(F,{});const u=Z(y.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:o("embed.iconTip"),children:e.jsx(h,{component:"img",src:Z(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:p,sx:An({cursor:"pointer"},r)})}),e.jsx(Xe,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:o("common.subscription"),width:f?"320px":"400px",height:"350px",style:{border:0},src:u})})]})}mt.defaultProps={sx:{}};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var S,P;const{t}=I(),[s,r]=b.useState(!1),{inService:o}=M(),[a,d]=b.useState(null),{siteId:l,domain:m,onAdd:f,children:p,did:g,issuing:y,setIssuing:u}=n,{api:j,ws:{useSubscription:x}}=M(),{mode:c,actions:{refreshDomainStatus:D}}=xe(),v=un(async()=>{const{cert:R}=await j.findCertificateByDomain({input:{domain:m,did:g}});return R}),w=(R,K)=>{R.domain===m&&(u(!1),r(!1),o&&c!=="setup"&&(K==="success"?L.success(t("setup.domain.genCertSuccess",{domain:R.domain})):K==="error"&&L.error(t("setup.domain.genCertFailed",{domain:R.domain,message:R.message}))))};if(b.useEffect(()=>{var R;v.loading||u(Ln((R=v.value)==null?void 0:R.status))},[v.loading,(S=v.value)==null?void 0:S.status,u]),x(Me.BlockletEvents.certError,R=>w(R,"error")),x(Me.BlockletEvents.certIssued,R=>{v.retry(),D(R.domain),w(R,"success")}),v.loading||((P=v.value)==null?void 0:P.status)==="normal")return"";const E=()=>{r(!1),d(null)},$=async()=>{r(!0);try{await j.issueLetsEncryptCert({input:{siteId:l,domain:m,did:g,inBlockletSetup:c==="setup"}}),f(),u(!0)}catch(R){console.error(R),u(!1)}finally{r(!1),d(null)}},B={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(pe,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:$,onCancel:E},oe=R=>{R.stopPropagation(),d(B)};return e.jsxs(e.Fragment,{children:[y?e.jsx(_,{title:t("router.cert.issuing"),children:e.jsx(F,{size:13,style:{fontSize:"13px"}})}):p({loading:s,open:oe}),a&&e.jsx(he,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ge.propTypes={domain:i.string.isRequired,did:i.string.isRequired,siteId:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};ge.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function De(n){const{domain:t,domainStatus:s,...r}=n;return sn(t)||!tt(t)||Vt(s)||s!=null&&s.isHttps?"":e.jsx(ge,{domain:t,...r})}De.propTypes={domain:i.string.isRequired,domainStatus:i.shape({isHttps:i.bool}).isRequired,did:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};De.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function ye(n){const{t}=I(),[s,r]=b.useState(!1),[o,a]=b.useState(null),{id:d,domain:l,children:m,teamDid:f,onDelete:p}=n,{api:g}=M(),y=()=>{r(!1),a(null)},u=async()=>{r(!0);try{await g.deleteDomainAlias({input:{id:d,domainAlias:l,teamDid:f}}),p==null||p(),await on(2e3)}catch(c){L.error(c.message)}finally{a(null),r(!1)}},j={keyName:l,title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description",{domain:l}),confirmPlaceholder:t("router.domainAlias.delete.confirmPlaceholder",{domain:l}),confirm:t("common.delete"),onConfirm:u,onCancel:y},x=c=>{c.stopPropagation(),a(j)};return e.jsxs(e.Fragment,{children:[typeof m=="function"?m({loading:s,open:x}):e.jsxs(J,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(F,{size:16}):e.jsx(Ve,{style:{fontSize:16}}),t("common.delete")]}),o&&e.jsx(pn,{keyName:o.keyName,title:o.title,description:o.description,confirmPlaceholder:o.confirmPlaceholder,confirm:o.confirm,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}ye.propTypes={id:i.string.isRequired,domain:i.string.isRequired,children:i.any,teamDid:i.string,onDelete:i.func};ye.defaultProps={children:null,teamDid:"",onDelete:null};function je({site:n,domain:t,blocklet:s,onDelete:r}){const{t:o}=I(),a=t.value===window.location.hostname;return e.jsx(mn,{"data-cy":"domain-actions",size:"large",actions:[({close:d})=>{var l;return e.jsx(ye,{id:n.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,onDelete:r,children:({open:m})=>e.jsx(_,{title:a?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ye,{disabled:t.isProtected||a,dense:!0,onClick:f=>{d(),m(f)},"data-cy":"action-toggle-block",children:[e.jsx(qt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ve,{})}),e.jsx(Lt,{primary:o("common.delete")})]},"remove")})})})}]})}je.propTypes={site:i.object.isRequired,domain:i.object.isRequired,blocklet:i.object.isRequired,onDelete:i.func};je.defaultProps={onDelete:()=>{}};var be={},_n=Ze;Object.defineProperty(be,"__esModule",{value:!0});var pt=be.default=void 0,$n=_n(Ge()),Mn=e;pt=be.default=(0,$n.default)((0,Mn.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip");const ne=i.shape({href:i.string,accessibility:i.shape({loading:i.bool,accessible:i.bool}),domainStatus:i.shape({isHttps:i.bool,matchedCert:i.object}),dns:i.shape({resolved:i.bool,ip:i.string})});function ve({certificate:n}){const[t,s]=b.useState(null),r=M(),{t:o,locale:a}=I(),d=f=>{s(f.currentTarget)},l=()=>{s(null)},m=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(xn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:d,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(Xe,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(_t,{children:e.jsxs($t,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${r.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(A,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(A,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(A,{component:"div",children:`${o("common.issuer")}: ${Gt(n,"issuer.commonName","")}`}),e.jsx(A,{component:"div",children:`${o("router.cert.issuedOn")}: ${Fe(n.validFrom,a)}`}),e.jsx(A,{component:"div",children:`${o("router.cert.expiryOn")}: ${Fe(n.validTo,a)}`})]})]})})})]})}ve.propTypes={certificate:i.object};ve.defaultProps={certificate:{}};function V({domain:n,filters:t}){const{t:s}=I(),{value:r,domainStatus:o}=n;if(!tt(r))return null;let a=null,d=null;const{isHttps:l,matchedCert:m}=o;if(!rn(r)){const{dns:{ip:p,isDnsResolved:g,isCnameMatch:y}={}}=o;g&&y||p==="127.0.0.1"?a=e.jsx(_,{title:s("router.domain.verify.ok"),children:e.jsx(Be,{color:"success"})}):a=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(Be,{color:"error"})})}l?d=e.jsx(ve,{certificate:m}):d=e.jsx(_,{title:s("router.domain.https.bad"),children:e.jsx(pt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const f=t.map(p=>p==="domain"?a:p==="http"?d:null);return b.createElement(b.Fragment,null,...f)}V.propTypes={domain:ne.isRequired,filters:i.array};V.defaultProps={filters:["domain","http"]};const Fn=ot(ie,"mutate_blocklets"),Bn=ot(ie,"",an);function Pi(n){const{inService:t}=M(),{blocklet:s,loadingRuntimeInfo:r}=xe();let o=Fn;return t&&(o=Bn),e.jsx(o,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}const Ne="nft-domain";function ie({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,showAllDomains:o,updateBlockletDomainAliases:a,systemTips:d}){var c;const{t:l}=I(),m=ee(D=>D.breakpoints.down("md")),f=b.useMemo(()=>{let D=n;return ln(t)&&(D=D&&r),D},[n,r,t]),{site:p}=t,g=b.useMemo(()=>{var D;return nt((D=t.site)==null?void 0:D.domainAliases)},[(c=t.site)==null?void 0:c.domainAliases]),y=b.useMemo(()=>g.filter(D=>!le.isCustomDomain(D.value)),[g]),u=b.useMemo(()=>g.filter(D=>le.isCustomDomain(D.value)),[g]),j=b.useMemo(()=>u.filter(D=>D.type!==Ne),[u]),x=b.useMemo(()=>u.filter(D=>D.type===Ne),[u]);return e.jsxs(e.Fragment,{children:[e.jsxs(H,{gap:3,children:[!!x.length&&e.jsx(W,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:x,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!j.length&&e.jsx(W,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:j,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!y.length&&e.jsxs(h,{children:[d,e.jsx(W,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:y,hasMutatePermission:f,blocklet:t,site:p,mobile:m,updateBlockletDomainAliases:a})]})]}),!g.length&&(s?e.jsx(F,{size:16}):e.jsx(Tt,{children:l("common.empty")}))]})}ie.propTypes={hasPermission:i.bool,blocklet:i.object.isRequired,loadingRuntimeInfo:i.bool,inService:i.bool.isRequired,showAllDomains:i.bool,updateBlockletDomainAliases:i.func,systemTips:i.node};ie.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,showAllDomains:!1,updateBlockletDomainAliases:()=>{},systemTips:null};function ce({domain:n,children:t,...s}){const{t:r,locale:o}=I(),a=G(),{href:d,accessibility:l,value:m}=n,f=b.useCallback(()=>e.jsx(Ke,{content:fe(m),locale:o,style:{marginLeft:"4px",color:a.palette.text.secondary,fontSize:"0.8em"}}),[m,o,a]);return!l||l.loading?e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),f(),e.jsx(_,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(F,{size:13,style:{fontSize:"13px"}})})})]}):l.accessible?e.jsxs(ae,{component:"span",...s,children:[e.jsx(h,{component:"a",href:d,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})})}),f()]}):e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),!n.loading&&f()]})}ce.propTypes={domain:ne.isRequired,children:i.any.isRequired};const ae=Mt(h)`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as o,aa as e,H as h,ah as v}from"./vendor-mui-core-D_bnq77o.js";import{n as C,f as k,ag as b,d as B}from"./index-DefO2n6z.js";import{D as w,a as I,b as E}from"./domain-action-card-Bcs_GWxq.js";import{b2 as T}from"./vendor-ux-did-connect-DHrruicZ.js";import{P as A}from"./page-header-xyZktwBS.js";import{r}from"./vendor-react-DEoibe3W.js";import{_ as L}from"./useSetState-CWq0AVWn.js";import{S as x}from"./button-D8hoY4xw.js";import{S as W}from"./layout-D93HKT6w.js";import{S as H}from"./step-actions-CeJCmiCS.js";import"./vendor-arcblock-uz9DVywv.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";import"./ExpandLess-CkoEHpgk.js";import"./permission-BH1TY_tz.js";import"./session-CHdTc1We.js";import"./dot-C4hULxc0.js";import"./useAsync-CMWsznMW.js";import"./confirm-DjTZImyg.js";import"./format-error-BrmqJs5a.js";import"./actions-BjTeIzgS.js";import"./MoreHoriz-B6KdR0Y8.js";import"./delete-confirm-BzuBR6TW.js";import"./click-to-copy-CFiGx48J.js";import"./util-MKllNgBs.js";import"./InfoOutlined-DkG0jjos.js";import"./useAsync-C8ydfEEr.js";import"./index-enM9Y412.js";import"./CheckCircle-Ds4QI0ey.js";import"./content-layout-BzF-fNQz.js";import"./use-mobile-DyX6Fl8Z.js";function d({onNext:s,onPrevious:D}){var u,f;const{t:n}=r.useContext(T),[S,p]=r.useState(!1),{blocklet:i}=C(),[l,j]=r.useState(""),y=(((i==null?void 0:i.site)||{}).domainAliases||[]).map(t=>k.replaceSlotToIp(t.value,l)),[a,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=(f=(u=i.environments)==null?void 0:u.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:f.value,P=y.find(t=>b.isDidDomain(t));return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{j(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(_,{children:[o.jsx(e,{className:"header",children:o.jsx(A,{title:n("setup.domain.title"),subTitle:n("setup.domain.subTitle"),onClickBack:D})}),o.jsxs(e,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(e,{children:[o.jsx(e,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o.jsx(e,{display:"inline",children:`${n("setup.domain.buyOrConnect")} (${n("common.optional")})`})}),o.jsx(e,{mt:1,children:o.jsx(I,{blocklet:i,bugDidDomainProps:{appPk:c,appId:i.appPid,siteId:i.site.id,teamDid:i.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:i.appPid,siteId:i.site.id,teamDid:i.meta.did,cnameDomain:P,currentIp:l,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),p(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const g={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};m(g),s()},onError:p}})})]}),o.jsx(e,{children:o.jsx(E,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(e,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1,children:o.jsx(e,{display:"inline",children:n("setup.domain.skipDescription")})})})})]}),o.jsx(H,{mt:8,disabled:!!a.addDomainState.text,blocklet:i,onStartNow:()=>s("complete"),children:a.domain?o.jsx(x,{variant:"contained",loading:!!a.addDomainState.text,disabled:S||!!a.addDomainState.text||!a.domain,onClick:()=>s(),children:a.addDomainState.text||n("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!a.addDomainState.text,onClick:()=>s(),children:n("setup.continue")})})]})}function Dt(s){return o.jsx(w,{children:o.jsx(d,{...s})})}d.propTypes={onNext:h.func,onPrevious:h.func};d.defaultProps={onNext:()=>{},onPrevious:()=>{}};const _=v(W)`
|
|
2
|
+
height: 100%;
|
|
3
|
+
overflow-y: hidden;
|
|
4
|
+
|
|
5
|
+
.form {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
`;export{Dt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as m}from"./vendor-react-DEoibe3W.js";import{u as n}from"./vendor-ux-did-connect-DHrruicZ.js";import{C as p,z as l,I as c,f as u}from"./index-DefO2n6z.js";import{a as x,b as d}from"./domain-action-card-Bcs_GWxq.js";import{j as t,aa as k,al as f,ak as h}from"./vendor-mui-core-D_bnq77o.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-uz9DVywv.js";import"./ExpandLess-CkoEHpgk.js";import"./permission-BH1TY_tz.js";import"./session-CHdTc1We.js";import"./dot-C4hULxc0.js";import"./useAsync-CMWsznMW.js";import"./confirm-DjTZImyg.js";import"./format-error-BrmqJs5a.js";import"./actions-BjTeIzgS.js";import"./MoreHoriz-B6KdR0Y8.js";import"./delete-confirm-BzuBR6TW.js";import"./click-to-copy-CFiGx48J.js";import"./util-MKllNgBs.js";import"./useSetState-CWq0AVWn.js";import"./InfoOutlined-DkG0jjos.js";import"./useAsync-C8ydfEEr.js";import"./index-enM9Y412.js";import"./CheckCircle-Ds4QI0ey.js";function D(){const{blocklet:o,actions:{updateBlockletDomainAliases:s}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let i=!0;return c(o)&&(i=i&&r),i},[r,o]);return t.jsxs(k,{component:f,sx:{maxWidth:820},gap:3,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:s,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:s})]})}D.propTypes={};export{D as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{x as m}from"./vendor-hooks-rDgu5KV9.js";import{r as v}from"./vendor-react-DEoibe3W.js";import{r as y}from"./useAsync-CMWsznMW.js";import{ah as p}from"./vendor-mui-core-D_bnq77o.js";var c={};Object.defineProperty(c,"__esModule",{value:!0});var e=m,i=v,b=e.__importDefault(y()),A=function(r,t){t===void 0&&(t=[]);var a=i.useState(0),l=a[0],_=a[1],s=b.default(r,e.__spreadArrays(t,[l])),o=s.loading,d=i.useCallback(function(){o||_(function(f){return f+1})},e.__spreadArrays(t,[o]));return e.__assign(e.__assign({},s),{retry:d})},D=c.default=A;const n={success:"#3ab39d",error:"#D0021B"},u="10px",k=p.div`
|
|
2
|
+
display: inline-block;
|
|
3
|
+
min-width: ${r=>r.size||u};
|
|
4
|
+
min-height: ${r=>r.size||u};
|
|
5
|
+
background-color: ${r=>n[r.color]||r.color||n.success};
|
|
6
|
+
border-radius: 100%;
|
|
7
|
+
`;export{k as D,D as _};
|